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

// UploadFileClassArray is adapter for slice of UploadFileClass.
type UploadFileClassArray []UploadFileClass

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// AsUploadFile returns copy with only UploadFile constructors.
func ( UploadFileClassArray) () ( UploadFileArray) {
	for ,  := range  {
		,  := .(*UploadFile)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsUploadFileCDNRedirect returns copy with only UploadFileCDNRedirect constructors.
func ( UploadFileClassArray) () ( UploadFileCDNRedirectArray) {
	for ,  := range  {
		,  := .(*UploadFileCDNRedirect)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// UploadFileArray is adapter for slice of UploadFile.
type UploadFileArray []UploadFile

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// UploadFileCDNRedirectArray is adapter for slice of UploadFileCDNRedirect.
type UploadFileCDNRedirectArray []UploadFileCDNRedirect

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}