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

// PaymentsPaymentReceiptClassArray is adapter for slice of PaymentsPaymentReceiptClass.
type PaymentsPaymentReceiptClassArray []PaymentsPaymentReceiptClass

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// SortByDate sorts slice of PaymentsPaymentReceiptClass by Date.
func ( PaymentsPaymentReceiptClassArray) () PaymentsPaymentReceiptClassArray {
	return .Sort(func(,  PaymentsPaymentReceiptClass) bool {
		return .GetDate() < .GetDate()
	})
}

// SortStableByDate sorts slice of PaymentsPaymentReceiptClass by Date.
func ( PaymentsPaymentReceiptClassArray) () PaymentsPaymentReceiptClassArray {
	return .SortStable(func(,  PaymentsPaymentReceiptClass) bool {
		return .GetDate() < .GetDate()
	})
}

// AsPaymentsPaymentReceipt returns copy with only PaymentsPaymentReceipt constructors.
func ( PaymentsPaymentReceiptClassArray) () ( PaymentsPaymentReceiptArray) {
	for ,  := range  {
		,  := .(*PaymentsPaymentReceipt)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsPaymentsPaymentReceiptStars returns copy with only PaymentsPaymentReceiptStars constructors.
func ( PaymentsPaymentReceiptClassArray) () ( PaymentsPaymentReceiptStarsArray) {
	for ,  := range  {
		,  := .(*PaymentsPaymentReceiptStars)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// PaymentsPaymentReceiptArray is adapter for slice of PaymentsPaymentReceipt.
type PaymentsPaymentReceiptArray []PaymentsPaymentReceipt

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// SortByDate sorts slice of PaymentsPaymentReceipt by Date.
func ( PaymentsPaymentReceiptArray) () PaymentsPaymentReceiptArray {
	return .Sort(func(,  PaymentsPaymentReceipt) bool {
		return .GetDate() < .GetDate()
	})
}

// SortStableByDate sorts slice of PaymentsPaymentReceipt by Date.
func ( PaymentsPaymentReceiptArray) () PaymentsPaymentReceiptArray {
	return .SortStable(func(,  PaymentsPaymentReceipt) bool {
		return .GetDate() < .GetDate()
	})
}

// PaymentsPaymentReceiptStarsArray is adapter for slice of PaymentsPaymentReceiptStars.
type PaymentsPaymentReceiptStarsArray []PaymentsPaymentReceiptStars

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// SortByDate sorts slice of PaymentsPaymentReceiptStars by Date.
func ( PaymentsPaymentReceiptStarsArray) () PaymentsPaymentReceiptStarsArray {
	return .Sort(func(,  PaymentsPaymentReceiptStars) bool {
		return .GetDate() < .GetDate()
	})
}

// SortStableByDate sorts slice of PaymentsPaymentReceiptStars by Date.
func ( PaymentsPaymentReceiptStarsArray) () PaymentsPaymentReceiptStarsArray {
	return .SortStable(func(,  PaymentsPaymentReceiptStars) bool {
		return .GetDate() < .GetDate()
	})
}