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

// UpdatesDifferenceClassArray is adapter for slice of UpdatesDifferenceClass.
type UpdatesDifferenceClassArray []UpdatesDifferenceClass

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// AsUpdatesDifferenceEmpty returns copy with only UpdatesDifferenceEmpty constructors.
func ( UpdatesDifferenceClassArray) () ( UpdatesDifferenceEmptyArray) {
	for ,  := range  {
		,  := .(*UpdatesDifferenceEmpty)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsUpdatesDifference returns copy with only UpdatesDifference constructors.
func ( UpdatesDifferenceClassArray) () ( UpdatesDifferenceArray) {
	for ,  := range  {
		,  := .(*UpdatesDifference)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsUpdatesDifferenceSlice returns copy with only UpdatesDifferenceSlice constructors.
func ( UpdatesDifferenceClassArray) () ( UpdatesDifferenceSliceArray) {
	for ,  := range  {
		,  := .(*UpdatesDifferenceSlice)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsUpdatesDifferenceTooLong returns copy with only UpdatesDifferenceTooLong constructors.
func ( UpdatesDifferenceClassArray) () ( UpdatesDifferenceTooLongArray) {
	for ,  := range  {
		,  := .(*UpdatesDifferenceTooLong)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// UpdatesDifferenceEmptyArray is adapter for slice of UpdatesDifferenceEmpty.
type UpdatesDifferenceEmptyArray []UpdatesDifferenceEmpty

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

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

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

// UpdatesDifferenceArray is adapter for slice of UpdatesDifference.
type UpdatesDifferenceArray []UpdatesDifference

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// UpdatesDifferenceSliceArray is adapter for slice of UpdatesDifferenceSlice.
type UpdatesDifferenceSliceArray []UpdatesDifferenceSlice

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// UpdatesDifferenceTooLongArray is adapter for slice of UpdatesDifferenceTooLong.
type UpdatesDifferenceTooLongArray []UpdatesDifferenceTooLong

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}