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

// PhoneCallClassArray is adapter for slice of PhoneCallClass.
type PhoneCallClassArray []PhoneCallClass

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

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

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

// FillPhoneCallEmptyMap fills only PhoneCallEmpty constructors to given map.
func ( PhoneCallClassArray) ( map[int64]*PhoneCallEmpty) {
	for ,  := range  {
		,  := .(*PhoneCallEmpty)
		if ! {
			continue
		}
		[.GetID()] = 
	}
}

// PhoneCallEmptyToMap collects only PhoneCallEmpty constructors to map.
func ( PhoneCallClassArray) () map[int64]*PhoneCallEmpty {
	 := make(map[int64]*PhoneCallEmpty, len())
	.FillPhoneCallEmptyMap()
	return 
}

// AsPhoneCallEmpty returns copy with only PhoneCallEmpty constructors.
func ( PhoneCallClassArray) () ( PhoneCallEmptyArray) {
	for ,  := range  {
		,  := .(*PhoneCallEmpty)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// FillPhoneCallWaitingMap fills only PhoneCallWaiting constructors to given map.
func ( PhoneCallClassArray) ( map[int64]*PhoneCallWaiting) {
	for ,  := range  {
		,  := .(*PhoneCallWaiting)
		if ! {
			continue
		}
		[.GetID()] = 
	}
}

// PhoneCallWaitingToMap collects only PhoneCallWaiting constructors to map.
func ( PhoneCallClassArray) () map[int64]*PhoneCallWaiting {
	 := make(map[int64]*PhoneCallWaiting, len())
	.FillPhoneCallWaitingMap()
	return 
}

// AsPhoneCallWaiting returns copy with only PhoneCallWaiting constructors.
func ( PhoneCallClassArray) () ( PhoneCallWaitingArray) {
	for ,  := range  {
		,  := .(*PhoneCallWaiting)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// FillPhoneCallRequestedMap fills only PhoneCallRequested constructors to given map.
func ( PhoneCallClassArray) ( map[int64]*PhoneCallRequested) {
	for ,  := range  {
		,  := .(*PhoneCallRequested)
		if ! {
			continue
		}
		[.GetID()] = 
	}
}

// PhoneCallRequestedToMap collects only PhoneCallRequested constructors to map.
func ( PhoneCallClassArray) () map[int64]*PhoneCallRequested {
	 := make(map[int64]*PhoneCallRequested, len())
	.FillPhoneCallRequestedMap()
	return 
}

// AsPhoneCallRequested returns copy with only PhoneCallRequested constructors.
func ( PhoneCallClassArray) () ( PhoneCallRequestedArray) {
	for ,  := range  {
		,  := .(*PhoneCallRequested)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// FillPhoneCallAcceptedMap fills only PhoneCallAccepted constructors to given map.
func ( PhoneCallClassArray) ( map[int64]*PhoneCallAccepted) {
	for ,  := range  {
		,  := .(*PhoneCallAccepted)
		if ! {
			continue
		}
		[.GetID()] = 
	}
}

// PhoneCallAcceptedToMap collects only PhoneCallAccepted constructors to map.
func ( PhoneCallClassArray) () map[int64]*PhoneCallAccepted {
	 := make(map[int64]*PhoneCallAccepted, len())
	.FillPhoneCallAcceptedMap()
	return 
}

// AsPhoneCallAccepted returns copy with only PhoneCallAccepted constructors.
func ( PhoneCallClassArray) () ( PhoneCallAcceptedArray) {
	for ,  := range  {
		,  := .(*PhoneCallAccepted)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// FillPhoneCallMap fills only PhoneCall constructors to given map.
func ( PhoneCallClassArray) ( map[int64]*PhoneCall) {
	for ,  := range  {
		,  := .(*PhoneCall)
		if ! {
			continue
		}
		[.GetID()] = 
	}
}

// PhoneCallToMap collects only PhoneCall constructors to map.
func ( PhoneCallClassArray) () map[int64]*PhoneCall {
	 := make(map[int64]*PhoneCall, len())
	.FillPhoneCallMap()
	return 
}

// AsPhoneCall returns copy with only PhoneCall constructors.
func ( PhoneCallClassArray) () ( PhoneCallArray) {
	for ,  := range  {
		,  := .(*PhoneCall)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// FillPhoneCallDiscardedMap fills only PhoneCallDiscarded constructors to given map.
func ( PhoneCallClassArray) ( map[int64]*PhoneCallDiscarded) {
	for ,  := range  {
		,  := .(*PhoneCallDiscarded)
		if ! {
			continue
		}
		[.GetID()] = 
	}
}

// PhoneCallDiscardedToMap collects only PhoneCallDiscarded constructors to map.
func ( PhoneCallClassArray) () map[int64]*PhoneCallDiscarded {
	 := make(map[int64]*PhoneCallDiscarded, len())
	.FillPhoneCallDiscardedMap()
	return 
}

// AsPhoneCallDiscarded returns copy with only PhoneCallDiscarded constructors.
func ( PhoneCallClassArray) () ( PhoneCallDiscardedArray) {
	for ,  := range  {
		,  := .(*PhoneCallDiscarded)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

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

// NotEmptyToMap collects only NotEmpty constructors to map.
func ( PhoneCallClassArray) () map[int64]NotEmptyPhoneCall {
	 := make(map[int64]NotEmptyPhoneCall, len())
	.FillNotEmptyMap()
	return 
}

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

	return 
}

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

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

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

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

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

// PhoneCallEmptyArray is adapter for slice of PhoneCallEmpty.
type PhoneCallEmptyArray []PhoneCallEmpty

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

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

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

// FillMap fills constructors to given map.
func ( PhoneCallEmptyArray) ( map[int64]PhoneCallEmpty) {
	for ,  := range  {
		[.GetID()] = 
	}
}

// ToMap collects constructors to map.
func ( PhoneCallEmptyArray) () map[int64]PhoneCallEmpty {
	 := make(map[int64]PhoneCallEmpty, len())
	.FillMap()
	return 
}

// PhoneCallWaitingArray is adapter for slice of PhoneCallWaiting.
type PhoneCallWaitingArray []PhoneCallWaiting

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

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

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

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

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

// FillMap fills constructors to given map.
func ( PhoneCallWaitingArray) ( map[int64]PhoneCallWaiting) {
	for ,  := range  {
		[.GetID()] = 
	}
}

// ToMap collects constructors to map.
func ( PhoneCallWaitingArray) () map[int64]PhoneCallWaiting {
	 := make(map[int64]PhoneCallWaiting, len())
	.FillMap()
	return 
}

// PhoneCallRequestedArray is adapter for slice of PhoneCallRequested.
type PhoneCallRequestedArray []PhoneCallRequested

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

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

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

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

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

// FillMap fills constructors to given map.
func ( PhoneCallRequestedArray) ( map[int64]PhoneCallRequested) {
	for ,  := range  {
		[.GetID()] = 
	}
}

// ToMap collects constructors to map.
func ( PhoneCallRequestedArray) () map[int64]PhoneCallRequested {
	 := make(map[int64]PhoneCallRequested, len())
	.FillMap()
	return 
}

// PhoneCallAcceptedArray is adapter for slice of PhoneCallAccepted.
type PhoneCallAcceptedArray []PhoneCallAccepted

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

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

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

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

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

// FillMap fills constructors to given map.
func ( PhoneCallAcceptedArray) ( map[int64]PhoneCallAccepted) {
	for ,  := range  {
		[.GetID()] = 
	}
}

// ToMap collects constructors to map.
func ( PhoneCallAcceptedArray) () map[int64]PhoneCallAccepted {
	 := make(map[int64]PhoneCallAccepted, len())
	.FillMap()
	return 
}

// PhoneCallArray is adapter for slice of PhoneCall.
type PhoneCallArray []PhoneCall

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

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

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

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

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

// FillMap fills constructors to given map.
func ( PhoneCallArray) ( map[int64]PhoneCall) {
	for ,  := range  {
		[.GetID()] = 
	}
}

// ToMap collects constructors to map.
func ( PhoneCallArray) () map[int64]PhoneCall {
	 := make(map[int64]PhoneCall, len())
	.FillMap()
	return 
}

// PhoneCallDiscardedArray is adapter for slice of PhoneCallDiscarded.
type PhoneCallDiscardedArray []PhoneCallDiscarded

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

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

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

// FillMap fills constructors to given map.
func ( PhoneCallDiscardedArray) ( map[int64]PhoneCallDiscarded) {
	for ,  := range  {
		[.GetID()] = 
	}
}

// ToMap collects constructors to map.
func ( PhoneCallDiscardedArray) () map[int64]PhoneCallDiscarded {
	 := make(map[int64]PhoneCallDiscarded, len())
	.FillMap()
	return 
}