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

// InputInvoiceClassArray is adapter for slice of InputInvoiceClass.
type InputInvoiceClassArray []InputInvoiceClass

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// AsInputInvoiceMessage returns copy with only InputInvoiceMessage constructors.
func ( InputInvoiceClassArray) () ( InputInvoiceMessageArray) {
	for ,  := range  {
		,  := .(*InputInvoiceMessage)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsInputInvoiceSlug returns copy with only InputInvoiceSlug constructors.
func ( InputInvoiceClassArray) () ( InputInvoiceSlugArray) {
	for ,  := range  {
		,  := .(*InputInvoiceSlug)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsInputInvoicePremiumGiftCode returns copy with only InputInvoicePremiumGiftCode constructors.
func ( InputInvoiceClassArray) () ( InputInvoicePremiumGiftCodeArray) {
	for ,  := range  {
		,  := .(*InputInvoicePremiumGiftCode)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// InputInvoiceMessageArray is adapter for slice of InputInvoiceMessage.
type InputInvoiceMessageArray []InputInvoiceMessage

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// InputInvoiceSlugArray is adapter for slice of InputInvoiceSlug.
type InputInvoiceSlugArray []InputInvoiceSlug

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// InputInvoicePremiumGiftCodeArray is adapter for slice of InputInvoicePremiumGiftCode.
type InputInvoicePremiumGiftCodeArray []InputInvoicePremiumGiftCode

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}