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

// InputEncryptedFileClassArray is adapter for slice of InputEncryptedFileClass.
type InputEncryptedFileClassArray []InputEncryptedFileClass

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// AsInputEncryptedFileUploaded returns copy with only InputEncryptedFileUploaded constructors.
func ( InputEncryptedFileClassArray) () ( InputEncryptedFileUploadedArray) {
	for ,  := range  {
		,  := .(*InputEncryptedFileUploaded)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsInputEncryptedFile returns copy with only InputEncryptedFile constructors.
func ( InputEncryptedFileClassArray) () ( InputEncryptedFileArray) {
	for ,  := range  {
		,  := .(*InputEncryptedFile)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsInputEncryptedFileBigUploaded returns copy with only InputEncryptedFileBigUploaded constructors.
func ( InputEncryptedFileClassArray) () ( InputEncryptedFileBigUploadedArray) {
	for ,  := range  {
		,  := .(*InputEncryptedFileBigUploaded)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// FillNotEmptyMap fills only NotEmpty constructors to given map.
func ( InputEncryptedFileClassArray) ( map[int64]NotEmptyInputEncryptedFile) {
	for ,  := range  {
		,  := .AsNotEmpty()
		if ! {
			continue
		}
		[.GetID()] = 
	}
}

// NotEmptyToMap collects only NotEmpty constructors to map.
func ( InputEncryptedFileClassArray) () map[int64]NotEmptyInputEncryptedFile {
	 := make(map[int64]NotEmptyInputEncryptedFile, len())
	.FillNotEmptyMap()
	return 
}

// AppendOnlyNotEmpty appends only NotEmpty constructors to
// given slice.
func ( InputEncryptedFileClassArray) ( []NotEmptyInputEncryptedFile) []NotEmptyInputEncryptedFile {
	for ,  := range  {
		,  := .AsNotEmpty()
		if ! {
			continue
		}
		 = append(, )
	}

	return 
}

// AsNotEmpty returns copy with only NotEmpty constructors.
func ( InputEncryptedFileClassArray) () ( []NotEmptyInputEncryptedFile) {
	return .AppendOnlyNotEmpty()
}

// FirstAsNotEmpty returns first element of slice (if exists).
func ( InputEncryptedFileClassArray) () ( NotEmptyInputEncryptedFile,  bool) {
	,  := .First()
	if ! {
		return
	}
	return .AsNotEmpty()
}

// LastAsNotEmpty returns last element of slice (if exists).
func ( InputEncryptedFileClassArray) () ( NotEmptyInputEncryptedFile,  bool) {
	,  := .Last()
	if ! {
		return
	}
	return .AsNotEmpty()
}

// PopFirstAsNotEmpty returns element of slice (if exists).
func ( *InputEncryptedFileClassArray) () ( NotEmptyInputEncryptedFile,  bool) {
	,  := .PopFirst()
	if ! {
		return
	}
	return .AsNotEmpty()
}

// PopAsNotEmpty returns element of slice (if exists).
func ( *InputEncryptedFileClassArray) () ( NotEmptyInputEncryptedFile,  bool) {
	,  := .Pop()
	if ! {
		return
	}
	return .AsNotEmpty()
}

// InputEncryptedFileUploadedArray is adapter for slice of InputEncryptedFileUploaded.
type InputEncryptedFileUploadedArray []InputEncryptedFileUploaded

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

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

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

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

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

// InputEncryptedFileArray is adapter for slice of InputEncryptedFile.
type InputEncryptedFileArray []InputEncryptedFile

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

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

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

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

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

// InputEncryptedFileBigUploadedArray is adapter for slice of InputEncryptedFileBigUploaded.
type InputEncryptedFileBigUploadedArray []InputEncryptedFileBigUploaded

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

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

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

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

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