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

// InputCollectibleClassArray is adapter for slice of InputCollectibleClass.
type InputCollectibleClassArray []InputCollectibleClass

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// AsInputCollectibleUsername returns copy with only InputCollectibleUsername constructors.
func ( InputCollectibleClassArray) () ( InputCollectibleUsernameArray) {
	for ,  := range  {
		,  := .(*InputCollectibleUsername)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsInputCollectiblePhone returns copy with only InputCollectiblePhone constructors.
func ( InputCollectibleClassArray) () ( InputCollectiblePhoneArray) {
	for ,  := range  {
		,  := .(*InputCollectiblePhone)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// InputCollectibleUsernameArray is adapter for slice of InputCollectibleUsername.
type InputCollectibleUsernameArray []InputCollectibleUsername

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// InputCollectiblePhoneArray is adapter for slice of InputCollectiblePhone.
type InputCollectiblePhoneArray []InputCollectiblePhone

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}