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

// InputFileClassArray is adapter for slice of InputFileClass.
type InputFileClassArray []InputFileClass

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

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

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

// FillInputFileMap fills only InputFile constructors to given map.
func ( InputFileClassArray) ( map[int64]*InputFile) {
	for ,  := range  {
		,  := .(*InputFile)
		if ! {
			continue
		}
		[.GetID()] = 
	}
}

// InputFileToMap collects only InputFile constructors to map.
func ( InputFileClassArray) () map[int64]*InputFile {
	 := make(map[int64]*InputFile, len())
	.FillInputFileMap()
	return 
}

// AsInputFile returns copy with only InputFile constructors.
func ( InputFileClassArray) () ( InputFileArray) {
	for ,  := range  {
		,  := .(*InputFile)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// FillInputFileBigMap fills only InputFileBig constructors to given map.
func ( InputFileClassArray) ( map[int64]*InputFileBig) {
	for ,  := range  {
		,  := .(*InputFileBig)
		if ! {
			continue
		}
		[.GetID()] = 
	}
}

// InputFileBigToMap collects only InputFileBig constructors to map.
func ( InputFileClassArray) () map[int64]*InputFileBig {
	 := make(map[int64]*InputFileBig, len())
	.FillInputFileBigMap()
	return 
}

// AsInputFileBig returns copy with only InputFileBig constructors.
func ( InputFileClassArray) () ( InputFileBigArray) {
	for ,  := range  {
		,  := .(*InputFileBig)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// InputFileArray is adapter for slice of InputFile.
type InputFileArray []InputFile

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

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

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

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

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

// InputFileBigArray is adapter for slice of InputFileBig.
type InputFileBigArray []InputFileBig

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

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

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

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

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