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

// SendMessageActionClassArray is adapter for slice of SendMessageActionClass.
type SendMessageActionClassArray []SendMessageActionClass

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// AsSendMessageUploadVideoAction returns copy with only SendMessageUploadVideoAction constructors.
func ( SendMessageActionClassArray) () ( SendMessageUploadVideoActionArray) {
	for ,  := range  {
		,  := .(*SendMessageUploadVideoAction)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsSendMessageUploadAudioAction returns copy with only SendMessageUploadAudioAction constructors.
func ( SendMessageActionClassArray) () ( SendMessageUploadAudioActionArray) {
	for ,  := range  {
		,  := .(*SendMessageUploadAudioAction)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsSendMessageUploadPhotoAction returns copy with only SendMessageUploadPhotoAction constructors.
func ( SendMessageActionClassArray) () ( SendMessageUploadPhotoActionArray) {
	for ,  := range  {
		,  := .(*SendMessageUploadPhotoAction)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsSendMessageUploadDocumentAction returns copy with only SendMessageUploadDocumentAction constructors.
func ( SendMessageActionClassArray) () ( SendMessageUploadDocumentActionArray) {
	for ,  := range  {
		,  := .(*SendMessageUploadDocumentAction)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsSendMessageUploadRoundAction returns copy with only SendMessageUploadRoundAction constructors.
func ( SendMessageActionClassArray) () ( SendMessageUploadRoundActionArray) {
	for ,  := range  {
		,  := .(*SendMessageUploadRoundAction)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsSendMessageHistoryImportAction returns copy with only SendMessageHistoryImportAction constructors.
func ( SendMessageActionClassArray) () ( SendMessageHistoryImportActionArray) {
	for ,  := range  {
		,  := .(*SendMessageHistoryImportAction)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsSendMessageEmojiInteraction returns copy with only SendMessageEmojiInteraction constructors.
func ( SendMessageActionClassArray) () ( SendMessageEmojiInteractionArray) {
	for ,  := range  {
		,  := .(*SendMessageEmojiInteraction)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsSendMessageEmojiInteractionSeen returns copy with only SendMessageEmojiInteractionSeen constructors.
func ( SendMessageActionClassArray) () ( SendMessageEmojiInteractionSeenArray) {
	for ,  := range  {
		,  := .(*SendMessageEmojiInteractionSeen)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// SendMessageUploadVideoActionArray is adapter for slice of SendMessageUploadVideoAction.
type SendMessageUploadVideoActionArray []SendMessageUploadVideoAction

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// SendMessageUploadAudioActionArray is adapter for slice of SendMessageUploadAudioAction.
type SendMessageUploadAudioActionArray []SendMessageUploadAudioAction

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// SendMessageUploadPhotoActionArray is adapter for slice of SendMessageUploadPhotoAction.
type SendMessageUploadPhotoActionArray []SendMessageUploadPhotoAction

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// SendMessageUploadDocumentActionArray is adapter for slice of SendMessageUploadDocumentAction.
type SendMessageUploadDocumentActionArray []SendMessageUploadDocumentAction

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// SendMessageUploadRoundActionArray is adapter for slice of SendMessageUploadRoundAction.
type SendMessageUploadRoundActionArray []SendMessageUploadRoundAction

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// SendMessageHistoryImportActionArray is adapter for slice of SendMessageHistoryImportAction.
type SendMessageHistoryImportActionArray []SendMessageHistoryImportAction

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// SendMessageEmojiInteractionArray is adapter for slice of SendMessageEmojiInteraction.
type SendMessageEmojiInteractionArray []SendMessageEmojiInteraction

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// SendMessageEmojiInteractionSeenArray is adapter for slice of SendMessageEmojiInteractionSeen.
type SendMessageEmojiInteractionSeenArray []SendMessageEmojiInteractionSeen

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}