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

// ChatFullClassArray is adapter for slice of ChatFullClass.
type ChatFullClassArray []ChatFullClass

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

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

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

// FillChatFullMap fills only ChatFull constructors to given map.
func ( ChatFullClassArray) ( map[int64]*ChatFull) {
	for ,  := range  {
		,  := .(*ChatFull)
		if ! {
			continue
		}
		[.GetID()] = 
	}
}

// ChatFullToMap collects only ChatFull constructors to map.
func ( ChatFullClassArray) () map[int64]*ChatFull {
	 := make(map[int64]*ChatFull, len())
	.FillChatFullMap()
	return 
}

// AsChatFull returns copy with only ChatFull constructors.
func ( ChatFullClassArray) () ( ChatFullArray) {
	for ,  := range  {
		,  := .(*ChatFull)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// FillChannelFullMap fills only ChannelFull constructors to given map.
func ( ChatFullClassArray) ( map[int64]*ChannelFull) {
	for ,  := range  {
		,  := .(*ChannelFull)
		if ! {
			continue
		}
		[.GetID()] = 
	}
}

// ChannelFullToMap collects only ChannelFull constructors to map.
func ( ChatFullClassArray) () map[int64]*ChannelFull {
	 := make(map[int64]*ChannelFull, len())
	.FillChannelFullMap()
	return 
}

// AsChannelFull returns copy with only ChannelFull constructors.
func ( ChatFullClassArray) () ( ChannelFullArray) {
	for ,  := range  {
		,  := .(*ChannelFull)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// ChatFullArray is adapter for slice of ChatFull.
type ChatFullArray []ChatFull

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

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

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

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

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

// ChannelFullArray is adapter for slice of ChannelFull.
type ChannelFullArray []ChannelFull

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

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

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

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

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