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

// StarGiftAttributeIDClassArray is adapter for slice of StarGiftAttributeIDClass.
type StarGiftAttributeIDClassArray []StarGiftAttributeIDClass

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// AsStarGiftAttributeIDModel returns copy with only StarGiftAttributeIDModel constructors.
func ( StarGiftAttributeIDClassArray) () ( StarGiftAttributeIDModelArray) {
	for ,  := range  {
		,  := .(*StarGiftAttributeIDModel)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsStarGiftAttributeIDPattern returns copy with only StarGiftAttributeIDPattern constructors.
func ( StarGiftAttributeIDClassArray) () ( StarGiftAttributeIDPatternArray) {
	for ,  := range  {
		,  := .(*StarGiftAttributeIDPattern)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsStarGiftAttributeIDBackdrop returns copy with only StarGiftAttributeIDBackdrop constructors.
func ( StarGiftAttributeIDClassArray) () ( StarGiftAttributeIDBackdropArray) {
	for ,  := range  {
		,  := .(*StarGiftAttributeIDBackdrop)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// StarGiftAttributeIDModelArray is adapter for slice of StarGiftAttributeIDModel.
type StarGiftAttributeIDModelArray []StarGiftAttributeIDModel

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// StarGiftAttributeIDPatternArray is adapter for slice of StarGiftAttributeIDPattern.
type StarGiftAttributeIDPatternArray []StarGiftAttributeIDPattern

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// StarGiftAttributeIDBackdropArray is adapter for slice of StarGiftAttributeIDBackdrop.
type StarGiftAttributeIDBackdropArray []StarGiftAttributeIDBackdrop

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}