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

// ChannelParticipantClassArray is adapter for slice of ChannelParticipantClass.
type ChannelParticipantClassArray []ChannelParticipantClass

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// AsChannelParticipant returns copy with only ChannelParticipant constructors.
func ( ChannelParticipantClassArray) () ( ChannelParticipantArray) {
	for ,  := range  {
		,  := .(*ChannelParticipant)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsChannelParticipantSelf returns copy with only ChannelParticipantSelf constructors.
func ( ChannelParticipantClassArray) () ( ChannelParticipantSelfArray) {
	for ,  := range  {
		,  := .(*ChannelParticipantSelf)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsChannelParticipantCreator returns copy with only ChannelParticipantCreator constructors.
func ( ChannelParticipantClassArray) () ( ChannelParticipantCreatorArray) {
	for ,  := range  {
		,  := .(*ChannelParticipantCreator)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsChannelParticipantAdmin returns copy with only ChannelParticipantAdmin constructors.
func ( ChannelParticipantClassArray) () ( ChannelParticipantAdminArray) {
	for ,  := range  {
		,  := .(*ChannelParticipantAdmin)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsChannelParticipantBanned returns copy with only ChannelParticipantBanned constructors.
func ( ChannelParticipantClassArray) () ( ChannelParticipantBannedArray) {
	for ,  := range  {
		,  := .(*ChannelParticipantBanned)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsChannelParticipantLeft returns copy with only ChannelParticipantLeft constructors.
func ( ChannelParticipantClassArray) () ( ChannelParticipantLeftArray) {
	for ,  := range  {
		,  := .(*ChannelParticipantLeft)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// ChannelParticipantArray is adapter for slice of ChannelParticipant.
type ChannelParticipantArray []ChannelParticipant

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

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

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

// ChannelParticipantSelfArray is adapter for slice of ChannelParticipantSelf.
type ChannelParticipantSelfArray []ChannelParticipantSelf

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

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

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

// ChannelParticipantCreatorArray is adapter for slice of ChannelParticipantCreator.
type ChannelParticipantCreatorArray []ChannelParticipantCreator

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// ChannelParticipantAdminArray is adapter for slice of ChannelParticipantAdmin.
type ChannelParticipantAdminArray []ChannelParticipantAdmin

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

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

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

// ChannelParticipantBannedArray is adapter for slice of ChannelParticipantBanned.
type ChannelParticipantBannedArray []ChannelParticipantBanned

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

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

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

// ChannelParticipantLeftArray is adapter for slice of ChannelParticipantLeft.
type ChannelParticipantLeftArray []ChannelParticipantLeft

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}