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

// MessagesSentEncryptedMessageClassArray is adapter for slice of MessagesSentEncryptedMessageClass.
type MessagesSentEncryptedMessageClassArray []MessagesSentEncryptedMessageClass

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// SortByDate sorts slice of MessagesSentEncryptedMessageClass by Date.
func ( MessagesSentEncryptedMessageClassArray) () MessagesSentEncryptedMessageClassArray {
	return .Sort(func(,  MessagesSentEncryptedMessageClass) bool {
		return .GetDate() < .GetDate()
	})
}

// SortStableByDate sorts slice of MessagesSentEncryptedMessageClass by Date.
func ( MessagesSentEncryptedMessageClassArray) () MessagesSentEncryptedMessageClassArray {
	return .SortStable(func(,  MessagesSentEncryptedMessageClass) bool {
		return .GetDate() < .GetDate()
	})
}

// AsMessagesSentEncryptedMessage returns copy with only MessagesSentEncryptedMessage constructors.
func ( MessagesSentEncryptedMessageClassArray) () ( MessagesSentEncryptedMessageArray) {
	for ,  := range  {
		,  := .(*MessagesSentEncryptedMessage)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsMessagesSentEncryptedFile returns copy with only MessagesSentEncryptedFile constructors.
func ( MessagesSentEncryptedMessageClassArray) () ( MessagesSentEncryptedFileArray) {
	for ,  := range  {
		,  := .(*MessagesSentEncryptedFile)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// MessagesSentEncryptedMessageArray is adapter for slice of MessagesSentEncryptedMessage.
type MessagesSentEncryptedMessageArray []MessagesSentEncryptedMessage

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// SortByDate sorts slice of MessagesSentEncryptedMessage by Date.
func ( MessagesSentEncryptedMessageArray) () MessagesSentEncryptedMessageArray {
	return .Sort(func(,  MessagesSentEncryptedMessage) bool {
		return .GetDate() < .GetDate()
	})
}

// SortStableByDate sorts slice of MessagesSentEncryptedMessage by Date.
func ( MessagesSentEncryptedMessageArray) () MessagesSentEncryptedMessageArray {
	return .SortStable(func(,  MessagesSentEncryptedMessage) bool {
		return .GetDate() < .GetDate()
	})
}

// MessagesSentEncryptedFileArray is adapter for slice of MessagesSentEncryptedFile.
type MessagesSentEncryptedFileArray []MessagesSentEncryptedFile

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// SortByDate sorts slice of MessagesSentEncryptedFile by Date.
func ( MessagesSentEncryptedFileArray) () MessagesSentEncryptedFileArray {
	return .Sort(func(,  MessagesSentEncryptedFile) bool {
		return .GetDate() < .GetDate()
	})
}

// SortStableByDate sorts slice of MessagesSentEncryptedFile by Date.
func ( MessagesSentEncryptedFileArray) () MessagesSentEncryptedFileArray {
	return .SortStable(func(,  MessagesSentEncryptedFile) bool {
		return .GetDate() < .GetDate()
	})
}