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

// MessagesMessagesClassArray is adapter for slice of MessagesMessagesClass.
type MessagesMessagesClassArray []MessagesMessagesClass

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// AsMessagesMessages returns copy with only MessagesMessages constructors.
func ( MessagesMessagesClassArray) () ( MessagesMessagesArray) {
	for ,  := range  {
		,  := .(*MessagesMessages)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsMessagesMessagesSlice returns copy with only MessagesMessagesSlice constructors.
func ( MessagesMessagesClassArray) () ( MessagesMessagesSliceArray) {
	for ,  := range  {
		,  := .(*MessagesMessagesSlice)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsMessagesChannelMessages returns copy with only MessagesChannelMessages constructors.
func ( MessagesMessagesClassArray) () ( MessagesChannelMessagesArray) {
	for ,  := range  {
		,  := .(*MessagesChannelMessages)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsMessagesMessagesNotModified returns copy with only MessagesMessagesNotModified constructors.
func ( MessagesMessagesClassArray) () ( MessagesMessagesNotModifiedArray) {
	for ,  := range  {
		,  := .(*MessagesMessagesNotModified)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AppendOnlyModified appends only Modified constructors to
// given slice.
func ( MessagesMessagesClassArray) ( []ModifiedMessagesMessages) []ModifiedMessagesMessages {
	for ,  := range  {
		,  := .AsModified()
		if ! {
			continue
		}
		 = append(, )
	}

	return 
}

// AsModified returns copy with only Modified constructors.
func ( MessagesMessagesClassArray) () ( []ModifiedMessagesMessages) {
	return .AppendOnlyModified()
}

// FirstAsModified returns first element of slice (if exists).
func ( MessagesMessagesClassArray) () ( ModifiedMessagesMessages,  bool) {
	,  := .First()
	if ! {
		return
	}
	return .AsModified()
}

// LastAsModified returns last element of slice (if exists).
func ( MessagesMessagesClassArray) () ( ModifiedMessagesMessages,  bool) {
	,  := .Last()
	if ! {
		return
	}
	return .AsModified()
}

// PopFirstAsModified returns element of slice (if exists).
func ( *MessagesMessagesClassArray) () ( ModifiedMessagesMessages,  bool) {
	,  := .PopFirst()
	if ! {
		return
	}
	return .AsModified()
}

// PopAsModified returns element of slice (if exists).
func ( *MessagesMessagesClassArray) () ( ModifiedMessagesMessages,  bool) {
	,  := .Pop()
	if ! {
		return
	}
	return .AsModified()
}

// MessagesMessagesArray is adapter for slice of MessagesMessages.
type MessagesMessagesArray []MessagesMessages

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// MessagesMessagesSliceArray is adapter for slice of MessagesMessagesSlice.
type MessagesMessagesSliceArray []MessagesMessagesSlice

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// MessagesChannelMessagesArray is adapter for slice of MessagesChannelMessages.
type MessagesChannelMessagesArray []MessagesChannelMessages

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// MessagesMessagesNotModifiedArray is adapter for slice of MessagesMessagesNotModified.
type MessagesMessagesNotModifiedArray []MessagesMessagesNotModified

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}