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

// MessagesStickerSetClassArray is adapter for slice of MessagesStickerSetClass.
type MessagesStickerSetClassArray []MessagesStickerSetClass

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// AsMessagesStickerSet returns copy with only MessagesStickerSet constructors.
func ( MessagesStickerSetClassArray) () ( MessagesStickerSetArray) {
	for ,  := range  {
		,  := .(*MessagesStickerSet)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

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

	return 
}

// AsModified returns copy with only Modified constructors.
func ( MessagesStickerSetClassArray) () ( []*MessagesStickerSet) {
	return .AppendOnlyModified()
}

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

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

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

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

// MessagesStickerSetArray is adapter for slice of MessagesStickerSet.
type MessagesStickerSetArray []MessagesStickerSet

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}