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

// InputSecureFileClassArray is adapter for slice of InputSecureFileClass.
type InputSecureFileClassArray []InputSecureFileClass

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

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

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

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

// InputSecureFileUploadedToMap collects only InputSecureFileUploaded constructors to map.
func ( InputSecureFileClassArray) () map[int64]*InputSecureFileUploaded {
	 := make(map[int64]*InputSecureFileUploaded, len())
	.FillInputSecureFileUploadedMap()
	return 
}

// AsInputSecureFileUploaded returns copy with only InputSecureFileUploaded constructors.
func ( InputSecureFileClassArray) () ( InputSecureFileUploadedArray) {
	for ,  := range  {
		,  := .(*InputSecureFileUploaded)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

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

// InputSecureFileToMap collects only InputSecureFile constructors to map.
func ( InputSecureFileClassArray) () map[int64]*InputSecureFile {
	 := make(map[int64]*InputSecureFile, len())
	.FillInputSecureFileMap()
	return 
}

// AsInputSecureFile returns copy with only InputSecureFile constructors.
func ( InputSecureFileClassArray) () ( InputSecureFileArray) {
	for ,  := range  {
		,  := .(*InputSecureFile)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// InputSecureFileUploadedArray is adapter for slice of InputSecureFileUploaded.
type InputSecureFileUploadedArray []InputSecureFileUploaded

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

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

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

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

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

// InputSecureFileArray is adapter for slice of InputSecureFile.
type InputSecureFileArray []InputSecureFile

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

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

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

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

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