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

// PrivacyRuleClassArray is adapter for slice of PrivacyRuleClass.
type PrivacyRuleClassArray []PrivacyRuleClass

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// AsPrivacyValueAllowUsers returns copy with only PrivacyValueAllowUsers constructors.
func ( PrivacyRuleClassArray) () ( PrivacyValueAllowUsersArray) {
	for ,  := range  {
		,  := .(*PrivacyValueAllowUsers)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsPrivacyValueDisallowUsers returns copy with only PrivacyValueDisallowUsers constructors.
func ( PrivacyRuleClassArray) () ( PrivacyValueDisallowUsersArray) {
	for ,  := range  {
		,  := .(*PrivacyValueDisallowUsers)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsPrivacyValueAllowChatParticipants returns copy with only PrivacyValueAllowChatParticipants constructors.
func ( PrivacyRuleClassArray) () ( PrivacyValueAllowChatParticipantsArray) {
	for ,  := range  {
		,  := .(*PrivacyValueAllowChatParticipants)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsPrivacyValueDisallowChatParticipants returns copy with only PrivacyValueDisallowChatParticipants constructors.
func ( PrivacyRuleClassArray) () ( PrivacyValueDisallowChatParticipantsArray) {
	for ,  := range  {
		,  := .(*PrivacyValueDisallowChatParticipants)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// PrivacyValueAllowUsersArray is adapter for slice of PrivacyValueAllowUsers.
type PrivacyValueAllowUsersArray []PrivacyValueAllowUsers

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// PrivacyValueDisallowUsersArray is adapter for slice of PrivacyValueDisallowUsers.
type PrivacyValueDisallowUsersArray []PrivacyValueDisallowUsers

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// PrivacyValueAllowChatParticipantsArray is adapter for slice of PrivacyValueAllowChatParticipants.
type PrivacyValueAllowChatParticipantsArray []PrivacyValueAllowChatParticipants

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// PrivacyValueDisallowChatParticipantsArray is adapter for slice of PrivacyValueDisallowChatParticipants.
type PrivacyValueDisallowChatParticipantsArray []PrivacyValueDisallowChatParticipants

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}