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

// InputGroupCallClassArray is adapter for slice of InputGroupCallClass.
type InputGroupCallClassArray []InputGroupCallClass

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// AsInputGroupCall returns copy with only InputGroupCall constructors.
func ( InputGroupCallClassArray) () ( InputGroupCallArray) {
	for ,  := range  {
		,  := .(*InputGroupCall)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsInputGroupCallSlug returns copy with only InputGroupCallSlug constructors.
func ( InputGroupCallClassArray) () ( InputGroupCallSlugArray) {
	for ,  := range  {
		,  := .(*InputGroupCallSlug)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsInputGroupCallInviteMessage returns copy with only InputGroupCallInviteMessage constructors.
func ( InputGroupCallClassArray) () ( InputGroupCallInviteMessageArray) {
	for ,  := range  {
		,  := .(*InputGroupCallInviteMessage)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// InputGroupCallArray is adapter for slice of InputGroupCall.
type InputGroupCallArray []InputGroupCall

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

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

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

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

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

// InputGroupCallSlugArray is adapter for slice of InputGroupCallSlug.
type InputGroupCallSlugArray []InputGroupCallSlug

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// InputGroupCallInviteMessageArray is adapter for slice of InputGroupCallInviteMessage.
type InputGroupCallInviteMessageArray []InputGroupCallInviteMessage

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}