package tg
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"github.com/gotd/td/bin"
"github.com/gotd/td/tdjson"
"github.com/gotd/td/tdp"
"github.com/gotd/td/tgerr"
)
var (
_ = bin .Buffer {}
_ = context .Background ()
_ = fmt .Stringer (nil )
_ = strings .Builder {}
_ = errors .Is
_ = multierr .AppendInto
_ = sort .Ints
_ = tdp .Format
_ = tgerr .Error {}
_ = tdjson .Encoder {}
)
type UpdateClassArray []UpdateClass
func (s UpdateClassArray ) Sort (less func (a , b UpdateClass ) bool ) UpdateClassArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateClassArray ) SortStable (less func (a , b UpdateClass ) bool ) UpdateClassArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateClassArray ) Retain (keep func (x UpdateClass ) bool ) UpdateClassArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateClassArray ) First () (v UpdateClass , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateClassArray ) Last () (v UpdateClass , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateClassArray ) PopFirst () (v UpdateClass , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateClass
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateClassArray ) Pop () (v UpdateClass , 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
}
func (s UpdateClassArray ) AsUpdateNewMessage () (to UpdateNewMessageArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateNewMessage )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateMessageID () (to UpdateMessageIDArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateMessageID )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateDeleteMessages () (to UpdateDeleteMessagesArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateDeleteMessages )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateUserTyping () (to UpdateUserTypingArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateUserTyping )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateChatUserTyping () (to UpdateChatUserTypingArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateChatUserTyping )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateChatParticipants () (to UpdateChatParticipantsArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateChatParticipants )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateUserStatus () (to UpdateUserStatusArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateUserStatus )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateUserName () (to UpdateUserNameArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateUserName )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateNewAuthorization () (to UpdateNewAuthorizationArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateNewAuthorization )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateNewEncryptedMessage () (to UpdateNewEncryptedMessageArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateNewEncryptedMessage )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateEncryptedChatTyping () (to UpdateEncryptedChatTypingArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateEncryptedChatTyping )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateEncryption () (to UpdateEncryptionArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateEncryption )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateEncryptedMessagesRead () (to UpdateEncryptedMessagesReadArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateEncryptedMessagesRead )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateChatParticipantAdd () (to UpdateChatParticipantAddArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateChatParticipantAdd )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateChatParticipantDelete () (to UpdateChatParticipantDeleteArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateChatParticipantDelete )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateDCOptions () (to UpdateDCOptionsArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateDCOptions )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateNotifySettings () (to UpdateNotifySettingsArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateNotifySettings )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateServiceNotification () (to UpdateServiceNotificationArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateServiceNotification )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdatePrivacy () (to UpdatePrivacyArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdatePrivacy )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateUserPhone () (to UpdateUserPhoneArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateUserPhone )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateReadHistoryInbox () (to UpdateReadHistoryInboxArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateReadHistoryInbox )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateReadHistoryOutbox () (to UpdateReadHistoryOutboxArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateReadHistoryOutbox )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateWebPage () (to UpdateWebPageArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateWebPage )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateReadMessagesContents () (to UpdateReadMessagesContentsArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateReadMessagesContents )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateChannelTooLong () (to UpdateChannelTooLongArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateChannelTooLong )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateChannel () (to UpdateChannelArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateChannel )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateNewChannelMessage () (to UpdateNewChannelMessageArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateNewChannelMessage )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateReadChannelInbox () (to UpdateReadChannelInboxArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateReadChannelInbox )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateDeleteChannelMessages () (to UpdateDeleteChannelMessagesArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateDeleteChannelMessages )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateChannelMessageViews () (to UpdateChannelMessageViewsArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateChannelMessageViews )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateChatParticipantAdmin () (to UpdateChatParticipantAdminArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateChatParticipantAdmin )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateNewStickerSet () (to UpdateNewStickerSetArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateNewStickerSet )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateStickerSetsOrder () (to UpdateStickerSetsOrderArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateStickerSetsOrder )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateStickerSets () (to UpdateStickerSetsArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateStickerSets )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateBotInlineQuery () (to UpdateBotInlineQueryArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateBotInlineQuery )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateBotInlineSend () (to UpdateBotInlineSendArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateBotInlineSend )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateEditChannelMessage () (to UpdateEditChannelMessageArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateEditChannelMessage )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateBotCallbackQuery () (to UpdateBotCallbackQueryArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateBotCallbackQuery )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateEditMessage () (to UpdateEditMessageArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateEditMessage )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateInlineBotCallbackQuery () (to UpdateInlineBotCallbackQueryArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateInlineBotCallbackQuery )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateReadChannelOutbox () (to UpdateReadChannelOutboxArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateReadChannelOutbox )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateDraftMessage () (to UpdateDraftMessageArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateDraftMessage )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateChannelWebPage () (to UpdateChannelWebPageArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateChannelWebPage )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateDialogPinned () (to UpdateDialogPinnedArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateDialogPinned )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdatePinnedDialogs () (to UpdatePinnedDialogsArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdatePinnedDialogs )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateBotWebhookJSON () (to UpdateBotWebhookJSONArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateBotWebhookJSON )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateBotWebhookJSONQuery () (to UpdateBotWebhookJSONQueryArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateBotWebhookJSONQuery )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateBotShippingQuery () (to UpdateBotShippingQueryArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateBotShippingQuery )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateBotPrecheckoutQuery () (to UpdateBotPrecheckoutQueryArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateBotPrecheckoutQuery )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdatePhoneCall () (to UpdatePhoneCallArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdatePhoneCall )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateLangPackTooLong () (to UpdateLangPackTooLongArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateLangPackTooLong )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateLangPack () (to UpdateLangPackArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateLangPack )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateChannelReadMessagesContents () (to UpdateChannelReadMessagesContentsArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateChannelReadMessagesContents )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateChannelAvailableMessages () (to UpdateChannelAvailableMessagesArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateChannelAvailableMessages )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateDialogUnreadMark () (to UpdateDialogUnreadMarkArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateDialogUnreadMark )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateMessagePoll () (to UpdateMessagePollArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateMessagePoll )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateChatDefaultBannedRights () (to UpdateChatDefaultBannedRightsArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateChatDefaultBannedRights )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateFolderPeers () (to UpdateFolderPeersArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateFolderPeers )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdatePeerSettings () (to UpdatePeerSettingsArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdatePeerSettings )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdatePeerLocated () (to UpdatePeerLocatedArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdatePeerLocated )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateNewScheduledMessage () (to UpdateNewScheduledMessageArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateNewScheduledMessage )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateDeleteScheduledMessages () (to UpdateDeleteScheduledMessagesArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateDeleteScheduledMessages )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateTheme () (to UpdateThemeArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateTheme )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateGeoLiveViewed () (to UpdateGeoLiveViewedArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateGeoLiveViewed )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateMessagePollVote () (to UpdateMessagePollVoteArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateMessagePollVote )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateDialogFilter () (to UpdateDialogFilterArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateDialogFilter )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateDialogFilterOrder () (to UpdateDialogFilterOrderArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateDialogFilterOrder )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdatePhoneCallSignalingData () (to UpdatePhoneCallSignalingDataArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdatePhoneCallSignalingData )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateChannelMessageForwards () (to UpdateChannelMessageForwardsArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateChannelMessageForwards )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateReadChannelDiscussionInbox () (to UpdateReadChannelDiscussionInboxArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateReadChannelDiscussionInbox )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateReadChannelDiscussionOutbox () (to UpdateReadChannelDiscussionOutboxArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateReadChannelDiscussionOutbox )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdatePeerBlocked () (to UpdatePeerBlockedArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdatePeerBlocked )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateChannelUserTyping () (to UpdateChannelUserTypingArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateChannelUserTyping )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdatePinnedMessages () (to UpdatePinnedMessagesArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdatePinnedMessages )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdatePinnedChannelMessages () (to UpdatePinnedChannelMessagesArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdatePinnedChannelMessages )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateChat () (to UpdateChatArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateChat )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateGroupCallParticipants () (to UpdateGroupCallParticipantsArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateGroupCallParticipants )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateGroupCall () (to UpdateGroupCallArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateGroupCall )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdatePeerHistoryTTL () (to UpdatePeerHistoryTTLArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdatePeerHistoryTTL )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateChatParticipant () (to UpdateChatParticipantArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateChatParticipant )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateChannelParticipant () (to UpdateChannelParticipantArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateChannelParticipant )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateBotStopped () (to UpdateBotStoppedArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateBotStopped )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateGroupCallConnection () (to UpdateGroupCallConnectionArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateGroupCallConnection )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateBotCommands () (to UpdateBotCommandsArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateBotCommands )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdatePendingJoinRequests () (to UpdatePendingJoinRequestsArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdatePendingJoinRequests )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateBotChatInviteRequester () (to UpdateBotChatInviteRequesterArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateBotChatInviteRequester )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateMessageReactions () (to UpdateMessageReactionsArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateMessageReactions )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateWebViewResultSent () (to UpdateWebViewResultSentArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateWebViewResultSent )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateBotMenuButton () (to UpdateBotMenuButtonArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateBotMenuButton )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateTranscribedAudio () (to UpdateTranscribedAudioArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateTranscribedAudio )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateUserEmojiStatus () (to UpdateUserEmojiStatusArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateUserEmojiStatus )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateMoveStickerSetToTop () (to UpdateMoveStickerSetToTopArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateMoveStickerSetToTop )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateMessageExtendedMedia () (to UpdateMessageExtendedMediaArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateMessageExtendedMedia )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateChannelPinnedTopic () (to UpdateChannelPinnedTopicArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateChannelPinnedTopic )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateChannelPinnedTopics () (to UpdateChannelPinnedTopicsArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateChannelPinnedTopics )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateUser () (to UpdateUserArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateUser )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateGroupInvitePrivacyForbidden () (to UpdateGroupInvitePrivacyForbiddenArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateGroupInvitePrivacyForbidden )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateStory () (to UpdateStoryArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateStory )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateReadStories () (to UpdateReadStoriesArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateReadStories )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateStoryID () (to UpdateStoryIDArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateStoryID )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateStoriesStealthMode () (to UpdateStoriesStealthModeArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateStoriesStealthMode )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateSentStoryReaction () (to UpdateSentStoryReactionArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateSentStoryReaction )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateBotChatBoost () (to UpdateBotChatBoostArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateBotChatBoost )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateChannelViewForumAsMessages () (to UpdateChannelViewForumAsMessagesArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateChannelViewForumAsMessages )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdatePeerWallpaper () (to UpdatePeerWallpaperArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdatePeerWallpaper )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateBotMessageReaction () (to UpdateBotMessageReactionArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateBotMessageReaction )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s UpdateClassArray ) AsUpdateBotMessageReactions () (to UpdateBotMessageReactionsArray ) {
for _ , elem := range s {
value , ok := elem .(*UpdateBotMessageReactions )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
type UpdateNewMessageArray []UpdateNewMessage
func (s UpdateNewMessageArray ) Sort (less func (a , b UpdateNewMessage ) bool ) UpdateNewMessageArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateNewMessageArray ) SortStable (less func (a , b UpdateNewMessage ) bool ) UpdateNewMessageArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateNewMessageArray ) Retain (keep func (x UpdateNewMessage ) bool ) UpdateNewMessageArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateNewMessageArray ) First () (v UpdateNewMessage , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateNewMessageArray ) Last () (v UpdateNewMessage , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateNewMessageArray ) PopFirst () (v UpdateNewMessage , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateNewMessage
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateNewMessageArray ) Pop () (v UpdateNewMessage , 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
}
type UpdateMessageIDArray []UpdateMessageID
func (s UpdateMessageIDArray ) Sort (less func (a , b UpdateMessageID ) bool ) UpdateMessageIDArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateMessageIDArray ) SortStable (less func (a , b UpdateMessageID ) bool ) UpdateMessageIDArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateMessageIDArray ) Retain (keep func (x UpdateMessageID ) bool ) UpdateMessageIDArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateMessageIDArray ) First () (v UpdateMessageID , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateMessageIDArray ) Last () (v UpdateMessageID , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateMessageIDArray ) PopFirst () (v UpdateMessageID , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateMessageID
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateMessageIDArray ) Pop () (v UpdateMessageID , 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
}
func (s UpdateMessageIDArray ) SortByID () UpdateMessageIDArray {
return s .Sort (func (a , b UpdateMessageID ) bool {
return a .GetID () < b .GetID ()
})
}
func (s UpdateMessageIDArray ) SortStableByID () UpdateMessageIDArray {
return s .SortStable (func (a , b UpdateMessageID ) bool {
return a .GetID () < b .GetID ()
})
}
func (s UpdateMessageIDArray ) FillMap (to map [int ]UpdateMessageID ) {
for _ , value := range s {
to [value .GetID ()] = value
}
}
func (s UpdateMessageIDArray ) ToMap () map [int ]UpdateMessageID {
r := make (map [int ]UpdateMessageID , len (s ))
s .FillMap (r )
return r
}
type UpdateDeleteMessagesArray []UpdateDeleteMessages
func (s UpdateDeleteMessagesArray ) Sort (less func (a , b UpdateDeleteMessages ) bool ) UpdateDeleteMessagesArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateDeleteMessagesArray ) SortStable (less func (a , b UpdateDeleteMessages ) bool ) UpdateDeleteMessagesArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateDeleteMessagesArray ) Retain (keep func (x UpdateDeleteMessages ) bool ) UpdateDeleteMessagesArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateDeleteMessagesArray ) First () (v UpdateDeleteMessages , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateDeleteMessagesArray ) Last () (v UpdateDeleteMessages , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateDeleteMessagesArray ) PopFirst () (v UpdateDeleteMessages , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateDeleteMessages
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateDeleteMessagesArray ) Pop () (v UpdateDeleteMessages , 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
}
type UpdateUserTypingArray []UpdateUserTyping
func (s UpdateUserTypingArray ) Sort (less func (a , b UpdateUserTyping ) bool ) UpdateUserTypingArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateUserTypingArray ) SortStable (less func (a , b UpdateUserTyping ) bool ) UpdateUserTypingArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateUserTypingArray ) Retain (keep func (x UpdateUserTyping ) bool ) UpdateUserTypingArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateUserTypingArray ) First () (v UpdateUserTyping , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateUserTypingArray ) Last () (v UpdateUserTyping , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateUserTypingArray ) PopFirst () (v UpdateUserTyping , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateUserTyping
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateUserTypingArray ) Pop () (v UpdateUserTyping , 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
}
type UpdateChatUserTypingArray []UpdateChatUserTyping
func (s UpdateChatUserTypingArray ) Sort (less func (a , b UpdateChatUserTyping ) bool ) UpdateChatUserTypingArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateChatUserTypingArray ) SortStable (less func (a , b UpdateChatUserTyping ) bool ) UpdateChatUserTypingArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateChatUserTypingArray ) Retain (keep func (x UpdateChatUserTyping ) bool ) UpdateChatUserTypingArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateChatUserTypingArray ) First () (v UpdateChatUserTyping , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateChatUserTypingArray ) Last () (v UpdateChatUserTyping , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateChatUserTypingArray ) PopFirst () (v UpdateChatUserTyping , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateChatUserTyping
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateChatUserTypingArray ) Pop () (v UpdateChatUserTyping , 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
}
type UpdateChatParticipantsArray []UpdateChatParticipants
func (s UpdateChatParticipantsArray ) Sort (less func (a , b UpdateChatParticipants ) bool ) UpdateChatParticipantsArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateChatParticipantsArray ) SortStable (less func (a , b UpdateChatParticipants ) bool ) UpdateChatParticipantsArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateChatParticipantsArray ) Retain (keep func (x UpdateChatParticipants ) bool ) UpdateChatParticipantsArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateChatParticipantsArray ) First () (v UpdateChatParticipants , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateChatParticipantsArray ) Last () (v UpdateChatParticipants , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateChatParticipantsArray ) PopFirst () (v UpdateChatParticipants , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateChatParticipants
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateChatParticipantsArray ) Pop () (v UpdateChatParticipants , 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
}
type UpdateUserStatusArray []UpdateUserStatus
func (s UpdateUserStatusArray ) Sort (less func (a , b UpdateUserStatus ) bool ) UpdateUserStatusArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateUserStatusArray ) SortStable (less func (a , b UpdateUserStatus ) bool ) UpdateUserStatusArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateUserStatusArray ) Retain (keep func (x UpdateUserStatus ) bool ) UpdateUserStatusArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateUserStatusArray ) First () (v UpdateUserStatus , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateUserStatusArray ) Last () (v UpdateUserStatus , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateUserStatusArray ) PopFirst () (v UpdateUserStatus , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateUserStatus
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateUserStatusArray ) Pop () (v UpdateUserStatus , 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
}
type UpdateUserNameArray []UpdateUserName
func (s UpdateUserNameArray ) Sort (less func (a , b UpdateUserName ) bool ) UpdateUserNameArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateUserNameArray ) SortStable (less func (a , b UpdateUserName ) bool ) UpdateUserNameArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateUserNameArray ) Retain (keep func (x UpdateUserName ) bool ) UpdateUserNameArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateUserNameArray ) First () (v UpdateUserName , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateUserNameArray ) Last () (v UpdateUserName , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateUserNameArray ) PopFirst () (v UpdateUserName , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateUserName
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateUserNameArray ) Pop () (v UpdateUserName , 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
}
type UpdateNewAuthorizationArray []UpdateNewAuthorization
func (s UpdateNewAuthorizationArray ) Sort (less func (a , b UpdateNewAuthorization ) bool ) UpdateNewAuthorizationArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateNewAuthorizationArray ) SortStable (less func (a , b UpdateNewAuthorization ) bool ) UpdateNewAuthorizationArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateNewAuthorizationArray ) Retain (keep func (x UpdateNewAuthorization ) bool ) UpdateNewAuthorizationArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateNewAuthorizationArray ) First () (v UpdateNewAuthorization , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateNewAuthorizationArray ) Last () (v UpdateNewAuthorization , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateNewAuthorizationArray ) PopFirst () (v UpdateNewAuthorization , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateNewAuthorization
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateNewAuthorizationArray ) Pop () (v UpdateNewAuthorization , 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
}
type UpdateNewEncryptedMessageArray []UpdateNewEncryptedMessage
func (s UpdateNewEncryptedMessageArray ) Sort (less func (a , b UpdateNewEncryptedMessage ) bool ) UpdateNewEncryptedMessageArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateNewEncryptedMessageArray ) SortStable (less func (a , b UpdateNewEncryptedMessage ) bool ) UpdateNewEncryptedMessageArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateNewEncryptedMessageArray ) Retain (keep func (x UpdateNewEncryptedMessage ) bool ) UpdateNewEncryptedMessageArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateNewEncryptedMessageArray ) First () (v UpdateNewEncryptedMessage , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateNewEncryptedMessageArray ) Last () (v UpdateNewEncryptedMessage , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateNewEncryptedMessageArray ) PopFirst () (v UpdateNewEncryptedMessage , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateNewEncryptedMessage
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateNewEncryptedMessageArray ) Pop () (v UpdateNewEncryptedMessage , 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
}
type UpdateEncryptedChatTypingArray []UpdateEncryptedChatTyping
func (s UpdateEncryptedChatTypingArray ) Sort (less func (a , b UpdateEncryptedChatTyping ) bool ) UpdateEncryptedChatTypingArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateEncryptedChatTypingArray ) SortStable (less func (a , b UpdateEncryptedChatTyping ) bool ) UpdateEncryptedChatTypingArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateEncryptedChatTypingArray ) Retain (keep func (x UpdateEncryptedChatTyping ) bool ) UpdateEncryptedChatTypingArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateEncryptedChatTypingArray ) First () (v UpdateEncryptedChatTyping , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateEncryptedChatTypingArray ) Last () (v UpdateEncryptedChatTyping , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateEncryptedChatTypingArray ) PopFirst () (v UpdateEncryptedChatTyping , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateEncryptedChatTyping
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateEncryptedChatTypingArray ) Pop () (v UpdateEncryptedChatTyping , 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
}
type UpdateEncryptionArray []UpdateEncryption
func (s UpdateEncryptionArray ) Sort (less func (a , b UpdateEncryption ) bool ) UpdateEncryptionArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateEncryptionArray ) SortStable (less func (a , b UpdateEncryption ) bool ) UpdateEncryptionArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateEncryptionArray ) Retain (keep func (x UpdateEncryption ) bool ) UpdateEncryptionArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateEncryptionArray ) First () (v UpdateEncryption , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateEncryptionArray ) Last () (v UpdateEncryption , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateEncryptionArray ) PopFirst () (v UpdateEncryption , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateEncryption
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateEncryptionArray ) Pop () (v UpdateEncryption , 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
}
func (s UpdateEncryptionArray ) SortByDate () UpdateEncryptionArray {
return s .Sort (func (a , b UpdateEncryption ) bool {
return a .GetDate () < b .GetDate ()
})
}
func (s UpdateEncryptionArray ) SortStableByDate () UpdateEncryptionArray {
return s .SortStable (func (a , b UpdateEncryption ) bool {
return a .GetDate () < b .GetDate ()
})
}
type UpdateEncryptedMessagesReadArray []UpdateEncryptedMessagesRead
func (s UpdateEncryptedMessagesReadArray ) Sort (less func (a , b UpdateEncryptedMessagesRead ) bool ) UpdateEncryptedMessagesReadArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateEncryptedMessagesReadArray ) SortStable (less func (a , b UpdateEncryptedMessagesRead ) bool ) UpdateEncryptedMessagesReadArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateEncryptedMessagesReadArray ) Retain (keep func (x UpdateEncryptedMessagesRead ) bool ) UpdateEncryptedMessagesReadArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateEncryptedMessagesReadArray ) First () (v UpdateEncryptedMessagesRead , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateEncryptedMessagesReadArray ) Last () (v UpdateEncryptedMessagesRead , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateEncryptedMessagesReadArray ) PopFirst () (v UpdateEncryptedMessagesRead , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateEncryptedMessagesRead
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateEncryptedMessagesReadArray ) Pop () (v UpdateEncryptedMessagesRead , 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
}
func (s UpdateEncryptedMessagesReadArray ) SortByDate () UpdateEncryptedMessagesReadArray {
return s .Sort (func (a , b UpdateEncryptedMessagesRead ) bool {
return a .GetDate () < b .GetDate ()
})
}
func (s UpdateEncryptedMessagesReadArray ) SortStableByDate () UpdateEncryptedMessagesReadArray {
return s .SortStable (func (a , b UpdateEncryptedMessagesRead ) bool {
return a .GetDate () < b .GetDate ()
})
}
type UpdateChatParticipantAddArray []UpdateChatParticipantAdd
func (s UpdateChatParticipantAddArray ) Sort (less func (a , b UpdateChatParticipantAdd ) bool ) UpdateChatParticipantAddArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateChatParticipantAddArray ) SortStable (less func (a , b UpdateChatParticipantAdd ) bool ) UpdateChatParticipantAddArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateChatParticipantAddArray ) Retain (keep func (x UpdateChatParticipantAdd ) bool ) UpdateChatParticipantAddArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateChatParticipantAddArray ) First () (v UpdateChatParticipantAdd , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateChatParticipantAddArray ) Last () (v UpdateChatParticipantAdd , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateChatParticipantAddArray ) PopFirst () (v UpdateChatParticipantAdd , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateChatParticipantAdd
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateChatParticipantAddArray ) Pop () (v UpdateChatParticipantAdd , 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
}
func (s UpdateChatParticipantAddArray ) SortByDate () UpdateChatParticipantAddArray {
return s .Sort (func (a , b UpdateChatParticipantAdd ) bool {
return a .GetDate () < b .GetDate ()
})
}
func (s UpdateChatParticipantAddArray ) SortStableByDate () UpdateChatParticipantAddArray {
return s .SortStable (func (a , b UpdateChatParticipantAdd ) bool {
return a .GetDate () < b .GetDate ()
})
}
type UpdateChatParticipantDeleteArray []UpdateChatParticipantDelete
func (s UpdateChatParticipantDeleteArray ) Sort (less func (a , b UpdateChatParticipantDelete ) bool ) UpdateChatParticipantDeleteArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateChatParticipantDeleteArray ) SortStable (less func (a , b UpdateChatParticipantDelete ) bool ) UpdateChatParticipantDeleteArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateChatParticipantDeleteArray ) Retain (keep func (x UpdateChatParticipantDelete ) bool ) UpdateChatParticipantDeleteArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateChatParticipantDeleteArray ) First () (v UpdateChatParticipantDelete , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateChatParticipantDeleteArray ) Last () (v UpdateChatParticipantDelete , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateChatParticipantDeleteArray ) PopFirst () (v UpdateChatParticipantDelete , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateChatParticipantDelete
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateChatParticipantDeleteArray ) Pop () (v UpdateChatParticipantDelete , 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
}
type UpdateDCOptionsArray []UpdateDCOptions
func (s UpdateDCOptionsArray ) Sort (less func (a , b UpdateDCOptions ) bool ) UpdateDCOptionsArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateDCOptionsArray ) SortStable (less func (a , b UpdateDCOptions ) bool ) UpdateDCOptionsArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateDCOptionsArray ) Retain (keep func (x UpdateDCOptions ) bool ) UpdateDCOptionsArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateDCOptionsArray ) First () (v UpdateDCOptions , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateDCOptionsArray ) Last () (v UpdateDCOptions , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateDCOptionsArray ) PopFirst () (v UpdateDCOptions , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateDCOptions
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateDCOptionsArray ) Pop () (v UpdateDCOptions , 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
}
type UpdateNotifySettingsArray []UpdateNotifySettings
func (s UpdateNotifySettingsArray ) Sort (less func (a , b UpdateNotifySettings ) bool ) UpdateNotifySettingsArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateNotifySettingsArray ) SortStable (less func (a , b UpdateNotifySettings ) bool ) UpdateNotifySettingsArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateNotifySettingsArray ) Retain (keep func (x UpdateNotifySettings ) bool ) UpdateNotifySettingsArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateNotifySettingsArray ) First () (v UpdateNotifySettings , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateNotifySettingsArray ) Last () (v UpdateNotifySettings , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateNotifySettingsArray ) PopFirst () (v UpdateNotifySettings , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateNotifySettings
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateNotifySettingsArray ) Pop () (v UpdateNotifySettings , 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
}
type UpdateServiceNotificationArray []UpdateServiceNotification
func (s UpdateServiceNotificationArray ) Sort (less func (a , b UpdateServiceNotification ) bool ) UpdateServiceNotificationArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateServiceNotificationArray ) SortStable (less func (a , b UpdateServiceNotification ) bool ) UpdateServiceNotificationArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateServiceNotificationArray ) Retain (keep func (x UpdateServiceNotification ) bool ) UpdateServiceNotificationArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateServiceNotificationArray ) First () (v UpdateServiceNotification , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateServiceNotificationArray ) Last () (v UpdateServiceNotification , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateServiceNotificationArray ) PopFirst () (v UpdateServiceNotification , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateServiceNotification
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateServiceNotificationArray ) Pop () (v UpdateServiceNotification , 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
}
type UpdatePrivacyArray []UpdatePrivacy
func (s UpdatePrivacyArray ) Sort (less func (a , b UpdatePrivacy ) bool ) UpdatePrivacyArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdatePrivacyArray ) SortStable (less func (a , b UpdatePrivacy ) bool ) UpdatePrivacyArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdatePrivacyArray ) Retain (keep func (x UpdatePrivacy ) bool ) UpdatePrivacyArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdatePrivacyArray ) First () (v UpdatePrivacy , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdatePrivacyArray ) Last () (v UpdatePrivacy , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdatePrivacyArray ) PopFirst () (v UpdatePrivacy , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdatePrivacy
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdatePrivacyArray ) Pop () (v UpdatePrivacy , 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
}
type UpdateUserPhoneArray []UpdateUserPhone
func (s UpdateUserPhoneArray ) Sort (less func (a , b UpdateUserPhone ) bool ) UpdateUserPhoneArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateUserPhoneArray ) SortStable (less func (a , b UpdateUserPhone ) bool ) UpdateUserPhoneArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateUserPhoneArray ) Retain (keep func (x UpdateUserPhone ) bool ) UpdateUserPhoneArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateUserPhoneArray ) First () (v UpdateUserPhone , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateUserPhoneArray ) Last () (v UpdateUserPhone , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateUserPhoneArray ) PopFirst () (v UpdateUserPhone , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateUserPhone
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateUserPhoneArray ) Pop () (v UpdateUserPhone , 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
}
type UpdateReadHistoryInboxArray []UpdateReadHistoryInbox
func (s UpdateReadHistoryInboxArray ) Sort (less func (a , b UpdateReadHistoryInbox ) bool ) UpdateReadHistoryInboxArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateReadHistoryInboxArray ) SortStable (less func (a , b UpdateReadHistoryInbox ) bool ) UpdateReadHistoryInboxArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateReadHistoryInboxArray ) Retain (keep func (x UpdateReadHistoryInbox ) bool ) UpdateReadHistoryInboxArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateReadHistoryInboxArray ) First () (v UpdateReadHistoryInbox , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateReadHistoryInboxArray ) Last () (v UpdateReadHistoryInbox , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateReadHistoryInboxArray ) PopFirst () (v UpdateReadHistoryInbox , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateReadHistoryInbox
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateReadHistoryInboxArray ) Pop () (v UpdateReadHistoryInbox , 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
}
type UpdateReadHistoryOutboxArray []UpdateReadHistoryOutbox
func (s UpdateReadHistoryOutboxArray ) Sort (less func (a , b UpdateReadHistoryOutbox ) bool ) UpdateReadHistoryOutboxArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateReadHistoryOutboxArray ) SortStable (less func (a , b UpdateReadHistoryOutbox ) bool ) UpdateReadHistoryOutboxArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateReadHistoryOutboxArray ) Retain (keep func (x UpdateReadHistoryOutbox ) bool ) UpdateReadHistoryOutboxArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateReadHistoryOutboxArray ) First () (v UpdateReadHistoryOutbox , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateReadHistoryOutboxArray ) Last () (v UpdateReadHistoryOutbox , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateReadHistoryOutboxArray ) PopFirst () (v UpdateReadHistoryOutbox , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateReadHistoryOutbox
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateReadHistoryOutboxArray ) Pop () (v UpdateReadHistoryOutbox , 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
}
type UpdateWebPageArray []UpdateWebPage
func (s UpdateWebPageArray ) Sort (less func (a , b UpdateWebPage ) bool ) UpdateWebPageArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateWebPageArray ) SortStable (less func (a , b UpdateWebPage ) bool ) UpdateWebPageArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateWebPageArray ) Retain (keep func (x UpdateWebPage ) bool ) UpdateWebPageArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateWebPageArray ) First () (v UpdateWebPage , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateWebPageArray ) Last () (v UpdateWebPage , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateWebPageArray ) PopFirst () (v UpdateWebPage , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateWebPage
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateWebPageArray ) Pop () (v UpdateWebPage , 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
}
type UpdateReadMessagesContentsArray []UpdateReadMessagesContents
func (s UpdateReadMessagesContentsArray ) Sort (less func (a , b UpdateReadMessagesContents ) bool ) UpdateReadMessagesContentsArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateReadMessagesContentsArray ) SortStable (less func (a , b UpdateReadMessagesContents ) bool ) UpdateReadMessagesContentsArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateReadMessagesContentsArray ) Retain (keep func (x UpdateReadMessagesContents ) bool ) UpdateReadMessagesContentsArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateReadMessagesContentsArray ) First () (v UpdateReadMessagesContents , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateReadMessagesContentsArray ) Last () (v UpdateReadMessagesContents , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateReadMessagesContentsArray ) PopFirst () (v UpdateReadMessagesContents , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateReadMessagesContents
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateReadMessagesContentsArray ) Pop () (v UpdateReadMessagesContents , 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
}
type UpdateChannelTooLongArray []UpdateChannelTooLong
func (s UpdateChannelTooLongArray ) Sort (less func (a , b UpdateChannelTooLong ) bool ) UpdateChannelTooLongArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateChannelTooLongArray ) SortStable (less func (a , b UpdateChannelTooLong ) bool ) UpdateChannelTooLongArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateChannelTooLongArray ) Retain (keep func (x UpdateChannelTooLong ) bool ) UpdateChannelTooLongArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateChannelTooLongArray ) First () (v UpdateChannelTooLong , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateChannelTooLongArray ) Last () (v UpdateChannelTooLong , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateChannelTooLongArray ) PopFirst () (v UpdateChannelTooLong , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateChannelTooLong
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateChannelTooLongArray ) Pop () (v UpdateChannelTooLong , 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
}
type UpdateChannelArray []UpdateChannel
func (s UpdateChannelArray ) Sort (less func (a , b UpdateChannel ) bool ) UpdateChannelArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateChannelArray ) SortStable (less func (a , b UpdateChannel ) bool ) UpdateChannelArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateChannelArray ) Retain (keep func (x UpdateChannel ) bool ) UpdateChannelArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateChannelArray ) First () (v UpdateChannel , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateChannelArray ) Last () (v UpdateChannel , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateChannelArray ) PopFirst () (v UpdateChannel , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateChannel
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateChannelArray ) Pop () (v UpdateChannel , 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
}
type UpdateNewChannelMessageArray []UpdateNewChannelMessage
func (s UpdateNewChannelMessageArray ) Sort (less func (a , b UpdateNewChannelMessage ) bool ) UpdateNewChannelMessageArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateNewChannelMessageArray ) SortStable (less func (a , b UpdateNewChannelMessage ) bool ) UpdateNewChannelMessageArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateNewChannelMessageArray ) Retain (keep func (x UpdateNewChannelMessage ) bool ) UpdateNewChannelMessageArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateNewChannelMessageArray ) First () (v UpdateNewChannelMessage , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateNewChannelMessageArray ) Last () (v UpdateNewChannelMessage , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateNewChannelMessageArray ) PopFirst () (v UpdateNewChannelMessage , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateNewChannelMessage
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateNewChannelMessageArray ) Pop () (v UpdateNewChannelMessage , 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
}
type UpdateReadChannelInboxArray []UpdateReadChannelInbox
func (s UpdateReadChannelInboxArray ) Sort (less func (a , b UpdateReadChannelInbox ) bool ) UpdateReadChannelInboxArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateReadChannelInboxArray ) SortStable (less func (a , b UpdateReadChannelInbox ) bool ) UpdateReadChannelInboxArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateReadChannelInboxArray ) Retain (keep func (x UpdateReadChannelInbox ) bool ) UpdateReadChannelInboxArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateReadChannelInboxArray ) First () (v UpdateReadChannelInbox , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateReadChannelInboxArray ) Last () (v UpdateReadChannelInbox , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateReadChannelInboxArray ) PopFirst () (v UpdateReadChannelInbox , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateReadChannelInbox
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateReadChannelInboxArray ) Pop () (v UpdateReadChannelInbox , 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
}
type UpdateDeleteChannelMessagesArray []UpdateDeleteChannelMessages
func (s UpdateDeleteChannelMessagesArray ) Sort (less func (a , b UpdateDeleteChannelMessages ) bool ) UpdateDeleteChannelMessagesArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateDeleteChannelMessagesArray ) SortStable (less func (a , b UpdateDeleteChannelMessages ) bool ) UpdateDeleteChannelMessagesArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateDeleteChannelMessagesArray ) Retain (keep func (x UpdateDeleteChannelMessages ) bool ) UpdateDeleteChannelMessagesArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateDeleteChannelMessagesArray ) First () (v UpdateDeleteChannelMessages , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateDeleteChannelMessagesArray ) Last () (v UpdateDeleteChannelMessages , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateDeleteChannelMessagesArray ) PopFirst () (v UpdateDeleteChannelMessages , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateDeleteChannelMessages
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateDeleteChannelMessagesArray ) Pop () (v UpdateDeleteChannelMessages , 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
}
type UpdateChannelMessageViewsArray []UpdateChannelMessageViews
func (s UpdateChannelMessageViewsArray ) Sort (less func (a , b UpdateChannelMessageViews ) bool ) UpdateChannelMessageViewsArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateChannelMessageViewsArray ) SortStable (less func (a , b UpdateChannelMessageViews ) bool ) UpdateChannelMessageViewsArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateChannelMessageViewsArray ) Retain (keep func (x UpdateChannelMessageViews ) bool ) UpdateChannelMessageViewsArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateChannelMessageViewsArray ) First () (v UpdateChannelMessageViews , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateChannelMessageViewsArray ) Last () (v UpdateChannelMessageViews , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateChannelMessageViewsArray ) PopFirst () (v UpdateChannelMessageViews , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateChannelMessageViews
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateChannelMessageViewsArray ) Pop () (v UpdateChannelMessageViews , 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
}
func (s UpdateChannelMessageViewsArray ) SortByID () UpdateChannelMessageViewsArray {
return s .Sort (func (a , b UpdateChannelMessageViews ) bool {
return a .GetID () < b .GetID ()
})
}
func (s UpdateChannelMessageViewsArray ) SortStableByID () UpdateChannelMessageViewsArray {
return s .SortStable (func (a , b UpdateChannelMessageViews ) bool {
return a .GetID () < b .GetID ()
})
}
func (s UpdateChannelMessageViewsArray ) FillMap (to map [int ]UpdateChannelMessageViews ) {
for _ , value := range s {
to [value .GetID ()] = value
}
}
func (s UpdateChannelMessageViewsArray ) ToMap () map [int ]UpdateChannelMessageViews {
r := make (map [int ]UpdateChannelMessageViews , len (s ))
s .FillMap (r )
return r
}
type UpdateChatParticipantAdminArray []UpdateChatParticipantAdmin
func (s UpdateChatParticipantAdminArray ) Sort (less func (a , b UpdateChatParticipantAdmin ) bool ) UpdateChatParticipantAdminArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateChatParticipantAdminArray ) SortStable (less func (a , b UpdateChatParticipantAdmin ) bool ) UpdateChatParticipantAdminArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateChatParticipantAdminArray ) Retain (keep func (x UpdateChatParticipantAdmin ) bool ) UpdateChatParticipantAdminArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateChatParticipantAdminArray ) First () (v UpdateChatParticipantAdmin , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateChatParticipantAdminArray ) Last () (v UpdateChatParticipantAdmin , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateChatParticipantAdminArray ) PopFirst () (v UpdateChatParticipantAdmin , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateChatParticipantAdmin
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateChatParticipantAdminArray ) Pop () (v UpdateChatParticipantAdmin , 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
}
type UpdateNewStickerSetArray []UpdateNewStickerSet
func (s UpdateNewStickerSetArray ) Sort (less func (a , b UpdateNewStickerSet ) bool ) UpdateNewStickerSetArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateNewStickerSetArray ) SortStable (less func (a , b UpdateNewStickerSet ) bool ) UpdateNewStickerSetArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateNewStickerSetArray ) Retain (keep func (x UpdateNewStickerSet ) bool ) UpdateNewStickerSetArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateNewStickerSetArray ) First () (v UpdateNewStickerSet , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateNewStickerSetArray ) Last () (v UpdateNewStickerSet , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateNewStickerSetArray ) PopFirst () (v UpdateNewStickerSet , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateNewStickerSet
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateNewStickerSetArray ) Pop () (v UpdateNewStickerSet , 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
}
type UpdateStickerSetsOrderArray []UpdateStickerSetsOrder
func (s UpdateStickerSetsOrderArray ) Sort (less func (a , b UpdateStickerSetsOrder ) bool ) UpdateStickerSetsOrderArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateStickerSetsOrderArray ) SortStable (less func (a , b UpdateStickerSetsOrder ) bool ) UpdateStickerSetsOrderArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateStickerSetsOrderArray ) Retain (keep func (x UpdateStickerSetsOrder ) bool ) UpdateStickerSetsOrderArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateStickerSetsOrderArray ) First () (v UpdateStickerSetsOrder , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateStickerSetsOrderArray ) Last () (v UpdateStickerSetsOrder , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateStickerSetsOrderArray ) PopFirst () (v UpdateStickerSetsOrder , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateStickerSetsOrder
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateStickerSetsOrderArray ) Pop () (v UpdateStickerSetsOrder , 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
}
type UpdateStickerSetsArray []UpdateStickerSets
func (s UpdateStickerSetsArray ) Sort (less func (a , b UpdateStickerSets ) bool ) UpdateStickerSetsArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateStickerSetsArray ) SortStable (less func (a , b UpdateStickerSets ) bool ) UpdateStickerSetsArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateStickerSetsArray ) Retain (keep func (x UpdateStickerSets ) bool ) UpdateStickerSetsArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateStickerSetsArray ) First () (v UpdateStickerSets , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateStickerSetsArray ) Last () (v UpdateStickerSets , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateStickerSetsArray ) PopFirst () (v UpdateStickerSets , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateStickerSets
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateStickerSetsArray ) Pop () (v UpdateStickerSets , 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
}
type UpdateBotInlineQueryArray []UpdateBotInlineQuery
func (s UpdateBotInlineQueryArray ) Sort (less func (a , b UpdateBotInlineQuery ) bool ) UpdateBotInlineQueryArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateBotInlineQueryArray ) SortStable (less func (a , b UpdateBotInlineQuery ) bool ) UpdateBotInlineQueryArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateBotInlineQueryArray ) Retain (keep func (x UpdateBotInlineQuery ) bool ) UpdateBotInlineQueryArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateBotInlineQueryArray ) First () (v UpdateBotInlineQuery , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateBotInlineQueryArray ) Last () (v UpdateBotInlineQuery , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateBotInlineQueryArray ) PopFirst () (v UpdateBotInlineQuery , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateBotInlineQuery
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateBotInlineQueryArray ) Pop () (v UpdateBotInlineQuery , 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
}
type UpdateBotInlineSendArray []UpdateBotInlineSend
func (s UpdateBotInlineSendArray ) Sort (less func (a , b UpdateBotInlineSend ) bool ) UpdateBotInlineSendArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateBotInlineSendArray ) SortStable (less func (a , b UpdateBotInlineSend ) bool ) UpdateBotInlineSendArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateBotInlineSendArray ) Retain (keep func (x UpdateBotInlineSend ) bool ) UpdateBotInlineSendArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateBotInlineSendArray ) First () (v UpdateBotInlineSend , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateBotInlineSendArray ) Last () (v UpdateBotInlineSend , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateBotInlineSendArray ) PopFirst () (v UpdateBotInlineSend , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateBotInlineSend
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateBotInlineSendArray ) Pop () (v UpdateBotInlineSend , 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
}
type UpdateEditChannelMessageArray []UpdateEditChannelMessage
func (s UpdateEditChannelMessageArray ) Sort (less func (a , b UpdateEditChannelMessage ) bool ) UpdateEditChannelMessageArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateEditChannelMessageArray ) SortStable (less func (a , b UpdateEditChannelMessage ) bool ) UpdateEditChannelMessageArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateEditChannelMessageArray ) Retain (keep func (x UpdateEditChannelMessage ) bool ) UpdateEditChannelMessageArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateEditChannelMessageArray ) First () (v UpdateEditChannelMessage , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateEditChannelMessageArray ) Last () (v UpdateEditChannelMessage , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateEditChannelMessageArray ) PopFirst () (v UpdateEditChannelMessage , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateEditChannelMessage
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateEditChannelMessageArray ) Pop () (v UpdateEditChannelMessage , 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
}
type UpdateBotCallbackQueryArray []UpdateBotCallbackQuery
func (s UpdateBotCallbackQueryArray ) Sort (less func (a , b UpdateBotCallbackQuery ) bool ) UpdateBotCallbackQueryArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateBotCallbackQueryArray ) SortStable (less func (a , b UpdateBotCallbackQuery ) bool ) UpdateBotCallbackQueryArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateBotCallbackQueryArray ) Retain (keep func (x UpdateBotCallbackQuery ) bool ) UpdateBotCallbackQueryArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateBotCallbackQueryArray ) First () (v UpdateBotCallbackQuery , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateBotCallbackQueryArray ) Last () (v UpdateBotCallbackQuery , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateBotCallbackQueryArray ) PopFirst () (v UpdateBotCallbackQuery , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateBotCallbackQuery
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateBotCallbackQueryArray ) Pop () (v UpdateBotCallbackQuery , 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
}
type UpdateEditMessageArray []UpdateEditMessage
func (s UpdateEditMessageArray ) Sort (less func (a , b UpdateEditMessage ) bool ) UpdateEditMessageArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateEditMessageArray ) SortStable (less func (a , b UpdateEditMessage ) bool ) UpdateEditMessageArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateEditMessageArray ) Retain (keep func (x UpdateEditMessage ) bool ) UpdateEditMessageArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateEditMessageArray ) First () (v UpdateEditMessage , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateEditMessageArray ) Last () (v UpdateEditMessage , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateEditMessageArray ) PopFirst () (v UpdateEditMessage , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateEditMessage
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateEditMessageArray ) Pop () (v UpdateEditMessage , 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
}
type UpdateInlineBotCallbackQueryArray []UpdateInlineBotCallbackQuery
func (s UpdateInlineBotCallbackQueryArray ) Sort (less func (a , b UpdateInlineBotCallbackQuery ) bool ) UpdateInlineBotCallbackQueryArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateInlineBotCallbackQueryArray ) SortStable (less func (a , b UpdateInlineBotCallbackQuery ) bool ) UpdateInlineBotCallbackQueryArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateInlineBotCallbackQueryArray ) Retain (keep func (x UpdateInlineBotCallbackQuery ) bool ) UpdateInlineBotCallbackQueryArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateInlineBotCallbackQueryArray ) First () (v UpdateInlineBotCallbackQuery , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateInlineBotCallbackQueryArray ) Last () (v UpdateInlineBotCallbackQuery , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateInlineBotCallbackQueryArray ) PopFirst () (v UpdateInlineBotCallbackQuery , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateInlineBotCallbackQuery
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateInlineBotCallbackQueryArray ) Pop () (v UpdateInlineBotCallbackQuery , 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
}
type UpdateReadChannelOutboxArray []UpdateReadChannelOutbox
func (s UpdateReadChannelOutboxArray ) Sort (less func (a , b UpdateReadChannelOutbox ) bool ) UpdateReadChannelOutboxArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateReadChannelOutboxArray ) SortStable (less func (a , b UpdateReadChannelOutbox ) bool ) UpdateReadChannelOutboxArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateReadChannelOutboxArray ) Retain (keep func (x UpdateReadChannelOutbox ) bool ) UpdateReadChannelOutboxArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateReadChannelOutboxArray ) First () (v UpdateReadChannelOutbox , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateReadChannelOutboxArray ) Last () (v UpdateReadChannelOutbox , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateReadChannelOutboxArray ) PopFirst () (v UpdateReadChannelOutbox , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateReadChannelOutbox
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateReadChannelOutboxArray ) Pop () (v UpdateReadChannelOutbox , 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
}
type UpdateDraftMessageArray []UpdateDraftMessage
func (s UpdateDraftMessageArray ) Sort (less func (a , b UpdateDraftMessage ) bool ) UpdateDraftMessageArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateDraftMessageArray ) SortStable (less func (a , b UpdateDraftMessage ) bool ) UpdateDraftMessageArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateDraftMessageArray ) Retain (keep func (x UpdateDraftMessage ) bool ) UpdateDraftMessageArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateDraftMessageArray ) First () (v UpdateDraftMessage , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateDraftMessageArray ) Last () (v UpdateDraftMessage , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateDraftMessageArray ) PopFirst () (v UpdateDraftMessage , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateDraftMessage
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateDraftMessageArray ) Pop () (v UpdateDraftMessage , 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
}
type UpdateChannelWebPageArray []UpdateChannelWebPage
func (s UpdateChannelWebPageArray ) Sort (less func (a , b UpdateChannelWebPage ) bool ) UpdateChannelWebPageArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateChannelWebPageArray ) SortStable (less func (a , b UpdateChannelWebPage ) bool ) UpdateChannelWebPageArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateChannelWebPageArray ) Retain (keep func (x UpdateChannelWebPage ) bool ) UpdateChannelWebPageArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateChannelWebPageArray ) First () (v UpdateChannelWebPage , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateChannelWebPageArray ) Last () (v UpdateChannelWebPage , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateChannelWebPageArray ) PopFirst () (v UpdateChannelWebPage , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateChannelWebPage
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateChannelWebPageArray ) Pop () (v UpdateChannelWebPage , 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
}
type UpdateDialogPinnedArray []UpdateDialogPinned
func (s UpdateDialogPinnedArray ) Sort (less func (a , b UpdateDialogPinned ) bool ) UpdateDialogPinnedArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateDialogPinnedArray ) SortStable (less func (a , b UpdateDialogPinned ) bool ) UpdateDialogPinnedArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateDialogPinnedArray ) Retain (keep func (x UpdateDialogPinned ) bool ) UpdateDialogPinnedArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateDialogPinnedArray ) First () (v UpdateDialogPinned , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateDialogPinnedArray ) Last () (v UpdateDialogPinned , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateDialogPinnedArray ) PopFirst () (v UpdateDialogPinned , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateDialogPinned
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateDialogPinnedArray ) Pop () (v UpdateDialogPinned , 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
}
type UpdatePinnedDialogsArray []UpdatePinnedDialogs
func (s UpdatePinnedDialogsArray ) Sort (less func (a , b UpdatePinnedDialogs ) bool ) UpdatePinnedDialogsArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdatePinnedDialogsArray ) SortStable (less func (a , b UpdatePinnedDialogs ) bool ) UpdatePinnedDialogsArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdatePinnedDialogsArray ) Retain (keep func (x UpdatePinnedDialogs ) bool ) UpdatePinnedDialogsArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdatePinnedDialogsArray ) First () (v UpdatePinnedDialogs , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdatePinnedDialogsArray ) Last () (v UpdatePinnedDialogs , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdatePinnedDialogsArray ) PopFirst () (v UpdatePinnedDialogs , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdatePinnedDialogs
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdatePinnedDialogsArray ) Pop () (v UpdatePinnedDialogs , 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
}
type UpdateBotWebhookJSONArray []UpdateBotWebhookJSON
func (s UpdateBotWebhookJSONArray ) Sort (less func (a , b UpdateBotWebhookJSON ) bool ) UpdateBotWebhookJSONArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateBotWebhookJSONArray ) SortStable (less func (a , b UpdateBotWebhookJSON ) bool ) UpdateBotWebhookJSONArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateBotWebhookJSONArray ) Retain (keep func (x UpdateBotWebhookJSON ) bool ) UpdateBotWebhookJSONArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateBotWebhookJSONArray ) First () (v UpdateBotWebhookJSON , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateBotWebhookJSONArray ) Last () (v UpdateBotWebhookJSON , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateBotWebhookJSONArray ) PopFirst () (v UpdateBotWebhookJSON , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateBotWebhookJSON
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateBotWebhookJSONArray ) Pop () (v UpdateBotWebhookJSON , 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
}
type UpdateBotWebhookJSONQueryArray []UpdateBotWebhookJSONQuery
func (s UpdateBotWebhookJSONQueryArray ) Sort (less func (a , b UpdateBotWebhookJSONQuery ) bool ) UpdateBotWebhookJSONQueryArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateBotWebhookJSONQueryArray ) SortStable (less func (a , b UpdateBotWebhookJSONQuery ) bool ) UpdateBotWebhookJSONQueryArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateBotWebhookJSONQueryArray ) Retain (keep func (x UpdateBotWebhookJSONQuery ) bool ) UpdateBotWebhookJSONQueryArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateBotWebhookJSONQueryArray ) First () (v UpdateBotWebhookJSONQuery , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateBotWebhookJSONQueryArray ) Last () (v UpdateBotWebhookJSONQuery , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateBotWebhookJSONQueryArray ) PopFirst () (v UpdateBotWebhookJSONQuery , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateBotWebhookJSONQuery
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateBotWebhookJSONQueryArray ) Pop () (v UpdateBotWebhookJSONQuery , 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
}
type UpdateBotShippingQueryArray []UpdateBotShippingQuery
func (s UpdateBotShippingQueryArray ) Sort (less func (a , b UpdateBotShippingQuery ) bool ) UpdateBotShippingQueryArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateBotShippingQueryArray ) SortStable (less func (a , b UpdateBotShippingQuery ) bool ) UpdateBotShippingQueryArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateBotShippingQueryArray ) Retain (keep func (x UpdateBotShippingQuery ) bool ) UpdateBotShippingQueryArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateBotShippingQueryArray ) First () (v UpdateBotShippingQuery , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateBotShippingQueryArray ) Last () (v UpdateBotShippingQuery , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateBotShippingQueryArray ) PopFirst () (v UpdateBotShippingQuery , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateBotShippingQuery
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateBotShippingQueryArray ) Pop () (v UpdateBotShippingQuery , 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
}
type UpdateBotPrecheckoutQueryArray []UpdateBotPrecheckoutQuery
func (s UpdateBotPrecheckoutQueryArray ) Sort (less func (a , b UpdateBotPrecheckoutQuery ) bool ) UpdateBotPrecheckoutQueryArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateBotPrecheckoutQueryArray ) SortStable (less func (a , b UpdateBotPrecheckoutQuery ) bool ) UpdateBotPrecheckoutQueryArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateBotPrecheckoutQueryArray ) Retain (keep func (x UpdateBotPrecheckoutQuery ) bool ) UpdateBotPrecheckoutQueryArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateBotPrecheckoutQueryArray ) First () (v UpdateBotPrecheckoutQuery , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateBotPrecheckoutQueryArray ) Last () (v UpdateBotPrecheckoutQuery , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateBotPrecheckoutQueryArray ) PopFirst () (v UpdateBotPrecheckoutQuery , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateBotPrecheckoutQuery
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateBotPrecheckoutQueryArray ) Pop () (v UpdateBotPrecheckoutQuery , 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
}
type UpdatePhoneCallArray []UpdatePhoneCall
func (s UpdatePhoneCallArray ) Sort (less func (a , b UpdatePhoneCall ) bool ) UpdatePhoneCallArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdatePhoneCallArray ) SortStable (less func (a , b UpdatePhoneCall ) bool ) UpdatePhoneCallArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdatePhoneCallArray ) Retain (keep func (x UpdatePhoneCall ) bool ) UpdatePhoneCallArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdatePhoneCallArray ) First () (v UpdatePhoneCall , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdatePhoneCallArray ) Last () (v UpdatePhoneCall , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdatePhoneCallArray ) PopFirst () (v UpdatePhoneCall , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdatePhoneCall
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdatePhoneCallArray ) Pop () (v UpdatePhoneCall , 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
}
type UpdateLangPackTooLongArray []UpdateLangPackTooLong
func (s UpdateLangPackTooLongArray ) Sort (less func (a , b UpdateLangPackTooLong ) bool ) UpdateLangPackTooLongArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateLangPackTooLongArray ) SortStable (less func (a , b UpdateLangPackTooLong ) bool ) UpdateLangPackTooLongArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateLangPackTooLongArray ) Retain (keep func (x UpdateLangPackTooLong ) bool ) UpdateLangPackTooLongArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateLangPackTooLongArray ) First () (v UpdateLangPackTooLong , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateLangPackTooLongArray ) Last () (v UpdateLangPackTooLong , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateLangPackTooLongArray ) PopFirst () (v UpdateLangPackTooLong , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateLangPackTooLong
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateLangPackTooLongArray ) Pop () (v UpdateLangPackTooLong , 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
}
type UpdateLangPackArray []UpdateLangPack
func (s UpdateLangPackArray ) Sort (less func (a , b UpdateLangPack ) bool ) UpdateLangPackArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateLangPackArray ) SortStable (less func (a , b UpdateLangPack ) bool ) UpdateLangPackArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateLangPackArray ) Retain (keep func (x UpdateLangPack ) bool ) UpdateLangPackArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateLangPackArray ) First () (v UpdateLangPack , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateLangPackArray ) Last () (v UpdateLangPack , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateLangPackArray ) PopFirst () (v UpdateLangPack , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateLangPack
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateLangPackArray ) Pop () (v UpdateLangPack , 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
}
type UpdateChannelReadMessagesContentsArray []UpdateChannelReadMessagesContents
func (s UpdateChannelReadMessagesContentsArray ) Sort (less func (a , b UpdateChannelReadMessagesContents ) bool ) UpdateChannelReadMessagesContentsArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateChannelReadMessagesContentsArray ) SortStable (less func (a , b UpdateChannelReadMessagesContents ) bool ) UpdateChannelReadMessagesContentsArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateChannelReadMessagesContentsArray ) Retain (keep func (x UpdateChannelReadMessagesContents ) bool ) UpdateChannelReadMessagesContentsArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateChannelReadMessagesContentsArray ) First () (v UpdateChannelReadMessagesContents , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateChannelReadMessagesContentsArray ) Last () (v UpdateChannelReadMessagesContents , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateChannelReadMessagesContentsArray ) PopFirst () (v UpdateChannelReadMessagesContents , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateChannelReadMessagesContents
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateChannelReadMessagesContentsArray ) Pop () (v UpdateChannelReadMessagesContents , 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
}
type UpdateChannelAvailableMessagesArray []UpdateChannelAvailableMessages
func (s UpdateChannelAvailableMessagesArray ) Sort (less func (a , b UpdateChannelAvailableMessages ) bool ) UpdateChannelAvailableMessagesArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateChannelAvailableMessagesArray ) SortStable (less func (a , b UpdateChannelAvailableMessages ) bool ) UpdateChannelAvailableMessagesArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateChannelAvailableMessagesArray ) Retain (keep func (x UpdateChannelAvailableMessages ) bool ) UpdateChannelAvailableMessagesArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateChannelAvailableMessagesArray ) First () (v UpdateChannelAvailableMessages , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateChannelAvailableMessagesArray ) Last () (v UpdateChannelAvailableMessages , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateChannelAvailableMessagesArray ) PopFirst () (v UpdateChannelAvailableMessages , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateChannelAvailableMessages
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateChannelAvailableMessagesArray ) Pop () (v UpdateChannelAvailableMessages , 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
}
type UpdateDialogUnreadMarkArray []UpdateDialogUnreadMark
func (s UpdateDialogUnreadMarkArray ) Sort (less func (a , b UpdateDialogUnreadMark ) bool ) UpdateDialogUnreadMarkArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateDialogUnreadMarkArray ) SortStable (less func (a , b UpdateDialogUnreadMark ) bool ) UpdateDialogUnreadMarkArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateDialogUnreadMarkArray ) Retain (keep func (x UpdateDialogUnreadMark ) bool ) UpdateDialogUnreadMarkArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateDialogUnreadMarkArray ) First () (v UpdateDialogUnreadMark , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateDialogUnreadMarkArray ) Last () (v UpdateDialogUnreadMark , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateDialogUnreadMarkArray ) PopFirst () (v UpdateDialogUnreadMark , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateDialogUnreadMark
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateDialogUnreadMarkArray ) Pop () (v UpdateDialogUnreadMark , 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
}
type UpdateMessagePollArray []UpdateMessagePoll
func (s UpdateMessagePollArray ) Sort (less func (a , b UpdateMessagePoll ) bool ) UpdateMessagePollArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateMessagePollArray ) SortStable (less func (a , b UpdateMessagePoll ) bool ) UpdateMessagePollArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateMessagePollArray ) Retain (keep func (x UpdateMessagePoll ) bool ) UpdateMessagePollArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateMessagePollArray ) First () (v UpdateMessagePoll , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateMessagePollArray ) Last () (v UpdateMessagePoll , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateMessagePollArray ) PopFirst () (v UpdateMessagePoll , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateMessagePoll
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateMessagePollArray ) Pop () (v UpdateMessagePoll , 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
}
type UpdateChatDefaultBannedRightsArray []UpdateChatDefaultBannedRights
func (s UpdateChatDefaultBannedRightsArray ) Sort (less func (a , b UpdateChatDefaultBannedRights ) bool ) UpdateChatDefaultBannedRightsArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateChatDefaultBannedRightsArray ) SortStable (less func (a , b UpdateChatDefaultBannedRights ) bool ) UpdateChatDefaultBannedRightsArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateChatDefaultBannedRightsArray ) Retain (keep func (x UpdateChatDefaultBannedRights ) bool ) UpdateChatDefaultBannedRightsArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateChatDefaultBannedRightsArray ) First () (v UpdateChatDefaultBannedRights , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateChatDefaultBannedRightsArray ) Last () (v UpdateChatDefaultBannedRights , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateChatDefaultBannedRightsArray ) PopFirst () (v UpdateChatDefaultBannedRights , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateChatDefaultBannedRights
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateChatDefaultBannedRightsArray ) Pop () (v UpdateChatDefaultBannedRights , 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
}
type UpdateFolderPeersArray []UpdateFolderPeers
func (s UpdateFolderPeersArray ) Sort (less func (a , b UpdateFolderPeers ) bool ) UpdateFolderPeersArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateFolderPeersArray ) SortStable (less func (a , b UpdateFolderPeers ) bool ) UpdateFolderPeersArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateFolderPeersArray ) Retain (keep func (x UpdateFolderPeers ) bool ) UpdateFolderPeersArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateFolderPeersArray ) First () (v UpdateFolderPeers , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateFolderPeersArray ) Last () (v UpdateFolderPeers , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateFolderPeersArray ) PopFirst () (v UpdateFolderPeers , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateFolderPeers
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateFolderPeersArray ) Pop () (v UpdateFolderPeers , 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
}
type UpdatePeerSettingsArray []UpdatePeerSettings
func (s UpdatePeerSettingsArray ) Sort (less func (a , b UpdatePeerSettings ) bool ) UpdatePeerSettingsArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdatePeerSettingsArray ) SortStable (less func (a , b UpdatePeerSettings ) bool ) UpdatePeerSettingsArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdatePeerSettingsArray ) Retain (keep func (x UpdatePeerSettings ) bool ) UpdatePeerSettingsArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdatePeerSettingsArray ) First () (v UpdatePeerSettings , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdatePeerSettingsArray ) Last () (v UpdatePeerSettings , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdatePeerSettingsArray ) PopFirst () (v UpdatePeerSettings , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdatePeerSettings
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdatePeerSettingsArray ) Pop () (v UpdatePeerSettings , 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
}
type UpdatePeerLocatedArray []UpdatePeerLocated
func (s UpdatePeerLocatedArray ) Sort (less func (a , b UpdatePeerLocated ) bool ) UpdatePeerLocatedArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdatePeerLocatedArray ) SortStable (less func (a , b UpdatePeerLocated ) bool ) UpdatePeerLocatedArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdatePeerLocatedArray ) Retain (keep func (x UpdatePeerLocated ) bool ) UpdatePeerLocatedArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdatePeerLocatedArray ) First () (v UpdatePeerLocated , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdatePeerLocatedArray ) Last () (v UpdatePeerLocated , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdatePeerLocatedArray ) PopFirst () (v UpdatePeerLocated , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdatePeerLocated
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdatePeerLocatedArray ) Pop () (v UpdatePeerLocated , 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
}
type UpdateNewScheduledMessageArray []UpdateNewScheduledMessage
func (s UpdateNewScheduledMessageArray ) Sort (less func (a , b UpdateNewScheduledMessage ) bool ) UpdateNewScheduledMessageArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateNewScheduledMessageArray ) SortStable (less func (a , b UpdateNewScheduledMessage ) bool ) UpdateNewScheduledMessageArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateNewScheduledMessageArray ) Retain (keep func (x UpdateNewScheduledMessage ) bool ) UpdateNewScheduledMessageArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateNewScheduledMessageArray ) First () (v UpdateNewScheduledMessage , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateNewScheduledMessageArray ) Last () (v UpdateNewScheduledMessage , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateNewScheduledMessageArray ) PopFirst () (v UpdateNewScheduledMessage , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateNewScheduledMessage
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateNewScheduledMessageArray ) Pop () (v UpdateNewScheduledMessage , 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
}
type UpdateDeleteScheduledMessagesArray []UpdateDeleteScheduledMessages
func (s UpdateDeleteScheduledMessagesArray ) Sort (less func (a , b UpdateDeleteScheduledMessages ) bool ) UpdateDeleteScheduledMessagesArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateDeleteScheduledMessagesArray ) SortStable (less func (a , b UpdateDeleteScheduledMessages ) bool ) UpdateDeleteScheduledMessagesArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateDeleteScheduledMessagesArray ) Retain (keep func (x UpdateDeleteScheduledMessages ) bool ) UpdateDeleteScheduledMessagesArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateDeleteScheduledMessagesArray ) First () (v UpdateDeleteScheduledMessages , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateDeleteScheduledMessagesArray ) Last () (v UpdateDeleteScheduledMessages , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateDeleteScheduledMessagesArray ) PopFirst () (v UpdateDeleteScheduledMessages , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateDeleteScheduledMessages
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateDeleteScheduledMessagesArray ) Pop () (v UpdateDeleteScheduledMessages , 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
}
type UpdateThemeArray []UpdateTheme
func (s UpdateThemeArray ) Sort (less func (a , b UpdateTheme ) bool ) UpdateThemeArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateThemeArray ) SortStable (less func (a , b UpdateTheme ) bool ) UpdateThemeArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateThemeArray ) Retain (keep func (x UpdateTheme ) bool ) UpdateThemeArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateThemeArray ) First () (v UpdateTheme , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateThemeArray ) Last () (v UpdateTheme , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateThemeArray ) PopFirst () (v UpdateTheme , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateTheme
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateThemeArray ) Pop () (v UpdateTheme , 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
}
type UpdateGeoLiveViewedArray []UpdateGeoLiveViewed
func (s UpdateGeoLiveViewedArray ) Sort (less func (a , b UpdateGeoLiveViewed ) bool ) UpdateGeoLiveViewedArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateGeoLiveViewedArray ) SortStable (less func (a , b UpdateGeoLiveViewed ) bool ) UpdateGeoLiveViewedArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateGeoLiveViewedArray ) Retain (keep func (x UpdateGeoLiveViewed ) bool ) UpdateGeoLiveViewedArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateGeoLiveViewedArray ) First () (v UpdateGeoLiveViewed , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateGeoLiveViewedArray ) Last () (v UpdateGeoLiveViewed , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateGeoLiveViewedArray ) PopFirst () (v UpdateGeoLiveViewed , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateGeoLiveViewed
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateGeoLiveViewedArray ) Pop () (v UpdateGeoLiveViewed , 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
}
type UpdateMessagePollVoteArray []UpdateMessagePollVote
func (s UpdateMessagePollVoteArray ) Sort (less func (a , b UpdateMessagePollVote ) bool ) UpdateMessagePollVoteArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateMessagePollVoteArray ) SortStable (less func (a , b UpdateMessagePollVote ) bool ) UpdateMessagePollVoteArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateMessagePollVoteArray ) Retain (keep func (x UpdateMessagePollVote ) bool ) UpdateMessagePollVoteArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateMessagePollVoteArray ) First () (v UpdateMessagePollVote , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateMessagePollVoteArray ) Last () (v UpdateMessagePollVote , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateMessagePollVoteArray ) PopFirst () (v UpdateMessagePollVote , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateMessagePollVote
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateMessagePollVoteArray ) Pop () (v UpdateMessagePollVote , 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
}
type UpdateDialogFilterArray []UpdateDialogFilter
func (s UpdateDialogFilterArray ) Sort (less func (a , b UpdateDialogFilter ) bool ) UpdateDialogFilterArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateDialogFilterArray ) SortStable (less func (a , b UpdateDialogFilter ) bool ) UpdateDialogFilterArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateDialogFilterArray ) Retain (keep func (x UpdateDialogFilter ) bool ) UpdateDialogFilterArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateDialogFilterArray ) First () (v UpdateDialogFilter , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateDialogFilterArray ) Last () (v UpdateDialogFilter , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateDialogFilterArray ) PopFirst () (v UpdateDialogFilter , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateDialogFilter
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateDialogFilterArray ) Pop () (v UpdateDialogFilter , 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
}
func (s UpdateDialogFilterArray ) SortByID () UpdateDialogFilterArray {
return s .Sort (func (a , b UpdateDialogFilter ) bool {
return a .GetID () < b .GetID ()
})
}
func (s UpdateDialogFilterArray ) SortStableByID () UpdateDialogFilterArray {
return s .SortStable (func (a , b UpdateDialogFilter ) bool {
return a .GetID () < b .GetID ()
})
}
func (s UpdateDialogFilterArray ) FillMap (to map [int ]UpdateDialogFilter ) {
for _ , value := range s {
to [value .GetID ()] = value
}
}
func (s UpdateDialogFilterArray ) ToMap () map [int ]UpdateDialogFilter {
r := make (map [int ]UpdateDialogFilter , len (s ))
s .FillMap (r )
return r
}
type UpdateDialogFilterOrderArray []UpdateDialogFilterOrder
func (s UpdateDialogFilterOrderArray ) Sort (less func (a , b UpdateDialogFilterOrder ) bool ) UpdateDialogFilterOrderArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateDialogFilterOrderArray ) SortStable (less func (a , b UpdateDialogFilterOrder ) bool ) UpdateDialogFilterOrderArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateDialogFilterOrderArray ) Retain (keep func (x UpdateDialogFilterOrder ) bool ) UpdateDialogFilterOrderArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateDialogFilterOrderArray ) First () (v UpdateDialogFilterOrder , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateDialogFilterOrderArray ) Last () (v UpdateDialogFilterOrder , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateDialogFilterOrderArray ) PopFirst () (v UpdateDialogFilterOrder , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateDialogFilterOrder
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateDialogFilterOrderArray ) Pop () (v UpdateDialogFilterOrder , 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
}
type UpdatePhoneCallSignalingDataArray []UpdatePhoneCallSignalingData
func (s UpdatePhoneCallSignalingDataArray ) Sort (less func (a , b UpdatePhoneCallSignalingData ) bool ) UpdatePhoneCallSignalingDataArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdatePhoneCallSignalingDataArray ) SortStable (less func (a , b UpdatePhoneCallSignalingData ) bool ) UpdatePhoneCallSignalingDataArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdatePhoneCallSignalingDataArray ) Retain (keep func (x UpdatePhoneCallSignalingData ) bool ) UpdatePhoneCallSignalingDataArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdatePhoneCallSignalingDataArray ) First () (v UpdatePhoneCallSignalingData , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdatePhoneCallSignalingDataArray ) Last () (v UpdatePhoneCallSignalingData , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdatePhoneCallSignalingDataArray ) PopFirst () (v UpdatePhoneCallSignalingData , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdatePhoneCallSignalingData
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdatePhoneCallSignalingDataArray ) Pop () (v UpdatePhoneCallSignalingData , 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
}
type UpdateChannelMessageForwardsArray []UpdateChannelMessageForwards
func (s UpdateChannelMessageForwardsArray ) Sort (less func (a , b UpdateChannelMessageForwards ) bool ) UpdateChannelMessageForwardsArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateChannelMessageForwardsArray ) SortStable (less func (a , b UpdateChannelMessageForwards ) bool ) UpdateChannelMessageForwardsArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateChannelMessageForwardsArray ) Retain (keep func (x UpdateChannelMessageForwards ) bool ) UpdateChannelMessageForwardsArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateChannelMessageForwardsArray ) First () (v UpdateChannelMessageForwards , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateChannelMessageForwardsArray ) Last () (v UpdateChannelMessageForwards , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateChannelMessageForwardsArray ) PopFirst () (v UpdateChannelMessageForwards , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateChannelMessageForwards
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateChannelMessageForwardsArray ) Pop () (v UpdateChannelMessageForwards , 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
}
func (s UpdateChannelMessageForwardsArray ) SortByID () UpdateChannelMessageForwardsArray {
return s .Sort (func (a , b UpdateChannelMessageForwards ) bool {
return a .GetID () < b .GetID ()
})
}
func (s UpdateChannelMessageForwardsArray ) SortStableByID () UpdateChannelMessageForwardsArray {
return s .SortStable (func (a , b UpdateChannelMessageForwards ) bool {
return a .GetID () < b .GetID ()
})
}
func (s UpdateChannelMessageForwardsArray ) FillMap (to map [int ]UpdateChannelMessageForwards ) {
for _ , value := range s {
to [value .GetID ()] = value
}
}
func (s UpdateChannelMessageForwardsArray ) ToMap () map [int ]UpdateChannelMessageForwards {
r := make (map [int ]UpdateChannelMessageForwards , len (s ))
s .FillMap (r )
return r
}
type UpdateReadChannelDiscussionInboxArray []UpdateReadChannelDiscussionInbox
func (s UpdateReadChannelDiscussionInboxArray ) Sort (less func (a , b UpdateReadChannelDiscussionInbox ) bool ) UpdateReadChannelDiscussionInboxArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateReadChannelDiscussionInboxArray ) SortStable (less func (a , b UpdateReadChannelDiscussionInbox ) bool ) UpdateReadChannelDiscussionInboxArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateReadChannelDiscussionInboxArray ) Retain (keep func (x UpdateReadChannelDiscussionInbox ) bool ) UpdateReadChannelDiscussionInboxArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateReadChannelDiscussionInboxArray ) First () (v UpdateReadChannelDiscussionInbox , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateReadChannelDiscussionInboxArray ) Last () (v UpdateReadChannelDiscussionInbox , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateReadChannelDiscussionInboxArray ) PopFirst () (v UpdateReadChannelDiscussionInbox , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateReadChannelDiscussionInbox
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateReadChannelDiscussionInboxArray ) Pop () (v UpdateReadChannelDiscussionInbox , 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
}
type UpdateReadChannelDiscussionOutboxArray []UpdateReadChannelDiscussionOutbox
func (s UpdateReadChannelDiscussionOutboxArray ) Sort (less func (a , b UpdateReadChannelDiscussionOutbox ) bool ) UpdateReadChannelDiscussionOutboxArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateReadChannelDiscussionOutboxArray ) SortStable (less func (a , b UpdateReadChannelDiscussionOutbox ) bool ) UpdateReadChannelDiscussionOutboxArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateReadChannelDiscussionOutboxArray ) Retain (keep func (x UpdateReadChannelDiscussionOutbox ) bool ) UpdateReadChannelDiscussionOutboxArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateReadChannelDiscussionOutboxArray ) First () (v UpdateReadChannelDiscussionOutbox , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateReadChannelDiscussionOutboxArray ) Last () (v UpdateReadChannelDiscussionOutbox , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateReadChannelDiscussionOutboxArray ) PopFirst () (v UpdateReadChannelDiscussionOutbox , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateReadChannelDiscussionOutbox
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateReadChannelDiscussionOutboxArray ) Pop () (v UpdateReadChannelDiscussionOutbox , 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
}
type UpdatePeerBlockedArray []UpdatePeerBlocked
func (s UpdatePeerBlockedArray ) Sort (less func (a , b UpdatePeerBlocked ) bool ) UpdatePeerBlockedArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdatePeerBlockedArray ) SortStable (less func (a , b UpdatePeerBlocked ) bool ) UpdatePeerBlockedArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdatePeerBlockedArray ) Retain (keep func (x UpdatePeerBlocked ) bool ) UpdatePeerBlockedArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdatePeerBlockedArray ) First () (v UpdatePeerBlocked , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdatePeerBlockedArray ) Last () (v UpdatePeerBlocked , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdatePeerBlockedArray ) PopFirst () (v UpdatePeerBlocked , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdatePeerBlocked
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdatePeerBlockedArray ) Pop () (v UpdatePeerBlocked , 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
}
type UpdateChannelUserTypingArray []UpdateChannelUserTyping
func (s UpdateChannelUserTypingArray ) Sort (less func (a , b UpdateChannelUserTyping ) bool ) UpdateChannelUserTypingArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateChannelUserTypingArray ) SortStable (less func (a , b UpdateChannelUserTyping ) bool ) UpdateChannelUserTypingArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateChannelUserTypingArray ) Retain (keep func (x UpdateChannelUserTyping ) bool ) UpdateChannelUserTypingArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateChannelUserTypingArray ) First () (v UpdateChannelUserTyping , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateChannelUserTypingArray ) Last () (v UpdateChannelUserTyping , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateChannelUserTypingArray ) PopFirst () (v UpdateChannelUserTyping , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateChannelUserTyping
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateChannelUserTypingArray ) Pop () (v UpdateChannelUserTyping , 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
}
type UpdatePinnedMessagesArray []UpdatePinnedMessages
func (s UpdatePinnedMessagesArray ) Sort (less func (a , b UpdatePinnedMessages ) bool ) UpdatePinnedMessagesArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdatePinnedMessagesArray ) SortStable (less func (a , b UpdatePinnedMessages ) bool ) UpdatePinnedMessagesArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdatePinnedMessagesArray ) Retain (keep func (x UpdatePinnedMessages ) bool ) UpdatePinnedMessagesArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdatePinnedMessagesArray ) First () (v UpdatePinnedMessages , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdatePinnedMessagesArray ) Last () (v UpdatePinnedMessages , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdatePinnedMessagesArray ) PopFirst () (v UpdatePinnedMessages , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdatePinnedMessages
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdatePinnedMessagesArray ) Pop () (v UpdatePinnedMessages , 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
}
type UpdatePinnedChannelMessagesArray []UpdatePinnedChannelMessages
func (s UpdatePinnedChannelMessagesArray ) Sort (less func (a , b UpdatePinnedChannelMessages ) bool ) UpdatePinnedChannelMessagesArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdatePinnedChannelMessagesArray ) SortStable (less func (a , b UpdatePinnedChannelMessages ) bool ) UpdatePinnedChannelMessagesArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdatePinnedChannelMessagesArray ) Retain (keep func (x UpdatePinnedChannelMessages ) bool ) UpdatePinnedChannelMessagesArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdatePinnedChannelMessagesArray ) First () (v UpdatePinnedChannelMessages , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdatePinnedChannelMessagesArray ) Last () (v UpdatePinnedChannelMessages , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdatePinnedChannelMessagesArray ) PopFirst () (v UpdatePinnedChannelMessages , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdatePinnedChannelMessages
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdatePinnedChannelMessagesArray ) Pop () (v UpdatePinnedChannelMessages , 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
}
type UpdateChatArray []UpdateChat
func (s UpdateChatArray ) Sort (less func (a , b UpdateChat ) bool ) UpdateChatArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateChatArray ) SortStable (less func (a , b UpdateChat ) bool ) UpdateChatArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateChatArray ) Retain (keep func (x UpdateChat ) bool ) UpdateChatArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateChatArray ) First () (v UpdateChat , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateChatArray ) Last () (v UpdateChat , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateChatArray ) PopFirst () (v UpdateChat , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateChat
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateChatArray ) Pop () (v UpdateChat , 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
}
type UpdateGroupCallParticipantsArray []UpdateGroupCallParticipants
func (s UpdateGroupCallParticipantsArray ) Sort (less func (a , b UpdateGroupCallParticipants ) bool ) UpdateGroupCallParticipantsArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateGroupCallParticipantsArray ) SortStable (less func (a , b UpdateGroupCallParticipants ) bool ) UpdateGroupCallParticipantsArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateGroupCallParticipantsArray ) Retain (keep func (x UpdateGroupCallParticipants ) bool ) UpdateGroupCallParticipantsArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateGroupCallParticipantsArray ) First () (v UpdateGroupCallParticipants , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateGroupCallParticipantsArray ) Last () (v UpdateGroupCallParticipants , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateGroupCallParticipantsArray ) PopFirst () (v UpdateGroupCallParticipants , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateGroupCallParticipants
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateGroupCallParticipantsArray ) Pop () (v UpdateGroupCallParticipants , 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
}
type UpdateGroupCallArray []UpdateGroupCall
func (s UpdateGroupCallArray ) Sort (less func (a , b UpdateGroupCall ) bool ) UpdateGroupCallArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateGroupCallArray ) SortStable (less func (a , b UpdateGroupCall ) bool ) UpdateGroupCallArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateGroupCallArray ) Retain (keep func (x UpdateGroupCall ) bool ) UpdateGroupCallArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateGroupCallArray ) First () (v UpdateGroupCall , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateGroupCallArray ) Last () (v UpdateGroupCall , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateGroupCallArray ) PopFirst () (v UpdateGroupCall , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateGroupCall
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateGroupCallArray ) Pop () (v UpdateGroupCall , 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
}
type UpdatePeerHistoryTTLArray []UpdatePeerHistoryTTL
func (s UpdatePeerHistoryTTLArray ) Sort (less func (a , b UpdatePeerHistoryTTL ) bool ) UpdatePeerHistoryTTLArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdatePeerHistoryTTLArray ) SortStable (less func (a , b UpdatePeerHistoryTTL ) bool ) UpdatePeerHistoryTTLArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdatePeerHistoryTTLArray ) Retain (keep func (x UpdatePeerHistoryTTL ) bool ) UpdatePeerHistoryTTLArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdatePeerHistoryTTLArray ) First () (v UpdatePeerHistoryTTL , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdatePeerHistoryTTLArray ) Last () (v UpdatePeerHistoryTTL , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdatePeerHistoryTTLArray ) PopFirst () (v UpdatePeerHistoryTTL , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdatePeerHistoryTTL
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdatePeerHistoryTTLArray ) Pop () (v UpdatePeerHistoryTTL , 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
}
type UpdateChatParticipantArray []UpdateChatParticipant
func (s UpdateChatParticipantArray ) Sort (less func (a , b UpdateChatParticipant ) bool ) UpdateChatParticipantArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateChatParticipantArray ) SortStable (less func (a , b UpdateChatParticipant ) bool ) UpdateChatParticipantArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateChatParticipantArray ) Retain (keep func (x UpdateChatParticipant ) bool ) UpdateChatParticipantArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateChatParticipantArray ) First () (v UpdateChatParticipant , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateChatParticipantArray ) Last () (v UpdateChatParticipant , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateChatParticipantArray ) PopFirst () (v UpdateChatParticipant , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateChatParticipant
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateChatParticipantArray ) Pop () (v UpdateChatParticipant , 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
}
func (s UpdateChatParticipantArray ) SortByDate () UpdateChatParticipantArray {
return s .Sort (func (a , b UpdateChatParticipant ) bool {
return a .GetDate () < b .GetDate ()
})
}
func (s UpdateChatParticipantArray ) SortStableByDate () UpdateChatParticipantArray {
return s .SortStable (func (a , b UpdateChatParticipant ) bool {
return a .GetDate () < b .GetDate ()
})
}
type UpdateChannelParticipantArray []UpdateChannelParticipant
func (s UpdateChannelParticipantArray ) Sort (less func (a , b UpdateChannelParticipant ) bool ) UpdateChannelParticipantArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateChannelParticipantArray ) SortStable (less func (a , b UpdateChannelParticipant ) bool ) UpdateChannelParticipantArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateChannelParticipantArray ) Retain (keep func (x UpdateChannelParticipant ) bool ) UpdateChannelParticipantArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateChannelParticipantArray ) First () (v UpdateChannelParticipant , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateChannelParticipantArray ) Last () (v UpdateChannelParticipant , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateChannelParticipantArray ) PopFirst () (v UpdateChannelParticipant , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateChannelParticipant
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateChannelParticipantArray ) Pop () (v UpdateChannelParticipant , 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
}
func (s UpdateChannelParticipantArray ) SortByDate () UpdateChannelParticipantArray {
return s .Sort (func (a , b UpdateChannelParticipant ) bool {
return a .GetDate () < b .GetDate ()
})
}
func (s UpdateChannelParticipantArray ) SortStableByDate () UpdateChannelParticipantArray {
return s .SortStable (func (a , b UpdateChannelParticipant ) bool {
return a .GetDate () < b .GetDate ()
})
}
type UpdateBotStoppedArray []UpdateBotStopped
func (s UpdateBotStoppedArray ) Sort (less func (a , b UpdateBotStopped ) bool ) UpdateBotStoppedArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateBotStoppedArray ) SortStable (less func (a , b UpdateBotStopped ) bool ) UpdateBotStoppedArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateBotStoppedArray ) Retain (keep func (x UpdateBotStopped ) bool ) UpdateBotStoppedArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateBotStoppedArray ) First () (v UpdateBotStopped , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateBotStoppedArray ) Last () (v UpdateBotStopped , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateBotStoppedArray ) PopFirst () (v UpdateBotStopped , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateBotStopped
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateBotStoppedArray ) Pop () (v UpdateBotStopped , 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
}
func (s UpdateBotStoppedArray ) SortByDate () UpdateBotStoppedArray {
return s .Sort (func (a , b UpdateBotStopped ) bool {
return a .GetDate () < b .GetDate ()
})
}
func (s UpdateBotStoppedArray ) SortStableByDate () UpdateBotStoppedArray {
return s .SortStable (func (a , b UpdateBotStopped ) bool {
return a .GetDate () < b .GetDate ()
})
}
type UpdateGroupCallConnectionArray []UpdateGroupCallConnection
func (s UpdateGroupCallConnectionArray ) Sort (less func (a , b UpdateGroupCallConnection ) bool ) UpdateGroupCallConnectionArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateGroupCallConnectionArray ) SortStable (less func (a , b UpdateGroupCallConnection ) bool ) UpdateGroupCallConnectionArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateGroupCallConnectionArray ) Retain (keep func (x UpdateGroupCallConnection ) bool ) UpdateGroupCallConnectionArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateGroupCallConnectionArray ) First () (v UpdateGroupCallConnection , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateGroupCallConnectionArray ) Last () (v UpdateGroupCallConnection , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateGroupCallConnectionArray ) PopFirst () (v UpdateGroupCallConnection , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateGroupCallConnection
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateGroupCallConnectionArray ) Pop () (v UpdateGroupCallConnection , 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
}
type UpdateBotCommandsArray []UpdateBotCommands
func (s UpdateBotCommandsArray ) Sort (less func (a , b UpdateBotCommands ) bool ) UpdateBotCommandsArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateBotCommandsArray ) SortStable (less func (a , b UpdateBotCommands ) bool ) UpdateBotCommandsArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateBotCommandsArray ) Retain (keep func (x UpdateBotCommands ) bool ) UpdateBotCommandsArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateBotCommandsArray ) First () (v UpdateBotCommands , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateBotCommandsArray ) Last () (v UpdateBotCommands , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateBotCommandsArray ) PopFirst () (v UpdateBotCommands , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateBotCommands
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateBotCommandsArray ) Pop () (v UpdateBotCommands , 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
}
type UpdatePendingJoinRequestsArray []UpdatePendingJoinRequests
func (s UpdatePendingJoinRequestsArray ) Sort (less func (a , b UpdatePendingJoinRequests ) bool ) UpdatePendingJoinRequestsArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdatePendingJoinRequestsArray ) SortStable (less func (a , b UpdatePendingJoinRequests ) bool ) UpdatePendingJoinRequestsArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdatePendingJoinRequestsArray ) Retain (keep func (x UpdatePendingJoinRequests ) bool ) UpdatePendingJoinRequestsArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdatePendingJoinRequestsArray ) First () (v UpdatePendingJoinRequests , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdatePendingJoinRequestsArray ) Last () (v UpdatePendingJoinRequests , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdatePendingJoinRequestsArray ) PopFirst () (v UpdatePendingJoinRequests , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdatePendingJoinRequests
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdatePendingJoinRequestsArray ) Pop () (v UpdatePendingJoinRequests , 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
}
type UpdateBotChatInviteRequesterArray []UpdateBotChatInviteRequester
func (s UpdateBotChatInviteRequesterArray ) Sort (less func (a , b UpdateBotChatInviteRequester ) bool ) UpdateBotChatInviteRequesterArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateBotChatInviteRequesterArray ) SortStable (less func (a , b UpdateBotChatInviteRequester ) bool ) UpdateBotChatInviteRequesterArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateBotChatInviteRequesterArray ) Retain (keep func (x UpdateBotChatInviteRequester ) bool ) UpdateBotChatInviteRequesterArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateBotChatInviteRequesterArray ) First () (v UpdateBotChatInviteRequester , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateBotChatInviteRequesterArray ) Last () (v UpdateBotChatInviteRequester , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateBotChatInviteRequesterArray ) PopFirst () (v UpdateBotChatInviteRequester , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateBotChatInviteRequester
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateBotChatInviteRequesterArray ) Pop () (v UpdateBotChatInviteRequester , 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
}
func (s UpdateBotChatInviteRequesterArray ) SortByDate () UpdateBotChatInviteRequesterArray {
return s .Sort (func (a , b UpdateBotChatInviteRequester ) bool {
return a .GetDate () < b .GetDate ()
})
}
func (s UpdateBotChatInviteRequesterArray ) SortStableByDate () UpdateBotChatInviteRequesterArray {
return s .SortStable (func (a , b UpdateBotChatInviteRequester ) bool {
return a .GetDate () < b .GetDate ()
})
}
type UpdateMessageReactionsArray []UpdateMessageReactions
func (s UpdateMessageReactionsArray ) Sort (less func (a , b UpdateMessageReactions ) bool ) UpdateMessageReactionsArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateMessageReactionsArray ) SortStable (less func (a , b UpdateMessageReactions ) bool ) UpdateMessageReactionsArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateMessageReactionsArray ) Retain (keep func (x UpdateMessageReactions ) bool ) UpdateMessageReactionsArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateMessageReactionsArray ) First () (v UpdateMessageReactions , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateMessageReactionsArray ) Last () (v UpdateMessageReactions , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateMessageReactionsArray ) PopFirst () (v UpdateMessageReactions , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateMessageReactions
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateMessageReactionsArray ) Pop () (v UpdateMessageReactions , 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
}
type UpdateWebViewResultSentArray []UpdateWebViewResultSent
func (s UpdateWebViewResultSentArray ) Sort (less func (a , b UpdateWebViewResultSent ) bool ) UpdateWebViewResultSentArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateWebViewResultSentArray ) SortStable (less func (a , b UpdateWebViewResultSent ) bool ) UpdateWebViewResultSentArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateWebViewResultSentArray ) Retain (keep func (x UpdateWebViewResultSent ) bool ) UpdateWebViewResultSentArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateWebViewResultSentArray ) First () (v UpdateWebViewResultSent , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateWebViewResultSentArray ) Last () (v UpdateWebViewResultSent , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateWebViewResultSentArray ) PopFirst () (v UpdateWebViewResultSent , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateWebViewResultSent
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateWebViewResultSentArray ) Pop () (v UpdateWebViewResultSent , 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
}
type UpdateBotMenuButtonArray []UpdateBotMenuButton
func (s UpdateBotMenuButtonArray ) Sort (less func (a , b UpdateBotMenuButton ) bool ) UpdateBotMenuButtonArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateBotMenuButtonArray ) SortStable (less func (a , b UpdateBotMenuButton ) bool ) UpdateBotMenuButtonArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateBotMenuButtonArray ) Retain (keep func (x UpdateBotMenuButton ) bool ) UpdateBotMenuButtonArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateBotMenuButtonArray ) First () (v UpdateBotMenuButton , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateBotMenuButtonArray ) Last () (v UpdateBotMenuButton , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateBotMenuButtonArray ) PopFirst () (v UpdateBotMenuButton , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateBotMenuButton
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateBotMenuButtonArray ) Pop () (v UpdateBotMenuButton , 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
}
type UpdateTranscribedAudioArray []UpdateTranscribedAudio
func (s UpdateTranscribedAudioArray ) Sort (less func (a , b UpdateTranscribedAudio ) bool ) UpdateTranscribedAudioArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateTranscribedAudioArray ) SortStable (less func (a , b UpdateTranscribedAudio ) bool ) UpdateTranscribedAudioArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateTranscribedAudioArray ) Retain (keep func (x UpdateTranscribedAudio ) bool ) UpdateTranscribedAudioArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateTranscribedAudioArray ) First () (v UpdateTranscribedAudio , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateTranscribedAudioArray ) Last () (v UpdateTranscribedAudio , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateTranscribedAudioArray ) PopFirst () (v UpdateTranscribedAudio , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateTranscribedAudio
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateTranscribedAudioArray ) Pop () (v UpdateTranscribedAudio , 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
}
type UpdateUserEmojiStatusArray []UpdateUserEmojiStatus
func (s UpdateUserEmojiStatusArray ) Sort (less func (a , b UpdateUserEmojiStatus ) bool ) UpdateUserEmojiStatusArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateUserEmojiStatusArray ) SortStable (less func (a , b UpdateUserEmojiStatus ) bool ) UpdateUserEmojiStatusArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateUserEmojiStatusArray ) Retain (keep func (x UpdateUserEmojiStatus ) bool ) UpdateUserEmojiStatusArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateUserEmojiStatusArray ) First () (v UpdateUserEmojiStatus , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateUserEmojiStatusArray ) Last () (v UpdateUserEmojiStatus , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateUserEmojiStatusArray ) PopFirst () (v UpdateUserEmojiStatus , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateUserEmojiStatus
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateUserEmojiStatusArray ) Pop () (v UpdateUserEmojiStatus , 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
}
type UpdateMoveStickerSetToTopArray []UpdateMoveStickerSetToTop
func (s UpdateMoveStickerSetToTopArray ) Sort (less func (a , b UpdateMoveStickerSetToTop ) bool ) UpdateMoveStickerSetToTopArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateMoveStickerSetToTopArray ) SortStable (less func (a , b UpdateMoveStickerSetToTop ) bool ) UpdateMoveStickerSetToTopArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateMoveStickerSetToTopArray ) Retain (keep func (x UpdateMoveStickerSetToTop ) bool ) UpdateMoveStickerSetToTopArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateMoveStickerSetToTopArray ) First () (v UpdateMoveStickerSetToTop , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateMoveStickerSetToTopArray ) Last () (v UpdateMoveStickerSetToTop , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateMoveStickerSetToTopArray ) PopFirst () (v UpdateMoveStickerSetToTop , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateMoveStickerSetToTop
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateMoveStickerSetToTopArray ) Pop () (v UpdateMoveStickerSetToTop , 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
}
type UpdateMessageExtendedMediaArray []UpdateMessageExtendedMedia
func (s UpdateMessageExtendedMediaArray ) Sort (less func (a , b UpdateMessageExtendedMedia ) bool ) UpdateMessageExtendedMediaArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateMessageExtendedMediaArray ) SortStable (less func (a , b UpdateMessageExtendedMedia ) bool ) UpdateMessageExtendedMediaArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateMessageExtendedMediaArray ) Retain (keep func (x UpdateMessageExtendedMedia ) bool ) UpdateMessageExtendedMediaArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateMessageExtendedMediaArray ) First () (v UpdateMessageExtendedMedia , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateMessageExtendedMediaArray ) Last () (v UpdateMessageExtendedMedia , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateMessageExtendedMediaArray ) PopFirst () (v UpdateMessageExtendedMedia , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateMessageExtendedMedia
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateMessageExtendedMediaArray ) Pop () (v UpdateMessageExtendedMedia , 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
}
type UpdateChannelPinnedTopicArray []UpdateChannelPinnedTopic
func (s UpdateChannelPinnedTopicArray ) Sort (less func (a , b UpdateChannelPinnedTopic ) bool ) UpdateChannelPinnedTopicArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateChannelPinnedTopicArray ) SortStable (less func (a , b UpdateChannelPinnedTopic ) bool ) UpdateChannelPinnedTopicArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateChannelPinnedTopicArray ) Retain (keep func (x UpdateChannelPinnedTopic ) bool ) UpdateChannelPinnedTopicArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateChannelPinnedTopicArray ) First () (v UpdateChannelPinnedTopic , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateChannelPinnedTopicArray ) Last () (v UpdateChannelPinnedTopic , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateChannelPinnedTopicArray ) PopFirst () (v UpdateChannelPinnedTopic , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateChannelPinnedTopic
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateChannelPinnedTopicArray ) Pop () (v UpdateChannelPinnedTopic , 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
}
type UpdateChannelPinnedTopicsArray []UpdateChannelPinnedTopics
func (s UpdateChannelPinnedTopicsArray ) Sort (less func (a , b UpdateChannelPinnedTopics ) bool ) UpdateChannelPinnedTopicsArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateChannelPinnedTopicsArray ) SortStable (less func (a , b UpdateChannelPinnedTopics ) bool ) UpdateChannelPinnedTopicsArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateChannelPinnedTopicsArray ) Retain (keep func (x UpdateChannelPinnedTopics ) bool ) UpdateChannelPinnedTopicsArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateChannelPinnedTopicsArray ) First () (v UpdateChannelPinnedTopics , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateChannelPinnedTopicsArray ) Last () (v UpdateChannelPinnedTopics , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateChannelPinnedTopicsArray ) PopFirst () (v UpdateChannelPinnedTopics , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateChannelPinnedTopics
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateChannelPinnedTopicsArray ) Pop () (v UpdateChannelPinnedTopics , 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
}
type UpdateUserArray []UpdateUser
func (s UpdateUserArray ) Sort (less func (a , b UpdateUser ) bool ) UpdateUserArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateUserArray ) SortStable (less func (a , b UpdateUser ) bool ) UpdateUserArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateUserArray ) Retain (keep func (x UpdateUser ) bool ) UpdateUserArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateUserArray ) First () (v UpdateUser , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateUserArray ) Last () (v UpdateUser , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateUserArray ) PopFirst () (v UpdateUser , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateUser
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateUserArray ) Pop () (v UpdateUser , 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
}
type UpdateGroupInvitePrivacyForbiddenArray []UpdateGroupInvitePrivacyForbidden
func (s UpdateGroupInvitePrivacyForbiddenArray ) Sort (less func (a , b UpdateGroupInvitePrivacyForbidden ) bool ) UpdateGroupInvitePrivacyForbiddenArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateGroupInvitePrivacyForbiddenArray ) SortStable (less func (a , b UpdateGroupInvitePrivacyForbidden ) bool ) UpdateGroupInvitePrivacyForbiddenArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateGroupInvitePrivacyForbiddenArray ) Retain (keep func (x UpdateGroupInvitePrivacyForbidden ) bool ) UpdateGroupInvitePrivacyForbiddenArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateGroupInvitePrivacyForbiddenArray ) First () (v UpdateGroupInvitePrivacyForbidden , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateGroupInvitePrivacyForbiddenArray ) Last () (v UpdateGroupInvitePrivacyForbidden , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateGroupInvitePrivacyForbiddenArray ) PopFirst () (v UpdateGroupInvitePrivacyForbidden , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateGroupInvitePrivacyForbidden
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateGroupInvitePrivacyForbiddenArray ) Pop () (v UpdateGroupInvitePrivacyForbidden , 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
}
type UpdateStoryArray []UpdateStory
func (s UpdateStoryArray ) Sort (less func (a , b UpdateStory ) bool ) UpdateStoryArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateStoryArray ) SortStable (less func (a , b UpdateStory ) bool ) UpdateStoryArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateStoryArray ) Retain (keep func (x UpdateStory ) bool ) UpdateStoryArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateStoryArray ) First () (v UpdateStory , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateStoryArray ) Last () (v UpdateStory , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateStoryArray ) PopFirst () (v UpdateStory , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateStory
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateStoryArray ) Pop () (v UpdateStory , 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
}
type UpdateReadStoriesArray []UpdateReadStories
func (s UpdateReadStoriesArray ) Sort (less func (a , b UpdateReadStories ) bool ) UpdateReadStoriesArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateReadStoriesArray ) SortStable (less func (a , b UpdateReadStories ) bool ) UpdateReadStoriesArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateReadStoriesArray ) Retain (keep func (x UpdateReadStories ) bool ) UpdateReadStoriesArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateReadStoriesArray ) First () (v UpdateReadStories , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateReadStoriesArray ) Last () (v UpdateReadStories , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateReadStoriesArray ) PopFirst () (v UpdateReadStories , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateReadStories
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateReadStoriesArray ) Pop () (v UpdateReadStories , 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
}
type UpdateStoryIDArray []UpdateStoryID
func (s UpdateStoryIDArray ) Sort (less func (a , b UpdateStoryID ) bool ) UpdateStoryIDArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateStoryIDArray ) SortStable (less func (a , b UpdateStoryID ) bool ) UpdateStoryIDArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateStoryIDArray ) Retain (keep func (x UpdateStoryID ) bool ) UpdateStoryIDArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateStoryIDArray ) First () (v UpdateStoryID , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateStoryIDArray ) Last () (v UpdateStoryID , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateStoryIDArray ) PopFirst () (v UpdateStoryID , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateStoryID
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateStoryIDArray ) Pop () (v UpdateStoryID , 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
}
func (s UpdateStoryIDArray ) SortByID () UpdateStoryIDArray {
return s .Sort (func (a , b UpdateStoryID ) bool {
return a .GetID () < b .GetID ()
})
}
func (s UpdateStoryIDArray ) SortStableByID () UpdateStoryIDArray {
return s .SortStable (func (a , b UpdateStoryID ) bool {
return a .GetID () < b .GetID ()
})
}
func (s UpdateStoryIDArray ) FillMap (to map [int ]UpdateStoryID ) {
for _ , value := range s {
to [value .GetID ()] = value
}
}
func (s UpdateStoryIDArray ) ToMap () map [int ]UpdateStoryID {
r := make (map [int ]UpdateStoryID , len (s ))
s .FillMap (r )
return r
}
type UpdateStoriesStealthModeArray []UpdateStoriesStealthMode
func (s UpdateStoriesStealthModeArray ) Sort (less func (a , b UpdateStoriesStealthMode ) bool ) UpdateStoriesStealthModeArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateStoriesStealthModeArray ) SortStable (less func (a , b UpdateStoriesStealthMode ) bool ) UpdateStoriesStealthModeArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateStoriesStealthModeArray ) Retain (keep func (x UpdateStoriesStealthMode ) bool ) UpdateStoriesStealthModeArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateStoriesStealthModeArray ) First () (v UpdateStoriesStealthMode , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateStoriesStealthModeArray ) Last () (v UpdateStoriesStealthMode , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateStoriesStealthModeArray ) PopFirst () (v UpdateStoriesStealthMode , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateStoriesStealthMode
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateStoriesStealthModeArray ) Pop () (v UpdateStoriesStealthMode , 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
}
type UpdateSentStoryReactionArray []UpdateSentStoryReaction
func (s UpdateSentStoryReactionArray ) Sort (less func (a , b UpdateSentStoryReaction ) bool ) UpdateSentStoryReactionArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateSentStoryReactionArray ) SortStable (less func (a , b UpdateSentStoryReaction ) bool ) UpdateSentStoryReactionArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateSentStoryReactionArray ) Retain (keep func (x UpdateSentStoryReaction ) bool ) UpdateSentStoryReactionArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateSentStoryReactionArray ) First () (v UpdateSentStoryReaction , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateSentStoryReactionArray ) Last () (v UpdateSentStoryReaction , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateSentStoryReactionArray ) PopFirst () (v UpdateSentStoryReaction , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateSentStoryReaction
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateSentStoryReactionArray ) Pop () (v UpdateSentStoryReaction , 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
}
type UpdateBotChatBoostArray []UpdateBotChatBoost
func (s UpdateBotChatBoostArray ) Sort (less func (a , b UpdateBotChatBoost ) bool ) UpdateBotChatBoostArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateBotChatBoostArray ) SortStable (less func (a , b UpdateBotChatBoost ) bool ) UpdateBotChatBoostArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateBotChatBoostArray ) Retain (keep func (x UpdateBotChatBoost ) bool ) UpdateBotChatBoostArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateBotChatBoostArray ) First () (v UpdateBotChatBoost , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateBotChatBoostArray ) Last () (v UpdateBotChatBoost , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateBotChatBoostArray ) PopFirst () (v UpdateBotChatBoost , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateBotChatBoost
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateBotChatBoostArray ) Pop () (v UpdateBotChatBoost , 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
}
type UpdateChannelViewForumAsMessagesArray []UpdateChannelViewForumAsMessages
func (s UpdateChannelViewForumAsMessagesArray ) Sort (less func (a , b UpdateChannelViewForumAsMessages ) bool ) UpdateChannelViewForumAsMessagesArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateChannelViewForumAsMessagesArray ) SortStable (less func (a , b UpdateChannelViewForumAsMessages ) bool ) UpdateChannelViewForumAsMessagesArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateChannelViewForumAsMessagesArray ) Retain (keep func (x UpdateChannelViewForumAsMessages ) bool ) UpdateChannelViewForumAsMessagesArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateChannelViewForumAsMessagesArray ) First () (v UpdateChannelViewForumAsMessages , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateChannelViewForumAsMessagesArray ) Last () (v UpdateChannelViewForumAsMessages , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateChannelViewForumAsMessagesArray ) PopFirst () (v UpdateChannelViewForumAsMessages , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateChannelViewForumAsMessages
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateChannelViewForumAsMessagesArray ) Pop () (v UpdateChannelViewForumAsMessages , 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
}
type UpdatePeerWallpaperArray []UpdatePeerWallpaper
func (s UpdatePeerWallpaperArray ) Sort (less func (a , b UpdatePeerWallpaper ) bool ) UpdatePeerWallpaperArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdatePeerWallpaperArray ) SortStable (less func (a , b UpdatePeerWallpaper ) bool ) UpdatePeerWallpaperArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdatePeerWallpaperArray ) Retain (keep func (x UpdatePeerWallpaper ) bool ) UpdatePeerWallpaperArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdatePeerWallpaperArray ) First () (v UpdatePeerWallpaper , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdatePeerWallpaperArray ) Last () (v UpdatePeerWallpaper , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdatePeerWallpaperArray ) PopFirst () (v UpdatePeerWallpaper , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdatePeerWallpaper
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdatePeerWallpaperArray ) Pop () (v UpdatePeerWallpaper , 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
}
type UpdateBotMessageReactionArray []UpdateBotMessageReaction
func (s UpdateBotMessageReactionArray ) Sort (less func (a , b UpdateBotMessageReaction ) bool ) UpdateBotMessageReactionArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateBotMessageReactionArray ) SortStable (less func (a , b UpdateBotMessageReaction ) bool ) UpdateBotMessageReactionArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateBotMessageReactionArray ) Retain (keep func (x UpdateBotMessageReaction ) bool ) UpdateBotMessageReactionArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateBotMessageReactionArray ) First () (v UpdateBotMessageReaction , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateBotMessageReactionArray ) Last () (v UpdateBotMessageReaction , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateBotMessageReactionArray ) PopFirst () (v UpdateBotMessageReaction , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateBotMessageReaction
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateBotMessageReactionArray ) Pop () (v UpdateBotMessageReaction , 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
}
func (s UpdateBotMessageReactionArray ) SortByDate () UpdateBotMessageReactionArray {
return s .Sort (func (a , b UpdateBotMessageReaction ) bool {
return a .GetDate () < b .GetDate ()
})
}
func (s UpdateBotMessageReactionArray ) SortStableByDate () UpdateBotMessageReactionArray {
return s .SortStable (func (a , b UpdateBotMessageReaction ) bool {
return a .GetDate () < b .GetDate ()
})
}
type UpdateBotMessageReactionsArray []UpdateBotMessageReactions
func (s UpdateBotMessageReactionsArray ) Sort (less func (a , b UpdateBotMessageReactions ) bool ) UpdateBotMessageReactionsArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateBotMessageReactionsArray ) SortStable (less func (a , b UpdateBotMessageReactions ) bool ) UpdateBotMessageReactionsArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s UpdateBotMessageReactionsArray ) Retain (keep func (x UpdateBotMessageReactions ) bool ) UpdateBotMessageReactionsArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s UpdateBotMessageReactionsArray ) First () (v UpdateBotMessageReactions , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s UpdateBotMessageReactionsArray ) Last () (v UpdateBotMessageReactions , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *UpdateBotMessageReactionsArray ) PopFirst () (v UpdateBotMessageReactions , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero UpdateBotMessageReactions
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *UpdateBotMessageReactionsArray ) Pop () (v UpdateBotMessageReactions , 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
}
func (s UpdateBotMessageReactionsArray ) SortByDate () UpdateBotMessageReactionsArray {
return s .Sort (func (a , b UpdateBotMessageReactions ) bool {
return a .GetDate () < b .GetDate ()
})
}
func (s UpdateBotMessageReactionsArray ) SortStableByDate () UpdateBotMessageReactionsArray {
return s .SortStable (func (a , b UpdateBotMessageReactions ) bool {
return a .GetDate () < b .GetDate ()
})
}
The pages are generated with Golds v0.6.7 . (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu .
PR and bug reports are welcome and can be submitted to the issue list .
Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds .