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

// InputStorePaymentPurposeClassArray is adapter for slice of InputStorePaymentPurposeClass.
type InputStorePaymentPurposeClassArray []InputStorePaymentPurposeClass

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// AsInputStorePaymentPremiumSubscription returns copy with only InputStorePaymentPremiumSubscription constructors.
func ( InputStorePaymentPurposeClassArray) () ( InputStorePaymentPremiumSubscriptionArray) {
	for ,  := range  {
		,  := .(*InputStorePaymentPremiumSubscription)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsInputStorePaymentGiftPremium returns copy with only InputStorePaymentGiftPremium constructors.
func ( InputStorePaymentPurposeClassArray) () ( InputStorePaymentGiftPremiumArray) {
	for ,  := range  {
		,  := .(*InputStorePaymentGiftPremium)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsInputStorePaymentPremiumGiftCode returns copy with only InputStorePaymentPremiumGiftCode constructors.
func ( InputStorePaymentPurposeClassArray) () ( InputStorePaymentPremiumGiftCodeArray) {
	for ,  := range  {
		,  := .(*InputStorePaymentPremiumGiftCode)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsInputStorePaymentPremiumGiveaway returns copy with only InputStorePaymentPremiumGiveaway constructors.
func ( InputStorePaymentPurposeClassArray) () ( InputStorePaymentPremiumGiveawayArray) {
	for ,  := range  {
		,  := .(*InputStorePaymentPremiumGiveaway)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// InputStorePaymentPremiumSubscriptionArray is adapter for slice of InputStorePaymentPremiumSubscription.
type InputStorePaymentPremiumSubscriptionArray []InputStorePaymentPremiumSubscription

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// InputStorePaymentGiftPremiumArray is adapter for slice of InputStorePaymentGiftPremium.
type InputStorePaymentGiftPremiumArray []InputStorePaymentGiftPremium

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// InputStorePaymentPremiumGiftCodeArray is adapter for slice of InputStorePaymentPremiumGiftCode.
type InputStorePaymentPremiumGiftCodeArray []InputStorePaymentPremiumGiftCode

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// InputStorePaymentPremiumGiveawayArray is adapter for slice of InputStorePaymentPremiumGiveaway.
type InputStorePaymentPremiumGiveawayArray []InputStorePaymentPremiumGiveaway

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}