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

// UploadCDNFileClassArray is adapter for slice of UploadCDNFileClass.
type UploadCDNFileClassArray []UploadCDNFileClass

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// AsUploadCDNFileReuploadNeeded returns copy with only UploadCDNFileReuploadNeeded constructors.
func ( UploadCDNFileClassArray) () ( UploadCDNFileReuploadNeededArray) {
	for ,  := range  {
		,  := .(*UploadCDNFileReuploadNeeded)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsUploadCDNFile returns copy with only UploadCDNFile constructors.
func ( UploadCDNFileClassArray) () ( UploadCDNFileArray) {
	for ,  := range  {
		,  := .(*UploadCDNFile)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// UploadCDNFileReuploadNeededArray is adapter for slice of UploadCDNFileReuploadNeeded.
type UploadCDNFileReuploadNeededArray []UploadCDNFileReuploadNeeded

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// UploadCDNFileArray is adapter for slice of UploadCDNFile.
type UploadCDNFileArray []UploadCDNFile

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}