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

// InputWallPaperClassArray is adapter for slice of InputWallPaperClass.
type InputWallPaperClassArray []InputWallPaperClass

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// AsInputWallPaper returns copy with only InputWallPaper constructors.
func ( InputWallPaperClassArray) () ( InputWallPaperArray) {
	for ,  := range  {
		,  := .(*InputWallPaper)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsInputWallPaperSlug returns copy with only InputWallPaperSlug constructors.
func ( InputWallPaperClassArray) () ( InputWallPaperSlugArray) {
	for ,  := range  {
		,  := .(*InputWallPaperSlug)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsInputWallPaperNoFile returns copy with only InputWallPaperNoFile constructors.
func ( InputWallPaperClassArray) () ( InputWallPaperNoFileArray) {
	for ,  := range  {
		,  := .(*InputWallPaperNoFile)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// InputWallPaperArray is adapter for slice of InputWallPaper.
type InputWallPaperArray []InputWallPaper

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

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

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

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

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

// InputWallPaperSlugArray is adapter for slice of InputWallPaperSlug.
type InputWallPaperSlugArray []InputWallPaperSlug

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// InputWallPaperNoFileArray is adapter for slice of InputWallPaperNoFile.
type InputWallPaperNoFileArray []InputWallPaperNoFile

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

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

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

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

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