//go:build !no_gotd_slices
// +build !no_gotd_slices

// Code generated by gotdgen, DO NOT EDIT.

package tg

import (
	"context"
	"errors"
	"fmt"
	"sort"
	"strings"

	"go.uber.org/multierr"

	"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
	"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
	"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
	"go.mau.fi/mautrix-telegram/pkg/gotd/tgerr"
)

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

// ChannelAdminLogEventActionClassArray is adapter for slice of ChannelAdminLogEventActionClass.
type ChannelAdminLogEventActionClassArray []ChannelAdminLogEventActionClass

// Sort sorts slice of ChannelAdminLogEventActionClass.
func (s ChannelAdminLogEventActionClassArray) Sort(less func(a, b ChannelAdminLogEventActionClass) bool) ChannelAdminLogEventActionClassArray {
	sort.Slice(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// SortStable sorts slice of ChannelAdminLogEventActionClass.
func (s ChannelAdminLogEventActionClassArray) SortStable(less func(a, b ChannelAdminLogEventActionClass) bool) ChannelAdminLogEventActionClassArray {
	sort.SliceStable(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// Retain filters in-place slice of ChannelAdminLogEventActionClass.
func (s ChannelAdminLogEventActionClassArray) Retain(keep func(x ChannelAdminLogEventActionClass) bool) ChannelAdminLogEventActionClassArray {
	n := 0
	for _, x := range s {
		if keep(x) {
			s[n] = x
			n++
		}
	}
	s = s[:n]

	return s
}

// First returns first element of slice (if exists).
func (s ChannelAdminLogEventActionClassArray) First() (v ChannelAdminLogEventActionClass, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[0], true
}

// Last returns last element of slice (if exists).
func (s ChannelAdminLogEventActionClassArray) Last() (v ChannelAdminLogEventActionClass, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[len(s)-1], true
}

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

	a := *s
	v = a[0]

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

	return v, true
}

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

	a := *s
	v = a[len(a)-1]
	a = a[:len(a)-1]
	*s = a

	return v, true
}

// AsChannelAdminLogEventActionChangeTitle returns copy with only ChannelAdminLogEventActionChangeTitle constructors.
func (s ChannelAdminLogEventActionClassArray) AsChannelAdminLogEventActionChangeTitle() (to ChannelAdminLogEventActionChangeTitleArray) {
	for _, elem := range s {
		value, ok := elem.(*ChannelAdminLogEventActionChangeTitle)
		if !ok {
			continue
		}
		to = append(to, *value)
	}

	return to
}

// AsChannelAdminLogEventActionChangeAbout returns copy with only ChannelAdminLogEventActionChangeAbout constructors.
func (s ChannelAdminLogEventActionClassArray) AsChannelAdminLogEventActionChangeAbout() (to ChannelAdminLogEventActionChangeAboutArray) {
	for _, elem := range s {
		value, ok := elem.(*ChannelAdminLogEventActionChangeAbout)
		if !ok {
			continue
		}
		to = append(to, *value)
	}

	return to
}

// AsChannelAdminLogEventActionChangeUsername returns copy with only ChannelAdminLogEventActionChangeUsername constructors.
func (s ChannelAdminLogEventActionClassArray) AsChannelAdminLogEventActionChangeUsername() (to ChannelAdminLogEventActionChangeUsernameArray) {
	for _, elem := range s {
		value, ok := elem.(*ChannelAdminLogEventActionChangeUsername)
		if !ok {
			continue
		}
		to = append(to, *value)
	}

	return to
}

// AsChannelAdminLogEventActionChangePhoto returns copy with only ChannelAdminLogEventActionChangePhoto constructors.
func (s ChannelAdminLogEventActionClassArray) AsChannelAdminLogEventActionChangePhoto() (to ChannelAdminLogEventActionChangePhotoArray) {
	for _, elem := range s {
		value, ok := elem.(*ChannelAdminLogEventActionChangePhoto)
		if !ok {
			continue
		}
		to = append(to, *value)
	}

	return to
}

// AsChannelAdminLogEventActionToggleInvites returns copy with only ChannelAdminLogEventActionToggleInvites constructors.
func (s ChannelAdminLogEventActionClassArray) AsChannelAdminLogEventActionToggleInvites() (to ChannelAdminLogEventActionToggleInvitesArray) {
	for _, elem := range s {
		value, ok := elem.(*ChannelAdminLogEventActionToggleInvites)
		if !ok {
			continue
		}
		to = append(to, *value)
	}

	return to
}

// AsChannelAdminLogEventActionToggleSignatures returns copy with only ChannelAdminLogEventActionToggleSignatures constructors.
func (s ChannelAdminLogEventActionClassArray) AsChannelAdminLogEventActionToggleSignatures() (to ChannelAdminLogEventActionToggleSignaturesArray) {
	for _, elem := range s {
		value, ok := elem.(*ChannelAdminLogEventActionToggleSignatures)
		if !ok {
			continue
		}
		to = append(to, *value)
	}

	return to
}

// AsChannelAdminLogEventActionUpdatePinned returns copy with only ChannelAdminLogEventActionUpdatePinned constructors.
func (s ChannelAdminLogEventActionClassArray) AsChannelAdminLogEventActionUpdatePinned() (to ChannelAdminLogEventActionUpdatePinnedArray) {
	for _, elem := range s {
		value, ok := elem.(*ChannelAdminLogEventActionUpdatePinned)
		if !ok {
			continue
		}
		to = append(to, *value)
	}

	return to
}

// AsChannelAdminLogEventActionEditMessage returns copy with only ChannelAdminLogEventActionEditMessage constructors.
func (s ChannelAdminLogEventActionClassArray) AsChannelAdminLogEventActionEditMessage() (to ChannelAdminLogEventActionEditMessageArray) {
	for _, elem := range s {
		value, ok := elem.(*ChannelAdminLogEventActionEditMessage)
		if !ok {
			continue
		}
		to = append(to, *value)
	}

	return to
}

// AsChannelAdminLogEventActionDeleteMessage returns copy with only ChannelAdminLogEventActionDeleteMessage constructors.
func (s ChannelAdminLogEventActionClassArray) AsChannelAdminLogEventActionDeleteMessage() (to ChannelAdminLogEventActionDeleteMessageArray) {
	for _, elem := range s {
		value, ok := elem.(*ChannelAdminLogEventActionDeleteMessage)
		if !ok {
			continue
		}
		to = append(to, *value)
	}

	return to
}

// AsChannelAdminLogEventActionParticipantInvite returns copy with only ChannelAdminLogEventActionParticipantInvite constructors.
func (s ChannelAdminLogEventActionClassArray) AsChannelAdminLogEventActionParticipantInvite() (to ChannelAdminLogEventActionParticipantInviteArray) {
	for _, elem := range s {
		value, ok := elem.(*ChannelAdminLogEventActionParticipantInvite)
		if !ok {
			continue
		}
		to = append(to, *value)
	}

	return to
}

// AsChannelAdminLogEventActionParticipantToggleBan returns copy with only ChannelAdminLogEventActionParticipantToggleBan constructors.
func (s ChannelAdminLogEventActionClassArray) AsChannelAdminLogEventActionParticipantToggleBan() (to ChannelAdminLogEventActionParticipantToggleBanArray) {
	for _, elem := range s {
		value, ok := elem.(*ChannelAdminLogEventActionParticipantToggleBan)
		if !ok {
			continue
		}
		to = append(to, *value)
	}

	return to
}

// AsChannelAdminLogEventActionParticipantToggleAdmin returns copy with only ChannelAdminLogEventActionParticipantToggleAdmin constructors.
func (s ChannelAdminLogEventActionClassArray) AsChannelAdminLogEventActionParticipantToggleAdmin() (to ChannelAdminLogEventActionParticipantToggleAdminArray) {
	for _, elem := range s {
		value, ok := elem.(*ChannelAdminLogEventActionParticipantToggleAdmin)
		if !ok {
			continue
		}
		to = append(to, *value)
	}

	return to
}

// AsChannelAdminLogEventActionChangeStickerSet returns copy with only ChannelAdminLogEventActionChangeStickerSet constructors.
func (s ChannelAdminLogEventActionClassArray) AsChannelAdminLogEventActionChangeStickerSet() (to ChannelAdminLogEventActionChangeStickerSetArray) {
	for _, elem := range s {
		value, ok := elem.(*ChannelAdminLogEventActionChangeStickerSet)
		if !ok {
			continue
		}
		to = append(to, *value)
	}

	return to
}

// AsChannelAdminLogEventActionTogglePreHistoryHidden returns copy with only ChannelAdminLogEventActionTogglePreHistoryHidden constructors.
func (s ChannelAdminLogEventActionClassArray) AsChannelAdminLogEventActionTogglePreHistoryHidden() (to ChannelAdminLogEventActionTogglePreHistoryHiddenArray) {
	for _, elem := range s {
		value, ok := elem.(*ChannelAdminLogEventActionTogglePreHistoryHidden)
		if !ok {
			continue
		}
		to = append(to, *value)
	}

	return to
}

// AsChannelAdminLogEventActionDefaultBannedRights returns copy with only ChannelAdminLogEventActionDefaultBannedRights constructors.
func (s ChannelAdminLogEventActionClassArray) AsChannelAdminLogEventActionDefaultBannedRights() (to ChannelAdminLogEventActionDefaultBannedRightsArray) {
	for _, elem := range s {
		value, ok := elem.(*ChannelAdminLogEventActionDefaultBannedRights)
		if !ok {
			continue
		}
		to = append(to, *value)
	}

	return to
}

// AsChannelAdminLogEventActionStopPoll returns copy with only ChannelAdminLogEventActionStopPoll constructors.
func (s ChannelAdminLogEventActionClassArray) AsChannelAdminLogEventActionStopPoll() (to ChannelAdminLogEventActionStopPollArray) {
	for _, elem := range s {
		value, ok := elem.(*ChannelAdminLogEventActionStopPoll)
		if !ok {
			continue
		}
		to = append(to, *value)
	}

	return to
}

// AsChannelAdminLogEventActionChangeLinkedChat returns copy with only ChannelAdminLogEventActionChangeLinkedChat constructors.
func (s ChannelAdminLogEventActionClassArray) AsChannelAdminLogEventActionChangeLinkedChat() (to ChannelAdminLogEventActionChangeLinkedChatArray) {
	for _, elem := range s {
		value, ok := elem.(*ChannelAdminLogEventActionChangeLinkedChat)
		if !ok {
			continue
		}
		to = append(to, *value)
	}

	return to
}

// AsChannelAdminLogEventActionChangeLocation returns copy with only ChannelAdminLogEventActionChangeLocation constructors.
func (s ChannelAdminLogEventActionClassArray) AsChannelAdminLogEventActionChangeLocation() (to ChannelAdminLogEventActionChangeLocationArray) {
	for _, elem := range s {
		value, ok := elem.(*ChannelAdminLogEventActionChangeLocation)
		if !ok {
			continue
		}
		to = append(to, *value)
	}

	return to
}

// AsChannelAdminLogEventActionToggleSlowMode returns copy with only ChannelAdminLogEventActionToggleSlowMode constructors.
func (s ChannelAdminLogEventActionClassArray) AsChannelAdminLogEventActionToggleSlowMode() (to ChannelAdminLogEventActionToggleSlowModeArray) {
	for _, elem := range s {
		value, ok := elem.(*ChannelAdminLogEventActionToggleSlowMode)
		if !ok {
			continue
		}
		to = append(to, *value)
	}

	return to
}

// AsChannelAdminLogEventActionStartGroupCall returns copy with only ChannelAdminLogEventActionStartGroupCall constructors.
func (s ChannelAdminLogEventActionClassArray) AsChannelAdminLogEventActionStartGroupCall() (to ChannelAdminLogEventActionStartGroupCallArray) {
	for _, elem := range s {
		value, ok := elem.(*ChannelAdminLogEventActionStartGroupCall)
		if !ok {
			continue
		}
		to = append(to, *value)
	}

	return to
}

// AsChannelAdminLogEventActionDiscardGroupCall returns copy with only ChannelAdminLogEventActionDiscardGroupCall constructors.
func (s ChannelAdminLogEventActionClassArray) AsChannelAdminLogEventActionDiscardGroupCall() (to ChannelAdminLogEventActionDiscardGroupCallArray) {
	for _, elem := range s {
		value, ok := elem.(*ChannelAdminLogEventActionDiscardGroupCall)
		if !ok {
			continue
		}
		to = append(to, *value)
	}

	return to
}

// AsChannelAdminLogEventActionParticipantMute returns copy with only ChannelAdminLogEventActionParticipantMute constructors.
func (s ChannelAdminLogEventActionClassArray) AsChannelAdminLogEventActionParticipantMute() (to ChannelAdminLogEventActionParticipantMuteArray) {
	for _, elem := range s {
		value, ok := elem.(*ChannelAdminLogEventActionParticipantMute)
		if !ok {
			continue
		}
		to = append(to, *value)
	}

	return to
}

// AsChannelAdminLogEventActionParticipantUnmute returns copy with only ChannelAdminLogEventActionParticipantUnmute constructors.
func (s ChannelAdminLogEventActionClassArray) AsChannelAdminLogEventActionParticipantUnmute() (to ChannelAdminLogEventActionParticipantUnmuteArray) {
	for _, elem := range s {
		value, ok := elem.(*ChannelAdminLogEventActionParticipantUnmute)
		if !ok {
			continue
		}
		to = append(to, *value)
	}

	return to
}

// AsChannelAdminLogEventActionToggleGroupCallSetting returns copy with only ChannelAdminLogEventActionToggleGroupCallSetting constructors.
func (s ChannelAdminLogEventActionClassArray) AsChannelAdminLogEventActionToggleGroupCallSetting() (to ChannelAdminLogEventActionToggleGroupCallSettingArray) {
	for _, elem := range s {
		value, ok := elem.(*ChannelAdminLogEventActionToggleGroupCallSetting)
		if !ok {
			continue
		}
		to = append(to, *value)
	}

	return to
}

// AsChannelAdminLogEventActionParticipantJoinByInvite returns copy with only ChannelAdminLogEventActionParticipantJoinByInvite constructors.
func (s ChannelAdminLogEventActionClassArray) AsChannelAdminLogEventActionParticipantJoinByInvite() (to ChannelAdminLogEventActionParticipantJoinByInviteArray) {
	for _, elem := range s {
		value, ok := elem.(*ChannelAdminLogEventActionParticipantJoinByInvite)
		if !ok {
			continue
		}
		to = append(to, *value)
	}

	return to
}

// AsChannelAdminLogEventActionExportedInviteDelete returns copy with only ChannelAdminLogEventActionExportedInviteDelete constructors.
func (s ChannelAdminLogEventActionClassArray) AsChannelAdminLogEventActionExportedInviteDelete() (to ChannelAdminLogEventActionExportedInviteDeleteArray) {
	for _, elem := range s {
		value, ok := elem.(*ChannelAdminLogEventActionExportedInviteDelete)
		if !ok {
			continue
		}
		to = append(to, *value)
	}

	return to
}

// AsChannelAdminLogEventActionExportedInviteRevoke returns copy with only ChannelAdminLogEventActionExportedInviteRevoke constructors.
func (s ChannelAdminLogEventActionClassArray) AsChannelAdminLogEventActionExportedInviteRevoke() (to ChannelAdminLogEventActionExportedInviteRevokeArray) {
	for _, elem := range s {
		value, ok := elem.(*ChannelAdminLogEventActionExportedInviteRevoke)
		if !ok {
			continue
		}
		to = append(to, *value)
	}

	return to
}

// AsChannelAdminLogEventActionExportedInviteEdit returns copy with only ChannelAdminLogEventActionExportedInviteEdit constructors.
func (s ChannelAdminLogEventActionClassArray) AsChannelAdminLogEventActionExportedInviteEdit() (to ChannelAdminLogEventActionExportedInviteEditArray) {
	for _, elem := range s {
		value, ok := elem.(*ChannelAdminLogEventActionExportedInviteEdit)
		if !ok {
			continue
		}
		to = append(to, *value)
	}

	return to
}

// AsChannelAdminLogEventActionParticipantVolume returns copy with only ChannelAdminLogEventActionParticipantVolume constructors.
func (s ChannelAdminLogEventActionClassArray) AsChannelAdminLogEventActionParticipantVolume() (to ChannelAdminLogEventActionParticipantVolumeArray) {
	for _, elem := range s {
		value, ok := elem.(*ChannelAdminLogEventActionParticipantVolume)
		if !ok {
			continue
		}
		to = append(to, *value)
	}

	return to
}

// AsChannelAdminLogEventActionChangeHistoryTTL returns copy with only ChannelAdminLogEventActionChangeHistoryTTL constructors.
func (s ChannelAdminLogEventActionClassArray) AsChannelAdminLogEventActionChangeHistoryTTL() (to ChannelAdminLogEventActionChangeHistoryTTLArray) {
	for _, elem := range s {
		value, ok := elem.(*ChannelAdminLogEventActionChangeHistoryTTL)
		if !ok {
			continue
		}
		to = append(to, *value)
	}

	return to
}

// AsChannelAdminLogEventActionParticipantJoinByRequest returns copy with only ChannelAdminLogEventActionParticipantJoinByRequest constructors.
func (s ChannelAdminLogEventActionClassArray) AsChannelAdminLogEventActionParticipantJoinByRequest() (to ChannelAdminLogEventActionParticipantJoinByRequestArray) {
	for _, elem := range s {
		value, ok := elem.(*ChannelAdminLogEventActionParticipantJoinByRequest)
		if !ok {
			continue
		}
		to = append(to, *value)
	}

	return to
}

// AsChannelAdminLogEventActionToggleNoForwards returns copy with only ChannelAdminLogEventActionToggleNoForwards constructors.
func (s ChannelAdminLogEventActionClassArray) AsChannelAdminLogEventActionToggleNoForwards() (to ChannelAdminLogEventActionToggleNoForwardsArray) {
	for _, elem := range s {
		value, ok := elem.(*ChannelAdminLogEventActionToggleNoForwards)
		if !ok {
			continue
		}
		to = append(to, *value)
	}

	return to
}

// AsChannelAdminLogEventActionSendMessage returns copy with only ChannelAdminLogEventActionSendMessage constructors.
func (s ChannelAdminLogEventActionClassArray) AsChannelAdminLogEventActionSendMessage() (to ChannelAdminLogEventActionSendMessageArray) {
	for _, elem := range s {
		value, ok := elem.(*ChannelAdminLogEventActionSendMessage)
		if !ok {
			continue
		}
		to = append(to, *value)
	}

	return to
}

// AsChannelAdminLogEventActionChangeAvailableReactions returns copy with only ChannelAdminLogEventActionChangeAvailableReactions constructors.
func (s ChannelAdminLogEventActionClassArray) AsChannelAdminLogEventActionChangeAvailableReactions() (to ChannelAdminLogEventActionChangeAvailableReactionsArray) {
	for _, elem := range s {
		value, ok := elem.(*ChannelAdminLogEventActionChangeAvailableReactions)
		if !ok {
			continue
		}
		to = append(to, *value)
	}

	return to
}

// AsChannelAdminLogEventActionChangeUsernames returns copy with only ChannelAdminLogEventActionChangeUsernames constructors.
func (s ChannelAdminLogEventActionClassArray) AsChannelAdminLogEventActionChangeUsernames() (to ChannelAdminLogEventActionChangeUsernamesArray) {
	for _, elem := range s {
		value, ok := elem.(*ChannelAdminLogEventActionChangeUsernames)
		if !ok {
			continue
		}
		to = append(to, *value)
	}

	return to
}

// AsChannelAdminLogEventActionToggleForum returns copy with only ChannelAdminLogEventActionToggleForum constructors.
func (s ChannelAdminLogEventActionClassArray) AsChannelAdminLogEventActionToggleForum() (to ChannelAdminLogEventActionToggleForumArray) {
	for _, elem := range s {
		value, ok := elem.(*ChannelAdminLogEventActionToggleForum)
		if !ok {
			continue
		}
		to = append(to, *value)
	}

	return to
}

// AsChannelAdminLogEventActionCreateTopic returns copy with only ChannelAdminLogEventActionCreateTopic constructors.
func (s ChannelAdminLogEventActionClassArray) AsChannelAdminLogEventActionCreateTopic() (to ChannelAdminLogEventActionCreateTopicArray) {
	for _, elem := range s {
		value, ok := elem.(*ChannelAdminLogEventActionCreateTopic)
		if !ok {
			continue
		}
		to = append(to, *value)
	}

	return to
}

// AsChannelAdminLogEventActionEditTopic returns copy with only ChannelAdminLogEventActionEditTopic constructors.
func (s ChannelAdminLogEventActionClassArray) AsChannelAdminLogEventActionEditTopic() (to ChannelAdminLogEventActionEditTopicArray) {
	for _, elem := range s {
		value, ok := elem.(*ChannelAdminLogEventActionEditTopic)
		if !ok {
			continue
		}
		to = append(to, *value)
	}

	return to
}

// AsChannelAdminLogEventActionDeleteTopic returns copy with only ChannelAdminLogEventActionDeleteTopic constructors.
func (s ChannelAdminLogEventActionClassArray) AsChannelAdminLogEventActionDeleteTopic() (to ChannelAdminLogEventActionDeleteTopicArray) {
	for _, elem := range s {
		value, ok := elem.(*ChannelAdminLogEventActionDeleteTopic)
		if !ok {
			continue
		}
		to = append(to, *value)
	}

	return to
}

// AsChannelAdminLogEventActionPinTopic returns copy with only ChannelAdminLogEventActionPinTopic constructors.
func (s ChannelAdminLogEventActionClassArray) AsChannelAdminLogEventActionPinTopic() (to ChannelAdminLogEventActionPinTopicArray) {
	for _, elem := range s {
		value, ok := elem.(*ChannelAdminLogEventActionPinTopic)
		if !ok {
			continue
		}
		to = append(to, *value)
	}

	return to
}

// AsChannelAdminLogEventActionToggleAntiSpam returns copy with only ChannelAdminLogEventActionToggleAntiSpam constructors.
func (s ChannelAdminLogEventActionClassArray) AsChannelAdminLogEventActionToggleAntiSpam() (to ChannelAdminLogEventActionToggleAntiSpamArray) {
	for _, elem := range s {
		value, ok := elem.(*ChannelAdminLogEventActionToggleAntiSpam)
		if !ok {
			continue
		}
		to = append(to, *value)
	}

	return to
}

// AsChannelAdminLogEventActionChangePeerColor returns copy with only ChannelAdminLogEventActionChangePeerColor constructors.
func (s ChannelAdminLogEventActionClassArray) AsChannelAdminLogEventActionChangePeerColor() (to ChannelAdminLogEventActionChangePeerColorArray) {
	for _, elem := range s {
		value, ok := elem.(*ChannelAdminLogEventActionChangePeerColor)
		if !ok {
			continue
		}
		to = append(to, *value)
	}

	return to
}

// AsChannelAdminLogEventActionChangeProfilePeerColor returns copy with only ChannelAdminLogEventActionChangeProfilePeerColor constructors.
func (s ChannelAdminLogEventActionClassArray) AsChannelAdminLogEventActionChangeProfilePeerColor() (to ChannelAdminLogEventActionChangeProfilePeerColorArray) {
	for _, elem := range s {
		value, ok := elem.(*ChannelAdminLogEventActionChangeProfilePeerColor)
		if !ok {
			continue
		}
		to = append(to, *value)
	}

	return to
}

// AsChannelAdminLogEventActionChangeWallpaper returns copy with only ChannelAdminLogEventActionChangeWallpaper constructors.
func (s ChannelAdminLogEventActionClassArray) AsChannelAdminLogEventActionChangeWallpaper() (to ChannelAdminLogEventActionChangeWallpaperArray) {
	for _, elem := range s {
		value, ok := elem.(*ChannelAdminLogEventActionChangeWallpaper)
		if !ok {
			continue
		}
		to = append(to, *value)
	}

	return to
}

// AsChannelAdminLogEventActionChangeEmojiStatus returns copy with only ChannelAdminLogEventActionChangeEmojiStatus constructors.
func (s ChannelAdminLogEventActionClassArray) AsChannelAdminLogEventActionChangeEmojiStatus() (to ChannelAdminLogEventActionChangeEmojiStatusArray) {
	for _, elem := range s {
		value, ok := elem.(*ChannelAdminLogEventActionChangeEmojiStatus)
		if !ok {
			continue
		}
		to = append(to, *value)
	}

	return to
}

// AsChannelAdminLogEventActionChangeEmojiStickerSet returns copy with only ChannelAdminLogEventActionChangeEmojiStickerSet constructors.
func (s ChannelAdminLogEventActionClassArray) AsChannelAdminLogEventActionChangeEmojiStickerSet() (to ChannelAdminLogEventActionChangeEmojiStickerSetArray) {
	for _, elem := range s {
		value, ok := elem.(*ChannelAdminLogEventActionChangeEmojiStickerSet)
		if !ok {
			continue
		}
		to = append(to, *value)
	}

	return to
}

// AsChannelAdminLogEventActionToggleSignatureProfiles returns copy with only ChannelAdminLogEventActionToggleSignatureProfiles constructors.
func (s ChannelAdminLogEventActionClassArray) AsChannelAdminLogEventActionToggleSignatureProfiles() (to ChannelAdminLogEventActionToggleSignatureProfilesArray) {
	for _, elem := range s {
		value, ok := elem.(*ChannelAdminLogEventActionToggleSignatureProfiles)
		if !ok {
			continue
		}
		to = append(to, *value)
	}

	return to
}

// AsChannelAdminLogEventActionParticipantSubExtend returns copy with only ChannelAdminLogEventActionParticipantSubExtend constructors.
func (s ChannelAdminLogEventActionClassArray) AsChannelAdminLogEventActionParticipantSubExtend() (to ChannelAdminLogEventActionParticipantSubExtendArray) {
	for _, elem := range s {
		value, ok := elem.(*ChannelAdminLogEventActionParticipantSubExtend)
		if !ok {
			continue
		}
		to = append(to, *value)
	}

	return to
}

// AsChannelAdminLogEventActionToggleAutotranslation returns copy with only ChannelAdminLogEventActionToggleAutotranslation constructors.
func (s ChannelAdminLogEventActionClassArray) AsChannelAdminLogEventActionToggleAutotranslation() (to ChannelAdminLogEventActionToggleAutotranslationArray) {
	for _, elem := range s {
		value, ok := elem.(*ChannelAdminLogEventActionToggleAutotranslation)
		if !ok {
			continue
		}
		to = append(to, *value)
	}

	return to
}

// ChannelAdminLogEventActionChangeTitleArray is adapter for slice of ChannelAdminLogEventActionChangeTitle.
type ChannelAdminLogEventActionChangeTitleArray []ChannelAdminLogEventActionChangeTitle

// Sort sorts slice of ChannelAdminLogEventActionChangeTitle.
func (s ChannelAdminLogEventActionChangeTitleArray) Sort(less func(a, b ChannelAdminLogEventActionChangeTitle) bool) ChannelAdminLogEventActionChangeTitleArray {
	sort.Slice(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// SortStable sorts slice of ChannelAdminLogEventActionChangeTitle.
func (s ChannelAdminLogEventActionChangeTitleArray) SortStable(less func(a, b ChannelAdminLogEventActionChangeTitle) bool) ChannelAdminLogEventActionChangeTitleArray {
	sort.SliceStable(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// Retain filters in-place slice of ChannelAdminLogEventActionChangeTitle.
func (s ChannelAdminLogEventActionChangeTitleArray) Retain(keep func(x ChannelAdminLogEventActionChangeTitle) bool) ChannelAdminLogEventActionChangeTitleArray {
	n := 0
	for _, x := range s {
		if keep(x) {
			s[n] = x
			n++
		}
	}
	s = s[:n]

	return s
}

// First returns first element of slice (if exists).
func (s ChannelAdminLogEventActionChangeTitleArray) First() (v ChannelAdminLogEventActionChangeTitle, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[0], true
}

// Last returns last element of slice (if exists).
func (s ChannelAdminLogEventActionChangeTitleArray) Last() (v ChannelAdminLogEventActionChangeTitle, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[len(s)-1], true
}

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

	a := *s
	v = a[0]

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

	return v, true
}

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

	a := *s
	v = a[len(a)-1]
	a = a[:len(a)-1]
	*s = a

	return v, true
}

// ChannelAdminLogEventActionChangeAboutArray is adapter for slice of ChannelAdminLogEventActionChangeAbout.
type ChannelAdminLogEventActionChangeAboutArray []ChannelAdminLogEventActionChangeAbout

// Sort sorts slice of ChannelAdminLogEventActionChangeAbout.
func (s ChannelAdminLogEventActionChangeAboutArray) Sort(less func(a, b ChannelAdminLogEventActionChangeAbout) bool) ChannelAdminLogEventActionChangeAboutArray {
	sort.Slice(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// SortStable sorts slice of ChannelAdminLogEventActionChangeAbout.
func (s ChannelAdminLogEventActionChangeAboutArray) SortStable(less func(a, b ChannelAdminLogEventActionChangeAbout) bool) ChannelAdminLogEventActionChangeAboutArray {
	sort.SliceStable(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// Retain filters in-place slice of ChannelAdminLogEventActionChangeAbout.
func (s ChannelAdminLogEventActionChangeAboutArray) Retain(keep func(x ChannelAdminLogEventActionChangeAbout) bool) ChannelAdminLogEventActionChangeAboutArray {
	n := 0
	for _, x := range s {
		if keep(x) {
			s[n] = x
			n++
		}
	}
	s = s[:n]

	return s
}

// First returns first element of slice (if exists).
func (s ChannelAdminLogEventActionChangeAboutArray) First() (v ChannelAdminLogEventActionChangeAbout, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[0], true
}

// Last returns last element of slice (if exists).
func (s ChannelAdminLogEventActionChangeAboutArray) Last() (v ChannelAdminLogEventActionChangeAbout, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[len(s)-1], true
}

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

	a := *s
	v = a[0]

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

	return v, true
}

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

	a := *s
	v = a[len(a)-1]
	a = a[:len(a)-1]
	*s = a

	return v, true
}

// ChannelAdminLogEventActionChangeUsernameArray is adapter for slice of ChannelAdminLogEventActionChangeUsername.
type ChannelAdminLogEventActionChangeUsernameArray []ChannelAdminLogEventActionChangeUsername

// Sort sorts slice of ChannelAdminLogEventActionChangeUsername.
func (s ChannelAdminLogEventActionChangeUsernameArray) Sort(less func(a, b ChannelAdminLogEventActionChangeUsername) bool) ChannelAdminLogEventActionChangeUsernameArray {
	sort.Slice(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// SortStable sorts slice of ChannelAdminLogEventActionChangeUsername.
func (s ChannelAdminLogEventActionChangeUsernameArray) SortStable(less func(a, b ChannelAdminLogEventActionChangeUsername) bool) ChannelAdminLogEventActionChangeUsernameArray {
	sort.SliceStable(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// Retain filters in-place slice of ChannelAdminLogEventActionChangeUsername.
func (s ChannelAdminLogEventActionChangeUsernameArray) Retain(keep func(x ChannelAdminLogEventActionChangeUsername) bool) ChannelAdminLogEventActionChangeUsernameArray {
	n := 0
	for _, x := range s {
		if keep(x) {
			s[n] = x
			n++
		}
	}
	s = s[:n]

	return s
}

// First returns first element of slice (if exists).
func (s ChannelAdminLogEventActionChangeUsernameArray) First() (v ChannelAdminLogEventActionChangeUsername, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[0], true
}

// Last returns last element of slice (if exists).
func (s ChannelAdminLogEventActionChangeUsernameArray) Last() (v ChannelAdminLogEventActionChangeUsername, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[len(s)-1], true
}

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

	a := *s
	v = a[0]

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

	return v, true
}

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

	a := *s
	v = a[len(a)-1]
	a = a[:len(a)-1]
	*s = a

	return v, true
}

// ChannelAdminLogEventActionChangePhotoArray is adapter for slice of ChannelAdminLogEventActionChangePhoto.
type ChannelAdminLogEventActionChangePhotoArray []ChannelAdminLogEventActionChangePhoto

// Sort sorts slice of ChannelAdminLogEventActionChangePhoto.
func (s ChannelAdminLogEventActionChangePhotoArray) Sort(less func(a, b ChannelAdminLogEventActionChangePhoto) bool) ChannelAdminLogEventActionChangePhotoArray {
	sort.Slice(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// SortStable sorts slice of ChannelAdminLogEventActionChangePhoto.
func (s ChannelAdminLogEventActionChangePhotoArray) SortStable(less func(a, b ChannelAdminLogEventActionChangePhoto) bool) ChannelAdminLogEventActionChangePhotoArray {
	sort.SliceStable(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// Retain filters in-place slice of ChannelAdminLogEventActionChangePhoto.
func (s ChannelAdminLogEventActionChangePhotoArray) Retain(keep func(x ChannelAdminLogEventActionChangePhoto) bool) ChannelAdminLogEventActionChangePhotoArray {
	n := 0
	for _, x := range s {
		if keep(x) {
			s[n] = x
			n++
		}
	}
	s = s[:n]

	return s
}

// First returns first element of slice (if exists).
func (s ChannelAdminLogEventActionChangePhotoArray) First() (v ChannelAdminLogEventActionChangePhoto, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[0], true
}

// Last returns last element of slice (if exists).
func (s ChannelAdminLogEventActionChangePhotoArray) Last() (v ChannelAdminLogEventActionChangePhoto, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[len(s)-1], true
}

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

	a := *s
	v = a[0]

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

	return v, true
}

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

	a := *s
	v = a[len(a)-1]
	a = a[:len(a)-1]
	*s = a

	return v, true
}

// ChannelAdminLogEventActionToggleInvitesArray is adapter for slice of ChannelAdminLogEventActionToggleInvites.
type ChannelAdminLogEventActionToggleInvitesArray []ChannelAdminLogEventActionToggleInvites

// Sort sorts slice of ChannelAdminLogEventActionToggleInvites.
func (s ChannelAdminLogEventActionToggleInvitesArray) Sort(less func(a, b ChannelAdminLogEventActionToggleInvites) bool) ChannelAdminLogEventActionToggleInvitesArray {
	sort.Slice(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// SortStable sorts slice of ChannelAdminLogEventActionToggleInvites.
func (s ChannelAdminLogEventActionToggleInvitesArray) SortStable(less func(a, b ChannelAdminLogEventActionToggleInvites) bool) ChannelAdminLogEventActionToggleInvitesArray {
	sort.SliceStable(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// Retain filters in-place slice of ChannelAdminLogEventActionToggleInvites.
func (s ChannelAdminLogEventActionToggleInvitesArray) Retain(keep func(x ChannelAdminLogEventActionToggleInvites) bool) ChannelAdminLogEventActionToggleInvitesArray {
	n := 0
	for _, x := range s {
		if keep(x) {
			s[n] = x
			n++
		}
	}
	s = s[:n]

	return s
}

// First returns first element of slice (if exists).
func (s ChannelAdminLogEventActionToggleInvitesArray) First() (v ChannelAdminLogEventActionToggleInvites, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[0], true
}

// Last returns last element of slice (if exists).
func (s ChannelAdminLogEventActionToggleInvitesArray) Last() (v ChannelAdminLogEventActionToggleInvites, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[len(s)-1], true
}

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

	a := *s
	v = a[0]

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

	return v, true
}

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

	a := *s
	v = a[len(a)-1]
	a = a[:len(a)-1]
	*s = a

	return v, true
}

// ChannelAdminLogEventActionToggleSignaturesArray is adapter for slice of ChannelAdminLogEventActionToggleSignatures.
type ChannelAdminLogEventActionToggleSignaturesArray []ChannelAdminLogEventActionToggleSignatures

// Sort sorts slice of ChannelAdminLogEventActionToggleSignatures.
func (s ChannelAdminLogEventActionToggleSignaturesArray) Sort(less func(a, b ChannelAdminLogEventActionToggleSignatures) bool) ChannelAdminLogEventActionToggleSignaturesArray {
	sort.Slice(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// SortStable sorts slice of ChannelAdminLogEventActionToggleSignatures.
func (s ChannelAdminLogEventActionToggleSignaturesArray) SortStable(less func(a, b ChannelAdminLogEventActionToggleSignatures) bool) ChannelAdminLogEventActionToggleSignaturesArray {
	sort.SliceStable(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// Retain filters in-place slice of ChannelAdminLogEventActionToggleSignatures.
func (s ChannelAdminLogEventActionToggleSignaturesArray) Retain(keep func(x ChannelAdminLogEventActionToggleSignatures) bool) ChannelAdminLogEventActionToggleSignaturesArray {
	n := 0
	for _, x := range s {
		if keep(x) {
			s[n] = x
			n++
		}
	}
	s = s[:n]

	return s
}

// First returns first element of slice (if exists).
func (s ChannelAdminLogEventActionToggleSignaturesArray) First() (v ChannelAdminLogEventActionToggleSignatures, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[0], true
}

// Last returns last element of slice (if exists).
func (s ChannelAdminLogEventActionToggleSignaturesArray) Last() (v ChannelAdminLogEventActionToggleSignatures, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[len(s)-1], true
}

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

	a := *s
	v = a[0]

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

	return v, true
}

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

	a := *s
	v = a[len(a)-1]
	a = a[:len(a)-1]
	*s = a

	return v, true
}

// ChannelAdminLogEventActionUpdatePinnedArray is adapter for slice of ChannelAdminLogEventActionUpdatePinned.
type ChannelAdminLogEventActionUpdatePinnedArray []ChannelAdminLogEventActionUpdatePinned

// Sort sorts slice of ChannelAdminLogEventActionUpdatePinned.
func (s ChannelAdminLogEventActionUpdatePinnedArray) Sort(less func(a, b ChannelAdminLogEventActionUpdatePinned) bool) ChannelAdminLogEventActionUpdatePinnedArray {
	sort.Slice(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// SortStable sorts slice of ChannelAdminLogEventActionUpdatePinned.
func (s ChannelAdminLogEventActionUpdatePinnedArray) SortStable(less func(a, b ChannelAdminLogEventActionUpdatePinned) bool) ChannelAdminLogEventActionUpdatePinnedArray {
	sort.SliceStable(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// Retain filters in-place slice of ChannelAdminLogEventActionUpdatePinned.
func (s ChannelAdminLogEventActionUpdatePinnedArray) Retain(keep func(x ChannelAdminLogEventActionUpdatePinned) bool) ChannelAdminLogEventActionUpdatePinnedArray {
	n := 0
	for _, x := range s {
		if keep(x) {
			s[n] = x
			n++
		}
	}
	s = s[:n]

	return s
}

// First returns first element of slice (if exists).
func (s ChannelAdminLogEventActionUpdatePinnedArray) First() (v ChannelAdminLogEventActionUpdatePinned, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[0], true
}

// Last returns last element of slice (if exists).
func (s ChannelAdminLogEventActionUpdatePinnedArray) Last() (v ChannelAdminLogEventActionUpdatePinned, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[len(s)-1], true
}

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

	a := *s
	v = a[0]

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

	return v, true
}

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

	a := *s
	v = a[len(a)-1]
	a = a[:len(a)-1]
	*s = a

	return v, true
}

// ChannelAdminLogEventActionEditMessageArray is adapter for slice of ChannelAdminLogEventActionEditMessage.
type ChannelAdminLogEventActionEditMessageArray []ChannelAdminLogEventActionEditMessage

// Sort sorts slice of ChannelAdminLogEventActionEditMessage.
func (s ChannelAdminLogEventActionEditMessageArray) Sort(less func(a, b ChannelAdminLogEventActionEditMessage) bool) ChannelAdminLogEventActionEditMessageArray {
	sort.Slice(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// SortStable sorts slice of ChannelAdminLogEventActionEditMessage.
func (s ChannelAdminLogEventActionEditMessageArray) SortStable(less func(a, b ChannelAdminLogEventActionEditMessage) bool) ChannelAdminLogEventActionEditMessageArray {
	sort.SliceStable(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// Retain filters in-place slice of ChannelAdminLogEventActionEditMessage.
func (s ChannelAdminLogEventActionEditMessageArray) Retain(keep func(x ChannelAdminLogEventActionEditMessage) bool) ChannelAdminLogEventActionEditMessageArray {
	n := 0
	for _, x := range s {
		if keep(x) {
			s[n] = x
			n++
		}
	}
	s = s[:n]

	return s
}

// First returns first element of slice (if exists).
func (s ChannelAdminLogEventActionEditMessageArray) First() (v ChannelAdminLogEventActionEditMessage, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[0], true
}

// Last returns last element of slice (if exists).
func (s ChannelAdminLogEventActionEditMessageArray) Last() (v ChannelAdminLogEventActionEditMessage, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[len(s)-1], true
}

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

	a := *s
	v = a[0]

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

	return v, true
}

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

	a := *s
	v = a[len(a)-1]
	a = a[:len(a)-1]
	*s = a

	return v, true
}

// ChannelAdminLogEventActionDeleteMessageArray is adapter for slice of ChannelAdminLogEventActionDeleteMessage.
type ChannelAdminLogEventActionDeleteMessageArray []ChannelAdminLogEventActionDeleteMessage

// Sort sorts slice of ChannelAdminLogEventActionDeleteMessage.
func (s ChannelAdminLogEventActionDeleteMessageArray) Sort(less func(a, b ChannelAdminLogEventActionDeleteMessage) bool) ChannelAdminLogEventActionDeleteMessageArray {
	sort.Slice(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// SortStable sorts slice of ChannelAdminLogEventActionDeleteMessage.
func (s ChannelAdminLogEventActionDeleteMessageArray) SortStable(less func(a, b ChannelAdminLogEventActionDeleteMessage) bool) ChannelAdminLogEventActionDeleteMessageArray {
	sort.SliceStable(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// Retain filters in-place slice of ChannelAdminLogEventActionDeleteMessage.
func (s ChannelAdminLogEventActionDeleteMessageArray) Retain(keep func(x ChannelAdminLogEventActionDeleteMessage) bool) ChannelAdminLogEventActionDeleteMessageArray {
	n := 0
	for _, x := range s {
		if keep(x) {
			s[n] = x
			n++
		}
	}
	s = s[:n]

	return s
}

// First returns first element of slice (if exists).
func (s ChannelAdminLogEventActionDeleteMessageArray) First() (v ChannelAdminLogEventActionDeleteMessage, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[0], true
}

// Last returns last element of slice (if exists).
func (s ChannelAdminLogEventActionDeleteMessageArray) Last() (v ChannelAdminLogEventActionDeleteMessage, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[len(s)-1], true
}

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

	a := *s
	v = a[0]

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

	return v, true
}

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

	a := *s
	v = a[len(a)-1]
	a = a[:len(a)-1]
	*s = a

	return v, true
}

// ChannelAdminLogEventActionParticipantInviteArray is adapter for slice of ChannelAdminLogEventActionParticipantInvite.
type ChannelAdminLogEventActionParticipantInviteArray []ChannelAdminLogEventActionParticipantInvite

// Sort sorts slice of ChannelAdminLogEventActionParticipantInvite.
func (s ChannelAdminLogEventActionParticipantInviteArray) Sort(less func(a, b ChannelAdminLogEventActionParticipantInvite) bool) ChannelAdminLogEventActionParticipantInviteArray {
	sort.Slice(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// SortStable sorts slice of ChannelAdminLogEventActionParticipantInvite.
func (s ChannelAdminLogEventActionParticipantInviteArray) SortStable(less func(a, b ChannelAdminLogEventActionParticipantInvite) bool) ChannelAdminLogEventActionParticipantInviteArray {
	sort.SliceStable(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// Retain filters in-place slice of ChannelAdminLogEventActionParticipantInvite.
func (s ChannelAdminLogEventActionParticipantInviteArray) Retain(keep func(x ChannelAdminLogEventActionParticipantInvite) bool) ChannelAdminLogEventActionParticipantInviteArray {
	n := 0
	for _, x := range s {
		if keep(x) {
			s[n] = x
			n++
		}
	}
	s = s[:n]

	return s
}

// First returns first element of slice (if exists).
func (s ChannelAdminLogEventActionParticipantInviteArray) First() (v ChannelAdminLogEventActionParticipantInvite, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[0], true
}

// Last returns last element of slice (if exists).
func (s ChannelAdminLogEventActionParticipantInviteArray) Last() (v ChannelAdminLogEventActionParticipantInvite, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[len(s)-1], true
}

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

	a := *s
	v = a[0]

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

	return v, true
}

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

	a := *s
	v = a[len(a)-1]
	a = a[:len(a)-1]
	*s = a

	return v, true
}

// ChannelAdminLogEventActionParticipantToggleBanArray is adapter for slice of ChannelAdminLogEventActionParticipantToggleBan.
type ChannelAdminLogEventActionParticipantToggleBanArray []ChannelAdminLogEventActionParticipantToggleBan

// Sort sorts slice of ChannelAdminLogEventActionParticipantToggleBan.
func (s ChannelAdminLogEventActionParticipantToggleBanArray) Sort(less func(a, b ChannelAdminLogEventActionParticipantToggleBan) bool) ChannelAdminLogEventActionParticipantToggleBanArray {
	sort.Slice(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// SortStable sorts slice of ChannelAdminLogEventActionParticipantToggleBan.
func (s ChannelAdminLogEventActionParticipantToggleBanArray) SortStable(less func(a, b ChannelAdminLogEventActionParticipantToggleBan) bool) ChannelAdminLogEventActionParticipantToggleBanArray {
	sort.SliceStable(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// Retain filters in-place slice of ChannelAdminLogEventActionParticipantToggleBan.
func (s ChannelAdminLogEventActionParticipantToggleBanArray) Retain(keep func(x ChannelAdminLogEventActionParticipantToggleBan) bool) ChannelAdminLogEventActionParticipantToggleBanArray {
	n := 0
	for _, x := range s {
		if keep(x) {
			s[n] = x
			n++
		}
	}
	s = s[:n]

	return s
}

// First returns first element of slice (if exists).
func (s ChannelAdminLogEventActionParticipantToggleBanArray) First() (v ChannelAdminLogEventActionParticipantToggleBan, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[0], true
}

// Last returns last element of slice (if exists).
func (s ChannelAdminLogEventActionParticipantToggleBanArray) Last() (v ChannelAdminLogEventActionParticipantToggleBan, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[len(s)-1], true
}

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

	a := *s
	v = a[0]

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

	return v, true
}

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

	a := *s
	v = a[len(a)-1]
	a = a[:len(a)-1]
	*s = a

	return v, true
}

// ChannelAdminLogEventActionParticipantToggleAdminArray is adapter for slice of ChannelAdminLogEventActionParticipantToggleAdmin.
type ChannelAdminLogEventActionParticipantToggleAdminArray []ChannelAdminLogEventActionParticipantToggleAdmin

// Sort sorts slice of ChannelAdminLogEventActionParticipantToggleAdmin.
func (s ChannelAdminLogEventActionParticipantToggleAdminArray) Sort(less func(a, b ChannelAdminLogEventActionParticipantToggleAdmin) bool) ChannelAdminLogEventActionParticipantToggleAdminArray {
	sort.Slice(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// SortStable sorts slice of ChannelAdminLogEventActionParticipantToggleAdmin.
func (s ChannelAdminLogEventActionParticipantToggleAdminArray) SortStable(less func(a, b ChannelAdminLogEventActionParticipantToggleAdmin) bool) ChannelAdminLogEventActionParticipantToggleAdminArray {
	sort.SliceStable(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// Retain filters in-place slice of ChannelAdminLogEventActionParticipantToggleAdmin.
func (s ChannelAdminLogEventActionParticipantToggleAdminArray) Retain(keep func(x ChannelAdminLogEventActionParticipantToggleAdmin) bool) ChannelAdminLogEventActionParticipantToggleAdminArray {
	n := 0
	for _, x := range s {
		if keep(x) {
			s[n] = x
			n++
		}
	}
	s = s[:n]

	return s
}

// First returns first element of slice (if exists).
func (s ChannelAdminLogEventActionParticipantToggleAdminArray) First() (v ChannelAdminLogEventActionParticipantToggleAdmin, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[0], true
}

// Last returns last element of slice (if exists).
func (s ChannelAdminLogEventActionParticipantToggleAdminArray) Last() (v ChannelAdminLogEventActionParticipantToggleAdmin, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[len(s)-1], true
}

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

	a := *s
	v = a[0]

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

	return v, true
}

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

	a := *s
	v = a[len(a)-1]
	a = a[:len(a)-1]
	*s = a

	return v, true
}

// ChannelAdminLogEventActionChangeStickerSetArray is adapter for slice of ChannelAdminLogEventActionChangeStickerSet.
type ChannelAdminLogEventActionChangeStickerSetArray []ChannelAdminLogEventActionChangeStickerSet

// Sort sorts slice of ChannelAdminLogEventActionChangeStickerSet.
func (s ChannelAdminLogEventActionChangeStickerSetArray) Sort(less func(a, b ChannelAdminLogEventActionChangeStickerSet) bool) ChannelAdminLogEventActionChangeStickerSetArray {
	sort.Slice(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// SortStable sorts slice of ChannelAdminLogEventActionChangeStickerSet.
func (s ChannelAdminLogEventActionChangeStickerSetArray) SortStable(less func(a, b ChannelAdminLogEventActionChangeStickerSet) bool) ChannelAdminLogEventActionChangeStickerSetArray {
	sort.SliceStable(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// Retain filters in-place slice of ChannelAdminLogEventActionChangeStickerSet.
func (s ChannelAdminLogEventActionChangeStickerSetArray) Retain(keep func(x ChannelAdminLogEventActionChangeStickerSet) bool) ChannelAdminLogEventActionChangeStickerSetArray {
	n := 0
	for _, x := range s {
		if keep(x) {
			s[n] = x
			n++
		}
	}
	s = s[:n]

	return s
}

// First returns first element of slice (if exists).
func (s ChannelAdminLogEventActionChangeStickerSetArray) First() (v ChannelAdminLogEventActionChangeStickerSet, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[0], true
}

// Last returns last element of slice (if exists).
func (s ChannelAdminLogEventActionChangeStickerSetArray) Last() (v ChannelAdminLogEventActionChangeStickerSet, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[len(s)-1], true
}

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

	a := *s
	v = a[0]

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

	return v, true
}

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

	a := *s
	v = a[len(a)-1]
	a = a[:len(a)-1]
	*s = a

	return v, true
}

// ChannelAdminLogEventActionTogglePreHistoryHiddenArray is adapter for slice of ChannelAdminLogEventActionTogglePreHistoryHidden.
type ChannelAdminLogEventActionTogglePreHistoryHiddenArray []ChannelAdminLogEventActionTogglePreHistoryHidden

// Sort sorts slice of ChannelAdminLogEventActionTogglePreHistoryHidden.
func (s ChannelAdminLogEventActionTogglePreHistoryHiddenArray) Sort(less func(a, b ChannelAdminLogEventActionTogglePreHistoryHidden) bool) ChannelAdminLogEventActionTogglePreHistoryHiddenArray {
	sort.Slice(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// SortStable sorts slice of ChannelAdminLogEventActionTogglePreHistoryHidden.
func (s ChannelAdminLogEventActionTogglePreHistoryHiddenArray) SortStable(less func(a, b ChannelAdminLogEventActionTogglePreHistoryHidden) bool) ChannelAdminLogEventActionTogglePreHistoryHiddenArray {
	sort.SliceStable(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// Retain filters in-place slice of ChannelAdminLogEventActionTogglePreHistoryHidden.
func (s ChannelAdminLogEventActionTogglePreHistoryHiddenArray) Retain(keep func(x ChannelAdminLogEventActionTogglePreHistoryHidden) bool) ChannelAdminLogEventActionTogglePreHistoryHiddenArray {
	n := 0
	for _, x := range s {
		if keep(x) {
			s[n] = x
			n++
		}
	}
	s = s[:n]

	return s
}

// First returns first element of slice (if exists).
func (s ChannelAdminLogEventActionTogglePreHistoryHiddenArray) First() (v ChannelAdminLogEventActionTogglePreHistoryHidden, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[0], true
}

// Last returns last element of slice (if exists).
func (s ChannelAdminLogEventActionTogglePreHistoryHiddenArray) Last() (v ChannelAdminLogEventActionTogglePreHistoryHidden, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[len(s)-1], true
}

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

	a := *s
	v = a[0]

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

	return v, true
}

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

	a := *s
	v = a[len(a)-1]
	a = a[:len(a)-1]
	*s = a

	return v, true
}

// ChannelAdminLogEventActionDefaultBannedRightsArray is adapter for slice of ChannelAdminLogEventActionDefaultBannedRights.
type ChannelAdminLogEventActionDefaultBannedRightsArray []ChannelAdminLogEventActionDefaultBannedRights

// Sort sorts slice of ChannelAdminLogEventActionDefaultBannedRights.
func (s ChannelAdminLogEventActionDefaultBannedRightsArray) Sort(less func(a, b ChannelAdminLogEventActionDefaultBannedRights) bool) ChannelAdminLogEventActionDefaultBannedRightsArray {
	sort.Slice(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// SortStable sorts slice of ChannelAdminLogEventActionDefaultBannedRights.
func (s ChannelAdminLogEventActionDefaultBannedRightsArray) SortStable(less func(a, b ChannelAdminLogEventActionDefaultBannedRights) bool) ChannelAdminLogEventActionDefaultBannedRightsArray {
	sort.SliceStable(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// Retain filters in-place slice of ChannelAdminLogEventActionDefaultBannedRights.
func (s ChannelAdminLogEventActionDefaultBannedRightsArray) Retain(keep func(x ChannelAdminLogEventActionDefaultBannedRights) bool) ChannelAdminLogEventActionDefaultBannedRightsArray {
	n := 0
	for _, x := range s {
		if keep(x) {
			s[n] = x
			n++
		}
	}
	s = s[:n]

	return s
}

// First returns first element of slice (if exists).
func (s ChannelAdminLogEventActionDefaultBannedRightsArray) First() (v ChannelAdminLogEventActionDefaultBannedRights, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[0], true
}

// Last returns last element of slice (if exists).
func (s ChannelAdminLogEventActionDefaultBannedRightsArray) Last() (v ChannelAdminLogEventActionDefaultBannedRights, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[len(s)-1], true
}

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

	a := *s
	v = a[0]

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

	return v, true
}

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

	a := *s
	v = a[len(a)-1]
	a = a[:len(a)-1]
	*s = a

	return v, true
}

// ChannelAdminLogEventActionStopPollArray is adapter for slice of ChannelAdminLogEventActionStopPoll.
type ChannelAdminLogEventActionStopPollArray []ChannelAdminLogEventActionStopPoll

// Sort sorts slice of ChannelAdminLogEventActionStopPoll.
func (s ChannelAdminLogEventActionStopPollArray) Sort(less func(a, b ChannelAdminLogEventActionStopPoll) bool) ChannelAdminLogEventActionStopPollArray {
	sort.Slice(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// SortStable sorts slice of ChannelAdminLogEventActionStopPoll.
func (s ChannelAdminLogEventActionStopPollArray) SortStable(less func(a, b ChannelAdminLogEventActionStopPoll) bool) ChannelAdminLogEventActionStopPollArray {
	sort.SliceStable(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// Retain filters in-place slice of ChannelAdminLogEventActionStopPoll.
func (s ChannelAdminLogEventActionStopPollArray) Retain(keep func(x ChannelAdminLogEventActionStopPoll) bool) ChannelAdminLogEventActionStopPollArray {
	n := 0
	for _, x := range s {
		if keep(x) {
			s[n] = x
			n++
		}
	}
	s = s[:n]

	return s
}

// First returns first element of slice (if exists).
func (s ChannelAdminLogEventActionStopPollArray) First() (v ChannelAdminLogEventActionStopPoll, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[0], true
}

// Last returns last element of slice (if exists).
func (s ChannelAdminLogEventActionStopPollArray) Last() (v ChannelAdminLogEventActionStopPoll, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[len(s)-1], true
}

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

	a := *s
	v = a[0]

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

	return v, true
}

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

	a := *s
	v = a[len(a)-1]
	a = a[:len(a)-1]
	*s = a

	return v, true
}

// ChannelAdminLogEventActionChangeLinkedChatArray is adapter for slice of ChannelAdminLogEventActionChangeLinkedChat.
type ChannelAdminLogEventActionChangeLinkedChatArray []ChannelAdminLogEventActionChangeLinkedChat

// Sort sorts slice of ChannelAdminLogEventActionChangeLinkedChat.
func (s ChannelAdminLogEventActionChangeLinkedChatArray) Sort(less func(a, b ChannelAdminLogEventActionChangeLinkedChat) bool) ChannelAdminLogEventActionChangeLinkedChatArray {
	sort.Slice(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// SortStable sorts slice of ChannelAdminLogEventActionChangeLinkedChat.
func (s ChannelAdminLogEventActionChangeLinkedChatArray) SortStable(less func(a, b ChannelAdminLogEventActionChangeLinkedChat) bool) ChannelAdminLogEventActionChangeLinkedChatArray {
	sort.SliceStable(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// Retain filters in-place slice of ChannelAdminLogEventActionChangeLinkedChat.
func (s ChannelAdminLogEventActionChangeLinkedChatArray) Retain(keep func(x ChannelAdminLogEventActionChangeLinkedChat) bool) ChannelAdminLogEventActionChangeLinkedChatArray {
	n := 0
	for _, x := range s {
		if keep(x) {
			s[n] = x
			n++
		}
	}
	s = s[:n]

	return s
}

// First returns first element of slice (if exists).
func (s ChannelAdminLogEventActionChangeLinkedChatArray) First() (v ChannelAdminLogEventActionChangeLinkedChat, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[0], true
}

// Last returns last element of slice (if exists).
func (s ChannelAdminLogEventActionChangeLinkedChatArray) Last() (v ChannelAdminLogEventActionChangeLinkedChat, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[len(s)-1], true
}

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

	a := *s
	v = a[0]

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

	return v, true
}

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

	a := *s
	v = a[len(a)-1]
	a = a[:len(a)-1]
	*s = a

	return v, true
}

// ChannelAdminLogEventActionChangeLocationArray is adapter for slice of ChannelAdminLogEventActionChangeLocation.
type ChannelAdminLogEventActionChangeLocationArray []ChannelAdminLogEventActionChangeLocation

// Sort sorts slice of ChannelAdminLogEventActionChangeLocation.
func (s ChannelAdminLogEventActionChangeLocationArray) Sort(less func(a, b ChannelAdminLogEventActionChangeLocation) bool) ChannelAdminLogEventActionChangeLocationArray {
	sort.Slice(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// SortStable sorts slice of ChannelAdminLogEventActionChangeLocation.
func (s ChannelAdminLogEventActionChangeLocationArray) SortStable(less func(a, b ChannelAdminLogEventActionChangeLocation) bool) ChannelAdminLogEventActionChangeLocationArray {
	sort.SliceStable(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// Retain filters in-place slice of ChannelAdminLogEventActionChangeLocation.
func (s ChannelAdminLogEventActionChangeLocationArray) Retain(keep func(x ChannelAdminLogEventActionChangeLocation) bool) ChannelAdminLogEventActionChangeLocationArray {
	n := 0
	for _, x := range s {
		if keep(x) {
			s[n] = x
			n++
		}
	}
	s = s[:n]

	return s
}

// First returns first element of slice (if exists).
func (s ChannelAdminLogEventActionChangeLocationArray) First() (v ChannelAdminLogEventActionChangeLocation, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[0], true
}

// Last returns last element of slice (if exists).
func (s ChannelAdminLogEventActionChangeLocationArray) Last() (v ChannelAdminLogEventActionChangeLocation, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[len(s)-1], true
}

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

	a := *s
	v = a[0]

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

	return v, true
}

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

	a := *s
	v = a[len(a)-1]
	a = a[:len(a)-1]
	*s = a

	return v, true
}

// ChannelAdminLogEventActionToggleSlowModeArray is adapter for slice of ChannelAdminLogEventActionToggleSlowMode.
type ChannelAdminLogEventActionToggleSlowModeArray []ChannelAdminLogEventActionToggleSlowMode

// Sort sorts slice of ChannelAdminLogEventActionToggleSlowMode.
func (s ChannelAdminLogEventActionToggleSlowModeArray) Sort(less func(a, b ChannelAdminLogEventActionToggleSlowMode) bool) ChannelAdminLogEventActionToggleSlowModeArray {
	sort.Slice(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// SortStable sorts slice of ChannelAdminLogEventActionToggleSlowMode.
func (s ChannelAdminLogEventActionToggleSlowModeArray) SortStable(less func(a, b ChannelAdminLogEventActionToggleSlowMode) bool) ChannelAdminLogEventActionToggleSlowModeArray {
	sort.SliceStable(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// Retain filters in-place slice of ChannelAdminLogEventActionToggleSlowMode.
func (s ChannelAdminLogEventActionToggleSlowModeArray) Retain(keep func(x ChannelAdminLogEventActionToggleSlowMode) bool) ChannelAdminLogEventActionToggleSlowModeArray {
	n := 0
	for _, x := range s {
		if keep(x) {
			s[n] = x
			n++
		}
	}
	s = s[:n]

	return s
}

// First returns first element of slice (if exists).
func (s ChannelAdminLogEventActionToggleSlowModeArray) First() (v ChannelAdminLogEventActionToggleSlowMode, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[0], true
}

// Last returns last element of slice (if exists).
func (s ChannelAdminLogEventActionToggleSlowModeArray) Last() (v ChannelAdminLogEventActionToggleSlowMode, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[len(s)-1], true
}

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

	a := *s
	v = a[0]

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

	return v, true
}

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

	a := *s
	v = a[len(a)-1]
	a = a[:len(a)-1]
	*s = a

	return v, true
}

// ChannelAdminLogEventActionStartGroupCallArray is adapter for slice of ChannelAdminLogEventActionStartGroupCall.
type ChannelAdminLogEventActionStartGroupCallArray []ChannelAdminLogEventActionStartGroupCall

// Sort sorts slice of ChannelAdminLogEventActionStartGroupCall.
func (s ChannelAdminLogEventActionStartGroupCallArray) Sort(less func(a, b ChannelAdminLogEventActionStartGroupCall) bool) ChannelAdminLogEventActionStartGroupCallArray {
	sort.Slice(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// SortStable sorts slice of ChannelAdminLogEventActionStartGroupCall.
func (s ChannelAdminLogEventActionStartGroupCallArray) SortStable(less func(a, b ChannelAdminLogEventActionStartGroupCall) bool) ChannelAdminLogEventActionStartGroupCallArray {
	sort.SliceStable(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// Retain filters in-place slice of ChannelAdminLogEventActionStartGroupCall.
func (s ChannelAdminLogEventActionStartGroupCallArray) Retain(keep func(x ChannelAdminLogEventActionStartGroupCall) bool) ChannelAdminLogEventActionStartGroupCallArray {
	n := 0
	for _, x := range s {
		if keep(x) {
			s[n] = x
			n++
		}
	}
	s = s[:n]

	return s
}

// First returns first element of slice (if exists).
func (s ChannelAdminLogEventActionStartGroupCallArray) First() (v ChannelAdminLogEventActionStartGroupCall, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[0], true
}

// Last returns last element of slice (if exists).
func (s ChannelAdminLogEventActionStartGroupCallArray) Last() (v ChannelAdminLogEventActionStartGroupCall, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[len(s)-1], true
}

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

	a := *s
	v = a[0]

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

	return v, true
}

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

	a := *s
	v = a[len(a)-1]
	a = a[:len(a)-1]
	*s = a

	return v, true
}

// ChannelAdminLogEventActionDiscardGroupCallArray is adapter for slice of ChannelAdminLogEventActionDiscardGroupCall.
type ChannelAdminLogEventActionDiscardGroupCallArray []ChannelAdminLogEventActionDiscardGroupCall

// Sort sorts slice of ChannelAdminLogEventActionDiscardGroupCall.
func (s ChannelAdminLogEventActionDiscardGroupCallArray) Sort(less func(a, b ChannelAdminLogEventActionDiscardGroupCall) bool) ChannelAdminLogEventActionDiscardGroupCallArray {
	sort.Slice(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// SortStable sorts slice of ChannelAdminLogEventActionDiscardGroupCall.
func (s ChannelAdminLogEventActionDiscardGroupCallArray) SortStable(less func(a, b ChannelAdminLogEventActionDiscardGroupCall) bool) ChannelAdminLogEventActionDiscardGroupCallArray {
	sort.SliceStable(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// Retain filters in-place slice of ChannelAdminLogEventActionDiscardGroupCall.
func (s ChannelAdminLogEventActionDiscardGroupCallArray) Retain(keep func(x ChannelAdminLogEventActionDiscardGroupCall) bool) ChannelAdminLogEventActionDiscardGroupCallArray {
	n := 0
	for _, x := range s {
		if keep(x) {
			s[n] = x
			n++
		}
	}
	s = s[:n]

	return s
}

// First returns first element of slice (if exists).
func (s ChannelAdminLogEventActionDiscardGroupCallArray) First() (v ChannelAdminLogEventActionDiscardGroupCall, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[0], true
}

// Last returns last element of slice (if exists).
func (s ChannelAdminLogEventActionDiscardGroupCallArray) Last() (v ChannelAdminLogEventActionDiscardGroupCall, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[len(s)-1], true
}

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

	a := *s
	v = a[0]

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

	return v, true
}

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

	a := *s
	v = a[len(a)-1]
	a = a[:len(a)-1]
	*s = a

	return v, true
}

// ChannelAdminLogEventActionParticipantMuteArray is adapter for slice of ChannelAdminLogEventActionParticipantMute.
type ChannelAdminLogEventActionParticipantMuteArray []ChannelAdminLogEventActionParticipantMute

// Sort sorts slice of ChannelAdminLogEventActionParticipantMute.
func (s ChannelAdminLogEventActionParticipantMuteArray) Sort(less func(a, b ChannelAdminLogEventActionParticipantMute) bool) ChannelAdminLogEventActionParticipantMuteArray {
	sort.Slice(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// SortStable sorts slice of ChannelAdminLogEventActionParticipantMute.
func (s ChannelAdminLogEventActionParticipantMuteArray) SortStable(less func(a, b ChannelAdminLogEventActionParticipantMute) bool) ChannelAdminLogEventActionParticipantMuteArray {
	sort.SliceStable(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// Retain filters in-place slice of ChannelAdminLogEventActionParticipantMute.
func (s ChannelAdminLogEventActionParticipantMuteArray) Retain(keep func(x ChannelAdminLogEventActionParticipantMute) bool) ChannelAdminLogEventActionParticipantMuteArray {
	n := 0
	for _, x := range s {
		if keep(x) {
			s[n] = x
			n++
		}
	}
	s = s[:n]

	return s
}

// First returns first element of slice (if exists).
func (s ChannelAdminLogEventActionParticipantMuteArray) First() (v ChannelAdminLogEventActionParticipantMute, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[0], true
}

// Last returns last element of slice (if exists).
func (s ChannelAdminLogEventActionParticipantMuteArray) Last() (v ChannelAdminLogEventActionParticipantMute, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[len(s)-1], true
}

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

	a := *s
	v = a[0]

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

	return v, true
}

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

	a := *s
	v = a[len(a)-1]
	a = a[:len(a)-1]
	*s = a

	return v, true
}

// ChannelAdminLogEventActionParticipantUnmuteArray is adapter for slice of ChannelAdminLogEventActionParticipantUnmute.
type ChannelAdminLogEventActionParticipantUnmuteArray []ChannelAdminLogEventActionParticipantUnmute

// Sort sorts slice of ChannelAdminLogEventActionParticipantUnmute.
func (s ChannelAdminLogEventActionParticipantUnmuteArray) Sort(less func(a, b ChannelAdminLogEventActionParticipantUnmute) bool) ChannelAdminLogEventActionParticipantUnmuteArray {
	sort.Slice(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// SortStable sorts slice of ChannelAdminLogEventActionParticipantUnmute.
func (s ChannelAdminLogEventActionParticipantUnmuteArray) SortStable(less func(a, b ChannelAdminLogEventActionParticipantUnmute) bool) ChannelAdminLogEventActionParticipantUnmuteArray {
	sort.SliceStable(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// Retain filters in-place slice of ChannelAdminLogEventActionParticipantUnmute.
func (s ChannelAdminLogEventActionParticipantUnmuteArray) Retain(keep func(x ChannelAdminLogEventActionParticipantUnmute) bool) ChannelAdminLogEventActionParticipantUnmuteArray {
	n := 0
	for _, x := range s {
		if keep(x) {
			s[n] = x
			n++
		}
	}
	s = s[:n]

	return s
}

// First returns first element of slice (if exists).
func (s ChannelAdminLogEventActionParticipantUnmuteArray) First() (v ChannelAdminLogEventActionParticipantUnmute, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[0], true
}

// Last returns last element of slice (if exists).
func (s ChannelAdminLogEventActionParticipantUnmuteArray) Last() (v ChannelAdminLogEventActionParticipantUnmute, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[len(s)-1], true
}

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

	a := *s
	v = a[0]

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

	return v, true
}

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

	a := *s
	v = a[len(a)-1]
	a = a[:len(a)-1]
	*s = a

	return v, true
}

// ChannelAdminLogEventActionToggleGroupCallSettingArray is adapter for slice of ChannelAdminLogEventActionToggleGroupCallSetting.
type ChannelAdminLogEventActionToggleGroupCallSettingArray []ChannelAdminLogEventActionToggleGroupCallSetting

// Sort sorts slice of ChannelAdminLogEventActionToggleGroupCallSetting.
func (s ChannelAdminLogEventActionToggleGroupCallSettingArray) Sort(less func(a, b ChannelAdminLogEventActionToggleGroupCallSetting) bool) ChannelAdminLogEventActionToggleGroupCallSettingArray {
	sort.Slice(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// SortStable sorts slice of ChannelAdminLogEventActionToggleGroupCallSetting.
func (s ChannelAdminLogEventActionToggleGroupCallSettingArray) SortStable(less func(a, b ChannelAdminLogEventActionToggleGroupCallSetting) bool) ChannelAdminLogEventActionToggleGroupCallSettingArray {
	sort.SliceStable(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// Retain filters in-place slice of ChannelAdminLogEventActionToggleGroupCallSetting.
func (s ChannelAdminLogEventActionToggleGroupCallSettingArray) Retain(keep func(x ChannelAdminLogEventActionToggleGroupCallSetting) bool) ChannelAdminLogEventActionToggleGroupCallSettingArray {
	n := 0
	for _, x := range s {
		if keep(x) {
			s[n] = x
			n++
		}
	}
	s = s[:n]

	return s
}

// First returns first element of slice (if exists).
func (s ChannelAdminLogEventActionToggleGroupCallSettingArray) First() (v ChannelAdminLogEventActionToggleGroupCallSetting, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[0], true
}

// Last returns last element of slice (if exists).
func (s ChannelAdminLogEventActionToggleGroupCallSettingArray) Last() (v ChannelAdminLogEventActionToggleGroupCallSetting, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[len(s)-1], true
}

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

	a := *s
	v = a[0]

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

	return v, true
}

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

	a := *s
	v = a[len(a)-1]
	a = a[:len(a)-1]
	*s = a

	return v, true
}

// ChannelAdminLogEventActionParticipantJoinByInviteArray is adapter for slice of ChannelAdminLogEventActionParticipantJoinByInvite.
type ChannelAdminLogEventActionParticipantJoinByInviteArray []ChannelAdminLogEventActionParticipantJoinByInvite

// Sort sorts slice of ChannelAdminLogEventActionParticipantJoinByInvite.
func (s ChannelAdminLogEventActionParticipantJoinByInviteArray) Sort(less func(a, b ChannelAdminLogEventActionParticipantJoinByInvite) bool) ChannelAdminLogEventActionParticipantJoinByInviteArray {
	sort.Slice(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// SortStable sorts slice of ChannelAdminLogEventActionParticipantJoinByInvite.
func (s ChannelAdminLogEventActionParticipantJoinByInviteArray) SortStable(less func(a, b ChannelAdminLogEventActionParticipantJoinByInvite) bool) ChannelAdminLogEventActionParticipantJoinByInviteArray {
	sort.SliceStable(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// Retain filters in-place slice of ChannelAdminLogEventActionParticipantJoinByInvite.
func (s ChannelAdminLogEventActionParticipantJoinByInviteArray) Retain(keep func(x ChannelAdminLogEventActionParticipantJoinByInvite) bool) ChannelAdminLogEventActionParticipantJoinByInviteArray {
	n := 0
	for _, x := range s {
		if keep(x) {
			s[n] = x
			n++
		}
	}
	s = s[:n]

	return s
}

// First returns first element of slice (if exists).
func (s ChannelAdminLogEventActionParticipantJoinByInviteArray) First() (v ChannelAdminLogEventActionParticipantJoinByInvite, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[0], true
}

// Last returns last element of slice (if exists).
func (s ChannelAdminLogEventActionParticipantJoinByInviteArray) Last() (v ChannelAdminLogEventActionParticipantJoinByInvite, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[len(s)-1], true
}

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

	a := *s
	v = a[0]

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

	return v, true
}

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

	a := *s
	v = a[len(a)-1]
	a = a[:len(a)-1]
	*s = a

	return v, true
}

// ChannelAdminLogEventActionExportedInviteDeleteArray is adapter for slice of ChannelAdminLogEventActionExportedInviteDelete.
type ChannelAdminLogEventActionExportedInviteDeleteArray []ChannelAdminLogEventActionExportedInviteDelete

// Sort sorts slice of ChannelAdminLogEventActionExportedInviteDelete.
func (s ChannelAdminLogEventActionExportedInviteDeleteArray) Sort(less func(a, b ChannelAdminLogEventActionExportedInviteDelete) bool) ChannelAdminLogEventActionExportedInviteDeleteArray {
	sort.Slice(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// SortStable sorts slice of ChannelAdminLogEventActionExportedInviteDelete.
func (s ChannelAdminLogEventActionExportedInviteDeleteArray) SortStable(less func(a, b ChannelAdminLogEventActionExportedInviteDelete) bool) ChannelAdminLogEventActionExportedInviteDeleteArray {
	sort.SliceStable(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// Retain filters in-place slice of ChannelAdminLogEventActionExportedInviteDelete.
func (s ChannelAdminLogEventActionExportedInviteDeleteArray) Retain(keep func(x ChannelAdminLogEventActionExportedInviteDelete) bool) ChannelAdminLogEventActionExportedInviteDeleteArray {
	n := 0
	for _, x := range s {
		if keep(x) {
			s[n] = x
			n++
		}
	}
	s = s[:n]

	return s
}

// First returns first element of slice (if exists).
func (s ChannelAdminLogEventActionExportedInviteDeleteArray) First() (v ChannelAdminLogEventActionExportedInviteDelete, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[0], true
}

// Last returns last element of slice (if exists).
func (s ChannelAdminLogEventActionExportedInviteDeleteArray) Last() (v ChannelAdminLogEventActionExportedInviteDelete, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[len(s)-1], true
}

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

	a := *s
	v = a[0]

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

	return v, true
}

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

	a := *s
	v = a[len(a)-1]
	a = a[:len(a)-1]
	*s = a

	return v, true
}

// ChannelAdminLogEventActionExportedInviteRevokeArray is adapter for slice of ChannelAdminLogEventActionExportedInviteRevoke.
type ChannelAdminLogEventActionExportedInviteRevokeArray []ChannelAdminLogEventActionExportedInviteRevoke

// Sort sorts slice of ChannelAdminLogEventActionExportedInviteRevoke.
func (s ChannelAdminLogEventActionExportedInviteRevokeArray) Sort(less func(a, b ChannelAdminLogEventActionExportedInviteRevoke) bool) ChannelAdminLogEventActionExportedInviteRevokeArray {
	sort.Slice(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// SortStable sorts slice of ChannelAdminLogEventActionExportedInviteRevoke.
func (s ChannelAdminLogEventActionExportedInviteRevokeArray) SortStable(less func(a, b ChannelAdminLogEventActionExportedInviteRevoke) bool) ChannelAdminLogEventActionExportedInviteRevokeArray {
	sort.SliceStable(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// Retain filters in-place slice of ChannelAdminLogEventActionExportedInviteRevoke.
func (s ChannelAdminLogEventActionExportedInviteRevokeArray) Retain(keep func(x ChannelAdminLogEventActionExportedInviteRevoke) bool) ChannelAdminLogEventActionExportedInviteRevokeArray {
	n := 0
	for _, x := range s {
		if keep(x) {
			s[n] = x
			n++
		}
	}
	s = s[:n]

	return s
}

// First returns first element of slice (if exists).
func (s ChannelAdminLogEventActionExportedInviteRevokeArray) First() (v ChannelAdminLogEventActionExportedInviteRevoke, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[0], true
}

// Last returns last element of slice (if exists).
func (s ChannelAdminLogEventActionExportedInviteRevokeArray) Last() (v ChannelAdminLogEventActionExportedInviteRevoke, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[len(s)-1], true
}

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

	a := *s
	v = a[0]

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

	return v, true
}

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

	a := *s
	v = a[len(a)-1]
	a = a[:len(a)-1]
	*s = a

	return v, true
}

// ChannelAdminLogEventActionExportedInviteEditArray is adapter for slice of ChannelAdminLogEventActionExportedInviteEdit.
type ChannelAdminLogEventActionExportedInviteEditArray []ChannelAdminLogEventActionExportedInviteEdit

// Sort sorts slice of ChannelAdminLogEventActionExportedInviteEdit.
func (s ChannelAdminLogEventActionExportedInviteEditArray) Sort(less func(a, b ChannelAdminLogEventActionExportedInviteEdit) bool) ChannelAdminLogEventActionExportedInviteEditArray {
	sort.Slice(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// SortStable sorts slice of ChannelAdminLogEventActionExportedInviteEdit.
func (s ChannelAdminLogEventActionExportedInviteEditArray) SortStable(less func(a, b ChannelAdminLogEventActionExportedInviteEdit) bool) ChannelAdminLogEventActionExportedInviteEditArray {
	sort.SliceStable(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// Retain filters in-place slice of ChannelAdminLogEventActionExportedInviteEdit.
func (s ChannelAdminLogEventActionExportedInviteEditArray) Retain(keep func(x ChannelAdminLogEventActionExportedInviteEdit) bool) ChannelAdminLogEventActionExportedInviteEditArray {
	n := 0
	for _, x := range s {
		if keep(x) {
			s[n] = x
			n++
		}
	}
	s = s[:n]

	return s
}

// First returns first element of slice (if exists).
func (s ChannelAdminLogEventActionExportedInviteEditArray) First() (v ChannelAdminLogEventActionExportedInviteEdit, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[0], true
}

// Last returns last element of slice (if exists).
func (s ChannelAdminLogEventActionExportedInviteEditArray) Last() (v ChannelAdminLogEventActionExportedInviteEdit, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[len(s)-1], true
}

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

	a := *s
	v = a[0]

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

	return v, true
}

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

	a := *s
	v = a[len(a)-1]
	a = a[:len(a)-1]
	*s = a

	return v, true
}

// ChannelAdminLogEventActionParticipantVolumeArray is adapter for slice of ChannelAdminLogEventActionParticipantVolume.
type ChannelAdminLogEventActionParticipantVolumeArray []ChannelAdminLogEventActionParticipantVolume

// Sort sorts slice of ChannelAdminLogEventActionParticipantVolume.
func (s ChannelAdminLogEventActionParticipantVolumeArray) Sort(less func(a, b ChannelAdminLogEventActionParticipantVolume) bool) ChannelAdminLogEventActionParticipantVolumeArray {
	sort.Slice(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// SortStable sorts slice of ChannelAdminLogEventActionParticipantVolume.
func (s ChannelAdminLogEventActionParticipantVolumeArray) SortStable(less func(a, b ChannelAdminLogEventActionParticipantVolume) bool) ChannelAdminLogEventActionParticipantVolumeArray {
	sort.SliceStable(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// Retain filters in-place slice of ChannelAdminLogEventActionParticipantVolume.
func (s ChannelAdminLogEventActionParticipantVolumeArray) Retain(keep func(x ChannelAdminLogEventActionParticipantVolume) bool) ChannelAdminLogEventActionParticipantVolumeArray {
	n := 0
	for _, x := range s {
		if keep(x) {
			s[n] = x
			n++
		}
	}
	s = s[:n]

	return s
}

// First returns first element of slice (if exists).
func (s ChannelAdminLogEventActionParticipantVolumeArray) First() (v ChannelAdminLogEventActionParticipantVolume, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[0], true
}

// Last returns last element of slice (if exists).
func (s ChannelAdminLogEventActionParticipantVolumeArray) Last() (v ChannelAdminLogEventActionParticipantVolume, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[len(s)-1], true
}

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

	a := *s
	v = a[0]

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

	return v, true
}

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

	a := *s
	v = a[len(a)-1]
	a = a[:len(a)-1]
	*s = a

	return v, true
}

// ChannelAdminLogEventActionChangeHistoryTTLArray is adapter for slice of ChannelAdminLogEventActionChangeHistoryTTL.
type ChannelAdminLogEventActionChangeHistoryTTLArray []ChannelAdminLogEventActionChangeHistoryTTL

// Sort sorts slice of ChannelAdminLogEventActionChangeHistoryTTL.
func (s ChannelAdminLogEventActionChangeHistoryTTLArray) Sort(less func(a, b ChannelAdminLogEventActionChangeHistoryTTL) bool) ChannelAdminLogEventActionChangeHistoryTTLArray {
	sort.Slice(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// SortStable sorts slice of ChannelAdminLogEventActionChangeHistoryTTL.
func (s ChannelAdminLogEventActionChangeHistoryTTLArray) SortStable(less func(a, b ChannelAdminLogEventActionChangeHistoryTTL) bool) ChannelAdminLogEventActionChangeHistoryTTLArray {
	sort.SliceStable(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// Retain filters in-place slice of ChannelAdminLogEventActionChangeHistoryTTL.
func (s ChannelAdminLogEventActionChangeHistoryTTLArray) Retain(keep func(x ChannelAdminLogEventActionChangeHistoryTTL) bool) ChannelAdminLogEventActionChangeHistoryTTLArray {
	n := 0
	for _, x := range s {
		if keep(x) {
			s[n] = x
			n++
		}
	}
	s = s[:n]

	return s
}

// First returns first element of slice (if exists).
func (s ChannelAdminLogEventActionChangeHistoryTTLArray) First() (v ChannelAdminLogEventActionChangeHistoryTTL, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[0], true
}

// Last returns last element of slice (if exists).
func (s ChannelAdminLogEventActionChangeHistoryTTLArray) Last() (v ChannelAdminLogEventActionChangeHistoryTTL, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[len(s)-1], true
}

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

	a := *s
	v = a[0]

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

	return v, true
}

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

	a := *s
	v = a[len(a)-1]
	a = a[:len(a)-1]
	*s = a

	return v, true
}

// ChannelAdminLogEventActionParticipantJoinByRequestArray is adapter for slice of ChannelAdminLogEventActionParticipantJoinByRequest.
type ChannelAdminLogEventActionParticipantJoinByRequestArray []ChannelAdminLogEventActionParticipantJoinByRequest

// Sort sorts slice of ChannelAdminLogEventActionParticipantJoinByRequest.
func (s ChannelAdminLogEventActionParticipantJoinByRequestArray) Sort(less func(a, b ChannelAdminLogEventActionParticipantJoinByRequest) bool) ChannelAdminLogEventActionParticipantJoinByRequestArray {
	sort.Slice(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// SortStable sorts slice of ChannelAdminLogEventActionParticipantJoinByRequest.
func (s ChannelAdminLogEventActionParticipantJoinByRequestArray) SortStable(less func(a, b ChannelAdminLogEventActionParticipantJoinByRequest) bool) ChannelAdminLogEventActionParticipantJoinByRequestArray {
	sort.SliceStable(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// Retain filters in-place slice of ChannelAdminLogEventActionParticipantJoinByRequest.
func (s ChannelAdminLogEventActionParticipantJoinByRequestArray) Retain(keep func(x ChannelAdminLogEventActionParticipantJoinByRequest) bool) ChannelAdminLogEventActionParticipantJoinByRequestArray {
	n := 0
	for _, x := range s {
		if keep(x) {
			s[n] = x
			n++
		}
	}
	s = s[:n]

	return s
}

// First returns first element of slice (if exists).
func (s ChannelAdminLogEventActionParticipantJoinByRequestArray) First() (v ChannelAdminLogEventActionParticipantJoinByRequest, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[0], true
}

// Last returns last element of slice (if exists).
func (s ChannelAdminLogEventActionParticipantJoinByRequestArray) Last() (v ChannelAdminLogEventActionParticipantJoinByRequest, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[len(s)-1], true
}

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

	a := *s
	v = a[0]

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

	return v, true
}

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

	a := *s
	v = a[len(a)-1]
	a = a[:len(a)-1]
	*s = a

	return v, true
}

// ChannelAdminLogEventActionToggleNoForwardsArray is adapter for slice of ChannelAdminLogEventActionToggleNoForwards.
type ChannelAdminLogEventActionToggleNoForwardsArray []ChannelAdminLogEventActionToggleNoForwards

// Sort sorts slice of ChannelAdminLogEventActionToggleNoForwards.
func (s ChannelAdminLogEventActionToggleNoForwardsArray) Sort(less func(a, b ChannelAdminLogEventActionToggleNoForwards) bool) ChannelAdminLogEventActionToggleNoForwardsArray {
	sort.Slice(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// SortStable sorts slice of ChannelAdminLogEventActionToggleNoForwards.
func (s ChannelAdminLogEventActionToggleNoForwardsArray) SortStable(less func(a, b ChannelAdminLogEventActionToggleNoForwards) bool) ChannelAdminLogEventActionToggleNoForwardsArray {
	sort.SliceStable(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// Retain filters in-place slice of ChannelAdminLogEventActionToggleNoForwards.
func (s ChannelAdminLogEventActionToggleNoForwardsArray) Retain(keep func(x ChannelAdminLogEventActionToggleNoForwards) bool) ChannelAdminLogEventActionToggleNoForwardsArray {
	n := 0
	for _, x := range s {
		if keep(x) {
			s[n] = x
			n++
		}
	}
	s = s[:n]

	return s
}

// First returns first element of slice (if exists).
func (s ChannelAdminLogEventActionToggleNoForwardsArray) First() (v ChannelAdminLogEventActionToggleNoForwards, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[0], true
}

// Last returns last element of slice (if exists).
func (s ChannelAdminLogEventActionToggleNoForwardsArray) Last() (v ChannelAdminLogEventActionToggleNoForwards, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[len(s)-1], true
}

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

	a := *s
	v = a[0]

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

	return v, true
}

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

	a := *s
	v = a[len(a)-1]
	a = a[:len(a)-1]
	*s = a

	return v, true
}

// ChannelAdminLogEventActionSendMessageArray is adapter for slice of ChannelAdminLogEventActionSendMessage.
type ChannelAdminLogEventActionSendMessageArray []ChannelAdminLogEventActionSendMessage

// Sort sorts slice of ChannelAdminLogEventActionSendMessage.
func (s ChannelAdminLogEventActionSendMessageArray) Sort(less func(a, b ChannelAdminLogEventActionSendMessage) bool) ChannelAdminLogEventActionSendMessageArray {
	sort.Slice(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// SortStable sorts slice of ChannelAdminLogEventActionSendMessage.
func (s ChannelAdminLogEventActionSendMessageArray) SortStable(less func(a, b ChannelAdminLogEventActionSendMessage) bool) ChannelAdminLogEventActionSendMessageArray {
	sort.SliceStable(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// Retain filters in-place slice of ChannelAdminLogEventActionSendMessage.
func (s ChannelAdminLogEventActionSendMessageArray) Retain(keep func(x ChannelAdminLogEventActionSendMessage) bool) ChannelAdminLogEventActionSendMessageArray {
	n := 0
	for _, x := range s {
		if keep(x) {
			s[n] = x
			n++
		}
	}
	s = s[:n]

	return s
}

// First returns first element of slice (if exists).
func (s ChannelAdminLogEventActionSendMessageArray) First() (v ChannelAdminLogEventActionSendMessage, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[0], true
}

// Last returns last element of slice (if exists).
func (s ChannelAdminLogEventActionSendMessageArray) Last() (v ChannelAdminLogEventActionSendMessage, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[len(s)-1], true
}

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

	a := *s
	v = a[0]

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

	return v, true
}

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

	a := *s
	v = a[len(a)-1]
	a = a[:len(a)-1]
	*s = a

	return v, true
}

// ChannelAdminLogEventActionChangeAvailableReactionsArray is adapter for slice of ChannelAdminLogEventActionChangeAvailableReactions.
type ChannelAdminLogEventActionChangeAvailableReactionsArray []ChannelAdminLogEventActionChangeAvailableReactions

// Sort sorts slice of ChannelAdminLogEventActionChangeAvailableReactions.
func (s ChannelAdminLogEventActionChangeAvailableReactionsArray) Sort(less func(a, b ChannelAdminLogEventActionChangeAvailableReactions) bool) ChannelAdminLogEventActionChangeAvailableReactionsArray {
	sort.Slice(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// SortStable sorts slice of ChannelAdminLogEventActionChangeAvailableReactions.
func (s ChannelAdminLogEventActionChangeAvailableReactionsArray) SortStable(less func(a, b ChannelAdminLogEventActionChangeAvailableReactions) bool) ChannelAdminLogEventActionChangeAvailableReactionsArray {
	sort.SliceStable(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// Retain filters in-place slice of ChannelAdminLogEventActionChangeAvailableReactions.
func (s ChannelAdminLogEventActionChangeAvailableReactionsArray) Retain(keep func(x ChannelAdminLogEventActionChangeAvailableReactions) bool) ChannelAdminLogEventActionChangeAvailableReactionsArray {
	n := 0
	for _, x := range s {
		if keep(x) {
			s[n] = x
			n++
		}
	}
	s = s[:n]

	return s
}

// First returns first element of slice (if exists).
func (s ChannelAdminLogEventActionChangeAvailableReactionsArray) First() (v ChannelAdminLogEventActionChangeAvailableReactions, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[0], true
}

// Last returns last element of slice (if exists).
func (s ChannelAdminLogEventActionChangeAvailableReactionsArray) Last() (v ChannelAdminLogEventActionChangeAvailableReactions, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[len(s)-1], true
}

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

	a := *s
	v = a[0]

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

	return v, true
}

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

	a := *s
	v = a[len(a)-1]
	a = a[:len(a)-1]
	*s = a

	return v, true
}

// ChannelAdminLogEventActionChangeUsernamesArray is adapter for slice of ChannelAdminLogEventActionChangeUsernames.
type ChannelAdminLogEventActionChangeUsernamesArray []ChannelAdminLogEventActionChangeUsernames

// Sort sorts slice of ChannelAdminLogEventActionChangeUsernames.
func (s ChannelAdminLogEventActionChangeUsernamesArray) Sort(less func(a, b ChannelAdminLogEventActionChangeUsernames) bool) ChannelAdminLogEventActionChangeUsernamesArray {
	sort.Slice(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// SortStable sorts slice of ChannelAdminLogEventActionChangeUsernames.
func (s ChannelAdminLogEventActionChangeUsernamesArray) SortStable(less func(a, b ChannelAdminLogEventActionChangeUsernames) bool) ChannelAdminLogEventActionChangeUsernamesArray {
	sort.SliceStable(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// Retain filters in-place slice of ChannelAdminLogEventActionChangeUsernames.
func (s ChannelAdminLogEventActionChangeUsernamesArray) Retain(keep func(x ChannelAdminLogEventActionChangeUsernames) bool) ChannelAdminLogEventActionChangeUsernamesArray {
	n := 0
	for _, x := range s {
		if keep(x) {
			s[n] = x
			n++
		}
	}
	s = s[:n]

	return s
}

// First returns first element of slice (if exists).
func (s ChannelAdminLogEventActionChangeUsernamesArray) First() (v ChannelAdminLogEventActionChangeUsernames, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[0], true
}

// Last returns last element of slice (if exists).
func (s ChannelAdminLogEventActionChangeUsernamesArray) Last() (v ChannelAdminLogEventActionChangeUsernames, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[len(s)-1], true
}

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

	a := *s
	v = a[0]

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

	return v, true
}

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

	a := *s
	v = a[len(a)-1]
	a = a[:len(a)-1]
	*s = a

	return v, true
}

// ChannelAdminLogEventActionToggleForumArray is adapter for slice of ChannelAdminLogEventActionToggleForum.
type ChannelAdminLogEventActionToggleForumArray []ChannelAdminLogEventActionToggleForum

// Sort sorts slice of ChannelAdminLogEventActionToggleForum.
func (s ChannelAdminLogEventActionToggleForumArray) Sort(less func(a, b ChannelAdminLogEventActionToggleForum) bool) ChannelAdminLogEventActionToggleForumArray {
	sort.Slice(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// SortStable sorts slice of ChannelAdminLogEventActionToggleForum.
func (s ChannelAdminLogEventActionToggleForumArray) SortStable(less func(a, b ChannelAdminLogEventActionToggleForum) bool) ChannelAdminLogEventActionToggleForumArray {
	sort.SliceStable(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// Retain filters in-place slice of ChannelAdminLogEventActionToggleForum.
func (s ChannelAdminLogEventActionToggleForumArray) Retain(keep func(x ChannelAdminLogEventActionToggleForum) bool) ChannelAdminLogEventActionToggleForumArray {
	n := 0
	for _, x := range s {
		if keep(x) {
			s[n] = x
			n++
		}
	}
	s = s[:n]

	return s
}

// First returns first element of slice (if exists).
func (s ChannelAdminLogEventActionToggleForumArray) First() (v ChannelAdminLogEventActionToggleForum, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[0], true
}

// Last returns last element of slice (if exists).
func (s ChannelAdminLogEventActionToggleForumArray) Last() (v ChannelAdminLogEventActionToggleForum, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[len(s)-1], true
}

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

	a := *s
	v = a[0]

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

	return v, true
}

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

	a := *s
	v = a[len(a)-1]
	a = a[:len(a)-1]
	*s = a

	return v, true
}

// ChannelAdminLogEventActionCreateTopicArray is adapter for slice of ChannelAdminLogEventActionCreateTopic.
type ChannelAdminLogEventActionCreateTopicArray []ChannelAdminLogEventActionCreateTopic

// Sort sorts slice of ChannelAdminLogEventActionCreateTopic.
func (s ChannelAdminLogEventActionCreateTopicArray) Sort(less func(a, b ChannelAdminLogEventActionCreateTopic) bool) ChannelAdminLogEventActionCreateTopicArray {
	sort.Slice(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// SortStable sorts slice of ChannelAdminLogEventActionCreateTopic.
func (s ChannelAdminLogEventActionCreateTopicArray) SortStable(less func(a, b ChannelAdminLogEventActionCreateTopic) bool) ChannelAdminLogEventActionCreateTopicArray {
	sort.SliceStable(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// Retain filters in-place slice of ChannelAdminLogEventActionCreateTopic.
func (s ChannelAdminLogEventActionCreateTopicArray) Retain(keep func(x ChannelAdminLogEventActionCreateTopic) bool) ChannelAdminLogEventActionCreateTopicArray {
	n := 0
	for _, x := range s {
		if keep(x) {
			s[n] = x
			n++
		}
	}
	s = s[:n]

	return s
}

// First returns first element of slice (if exists).
func (s ChannelAdminLogEventActionCreateTopicArray) First() (v ChannelAdminLogEventActionCreateTopic, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[0], true
}

// Last returns last element of slice (if exists).
func (s ChannelAdminLogEventActionCreateTopicArray) Last() (v ChannelAdminLogEventActionCreateTopic, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[len(s)-1], true
}

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

	a := *s
	v = a[0]

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

	return v, true
}

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

	a := *s
	v = a[len(a)-1]
	a = a[:len(a)-1]
	*s = a

	return v, true
}

// ChannelAdminLogEventActionEditTopicArray is adapter for slice of ChannelAdminLogEventActionEditTopic.
type ChannelAdminLogEventActionEditTopicArray []ChannelAdminLogEventActionEditTopic

// Sort sorts slice of ChannelAdminLogEventActionEditTopic.
func (s ChannelAdminLogEventActionEditTopicArray) Sort(less func(a, b ChannelAdminLogEventActionEditTopic) bool) ChannelAdminLogEventActionEditTopicArray {
	sort.Slice(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// SortStable sorts slice of ChannelAdminLogEventActionEditTopic.
func (s ChannelAdminLogEventActionEditTopicArray) SortStable(less func(a, b ChannelAdminLogEventActionEditTopic) bool) ChannelAdminLogEventActionEditTopicArray {
	sort.SliceStable(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// Retain filters in-place slice of ChannelAdminLogEventActionEditTopic.
func (s ChannelAdminLogEventActionEditTopicArray) Retain(keep func(x ChannelAdminLogEventActionEditTopic) bool) ChannelAdminLogEventActionEditTopicArray {
	n := 0
	for _, x := range s {
		if keep(x) {
			s[n] = x
			n++
		}
	}
	s = s[:n]

	return s
}

// First returns first element of slice (if exists).
func (s ChannelAdminLogEventActionEditTopicArray) First() (v ChannelAdminLogEventActionEditTopic, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[0], true
}

// Last returns last element of slice (if exists).
func (s ChannelAdminLogEventActionEditTopicArray) Last() (v ChannelAdminLogEventActionEditTopic, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[len(s)-1], true
}

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

	a := *s
	v = a[0]

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

	return v, true
}

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

	a := *s
	v = a[len(a)-1]
	a = a[:len(a)-1]
	*s = a

	return v, true
}

// ChannelAdminLogEventActionDeleteTopicArray is adapter for slice of ChannelAdminLogEventActionDeleteTopic.
type ChannelAdminLogEventActionDeleteTopicArray []ChannelAdminLogEventActionDeleteTopic

// Sort sorts slice of ChannelAdminLogEventActionDeleteTopic.
func (s ChannelAdminLogEventActionDeleteTopicArray) Sort(less func(a, b ChannelAdminLogEventActionDeleteTopic) bool) ChannelAdminLogEventActionDeleteTopicArray {
	sort.Slice(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// SortStable sorts slice of ChannelAdminLogEventActionDeleteTopic.
func (s ChannelAdminLogEventActionDeleteTopicArray) SortStable(less func(a, b ChannelAdminLogEventActionDeleteTopic) bool) ChannelAdminLogEventActionDeleteTopicArray {
	sort.SliceStable(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// Retain filters in-place slice of ChannelAdminLogEventActionDeleteTopic.
func (s ChannelAdminLogEventActionDeleteTopicArray) Retain(keep func(x ChannelAdminLogEventActionDeleteTopic) bool) ChannelAdminLogEventActionDeleteTopicArray {
	n := 0
	for _, x := range s {
		if keep(x) {
			s[n] = x
			n++
		}
	}
	s = s[:n]

	return s
}

// First returns first element of slice (if exists).
func (s ChannelAdminLogEventActionDeleteTopicArray) First() (v ChannelAdminLogEventActionDeleteTopic, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[0], true
}

// Last returns last element of slice (if exists).
func (s ChannelAdminLogEventActionDeleteTopicArray) Last() (v ChannelAdminLogEventActionDeleteTopic, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[len(s)-1], true
}

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

	a := *s
	v = a[0]

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

	return v, true
}

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

	a := *s
	v = a[len(a)-1]
	a = a[:len(a)-1]
	*s = a

	return v, true
}

// ChannelAdminLogEventActionPinTopicArray is adapter for slice of ChannelAdminLogEventActionPinTopic.
type ChannelAdminLogEventActionPinTopicArray []ChannelAdminLogEventActionPinTopic

// Sort sorts slice of ChannelAdminLogEventActionPinTopic.
func (s ChannelAdminLogEventActionPinTopicArray) Sort(less func(a, b ChannelAdminLogEventActionPinTopic) bool) ChannelAdminLogEventActionPinTopicArray {
	sort.Slice(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// SortStable sorts slice of ChannelAdminLogEventActionPinTopic.
func (s ChannelAdminLogEventActionPinTopicArray) SortStable(less func(a, b ChannelAdminLogEventActionPinTopic) bool) ChannelAdminLogEventActionPinTopicArray {
	sort.SliceStable(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// Retain filters in-place slice of ChannelAdminLogEventActionPinTopic.
func (s ChannelAdminLogEventActionPinTopicArray) Retain(keep func(x ChannelAdminLogEventActionPinTopic) bool) ChannelAdminLogEventActionPinTopicArray {
	n := 0
	for _, x := range s {
		if keep(x) {
			s[n] = x
			n++
		}
	}
	s = s[:n]

	return s
}

// First returns first element of slice (if exists).
func (s ChannelAdminLogEventActionPinTopicArray) First() (v ChannelAdminLogEventActionPinTopic, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[0], true
}

// Last returns last element of slice (if exists).
func (s ChannelAdminLogEventActionPinTopicArray) Last() (v ChannelAdminLogEventActionPinTopic, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[len(s)-1], true
}

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

	a := *s
	v = a[0]

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

	return v, true
}

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

	a := *s
	v = a[len(a)-1]
	a = a[:len(a)-1]
	*s = a

	return v, true
}

// ChannelAdminLogEventActionToggleAntiSpamArray is adapter for slice of ChannelAdminLogEventActionToggleAntiSpam.
type ChannelAdminLogEventActionToggleAntiSpamArray []ChannelAdminLogEventActionToggleAntiSpam

// Sort sorts slice of ChannelAdminLogEventActionToggleAntiSpam.
func (s ChannelAdminLogEventActionToggleAntiSpamArray) Sort(less func(a, b ChannelAdminLogEventActionToggleAntiSpam) bool) ChannelAdminLogEventActionToggleAntiSpamArray {
	sort.Slice(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// SortStable sorts slice of ChannelAdminLogEventActionToggleAntiSpam.
func (s ChannelAdminLogEventActionToggleAntiSpamArray) SortStable(less func(a, b ChannelAdminLogEventActionToggleAntiSpam) bool) ChannelAdminLogEventActionToggleAntiSpamArray {
	sort.SliceStable(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// Retain filters in-place slice of ChannelAdminLogEventActionToggleAntiSpam.
func (s ChannelAdminLogEventActionToggleAntiSpamArray) Retain(keep func(x ChannelAdminLogEventActionToggleAntiSpam) bool) ChannelAdminLogEventActionToggleAntiSpamArray {
	n := 0
	for _, x := range s {
		if keep(x) {
			s[n] = x
			n++
		}
	}
	s = s[:n]

	return s
}

// First returns first element of slice (if exists).
func (s ChannelAdminLogEventActionToggleAntiSpamArray) First() (v ChannelAdminLogEventActionToggleAntiSpam, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[0], true
}

// Last returns last element of slice (if exists).
func (s ChannelAdminLogEventActionToggleAntiSpamArray) Last() (v ChannelAdminLogEventActionToggleAntiSpam, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[len(s)-1], true
}

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

	a := *s
	v = a[0]

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

	return v, true
}

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

	a := *s
	v = a[len(a)-1]
	a = a[:len(a)-1]
	*s = a

	return v, true
}

// ChannelAdminLogEventActionChangePeerColorArray is adapter for slice of ChannelAdminLogEventActionChangePeerColor.
type ChannelAdminLogEventActionChangePeerColorArray []ChannelAdminLogEventActionChangePeerColor

// Sort sorts slice of ChannelAdminLogEventActionChangePeerColor.
func (s ChannelAdminLogEventActionChangePeerColorArray) Sort(less func(a, b ChannelAdminLogEventActionChangePeerColor) bool) ChannelAdminLogEventActionChangePeerColorArray {
	sort.Slice(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// SortStable sorts slice of ChannelAdminLogEventActionChangePeerColor.
func (s ChannelAdminLogEventActionChangePeerColorArray) SortStable(less func(a, b ChannelAdminLogEventActionChangePeerColor) bool) ChannelAdminLogEventActionChangePeerColorArray {
	sort.SliceStable(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// Retain filters in-place slice of ChannelAdminLogEventActionChangePeerColor.
func (s ChannelAdminLogEventActionChangePeerColorArray) Retain(keep func(x ChannelAdminLogEventActionChangePeerColor) bool) ChannelAdminLogEventActionChangePeerColorArray {
	n := 0
	for _, x := range s {
		if keep(x) {
			s[n] = x
			n++
		}
	}
	s = s[:n]

	return s
}

// First returns first element of slice (if exists).
func (s ChannelAdminLogEventActionChangePeerColorArray) First() (v ChannelAdminLogEventActionChangePeerColor, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[0], true
}

// Last returns last element of slice (if exists).
func (s ChannelAdminLogEventActionChangePeerColorArray) Last() (v ChannelAdminLogEventActionChangePeerColor, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[len(s)-1], true
}

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

	a := *s
	v = a[0]

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

	return v, true
}

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

	a := *s
	v = a[len(a)-1]
	a = a[:len(a)-1]
	*s = a

	return v, true
}

// ChannelAdminLogEventActionChangeProfilePeerColorArray is adapter for slice of ChannelAdminLogEventActionChangeProfilePeerColor.
type ChannelAdminLogEventActionChangeProfilePeerColorArray []ChannelAdminLogEventActionChangeProfilePeerColor

// Sort sorts slice of ChannelAdminLogEventActionChangeProfilePeerColor.
func (s ChannelAdminLogEventActionChangeProfilePeerColorArray) Sort(less func(a, b ChannelAdminLogEventActionChangeProfilePeerColor) bool) ChannelAdminLogEventActionChangeProfilePeerColorArray {
	sort.Slice(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// SortStable sorts slice of ChannelAdminLogEventActionChangeProfilePeerColor.
func (s ChannelAdminLogEventActionChangeProfilePeerColorArray) SortStable(less func(a, b ChannelAdminLogEventActionChangeProfilePeerColor) bool) ChannelAdminLogEventActionChangeProfilePeerColorArray {
	sort.SliceStable(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// Retain filters in-place slice of ChannelAdminLogEventActionChangeProfilePeerColor.
func (s ChannelAdminLogEventActionChangeProfilePeerColorArray) Retain(keep func(x ChannelAdminLogEventActionChangeProfilePeerColor) bool) ChannelAdminLogEventActionChangeProfilePeerColorArray {
	n := 0
	for _, x := range s {
		if keep(x) {
			s[n] = x
			n++
		}
	}
	s = s[:n]

	return s
}

// First returns first element of slice (if exists).
func (s ChannelAdminLogEventActionChangeProfilePeerColorArray) First() (v ChannelAdminLogEventActionChangeProfilePeerColor, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[0], true
}

// Last returns last element of slice (if exists).
func (s ChannelAdminLogEventActionChangeProfilePeerColorArray) Last() (v ChannelAdminLogEventActionChangeProfilePeerColor, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[len(s)-1], true
}

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

	a := *s
	v = a[0]

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

	return v, true
}

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

	a := *s
	v = a[len(a)-1]
	a = a[:len(a)-1]
	*s = a

	return v, true
}

// ChannelAdminLogEventActionChangeWallpaperArray is adapter for slice of ChannelAdminLogEventActionChangeWallpaper.
type ChannelAdminLogEventActionChangeWallpaperArray []ChannelAdminLogEventActionChangeWallpaper

// Sort sorts slice of ChannelAdminLogEventActionChangeWallpaper.
func (s ChannelAdminLogEventActionChangeWallpaperArray) Sort(less func(a, b ChannelAdminLogEventActionChangeWallpaper) bool) ChannelAdminLogEventActionChangeWallpaperArray {
	sort.Slice(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// SortStable sorts slice of ChannelAdminLogEventActionChangeWallpaper.
func (s ChannelAdminLogEventActionChangeWallpaperArray) SortStable(less func(a, b ChannelAdminLogEventActionChangeWallpaper) bool) ChannelAdminLogEventActionChangeWallpaperArray {
	sort.SliceStable(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// Retain filters in-place slice of ChannelAdminLogEventActionChangeWallpaper.
func (s ChannelAdminLogEventActionChangeWallpaperArray) Retain(keep func(x ChannelAdminLogEventActionChangeWallpaper) bool) ChannelAdminLogEventActionChangeWallpaperArray {
	n := 0
	for _, x := range s {
		if keep(x) {
			s[n] = x
			n++
		}
	}
	s = s[:n]

	return s
}

// First returns first element of slice (if exists).
func (s ChannelAdminLogEventActionChangeWallpaperArray) First() (v ChannelAdminLogEventActionChangeWallpaper, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[0], true
}

// Last returns last element of slice (if exists).
func (s ChannelAdminLogEventActionChangeWallpaperArray) Last() (v ChannelAdminLogEventActionChangeWallpaper, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[len(s)-1], true
}

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

	a := *s
	v = a[0]

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

	return v, true
}

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

	a := *s
	v = a[len(a)-1]
	a = a[:len(a)-1]
	*s = a

	return v, true
}

// ChannelAdminLogEventActionChangeEmojiStatusArray is adapter for slice of ChannelAdminLogEventActionChangeEmojiStatus.
type ChannelAdminLogEventActionChangeEmojiStatusArray []ChannelAdminLogEventActionChangeEmojiStatus

// Sort sorts slice of ChannelAdminLogEventActionChangeEmojiStatus.
func (s ChannelAdminLogEventActionChangeEmojiStatusArray) Sort(less func(a, b ChannelAdminLogEventActionChangeEmojiStatus) bool) ChannelAdminLogEventActionChangeEmojiStatusArray {
	sort.Slice(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// SortStable sorts slice of ChannelAdminLogEventActionChangeEmojiStatus.
func (s ChannelAdminLogEventActionChangeEmojiStatusArray) SortStable(less func(a, b ChannelAdminLogEventActionChangeEmojiStatus) bool) ChannelAdminLogEventActionChangeEmojiStatusArray {
	sort.SliceStable(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// Retain filters in-place slice of ChannelAdminLogEventActionChangeEmojiStatus.
func (s ChannelAdminLogEventActionChangeEmojiStatusArray) Retain(keep func(x ChannelAdminLogEventActionChangeEmojiStatus) bool) ChannelAdminLogEventActionChangeEmojiStatusArray {
	n := 0
	for _, x := range s {
		if keep(x) {
			s[n] = x
			n++
		}
	}
	s = s[:n]

	return s
}

// First returns first element of slice (if exists).
func (s ChannelAdminLogEventActionChangeEmojiStatusArray) First() (v ChannelAdminLogEventActionChangeEmojiStatus, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[0], true
}

// Last returns last element of slice (if exists).
func (s ChannelAdminLogEventActionChangeEmojiStatusArray) Last() (v ChannelAdminLogEventActionChangeEmojiStatus, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[len(s)-1], true
}

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

	a := *s
	v = a[0]

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

	return v, true
}

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

	a := *s
	v = a[len(a)-1]
	a = a[:len(a)-1]
	*s = a

	return v, true
}

// ChannelAdminLogEventActionChangeEmojiStickerSetArray is adapter for slice of ChannelAdminLogEventActionChangeEmojiStickerSet.
type ChannelAdminLogEventActionChangeEmojiStickerSetArray []ChannelAdminLogEventActionChangeEmojiStickerSet

// Sort sorts slice of ChannelAdminLogEventActionChangeEmojiStickerSet.
func (s ChannelAdminLogEventActionChangeEmojiStickerSetArray) Sort(less func(a, b ChannelAdminLogEventActionChangeEmojiStickerSet) bool) ChannelAdminLogEventActionChangeEmojiStickerSetArray {
	sort.Slice(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// SortStable sorts slice of ChannelAdminLogEventActionChangeEmojiStickerSet.
func (s ChannelAdminLogEventActionChangeEmojiStickerSetArray) SortStable(less func(a, b ChannelAdminLogEventActionChangeEmojiStickerSet) bool) ChannelAdminLogEventActionChangeEmojiStickerSetArray {
	sort.SliceStable(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// Retain filters in-place slice of ChannelAdminLogEventActionChangeEmojiStickerSet.
func (s ChannelAdminLogEventActionChangeEmojiStickerSetArray) Retain(keep func(x ChannelAdminLogEventActionChangeEmojiStickerSet) bool) ChannelAdminLogEventActionChangeEmojiStickerSetArray {
	n := 0
	for _, x := range s {
		if keep(x) {
			s[n] = x
			n++
		}
	}
	s = s[:n]

	return s
}

// First returns first element of slice (if exists).
func (s ChannelAdminLogEventActionChangeEmojiStickerSetArray) First() (v ChannelAdminLogEventActionChangeEmojiStickerSet, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[0], true
}

// Last returns last element of slice (if exists).
func (s ChannelAdminLogEventActionChangeEmojiStickerSetArray) Last() (v ChannelAdminLogEventActionChangeEmojiStickerSet, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[len(s)-1], true
}

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

	a := *s
	v = a[0]

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

	return v, true
}

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

	a := *s
	v = a[len(a)-1]
	a = a[:len(a)-1]
	*s = a

	return v, true
}

// ChannelAdminLogEventActionToggleSignatureProfilesArray is adapter for slice of ChannelAdminLogEventActionToggleSignatureProfiles.
type ChannelAdminLogEventActionToggleSignatureProfilesArray []ChannelAdminLogEventActionToggleSignatureProfiles

// Sort sorts slice of ChannelAdminLogEventActionToggleSignatureProfiles.
func (s ChannelAdminLogEventActionToggleSignatureProfilesArray) Sort(less func(a, b ChannelAdminLogEventActionToggleSignatureProfiles) bool) ChannelAdminLogEventActionToggleSignatureProfilesArray {
	sort.Slice(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// SortStable sorts slice of ChannelAdminLogEventActionToggleSignatureProfiles.
func (s ChannelAdminLogEventActionToggleSignatureProfilesArray) SortStable(less func(a, b ChannelAdminLogEventActionToggleSignatureProfiles) bool) ChannelAdminLogEventActionToggleSignatureProfilesArray {
	sort.SliceStable(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// Retain filters in-place slice of ChannelAdminLogEventActionToggleSignatureProfiles.
func (s ChannelAdminLogEventActionToggleSignatureProfilesArray) Retain(keep func(x ChannelAdminLogEventActionToggleSignatureProfiles) bool) ChannelAdminLogEventActionToggleSignatureProfilesArray {
	n := 0
	for _, x := range s {
		if keep(x) {
			s[n] = x
			n++
		}
	}
	s = s[:n]

	return s
}

// First returns first element of slice (if exists).
func (s ChannelAdminLogEventActionToggleSignatureProfilesArray) First() (v ChannelAdminLogEventActionToggleSignatureProfiles, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[0], true
}

// Last returns last element of slice (if exists).
func (s ChannelAdminLogEventActionToggleSignatureProfilesArray) Last() (v ChannelAdminLogEventActionToggleSignatureProfiles, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[len(s)-1], true
}

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

	a := *s
	v = a[0]

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

	return v, true
}

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

	a := *s
	v = a[len(a)-1]
	a = a[:len(a)-1]
	*s = a

	return v, true
}

// ChannelAdminLogEventActionParticipantSubExtendArray is adapter for slice of ChannelAdminLogEventActionParticipantSubExtend.
type ChannelAdminLogEventActionParticipantSubExtendArray []ChannelAdminLogEventActionParticipantSubExtend

// Sort sorts slice of ChannelAdminLogEventActionParticipantSubExtend.
func (s ChannelAdminLogEventActionParticipantSubExtendArray) Sort(less func(a, b ChannelAdminLogEventActionParticipantSubExtend) bool) ChannelAdminLogEventActionParticipantSubExtendArray {
	sort.Slice(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// SortStable sorts slice of ChannelAdminLogEventActionParticipantSubExtend.
func (s ChannelAdminLogEventActionParticipantSubExtendArray) SortStable(less func(a, b ChannelAdminLogEventActionParticipantSubExtend) bool) ChannelAdminLogEventActionParticipantSubExtendArray {
	sort.SliceStable(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// Retain filters in-place slice of ChannelAdminLogEventActionParticipantSubExtend.
func (s ChannelAdminLogEventActionParticipantSubExtendArray) Retain(keep func(x ChannelAdminLogEventActionParticipantSubExtend) bool) ChannelAdminLogEventActionParticipantSubExtendArray {
	n := 0
	for _, x := range s {
		if keep(x) {
			s[n] = x
			n++
		}
	}
	s = s[:n]

	return s
}

// First returns first element of slice (if exists).
func (s ChannelAdminLogEventActionParticipantSubExtendArray) First() (v ChannelAdminLogEventActionParticipantSubExtend, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[0], true
}

// Last returns last element of slice (if exists).
func (s ChannelAdminLogEventActionParticipantSubExtendArray) Last() (v ChannelAdminLogEventActionParticipantSubExtend, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[len(s)-1], true
}

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

	a := *s
	v = a[0]

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

	return v, true
}

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

	a := *s
	v = a[len(a)-1]
	a = a[:len(a)-1]
	*s = a

	return v, true
}

// ChannelAdminLogEventActionToggleAutotranslationArray is adapter for slice of ChannelAdminLogEventActionToggleAutotranslation.
type ChannelAdminLogEventActionToggleAutotranslationArray []ChannelAdminLogEventActionToggleAutotranslation

// Sort sorts slice of ChannelAdminLogEventActionToggleAutotranslation.
func (s ChannelAdminLogEventActionToggleAutotranslationArray) Sort(less func(a, b ChannelAdminLogEventActionToggleAutotranslation) bool) ChannelAdminLogEventActionToggleAutotranslationArray {
	sort.Slice(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// SortStable sorts slice of ChannelAdminLogEventActionToggleAutotranslation.
func (s ChannelAdminLogEventActionToggleAutotranslationArray) SortStable(less func(a, b ChannelAdminLogEventActionToggleAutotranslation) bool) ChannelAdminLogEventActionToggleAutotranslationArray {
	sort.SliceStable(s, func(i, j int) bool {
		return less(s[i], s[j])
	})
	return s
}

// Retain filters in-place slice of ChannelAdminLogEventActionToggleAutotranslation.
func (s ChannelAdminLogEventActionToggleAutotranslationArray) Retain(keep func(x ChannelAdminLogEventActionToggleAutotranslation) bool) ChannelAdminLogEventActionToggleAutotranslationArray {
	n := 0
	for _, x := range s {
		if keep(x) {
			s[n] = x
			n++
		}
	}
	s = s[:n]

	return s
}

// First returns first element of slice (if exists).
func (s ChannelAdminLogEventActionToggleAutotranslationArray) First() (v ChannelAdminLogEventActionToggleAutotranslation, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[0], true
}

// Last returns last element of slice (if exists).
func (s ChannelAdminLogEventActionToggleAutotranslationArray) Last() (v ChannelAdminLogEventActionToggleAutotranslation, ok bool) {
	if len(s) < 1 {
		return
	}
	return s[len(s)-1], true
}

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

	a := *s
	v = a[0]

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

	return v, true
}

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

	a := *s
	v = a[len(a)-1]
	a = a[:len(a)-1]
	*s = a

	return v, true
}
