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

// SecurePlainDataClassArray is adapter for slice of SecurePlainDataClass.
type SecurePlainDataClassArray []SecurePlainDataClass

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// AsSecurePlainPhone returns copy with only SecurePlainPhone constructors.
func ( SecurePlainDataClassArray) () ( SecurePlainPhoneArray) {
	for ,  := range  {
		,  := .(*SecurePlainPhone)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsSecurePlainEmail returns copy with only SecurePlainEmail constructors.
func ( SecurePlainDataClassArray) () ( SecurePlainEmailArray) {
	for ,  := range  {
		,  := .(*SecurePlainEmail)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// SecurePlainPhoneArray is adapter for slice of SecurePlainPhone.
type SecurePlainPhoneArray []SecurePlainPhone

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// SecurePlainEmailArray is adapter for slice of SecurePlainEmail.
type SecurePlainEmailArray []SecurePlainEmail

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}