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

// WebPageClassArray is adapter for slice of WebPageClass.
type WebPageClassArray []WebPageClass

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// AsWebPageEmpty returns copy with only WebPageEmpty constructors.
func ( WebPageClassArray) () ( WebPageEmptyArray) {
	for ,  := range  {
		,  := .(*WebPageEmpty)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsWebPagePending returns copy with only WebPagePending constructors.
func ( WebPageClassArray) () ( WebPagePendingArray) {
	for ,  := range  {
		,  := .(*WebPagePending)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsWebPage returns copy with only WebPage constructors.
func ( WebPageClassArray) () ( WebPageArray) {
	for ,  := range  {
		,  := .(*WebPage)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsWebPageNotModified returns copy with only WebPageNotModified constructors.
func ( WebPageClassArray) () ( WebPageNotModifiedArray) {
	for ,  := range  {
		,  := .(*WebPageNotModified)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// FillModifiedMap fills only Modified constructors to given map.
func ( WebPageClassArray) ( map[int64]ModifiedWebPage) {
	for ,  := range  {
		,  := .AsModified()
		if ! {
			continue
		}
		[.GetID()] = 
	}
}

// ModifiedToMap collects only Modified constructors to map.
func ( WebPageClassArray) () map[int64]ModifiedWebPage {
	 := make(map[int64]ModifiedWebPage, len())
	.FillModifiedMap()
	return 
}

// AppendOnlyModified appends only Modified constructors to
// given slice.
func ( WebPageClassArray) ( []ModifiedWebPage) []ModifiedWebPage {
	for ,  := range  {
		,  := .AsModified()
		if ! {
			continue
		}
		 = append(, )
	}

	return 
}

// AsModified returns copy with only Modified constructors.
func ( WebPageClassArray) () ( []ModifiedWebPage) {
	return .AppendOnlyModified()
}

// FirstAsModified returns first element of slice (if exists).
func ( WebPageClassArray) () ( ModifiedWebPage,  bool) {
	,  := .First()
	if ! {
		return
	}
	return .AsModified()
}

// LastAsModified returns last element of slice (if exists).
func ( WebPageClassArray) () ( ModifiedWebPage,  bool) {
	,  := .Last()
	if ! {
		return
	}
	return .AsModified()
}

// PopFirstAsModified returns element of slice (if exists).
func ( *WebPageClassArray) () ( ModifiedWebPage,  bool) {
	,  := .PopFirst()
	if ! {
		return
	}
	return .AsModified()
}

// PopAsModified returns element of slice (if exists).
func ( *WebPageClassArray) () ( ModifiedWebPage,  bool) {
	,  := .Pop()
	if ! {
		return
	}
	return .AsModified()
}

// WebPageEmptyArray is adapter for slice of WebPageEmpty.
type WebPageEmptyArray []WebPageEmpty

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

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

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

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

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

// WebPagePendingArray is adapter for slice of WebPagePending.
type WebPagePendingArray []WebPagePending

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

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

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

// SortByDate sorts slice of WebPagePending by Date.
func ( WebPagePendingArray) () WebPagePendingArray {
	return .Sort(func(,  WebPagePending) bool {
		return .GetDate() < .GetDate()
	})
}

// SortStableByDate sorts slice of WebPagePending by Date.
func ( WebPagePendingArray) () WebPagePendingArray {
	return .SortStable(func(,  WebPagePending) bool {
		return .GetDate() < .GetDate()
	})
}

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

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

// WebPageArray is adapter for slice of WebPage.
type WebPageArray []WebPage

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

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

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

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

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

// WebPageNotModifiedArray is adapter for slice of WebPageNotModified.
type WebPageNotModifiedArray []WebPageNotModified

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}