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

// AuthAuthorizationClassArray is adapter for slice of AuthAuthorizationClass.
type AuthAuthorizationClassArray []AuthAuthorizationClass

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// AsAuthAuthorization returns copy with only AuthAuthorization constructors.
func ( AuthAuthorizationClassArray) () ( AuthAuthorizationArray) {
	for ,  := range  {
		,  := .(*AuthAuthorization)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsAuthAuthorizationSignUpRequired returns copy with only AuthAuthorizationSignUpRequired constructors.
func ( AuthAuthorizationClassArray) () ( AuthAuthorizationSignUpRequiredArray) {
	for ,  := range  {
		,  := .(*AuthAuthorizationSignUpRequired)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AuthAuthorizationArray is adapter for slice of AuthAuthorization.
type AuthAuthorizationArray []AuthAuthorization

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// AuthAuthorizationSignUpRequiredArray is adapter for slice of AuthAuthorizationSignUpRequired.
type AuthAuthorizationSignUpRequiredArray []AuthAuthorizationSignUpRequired

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}