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

// PaymentsGiveawayInfoClassArray is adapter for slice of PaymentsGiveawayInfoClass.
type PaymentsGiveawayInfoClassArray []PaymentsGiveawayInfoClass

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// AsPaymentsGiveawayInfo returns copy with only PaymentsGiveawayInfo constructors.
func ( PaymentsGiveawayInfoClassArray) () ( PaymentsGiveawayInfoArray) {
	for ,  := range  {
		,  := .(*PaymentsGiveawayInfo)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsPaymentsGiveawayInfoResults returns copy with only PaymentsGiveawayInfoResults constructors.
func ( PaymentsGiveawayInfoClassArray) () ( PaymentsGiveawayInfoResultsArray) {
	for ,  := range  {
		,  := .(*PaymentsGiveawayInfoResults)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// PaymentsGiveawayInfoArray is adapter for slice of PaymentsGiveawayInfo.
type PaymentsGiveawayInfoArray []PaymentsGiveawayInfo

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// PaymentsGiveawayInfoResultsArray is adapter for slice of PaymentsGiveawayInfoResults.
type PaymentsGiveawayInfoResultsArray []PaymentsGiveawayInfoResults

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}