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

// StarGiftAuctionStateClassArray is adapter for slice of StarGiftAuctionStateClass.
type StarGiftAuctionStateClassArray []StarGiftAuctionStateClass

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// AsStarGiftAuctionState returns copy with only StarGiftAuctionState constructors.
func ( StarGiftAuctionStateClassArray) () ( StarGiftAuctionStateArray) {
	for ,  := range  {
		,  := .(*StarGiftAuctionState)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsStarGiftAuctionStateFinished returns copy with only StarGiftAuctionStateFinished constructors.
func ( StarGiftAuctionStateClassArray) () ( StarGiftAuctionStateFinishedArray) {
	for ,  := range  {
		,  := .(*StarGiftAuctionStateFinished)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AppendOnlyModified appends only Modified constructors to
// given slice.
func ( StarGiftAuctionStateClassArray) ( []ModifiedStarGiftAuctionState) []ModifiedStarGiftAuctionState {
	for ,  := range  {
		,  := .AsModified()
		if ! {
			continue
		}
		 = append(, )
	}

	return 
}

// AsModified returns copy with only Modified constructors.
func ( StarGiftAuctionStateClassArray) () ( []ModifiedStarGiftAuctionState) {
	return .AppendOnlyModified()
}

// FirstAsModified returns first element of slice (if exists).
func ( StarGiftAuctionStateClassArray) () ( ModifiedStarGiftAuctionState,  bool) {
	,  := .First()
	if ! {
		return
	}
	return .AsModified()
}

// LastAsModified returns last element of slice (if exists).
func ( StarGiftAuctionStateClassArray) () ( ModifiedStarGiftAuctionState,  bool) {
	,  := .Last()
	if ! {
		return
	}
	return .AsModified()
}

// PopFirstAsModified returns element of slice (if exists).
func ( *StarGiftAuctionStateClassArray) () ( ModifiedStarGiftAuctionState,  bool) {
	,  := .PopFirst()
	if ! {
		return
	}
	return .AsModified()
}

// PopAsModified returns element of slice (if exists).
func ( *StarGiftAuctionStateClassArray) () ( ModifiedStarGiftAuctionState,  bool) {
	,  := .Pop()
	if ! {
		return
	}
	return .AsModified()
}

// StarGiftAuctionStateArray is adapter for slice of StarGiftAuctionState.
type StarGiftAuctionStateArray []StarGiftAuctionState

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// StarGiftAuctionStateFinishedArray is adapter for slice of StarGiftAuctionStateFinished.
type StarGiftAuctionStateFinishedArray []StarGiftAuctionStateFinished

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}