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

// HelpAppUpdateClassArray is adapter for slice of HelpAppUpdateClass.
type HelpAppUpdateClassArray []HelpAppUpdateClass

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// AsHelpAppUpdate returns copy with only HelpAppUpdate constructors.
func ( HelpAppUpdateClassArray) () ( HelpAppUpdateArray) {
	for ,  := range  {
		,  := .(*HelpAppUpdate)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// HelpAppUpdateArray is adapter for slice of HelpAppUpdate.
type HelpAppUpdateArray []HelpAppUpdate

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

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

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

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

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