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

// ChatInviteClassArray is adapter for slice of ChatInviteClass.
type ChatInviteClassArray []ChatInviteClass

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// AsChatInviteAlready returns copy with only ChatInviteAlready constructors.
func ( ChatInviteClassArray) () ( ChatInviteAlreadyArray) {
	for ,  := range  {
		,  := .(*ChatInviteAlready)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsChatInvite returns copy with only ChatInvite constructors.
func ( ChatInviteClassArray) () ( ChatInviteArray) {
	for ,  := range  {
		,  := .(*ChatInvite)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsChatInvitePeek returns copy with only ChatInvitePeek constructors.
func ( ChatInviteClassArray) () ( ChatInvitePeekArray) {
	for ,  := range  {
		,  := .(*ChatInvitePeek)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// ChatInviteAlreadyArray is adapter for slice of ChatInviteAlready.
type ChatInviteAlreadyArray []ChatInviteAlready

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// ChatInviteArray is adapter for slice of ChatInvite.
type ChatInviteArray []ChatInvite

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// ChatInvitePeekArray is adapter for slice of ChatInvitePeek.
type ChatInvitePeekArray []ChatInvitePeek

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}