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

// InputBotInlineMessageIDClassArray is adapter for slice of InputBotInlineMessageIDClass.
type InputBotInlineMessageIDClassArray []InputBotInlineMessageIDClass

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// AsInputBotInlineMessageID returns copy with only InputBotInlineMessageID constructors.
func ( InputBotInlineMessageIDClassArray) () ( InputBotInlineMessageIDArray) {
	for ,  := range  {
		,  := .(*InputBotInlineMessageID)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsInputBotInlineMessageID64 returns copy with only InputBotInlineMessageID64 constructors.
func ( InputBotInlineMessageIDClassArray) () ( InputBotInlineMessageID64Array) {
	for ,  := range  {
		,  := .(*InputBotInlineMessageID64)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// InputBotInlineMessageIDArray is adapter for slice of InputBotInlineMessageID.
type InputBotInlineMessageIDArray []InputBotInlineMessageID

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

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

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

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

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

// InputBotInlineMessageID64Array is adapter for slice of InputBotInlineMessageID64.
type InputBotInlineMessageID64Array []InputBotInlineMessageID64

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

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

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

// FillMap fills constructors to given map.
func ( InputBotInlineMessageID64Array) ( map[int]InputBotInlineMessageID64) {
	for ,  := range  {
		[.GetID()] = 
	}
}

// ToMap collects constructors to map.
func ( InputBotInlineMessageID64Array) () map[int]InputBotInlineMessageID64 {
	 := make(map[int]InputBotInlineMessageID64, len())
	.FillMap()
	return 
}