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

// EncryptedChatClassArray is adapter for slice of EncryptedChatClass.
type EncryptedChatClassArray []EncryptedChatClass

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

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

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

// FillEncryptedChatEmptyMap fills only EncryptedChatEmpty constructors to given map.
func ( EncryptedChatClassArray) ( map[int]*EncryptedChatEmpty) {
	for ,  := range  {
		,  := .(*EncryptedChatEmpty)
		if ! {
			continue
		}
		[.GetID()] = 
	}
}

// EncryptedChatEmptyToMap collects only EncryptedChatEmpty constructors to map.
func ( EncryptedChatClassArray) () map[int]*EncryptedChatEmpty {
	 := make(map[int]*EncryptedChatEmpty, len())
	.FillEncryptedChatEmptyMap()
	return 
}

// AsEncryptedChatEmpty returns copy with only EncryptedChatEmpty constructors.
func ( EncryptedChatClassArray) () ( EncryptedChatEmptyArray) {
	for ,  := range  {
		,  := .(*EncryptedChatEmpty)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// FillEncryptedChatWaitingMap fills only EncryptedChatWaiting constructors to given map.
func ( EncryptedChatClassArray) ( map[int]*EncryptedChatWaiting) {
	for ,  := range  {
		,  := .(*EncryptedChatWaiting)
		if ! {
			continue
		}
		[.GetID()] = 
	}
}

// EncryptedChatWaitingToMap collects only EncryptedChatWaiting constructors to map.
func ( EncryptedChatClassArray) () map[int]*EncryptedChatWaiting {
	 := make(map[int]*EncryptedChatWaiting, len())
	.FillEncryptedChatWaitingMap()
	return 
}

// AsEncryptedChatWaiting returns copy with only EncryptedChatWaiting constructors.
func ( EncryptedChatClassArray) () ( EncryptedChatWaitingArray) {
	for ,  := range  {
		,  := .(*EncryptedChatWaiting)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// FillEncryptedChatRequestedMap fills only EncryptedChatRequested constructors to given map.
func ( EncryptedChatClassArray) ( map[int]*EncryptedChatRequested) {
	for ,  := range  {
		,  := .(*EncryptedChatRequested)
		if ! {
			continue
		}
		[.GetID()] = 
	}
}

// EncryptedChatRequestedToMap collects only EncryptedChatRequested constructors to map.
func ( EncryptedChatClassArray) () map[int]*EncryptedChatRequested {
	 := make(map[int]*EncryptedChatRequested, len())
	.FillEncryptedChatRequestedMap()
	return 
}

// AsEncryptedChatRequested returns copy with only EncryptedChatRequested constructors.
func ( EncryptedChatClassArray) () ( EncryptedChatRequestedArray) {
	for ,  := range  {
		,  := .(*EncryptedChatRequested)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// FillEncryptedChatMap fills only EncryptedChat constructors to given map.
func ( EncryptedChatClassArray) ( map[int]*EncryptedChat) {
	for ,  := range  {
		,  := .(*EncryptedChat)
		if ! {
			continue
		}
		[.GetID()] = 
	}
}

// EncryptedChatToMap collects only EncryptedChat constructors to map.
func ( EncryptedChatClassArray) () map[int]*EncryptedChat {
	 := make(map[int]*EncryptedChat, len())
	.FillEncryptedChatMap()
	return 
}

// AsEncryptedChat returns copy with only EncryptedChat constructors.
func ( EncryptedChatClassArray) () ( EncryptedChatArray) {
	for ,  := range  {
		,  := .(*EncryptedChat)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// FillEncryptedChatDiscardedMap fills only EncryptedChatDiscarded constructors to given map.
func ( EncryptedChatClassArray) ( map[int]*EncryptedChatDiscarded) {
	for ,  := range  {
		,  := .(*EncryptedChatDiscarded)
		if ! {
			continue
		}
		[.GetID()] = 
	}
}

// EncryptedChatDiscardedToMap collects only EncryptedChatDiscarded constructors to map.
func ( EncryptedChatClassArray) () map[int]*EncryptedChatDiscarded {
	 := make(map[int]*EncryptedChatDiscarded, len())
	.FillEncryptedChatDiscardedMap()
	return 
}

// AsEncryptedChatDiscarded returns copy with only EncryptedChatDiscarded constructors.
func ( EncryptedChatClassArray) () ( EncryptedChatDiscardedArray) {
	for ,  := range  {
		,  := .(*EncryptedChatDiscarded)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// FillNotEmptyMap fills only NotEmpty constructors to given map.
func ( EncryptedChatClassArray) ( map[int]NotEmptyEncryptedChat) {
	for ,  := range  {
		,  := .AsNotEmpty()
		if ! {
			continue
		}
		[.GetID()] = 
	}
}

// NotEmptyToMap collects only NotEmpty constructors to map.
func ( EncryptedChatClassArray) () map[int]NotEmptyEncryptedChat {
	 := make(map[int]NotEmptyEncryptedChat, len())
	.FillNotEmptyMap()
	return 
}

// AppendOnlyNotEmpty appends only NotEmpty constructors to
// given slice.
func ( EncryptedChatClassArray) ( []NotEmptyEncryptedChat) []NotEmptyEncryptedChat {
	for ,  := range  {
		,  := .AsNotEmpty()
		if ! {
			continue
		}
		 = append(, )
	}

	return 
}

// AsNotEmpty returns copy with only NotEmpty constructors.
func ( EncryptedChatClassArray) () ( []NotEmptyEncryptedChat) {
	return .AppendOnlyNotEmpty()
}

// FirstAsNotEmpty returns first element of slice (if exists).
func ( EncryptedChatClassArray) () ( NotEmptyEncryptedChat,  bool) {
	,  := .First()
	if ! {
		return
	}
	return .AsNotEmpty()
}

// LastAsNotEmpty returns last element of slice (if exists).
func ( EncryptedChatClassArray) () ( NotEmptyEncryptedChat,  bool) {
	,  := .Last()
	if ! {
		return
	}
	return .AsNotEmpty()
}

// PopFirstAsNotEmpty returns element of slice (if exists).
func ( *EncryptedChatClassArray) () ( NotEmptyEncryptedChat,  bool) {
	,  := .PopFirst()
	if ! {
		return
	}
	return .AsNotEmpty()
}

// PopAsNotEmpty returns element of slice (if exists).
func ( *EncryptedChatClassArray) () ( NotEmptyEncryptedChat,  bool) {
	,  := .Pop()
	if ! {
		return
	}
	return .AsNotEmpty()
}

// EncryptedChatEmptyArray is adapter for slice of EncryptedChatEmpty.
type EncryptedChatEmptyArray []EncryptedChatEmpty

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

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

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

// FillMap fills constructors to given map.
func ( EncryptedChatEmptyArray) ( map[int]EncryptedChatEmpty) {
	for ,  := range  {
		[.GetID()] = 
	}
}

// ToMap collects constructors to map.
func ( EncryptedChatEmptyArray) () map[int]EncryptedChatEmpty {
	 := make(map[int]EncryptedChatEmpty, len())
	.FillMap()
	return 
}

// EncryptedChatWaitingArray is adapter for slice of EncryptedChatWaiting.
type EncryptedChatWaitingArray []EncryptedChatWaiting

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

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

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

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

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

// FillMap fills constructors to given map.
func ( EncryptedChatWaitingArray) ( map[int]EncryptedChatWaiting) {
	for ,  := range  {
		[.GetID()] = 
	}
}

// ToMap collects constructors to map.
func ( EncryptedChatWaitingArray) () map[int]EncryptedChatWaiting {
	 := make(map[int]EncryptedChatWaiting, len())
	.FillMap()
	return 
}

// EncryptedChatRequestedArray is adapter for slice of EncryptedChatRequested.
type EncryptedChatRequestedArray []EncryptedChatRequested

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

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

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

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

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

// FillMap fills constructors to given map.
func ( EncryptedChatRequestedArray) ( map[int]EncryptedChatRequested) {
	for ,  := range  {
		[.GetID()] = 
	}
}

// ToMap collects constructors to map.
func ( EncryptedChatRequestedArray) () map[int]EncryptedChatRequested {
	 := make(map[int]EncryptedChatRequested, len())
	.FillMap()
	return 
}

// EncryptedChatArray is adapter for slice of EncryptedChat.
type EncryptedChatArray []EncryptedChat

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

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

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

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

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

// FillMap fills constructors to given map.
func ( EncryptedChatArray) ( map[int]EncryptedChat) {
	for ,  := range  {
		[.GetID()] = 
	}
}

// ToMap collects constructors to map.
func ( EncryptedChatArray) () map[int]EncryptedChat {
	 := make(map[int]EncryptedChat, len())
	.FillMap()
	return 
}

// EncryptedChatDiscardedArray is adapter for slice of EncryptedChatDiscarded.
type EncryptedChatDiscardedArray []EncryptedChatDiscarded

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

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

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

// FillMap fills constructors to given map.
func ( EncryptedChatDiscardedArray) ( map[int]EncryptedChatDiscarded) {
	for ,  := range  {
		[.GetID()] = 
	}
}

// ToMap collects constructors to map.
func ( EncryptedChatDiscardedArray) () map[int]EncryptedChatDiscarded {
	 := make(map[int]EncryptedChatDiscarded, len())
	.FillMap()
	return 
}