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

// PostInteractionCountersClassArray is adapter for slice of PostInteractionCountersClass.
type PostInteractionCountersClassArray []PostInteractionCountersClass

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// AsPostInteractionCountersMessage returns copy with only PostInteractionCountersMessage constructors.
func ( PostInteractionCountersClassArray) () ( PostInteractionCountersMessageArray) {
	for ,  := range  {
		,  := .(*PostInteractionCountersMessage)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsPostInteractionCountersStory returns copy with only PostInteractionCountersStory constructors.
func ( PostInteractionCountersClassArray) () ( PostInteractionCountersStoryArray) {
	for ,  := range  {
		,  := .(*PostInteractionCountersStory)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// PostInteractionCountersMessageArray is adapter for slice of PostInteractionCountersMessage.
type PostInteractionCountersMessageArray []PostInteractionCountersMessage

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// PostInteractionCountersStoryArray is adapter for slice of PostInteractionCountersStory.
type PostInteractionCountersStoryArray []PostInteractionCountersStory

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}