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

// InputStickerSetClassArray is adapter for slice of InputStickerSetClass.
type InputStickerSetClassArray []InputStickerSetClass

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// AsInputStickerSetID returns copy with only InputStickerSetID constructors.
func ( InputStickerSetClassArray) () ( InputStickerSetIDArray) {
	for ,  := range  {
		,  := .(*InputStickerSetID)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsInputStickerSetShortName returns copy with only InputStickerSetShortName constructors.
func ( InputStickerSetClassArray) () ( InputStickerSetShortNameArray) {
	for ,  := range  {
		,  := .(*InputStickerSetShortName)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsInputStickerSetDice returns copy with only InputStickerSetDice constructors.
func ( InputStickerSetClassArray) () ( InputStickerSetDiceArray) {
	for ,  := range  {
		,  := .(*InputStickerSetDice)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// InputStickerSetIDArray is adapter for slice of InputStickerSetID.
type InputStickerSetIDArray []InputStickerSetID

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

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

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

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

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

// InputStickerSetShortNameArray is adapter for slice of InputStickerSetShortName.
type InputStickerSetShortNameArray []InputStickerSetShortName

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// InputStickerSetDiceArray is adapter for slice of InputStickerSetDice.
type InputStickerSetDiceArray []InputStickerSetDice

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}