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

// HelpPromoDataClassArray is adapter for slice of HelpPromoDataClass.
type HelpPromoDataClassArray []HelpPromoDataClass

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// AsHelpPromoDataEmpty returns copy with only HelpPromoDataEmpty constructors.
func ( HelpPromoDataClassArray) () ( HelpPromoDataEmptyArray) {
	for ,  := range  {
		,  := .(*HelpPromoDataEmpty)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsHelpPromoData returns copy with only HelpPromoData constructors.
func ( HelpPromoDataClassArray) () ( HelpPromoDataArray) {
	for ,  := range  {
		,  := .(*HelpPromoData)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

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

	return 
}

// AsNotEmpty returns copy with only NotEmpty constructors.
func ( HelpPromoDataClassArray) () ( []*HelpPromoData) {
	return .AppendOnlyNotEmpty()
}

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

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

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

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

// HelpPromoDataEmptyArray is adapter for slice of HelpPromoDataEmpty.
type HelpPromoDataEmptyArray []HelpPromoDataEmpty

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// HelpPromoDataArray is adapter for slice of HelpPromoData.
type HelpPromoDataArray []HelpPromoData

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}