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

// WebPageAttributeClassArray is adapter for slice of WebPageAttributeClass.
type WebPageAttributeClassArray []WebPageAttributeClass

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// AsWebPageAttributeTheme returns copy with only WebPageAttributeTheme constructors.
func ( WebPageAttributeClassArray) () ( WebPageAttributeThemeArray) {
	for ,  := range  {
		,  := .(*WebPageAttributeTheme)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsWebPageAttributeStory returns copy with only WebPageAttributeStory constructors.
func ( WebPageAttributeClassArray) () ( WebPageAttributeStoryArray) {
	for ,  := range  {
		,  := .(*WebPageAttributeStory)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// WebPageAttributeThemeArray is adapter for slice of WebPageAttributeTheme.
type WebPageAttributeThemeArray []WebPageAttributeTheme

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// WebPageAttributeStoryArray is adapter for slice of WebPageAttributeStory.
type WebPageAttributeStoryArray []WebPageAttributeStory

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

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

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

// FillMap fills constructors to given map.
func ( WebPageAttributeStoryArray) ( map[int]WebPageAttributeStory) {
	for ,  := range  {
		[.GetID()] = 
	}
}

// ToMap collects constructors to map.
func ( WebPageAttributeStoryArray) () map[int]WebPageAttributeStory {
	 := make(map[int]WebPageAttributeStory, len())
	.FillMap()
	return 
}