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

// RequestPeerTypeClassArray is adapter for slice of RequestPeerTypeClass.
type RequestPeerTypeClassArray []RequestPeerTypeClass

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// AsRequestPeerTypeUser returns copy with only RequestPeerTypeUser constructors.
func ( RequestPeerTypeClassArray) () ( RequestPeerTypeUserArray) {
	for ,  := range  {
		,  := .(*RequestPeerTypeUser)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsRequestPeerTypeChat returns copy with only RequestPeerTypeChat constructors.
func ( RequestPeerTypeClassArray) () ( RequestPeerTypeChatArray) {
	for ,  := range  {
		,  := .(*RequestPeerTypeChat)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsRequestPeerTypeBroadcast returns copy with only RequestPeerTypeBroadcast constructors.
func ( RequestPeerTypeClassArray) () ( RequestPeerTypeBroadcastArray) {
	for ,  := range  {
		,  := .(*RequestPeerTypeBroadcast)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// RequestPeerTypeUserArray is adapter for slice of RequestPeerTypeUser.
type RequestPeerTypeUserArray []RequestPeerTypeUser

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// RequestPeerTypeChatArray is adapter for slice of RequestPeerTypeChat.
type RequestPeerTypeChatArray []RequestPeerTypeChat

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// RequestPeerTypeBroadcastArray is adapter for slice of RequestPeerTypeBroadcast.
type RequestPeerTypeBroadcastArray []RequestPeerTypeBroadcast

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}