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

// MessagesDialogsClassArray is adapter for slice of MessagesDialogsClass.
type MessagesDialogsClassArray []MessagesDialogsClass

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// AsMessagesDialogs returns copy with only MessagesDialogs constructors.
func ( MessagesDialogsClassArray) () ( MessagesDialogsArray) {
	for ,  := range  {
		,  := .(*MessagesDialogs)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsMessagesDialogsSlice returns copy with only MessagesDialogsSlice constructors.
func ( MessagesDialogsClassArray) () ( MessagesDialogsSliceArray) {
	for ,  := range  {
		,  := .(*MessagesDialogsSlice)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsMessagesDialogsNotModified returns copy with only MessagesDialogsNotModified constructors.
func ( MessagesDialogsClassArray) () ( MessagesDialogsNotModifiedArray) {
	for ,  := range  {
		,  := .(*MessagesDialogsNotModified)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

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

	return 
}

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

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

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

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

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

// MessagesDialogsArray is adapter for slice of MessagesDialogs.
type MessagesDialogsArray []MessagesDialogs

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// MessagesDialogsSliceArray is adapter for slice of MessagesDialogsSlice.
type MessagesDialogsSliceArray []MessagesDialogsSlice

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// MessagesDialogsNotModifiedArray is adapter for slice of MessagesDialogsNotModified.
type MessagesDialogsNotModifiedArray []MessagesDialogsNotModified

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}