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

// InputPrivacyRuleClassArray is adapter for slice of InputPrivacyRuleClass.
type InputPrivacyRuleClassArray []InputPrivacyRuleClass

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// AsInputPrivacyValueAllowUsers returns copy with only InputPrivacyValueAllowUsers constructors.
func ( InputPrivacyRuleClassArray) () ( InputPrivacyValueAllowUsersArray) {
	for ,  := range  {
		,  := .(*InputPrivacyValueAllowUsers)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsInputPrivacyValueDisallowUsers returns copy with only InputPrivacyValueDisallowUsers constructors.
func ( InputPrivacyRuleClassArray) () ( InputPrivacyValueDisallowUsersArray) {
	for ,  := range  {
		,  := .(*InputPrivacyValueDisallowUsers)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsInputPrivacyValueAllowChatParticipants returns copy with only InputPrivacyValueAllowChatParticipants constructors.
func ( InputPrivacyRuleClassArray) () ( InputPrivacyValueAllowChatParticipantsArray) {
	for ,  := range  {
		,  := .(*InputPrivacyValueAllowChatParticipants)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsInputPrivacyValueDisallowChatParticipants returns copy with only InputPrivacyValueDisallowChatParticipants constructors.
func ( InputPrivacyRuleClassArray) () ( InputPrivacyValueDisallowChatParticipantsArray) {
	for ,  := range  {
		,  := .(*InputPrivacyValueDisallowChatParticipants)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// InputPrivacyValueAllowUsersArray is adapter for slice of InputPrivacyValueAllowUsers.
type InputPrivacyValueAllowUsersArray []InputPrivacyValueAllowUsers

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// InputPrivacyValueDisallowUsersArray is adapter for slice of InputPrivacyValueDisallowUsers.
type InputPrivacyValueDisallowUsersArray []InputPrivacyValueDisallowUsers

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// InputPrivacyValueAllowChatParticipantsArray is adapter for slice of InputPrivacyValueAllowChatParticipants.
type InputPrivacyValueAllowChatParticipantsArray []InputPrivacyValueAllowChatParticipants

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// InputPrivacyValueDisallowChatParticipantsArray is adapter for slice of InputPrivacyValueDisallowChatParticipants.
type InputPrivacyValueDisallowChatParticipantsArray []InputPrivacyValueDisallowChatParticipants

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}