go-tdlib/client/type.go

33526 lines
951 KiB
Go
Raw Normal View History

2018-08-30 14:55:42 +00:00
// AUTOGENERATED
package client
import (
2022-03-13 04:04:12 +00:00
"encoding/json"
2018-08-30 14:55:42 +00:00
)
const (
2022-03-13 04:04:12 +00:00
ClassAuthenticationCodeType = "AuthenticationCodeType"
ClassAuthorizationState = "AuthorizationState"
ClassInputFile = "InputFile"
ClassThumbnailFormat = "ThumbnailFormat"
ClassMaskPoint = "MaskPoint"
ClassStickerType = "StickerType"
ClassPollType = "PollType"
ClassUserType = "UserType"
ClassInputChatPhoto = "InputChatPhoto"
ClassChatMemberStatus = "ChatMemberStatus"
ClassChatMembersFilter = "ChatMembersFilter"
ClassSupergroupMembersFilter = "SupergroupMembersFilter"
ClassSecretChatState = "SecretChatState"
ClassMessageSender = "MessageSender"
ClassMessageForwardOrigin = "MessageForwardOrigin"
ClassMessageSendingState = "MessageSendingState"
ClassNotificationSettingsScope = "NotificationSettingsScope"
ClassChatType = "ChatType"
ClassChatList = "ChatList"
ClassChatSource = "ChatSource"
ClassPublicChatType = "PublicChatType"
ClassChatActionBar = "ChatActionBar"
ClassKeyboardButtonType = "KeyboardButtonType"
ClassInlineKeyboardButtonType = "InlineKeyboardButtonType"
ClassReplyMarkup = "ReplyMarkup"
ClassLoginUrlInfo = "LoginUrlInfo"
ClassRichText = "RichText"
ClassPageBlockHorizontalAlignment = "PageBlockHorizontalAlignment"
ClassPageBlockVerticalAlignment = "PageBlockVerticalAlignment"
ClassPageBlock = "PageBlock"
ClassInputCredentials = "InputCredentials"
ClassPassportElementType = "PassportElementType"
ClassPassportElement = "PassportElement"
ClassInputPassportElement = "InputPassportElement"
ClassPassportElementErrorSource = "PassportElementErrorSource"
ClassInputPassportElementErrorSource = "InputPassportElementErrorSource"
ClassMessageContent = "MessageContent"
ClassTextEntityType = "TextEntityType"
ClassMessageSchedulingState = "MessageSchedulingState"
ClassInputMessageContent = "InputMessageContent"
ClassSearchMessagesFilter = "SearchMessagesFilter"
ClassChatAction = "ChatAction"
ClassUserStatus = "UserStatus"
ClassCallDiscardReason = "CallDiscardReason"
ClassCallServerType = "CallServerType"
ClassCallState = "CallState"
ClassGroupCallVideoQuality = "GroupCallVideoQuality"
ClassCallProblem = "CallProblem"
ClassDiceStickers = "DiceStickers"
ClassInputInlineQueryResult = "InputInlineQueryResult"
ClassInlineQueryResult = "InlineQueryResult"
ClassCallbackQueryPayload = "CallbackQueryPayload"
ClassChatEventAction = "ChatEventAction"
ClassLanguagePackStringValue = "LanguagePackStringValue"
ClassDeviceToken = "DeviceToken"
ClassBackgroundFill = "BackgroundFill"
ClassBackgroundType = "BackgroundType"
ClassInputBackground = "InputBackground"
ClassCanTransferOwnershipResult = "CanTransferOwnershipResult"
ClassCheckChatUsernameResult = "CheckChatUsernameResult"
ClassCheckStickerSetNameResult = "CheckStickerSetNameResult"
ClassResetPasswordResult = "ResetPasswordResult"
ClassMessageFileType = "MessageFileType"
ClassPushMessageContent = "PushMessageContent"
ClassNotificationType = "NotificationType"
ClassNotificationGroupType = "NotificationGroupType"
ClassOptionValue = "OptionValue"
ClassJsonValue = "JsonValue"
ClassUserPrivacySettingRule = "UserPrivacySettingRule"
ClassUserPrivacySetting = "UserPrivacySetting"
ClassChatReportReason = "ChatReportReason"
ClassInternalLinkType = "InternalLinkType"
ClassFileType = "FileType"
ClassNetworkType = "NetworkType"
ClassNetworkStatisticsEntry = "NetworkStatisticsEntry"
ClassConnectionState = "ConnectionState"
ClassTopChatCategory = "TopChatCategory"
ClassTMeUrlType = "TMeUrlType"
ClassSuggestedAction = "SuggestedAction"
ClassTextParseMode = "TextParseMode"
ClassProxyType = "ProxyType"
ClassStatisticalGraph = "StatisticalGraph"
ClassChatStatistics = "ChatStatistics"
ClassVectorPathCommand = "VectorPathCommand"
ClassBotCommandScope = "BotCommandScope"
ClassUpdate = "Update"
ClassLogStream = "LogStream"
ClassError = "Error"
ClassOk = "Ok"
ClassTdlibParameters = "TdlibParameters"
ClassAuthenticationCodeInfo = "AuthenticationCodeInfo"
ClassEmailAddressAuthenticationCodeInfo = "EmailAddressAuthenticationCodeInfo"
ClassTextEntity = "TextEntity"
ClassTextEntities = "TextEntities"
ClassFormattedText = "FormattedText"
ClassTermsOfService = "TermsOfService"
ClassPasswordState = "PasswordState"
ClassRecoveryEmailAddress = "RecoveryEmailAddress"
ClassTemporaryPasswordState = "TemporaryPasswordState"
ClassLocalFile = "LocalFile"
ClassRemoteFile = "RemoteFile"
ClassFile = "File"
ClassPhotoSize = "PhotoSize"
ClassMinithumbnail = "Minithumbnail"
ClassThumbnail = "Thumbnail"
ClassMaskPosition = "MaskPosition"
ClassClosedVectorPath = "ClosedVectorPath"
ClassPollOption = "PollOption"
ClassAnimation = "Animation"
ClassAudio = "Audio"
ClassDocument = "Document"
ClassPhoto = "Photo"
ClassSticker = "Sticker"
ClassVideo = "Video"
ClassVideoNote = "VideoNote"
ClassVoiceNote = "VoiceNote"
ClassAnimatedEmoji = "AnimatedEmoji"
ClassContact = "Contact"
ClassLocation = "Location"
ClassVenue = "Venue"
ClassGame = "Game"
ClassPoll = "Poll"
ClassProfilePhoto = "ProfilePhoto"
ClassChatPhotoInfo = "ChatPhotoInfo"
ClassBotCommand = "BotCommand"
ClassBotCommands = "BotCommands"
ClassChatLocation = "ChatLocation"
ClassAnimatedChatPhoto = "AnimatedChatPhoto"
ClassChatPhoto = "ChatPhoto"
ClassChatPhotos = "ChatPhotos"
ClassUser = "User"
ClassUserFullInfo = "UserFullInfo"
ClassUsers = "Users"
ClassChatAdministrator = "ChatAdministrator"
ClassChatAdministrators = "ChatAdministrators"
ClassChatPermissions = "ChatPermissions"
ClassChatMember = "ChatMember"
ClassChatMembers = "ChatMembers"
ClassChatInviteLink = "ChatInviteLink"
ClassChatInviteLinks = "ChatInviteLinks"
ClassChatInviteLinkCount = "ChatInviteLinkCount"
ClassChatInviteLinkCounts = "ChatInviteLinkCounts"
ClassChatInviteLinkMember = "ChatInviteLinkMember"
ClassChatInviteLinkMembers = "ChatInviteLinkMembers"
ClassChatInviteLinkInfo = "ChatInviteLinkInfo"
ClassChatJoinRequest = "ChatJoinRequest"
ClassChatJoinRequests = "ChatJoinRequests"
ClassChatJoinRequestsInfo = "ChatJoinRequestsInfo"
ClassBasicGroup = "BasicGroup"
ClassBasicGroupFullInfo = "BasicGroupFullInfo"
ClassSupergroup = "Supergroup"
ClassSupergroupFullInfo = "SupergroupFullInfo"
ClassSecretChat = "SecretChat"
ClassMessageSenders = "MessageSenders"
ClassMessageForwardInfo = "MessageForwardInfo"
ClassMessageReplyInfo = "MessageReplyInfo"
ClassMessageReaction = "MessageReaction"
ClassMessageInteractionInfo = "MessageInteractionInfo"
ClassUnreadReaction = "UnreadReaction"
ClassMessage = "Message"
ClassMessages = "Messages"
ClassFoundMessages = "FoundMessages"
ClassMessagePosition = "MessagePosition"
ClassMessagePositions = "MessagePositions"
ClassMessageCalendarDay = "MessageCalendarDay"
ClassMessageCalendar = "MessageCalendar"
ClassSponsoredMessage = "SponsoredMessage"
ClassFileDownload = "FileDownload"
ClassDownloadedFileCounts = "DownloadedFileCounts"
ClassFoundFileDownloads = "FoundFileDownloads"
ClassChatNotificationSettings = "ChatNotificationSettings"
ClassScopeNotificationSettings = "ScopeNotificationSettings"
ClassDraftMessage = "DraftMessage"
ClassChatFilter = "ChatFilter"
ClassChatFilterInfo = "ChatFilterInfo"
ClassRecommendedChatFilter = "RecommendedChatFilter"
ClassRecommendedChatFilters = "RecommendedChatFilters"
ClassChatLists = "ChatLists"
ClassChatPosition = "ChatPosition"
ClassVideoChat = "VideoChat"
ClassChat = "Chat"
ClassChats = "Chats"
ClassChatNearby = "ChatNearby"
ClassChatsNearby = "ChatsNearby"
ClassKeyboardButton = "KeyboardButton"
ClassInlineKeyboardButton = "InlineKeyboardButton"
ClassMessageThreadInfo = "MessageThreadInfo"
ClassPageBlockCaption = "PageBlockCaption"
ClassPageBlockListItem = "PageBlockListItem"
ClassPageBlockTableCell = "PageBlockTableCell"
ClassPageBlockRelatedArticle = "PageBlockRelatedArticle"
ClassWebPageInstantView = "WebPageInstantView"
ClassWebPage = "WebPage"
ClassCountryInfo = "CountryInfo"
ClassCountries = "Countries"
ClassPhoneNumberInfo = "PhoneNumberInfo"
ClassBankCardActionOpenUrl = "BankCardActionOpenUrl"
ClassBankCardInfo = "BankCardInfo"
ClassAddress = "Address"
ClassLabeledPricePart = "LabeledPricePart"
ClassInvoice = "Invoice"
ClassOrderInfo = "OrderInfo"
ClassShippingOption = "ShippingOption"
ClassSavedCredentials = "SavedCredentials"
ClassPaymentsProviderStripe = "PaymentsProviderStripe"
ClassPaymentFormTheme = "PaymentFormTheme"
ClassPaymentForm = "PaymentForm"
ClassValidatedOrderInfo = "ValidatedOrderInfo"
ClassPaymentResult = "PaymentResult"
ClassPaymentReceipt = "PaymentReceipt"
ClassDatedFile = "DatedFile"
ClassDate = "Date"
ClassPersonalDetails = "PersonalDetails"
ClassIdentityDocument = "IdentityDocument"
ClassInputIdentityDocument = "InputIdentityDocument"
ClassPersonalDocument = "PersonalDocument"
ClassInputPersonalDocument = "InputPersonalDocument"
ClassPassportElements = "PassportElements"
ClassPassportElementError = "PassportElementError"
ClassPassportSuitableElement = "PassportSuitableElement"
ClassPassportRequiredElement = "PassportRequiredElement"
ClassPassportAuthorizationForm = "PassportAuthorizationForm"
ClassPassportElementsWithErrors = "PassportElementsWithErrors"
ClassEncryptedCredentials = "EncryptedCredentials"
ClassEncryptedPassportElement = "EncryptedPassportElement"
ClassInputPassportElementError = "InputPassportElementError"
ClassInputThumbnail = "InputThumbnail"
ClassMessageSendOptions = "MessageSendOptions"
ClassMessageCopyOptions = "MessageCopyOptions"
ClassStickers = "Stickers"
ClassEmojis = "Emojis"
ClassStickerSet = "StickerSet"
ClassStickerSetInfo = "StickerSetInfo"
ClassStickerSets = "StickerSets"
ClassCallProtocol = "CallProtocol"
ClassCallServer = "CallServer"
ClassCallId = "CallId"
ClassGroupCallId = "GroupCallId"
ClassGroupCallStream = "GroupCallStream"
ClassGroupCallStreams = "GroupCallStreams"
ClassRtmpUrl = "RtmpUrl"
ClassGroupCallRecentSpeaker = "GroupCallRecentSpeaker"
ClassGroupCall = "GroupCall"
ClassGroupCallVideoSourceGroup = "GroupCallVideoSourceGroup"
ClassGroupCallParticipantVideoInfo = "GroupCallParticipantVideoInfo"
ClassGroupCallParticipant = "GroupCallParticipant"
ClassCall = "Call"
ClassPhoneNumberAuthenticationSettings = "PhoneNumberAuthenticationSettings"
ClassAddedReaction = "AddedReaction"
ClassAddedReactions = "AddedReactions"
ClassAvailableReactions = "AvailableReactions"
ClassReaction = "Reaction"
ClassAnimations = "Animations"
ClassImportedContacts = "ImportedContacts"
ClassHttpUrl = "HttpUrl"
ClassInlineQueryResults = "InlineQueryResults"
ClassCallbackQueryAnswer = "CallbackQueryAnswer"
ClassCustomRequestResult = "CustomRequestResult"
ClassGameHighScore = "GameHighScore"
ClassGameHighScores = "GameHighScores"
ClassChatEvent = "ChatEvent"
ClassChatEvents = "ChatEvents"
ClassChatEventLogFilters = "ChatEventLogFilters"
ClassLanguagePackString = "LanguagePackString"
ClassLanguagePackStrings = "LanguagePackStrings"
ClassLanguagePackInfo = "LanguagePackInfo"
ClassLocalizationTargetInfo = "LocalizationTargetInfo"
ClassPushReceiverId = "PushReceiverId"
ClassBackground = "Background"
ClassBackgrounds = "Backgrounds"
ClassThemeSettings = "ThemeSettings"
ClassChatTheme = "ChatTheme"
ClassHashtags = "Hashtags"
ClassNotification = "Notification"
ClassNotificationGroup = "NotificationGroup"
ClassJsonObjectMember = "JsonObjectMember"
ClassUserPrivacySettingRules = "UserPrivacySettingRules"
ClassAccountTtl = "AccountTtl"
ClassSession = "Session"
ClassSessions = "Sessions"
ClassConnectedWebsite = "ConnectedWebsite"
ClassConnectedWebsites = "ConnectedWebsites"
ClassMessageLink = "MessageLink"
ClassMessageLinkInfo = "MessageLinkInfo"
ClassFilePart = "FilePart"
ClassStorageStatisticsByFileType = "StorageStatisticsByFileType"
ClassStorageStatisticsByChat = "StorageStatisticsByChat"
ClassStorageStatistics = "StorageStatistics"
ClassStorageStatisticsFast = "StorageStatisticsFast"
ClassDatabaseStatistics = "DatabaseStatistics"
ClassNetworkStatistics = "NetworkStatistics"
ClassAutoDownloadSettings = "AutoDownloadSettings"
ClassAutoDownloadSettingsPresets = "AutoDownloadSettingsPresets"
ClassTMeUrl = "TMeUrl"
ClassTMeUrls = "TMeUrls"
ClassCount = "Count"
ClassText = "Text"
ClassSeconds = "Seconds"
ClassDeepLinkInfo = "DeepLinkInfo"
ClassProxy = "Proxy"
ClassProxies = "Proxies"
ClassInputSticker = "InputSticker"
ClassDateRange = "DateRange"
ClassStatisticalValue = "StatisticalValue"
ClassChatStatisticsMessageInteractionInfo = "ChatStatisticsMessageInteractionInfo"
ClassChatStatisticsMessageSenderInfo = "ChatStatisticsMessageSenderInfo"
ClassChatStatisticsAdministratorActionsInfo = "ChatStatisticsAdministratorActionsInfo"
ClassChatStatisticsInviterInfo = "ChatStatisticsInviterInfo"
ClassMessageStatistics = "MessageStatistics"
ClassPoint = "Point"
ClassUpdates = "Updates"
ClassLogVerbosityLevel = "LogVerbosityLevel"
ClassLogTags = "LogTags"
ClassTestInt = "TestInt"
ClassTestString = "TestString"
ClassTestBytes = "TestBytes"
ClassTestVectorInt = "TestVectorInt"
ClassTestVectorIntObject = "TestVectorIntObject"
ClassTestVectorString = "TestVectorString"
ClassTestVectorStringObject = "TestVectorStringObject"
2018-08-30 14:55:42 +00:00
)
const (
2022-03-13 04:04:12 +00:00
TypeError = "error"
TypeOk = "ok"
TypeTdlibParameters = "tdlibParameters"
TypeAuthenticationCodeTypeTelegramMessage = "authenticationCodeTypeTelegramMessage"
TypeAuthenticationCodeTypeSms = "authenticationCodeTypeSms"
TypeAuthenticationCodeTypeCall = "authenticationCodeTypeCall"
TypeAuthenticationCodeTypeFlashCall = "authenticationCodeTypeFlashCall"
TypeAuthenticationCodeTypeMissedCall = "authenticationCodeTypeMissedCall"
TypeAuthenticationCodeInfo = "authenticationCodeInfo"
TypeEmailAddressAuthenticationCodeInfo = "emailAddressAuthenticationCodeInfo"
TypeTextEntity = "textEntity"
TypeTextEntities = "textEntities"
TypeFormattedText = "formattedText"
TypeTermsOfService = "termsOfService"
TypeAuthorizationStateWaitTdlibParameters = "authorizationStateWaitTdlibParameters"
TypeAuthorizationStateWaitEncryptionKey = "authorizationStateWaitEncryptionKey"
TypeAuthorizationStateWaitPhoneNumber = "authorizationStateWaitPhoneNumber"
TypeAuthorizationStateWaitCode = "authorizationStateWaitCode"
TypeAuthorizationStateWaitOtherDeviceConfirmation = "authorizationStateWaitOtherDeviceConfirmation"
TypeAuthorizationStateWaitRegistration = "authorizationStateWaitRegistration"
TypeAuthorizationStateWaitPassword = "authorizationStateWaitPassword"
TypeAuthorizationStateReady = "authorizationStateReady"
TypeAuthorizationStateLoggingOut = "authorizationStateLoggingOut"
TypeAuthorizationStateClosing = "authorizationStateClosing"
TypeAuthorizationStateClosed = "authorizationStateClosed"
TypePasswordState = "passwordState"
TypeRecoveryEmailAddress = "recoveryEmailAddress"
TypeTemporaryPasswordState = "temporaryPasswordState"
TypeLocalFile = "localFile"
TypeRemoteFile = "remoteFile"
TypeFile = "file"
TypeInputFileId = "inputFileId"
TypeInputFileRemote = "inputFileRemote"
TypeInputFileLocal = "inputFileLocal"
TypeInputFileGenerated = "inputFileGenerated"
TypePhotoSize = "photoSize"
TypeMinithumbnail = "minithumbnail"
TypeThumbnailFormatJpeg = "thumbnailFormatJpeg"
TypeThumbnailFormatGif = "thumbnailFormatGif"
TypeThumbnailFormatMpeg4 = "thumbnailFormatMpeg4"
TypeThumbnailFormatPng = "thumbnailFormatPng"
TypeThumbnailFormatTgs = "thumbnailFormatTgs"
TypeThumbnailFormatWebm = "thumbnailFormatWebm"
TypeThumbnailFormatWebp = "thumbnailFormatWebp"
TypeThumbnail = "thumbnail"
TypeMaskPointForehead = "maskPointForehead"
TypeMaskPointEyes = "maskPointEyes"
TypeMaskPointMouth = "maskPointMouth"
TypeMaskPointChin = "maskPointChin"
TypeMaskPosition = "maskPosition"
TypeStickerTypeStatic = "stickerTypeStatic"
TypeStickerTypeAnimated = "stickerTypeAnimated"
TypeStickerTypeVideo = "stickerTypeVideo"
TypeStickerTypeMask = "stickerTypeMask"
TypeClosedVectorPath = "closedVectorPath"
TypePollOption = "pollOption"
TypePollTypeRegular = "pollTypeRegular"
TypePollTypeQuiz = "pollTypeQuiz"
TypeAnimation = "animation"
TypeAudio = "audio"
TypeDocument = "document"
TypePhoto = "photo"
TypeSticker = "sticker"
TypeVideo = "video"
TypeVideoNote = "videoNote"
TypeVoiceNote = "voiceNote"
TypeAnimatedEmoji = "animatedEmoji"
TypeContact = "contact"
TypeLocation = "location"
TypeVenue = "venue"
TypeGame = "game"
TypePoll = "poll"
TypeProfilePhoto = "profilePhoto"
TypeChatPhotoInfo = "chatPhotoInfo"
TypeUserTypeRegular = "userTypeRegular"
TypeUserTypeDeleted = "userTypeDeleted"
TypeUserTypeBot = "userTypeBot"
TypeUserTypeUnknown = "userTypeUnknown"
TypeBotCommand = "botCommand"
TypeBotCommands = "botCommands"
TypeChatLocation = "chatLocation"
TypeAnimatedChatPhoto = "animatedChatPhoto"
TypeChatPhoto = "chatPhoto"
TypeChatPhotos = "chatPhotos"
TypeInputChatPhotoPrevious = "inputChatPhotoPrevious"
TypeInputChatPhotoStatic = "inputChatPhotoStatic"
TypeInputChatPhotoAnimation = "inputChatPhotoAnimation"
TypeUser = "user"
TypeUserFullInfo = "userFullInfo"
TypeUsers = "users"
TypeChatAdministrator = "chatAdministrator"
TypeChatAdministrators = "chatAdministrators"
TypeChatPermissions = "chatPermissions"
TypeChatMemberStatusCreator = "chatMemberStatusCreator"
TypeChatMemberStatusAdministrator = "chatMemberStatusAdministrator"
TypeChatMemberStatusMember = "chatMemberStatusMember"
TypeChatMemberStatusRestricted = "chatMemberStatusRestricted"
TypeChatMemberStatusLeft = "chatMemberStatusLeft"
TypeChatMemberStatusBanned = "chatMemberStatusBanned"
TypeChatMember = "chatMember"
TypeChatMembers = "chatMembers"
TypeChatMembersFilterContacts = "chatMembersFilterContacts"
TypeChatMembersFilterAdministrators = "chatMembersFilterAdministrators"
TypeChatMembersFilterMembers = "chatMembersFilterMembers"
TypeChatMembersFilterMention = "chatMembersFilterMention"
TypeChatMembersFilterRestricted = "chatMembersFilterRestricted"
TypeChatMembersFilterBanned = "chatMembersFilterBanned"
TypeChatMembersFilterBots = "chatMembersFilterBots"
TypeSupergroupMembersFilterRecent = "supergroupMembersFilterRecent"
TypeSupergroupMembersFilterContacts = "supergroupMembersFilterContacts"
TypeSupergroupMembersFilterAdministrators = "supergroupMembersFilterAdministrators"
TypeSupergroupMembersFilterSearch = "supergroupMembersFilterSearch"
TypeSupergroupMembersFilterRestricted = "supergroupMembersFilterRestricted"
TypeSupergroupMembersFilterBanned = "supergroupMembersFilterBanned"
TypeSupergroupMembersFilterMention = "supergroupMembersFilterMention"
TypeSupergroupMembersFilterBots = "supergroupMembersFilterBots"
TypeChatInviteLink = "chatInviteLink"
TypeChatInviteLinks = "chatInviteLinks"
TypeChatInviteLinkCount = "chatInviteLinkCount"
TypeChatInviteLinkCounts = "chatInviteLinkCounts"
TypeChatInviteLinkMember = "chatInviteLinkMember"
TypeChatInviteLinkMembers = "chatInviteLinkMembers"
TypeChatInviteLinkInfo = "chatInviteLinkInfo"
TypeChatJoinRequest = "chatJoinRequest"
TypeChatJoinRequests = "chatJoinRequests"
TypeChatJoinRequestsInfo = "chatJoinRequestsInfo"
TypeBasicGroup = "basicGroup"
TypeBasicGroupFullInfo = "basicGroupFullInfo"
TypeSupergroup = "supergroup"
TypeSupergroupFullInfo = "supergroupFullInfo"
TypeSecretChatStatePending = "secretChatStatePending"
TypeSecretChatStateReady = "secretChatStateReady"
TypeSecretChatStateClosed = "secretChatStateClosed"
TypeSecretChat = "secretChat"
TypeMessageSenderUser = "messageSenderUser"
TypeMessageSenderChat = "messageSenderChat"
TypeMessageSenders = "messageSenders"
TypeMessageForwardOriginUser = "messageForwardOriginUser"
TypeMessageForwardOriginChat = "messageForwardOriginChat"
TypeMessageForwardOriginHiddenUser = "messageForwardOriginHiddenUser"
TypeMessageForwardOriginChannel = "messageForwardOriginChannel"
TypeMessageForwardOriginMessageImport = "messageForwardOriginMessageImport"
TypeMessageForwardInfo = "messageForwardInfo"
TypeMessageReplyInfo = "messageReplyInfo"
TypeMessageReaction = "messageReaction"
TypeMessageInteractionInfo = "messageInteractionInfo"
TypeUnreadReaction = "unreadReaction"
TypeMessageSendingStatePending = "messageSendingStatePending"
TypeMessageSendingStateFailed = "messageSendingStateFailed"
TypeMessage = "message"
TypeMessages = "messages"
TypeFoundMessages = "foundMessages"
TypeMessagePosition = "messagePosition"
TypeMessagePositions = "messagePositions"
TypeMessageCalendarDay = "messageCalendarDay"
TypeMessageCalendar = "messageCalendar"
TypeSponsoredMessage = "sponsoredMessage"
TypeFileDownload = "fileDownload"
TypeDownloadedFileCounts = "downloadedFileCounts"
TypeFoundFileDownloads = "foundFileDownloads"
TypeNotificationSettingsScopePrivateChats = "notificationSettingsScopePrivateChats"
TypeNotificationSettingsScopeGroupChats = "notificationSettingsScopeGroupChats"
TypeNotificationSettingsScopeChannelChats = "notificationSettingsScopeChannelChats"
TypeChatNotificationSettings = "chatNotificationSettings"
TypeScopeNotificationSettings = "scopeNotificationSettings"
TypeDraftMessage = "draftMessage"
TypeChatTypePrivate = "chatTypePrivate"
TypeChatTypeBasicGroup = "chatTypeBasicGroup"
TypeChatTypeSupergroup = "chatTypeSupergroup"
TypeChatTypeSecret = "chatTypeSecret"
TypeChatFilter = "chatFilter"
TypeChatFilterInfo = "chatFilterInfo"
TypeRecommendedChatFilter = "recommendedChatFilter"
TypeRecommendedChatFilters = "recommendedChatFilters"
TypeChatListMain = "chatListMain"
TypeChatListArchive = "chatListArchive"
TypeChatListFilter = "chatListFilter"
TypeChatLists = "chatLists"
TypeChatSourceMtprotoProxy = "chatSourceMtprotoProxy"
TypeChatSourcePublicServiceAnnouncement = "chatSourcePublicServiceAnnouncement"
TypeChatPosition = "chatPosition"
TypeVideoChat = "videoChat"
TypeChat = "chat"
TypeChats = "chats"
TypeChatNearby = "chatNearby"
TypeChatsNearby = "chatsNearby"
TypePublicChatTypeHasUsername = "publicChatTypeHasUsername"
TypePublicChatTypeIsLocationBased = "publicChatTypeIsLocationBased"
TypeChatActionBarReportSpam = "chatActionBarReportSpam"
TypeChatActionBarReportUnrelatedLocation = "chatActionBarReportUnrelatedLocation"
TypeChatActionBarInviteMembers = "chatActionBarInviteMembers"
TypeChatActionBarReportAddBlock = "chatActionBarReportAddBlock"
TypeChatActionBarAddContact = "chatActionBarAddContact"
TypeChatActionBarSharePhoneNumber = "chatActionBarSharePhoneNumber"
TypeChatActionBarJoinRequest = "chatActionBarJoinRequest"
TypeKeyboardButtonTypeText = "keyboardButtonTypeText"
TypeKeyboardButtonTypeRequestPhoneNumber = "keyboardButtonTypeRequestPhoneNumber"
TypeKeyboardButtonTypeRequestLocation = "keyboardButtonTypeRequestLocation"
TypeKeyboardButtonTypeRequestPoll = "keyboardButtonTypeRequestPoll"
TypeKeyboardButton = "keyboardButton"
TypeInlineKeyboardButtonTypeUrl = "inlineKeyboardButtonTypeUrl"
TypeInlineKeyboardButtonTypeLoginUrl = "inlineKeyboardButtonTypeLoginUrl"
TypeInlineKeyboardButtonTypeCallback = "inlineKeyboardButtonTypeCallback"
TypeInlineKeyboardButtonTypeCallbackWithPassword = "inlineKeyboardButtonTypeCallbackWithPassword"
TypeInlineKeyboardButtonTypeCallbackGame = "inlineKeyboardButtonTypeCallbackGame"
TypeInlineKeyboardButtonTypeSwitchInline = "inlineKeyboardButtonTypeSwitchInline"
TypeInlineKeyboardButtonTypeBuy = "inlineKeyboardButtonTypeBuy"
TypeInlineKeyboardButtonTypeUser = "inlineKeyboardButtonTypeUser"
TypeInlineKeyboardButton = "inlineKeyboardButton"
TypeReplyMarkupRemoveKeyboard = "replyMarkupRemoveKeyboard"
TypeReplyMarkupForceReply = "replyMarkupForceReply"
TypeReplyMarkupShowKeyboard = "replyMarkupShowKeyboard"
TypeReplyMarkupInlineKeyboard = "replyMarkupInlineKeyboard"
TypeLoginUrlInfoOpen = "loginUrlInfoOpen"
TypeLoginUrlInfoRequestConfirmation = "loginUrlInfoRequestConfirmation"
TypeMessageThreadInfo = "messageThreadInfo"
TypeRichTextPlain = "richTextPlain"
TypeRichTextBold = "richTextBold"
TypeRichTextItalic = "richTextItalic"
TypeRichTextUnderline = "richTextUnderline"
TypeRichTextStrikethrough = "richTextStrikethrough"
TypeRichTextFixed = "richTextFixed"
TypeRichTextUrl = "richTextUrl"
TypeRichTextEmailAddress = "richTextEmailAddress"
TypeRichTextSubscript = "richTextSubscript"
TypeRichTextSuperscript = "richTextSuperscript"
TypeRichTextMarked = "richTextMarked"
TypeRichTextPhoneNumber = "richTextPhoneNumber"
TypeRichTextIcon = "richTextIcon"
TypeRichTextReference = "richTextReference"
TypeRichTextAnchor = "richTextAnchor"
TypeRichTextAnchorLink = "richTextAnchorLink"
TypeRichTexts = "richTexts"
TypePageBlockCaption = "pageBlockCaption"
TypePageBlockListItem = "pageBlockListItem"
TypePageBlockHorizontalAlignmentLeft = "pageBlockHorizontalAlignmentLeft"
TypePageBlockHorizontalAlignmentCenter = "pageBlockHorizontalAlignmentCenter"
TypePageBlockHorizontalAlignmentRight = "pageBlockHorizontalAlignmentRight"
TypePageBlockVerticalAlignmentTop = "pageBlockVerticalAlignmentTop"
TypePageBlockVerticalAlignmentMiddle = "pageBlockVerticalAlignmentMiddle"
TypePageBlockVerticalAlignmentBottom = "pageBlockVerticalAlignmentBottom"
TypePageBlockTableCell = "pageBlockTableCell"
TypePageBlockRelatedArticle = "pageBlockRelatedArticle"
TypePageBlockTitle = "pageBlockTitle"
TypePageBlockSubtitle = "pageBlockSubtitle"
TypePageBlockAuthorDate = "pageBlockAuthorDate"
TypePageBlockHeader = "pageBlockHeader"
TypePageBlockSubheader = "pageBlockSubheader"
TypePageBlockKicker = "pageBlockKicker"
TypePageBlockParagraph = "pageBlockParagraph"
TypePageBlockPreformatted = "pageBlockPreformatted"
TypePageBlockFooter = "pageBlockFooter"
TypePageBlockDivider = "pageBlockDivider"
TypePageBlockAnchor = "pageBlockAnchor"
TypePageBlockList = "pageBlockList"
TypePageBlockBlockQuote = "pageBlockBlockQuote"
TypePageBlockPullQuote = "pageBlockPullQuote"
TypePageBlockAnimation = "pageBlockAnimation"
TypePageBlockAudio = "pageBlockAudio"
TypePageBlockPhoto = "pageBlockPhoto"
TypePageBlockVideo = "pageBlockVideo"
TypePageBlockVoiceNote = "pageBlockVoiceNote"
TypePageBlockCover = "pageBlockCover"
TypePageBlockEmbedded = "pageBlockEmbedded"
TypePageBlockEmbeddedPost = "pageBlockEmbeddedPost"
TypePageBlockCollage = "pageBlockCollage"
TypePageBlockSlideshow = "pageBlockSlideshow"
TypePageBlockChatLink = "pageBlockChatLink"
TypePageBlockTable = "pageBlockTable"
TypePageBlockDetails = "pageBlockDetails"
TypePageBlockRelatedArticles = "pageBlockRelatedArticles"
TypePageBlockMap = "pageBlockMap"
TypeWebPageInstantView = "webPageInstantView"
TypeWebPage = "webPage"
TypeCountryInfo = "countryInfo"
TypeCountries = "countries"
TypePhoneNumberInfo = "phoneNumberInfo"
TypeBankCardActionOpenUrl = "bankCardActionOpenUrl"
TypeBankCardInfo = "bankCardInfo"
TypeAddress = "address"
TypeLabeledPricePart = "labeledPricePart"
TypeInvoice = "invoice"
TypeOrderInfo = "orderInfo"
TypeShippingOption = "shippingOption"
TypeSavedCredentials = "savedCredentials"
TypeInputCredentialsSaved = "inputCredentialsSaved"
TypeInputCredentialsNew = "inputCredentialsNew"
TypeInputCredentialsApplePay = "inputCredentialsApplePay"
TypeInputCredentialsGooglePay = "inputCredentialsGooglePay"
TypePaymentsProviderStripe = "paymentsProviderStripe"
TypePaymentFormTheme = "paymentFormTheme"
TypePaymentForm = "paymentForm"
TypeValidatedOrderInfo = "validatedOrderInfo"
TypePaymentResult = "paymentResult"
TypePaymentReceipt = "paymentReceipt"
TypeDatedFile = "datedFile"
TypePassportElementTypePersonalDetails = "passportElementTypePersonalDetails"
TypePassportElementTypePassport = "passportElementTypePassport"
TypePassportElementTypeDriverLicense = "passportElementTypeDriverLicense"
TypePassportElementTypeIdentityCard = "passportElementTypeIdentityCard"
TypePassportElementTypeInternalPassport = "passportElementTypeInternalPassport"
TypePassportElementTypeAddress = "passportElementTypeAddress"
TypePassportElementTypeUtilityBill = "passportElementTypeUtilityBill"
TypePassportElementTypeBankStatement = "passportElementTypeBankStatement"
TypePassportElementTypeRentalAgreement = "passportElementTypeRentalAgreement"
TypePassportElementTypePassportRegistration = "passportElementTypePassportRegistration"
TypePassportElementTypeTemporaryRegistration = "passportElementTypeTemporaryRegistration"
TypePassportElementTypePhoneNumber = "passportElementTypePhoneNumber"
TypePassportElementTypeEmailAddress = "passportElementTypeEmailAddress"
TypeDate = "date"
TypePersonalDetails = "personalDetails"
TypeIdentityDocument = "identityDocument"
TypeInputIdentityDocument = "inputIdentityDocument"
TypePersonalDocument = "personalDocument"
TypeInputPersonalDocument = "inputPersonalDocument"
TypePassportElementPersonalDetails = "passportElementPersonalDetails"
TypePassportElementPassport = "passportElementPassport"
TypePassportElementDriverLicense = "passportElementDriverLicense"
TypePassportElementIdentityCard = "passportElementIdentityCard"
TypePassportElementInternalPassport = "passportElementInternalPassport"
TypePassportElementAddress = "passportElementAddress"
TypePassportElementUtilityBill = "passportElementUtilityBill"
TypePassportElementBankStatement = "passportElementBankStatement"
TypePassportElementRentalAgreement = "passportElementRentalAgreement"
TypePassportElementPassportRegistration = "passportElementPassportRegistration"
TypePassportElementTemporaryRegistration = "passportElementTemporaryRegistration"
TypePassportElementPhoneNumber = "passportElementPhoneNumber"
TypePassportElementEmailAddress = "passportElementEmailAddress"
TypeInputPassportElementPersonalDetails = "inputPassportElementPersonalDetails"
TypeInputPassportElementPassport = "inputPassportElementPassport"
TypeInputPassportElementDriverLicense = "inputPassportElementDriverLicense"
TypeInputPassportElementIdentityCard = "inputPassportElementIdentityCard"
TypeInputPassportElementInternalPassport = "inputPassportElementInternalPassport"
TypeInputPassportElementAddress = "inputPassportElementAddress"
TypeInputPassportElementUtilityBill = "inputPassportElementUtilityBill"
TypeInputPassportElementBankStatement = "inputPassportElementBankStatement"
TypeInputPassportElementRentalAgreement = "inputPassportElementRentalAgreement"
TypeInputPassportElementPassportRegistration = "inputPassportElementPassportRegistration"
TypeInputPassportElementTemporaryRegistration = "inputPassportElementTemporaryRegistration"
TypeInputPassportElementPhoneNumber = "inputPassportElementPhoneNumber"
TypeInputPassportElementEmailAddress = "inputPassportElementEmailAddress"
TypePassportElements = "passportElements"
TypePassportElementErrorSourceUnspecified = "passportElementErrorSourceUnspecified"
TypePassportElementErrorSourceDataField = "passportElementErrorSourceDataField"
TypePassportElementErrorSourceFrontSide = "passportElementErrorSourceFrontSide"
TypePassportElementErrorSourceReverseSide = "passportElementErrorSourceReverseSide"
TypePassportElementErrorSourceSelfie = "passportElementErrorSourceSelfie"
TypePassportElementErrorSourceTranslationFile = "passportElementErrorSourceTranslationFile"
TypePassportElementErrorSourceTranslationFiles = "passportElementErrorSourceTranslationFiles"
TypePassportElementErrorSourceFile = "passportElementErrorSourceFile"
TypePassportElementErrorSourceFiles = "passportElementErrorSourceFiles"
TypePassportElementError = "passportElementError"
TypePassportSuitableElement = "passportSuitableElement"
TypePassportRequiredElement = "passportRequiredElement"
TypePassportAuthorizationForm = "passportAuthorizationForm"
TypePassportElementsWithErrors = "passportElementsWithErrors"
TypeEncryptedCredentials = "encryptedCredentials"
TypeEncryptedPassportElement = "encryptedPassportElement"
TypeInputPassportElementErrorSourceUnspecified = "inputPassportElementErrorSourceUnspecified"
TypeInputPassportElementErrorSourceDataField = "inputPassportElementErrorSourceDataField"
TypeInputPassportElementErrorSourceFrontSide = "inputPassportElementErrorSourceFrontSide"
TypeInputPassportElementErrorSourceReverseSide = "inputPassportElementErrorSourceReverseSide"
TypeInputPassportElementErrorSourceSelfie = "inputPassportElementErrorSourceSelfie"
TypeInputPassportElementErrorSourceTranslationFile = "inputPassportElementErrorSourceTranslationFile"
TypeInputPassportElementErrorSourceTranslationFiles = "inputPassportElementErrorSourceTranslationFiles"
TypeInputPassportElementErrorSourceFile = "inputPassportElementErrorSourceFile"
TypeInputPassportElementErrorSourceFiles = "inputPassportElementErrorSourceFiles"
TypeInputPassportElementError = "inputPassportElementError"
TypeMessageText = "messageText"
TypeMessageAnimation = "messageAnimation"
TypeMessageAudio = "messageAudio"
TypeMessageDocument = "messageDocument"
TypeMessagePhoto = "messagePhoto"
TypeMessageExpiredPhoto = "messageExpiredPhoto"
TypeMessageSticker = "messageSticker"
TypeMessageVideo = "messageVideo"
TypeMessageExpiredVideo = "messageExpiredVideo"
TypeMessageVideoNote = "messageVideoNote"
TypeMessageVoiceNote = "messageVoiceNote"
TypeMessageLocation = "messageLocation"
TypeMessageVenue = "messageVenue"
TypeMessageContact = "messageContact"
TypeMessageAnimatedEmoji = "messageAnimatedEmoji"
TypeMessageDice = "messageDice"
TypeMessageGame = "messageGame"
TypeMessagePoll = "messagePoll"
TypeMessageInvoice = "messageInvoice"
TypeMessageCall = "messageCall"
TypeMessageVideoChatScheduled = "messageVideoChatScheduled"
TypeMessageVideoChatStarted = "messageVideoChatStarted"
TypeMessageVideoChatEnded = "messageVideoChatEnded"
TypeMessageInviteVideoChatParticipants = "messageInviteVideoChatParticipants"
TypeMessageBasicGroupChatCreate = "messageBasicGroupChatCreate"
TypeMessageSupergroupChatCreate = "messageSupergroupChatCreate"
TypeMessageChatChangeTitle = "messageChatChangeTitle"
TypeMessageChatChangePhoto = "messageChatChangePhoto"
TypeMessageChatDeletePhoto = "messageChatDeletePhoto"
TypeMessageChatAddMembers = "messageChatAddMembers"
TypeMessageChatJoinByLink = "messageChatJoinByLink"
TypeMessageChatJoinByRequest = "messageChatJoinByRequest"
TypeMessageChatDeleteMember = "messageChatDeleteMember"
TypeMessageChatUpgradeTo = "messageChatUpgradeTo"
TypeMessageChatUpgradeFrom = "messageChatUpgradeFrom"
TypeMessagePinMessage = "messagePinMessage"
TypeMessageScreenshotTaken = "messageScreenshotTaken"
TypeMessageChatSetTheme = "messageChatSetTheme"
TypeMessageChatSetTtl = "messageChatSetTtl"
TypeMessageCustomServiceAction = "messageCustomServiceAction"
TypeMessageGameScore = "messageGameScore"
TypeMessagePaymentSuccessful = "messagePaymentSuccessful"
TypeMessagePaymentSuccessfulBot = "messagePaymentSuccessfulBot"
TypeMessageContactRegistered = "messageContactRegistered"
TypeMessageWebsiteConnected = "messageWebsiteConnected"
TypeMessagePassportDataSent = "messagePassportDataSent"
TypeMessagePassportDataReceived = "messagePassportDataReceived"
TypeMessageProximityAlertTriggered = "messageProximityAlertTriggered"
TypeMessageUnsupported = "messageUnsupported"
TypeTextEntityTypeMention = "textEntityTypeMention"
TypeTextEntityTypeHashtag = "textEntityTypeHashtag"
TypeTextEntityTypeCashtag = "textEntityTypeCashtag"
TypeTextEntityTypeBotCommand = "textEntityTypeBotCommand"
TypeTextEntityTypeUrl = "textEntityTypeUrl"
TypeTextEntityTypeEmailAddress = "textEntityTypeEmailAddress"
TypeTextEntityTypePhoneNumber = "textEntityTypePhoneNumber"
TypeTextEntityTypeBankCardNumber = "textEntityTypeBankCardNumber"
TypeTextEntityTypeBold = "textEntityTypeBold"
TypeTextEntityTypeItalic = "textEntityTypeItalic"
TypeTextEntityTypeUnderline = "textEntityTypeUnderline"
TypeTextEntityTypeStrikethrough = "textEntityTypeStrikethrough"
TypeTextEntityTypeSpoiler = "textEntityTypeSpoiler"
TypeTextEntityTypeCode = "textEntityTypeCode"
TypeTextEntityTypePre = "textEntityTypePre"
TypeTextEntityTypePreCode = "textEntityTypePreCode"
TypeTextEntityTypeTextUrl = "textEntityTypeTextUrl"
TypeTextEntityTypeMentionName = "textEntityTypeMentionName"
TypeTextEntityTypeMediaTimestamp = "textEntityTypeMediaTimestamp"
TypeInputThumbnail = "inputThumbnail"
TypeMessageSchedulingStateSendAtDate = "messageSchedulingStateSendAtDate"
TypeMessageSchedulingStateSendWhenOnline = "messageSchedulingStateSendWhenOnline"
TypeMessageSendOptions = "messageSendOptions"
TypeMessageCopyOptions = "messageCopyOptions"
TypeInputMessageText = "inputMessageText"
TypeInputMessageAnimation = "inputMessageAnimation"
TypeInputMessageAudio = "inputMessageAudio"
TypeInputMessageDocument = "inputMessageDocument"
TypeInputMessagePhoto = "inputMessagePhoto"
TypeInputMessageSticker = "inputMessageSticker"
TypeInputMessageVideo = "inputMessageVideo"
TypeInputMessageVideoNote = "inputMessageVideoNote"
TypeInputMessageVoiceNote = "inputMessageVoiceNote"
TypeInputMessageLocation = "inputMessageLocation"
TypeInputMessageVenue = "inputMessageVenue"
TypeInputMessageContact = "inputMessageContact"
TypeInputMessageDice = "inputMessageDice"
TypeInputMessageGame = "inputMessageGame"
TypeInputMessageInvoice = "inputMessageInvoice"
TypeInputMessagePoll = "inputMessagePoll"
TypeInputMessageForwarded = "inputMessageForwarded"
TypeSearchMessagesFilterEmpty = "searchMessagesFilterEmpty"
TypeSearchMessagesFilterAnimation = "searchMessagesFilterAnimation"
TypeSearchMessagesFilterAudio = "searchMessagesFilterAudio"
TypeSearchMessagesFilterDocument = "searchMessagesFilterDocument"
TypeSearchMessagesFilterPhoto = "searchMessagesFilterPhoto"
TypeSearchMessagesFilterVideo = "searchMessagesFilterVideo"
TypeSearchMessagesFilterVoiceNote = "searchMessagesFilterVoiceNote"
TypeSearchMessagesFilterPhotoAndVideo = "searchMessagesFilterPhotoAndVideo"
TypeSearchMessagesFilterUrl = "searchMessagesFilterUrl"
TypeSearchMessagesFilterChatPhoto = "searchMessagesFilterChatPhoto"
TypeSearchMessagesFilterVideoNote = "searchMessagesFilterVideoNote"
TypeSearchMessagesFilterVoiceAndVideoNote = "searchMessagesFilterVoiceAndVideoNote"
TypeSearchMessagesFilterMention = "searchMessagesFilterMention"
TypeSearchMessagesFilterUnreadMention = "searchMessagesFilterUnreadMention"
TypeSearchMessagesFilterUnreadReaction = "searchMessagesFilterUnreadReaction"
TypeSearchMessagesFilterFailedToSend = "searchMessagesFilterFailedToSend"
TypeSearchMessagesFilterPinned = "searchMessagesFilterPinned"
TypeChatActionTyping = "chatActionTyping"
TypeChatActionRecordingVideo = "chatActionRecordingVideo"
TypeChatActionUploadingVideo = "chatActionUploadingVideo"
TypeChatActionRecordingVoiceNote = "chatActionRecordingVoiceNote"
TypeChatActionUploadingVoiceNote = "chatActionUploadingVoiceNote"
TypeChatActionUploadingPhoto = "chatActionUploadingPhoto"
TypeChatActionUploadingDocument = "chatActionUploadingDocument"
TypeChatActionChoosingSticker = "chatActionChoosingSticker"
TypeChatActionChoosingLocation = "chatActionChoosingLocation"
TypeChatActionChoosingContact = "chatActionChoosingContact"
TypeChatActionStartPlayingGame = "chatActionStartPlayingGame"
TypeChatActionRecordingVideoNote = "chatActionRecordingVideoNote"
TypeChatActionUploadingVideoNote = "chatActionUploadingVideoNote"
TypeChatActionWatchingAnimations = "chatActionWatchingAnimations"
TypeChatActionCancel = "chatActionCancel"
TypeUserStatusEmpty = "userStatusEmpty"
TypeUserStatusOnline = "userStatusOnline"
TypeUserStatusOffline = "userStatusOffline"
TypeUserStatusRecently = "userStatusRecently"
TypeUserStatusLastWeek = "userStatusLastWeek"
TypeUserStatusLastMonth = "userStatusLastMonth"
TypeStickers = "stickers"
TypeEmojis = "emojis"
TypeStickerSet = "stickerSet"
TypeStickerSetInfo = "stickerSetInfo"
TypeStickerSets = "stickerSets"
TypeCallDiscardReasonEmpty = "callDiscardReasonEmpty"
TypeCallDiscardReasonMissed = "callDiscardReasonMissed"
TypeCallDiscardReasonDeclined = "callDiscardReasonDeclined"
TypeCallDiscardReasonDisconnected = "callDiscardReasonDisconnected"
TypeCallDiscardReasonHungUp = "callDiscardReasonHungUp"
TypeCallProtocol = "callProtocol"
TypeCallServerTypeTelegramReflector = "callServerTypeTelegramReflector"
TypeCallServerTypeWebrtc = "callServerTypeWebrtc"
TypeCallServer = "callServer"
TypeCallId = "callId"
TypeGroupCallId = "groupCallId"
TypeCallStatePending = "callStatePending"
TypeCallStateExchangingKeys = "callStateExchangingKeys"
TypeCallStateReady = "callStateReady"
TypeCallStateHangingUp = "callStateHangingUp"
TypeCallStateDiscarded = "callStateDiscarded"
TypeCallStateError = "callStateError"
TypeGroupCallVideoQualityThumbnail = "groupCallVideoQualityThumbnail"
TypeGroupCallVideoQualityMedium = "groupCallVideoQualityMedium"
TypeGroupCallVideoQualityFull = "groupCallVideoQualityFull"
TypeGroupCallStream = "groupCallStream"
TypeGroupCallStreams = "groupCallStreams"
TypeRtmpUrl = "rtmpUrl"
TypeGroupCallRecentSpeaker = "groupCallRecentSpeaker"
TypeGroupCall = "groupCall"
TypeGroupCallVideoSourceGroup = "groupCallVideoSourceGroup"
TypeGroupCallParticipantVideoInfo = "groupCallParticipantVideoInfo"
TypeGroupCallParticipant = "groupCallParticipant"
TypeCallProblemEcho = "callProblemEcho"
TypeCallProblemNoise = "callProblemNoise"
TypeCallProblemInterruptions = "callProblemInterruptions"
TypeCallProblemDistortedSpeech = "callProblemDistortedSpeech"
TypeCallProblemSilentLocal = "callProblemSilentLocal"
TypeCallProblemSilentRemote = "callProblemSilentRemote"
TypeCallProblemDropped = "callProblemDropped"
TypeCallProblemDistortedVideo = "callProblemDistortedVideo"
TypeCallProblemPixelatedVideo = "callProblemPixelatedVideo"
TypeCall = "call"
TypePhoneNumberAuthenticationSettings = "phoneNumberAuthenticationSettings"
TypeAddedReaction = "addedReaction"
TypeAddedReactions = "addedReactions"
TypeAvailableReactions = "availableReactions"
TypeReaction = "reaction"
TypeAnimations = "animations"
TypeDiceStickersRegular = "diceStickersRegular"
TypeDiceStickersSlotMachine = "diceStickersSlotMachine"
TypeImportedContacts = "importedContacts"
TypeHttpUrl = "httpUrl"
TypeInputInlineQueryResultAnimation = "inputInlineQueryResultAnimation"
TypeInputInlineQueryResultArticle = "inputInlineQueryResultArticle"
TypeInputInlineQueryResultAudio = "inputInlineQueryResultAudio"
TypeInputInlineQueryResultContact = "inputInlineQueryResultContact"
TypeInputInlineQueryResultDocument = "inputInlineQueryResultDocument"
TypeInputInlineQueryResultGame = "inputInlineQueryResultGame"
TypeInputInlineQueryResultLocation = "inputInlineQueryResultLocation"
TypeInputInlineQueryResultPhoto = "inputInlineQueryResultPhoto"
TypeInputInlineQueryResultSticker = "inputInlineQueryResultSticker"
TypeInputInlineQueryResultVenue = "inputInlineQueryResultVenue"
TypeInputInlineQueryResultVideo = "inputInlineQueryResultVideo"
TypeInputInlineQueryResultVoiceNote = "inputInlineQueryResultVoiceNote"
TypeInlineQueryResultArticle = "inlineQueryResultArticle"
TypeInlineQueryResultContact = "inlineQueryResultContact"
TypeInlineQueryResultLocation = "inlineQueryResultLocation"
TypeInlineQueryResultVenue = "inlineQueryResultVenue"
TypeInlineQueryResultGame = "inlineQueryResultGame"
TypeInlineQueryResultAnimation = "inlineQueryResultAnimation"
TypeInlineQueryResultAudio = "inlineQueryResultAudio"
TypeInlineQueryResultDocument = "inlineQueryResultDocument"
TypeInlineQueryResultPhoto = "inlineQueryResultPhoto"
TypeInlineQueryResultSticker = "inlineQueryResultSticker"
TypeInlineQueryResultVideo = "inlineQueryResultVideo"
TypeInlineQueryResultVoiceNote = "inlineQueryResultVoiceNote"
TypeInlineQueryResults = "inlineQueryResults"
TypeCallbackQueryPayloadData = "callbackQueryPayloadData"
TypeCallbackQueryPayloadDataWithPassword = "callbackQueryPayloadDataWithPassword"
TypeCallbackQueryPayloadGame = "callbackQueryPayloadGame"
TypeCallbackQueryAnswer = "callbackQueryAnswer"
TypeCustomRequestResult = "customRequestResult"
TypeGameHighScore = "gameHighScore"
TypeGameHighScores = "gameHighScores"
TypeChatEventMessageEdited = "chatEventMessageEdited"
TypeChatEventMessageDeleted = "chatEventMessageDeleted"
TypeChatEventMessagePinned = "chatEventMessagePinned"
TypeChatEventMessageUnpinned = "chatEventMessageUnpinned"
TypeChatEventPollStopped = "chatEventPollStopped"
TypeChatEventMemberJoined = "chatEventMemberJoined"
TypeChatEventMemberJoinedByInviteLink = "chatEventMemberJoinedByInviteLink"
TypeChatEventMemberJoinedByRequest = "chatEventMemberJoinedByRequest"
TypeChatEventMemberInvited = "chatEventMemberInvited"
TypeChatEventMemberLeft = "chatEventMemberLeft"
TypeChatEventMemberPromoted = "chatEventMemberPromoted"
TypeChatEventMemberRestricted = "chatEventMemberRestricted"
TypeChatEventAvailableReactionsChanged = "chatEventAvailableReactionsChanged"
TypeChatEventDescriptionChanged = "chatEventDescriptionChanged"
TypeChatEventLinkedChatChanged = "chatEventLinkedChatChanged"
TypeChatEventLocationChanged = "chatEventLocationChanged"
TypeChatEventMessageTtlChanged = "chatEventMessageTtlChanged"
TypeChatEventPermissionsChanged = "chatEventPermissionsChanged"
TypeChatEventPhotoChanged = "chatEventPhotoChanged"
TypeChatEventSlowModeDelayChanged = "chatEventSlowModeDelayChanged"
TypeChatEventStickerSetChanged = "chatEventStickerSetChanged"
TypeChatEventTitleChanged = "chatEventTitleChanged"
TypeChatEventUsernameChanged = "chatEventUsernameChanged"
TypeChatEventHasProtectedContentToggled = "chatEventHasProtectedContentToggled"
TypeChatEventInvitesToggled = "chatEventInvitesToggled"
TypeChatEventIsAllHistoryAvailableToggled = "chatEventIsAllHistoryAvailableToggled"
TypeChatEventSignMessagesToggled = "chatEventSignMessagesToggled"
TypeChatEventInviteLinkEdited = "chatEventInviteLinkEdited"
TypeChatEventInviteLinkRevoked = "chatEventInviteLinkRevoked"
TypeChatEventInviteLinkDeleted = "chatEventInviteLinkDeleted"
TypeChatEventVideoChatCreated = "chatEventVideoChatCreated"
TypeChatEventVideoChatEnded = "chatEventVideoChatEnded"
TypeChatEventVideoChatMuteNewParticipantsToggled = "chatEventVideoChatMuteNewParticipantsToggled"
TypeChatEventVideoChatParticipantIsMutedToggled = "chatEventVideoChatParticipantIsMutedToggled"
TypeChatEventVideoChatParticipantVolumeLevelChanged = "chatEventVideoChatParticipantVolumeLevelChanged"
TypeChatEvent = "chatEvent"
TypeChatEvents = "chatEvents"
TypeChatEventLogFilters = "chatEventLogFilters"
TypeLanguagePackStringValueOrdinary = "languagePackStringValueOrdinary"
TypeLanguagePackStringValuePluralized = "languagePackStringValuePluralized"
TypeLanguagePackStringValueDeleted = "languagePackStringValueDeleted"
TypeLanguagePackString = "languagePackString"
TypeLanguagePackStrings = "languagePackStrings"
TypeLanguagePackInfo = "languagePackInfo"
TypeLocalizationTargetInfo = "localizationTargetInfo"
TypeDeviceTokenFirebaseCloudMessaging = "deviceTokenFirebaseCloudMessaging"
TypeDeviceTokenApplePush = "deviceTokenApplePush"
TypeDeviceTokenApplePushVoIP = "deviceTokenApplePushVoIP"
TypeDeviceTokenWindowsPush = "deviceTokenWindowsPush"
TypeDeviceTokenMicrosoftPush = "deviceTokenMicrosoftPush"
TypeDeviceTokenMicrosoftPushVoIP = "deviceTokenMicrosoftPushVoIP"
TypeDeviceTokenWebPush = "deviceTokenWebPush"
TypeDeviceTokenSimplePush = "deviceTokenSimplePush"
TypeDeviceTokenUbuntuPush = "deviceTokenUbuntuPush"
TypeDeviceTokenBlackBerryPush = "deviceTokenBlackBerryPush"
TypeDeviceTokenTizenPush = "deviceTokenTizenPush"
TypePushReceiverId = "pushReceiverId"
TypeBackgroundFillSolid = "backgroundFillSolid"
TypeBackgroundFillGradient = "backgroundFillGradient"
TypeBackgroundFillFreeformGradient = "backgroundFillFreeformGradient"
TypeBackgroundTypeWallpaper = "backgroundTypeWallpaper"
TypeBackgroundTypePattern = "backgroundTypePattern"
TypeBackgroundTypeFill = "backgroundTypeFill"
TypeBackground = "background"
TypeBackgrounds = "backgrounds"
TypeInputBackgroundLocal = "inputBackgroundLocal"
TypeInputBackgroundRemote = "inputBackgroundRemote"
TypeThemeSettings = "themeSettings"
TypeChatTheme = "chatTheme"
TypeHashtags = "hashtags"
TypeCanTransferOwnershipResultOk = "canTransferOwnershipResultOk"
TypeCanTransferOwnershipResultPasswordNeeded = "canTransferOwnershipResultPasswordNeeded"
TypeCanTransferOwnershipResultPasswordTooFresh = "canTransferOwnershipResultPasswordTooFresh"
TypeCanTransferOwnershipResultSessionTooFresh = "canTransferOwnershipResultSessionTooFresh"
TypeCheckChatUsernameResultOk = "checkChatUsernameResultOk"
TypeCheckChatUsernameResultUsernameInvalid = "checkChatUsernameResultUsernameInvalid"
TypeCheckChatUsernameResultUsernameOccupied = "checkChatUsernameResultUsernameOccupied"
TypeCheckChatUsernameResultPublicChatsTooMuch = "checkChatUsernameResultPublicChatsTooMuch"
TypeCheckChatUsernameResultPublicGroupsUnavailable = "checkChatUsernameResultPublicGroupsUnavailable"
TypeCheckStickerSetNameResultOk = "checkStickerSetNameResultOk"
TypeCheckStickerSetNameResultNameInvalid = "checkStickerSetNameResultNameInvalid"
TypeCheckStickerSetNameResultNameOccupied = "checkStickerSetNameResultNameOccupied"
TypeResetPasswordResultOk = "resetPasswordResultOk"
TypeResetPasswordResultPending = "resetPasswordResultPending"
TypeResetPasswordResultDeclined = "resetPasswordResultDeclined"
TypeMessageFileTypePrivate = "messageFileTypePrivate"
TypeMessageFileTypeGroup = "messageFileTypeGroup"
TypeMessageFileTypeUnknown = "messageFileTypeUnknown"
TypePushMessageContentHidden = "pushMessageContentHidden"
TypePushMessageContentAnimation = "pushMessageContentAnimation"
TypePushMessageContentAudio = "pushMessageContentAudio"
TypePushMessageContentContact = "pushMessageContentContact"
TypePushMessageContentContactRegistered = "pushMessageContentContactRegistered"
TypePushMessageContentDocument = "pushMessageContentDocument"
TypePushMessageContentGame = "pushMessageContentGame"
TypePushMessageContentGameScore = "pushMessageContentGameScore"
TypePushMessageContentInvoice = "pushMessageContentInvoice"
TypePushMessageContentLocation = "pushMessageContentLocation"
TypePushMessageContentPhoto = "pushMessageContentPhoto"
TypePushMessageContentPoll = "pushMessageContentPoll"
TypePushMessageContentScreenshotTaken = "pushMessageContentScreenshotTaken"
TypePushMessageContentSticker = "pushMessageContentSticker"
TypePushMessageContentText = "pushMessageContentText"
TypePushMessageContentVideo = "pushMessageContentVideo"
TypePushMessageContentVideoNote = "pushMessageContentVideoNote"
TypePushMessageContentVoiceNote = "pushMessageContentVoiceNote"
TypePushMessageContentBasicGroupChatCreate = "pushMessageContentBasicGroupChatCreate"
TypePushMessageContentChatAddMembers = "pushMessageContentChatAddMembers"
TypePushMessageContentChatChangePhoto = "pushMessageContentChatChangePhoto"
TypePushMessageContentChatChangeTitle = "pushMessageContentChatChangeTitle"
TypePushMessageContentChatSetTheme = "pushMessageContentChatSetTheme"
TypePushMessageContentChatDeleteMember = "pushMessageContentChatDeleteMember"
TypePushMessageContentChatJoinByLink = "pushMessageContentChatJoinByLink"
TypePushMessageContentChatJoinByRequest = "pushMessageContentChatJoinByRequest"
TypePushMessageContentMessageForwards = "pushMessageContentMessageForwards"
TypePushMessageContentMediaAlbum = "pushMessageContentMediaAlbum"
TypeNotificationTypeNewMessage = "notificationTypeNewMessage"
TypeNotificationTypeNewSecretChat = "notificationTypeNewSecretChat"
TypeNotificationTypeNewCall = "notificationTypeNewCall"
TypeNotificationTypeNewPushMessage = "notificationTypeNewPushMessage"
TypeNotificationGroupTypeMessages = "notificationGroupTypeMessages"
TypeNotificationGroupTypeMentions = "notificationGroupTypeMentions"
TypeNotificationGroupTypeSecretChat = "notificationGroupTypeSecretChat"
TypeNotificationGroupTypeCalls = "notificationGroupTypeCalls"
TypeNotification = "notification"
TypeNotificationGroup = "notificationGroup"
TypeOptionValueBoolean = "optionValueBoolean"
TypeOptionValueEmpty = "optionValueEmpty"
TypeOptionValueInteger = "optionValueInteger"
TypeOptionValueString = "optionValueString"
TypeJsonObjectMember = "jsonObjectMember"
TypeJsonValueNull = "jsonValueNull"
TypeJsonValueBoolean = "jsonValueBoolean"
TypeJsonValueNumber = "jsonValueNumber"
TypeJsonValueString = "jsonValueString"
TypeJsonValueArray = "jsonValueArray"
TypeJsonValueObject = "jsonValueObject"
TypeUserPrivacySettingRuleAllowAll = "userPrivacySettingRuleAllowAll"
TypeUserPrivacySettingRuleAllowContacts = "userPrivacySettingRuleAllowContacts"
TypeUserPrivacySettingRuleAllowUsers = "userPrivacySettingRuleAllowUsers"
TypeUserPrivacySettingRuleAllowChatMembers = "userPrivacySettingRuleAllowChatMembers"
TypeUserPrivacySettingRuleRestrictAll = "userPrivacySettingRuleRestrictAll"
TypeUserPrivacySettingRuleRestrictContacts = "userPrivacySettingRuleRestrictContacts"
TypeUserPrivacySettingRuleRestrictUsers = "userPrivacySettingRuleRestrictUsers"
TypeUserPrivacySettingRuleRestrictChatMembers = "userPrivacySettingRuleRestrictChatMembers"
TypeUserPrivacySettingRules = "userPrivacySettingRules"
TypeUserPrivacySettingShowStatus = "userPrivacySettingShowStatus"
TypeUserPrivacySettingShowProfilePhoto = "userPrivacySettingShowProfilePhoto"
TypeUserPrivacySettingShowLinkInForwardedMessages = "userPrivacySettingShowLinkInForwardedMessages"
TypeUserPrivacySettingShowPhoneNumber = "userPrivacySettingShowPhoneNumber"
TypeUserPrivacySettingAllowChatInvites = "userPrivacySettingAllowChatInvites"
TypeUserPrivacySettingAllowCalls = "userPrivacySettingAllowCalls"
TypeUserPrivacySettingAllowPeerToPeerCalls = "userPrivacySettingAllowPeerToPeerCalls"
TypeUserPrivacySettingAllowFindingByPhoneNumber = "userPrivacySettingAllowFindingByPhoneNumber"
TypeAccountTtl = "accountTtl"
TypeSession = "session"
TypeSessions = "sessions"
TypeConnectedWebsite = "connectedWebsite"
TypeConnectedWebsites = "connectedWebsites"
TypeChatReportReasonSpam = "chatReportReasonSpam"
TypeChatReportReasonViolence = "chatReportReasonViolence"
TypeChatReportReasonPornography = "chatReportReasonPornography"
TypeChatReportReasonChildAbuse = "chatReportReasonChildAbuse"
TypeChatReportReasonCopyright = "chatReportReasonCopyright"
TypeChatReportReasonUnrelatedLocation = "chatReportReasonUnrelatedLocation"
TypeChatReportReasonFake = "chatReportReasonFake"
TypeChatReportReasonIllegalDrugs = "chatReportReasonIllegalDrugs"
TypeChatReportReasonPersonalDetails = "chatReportReasonPersonalDetails"
TypeChatReportReasonCustom = "chatReportReasonCustom"
TypeInternalLinkTypeActiveSessions = "internalLinkTypeActiveSessions"
TypeInternalLinkTypeAuthenticationCode = "internalLinkTypeAuthenticationCode"
TypeInternalLinkTypeBackground = "internalLinkTypeBackground"
TypeInternalLinkTypeBotStart = "internalLinkTypeBotStart"
TypeInternalLinkTypeBotStartInGroup = "internalLinkTypeBotStartInGroup"
TypeInternalLinkTypeChangePhoneNumber = "internalLinkTypeChangePhoneNumber"
TypeInternalLinkTypeChatInvite = "internalLinkTypeChatInvite"
TypeInternalLinkTypeFilterSettings = "internalLinkTypeFilterSettings"
TypeInternalLinkTypeGame = "internalLinkTypeGame"
TypeInternalLinkTypeLanguagePack = "internalLinkTypeLanguagePack"
2022-03-31 08:54:35 +00:00
TypeInternalLinkTypeLanguageSettings = "internalLinkTypeLanguageSettings"
2022-03-13 04:04:12 +00:00
TypeInternalLinkTypeMessage = "internalLinkTypeMessage"
TypeInternalLinkTypeMessageDraft = "internalLinkTypeMessageDraft"
TypeInternalLinkTypePassportDataRequest = "internalLinkTypePassportDataRequest"
TypeInternalLinkTypePhoneNumberConfirmation = "internalLinkTypePhoneNumberConfirmation"
2022-03-31 08:54:35 +00:00
TypeInternalLinkTypePrivacyAndSecuritySettings = "internalLinkTypePrivacyAndSecuritySettings"
2022-03-13 04:04:12 +00:00
TypeInternalLinkTypeProxy = "internalLinkTypeProxy"
TypeInternalLinkTypePublicChat = "internalLinkTypePublicChat"
TypeInternalLinkTypeQrCodeAuthentication = "internalLinkTypeQrCodeAuthentication"
TypeInternalLinkTypeSettings = "internalLinkTypeSettings"
TypeInternalLinkTypeStickerSet = "internalLinkTypeStickerSet"
TypeInternalLinkTypeTheme = "internalLinkTypeTheme"
TypeInternalLinkTypeThemeSettings = "internalLinkTypeThemeSettings"
TypeInternalLinkTypeUnknownDeepLink = "internalLinkTypeUnknownDeepLink"
TypeInternalLinkTypeUnsupportedProxy = "internalLinkTypeUnsupportedProxy"
TypeInternalLinkTypeUserPhoneNumber = "internalLinkTypeUserPhoneNumber"
TypeInternalLinkTypeVideoChat = "internalLinkTypeVideoChat"
TypeMessageLink = "messageLink"
TypeMessageLinkInfo = "messageLinkInfo"
TypeFilePart = "filePart"
TypeFileTypeNone = "fileTypeNone"
TypeFileTypeAnimation = "fileTypeAnimation"
TypeFileTypeAudio = "fileTypeAudio"
TypeFileTypeDocument = "fileTypeDocument"
TypeFileTypePhoto = "fileTypePhoto"
TypeFileTypeProfilePhoto = "fileTypeProfilePhoto"
TypeFileTypeSecret = "fileTypeSecret"
TypeFileTypeSecretThumbnail = "fileTypeSecretThumbnail"
TypeFileTypeSecure = "fileTypeSecure"
TypeFileTypeSticker = "fileTypeSticker"
TypeFileTypeThumbnail = "fileTypeThumbnail"
TypeFileTypeUnknown = "fileTypeUnknown"
TypeFileTypeVideo = "fileTypeVideo"
TypeFileTypeVideoNote = "fileTypeVideoNote"
TypeFileTypeVoiceNote = "fileTypeVoiceNote"
TypeFileTypeWallpaper = "fileTypeWallpaper"
TypeStorageStatisticsByFileType = "storageStatisticsByFileType"
TypeStorageStatisticsByChat = "storageStatisticsByChat"
TypeStorageStatistics = "storageStatistics"
TypeStorageStatisticsFast = "storageStatisticsFast"
TypeDatabaseStatistics = "databaseStatistics"
TypeNetworkTypeNone = "networkTypeNone"
TypeNetworkTypeMobile = "networkTypeMobile"
TypeNetworkTypeMobileRoaming = "networkTypeMobileRoaming"
TypeNetworkTypeWiFi = "networkTypeWiFi"
TypeNetworkTypeOther = "networkTypeOther"
TypeNetworkStatisticsEntryFile = "networkStatisticsEntryFile"
TypeNetworkStatisticsEntryCall = "networkStatisticsEntryCall"
TypeNetworkStatistics = "networkStatistics"
TypeAutoDownloadSettings = "autoDownloadSettings"
TypeAutoDownloadSettingsPresets = "autoDownloadSettingsPresets"
TypeConnectionStateWaitingForNetwork = "connectionStateWaitingForNetwork"
TypeConnectionStateConnectingToProxy = "connectionStateConnectingToProxy"
TypeConnectionStateConnecting = "connectionStateConnecting"
TypeConnectionStateUpdating = "connectionStateUpdating"
TypeConnectionStateReady = "connectionStateReady"
TypeTopChatCategoryUsers = "topChatCategoryUsers"
TypeTopChatCategoryBots = "topChatCategoryBots"
TypeTopChatCategoryGroups = "topChatCategoryGroups"
TypeTopChatCategoryChannels = "topChatCategoryChannels"
TypeTopChatCategoryInlineBots = "topChatCategoryInlineBots"
TypeTopChatCategoryCalls = "topChatCategoryCalls"
TypeTopChatCategoryForwardChats = "topChatCategoryForwardChats"
TypeTMeUrlTypeUser = "tMeUrlTypeUser"
TypeTMeUrlTypeSupergroup = "tMeUrlTypeSupergroup"
TypeTMeUrlTypeChatInvite = "tMeUrlTypeChatInvite"
TypeTMeUrlTypeStickerSet = "tMeUrlTypeStickerSet"
TypeTMeUrl = "tMeUrl"
TypeTMeUrls = "tMeUrls"
TypeSuggestedActionEnableArchiveAndMuteNewChats = "suggestedActionEnableArchiveAndMuteNewChats"
TypeSuggestedActionCheckPassword = "suggestedActionCheckPassword"
TypeSuggestedActionCheckPhoneNumber = "suggestedActionCheckPhoneNumber"
TypeSuggestedActionViewChecksHint = "suggestedActionViewChecksHint"
TypeSuggestedActionConvertToBroadcastGroup = "suggestedActionConvertToBroadcastGroup"
TypeSuggestedActionSetPassword = "suggestedActionSetPassword"
TypeCount = "count"
TypeText = "text"
TypeSeconds = "seconds"
TypeDeepLinkInfo = "deepLinkInfo"
TypeTextParseModeMarkdown = "textParseModeMarkdown"
TypeTextParseModeHTML = "textParseModeHTML"
TypeProxyTypeSocks5 = "proxyTypeSocks5"
TypeProxyTypeHttp = "proxyTypeHttp"
TypeProxyTypeMtproto = "proxyTypeMtproto"
TypeProxy = "proxy"
TypeProxies = "proxies"
TypeInputSticker = "inputSticker"
TypeDateRange = "dateRange"
TypeStatisticalValue = "statisticalValue"
TypeStatisticalGraphData = "statisticalGraphData"
TypeStatisticalGraphAsync = "statisticalGraphAsync"
TypeStatisticalGraphError = "statisticalGraphError"
TypeChatStatisticsMessageInteractionInfo = "chatStatisticsMessageInteractionInfo"
TypeChatStatisticsMessageSenderInfo = "chatStatisticsMessageSenderInfo"
TypeChatStatisticsAdministratorActionsInfo = "chatStatisticsAdministratorActionsInfo"
TypeChatStatisticsInviterInfo = "chatStatisticsInviterInfo"
TypeChatStatisticsSupergroup = "chatStatisticsSupergroup"
TypeChatStatisticsChannel = "chatStatisticsChannel"
TypeMessageStatistics = "messageStatistics"
TypePoint = "point"
TypeVectorPathCommandLine = "vectorPathCommandLine"
TypeVectorPathCommandCubicBezierCurve = "vectorPathCommandCubicBezierCurve"
TypeBotCommandScopeDefault = "botCommandScopeDefault"
TypeBotCommandScopeAllPrivateChats = "botCommandScopeAllPrivateChats"
TypeBotCommandScopeAllGroupChats = "botCommandScopeAllGroupChats"
TypeBotCommandScopeAllChatAdministrators = "botCommandScopeAllChatAdministrators"
TypeBotCommandScopeChat = "botCommandScopeChat"
TypeBotCommandScopeChatAdministrators = "botCommandScopeChatAdministrators"
TypeBotCommandScopeChatMember = "botCommandScopeChatMember"
TypeUpdateAuthorizationState = "updateAuthorizationState"
TypeUpdateNewMessage = "updateNewMessage"
TypeUpdateMessageSendAcknowledged = "updateMessageSendAcknowledged"
TypeUpdateMessageSendSucceeded = "updateMessageSendSucceeded"
TypeUpdateMessageSendFailed = "updateMessageSendFailed"
TypeUpdateMessageContent = "updateMessageContent"
TypeUpdateMessageEdited = "updateMessageEdited"
TypeUpdateMessageIsPinned = "updateMessageIsPinned"
TypeUpdateMessageInteractionInfo = "updateMessageInteractionInfo"
TypeUpdateMessageContentOpened = "updateMessageContentOpened"
TypeUpdateMessageMentionRead = "updateMessageMentionRead"
TypeUpdateMessageUnreadReactions = "updateMessageUnreadReactions"
TypeUpdateMessageLiveLocationViewed = "updateMessageLiveLocationViewed"
TypeUpdateNewChat = "updateNewChat"
TypeUpdateChatTitle = "updateChatTitle"
TypeUpdateChatPhoto = "updateChatPhoto"
TypeUpdateChatPermissions = "updateChatPermissions"
TypeUpdateChatLastMessage = "updateChatLastMessage"
TypeUpdateChatPosition = "updateChatPosition"
TypeUpdateChatReadInbox = "updateChatReadInbox"
TypeUpdateChatReadOutbox = "updateChatReadOutbox"
TypeUpdateChatActionBar = "updateChatActionBar"
TypeUpdateChatAvailableReactions = "updateChatAvailableReactions"
TypeUpdateChatDraftMessage = "updateChatDraftMessage"
TypeUpdateChatMessageSender = "updateChatMessageSender"
TypeUpdateChatMessageTtl = "updateChatMessageTtl"
TypeUpdateChatNotificationSettings = "updateChatNotificationSettings"
TypeUpdateChatPendingJoinRequests = "updateChatPendingJoinRequests"
TypeUpdateChatReplyMarkup = "updateChatReplyMarkup"
TypeUpdateChatTheme = "updateChatTheme"
TypeUpdateChatUnreadMentionCount = "updateChatUnreadMentionCount"
TypeUpdateChatUnreadReactionCount = "updateChatUnreadReactionCount"
TypeUpdateChatVideoChat = "updateChatVideoChat"
TypeUpdateChatDefaultDisableNotification = "updateChatDefaultDisableNotification"
TypeUpdateChatHasProtectedContent = "updateChatHasProtectedContent"
TypeUpdateChatHasScheduledMessages = "updateChatHasScheduledMessages"
TypeUpdateChatIsBlocked = "updateChatIsBlocked"
TypeUpdateChatIsMarkedAsUnread = "updateChatIsMarkedAsUnread"
TypeUpdateChatFilters = "updateChatFilters"
TypeUpdateChatOnlineMemberCount = "updateChatOnlineMemberCount"
TypeUpdateScopeNotificationSettings = "updateScopeNotificationSettings"
TypeUpdateNotification = "updateNotification"
TypeUpdateNotificationGroup = "updateNotificationGroup"
TypeUpdateActiveNotifications = "updateActiveNotifications"
TypeUpdateHavePendingNotifications = "updateHavePendingNotifications"
TypeUpdateDeleteMessages = "updateDeleteMessages"
TypeUpdateChatAction = "updateChatAction"
TypeUpdateUserStatus = "updateUserStatus"
TypeUpdateUser = "updateUser"
TypeUpdateBasicGroup = "updateBasicGroup"
TypeUpdateSupergroup = "updateSupergroup"
TypeUpdateSecretChat = "updateSecretChat"
TypeUpdateUserFullInfo = "updateUserFullInfo"
TypeUpdateBasicGroupFullInfo = "updateBasicGroupFullInfo"
TypeUpdateSupergroupFullInfo = "updateSupergroupFullInfo"
TypeUpdateServiceNotification = "updateServiceNotification"
TypeUpdateFile = "updateFile"
TypeUpdateFileGenerationStart = "updateFileGenerationStart"
TypeUpdateFileGenerationStop = "updateFileGenerationStop"
TypeUpdateFileDownloads = "updateFileDownloads"
TypeUpdateFileAddedToDownloads = "updateFileAddedToDownloads"
TypeUpdateFileDownload = "updateFileDownload"
TypeUpdateFileRemovedFromDownloads = "updateFileRemovedFromDownloads"
TypeUpdateCall = "updateCall"
TypeUpdateGroupCall = "updateGroupCall"
TypeUpdateGroupCallParticipant = "updateGroupCallParticipant"
TypeUpdateNewCallSignalingData = "updateNewCallSignalingData"
TypeUpdateUserPrivacySettingRules = "updateUserPrivacySettingRules"
TypeUpdateUnreadMessageCount = "updateUnreadMessageCount"
TypeUpdateUnreadChatCount = "updateUnreadChatCount"
TypeUpdateOption = "updateOption"
TypeUpdateStickerSet = "updateStickerSet"
TypeUpdateInstalledStickerSets = "updateInstalledStickerSets"
TypeUpdateTrendingStickerSets = "updateTrendingStickerSets"
TypeUpdateRecentStickers = "updateRecentStickers"
TypeUpdateFavoriteStickers = "updateFavoriteStickers"
TypeUpdateSavedAnimations = "updateSavedAnimations"
TypeUpdateSelectedBackground = "updateSelectedBackground"
TypeUpdateChatThemes = "updateChatThemes"
TypeUpdateLanguagePackStrings = "updateLanguagePackStrings"
TypeUpdateConnectionState = "updateConnectionState"
TypeUpdateTermsOfService = "updateTermsOfService"
TypeUpdateUsersNearby = "updateUsersNearby"
TypeUpdateReactions = "updateReactions"
TypeUpdateDiceEmojis = "updateDiceEmojis"
TypeUpdateAnimatedEmojiMessageClicked = "updateAnimatedEmojiMessageClicked"
TypeUpdateAnimationSearchParameters = "updateAnimationSearchParameters"
TypeUpdateSuggestedActions = "updateSuggestedActions"
TypeUpdateNewInlineQuery = "updateNewInlineQuery"
TypeUpdateNewChosenInlineResult = "updateNewChosenInlineResult"
TypeUpdateNewCallbackQuery = "updateNewCallbackQuery"
TypeUpdateNewInlineCallbackQuery = "updateNewInlineCallbackQuery"
TypeUpdateNewShippingQuery = "updateNewShippingQuery"
TypeUpdateNewPreCheckoutQuery = "updateNewPreCheckoutQuery"
TypeUpdateNewCustomEvent = "updateNewCustomEvent"
TypeUpdateNewCustomQuery = "updateNewCustomQuery"
TypeUpdatePoll = "updatePoll"
TypeUpdatePollAnswer = "updatePollAnswer"
TypeUpdateChatMember = "updateChatMember"
TypeUpdateNewChatJoinRequest = "updateNewChatJoinRequest"
TypeUpdates = "updates"
TypeLogStreamDefault = "logStreamDefault"
TypeLogStreamFile = "logStreamFile"
TypeLogStreamEmpty = "logStreamEmpty"
TypeLogVerbosityLevel = "logVerbosityLevel"
TypeLogTags = "logTags"
TypeTestInt = "testInt"
TypeTestString = "testString"
TypeTestBytes = "testBytes"
TypeTestVectorInt = "testVectorInt"
TypeTestVectorIntObject = "testVectorIntObject"
TypeTestVectorString = "testVectorString"
TypeTestVectorStringObject = "testVectorStringObject"
2018-08-30 14:55:42 +00:00
)
// Provides information about the method by which an authentication code is delivered to the user
type AuthenticationCodeType interface {
2022-03-13 04:04:12 +00:00
AuthenticationCodeTypeType() string
2018-08-30 14:55:42 +00:00
}
2020-11-30 09:33:47 +00:00
// Represents the current authorization state of the TDLib client
2018-08-30 14:55:42 +00:00
type AuthorizationState interface {
2022-03-13 04:04:12 +00:00
AuthorizationStateType() string
2018-08-30 14:55:42 +00:00
}
// Points to a file
type InputFile interface {
2022-03-13 04:04:12 +00:00
InputFileType() string
2018-08-30 14:55:42 +00:00
}
2022-02-06 18:36:17 +00:00
// Describes format of a thumbnail
2020-11-30 09:33:47 +00:00
type ThumbnailFormat interface {
2022-03-13 04:04:12 +00:00
ThumbnailFormatType() string
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
// Part of the face, relative to which a mask is placed
2018-08-30 14:55:42 +00:00
type MaskPoint interface {
2022-03-13 04:04:12 +00:00
MaskPointType() string
2018-08-30 14:55:42 +00:00
}
2022-02-06 18:36:17 +00:00
// Describes type of a sticker
type StickerType interface {
2022-03-13 04:04:12 +00:00
StickerTypeType() string
2022-02-06 18:36:17 +00:00
}
2020-02-03 12:56:20 +00:00
// Describes the type of a poll
type PollType interface {
2022-03-13 04:04:12 +00:00
PollTypeType() string
2018-08-30 14:55:42 +00:00
}
2020-02-03 12:56:20 +00:00
// Represents the type of a user. The following types are possible: regular users, deleted users and bots
2018-08-30 14:55:42 +00:00
type UserType interface {
2022-03-13 04:04:12 +00:00
UserTypeType() string
2018-08-30 14:55:42 +00:00
}
2020-11-30 09:33:47 +00:00
// Describes a photo to be set as a user profile or chat photo
type InputChatPhoto interface {
2022-03-13 04:04:12 +00:00
InputChatPhotoType() string
2020-11-30 09:33:47 +00:00
}
2018-08-30 14:55:42 +00:00
// Provides information about the status of a member in a chat
type ChatMemberStatus interface {
2022-03-13 04:04:12 +00:00
ChatMemberStatusType() string
2018-08-30 14:55:42 +00:00
}
2018-09-05 21:45:29 +00:00
// Specifies the kind of chat members to return in searchChatMembers
type ChatMembersFilter interface {
2022-03-13 04:04:12 +00:00
ChatMembersFilterType() string
2018-09-05 21:45:29 +00:00
}
2018-08-30 14:55:42 +00:00
// Specifies the kind of chat members to return in getSupergroupMembers
type SupergroupMembersFilter interface {
2022-03-13 04:04:12 +00:00
SupergroupMembersFilterType() string
2018-08-30 14:55:42 +00:00
}
// Describes the current secret chat state
type SecretChatState interface {
2022-03-13 04:04:12 +00:00
SecretChatStateType() string
2018-08-30 14:55:42 +00:00
}
2020-11-30 09:33:47 +00:00
// Contains information about the sender of a message
type MessageSender interface {
2022-03-13 04:04:12 +00:00
MessageSenderType() string
2020-11-30 09:33:47 +00:00
}
2019-06-07 10:56:06 +00:00
// Contains information about the origin of a forwarded message
type MessageForwardOrigin interface {
2022-03-13 04:04:12 +00:00
MessageForwardOriginType() string
2018-08-30 14:55:42 +00:00
}
// Contains information about the sending state of the message
type MessageSendingState interface {
2022-03-13 04:04:12 +00:00
MessageSendingStateType() string
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// Describes the types of chats to which notification settings are relevant
2018-08-30 14:55:42 +00:00
type NotificationSettingsScope interface {
2022-03-13 04:04:12 +00:00
NotificationSettingsScopeType() string
2018-08-30 14:55:42 +00:00
}
// Describes the type of a chat
type ChatType interface {
2022-03-13 04:04:12 +00:00
ChatTypeType() string
2018-08-30 14:55:42 +00:00
}
2020-02-03 12:56:20 +00:00
// Describes a list of chats
type ChatList interface {
2022-03-13 04:04:12 +00:00
ChatListType() string
2020-02-03 12:56:20 +00:00
}
2020-11-30 09:33:47 +00:00
// Describes a reason why an external chat is shown in a chat list
type ChatSource interface {
2022-03-13 04:04:12 +00:00
ChatSourceType() string
2020-11-30 09:33:47 +00:00
}
2020-02-03 12:56:20 +00:00
// Describes a type of public chats
type PublicChatType interface {
2022-03-13 04:04:12 +00:00
PublicChatTypeType() string
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
// Describes actions which must be possible to do through a chat action bar
2020-02-03 12:56:20 +00:00
type ChatActionBar interface {
2022-03-13 04:04:12 +00:00
ChatActionBarType() string
2020-02-03 12:56:20 +00:00
}
2018-08-30 14:55:42 +00:00
// Describes a keyboard button type
type KeyboardButtonType interface {
2022-03-13 04:04:12 +00:00
KeyboardButtonTypeType() string
2018-08-30 14:55:42 +00:00
}
// Describes the type of an inline keyboard button
type InlineKeyboardButtonType interface {
2022-03-13 04:04:12 +00:00
InlineKeyboardButtonTypeType() string
2018-08-30 14:55:42 +00:00
}
// Contains a description of a custom keyboard and actions that can be done with it to quickly reply to bots
type ReplyMarkup interface {
2022-03-13 04:04:12 +00:00
ReplyMarkupType() string
2018-08-30 14:55:42 +00:00
}
2020-02-03 12:56:20 +00:00
// Contains information about an inline button of type inlineKeyboardButtonTypeLoginUrl
type LoginUrlInfo interface {
2022-03-13 04:04:12 +00:00
LoginUrlInfoType() string
2020-02-03 12:56:20 +00:00
}
2018-08-30 14:55:42 +00:00
// Describes a text object inside an instant-view web page
type RichText interface {
2022-03-13 04:04:12 +00:00
RichTextType() string
2018-08-30 14:55:42 +00:00
}
2019-06-07 10:56:06 +00:00
// Describes a horizontal alignment of a table cell content
type PageBlockHorizontalAlignment interface {
2022-03-13 04:04:12 +00:00
PageBlockHorizontalAlignmentType() string
2019-06-07 10:56:06 +00:00
}
// Describes a Vertical alignment of a table cell content
type PageBlockVerticalAlignment interface {
2022-03-13 04:04:12 +00:00
PageBlockVerticalAlignmentType() string
2019-06-07 10:56:06 +00:00
}
2018-08-30 14:55:42 +00:00
// Describes a block of an instant view web page
type PageBlock interface {
2022-03-13 04:04:12 +00:00
PageBlockType() string
2018-08-30 14:55:42 +00:00
}
// Contains information about the payment method chosen by the user
type InputCredentials interface {
2022-03-13 04:04:12 +00:00
InputCredentialsType() string
2018-08-30 14:55:42 +00:00
}
2018-09-05 21:45:29 +00:00
// Contains the type of a Telegram Passport element
type PassportElementType interface {
2022-03-13 04:04:12 +00:00
PassportElementTypeType() string
2018-09-05 21:45:29 +00:00
}
// Contains information about a Telegram Passport element
type PassportElement interface {
2022-03-13 04:04:12 +00:00
PassportElementType() string
2018-09-05 21:45:29 +00:00
}
// Contains information about a Telegram Passport element to be saved
type InputPassportElement interface {
2022-03-13 04:04:12 +00:00
InputPassportElementType() string
2018-09-05 21:45:29 +00:00
}
// Contains the description of an error in a Telegram Passport element
type PassportElementErrorSource interface {
2022-03-13 04:04:12 +00:00
PassportElementErrorSourceType() string
2018-09-05 21:45:29 +00:00
}
// Contains the description of an error in a Telegram Passport element; for bots only
type InputPassportElementErrorSource interface {
2022-03-13 04:04:12 +00:00
InputPassportElementErrorSourceType() string
2018-09-05 21:45:29 +00:00
}
2018-08-30 14:55:42 +00:00
// Contains the content of a message
type MessageContent interface {
2022-03-13 04:04:12 +00:00
MessageContentType() string
2018-08-30 14:55:42 +00:00
}
// Represents a part of the text which must be formatted differently
type TextEntityType interface {
2022-03-13 04:04:12 +00:00
TextEntityTypeType() string
2018-08-30 14:55:42 +00:00
}
2020-02-03 12:56:20 +00:00
// Contains information about the time when a scheduled message will be sent
type MessageSchedulingState interface {
2022-03-13 04:04:12 +00:00
MessageSchedulingStateType() string
2020-02-03 12:56:20 +00:00
}
2018-08-30 14:55:42 +00:00
// The content of a message to send
type InputMessageContent interface {
2022-03-13 04:04:12 +00:00
InputMessageContentType() string
2018-08-30 14:55:42 +00:00
}
// Represents a filter for message search results
type SearchMessagesFilter interface {
2022-03-13 04:04:12 +00:00
SearchMessagesFilterType() string
2018-08-30 14:55:42 +00:00
}
// Describes the different types of activity in a chat
type ChatAction interface {
2022-03-13 04:04:12 +00:00
ChatActionType() string
2018-08-30 14:55:42 +00:00
}
// Describes the last time the user was online
type UserStatus interface {
2022-03-13 04:04:12 +00:00
UserStatusType() string
2018-08-30 14:55:42 +00:00
}
// Describes the reason why a call was discarded
type CallDiscardReason interface {
2022-03-13 04:04:12 +00:00
CallDiscardReasonType() string
2018-08-30 14:55:42 +00:00
}
2020-11-30 09:33:47 +00:00
// Describes the type of a call server
type CallServerType interface {
2022-03-13 04:04:12 +00:00
CallServerTypeType() string
2020-11-30 09:33:47 +00:00
}
2018-08-30 14:55:42 +00:00
// Describes the current call state
type CallState interface {
2022-03-13 04:04:12 +00:00
CallStateType() string
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// Describes the quality of a group call video
type GroupCallVideoQuality interface {
2022-03-13 04:04:12 +00:00
GroupCallVideoQualityType() string
2021-12-30 05:55:02 +00:00
}
2019-09-10 12:36:54 +00:00
// Describes the exact type of a problem with a call
type CallProblem interface {
2022-03-13 04:04:12 +00:00
CallProblemType() string
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
// Contains animated stickers which must be used for dice animation rendering
2020-11-30 09:33:47 +00:00
type DiceStickers interface {
2022-03-13 04:04:12 +00:00
DiceStickersType() string
2020-11-30 09:33:47 +00:00
}
2018-08-30 14:55:42 +00:00
// Represents a single result of an inline query; for bots only
type InputInlineQueryResult interface {
2022-03-13 04:04:12 +00:00
InputInlineQueryResultType() string
2018-08-30 14:55:42 +00:00
}
// Represents a single result of an inline query
type InlineQueryResult interface {
2022-03-13 04:04:12 +00:00
InlineQueryResultType() string
2018-08-30 14:55:42 +00:00
}
// Represents a payload of a callback query
type CallbackQueryPayload interface {
2022-03-13 04:04:12 +00:00
CallbackQueryPayloadType() string
2018-08-30 14:55:42 +00:00
}
// Represents a chat event
type ChatEventAction interface {
2022-03-13 04:04:12 +00:00
ChatEventActionType() string
2018-08-30 14:55:42 +00:00
}
2018-09-05 21:45:29 +00:00
// Represents the value of a string in a language pack
type LanguagePackStringValue interface {
2022-03-13 04:04:12 +00:00
LanguagePackStringValueType() string
2018-09-05 21:45:29 +00:00
}
2020-11-30 09:33:47 +00:00
// Represents a data needed to subscribe for push notifications through registerDevice method. To use specific push notification service, the correct application platform must be specified and a valid server authentication data must be uploaded at https://my.telegram.org
2018-08-30 14:55:42 +00:00
type DeviceToken interface {
2022-03-13 04:04:12 +00:00
DeviceTokenType() string
2018-08-30 14:55:42 +00:00
}
2020-02-03 12:56:20 +00:00
// Describes a fill of a background
type BackgroundFill interface {
2022-03-13 04:04:12 +00:00
BackgroundFillType() string
2020-02-03 12:56:20 +00:00
}
// Describes the type of a background
2019-09-10 12:36:54 +00:00
type BackgroundType interface {
2022-03-13 04:04:12 +00:00
BackgroundTypeType() string
2019-09-10 12:36:54 +00:00
}
// Contains information about background to set
type InputBackground interface {
2022-03-13 04:04:12 +00:00
InputBackgroundType() string
2019-09-10 12:36:54 +00:00
}
2020-02-03 12:56:20 +00:00
// Represents result of checking whether the current session can be used to transfer a chat ownership to another user
type CanTransferOwnershipResult interface {
2022-03-13 04:04:12 +00:00
CanTransferOwnershipResultType() string
2020-02-03 12:56:20 +00:00
}
2018-08-30 14:55:42 +00:00
// Represents result of checking whether a username can be set for a chat
type CheckChatUsernameResult interface {
2022-03-13 04:04:12 +00:00
CheckChatUsernameResultType() string
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// Represents result of checking whether a name can be used for a new sticker set
type CheckStickerSetNameResult interface {
2022-03-13 04:04:12 +00:00
CheckStickerSetNameResultType() string
2021-12-30 05:55:02 +00:00
}
// Represents result of 2-step verification password reset
type ResetPasswordResult interface {
2022-03-13 04:04:12 +00:00
ResetPasswordResultType() string
2021-12-30 05:55:02 +00:00
}
// Contains information about a file with messages exported from another app
type MessageFileType interface {
2022-03-13 04:04:12 +00:00
MessageFileTypeType() string
2021-12-30 05:55:02 +00:00
}
2019-06-07 10:56:06 +00:00
// Contains content of a push message notification
type PushMessageContent interface {
2022-03-13 04:04:12 +00:00
PushMessageContentType() string
2019-06-07 10:56:06 +00:00
}
// Contains detailed information about a notification
type NotificationType interface {
2022-03-13 04:04:12 +00:00
NotificationTypeType() string
2019-06-07 10:56:06 +00:00
}
2020-02-03 12:56:20 +00:00
// Describes the type of notifications in a notification group
2019-06-07 10:56:06 +00:00
type NotificationGroupType interface {
2022-03-13 04:04:12 +00:00
NotificationGroupTypeType() string
2019-06-07 10:56:06 +00:00
}
2018-08-30 14:55:42 +00:00
// Represents the value of an option
type OptionValue interface {
2022-03-13 04:04:12 +00:00
OptionValueType() string
2018-08-30 14:55:42 +00:00
}
2019-06-07 10:56:06 +00:00
// Represents a JSON value
type JsonValue interface {
2022-03-13 04:04:12 +00:00
JsonValueType() string
2019-06-07 10:56:06 +00:00
}
2018-08-30 14:55:42 +00:00
// Represents a single rule for managing privacy settings
type UserPrivacySettingRule interface {
2022-03-13 04:04:12 +00:00
UserPrivacySettingRuleType() string
2018-08-30 14:55:42 +00:00
}
// Describes available user privacy settings
type UserPrivacySetting interface {
2022-03-13 04:04:12 +00:00
UserPrivacySettingType() string
2018-08-30 14:55:42 +00:00
}
// Describes the reason why a chat is reported
type ChatReportReason interface {
2022-03-13 04:04:12 +00:00
ChatReportReasonType() string
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// Describes an internal https://t.me or tg: link, which must be processed by the app in a special way
type InternalLinkType interface {
2022-03-13 04:04:12 +00:00
InternalLinkTypeType() string
2021-12-30 05:55:02 +00:00
}
2018-08-30 14:55:42 +00:00
// Represents the type of a file
type FileType interface {
2022-03-13 04:04:12 +00:00
FileTypeType() string
2018-08-30 14:55:42 +00:00
}
// Represents the type of a network
type NetworkType interface {
2022-03-13 04:04:12 +00:00
NetworkTypeType() string
2018-08-30 14:55:42 +00:00
}
// Contains statistics about network usage
type NetworkStatisticsEntry interface {
2022-03-13 04:04:12 +00:00
NetworkStatisticsEntryType() string
2018-08-30 14:55:42 +00:00
}
// Describes the current state of the connection to Telegram servers
type ConnectionState interface {
2022-03-13 04:04:12 +00:00
ConnectionStateType() string
2018-08-30 14:55:42 +00:00
}
// Represents the categories of chats for which a list of frequently used chats can be retrieved
type TopChatCategory interface {
2022-03-13 04:04:12 +00:00
TopChatCategoryType() string
2018-08-30 14:55:42 +00:00
}
// Describes the type of a URL linking to an internal Telegram entity
type TMeUrlType interface {
2022-03-13 04:04:12 +00:00
TMeUrlTypeType() string
2018-08-30 14:55:42 +00:00
}
2020-11-30 09:33:47 +00:00
// Describes an action suggested to the current user
type SuggestedAction interface {
2022-03-13 04:04:12 +00:00
SuggestedActionType() string
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
// Describes the way the text needs to be parsed for TextEntities
2018-08-30 14:55:42 +00:00
type TextParseMode interface {
2022-03-13 04:04:12 +00:00
TextParseModeType() string
2018-08-30 14:55:42 +00:00
}
2020-02-03 12:56:20 +00:00
// Describes the type of a proxy server
2018-09-05 21:45:29 +00:00
type ProxyType interface {
2022-03-13 04:04:12 +00:00
ProxyTypeType() string
2018-08-30 14:55:42 +00:00
}
2020-11-30 09:33:47 +00:00
// Describes a statistical graph
type StatisticalGraph interface {
2022-03-13 04:04:12 +00:00
StatisticalGraphType() string
2020-11-30 09:33:47 +00:00
}
// Contains a detailed statistics about a chat
type ChatStatistics interface {
2022-03-13 04:04:12 +00:00
ChatStatisticsType() string
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
// Represents a vector path command
type VectorPathCommand interface {
2022-03-13 04:04:12 +00:00
VectorPathCommandType() string
2021-12-30 05:55:02 +00:00
}
// Represents the scope to which bot commands are relevant
type BotCommandScope interface {
2022-03-13 04:04:12 +00:00
BotCommandScopeType() string
2021-12-30 05:55:02 +00:00
}
2018-08-30 14:55:42 +00:00
// Contains notifications about data changes
type Update interface {
2022-03-13 04:04:12 +00:00
UpdateType() string
2018-08-30 14:55:42 +00:00
}
2019-06-07 10:56:06 +00:00
// Describes a stream to which TDLib internal log is written
type LogStream interface {
2022-03-13 04:04:12 +00:00
LogStreamType() string
2019-06-07 10:56:06 +00:00
}
2018-08-30 14:55:42 +00:00
// An object of this type can be returned on every function call, in case of an error
type Error struct {
2022-03-13 04:04:12 +00:00
meta
// Error code; subject to future changes. If the error code is 406, the error message must not be processed in any way and must not be displayed to the user
Code int32 `json:"code"`
// Error message; subject to future changes
Message string `json:"message"`
2018-08-30 14:55:42 +00:00
}
func (entity *Error) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub Error
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*Error) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassError
2018-08-30 14:55:42 +00:00
}
func (*Error) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeError
2018-08-30 14:55:42 +00:00
}
// An object of this type is returned on a successful function call for certain functions
2022-03-13 04:04:12 +00:00
type Ok struct{
meta
2018-08-30 14:55:42 +00:00
}
func (entity *Ok) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub Ok
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*Ok) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassOk
2018-08-30 14:55:42 +00:00
}
func (*Ok) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeOk
2018-08-30 14:55:42 +00:00
}
// Contains parameters for TDLib initialization
type TdlibParameters struct {
2022-03-13 04:04:12 +00:00
meta
// If set to true, the Telegram test environment will be used instead of the production environment
UseTestDc bool `json:"use_test_dc"`
// The path to the directory for the persistent database; if empty, the current working directory will be used
DatabaseDirectory string `json:"database_directory"`
// The path to the directory for storing files; if empty, database_directory will be used
FilesDirectory string `json:"files_directory"`
// If set to true, information about downloaded and uploaded files will be saved between application restarts
UseFileDatabase bool `json:"use_file_database"`
// If set to true, the library will maintain a cache of users, basic groups, supergroups, channels and secret chats. Implies use_file_database
UseChatInfoDatabase bool `json:"use_chat_info_database"`
// If set to true, the library will maintain a cache of chats and messages. Implies use_chat_info_database
UseMessageDatabase bool `json:"use_message_database"`
// If set to true, support for secret chats will be enabled
UseSecretChats bool `json:"use_secret_chats"`
// Application identifier for Telegram API access, which can be obtained at https://my.telegram.org
ApiId int32 `json:"api_id"`
// Application identifier hash for Telegram API access, which can be obtained at https://my.telegram.org
ApiHash string `json:"api_hash"`
// IETF language tag of the user's operating system language; must be non-empty
SystemLanguageCode string `json:"system_language_code"`
// Model of the device the application is being run on; must be non-empty
DeviceModel string `json:"device_model"`
// Version of the operating system the application is being run on. If empty, the version is automatically detected by TDLib
SystemVersion string `json:"system_version"`
// Application version; must be non-empty
ApplicationVersion string `json:"application_version"`
// If set to true, old files will automatically be deleted
EnableStorageOptimizer bool `json:"enable_storage_optimizer"`
// If set to true, original file names will be ignored. Otherwise, downloaded files will be saved under names as close as possible to the original name
IgnoreFileNames bool `json:"ignore_file_names"`
2018-08-30 14:55:42 +00:00
}
func (entity *TdlibParameters) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub TdlibParameters
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*TdlibParameters) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassTdlibParameters
2018-08-30 14:55:42 +00:00
}
func (*TdlibParameters) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeTdlibParameters
2018-08-30 14:55:42 +00:00
}
2020-11-30 09:33:47 +00:00
// An authentication code is delivered via a private Telegram message, which can be viewed from another active session
2018-08-30 14:55:42 +00:00
type AuthenticationCodeTypeTelegramMessage struct {
2022-03-13 04:04:12 +00:00
meta
// Length of the code
Length int32 `json:"length"`
2018-08-30 14:55:42 +00:00
}
func (entity *AuthenticationCodeTypeTelegramMessage) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub AuthenticationCodeTypeTelegramMessage
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*AuthenticationCodeTypeTelegramMessage) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassAuthenticationCodeType
2018-08-30 14:55:42 +00:00
}
func (*AuthenticationCodeTypeTelegramMessage) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeAuthenticationCodeTypeTelegramMessage
2018-08-30 14:55:42 +00:00
}
func (*AuthenticationCodeTypeTelegramMessage) AuthenticationCodeTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeAuthenticationCodeTypeTelegramMessage
2018-08-30 14:55:42 +00:00
}
// An authentication code is delivered via an SMS message to the specified phone number
type AuthenticationCodeTypeSms struct {
2022-03-13 04:04:12 +00:00
meta
// Length of the code
Length int32 `json:"length"`
2018-08-30 14:55:42 +00:00
}
func (entity *AuthenticationCodeTypeSms) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub AuthenticationCodeTypeSms
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*AuthenticationCodeTypeSms) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassAuthenticationCodeType
2018-08-30 14:55:42 +00:00
}
func (*AuthenticationCodeTypeSms) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeAuthenticationCodeTypeSms
2018-08-30 14:55:42 +00:00
}
func (*AuthenticationCodeTypeSms) AuthenticationCodeTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeAuthenticationCodeTypeSms
2018-08-30 14:55:42 +00:00
}
// An authentication code is delivered via a phone call to the specified phone number
type AuthenticationCodeTypeCall struct {
2022-03-13 04:04:12 +00:00
meta
// Length of the code
Length int32 `json:"length"`
2018-08-30 14:55:42 +00:00
}
func (entity *AuthenticationCodeTypeCall) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub AuthenticationCodeTypeCall
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*AuthenticationCodeTypeCall) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassAuthenticationCodeType
2018-08-30 14:55:42 +00:00
}
func (*AuthenticationCodeTypeCall) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeAuthenticationCodeTypeCall
2018-08-30 14:55:42 +00:00
}
func (*AuthenticationCodeTypeCall) AuthenticationCodeTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeAuthenticationCodeTypeCall
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// An authentication code is delivered by an immediately canceled call to the specified phone number. The phone number that calls is the code that must be entered automatically
2018-08-30 14:55:42 +00:00
type AuthenticationCodeTypeFlashCall struct {
2022-03-13 04:04:12 +00:00
meta
// Pattern of the phone number from which the call will be made
Pattern string `json:"pattern"`
2018-08-30 14:55:42 +00:00
}
func (entity *AuthenticationCodeTypeFlashCall) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub AuthenticationCodeTypeFlashCall
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*AuthenticationCodeTypeFlashCall) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassAuthenticationCodeType
2018-08-30 14:55:42 +00:00
}
func (*AuthenticationCodeTypeFlashCall) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeAuthenticationCodeTypeFlashCall
2018-08-30 14:55:42 +00:00
}
func (*AuthenticationCodeTypeFlashCall) AuthenticationCodeTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeAuthenticationCodeTypeFlashCall
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// An authentication code is delivered by an immediately canceled call to the specified phone number. The last digits of the phone number that calls are the code that must be entered manually by the user
type AuthenticationCodeTypeMissedCall struct {
2022-03-13 04:04:12 +00:00
meta
// Prefix of the phone number from which the call will be made
PhoneNumberPrefix string `json:"phone_number_prefix"`
// Number of digits in the code, excluding the prefix
Length int32 `json:"length"`
2021-12-30 05:55:02 +00:00
}
func (entity *AuthenticationCodeTypeMissedCall) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub AuthenticationCodeTypeMissedCall
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*AuthenticationCodeTypeMissedCall) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassAuthenticationCodeType
2021-12-30 05:55:02 +00:00
}
func (*AuthenticationCodeTypeMissedCall) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeAuthenticationCodeTypeMissedCall
2021-12-30 05:55:02 +00:00
}
func (*AuthenticationCodeTypeMissedCall) AuthenticationCodeTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeAuthenticationCodeTypeMissedCall
2021-12-30 05:55:02 +00:00
}
2018-08-30 14:55:42 +00:00
// Information about the authentication code that was sent
type AuthenticationCodeInfo struct {
2022-03-13 04:04:12 +00:00
meta
// A phone number that is being authenticated
PhoneNumber string `json:"phone_number"`
// The way the code was sent to the user
Type AuthenticationCodeType `json:"type"`
// The way the next code will be sent to the user; may be null
NextType AuthenticationCodeType `json:"next_type"`
// Timeout before the code can be re-sent, in seconds
Timeout int32 `json:"timeout"`
2018-08-30 14:55:42 +00:00
}
func (entity *AuthenticationCodeInfo) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub AuthenticationCodeInfo
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*AuthenticationCodeInfo) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassAuthenticationCodeInfo
2018-08-30 14:55:42 +00:00
}
func (*AuthenticationCodeInfo) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeAuthenticationCodeInfo
2018-08-30 14:55:42 +00:00
}
func (authenticationCodeInfo *AuthenticationCodeInfo) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
PhoneNumber string `json:"phone_number"`
Type json.RawMessage `json:"type"`
NextType json.RawMessage `json:"next_type"`
Timeout int32 `json:"timeout"`
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
authenticationCodeInfo.PhoneNumber = tmp.PhoneNumber
authenticationCodeInfo.Timeout = tmp.Timeout
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
fieldType, _ := UnmarshalAuthenticationCodeType(tmp.Type)
authenticationCodeInfo.Type = fieldType
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
fieldNextType, _ := UnmarshalAuthenticationCodeType(tmp.NextType)
authenticationCodeInfo.NextType = fieldNextType
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return nil
2018-08-30 14:55:42 +00:00
}
2018-09-05 21:45:29 +00:00
// Information about the email address authentication code that was sent
type EmailAddressAuthenticationCodeInfo struct {
2022-03-13 04:04:12 +00:00
meta
// Pattern of the email address to which an authentication code was sent
EmailAddressPattern string `json:"email_address_pattern"`
// Length of the code; 0 if unknown
Length int32 `json:"length"`
2018-09-05 21:45:29 +00:00
}
func (entity *EmailAddressAuthenticationCodeInfo) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub EmailAddressAuthenticationCodeInfo
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
func (*EmailAddressAuthenticationCodeInfo) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassEmailAddressAuthenticationCodeInfo
2018-09-05 21:45:29 +00:00
}
func (*EmailAddressAuthenticationCodeInfo) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeEmailAddressAuthenticationCodeInfo
2018-09-05 21:45:29 +00:00
}
// Represents a part of the text that needs to be formatted in some unusual way
type TextEntity struct {
2022-03-13 04:04:12 +00:00
meta
// Offset of the entity, in UTF-16 code units
Offset int32 `json:"offset"`
// Length of the entity, in UTF-16 code units
Length int32 `json:"length"`
// Type of the entity
Type TextEntityType `json:"type"`
2018-09-05 21:45:29 +00:00
}
func (entity *TextEntity) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub TextEntity
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
func (*TextEntity) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassTextEntity
2018-09-05 21:45:29 +00:00
}
func (*TextEntity) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeTextEntity
2018-09-05 21:45:29 +00:00
}
func (textEntity *TextEntity) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Offset int32 `json:"offset"`
Length int32 `json:"length"`
Type json.RawMessage `json:"type"`
}
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
textEntity.Offset = tmp.Offset
textEntity.Length = tmp.Length
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
fieldType, _ := UnmarshalTextEntityType(tmp.Type)
textEntity.Type = fieldType
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return nil
2018-09-05 21:45:29 +00:00
}
// Contains a list of text entities
type TextEntities struct {
2022-03-13 04:04:12 +00:00
meta
// List of text entities
Entities []*TextEntity `json:"entities"`
2018-09-05 21:45:29 +00:00
}
func (entity *TextEntities) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub TextEntities
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
func (*TextEntities) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassTextEntities
2018-09-05 21:45:29 +00:00
}
func (*TextEntities) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeTextEntities
2018-09-05 21:45:29 +00:00
}
// A text with some entities
type FormattedText struct {
2022-03-13 04:04:12 +00:00
meta
// The text
Text string `json:"text"`
// Entities contained in the text. Entities can be nested, but must not mutually intersect with each other. Pre, Code and PreCode entities can't contain other entities. Bold, Italic, Underline, Strikethrough, and Spoiler entities can contain and to be contained in all other entities. All other entities can't contain each other
Entities []*TextEntity `json:"entities"`
2018-09-05 21:45:29 +00:00
}
func (entity *FormattedText) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub FormattedText
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
func (*FormattedText) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassFormattedText
2018-09-05 21:45:29 +00:00
}
func (*FormattedText) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeFormattedText
2018-09-05 21:45:29 +00:00
}
// Contains Telegram terms of service
type TermsOfService struct {
2022-03-13 04:04:12 +00:00
meta
// Text of the terms of service
Text *FormattedText `json:"text"`
// The minimum age of a user to be able to accept the terms; 0 if age isn't restricted
MinUserAge int32 `json:"min_user_age"`
// True, if a blocking popup with terms of service must be shown to the user
ShowPopup bool `json:"show_popup"`
2018-09-05 21:45:29 +00:00
}
func (entity *TermsOfService) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub TermsOfService
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
func (*TermsOfService) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassTermsOfService
2018-09-05 21:45:29 +00:00
}
func (*TermsOfService) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeTermsOfService
2018-09-05 21:45:29 +00:00
}
2018-08-30 14:55:42 +00:00
// TDLib needs TdlibParameters for initialization
2022-03-13 04:04:12 +00:00
type AuthorizationStateWaitTdlibParameters struct{
meta
2018-08-30 14:55:42 +00:00
}
func (entity *AuthorizationStateWaitTdlibParameters) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub AuthorizationStateWaitTdlibParameters
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*AuthorizationStateWaitTdlibParameters) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassAuthorizationState
2018-08-30 14:55:42 +00:00
}
func (*AuthorizationStateWaitTdlibParameters) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeAuthorizationStateWaitTdlibParameters
2018-08-30 14:55:42 +00:00
}
func (*AuthorizationStateWaitTdlibParameters) AuthorizationStateType() string {
2022-03-13 04:04:12 +00:00
return TypeAuthorizationStateWaitTdlibParameters
2018-08-30 14:55:42 +00:00
}
// TDLib needs an encryption key to decrypt the local database
type AuthorizationStateWaitEncryptionKey struct {
2022-03-13 04:04:12 +00:00
meta
// True, if the database is currently encrypted
IsEncrypted bool `json:"is_encrypted"`
2018-08-30 14:55:42 +00:00
}
func (entity *AuthorizationStateWaitEncryptionKey) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub AuthorizationStateWaitEncryptionKey
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*AuthorizationStateWaitEncryptionKey) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassAuthorizationState
2018-08-30 14:55:42 +00:00
}
func (*AuthorizationStateWaitEncryptionKey) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeAuthorizationStateWaitEncryptionKey
2018-08-30 14:55:42 +00:00
}
func (*AuthorizationStateWaitEncryptionKey) AuthorizationStateType() string {
2022-03-13 04:04:12 +00:00
return TypeAuthorizationStateWaitEncryptionKey
2018-08-30 14:55:42 +00:00
}
2020-02-03 12:56:20 +00:00
// TDLib needs the user's phone number to authorize. Call `setAuthenticationPhoneNumber` to provide the phone number, or use `requestQrCodeAuthentication`, or `checkAuthenticationBotToken` for other authentication options
2022-03-13 04:04:12 +00:00
type AuthorizationStateWaitPhoneNumber struct{
meta
2018-08-30 14:55:42 +00:00
}
func (entity *AuthorizationStateWaitPhoneNumber) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub AuthorizationStateWaitPhoneNumber
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*AuthorizationStateWaitPhoneNumber) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassAuthorizationState
2018-08-30 14:55:42 +00:00
}
func (*AuthorizationStateWaitPhoneNumber) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeAuthorizationStateWaitPhoneNumber
2018-08-30 14:55:42 +00:00
}
func (*AuthorizationStateWaitPhoneNumber) AuthorizationStateType() string {
2022-03-13 04:04:12 +00:00
return TypeAuthorizationStateWaitPhoneNumber
2018-08-30 14:55:42 +00:00
}
2019-09-10 12:36:54 +00:00
// TDLib needs the user's authentication code to authorize
2018-08-30 14:55:42 +00:00
type AuthorizationStateWaitCode struct {
2022-03-13 04:04:12 +00:00
meta
// Information about the authorization code that was sent
CodeInfo *AuthenticationCodeInfo `json:"code_info"`
2018-08-30 14:55:42 +00:00
}
func (entity *AuthorizationStateWaitCode) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub AuthorizationStateWaitCode
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*AuthorizationStateWaitCode) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassAuthorizationState
2018-08-30 14:55:42 +00:00
}
func (*AuthorizationStateWaitCode) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeAuthorizationStateWaitCode
2018-08-30 14:55:42 +00:00
}
func (*AuthorizationStateWaitCode) AuthorizationStateType() string {
2022-03-13 04:04:12 +00:00
return TypeAuthorizationStateWaitCode
2018-08-30 14:55:42 +00:00
}
2020-02-03 12:56:20 +00:00
// The user needs to confirm authorization on another logged in device by scanning a QR code with the provided link
type AuthorizationStateWaitOtherDeviceConfirmation struct {
2022-03-13 04:04:12 +00:00
meta
// A tg:// URL for the QR code. The link will be updated frequently
Link string `json:"link"`
2020-02-03 12:56:20 +00:00
}
func (entity *AuthorizationStateWaitOtherDeviceConfirmation) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
type stub AuthorizationStateWaitOtherDeviceConfirmation
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-02-03 12:56:20 +00:00
}
func (*AuthorizationStateWaitOtherDeviceConfirmation) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassAuthorizationState
2020-02-03 12:56:20 +00:00
}
func (*AuthorizationStateWaitOtherDeviceConfirmation) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeAuthorizationStateWaitOtherDeviceConfirmation
2020-02-03 12:56:20 +00:00
}
func (*AuthorizationStateWaitOtherDeviceConfirmation) AuthorizationStateType() string {
2022-03-13 04:04:12 +00:00
return TypeAuthorizationStateWaitOtherDeviceConfirmation
2020-02-03 12:56:20 +00:00
}
2019-09-10 12:36:54 +00:00
// The user is unregistered and need to accept terms of service and enter their first name and last name to finish registration
type AuthorizationStateWaitRegistration struct {
2022-03-13 04:04:12 +00:00
meta
// Telegram terms of service
TermsOfService *TermsOfService `json:"terms_of_service"`
2019-09-10 12:36:54 +00:00
}
func (entity *AuthorizationStateWaitRegistration) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-09-10 12:36:54 +00:00
2022-03-13 04:04:12 +00:00
type stub AuthorizationStateWaitRegistration
2019-09-10 12:36:54 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-09-10 12:36:54 +00:00
}
func (*AuthorizationStateWaitRegistration) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassAuthorizationState
2019-09-10 12:36:54 +00:00
}
func (*AuthorizationStateWaitRegistration) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeAuthorizationStateWaitRegistration
2019-09-10 12:36:54 +00:00
}
func (*AuthorizationStateWaitRegistration) AuthorizationStateType() string {
2022-03-13 04:04:12 +00:00
return TypeAuthorizationStateWaitRegistration
2019-09-10 12:36:54 +00:00
}
2018-08-30 14:55:42 +00:00
// The user has been authorized, but needs to enter a password to start using the application
type AuthorizationStateWaitPassword struct {
2022-03-13 04:04:12 +00:00
meta
// Hint for the password; may be empty
PasswordHint string `json:"password_hint"`
// True, if a recovery email address has been set up
HasRecoveryEmailAddress bool `json:"has_recovery_email_address"`
// Pattern of the email address to which the recovery email was sent; empty until a recovery email has been sent
RecoveryEmailAddressPattern string `json:"recovery_email_address_pattern"`
2018-08-30 14:55:42 +00:00
}
func (entity *AuthorizationStateWaitPassword) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub AuthorizationStateWaitPassword
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*AuthorizationStateWaitPassword) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassAuthorizationState
2018-08-30 14:55:42 +00:00
}
func (*AuthorizationStateWaitPassword) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeAuthorizationStateWaitPassword
2018-08-30 14:55:42 +00:00
}
func (*AuthorizationStateWaitPassword) AuthorizationStateType() string {
2022-03-13 04:04:12 +00:00
return TypeAuthorizationStateWaitPassword
2018-08-30 14:55:42 +00:00
}
// The user has been successfully authorized. TDLib is now ready to answer queries
2022-03-13 04:04:12 +00:00
type AuthorizationStateReady struct{
meta
2018-08-30 14:55:42 +00:00
}
func (entity *AuthorizationStateReady) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub AuthorizationStateReady
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*AuthorizationStateReady) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassAuthorizationState
2018-08-30 14:55:42 +00:00
}
func (*AuthorizationStateReady) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeAuthorizationStateReady
2018-08-30 14:55:42 +00:00
}
func (*AuthorizationStateReady) AuthorizationStateType() string {
2022-03-13 04:04:12 +00:00
return TypeAuthorizationStateReady
2018-08-30 14:55:42 +00:00
}
// The user is currently logging out
2022-03-13 04:04:12 +00:00
type AuthorizationStateLoggingOut struct{
meta
2018-08-30 14:55:42 +00:00
}
func (entity *AuthorizationStateLoggingOut) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub AuthorizationStateLoggingOut
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*AuthorizationStateLoggingOut) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassAuthorizationState
2018-08-30 14:55:42 +00:00
}
func (*AuthorizationStateLoggingOut) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeAuthorizationStateLoggingOut
2018-08-30 14:55:42 +00:00
}
func (*AuthorizationStateLoggingOut) AuthorizationStateType() string {
2022-03-13 04:04:12 +00:00
return TypeAuthorizationStateLoggingOut
2018-08-30 14:55:42 +00:00
}
// TDLib is closing, all subsequent queries will be answered with the error 500. Note that closing TDLib can take a while. All resources will be freed only after authorizationStateClosed has been received
2022-03-13 04:04:12 +00:00
type AuthorizationStateClosing struct{
meta
2018-08-30 14:55:42 +00:00
}
func (entity *AuthorizationStateClosing) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub AuthorizationStateClosing
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*AuthorizationStateClosing) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassAuthorizationState
2018-08-30 14:55:42 +00:00
}
func (*AuthorizationStateClosing) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeAuthorizationStateClosing
2018-08-30 14:55:42 +00:00
}
func (*AuthorizationStateClosing) AuthorizationStateType() string {
2022-03-13 04:04:12 +00:00
return TypeAuthorizationStateClosing
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// TDLib client is in its final state. All databases are closed and all resources are released. No other updates will be received after this. All queries will be responded to with error code 500. To continue working, one must create a new instance of the TDLib client
2022-03-13 04:04:12 +00:00
type AuthorizationStateClosed struct{
meta
2018-08-30 14:55:42 +00:00
}
func (entity *AuthorizationStateClosed) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub AuthorizationStateClosed
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*AuthorizationStateClosed) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassAuthorizationState
2018-08-30 14:55:42 +00:00
}
func (*AuthorizationStateClosed) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeAuthorizationStateClosed
2018-08-30 14:55:42 +00:00
}
func (*AuthorizationStateClosed) AuthorizationStateType() string {
2022-03-13 04:04:12 +00:00
return TypeAuthorizationStateClosed
2018-08-30 14:55:42 +00:00
}
// Represents the current state of 2-step verification
type PasswordState struct {
2022-03-13 04:04:12 +00:00
meta
// True, if a 2-step verification password is set
HasPassword bool `json:"has_password"`
// Hint for the password; may be empty
PasswordHint string `json:"password_hint"`
// True, if a recovery email is set
HasRecoveryEmailAddress bool `json:"has_recovery_email_address"`
// True, if some Telegram Passport elements were saved
HasPassportData bool `json:"has_passport_data"`
// Information about the recovery email address to which the confirmation email was sent; may be null
RecoveryEmailAddressCodeInfo *EmailAddressAuthenticationCodeInfo `json:"recovery_email_address_code_info"`
// If not 0, point in time (Unix timestamp) after which the password can be reset immediately using resetPassword
PendingResetDate int32 `json:"pending_reset_date"`
2018-08-30 14:55:42 +00:00
}
func (entity *PasswordState) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub PasswordState
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*PasswordState) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPasswordState
2018-08-30 14:55:42 +00:00
}
func (*PasswordState) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePasswordState
2018-08-30 14:55:42 +00:00
}
// Contains information about the current recovery email address
type RecoveryEmailAddress struct {
2022-03-13 04:04:12 +00:00
meta
// Recovery email address
RecoveryEmailAddress string `json:"recovery_email_address"`
2018-08-30 14:55:42 +00:00
}
func (entity *RecoveryEmailAddress) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub RecoveryEmailAddress
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*RecoveryEmailAddress) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassRecoveryEmailAddress
2018-08-30 14:55:42 +00:00
}
func (*RecoveryEmailAddress) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeRecoveryEmailAddress
2018-08-30 14:55:42 +00:00
}
// Returns information about the availability of a temporary password, which can be used for payments
type TemporaryPasswordState struct {
2022-03-13 04:04:12 +00:00
meta
// True, if a temporary password is available
HasPassword bool `json:"has_password"`
// Time left before the temporary password expires, in seconds
ValidFor int32 `json:"valid_for"`
2018-08-30 14:55:42 +00:00
}
func (entity *TemporaryPasswordState) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub TemporaryPasswordState
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*TemporaryPasswordState) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassTemporaryPasswordState
2018-08-30 14:55:42 +00:00
}
func (*TemporaryPasswordState) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeTemporaryPasswordState
2018-08-30 14:55:42 +00:00
}
// Represents a local file
type LocalFile struct {
2022-03-13 04:04:12 +00:00
meta
// Local path to the locally available file part; may be empty
Path string `json:"path"`
// True, if it is possible to download or generate the file
CanBeDownloaded bool `json:"can_be_downloaded"`
// True, if the file can be deleted
CanBeDeleted bool `json:"can_be_deleted"`
// True, if the file is currently being downloaded (or a local copy is being generated by some other means)
IsDownloadingActive bool `json:"is_downloading_active"`
// True, if the local copy is fully available
IsDownloadingCompleted bool `json:"is_downloading_completed"`
// Download will be started from this offset. downloaded_prefix_size is calculated from this offset
DownloadOffset int32 `json:"download_offset"`
// If is_downloading_completed is false, then only some prefix of the file starting from download_offset is ready to be read. downloaded_prefix_size is the size of that prefix in bytes
DownloadedPrefixSize int32 `json:"downloaded_prefix_size"`
// Total downloaded file size, in bytes. Can be used only for calculating download progress. The actual file size may be bigger, and some parts of it may contain garbage
DownloadedSize int32 `json:"downloaded_size"`
2018-08-30 14:55:42 +00:00
}
func (entity *LocalFile) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub LocalFile
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*LocalFile) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassLocalFile
2018-08-30 14:55:42 +00:00
}
func (*LocalFile) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeLocalFile
2018-08-30 14:55:42 +00:00
}
// Represents a remote file
type RemoteFile struct {
2022-03-13 04:04:12 +00:00
meta
// Remote file identifier; may be empty. Can be used by the current user across application restarts or even from other devices. Uniquely identifies a file, but a file can have a lot of different valid identifiers. If the ID starts with "http://" or "https://", it represents the HTTP URL of the file. TDLib is currently unable to download files if only their URL is known. If downloadFile/addFileToDownloads is called on such a file or if it is sent to a secret chat, TDLib starts a file generation process by sending updateFileGenerationStart to the application with the HTTP URL in the original_path and "#url#" as the conversion string. Application must generate the file by downloading it to the specified location
Id string `json:"id"`
// Unique file identifier; may be empty if unknown. The unique file identifier which is the same for the same file even for different users and is persistent over time
UniqueId string `json:"unique_id"`
// True, if the file is currently being uploaded (or a remote copy is being generated by some other means)
IsUploadingActive bool `json:"is_uploading_active"`
// True, if a remote copy is fully available
IsUploadingCompleted bool `json:"is_uploading_completed"`
// Size of the remote available part of the file, in bytes; 0 if unknown
UploadedSize int32 `json:"uploaded_size"`
2018-08-30 14:55:42 +00:00
}
func (entity *RemoteFile) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub RemoteFile
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*RemoteFile) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassRemoteFile
2018-08-30 14:55:42 +00:00
}
func (*RemoteFile) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeRemoteFile
2018-08-30 14:55:42 +00:00
}
// Represents a file
type File struct {
2022-03-13 04:04:12 +00:00
meta
// Unique file identifier
Id int32 `json:"id"`
// File data center
DcId int32 `json:"dc_id"`
// File size, in bytes; 0 if unknown
Size int32 `json:"size"`
// Approximate file size in bytes in case the exact file size is unknown. Can be used to show download/upload progress
ExpectedSize int32 `json:"expected_size"`
// Information about the local copy of the file
Local *LocalFile `json:"local"`
// Information about the remote copy of the file
Remote *RemoteFile `json:"remote"`
2018-08-30 14:55:42 +00:00
}
func (entity *File) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub File
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*File) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassFile
2018-08-30 14:55:42 +00:00
}
func (*File) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeFile
2018-08-30 14:55:42 +00:00
}
// A file defined by its unique ID
type InputFileId struct {
2022-03-13 04:04:12 +00:00
meta
// Unique file identifier
Id int32 `json:"id"`
2018-08-30 14:55:42 +00:00
}
func (entity *InputFileId) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub InputFileId
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*InputFileId) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInputFile
2018-08-30 14:55:42 +00:00
}
func (*InputFileId) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInputFileId
2018-08-30 14:55:42 +00:00
}
func (*InputFileId) InputFileType() string {
2022-03-13 04:04:12 +00:00
return TypeInputFileId
2018-08-30 14:55:42 +00:00
}
2020-11-30 09:33:47 +00:00
// A file defined by its remote ID. The remote ID is guaranteed to be usable only if the corresponding file is still accessible to the user and known to TDLib. For example, if the file is from a message, then the message must be not deleted and accessible to the user. If the file database is disabled, then the corresponding object with the file must be preloaded by the application
2018-08-30 14:55:42 +00:00
type InputFileRemote struct {
2022-03-13 04:04:12 +00:00
meta
// Remote file identifier
Id string `json:"id"`
2018-08-30 14:55:42 +00:00
}
func (entity *InputFileRemote) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub InputFileRemote
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*InputFileRemote) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInputFile
2018-08-30 14:55:42 +00:00
}
func (*InputFileRemote) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInputFileRemote
2018-08-30 14:55:42 +00:00
}
func (*InputFileRemote) InputFileType() string {
2022-03-13 04:04:12 +00:00
return TypeInputFileRemote
2018-08-30 14:55:42 +00:00
}
// A file defined by a local path
type InputFileLocal struct {
2022-03-13 04:04:12 +00:00
meta
// Local path to the file
Path string `json:"path"`
2018-08-30 14:55:42 +00:00
}
func (entity *InputFileLocal) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub InputFileLocal
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*InputFileLocal) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInputFile
2018-08-30 14:55:42 +00:00
}
func (*InputFileLocal) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInputFileLocal
2018-08-30 14:55:42 +00:00
}
func (*InputFileLocal) InputFileType() string {
2022-03-13 04:04:12 +00:00
return TypeInputFileLocal
2018-08-30 14:55:42 +00:00
}
2020-11-30 09:33:47 +00:00
// A file generated by the application
2018-08-30 14:55:42 +00:00
type InputFileGenerated struct {
2022-03-13 04:04:12 +00:00
meta
// Local path to a file from which the file is generated; may be empty if there is no such file
OriginalPath string `json:"original_path"`
// String specifying the conversion applied to the original file; must be persistent across application restarts. Conversions beginning with '#' are reserved for internal TDLib usage
Conversion string `json:"conversion"`
// Expected size of the generated file, in bytes; 0 if unknown
ExpectedSize int32 `json:"expected_size"`
2018-08-30 14:55:42 +00:00
}
func (entity *InputFileGenerated) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub InputFileGenerated
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*InputFileGenerated) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInputFile
2018-08-30 14:55:42 +00:00
}
func (*InputFileGenerated) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInputFileGenerated
2018-08-30 14:55:42 +00:00
}
func (*InputFileGenerated) InputFileType() string {
2022-03-13 04:04:12 +00:00
return TypeInputFileGenerated
2018-08-30 14:55:42 +00:00
}
2020-11-30 09:33:47 +00:00
// Describes an image in JPEG format
2018-08-30 14:55:42 +00:00
type PhotoSize struct {
2022-03-13 04:04:12 +00:00
meta
// Image type (see https://core.telegram.org/constructor/photoSize)
Type string `json:"type"`
// Information about the image file
Photo *File `json:"photo"`
// Image width
Width int32 `json:"width"`
// Image height
Height int32 `json:"height"`
// Sizes of progressive JPEG file prefixes, which can be used to preliminarily show the image; in bytes
ProgressiveSizes []int32 `json:"progressive_sizes"`
2018-08-30 14:55:42 +00:00
}
func (entity *PhotoSize) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub PhotoSize
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*PhotoSize) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPhotoSize
2018-08-30 14:55:42 +00:00
}
func (*PhotoSize) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePhotoSize
2018-08-30 14:55:42 +00:00
}
2019-09-10 12:36:54 +00:00
// Thumbnail image of a very poor quality and low resolution
type Minithumbnail struct {
2022-03-13 04:04:12 +00:00
meta
// Thumbnail width, usually doesn't exceed 40
Width int32 `json:"width"`
// Thumbnail height, usually doesn't exceed 40
Height int32 `json:"height"`
// The thumbnail in JPEG format
Data []byte `json:"data"`
2019-09-10 12:36:54 +00:00
}
func (entity *Minithumbnail) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-09-10 12:36:54 +00:00
2022-03-13 04:04:12 +00:00
type stub Minithumbnail
2019-09-10 12:36:54 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-09-10 12:36:54 +00:00
}
func (*Minithumbnail) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMinithumbnail
2019-09-10 12:36:54 +00:00
}
func (*Minithumbnail) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMinithumbnail
2019-09-10 12:36:54 +00:00
}
2020-11-30 09:33:47 +00:00
// The thumbnail is in JPEG format
2022-03-13 04:04:12 +00:00
type ThumbnailFormatJpeg struct{
meta
2020-11-30 09:33:47 +00:00
}
func (entity *ThumbnailFormatJpeg) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
type stub ThumbnailFormatJpeg
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-11-30 09:33:47 +00:00
}
func (*ThumbnailFormatJpeg) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassThumbnailFormat
2020-11-30 09:33:47 +00:00
}
func (*ThumbnailFormatJpeg) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeThumbnailFormatJpeg
2020-11-30 09:33:47 +00:00
}
func (*ThumbnailFormatJpeg) ThumbnailFormatType() string {
2022-03-13 04:04:12 +00:00
return TypeThumbnailFormatJpeg
2020-11-30 09:33:47 +00:00
}
2022-02-06 18:36:17 +00:00
// The thumbnail is in static GIF format. It will be used only for some bot inline results
2022-03-13 04:04:12 +00:00
type ThumbnailFormatGif struct{
meta
2020-11-30 09:33:47 +00:00
}
2022-02-06 18:36:17 +00:00
func (entity *ThumbnailFormatGif) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
type stub ThumbnailFormatGif
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-11-30 09:33:47 +00:00
}
2022-02-06 18:36:17 +00:00
func (*ThumbnailFormatGif) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassThumbnailFormat
2020-11-30 09:33:47 +00:00
}
2022-02-06 18:36:17 +00:00
func (*ThumbnailFormatGif) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeThumbnailFormatGif
2020-11-30 09:33:47 +00:00
}
2022-02-06 18:36:17 +00:00
func (*ThumbnailFormatGif) ThumbnailFormatType() string {
2022-03-13 04:04:12 +00:00
return TypeThumbnailFormatGif
2020-11-30 09:33:47 +00:00
}
2022-02-06 18:36:17 +00:00
// The thumbnail is in MPEG4 format. It will be used only for some animations and videos
2022-03-13 04:04:12 +00:00
type ThumbnailFormatMpeg4 struct{
meta
2020-11-30 09:33:47 +00:00
}
2022-02-06 18:36:17 +00:00
func (entity *ThumbnailFormatMpeg4) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
type stub ThumbnailFormatMpeg4
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-11-30 09:33:47 +00:00
}
2022-02-06 18:36:17 +00:00
func (*ThumbnailFormatMpeg4) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassThumbnailFormat
2020-11-30 09:33:47 +00:00
}
2022-02-06 18:36:17 +00:00
func (*ThumbnailFormatMpeg4) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeThumbnailFormatMpeg4
2020-11-30 09:33:47 +00:00
}
2022-02-06 18:36:17 +00:00
func (*ThumbnailFormatMpeg4) ThumbnailFormatType() string {
2022-03-13 04:04:12 +00:00
return TypeThumbnailFormatMpeg4
2020-11-30 09:33:47 +00:00
}
2022-02-06 18:36:17 +00:00
// The thumbnail is in PNG format. It will be used only for background patterns
2022-03-13 04:04:12 +00:00
type ThumbnailFormatPng struct{
meta
2020-11-30 09:33:47 +00:00
}
2022-02-06 18:36:17 +00:00
func (entity *ThumbnailFormatPng) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
type stub ThumbnailFormatPng
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-11-30 09:33:47 +00:00
}
2022-02-06 18:36:17 +00:00
func (*ThumbnailFormatPng) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassThumbnailFormat
2020-11-30 09:33:47 +00:00
}
2022-02-06 18:36:17 +00:00
func (*ThumbnailFormatPng) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeThumbnailFormatPng
2020-11-30 09:33:47 +00:00
}
2022-02-06 18:36:17 +00:00
func (*ThumbnailFormatPng) ThumbnailFormatType() string {
2022-03-13 04:04:12 +00:00
return TypeThumbnailFormatPng
2020-11-30 09:33:47 +00:00
}
2022-02-06 18:36:17 +00:00
// The thumbnail is in TGS format. It will be used only for TGS sticker sets
2022-03-13 04:04:12 +00:00
type ThumbnailFormatTgs struct{
meta
2020-11-30 09:33:47 +00:00
}
func (entity *ThumbnailFormatTgs) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
type stub ThumbnailFormatTgs
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-11-30 09:33:47 +00:00
}
func (*ThumbnailFormatTgs) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassThumbnailFormat
2020-11-30 09:33:47 +00:00
}
func (*ThumbnailFormatTgs) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeThumbnailFormatTgs
2020-11-30 09:33:47 +00:00
}
func (*ThumbnailFormatTgs) ThumbnailFormatType() string {
2022-03-13 04:04:12 +00:00
return TypeThumbnailFormatTgs
2020-11-30 09:33:47 +00:00
}
2022-02-06 18:36:17 +00:00
// The thumbnail is in WEBM format. It will be used only for WEBM sticker sets
2022-03-13 04:04:12 +00:00
type ThumbnailFormatWebm struct{
meta
2020-11-30 09:33:47 +00:00
}
2022-02-06 18:36:17 +00:00
func (entity *ThumbnailFormatWebm) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
type stub ThumbnailFormatWebm
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-11-30 09:33:47 +00:00
}
2022-02-06 18:36:17 +00:00
func (*ThumbnailFormatWebm) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassThumbnailFormat
2020-11-30 09:33:47 +00:00
}
2022-02-06 18:36:17 +00:00
func (*ThumbnailFormatWebm) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeThumbnailFormatWebm
2020-11-30 09:33:47 +00:00
}
2022-02-06 18:36:17 +00:00
func (*ThumbnailFormatWebm) ThumbnailFormatType() string {
2022-03-13 04:04:12 +00:00
return TypeThumbnailFormatWebm
2022-02-06 18:36:17 +00:00
}
// The thumbnail is in WEBP format. It will be used only for some stickers
2022-03-13 04:04:12 +00:00
type ThumbnailFormatWebp struct{
meta
2022-02-06 18:36:17 +00:00
}
func (entity *ThumbnailFormatWebp) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2022-02-06 18:36:17 +00:00
2022-03-13 04:04:12 +00:00
type stub ThumbnailFormatWebp
2022-02-06 18:36:17 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2022-02-06 18:36:17 +00:00
}
func (*ThumbnailFormatWebp) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassThumbnailFormat
2022-02-06 18:36:17 +00:00
}
func (*ThumbnailFormatWebp) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeThumbnailFormatWebp
2022-02-06 18:36:17 +00:00
}
func (*ThumbnailFormatWebp) ThumbnailFormatType() string {
2022-03-13 04:04:12 +00:00
return TypeThumbnailFormatWebp
2020-11-30 09:33:47 +00:00
}
// Represents a thumbnail
type Thumbnail struct {
2022-03-13 04:04:12 +00:00
meta
// Thumbnail format
Format ThumbnailFormat `json:"format"`
// Thumbnail width
Width int32 `json:"width"`
// Thumbnail height
Height int32 `json:"height"`
// The thumbnail
File *File `json:"file"`
2020-11-30 09:33:47 +00:00
}
func (entity *Thumbnail) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
type stub Thumbnail
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-11-30 09:33:47 +00:00
}
func (*Thumbnail) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassThumbnail
2020-11-30 09:33:47 +00:00
}
func (*Thumbnail) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeThumbnail
2020-11-30 09:33:47 +00:00
}
func (thumbnail *Thumbnail) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Format json.RawMessage `json:"format"`
Width int32 `json:"width"`
Height int32 `json:"height"`
File *File `json:"file"`
}
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
thumbnail.Width = tmp.Width
thumbnail.Height = tmp.Height
thumbnail.File = tmp.File
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
fieldFormat, _ := UnmarshalThumbnailFormat(tmp.Format)
thumbnail.Format = fieldFormat
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return nil
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
// The mask is placed relatively to the forehead
2022-03-13 04:04:12 +00:00
type MaskPointForehead struct{
meta
2018-08-30 14:55:42 +00:00
}
func (entity *MaskPointForehead) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub MaskPointForehead
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*MaskPointForehead) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMaskPoint
2018-08-30 14:55:42 +00:00
}
func (*MaskPointForehead) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMaskPointForehead
2018-08-30 14:55:42 +00:00
}
func (*MaskPointForehead) MaskPointType() string {
2022-03-13 04:04:12 +00:00
return TypeMaskPointForehead
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// The mask is placed relatively to the eyes
2022-03-13 04:04:12 +00:00
type MaskPointEyes struct{
meta
2018-08-30 14:55:42 +00:00
}
func (entity *MaskPointEyes) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub MaskPointEyes
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*MaskPointEyes) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMaskPoint
2018-08-30 14:55:42 +00:00
}
func (*MaskPointEyes) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMaskPointEyes
2018-08-30 14:55:42 +00:00
}
func (*MaskPointEyes) MaskPointType() string {
2022-03-13 04:04:12 +00:00
return TypeMaskPointEyes
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// The mask is placed relatively to the mouth
2022-03-13 04:04:12 +00:00
type MaskPointMouth struct{
meta
2018-08-30 14:55:42 +00:00
}
func (entity *MaskPointMouth) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub MaskPointMouth
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*MaskPointMouth) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMaskPoint
2018-08-30 14:55:42 +00:00
}
func (*MaskPointMouth) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMaskPointMouth
2018-08-30 14:55:42 +00:00
}
func (*MaskPointMouth) MaskPointType() string {
2022-03-13 04:04:12 +00:00
return TypeMaskPointMouth
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// The mask is placed relatively to the chin
2022-03-13 04:04:12 +00:00
type MaskPointChin struct{
meta
2018-08-30 14:55:42 +00:00
}
func (entity *MaskPointChin) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub MaskPointChin
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*MaskPointChin) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMaskPoint
2018-08-30 14:55:42 +00:00
}
func (*MaskPointChin) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMaskPointChin
2018-08-30 14:55:42 +00:00
}
func (*MaskPointChin) MaskPointType() string {
2022-03-13 04:04:12 +00:00
return TypeMaskPointChin
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// Position on a photo where a mask is placed
2018-08-30 14:55:42 +00:00
type MaskPosition struct {
2022-03-13 04:04:12 +00:00
meta
// Part of the face, relative to which the mask is placed
Point MaskPoint `json:"point"`
// Shift by X-axis measured in widths of the mask scaled to the face size, from left to right. (For example, -1.0 will place the mask just to the left of the default mask position)
XShift float64 `json:"x_shift"`
// Shift by Y-axis measured in heights of the mask scaled to the face size, from top to bottom. (For example, 1.0 will place the mask just below the default mask position)
YShift float64 `json:"y_shift"`
// Mask scaling coefficient. (For example, 2.0 means a doubled size)
Scale float64 `json:"scale"`
2018-08-30 14:55:42 +00:00
}
func (entity *MaskPosition) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub MaskPosition
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*MaskPosition) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMaskPosition
2018-08-30 14:55:42 +00:00
}
func (*MaskPosition) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMaskPosition
2018-08-30 14:55:42 +00:00
}
func (maskPosition *MaskPosition) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Point json.RawMessage `json:"point"`
XShift float64 `json:"x_shift"`
YShift float64 `json:"y_shift"`
Scale float64 `json:"scale"`
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
maskPosition.XShift = tmp.XShift
maskPosition.YShift = tmp.YShift
maskPosition.Scale = tmp.Scale
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
fieldPoint, _ := UnmarshalMaskPoint(tmp.Point)
maskPosition.Point = fieldPoint
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return nil
2018-08-30 14:55:42 +00:00
}
2022-02-06 18:36:17 +00:00
// The sticker is an image in WEBP format
2022-03-13 04:04:12 +00:00
type StickerTypeStatic struct{
meta
2022-02-06 18:36:17 +00:00
}
func (entity *StickerTypeStatic) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2022-02-06 18:36:17 +00:00
2022-03-13 04:04:12 +00:00
type stub StickerTypeStatic
2022-02-06 18:36:17 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2022-02-06 18:36:17 +00:00
}
func (*StickerTypeStatic) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassStickerType
2022-02-06 18:36:17 +00:00
}
func (*StickerTypeStatic) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeStickerTypeStatic
2022-02-06 18:36:17 +00:00
}
func (*StickerTypeStatic) StickerTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeStickerTypeStatic
2022-02-06 18:36:17 +00:00
}
// The sticker is an animation in TGS format
2022-03-13 04:04:12 +00:00
type StickerTypeAnimated struct{
meta
2022-02-06 18:36:17 +00:00
}
func (entity *StickerTypeAnimated) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2022-02-06 18:36:17 +00:00
2022-03-13 04:04:12 +00:00
type stub StickerTypeAnimated
2022-02-06 18:36:17 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2022-02-06 18:36:17 +00:00
}
func (*StickerTypeAnimated) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassStickerType
2022-02-06 18:36:17 +00:00
}
func (*StickerTypeAnimated) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeStickerTypeAnimated
2022-02-06 18:36:17 +00:00
}
func (*StickerTypeAnimated) StickerTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeStickerTypeAnimated
2022-02-06 18:36:17 +00:00
}
// The sticker is a video in WEBM format
2022-03-13 04:04:12 +00:00
type StickerTypeVideo struct{
meta
2022-02-06 18:36:17 +00:00
}
func (entity *StickerTypeVideo) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2022-02-06 18:36:17 +00:00
2022-03-13 04:04:12 +00:00
type stub StickerTypeVideo
2022-02-06 18:36:17 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2022-02-06 18:36:17 +00:00
}
func (*StickerTypeVideo) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassStickerType
2022-02-06 18:36:17 +00:00
}
func (*StickerTypeVideo) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeStickerTypeVideo
2022-02-06 18:36:17 +00:00
}
func (*StickerTypeVideo) StickerTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeStickerTypeVideo
2022-02-06 18:36:17 +00:00
}
// The sticker is a mask in WEBP format to be placed on photos or videos
type StickerTypeMask struct {
2022-03-13 04:04:12 +00:00
meta
// Position where the mask is placed; may be null
MaskPosition *MaskPosition `json:"mask_position"`
2022-02-06 18:36:17 +00:00
}
func (entity *StickerTypeMask) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2022-02-06 18:36:17 +00:00
2022-03-13 04:04:12 +00:00
type stub StickerTypeMask
2022-02-06 18:36:17 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2022-02-06 18:36:17 +00:00
}
func (*StickerTypeMask) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassStickerType
2022-02-06 18:36:17 +00:00
}
func (*StickerTypeMask) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeStickerTypeMask
2022-02-06 18:36:17 +00:00
}
func (*StickerTypeMask) StickerTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeStickerTypeMask
2022-02-06 18:36:17 +00:00
}
2021-12-30 05:55:02 +00:00
// Represents a closed vector path. The path begins at the end point of the last command
type ClosedVectorPath struct {
2022-03-13 04:04:12 +00:00
meta
// List of vector path commands
Commands []VectorPathCommand `json:"commands"`
2021-12-30 05:55:02 +00:00
}
func (entity *ClosedVectorPath) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub ClosedVectorPath
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*ClosedVectorPath) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassClosedVectorPath
2021-12-30 05:55:02 +00:00
}
func (*ClosedVectorPath) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeClosedVectorPath
2021-12-30 05:55:02 +00:00
}
func (closedVectorPath *ClosedVectorPath) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Commands []json.RawMessage `json:"commands"`
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
fieldCommands, _ := UnmarshalListOfVectorPathCommand(tmp.Commands)
closedVectorPath.Commands = fieldCommands
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return nil
2021-12-30 05:55:02 +00:00
}
2019-06-07 10:56:06 +00:00
// Describes one answer option of a poll
type PollOption struct {
2022-03-13 04:04:12 +00:00
meta
// Option text; 1-100 characters
Text string `json:"text"`
// Number of voters for this option, available only for closed or voted polls
VoterCount int32 `json:"voter_count"`
// The percentage of votes for this option; 0-100
VotePercentage int32 `json:"vote_percentage"`
// True, if the option was chosen by the user
IsChosen bool `json:"is_chosen"`
// True, if the option is being chosen by a pending setPollAnswer request
IsBeingChosen bool `json:"is_being_chosen"`
2019-06-07 10:56:06 +00:00
}
func (entity *PollOption) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub PollOption
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
func (*PollOption) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPollOption
2019-06-07 10:56:06 +00:00
}
func (*PollOption) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePollOption
2019-06-07 10:56:06 +00:00
}
2020-02-03 12:56:20 +00:00
// A regular poll
type PollTypeRegular struct {
2022-03-13 04:04:12 +00:00
meta
// True, if multiple answer options can be chosen simultaneously
AllowMultipleAnswers bool `json:"allow_multiple_answers"`
2020-02-03 12:56:20 +00:00
}
func (entity *PollTypeRegular) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
type stub PollTypeRegular
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-02-03 12:56:20 +00:00
}
func (*PollTypeRegular) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPollType
2020-02-03 12:56:20 +00:00
}
func (*PollTypeRegular) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePollTypeRegular
2020-02-03 12:56:20 +00:00
}
func (*PollTypeRegular) PollTypeType() string {
2022-03-13 04:04:12 +00:00
return TypePollTypeRegular
2020-02-03 12:56:20 +00:00
}
// A poll in quiz mode, which has exactly one correct answer option and can be answered only once
type PollTypeQuiz struct {
2022-03-13 04:04:12 +00:00
meta
// 0-based identifier of the correct answer option; -1 for a yet unanswered poll
CorrectOptionId int32 `json:"correct_option_id"`
// Text that is shown when the user chooses an incorrect answer or taps on the lamp icon; 0-200 characters with at most 2 line feeds; empty for a yet unanswered poll
Explanation *FormattedText `json:"explanation"`
2020-02-03 12:56:20 +00:00
}
func (entity *PollTypeQuiz) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
type stub PollTypeQuiz
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-02-03 12:56:20 +00:00
}
func (*PollTypeQuiz) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPollType
2020-02-03 12:56:20 +00:00
}
func (*PollTypeQuiz) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePollTypeQuiz
2020-02-03 12:56:20 +00:00
}
func (*PollTypeQuiz) PollTypeType() string {
2022-03-13 04:04:12 +00:00
return TypePollTypeQuiz
2020-02-03 12:56:20 +00:00
}
2018-09-05 21:45:29 +00:00
// Describes an animation file. The animation must be encoded in GIF or MPEG4 format
type Animation struct {
2022-03-13 04:04:12 +00:00
meta
// Duration of the animation, in seconds; as defined by the sender
Duration int32 `json:"duration"`
// Width of the animation
Width int32 `json:"width"`
// Height of the animation
Height int32 `json:"height"`
// Original name of the file; as defined by the sender
FileName string `json:"file_name"`
// MIME type of the file, usually "image/gif" or "video/mp4"
MimeType string `json:"mime_type"`
// True, if stickers were added to the animation. The list of corresponding sticker set can be received using getAttachedStickerSets
HasStickers bool `json:"has_stickers"`
// Animation minithumbnail; may be null
Minithumbnail *Minithumbnail `json:"minithumbnail"`
// Animation thumbnail in JPEG or MPEG4 format; may be null
Thumbnail *Thumbnail `json:"thumbnail"`
// File containing the animation
Animation *File `json:"animation"`
2018-08-30 14:55:42 +00:00
}
2018-09-05 21:45:29 +00:00
func (entity *Animation) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub Animation
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2018-09-05 21:45:29 +00:00
func (*Animation) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassAnimation
2018-08-30 14:55:42 +00:00
}
2018-09-05 21:45:29 +00:00
func (*Animation) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeAnimation
2018-08-30 14:55:42 +00:00
}
2020-02-03 12:56:20 +00:00
// Describes an audio file. Audio is usually in MP3 or M4A format
2018-09-05 21:45:29 +00:00
type Audio struct {
2022-03-13 04:04:12 +00:00
meta
// Duration of the audio, in seconds; as defined by the sender
Duration int32 `json:"duration"`
// Title of the audio; as defined by the sender
Title string `json:"title"`
// Performer of the audio; as defined by the sender
Performer string `json:"performer"`
// Original name of the file; as defined by the sender
FileName string `json:"file_name"`
// The MIME type of the file; as defined by the sender
MimeType string `json:"mime_type"`
// The minithumbnail of the album cover; may be null
AlbumCoverMinithumbnail *Minithumbnail `json:"album_cover_minithumbnail"`
// The thumbnail of the album cover in JPEG format; as defined by the sender. The full size thumbnail is supposed to be extracted from the downloaded file; may be null
AlbumCoverThumbnail *Thumbnail `json:"album_cover_thumbnail"`
// File containing the audio
Audio *File `json:"audio"`
2018-08-30 14:55:42 +00:00
}
2018-09-05 21:45:29 +00:00
func (entity *Audio) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub Audio
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2018-09-05 21:45:29 +00:00
func (*Audio) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassAudio
2018-08-30 14:55:42 +00:00
}
func (*Audio) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeAudio
2018-08-30 14:55:42 +00:00
}
// Describes a document of any type
type Document struct {
2022-03-13 04:04:12 +00:00
meta
// Original name of the file; as defined by the sender
FileName string `json:"file_name"`
// MIME type of the file; as defined by the sender
MimeType string `json:"mime_type"`
// Document minithumbnail; may be null
Minithumbnail *Minithumbnail `json:"minithumbnail"`
// Document thumbnail in JPEG or PNG format (PNG will be used only for background patterns); as defined by the sender; may be null
Thumbnail *Thumbnail `json:"thumbnail"`
// File containing the document
Document *File `json:"document"`
2018-08-30 14:55:42 +00:00
}
func (entity *Document) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub Document
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*Document) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassDocument
2018-08-30 14:55:42 +00:00
}
func (*Document) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeDocument
2018-08-30 14:55:42 +00:00
}
// Describes a photo
type Photo struct {
2022-03-13 04:04:12 +00:00
meta
// True, if stickers were added to the photo. The list of corresponding sticker sets can be received using getAttachedStickerSets
HasStickers bool `json:"has_stickers"`
// Photo minithumbnail; may be null
Minithumbnail *Minithumbnail `json:"minithumbnail"`
// Available variants of the photo, in different sizes
Sizes []*PhotoSize `json:"sizes"`
2018-08-30 14:55:42 +00:00
}
func (entity *Photo) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub Photo
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*Photo) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPhoto
2018-08-30 14:55:42 +00:00
}
func (*Photo) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePhoto
2018-08-30 14:55:42 +00:00
}
// Describes a sticker
type Sticker struct {
2022-03-13 04:04:12 +00:00
meta
// The identifier of the sticker set to which the sticker belongs; 0 if none
SetId JsonInt64 `json:"set_id"`
// Sticker width; as defined by the sender
Width int32 `json:"width"`
// Sticker height; as defined by the sender
Height int32 `json:"height"`
// Emoji corresponding to the sticker
Emoji string `json:"emoji"`
// Sticker type
Type StickerType `json:"type"`
// Sticker's outline represented as a list of closed vector paths; may be empty. The coordinate system origin is in the upper-left corner
Outline []*ClosedVectorPath `json:"outline"`
// Sticker thumbnail in WEBP or JPEG format; may be null
Thumbnail *Thumbnail `json:"thumbnail"`
// File containing the sticker
Sticker *File `json:"sticker"`
2018-08-30 14:55:42 +00:00
}
func (entity *Sticker) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub Sticker
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*Sticker) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassSticker
2018-08-30 14:55:42 +00:00
}
func (*Sticker) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeSticker
2018-08-30 14:55:42 +00:00
}
2022-02-06 18:36:17 +00:00
func (sticker *Sticker) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
SetId JsonInt64 `json:"set_id"`
Width int32 `json:"width"`
Height int32 `json:"height"`
Emoji string `json:"emoji"`
Type json.RawMessage `json:"type"`
Outline []*ClosedVectorPath `json:"outline"`
Thumbnail *Thumbnail `json:"thumbnail"`
Sticker *File `json:"sticker"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
sticker.SetId = tmp.SetId
sticker.Width = tmp.Width
sticker.Height = tmp.Height
sticker.Emoji = tmp.Emoji
sticker.Outline = tmp.Outline
sticker.Thumbnail = tmp.Thumbnail
sticker.Sticker = tmp.Sticker
fieldType, _ := UnmarshalStickerType(tmp.Type)
sticker.Type = fieldType
return nil
2022-02-06 18:36:17 +00:00
}
2018-08-30 14:55:42 +00:00
// Describes a video file
type Video struct {
2022-03-13 04:04:12 +00:00
meta
// Duration of the video, in seconds; as defined by the sender
Duration int32 `json:"duration"`
// Video width; as defined by the sender
Width int32 `json:"width"`
// Video height; as defined by the sender
Height int32 `json:"height"`
// Original name of the file; as defined by the sender
FileName string `json:"file_name"`
// MIME type of the file; as defined by the sender
MimeType string `json:"mime_type"`
// True, if stickers were added to the video. The list of corresponding sticker sets can be received using getAttachedStickerSets
HasStickers bool `json:"has_stickers"`
// True, if the video is supposed to be streamed
SupportsStreaming bool `json:"supports_streaming"`
// Video minithumbnail; may be null
Minithumbnail *Minithumbnail `json:"minithumbnail"`
// Video thumbnail in JPEG or MPEG4 format; as defined by the sender; may be null
Thumbnail *Thumbnail `json:"thumbnail"`
// File containing the video
Video *File `json:"video"`
2018-08-30 14:55:42 +00:00
}
func (entity *Video) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub Video
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*Video) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassVideo
2018-08-30 14:55:42 +00:00
}
func (*Video) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeVideo
2018-08-30 14:55:42 +00:00
}
// Describes a video note. The video must be equal in width and height, cropped to a circle, and stored in MPEG4 format
type VideoNote struct {
2022-03-13 04:04:12 +00:00
meta
// Duration of the video, in seconds; as defined by the sender
Duration int32 `json:"duration"`
// Video width and height; as defined by the sender
Length int32 `json:"length"`
// Video minithumbnail; may be null
Minithumbnail *Minithumbnail `json:"minithumbnail"`
// Video thumbnail in JPEG format; as defined by the sender; may be null
Thumbnail *Thumbnail `json:"thumbnail"`
// File containing the video
Video *File `json:"video"`
2018-08-30 14:55:42 +00:00
}
func (entity *VideoNote) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub VideoNote
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*VideoNote) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassVideoNote
2018-08-30 14:55:42 +00:00
}
func (*VideoNote) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeVideoNote
2018-08-30 14:55:42 +00:00
}
// Describes a voice note. The voice note must be encoded with the Opus codec, and stored inside an OGG container. Voice notes can have only a single audio channel
type VoiceNote struct {
2022-03-13 04:04:12 +00:00
meta
// Duration of the voice note, in seconds; as defined by the sender
Duration int32 `json:"duration"`
// A waveform representation of the voice note in 5-bit format
Waveform []byte `json:"waveform"`
// MIME type of the file; as defined by the sender
MimeType string `json:"mime_type"`
// File containing the voice note
Voice *File `json:"voice"`
2018-08-30 14:55:42 +00:00
}
func (entity *VoiceNote) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub VoiceNote
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*VoiceNote) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassVoiceNote
2018-08-30 14:55:42 +00:00
}
func (*VoiceNote) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeVoiceNote
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// Describes an animated representation of an emoji
type AnimatedEmoji struct {
2022-03-13 04:04:12 +00:00
meta
// Animated sticker for the emoji
Sticker *Sticker `json:"sticker"`
// Emoji modifier fitzpatrick type; 0-6; 0 if none
FitzpatrickType int32 `json:"fitzpatrick_type"`
// File containing the sound to be played when the animated emoji is clicked; may be null. The sound is encoded with the Opus codec, and stored inside an OGG container
Sound *File `json:"sound"`
2021-12-30 05:55:02 +00:00
}
func (entity *AnimatedEmoji) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub AnimatedEmoji
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*AnimatedEmoji) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassAnimatedEmoji
2021-12-30 05:55:02 +00:00
}
func (*AnimatedEmoji) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeAnimatedEmoji
2021-12-30 05:55:02 +00:00
}
2018-08-30 14:55:42 +00:00
// Describes a user contact
type Contact struct {
2022-03-13 04:04:12 +00:00
meta
// Phone number of the user
PhoneNumber string `json:"phone_number"`
// First name of the user; 1-255 characters in length
FirstName string `json:"first_name"`
// Last name of the user
LastName string `json:"last_name"`
// Additional data about the user in a form of vCard; 0-2048 bytes in length
Vcard string `json:"vcard"`
// Identifier of the user, if known; otherwise 0
UserId int64 `json:"user_id"`
2018-08-30 14:55:42 +00:00
}
func (entity *Contact) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub Contact
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*Contact) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassContact
2018-08-30 14:55:42 +00:00
}
func (*Contact) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeContact
2018-08-30 14:55:42 +00:00
}
// Describes a location on planet Earth
type Location struct {
2022-03-13 04:04:12 +00:00
meta
// Latitude of the location in degrees; as defined by the sender
Latitude float64 `json:"latitude"`
// Longitude of the location, in degrees; as defined by the sender
Longitude float64 `json:"longitude"`
// The estimated horizontal accuracy of the location, in meters; as defined by the sender. 0 if unknown
HorizontalAccuracy float64 `json:"horizontal_accuracy"`
2018-08-30 14:55:42 +00:00
}
func (entity *Location) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub Location
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*Location) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassLocation
2018-08-30 14:55:42 +00:00
}
func (*Location) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeLocation
2018-08-30 14:55:42 +00:00
}
// Describes a venue
type Venue struct {
2022-03-13 04:04:12 +00:00
meta
// Venue location; as defined by the sender
Location *Location `json:"location"`
// Venue name; as defined by the sender
Title string `json:"title"`
// Venue address; as defined by the sender
Address string `json:"address"`
// Provider of the venue database; as defined by the sender. Currently, only "foursquare" and "gplaces" (Google Places) need to be supported
Provider string `json:"provider"`
// Identifier of the venue in the provider database; as defined by the sender
Id string `json:"id"`
// Type of the venue in the provider database; as defined by the sender
Type string `json:"type"`
2018-08-30 14:55:42 +00:00
}
func (entity *Venue) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub Venue
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*Venue) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassVenue
2018-08-30 14:55:42 +00:00
}
func (*Venue) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeVenue
2018-08-30 14:55:42 +00:00
}
// Describes a game
type Game struct {
2022-03-13 04:04:12 +00:00
meta
// Game ID
Id JsonInt64 `json:"id"`
// Game short name. To share a game use the URL https://t.me/{bot_username}?game={game_short_name}
ShortName string `json:"short_name"`
// Game title
Title string `json:"title"`
// Game text, usually containing scoreboards for a game
Text *FormattedText `json:"text"`
// Game description
Description string `json:"description"`
// Game photo
Photo *Photo `json:"photo"`
// Game animation; may be null
Animation *Animation `json:"animation"`
2018-08-30 14:55:42 +00:00
}
func (entity *Game) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub Game
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*Game) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassGame
2018-08-30 14:55:42 +00:00
}
func (*Game) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeGame
2018-08-30 14:55:42 +00:00
}
2019-06-07 10:56:06 +00:00
// Describes a poll
type Poll struct {
2022-03-13 04:04:12 +00:00
meta
// Unique poll identifier
Id JsonInt64 `json:"id"`
// Poll question; 1-300 characters
Question string `json:"question"`
// List of poll answer options
Options []*PollOption `json:"options"`
// Total number of voters, participating in the poll
TotalVoterCount int32 `json:"total_voter_count"`
// User identifiers of recent voters, if the poll is non-anonymous
RecentVoterUserIds []int64 `json:"recent_voter_user_ids"`
// True, if the poll is anonymous
IsAnonymous bool `json:"is_anonymous"`
// Type of the poll
Type PollType `json:"type"`
// Amount of time the poll will be active after creation, in seconds
OpenPeriod int32 `json:"open_period"`
// Point in time (Unix timestamp) when the poll will automatically be closed
CloseDate int32 `json:"close_date"`
// True, if the poll is closed
IsClosed bool `json:"is_closed"`
2019-06-07 10:56:06 +00:00
}
func (entity *Poll) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub Poll
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
func (*Poll) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPoll
2019-06-07 10:56:06 +00:00
}
func (*Poll) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePoll
2019-06-07 10:56:06 +00:00
}
2020-02-03 12:56:20 +00:00
func (poll *Poll) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Id JsonInt64 `json:"id"`
Question string `json:"question"`
Options []*PollOption `json:"options"`
TotalVoterCount int32 `json:"total_voter_count"`
RecentVoterUserIds []int64 `json:"recent_voter_user_ids"`
IsAnonymous bool `json:"is_anonymous"`
Type json.RawMessage `json:"type"`
OpenPeriod int32 `json:"open_period"`
CloseDate int32 `json:"close_date"`
IsClosed bool `json:"is_closed"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
poll.Id = tmp.Id
poll.Question = tmp.Question
poll.Options = tmp.Options
poll.TotalVoterCount = tmp.TotalVoterCount
poll.RecentVoterUserIds = tmp.RecentVoterUserIds
poll.IsAnonymous = tmp.IsAnonymous
poll.OpenPeriod = tmp.OpenPeriod
poll.CloseDate = tmp.CloseDate
poll.IsClosed = tmp.IsClosed
fieldType, _ := UnmarshalPollType(tmp.Type)
poll.Type = fieldType
return nil
2020-02-03 12:56:20 +00:00
}
2018-08-30 14:55:42 +00:00
// Describes a user profile photo
type ProfilePhoto struct {
2022-03-13 04:04:12 +00:00
meta
// Photo identifier; 0 for an empty photo. Can be used to find a photo in a list of user profile photos
Id JsonInt64 `json:"id"`
// A small (160x160) user profile photo. The file can be downloaded only before the photo is changed
Small *File `json:"small"`
// A big (640x640) user profile photo. The file can be downloaded only before the photo is changed
Big *File `json:"big"`
// User profile photo minithumbnail; may be null
Minithumbnail *Minithumbnail `json:"minithumbnail"`
// True, if the photo has animated variant
HasAnimation bool `json:"has_animation"`
2018-08-30 14:55:42 +00:00
}
func (entity *ProfilePhoto) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub ProfilePhoto
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*ProfilePhoto) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassProfilePhoto
2018-08-30 14:55:42 +00:00
}
func (*ProfilePhoto) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeProfilePhoto
2018-08-30 14:55:42 +00:00
}
2020-11-30 09:33:47 +00:00
// Contains basic information about the photo of a chat
type ChatPhotoInfo struct {
2022-03-13 04:04:12 +00:00
meta
// A small (160x160) chat photo variant in JPEG format. The file can be downloaded only before the photo is changed
Small *File `json:"small"`
// A big (640x640) chat photo variant in JPEG format. The file can be downloaded only before the photo is changed
Big *File `json:"big"`
// Chat photo minithumbnail; may be null
Minithumbnail *Minithumbnail `json:"minithumbnail"`
// True, if the photo has animated variant
HasAnimation bool `json:"has_animation"`
2018-08-30 14:55:42 +00:00
}
2020-11-30 09:33:47 +00:00
func (entity *ChatPhotoInfo) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatPhotoInfo
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2020-11-30 09:33:47 +00:00
func (*ChatPhotoInfo) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatPhotoInfo
2018-08-30 14:55:42 +00:00
}
2020-11-30 09:33:47 +00:00
func (*ChatPhotoInfo) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatPhotoInfo
2018-08-30 14:55:42 +00:00
}
// A regular user
2022-03-13 04:04:12 +00:00
type UserTypeRegular struct{
meta
2018-08-30 14:55:42 +00:00
}
func (entity *UserTypeRegular) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub UserTypeRegular
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*UserTypeRegular) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUserType
2018-08-30 14:55:42 +00:00
}
func (*UserTypeRegular) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUserTypeRegular
2018-08-30 14:55:42 +00:00
}
func (*UserTypeRegular) UserTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeUserTypeRegular
2018-08-30 14:55:42 +00:00
}
2020-02-03 12:56:20 +00:00
// A deleted user or deleted bot. No information on the user besides the user identifier is available. It is not possible to perform any active actions on this type of user
2022-03-13 04:04:12 +00:00
type UserTypeDeleted struct{
meta
2018-08-30 14:55:42 +00:00
}
func (entity *UserTypeDeleted) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub UserTypeDeleted
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*UserTypeDeleted) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUserType
2018-08-30 14:55:42 +00:00
}
func (*UserTypeDeleted) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUserTypeDeleted
2018-08-30 14:55:42 +00:00
}
func (*UserTypeDeleted) UserTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeUserTypeDeleted
2018-08-30 14:55:42 +00:00
}
// A bot (see https://core.telegram.org/bots)
type UserTypeBot struct {
2022-03-13 04:04:12 +00:00
meta
// True, if the bot can be invited to basic group and supergroup chats
CanJoinGroups bool `json:"can_join_groups"`
// True, if the bot can read all messages in basic group or supergroup chats and not just those addressed to the bot. In private and channel chats a bot can always read all messages
CanReadAllGroupMessages bool `json:"can_read_all_group_messages"`
// True, if the bot supports inline queries
IsInline bool `json:"is_inline"`
// Placeholder for inline queries (displayed on the application input field)
InlineQueryPlaceholder string `json:"inline_query_placeholder"`
// True, if the location of the user is expected to be sent with every inline query to this bot
NeedLocation bool `json:"need_location"`
2018-08-30 14:55:42 +00:00
}
func (entity *UserTypeBot) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub UserTypeBot
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*UserTypeBot) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUserType
2018-08-30 14:55:42 +00:00
}
func (*UserTypeBot) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUserTypeBot
2018-08-30 14:55:42 +00:00
}
func (*UserTypeBot) UserTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeUserTypeBot
2018-08-30 14:55:42 +00:00
}
2020-02-03 12:56:20 +00:00
// No information on the user besides the user identifier is available, yet this user has not been deleted. This object is extremely rare and must be handled like a deleted user. It is not possible to perform any actions on users of this type
2022-03-13 04:04:12 +00:00
type UserTypeUnknown struct{
meta
2018-08-30 14:55:42 +00:00
}
func (entity *UserTypeUnknown) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub UserTypeUnknown
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*UserTypeUnknown) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUserType
2018-08-30 14:55:42 +00:00
}
func (*UserTypeUnknown) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUserTypeUnknown
2018-08-30 14:55:42 +00:00
}
func (*UserTypeUnknown) UserTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeUserTypeUnknown
2018-08-30 14:55:42 +00:00
}
2020-11-30 09:33:47 +00:00
// Represents a command supported by a bot
2018-08-30 14:55:42 +00:00
type BotCommand struct {
2022-03-13 04:04:12 +00:00
meta
// Text of the bot command
Command string `json:"command"`
// Description of the bot command
Description string `json:"description"`
2018-08-30 14:55:42 +00:00
}
func (entity *BotCommand) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub BotCommand
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*BotCommand) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassBotCommand
2018-08-30 14:55:42 +00:00
}
func (*BotCommand) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeBotCommand
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// Contains a list of bot commands
type BotCommands struct {
2022-03-13 04:04:12 +00:00
meta
// Bot's user identifier
BotUserId int64 `json:"bot_user_id"`
// List of bot commands
Commands []*BotCommand `json:"commands"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *BotCommands) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub BotCommands
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*BotCommands) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassBotCommands
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*BotCommands) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeBotCommands
2018-08-30 14:55:42 +00:00
}
2020-02-03 12:56:20 +00:00
// Represents a location to which a chat is connected
type ChatLocation struct {
2022-03-13 04:04:12 +00:00
meta
// The location
Location *Location `json:"location"`
// Location address; 1-64 characters, as defined by the chat owner
Address string `json:"address"`
2020-02-03 12:56:20 +00:00
}
func (entity *ChatLocation) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatLocation
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-02-03 12:56:20 +00:00
}
func (*ChatLocation) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatLocation
2020-02-03 12:56:20 +00:00
}
func (*ChatLocation) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatLocation
2020-02-03 12:56:20 +00:00
}
2020-11-30 09:33:47 +00:00
// Animated variant of a chat photo in MPEG4 format
type AnimatedChatPhoto struct {
2022-03-13 04:04:12 +00:00
meta
// Animation width and height
Length int32 `json:"length"`
// Information about the animation file
File *File `json:"file"`
// Timestamp of the frame, used as a static chat photo
MainFrameTimestamp float64 `json:"main_frame_timestamp"`
2018-08-30 14:55:42 +00:00
}
2020-11-30 09:33:47 +00:00
func (entity *AnimatedChatPhoto) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub AnimatedChatPhoto
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2020-11-30 09:33:47 +00:00
func (*AnimatedChatPhoto) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassAnimatedChatPhoto
2018-08-30 14:55:42 +00:00
}
2020-11-30 09:33:47 +00:00
func (*AnimatedChatPhoto) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeAnimatedChatPhoto
2018-08-30 14:55:42 +00:00
}
2020-11-30 09:33:47 +00:00
// Describes a chat or user profile photo
type ChatPhoto struct {
2022-03-13 04:04:12 +00:00
meta
// Unique photo identifier
Id JsonInt64 `json:"id"`
// Point in time (Unix timestamp) when the photo has been added
AddedDate int32 `json:"added_date"`
// Photo minithumbnail; may be null
Minithumbnail *Minithumbnail `json:"minithumbnail"`
// Available variants of the photo in JPEG format, in different size
Sizes []*PhotoSize `json:"sizes"`
// Animated variant of the photo in MPEG4 format; may be null
Animation *AnimatedChatPhoto `json:"animation"`
2020-11-30 09:33:47 +00:00
}
2018-10-23 12:38:10 +00:00
2020-11-30 09:33:47 +00:00
func (entity *ChatPhoto) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-10-23 12:38:10 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatPhoto
2018-10-23 12:38:10 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-11-30 09:33:47 +00:00
}
2018-10-23 12:38:10 +00:00
2020-11-30 09:33:47 +00:00
func (*ChatPhoto) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatPhoto
2020-11-30 09:33:47 +00:00
}
2018-10-23 12:38:10 +00:00
2020-11-30 09:33:47 +00:00
func (*ChatPhoto) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatPhoto
2018-08-30 14:55:42 +00:00
}
2020-11-30 09:33:47 +00:00
// Contains a list of chat or user profile photos
type ChatPhotos struct {
2022-03-13 04:04:12 +00:00
meta
// Total number of photos
TotalCount int32 `json:"total_count"`
// List of photos
Photos []*ChatPhoto `json:"photos"`
2018-08-30 14:55:42 +00:00
}
2020-11-30 09:33:47 +00:00
func (entity *ChatPhotos) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatPhotos
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2020-11-30 09:33:47 +00:00
func (*ChatPhotos) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatPhotos
2018-08-30 14:55:42 +00:00
}
2020-11-30 09:33:47 +00:00
func (*ChatPhotos) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatPhotos
2018-08-30 14:55:42 +00:00
}
2020-11-30 09:33:47 +00:00
// A previously used profile photo of the current user
type InputChatPhotoPrevious struct {
2022-03-13 04:04:12 +00:00
meta
// Identifier of the current user's profile photo to reuse
ChatPhotoId JsonInt64 `json:"chat_photo_id"`
2019-06-07 10:56:06 +00:00
}
2020-11-30 09:33:47 +00:00
func (entity *InputChatPhotoPrevious) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub InputChatPhotoPrevious
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2020-11-30 09:33:47 +00:00
func (*InputChatPhotoPrevious) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInputChatPhoto
2020-11-30 09:33:47 +00:00
}
func (*InputChatPhotoPrevious) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInputChatPhotoPrevious
2019-06-07 10:56:06 +00:00
}
2020-11-30 09:33:47 +00:00
func (*InputChatPhotoPrevious) InputChatPhotoType() string {
2022-03-13 04:04:12 +00:00
return TypeInputChatPhotoPrevious
2019-06-07 10:56:06 +00:00
}
2020-11-30 09:33:47 +00:00
// A static photo in JPEG format
type InputChatPhotoStatic struct {
2022-03-13 04:04:12 +00:00
meta
// Photo to be set as profile photo. Only inputFileLocal and inputFileGenerated are allowed
Photo InputFile `json:"photo"`
2020-11-30 09:33:47 +00:00
}
func (entity *InputChatPhotoStatic) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
type stub InputChatPhotoStatic
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-11-30 09:33:47 +00:00
}
func (*InputChatPhotoStatic) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInputChatPhoto
2020-11-30 09:33:47 +00:00
}
func (*InputChatPhotoStatic) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInputChatPhotoStatic
2020-11-30 09:33:47 +00:00
}
func (*InputChatPhotoStatic) InputChatPhotoType() string {
2022-03-13 04:04:12 +00:00
return TypeInputChatPhotoStatic
2020-11-30 09:33:47 +00:00
}
func (inputChatPhotoStatic *InputChatPhotoStatic) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Photo json.RawMessage `json:"photo"`
}
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
fieldPhoto, _ := UnmarshalInputFile(tmp.Photo)
inputChatPhotoStatic.Photo = fieldPhoto
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return nil
2020-11-30 09:33:47 +00:00
}
// An animation in MPEG4 format; must be square, at most 10 seconds long, have width between 160 and 800 and be at most 2MB in size
type InputChatPhotoAnimation struct {
2022-03-13 04:04:12 +00:00
meta
// Animation to be set as profile photo. Only inputFileLocal and inputFileGenerated are allowed
Animation InputFile `json:"animation"`
// Timestamp of the frame, which will be used as static chat photo
MainFrameTimestamp float64 `json:"main_frame_timestamp"`
2020-11-30 09:33:47 +00:00
}
func (entity *InputChatPhotoAnimation) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
type stub InputChatPhotoAnimation
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-11-30 09:33:47 +00:00
}
func (*InputChatPhotoAnimation) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInputChatPhoto
2020-11-30 09:33:47 +00:00
}
func (*InputChatPhotoAnimation) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInputChatPhotoAnimation
2020-11-30 09:33:47 +00:00
}
func (*InputChatPhotoAnimation) InputChatPhotoType() string {
2022-03-13 04:04:12 +00:00
return TypeInputChatPhotoAnimation
2020-11-30 09:33:47 +00:00
}
func (inputChatPhotoAnimation *InputChatPhotoAnimation) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Animation json.RawMessage `json:"animation"`
MainFrameTimestamp float64 `json:"main_frame_timestamp"`
}
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
inputChatPhotoAnimation.MainFrameTimestamp = tmp.MainFrameTimestamp
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
fieldAnimation, _ := UnmarshalInputFile(tmp.Animation)
inputChatPhotoAnimation.Animation = fieldAnimation
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return nil
2020-11-30 09:33:47 +00:00
}
// Represents a user
type User struct {
2022-03-13 04:04:12 +00:00
meta
// User identifier
Id int64 `json:"id"`
// User access hash
AccessHash JsonInt64 `json:"access_hash"`
// First name of the user
FirstName string `json:"first_name"`
// Last name of the user
LastName string `json:"last_name"`
// Username of the user
Username string `json:"username"`
// Phone number of the user
PhoneNumber string `json:"phone_number"`
// Current online status of the user
Status UserStatus `json:"status"`
// Profile photo of the user; may be null
ProfilePhoto *ProfilePhoto `json:"profile_photo"`
// The user is a contact of the current user
IsContact bool `json:"is_contact"`
// The user is a contact of the current user and the current user is a contact of the user
IsMutualContact bool `json:"is_mutual_contact"`
// True, if the user is verified
IsVerified bool `json:"is_verified"`
// True, if the user is Telegram support account
IsSupport bool `json:"is_support"`
// If non-empty, it contains a human-readable description of the reason why access to this user must be restricted
RestrictionReason string `json:"restriction_reason"`
// True, if many users reported this user as a scam
IsScam bool `json:"is_scam"`
// True, if many users reported this user as a fake account
IsFake bool `json:"is_fake"`
// If false, the user is inaccessible, and the only information known about the user is inside this class. Identifier of the user can't be passed to any method except GetUser
HaveAccess bool `json:"have_access"`
// Type of the user
Type UserType `json:"type"`
// IETF language tag of the user's language; only available to bots
LanguageCode string `json:"language_code"`
2020-11-30 09:33:47 +00:00
}
func (entity *User) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
type stub User
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-11-30 09:33:47 +00:00
}
func (*User) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUser
2020-11-30 09:33:47 +00:00
}
func (*User) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUser
2020-11-30 09:33:47 +00:00
}
func (user *User) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Id int64 `json:"id"`
AccessHash JsonInt64 `json:"access_hash"`
FirstName string `json:"first_name"`
LastName string `json:"last_name"`
Username string `json:"username"`
PhoneNumber string `json:"phone_number"`
Status json.RawMessage `json:"status"`
ProfilePhoto *ProfilePhoto `json:"profile_photo"`
IsContact bool `json:"is_contact"`
IsMutualContact bool `json:"is_mutual_contact"`
IsVerified bool `json:"is_verified"`
IsSupport bool `json:"is_support"`
RestrictionReason string `json:"restriction_reason"`
IsScam bool `json:"is_scam"`
IsFake bool `json:"is_fake"`
HaveAccess bool `json:"have_access"`
Type json.RawMessage `json:"type"`
LanguageCode string `json:"language_code"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
user.Id = tmp.Id
user.AccessHash = tmp.AccessHash
user.FirstName = tmp.FirstName
user.LastName = tmp.LastName
user.Username = tmp.Username
user.PhoneNumber = tmp.PhoneNumber
user.ProfilePhoto = tmp.ProfilePhoto
user.IsContact = tmp.IsContact
user.IsMutualContact = tmp.IsMutualContact
user.IsVerified = tmp.IsVerified
user.IsSupport = tmp.IsSupport
user.RestrictionReason = tmp.RestrictionReason
user.IsScam = tmp.IsScam
user.IsFake = tmp.IsFake
user.HaveAccess = tmp.HaveAccess
user.LanguageCode = tmp.LanguageCode
fieldStatus, _ := UnmarshalUserStatus(tmp.Status)
user.Status = fieldStatus
fieldType, _ := UnmarshalUserType(tmp.Type)
user.Type = fieldType
return nil
2020-11-30 09:33:47 +00:00
}
// Contains full information about a user
type UserFullInfo struct {
2022-03-13 04:04:12 +00:00
meta
// User profile photo; may be null
Photo *ChatPhoto `json:"photo"`
// True, if the user is blocked by the current user
IsBlocked bool `json:"is_blocked"`
// True, if the user can be called
CanBeCalled bool `json:"can_be_called"`
// True, if a video call can be created with the user
SupportsVideoCalls bool `json:"supports_video_calls"`
// True, if the user can't be called due to their privacy settings
HasPrivateCalls bool `json:"has_private_calls"`
// True, if the user can't be linked in forwarded messages due to their privacy settings
HasPrivateForwards bool `json:"has_private_forwards"`
// True, if the current user needs to explicitly allow to share their phone number with the user when the method addContact is used
NeedPhoneNumberPrivacyException bool `json:"need_phone_number_privacy_exception"`
// A short user bio
Bio string `json:"bio"`
// For bots, the text that is shown on the bot's profile page and is sent together with the link when users share the bot
ShareText string `json:"share_text"`
// For bots, the text shown in the chat with the bot if the chat is empty
Description string `json:"description"`
// Number of group chats where both the other user and the current user are a member; 0 for the current user
GroupInCommonCount int32 `json:"group_in_common_count"`
// For bots, list of the bot commands
Commands []*BotCommand `json:"commands"`
2018-08-30 14:55:42 +00:00
}
2020-11-30 09:33:47 +00:00
func (entity *UserFullInfo) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub UserFullInfo
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2020-11-30 09:33:47 +00:00
func (*UserFullInfo) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUserFullInfo
2018-08-30 14:55:42 +00:00
}
2020-11-30 09:33:47 +00:00
func (*UserFullInfo) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUserFullInfo
2018-08-30 14:55:42 +00:00
}
// Represents a list of users
type Users struct {
2022-03-13 04:04:12 +00:00
meta
// Approximate total number of users found
TotalCount int32 `json:"total_count"`
// A list of user identifiers
UserIds []int64 `json:"user_ids"`
2018-08-30 14:55:42 +00:00
}
func (entity *Users) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub Users
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*Users) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUsers
2018-08-30 14:55:42 +00:00
}
func (*Users) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUsers
2018-08-30 14:55:42 +00:00
}
2020-02-03 12:56:20 +00:00
// Contains information about a chat administrator
type ChatAdministrator struct {
2022-03-13 04:04:12 +00:00
meta
// User identifier of the administrator
UserId int64 `json:"user_id"`
// Custom title of the administrator
CustomTitle string `json:"custom_title"`
// True, if the user is the owner of the chat
IsOwner bool `json:"is_owner"`
2020-02-03 12:56:20 +00:00
}
func (entity *ChatAdministrator) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatAdministrator
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-02-03 12:56:20 +00:00
}
func (*ChatAdministrator) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatAdministrator
2020-02-03 12:56:20 +00:00
}
func (*ChatAdministrator) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatAdministrator
2020-02-03 12:56:20 +00:00
}
// Represents a list of chat administrators
type ChatAdministrators struct {
2022-03-13 04:04:12 +00:00
meta
// A list of chat administrators
Administrators []*ChatAdministrator `json:"administrators"`
2020-02-03 12:56:20 +00:00
}
func (entity *ChatAdministrators) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatAdministrators
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-02-03 12:56:20 +00:00
}
func (*ChatAdministrators) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatAdministrators
2020-02-03 12:56:20 +00:00
}
func (*ChatAdministrators) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatAdministrators
2020-02-03 12:56:20 +00:00
}
2019-09-10 12:36:54 +00:00
// Describes actions that a user is allowed to take in a chat
type ChatPermissions struct {
2022-03-13 04:04:12 +00:00
meta
// True, if the user can send text messages, contacts, locations, and venues
CanSendMessages bool `json:"can_send_messages"`
// True, if the user can send audio files, documents, photos, videos, video notes, and voice notes. Implies can_send_messages permissions
CanSendMediaMessages bool `json:"can_send_media_messages"`
// True, if the user can send polls. Implies can_send_messages permissions
CanSendPolls bool `json:"can_send_polls"`
// True, if the user can send stickers. Implies can_send_messages permissions
CanSendStickers bool `json:"can_send_stickers"`
// True, if the user can send animations. Implies can_send_messages permissions
CanSendAnimations bool `json:"can_send_animations"`
// True, if the user can send games. Implies can_send_messages permissions
CanSendGames bool `json:"can_send_games"`
// True, if the user can use inline bots. Implies can_send_messages permissions
CanUseInlineBots bool `json:"can_use_inline_bots"`
// True, if the user may add a web page preview to their messages. Implies can_send_messages permissions
CanAddWebPagePreviews bool `json:"can_add_web_page_previews"`
// True, if the user can change the chat title, photo, and other settings
CanChangeInfo bool `json:"can_change_info"`
// True, if the user can invite new users to the chat
CanInviteUsers bool `json:"can_invite_users"`
// True, if the user can pin messages
CanPinMessages bool `json:"can_pin_messages"`
2019-09-10 12:36:54 +00:00
}
func (entity *ChatPermissions) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-09-10 12:36:54 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatPermissions
2019-09-10 12:36:54 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-09-10 12:36:54 +00:00
}
func (*ChatPermissions) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatPermissions
2019-09-10 12:36:54 +00:00
}
func (*ChatPermissions) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatPermissions
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
// The user is the owner of the chat and has all the administrator privileges
2018-08-30 14:55:42 +00:00
type ChatMemberStatusCreator struct {
2022-03-13 04:04:12 +00:00
meta
// A custom title of the owner; 0-16 characters without emojis; applicable to supergroups only
CustomTitle string `json:"custom_title"`
// True, if the creator isn't shown in the chat member list and sends messages anonymously; applicable to supergroups only
IsAnonymous bool `json:"is_anonymous"`
// True, if the user is a member of the chat
IsMember bool `json:"is_member"`
2018-08-30 14:55:42 +00:00
}
func (entity *ChatMemberStatusCreator) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatMemberStatusCreator
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*ChatMemberStatusCreator) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatMemberStatus
2018-08-30 14:55:42 +00:00
}
func (*ChatMemberStatusCreator) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatMemberStatusCreator
2018-08-30 14:55:42 +00:00
}
func (*ChatMemberStatusCreator) ChatMemberStatusType() string {
2022-03-13 04:04:12 +00:00
return TypeChatMemberStatusCreator
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// The user is a member of the chat and has some additional privileges. In basic groups, administrators can edit and delete messages sent by others, add new members, ban unprivileged members, and manage video chats. In supergroups and channels, there are more detailed options for administrator privileges
2018-08-30 14:55:42 +00:00
type ChatMemberStatusAdministrator struct {
2022-03-13 04:04:12 +00:00
meta
// A custom title of the administrator; 0-16 characters without emojis; applicable to supergroups only
CustomTitle string `json:"custom_title"`
// True, if the current user can edit the administrator privileges for the called user
CanBeEdited bool `json:"can_be_edited"`
// True, if the administrator can get chat event log, get chat statistics, get message statistics in channels, get channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other privilege; applicable to supergroups and channels only
CanManageChat bool `json:"can_manage_chat"`
// True, if the administrator can change the chat title, photo, and other settings
CanChangeInfo bool `json:"can_change_info"`
// True, if the administrator can create channel posts; applicable to channels only
CanPostMessages bool `json:"can_post_messages"`
// True, if the administrator can edit messages of other users and pin messages; applicable to channels only
CanEditMessages bool `json:"can_edit_messages"`
// True, if the administrator can delete messages of other users
CanDeleteMessages bool `json:"can_delete_messages"`
// True, if the administrator can invite new users to the chat
CanInviteUsers bool `json:"can_invite_users"`
// True, if the administrator can restrict, ban, or unban chat members; always true for channels
CanRestrictMembers bool `json:"can_restrict_members"`
// True, if the administrator can pin messages; applicable to basic groups and supergroups only
CanPinMessages bool `json:"can_pin_messages"`
// True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that were directly or indirectly promoted by them
CanPromoteMembers bool `json:"can_promote_members"`
// True, if the administrator can manage video chats
CanManageVideoChats bool `json:"can_manage_video_chats"`
// True, if the administrator isn't shown in the chat member list and sends messages anonymously; applicable to supergroups only
IsAnonymous bool `json:"is_anonymous"`
2018-08-30 14:55:42 +00:00
}
func (entity *ChatMemberStatusAdministrator) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatMemberStatusAdministrator
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*ChatMemberStatusAdministrator) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatMemberStatus
2018-08-30 14:55:42 +00:00
}
func (*ChatMemberStatusAdministrator) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatMemberStatusAdministrator
2018-08-30 14:55:42 +00:00
}
func (*ChatMemberStatusAdministrator) ChatMemberStatusType() string {
2022-03-13 04:04:12 +00:00
return TypeChatMemberStatusAdministrator
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// The user is a member of the chat, without any additional privileges or restrictions
2022-03-13 04:04:12 +00:00
type ChatMemberStatusMember struct{
meta
2018-08-30 14:55:42 +00:00
}
func (entity *ChatMemberStatusMember) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatMemberStatusMember
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*ChatMemberStatusMember) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatMemberStatus
2018-08-30 14:55:42 +00:00
}
func (*ChatMemberStatusMember) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatMemberStatusMember
2018-08-30 14:55:42 +00:00
}
func (*ChatMemberStatusMember) ChatMemberStatusType() string {
2022-03-13 04:04:12 +00:00
return TypeChatMemberStatusMember
2018-08-30 14:55:42 +00:00
}
// The user is under certain restrictions in the chat. Not supported in basic groups and channels
type ChatMemberStatusRestricted struct {
2022-03-13 04:04:12 +00:00
meta
// True, if the user is a member of the chat
IsMember bool `json:"is_member"`
// Point in time (Unix timestamp) when restrictions will be lifted from the user; 0 if never. If the user is restricted for more than 366 days or for less than 30 seconds from the current time, the user is considered to be restricted forever
RestrictedUntilDate int32 `json:"restricted_until_date"`
// User permissions in the chat
Permissions *ChatPermissions `json:"permissions"`
2018-08-30 14:55:42 +00:00
}
func (entity *ChatMemberStatusRestricted) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatMemberStatusRestricted
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*ChatMemberStatusRestricted) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatMemberStatus
2018-08-30 14:55:42 +00:00
}
func (*ChatMemberStatusRestricted) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatMemberStatusRestricted
2018-08-30 14:55:42 +00:00
}
func (*ChatMemberStatusRestricted) ChatMemberStatusType() string {
2022-03-13 04:04:12 +00:00
return TypeChatMemberStatusRestricted
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// The user or the chat is not a chat member
2022-03-13 04:04:12 +00:00
type ChatMemberStatusLeft struct{
meta
2018-08-30 14:55:42 +00:00
}
func (entity *ChatMemberStatusLeft) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatMemberStatusLeft
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*ChatMemberStatusLeft) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatMemberStatus
2018-08-30 14:55:42 +00:00
}
func (*ChatMemberStatusLeft) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatMemberStatusLeft
2018-08-30 14:55:42 +00:00
}
func (*ChatMemberStatusLeft) ChatMemberStatusType() string {
2022-03-13 04:04:12 +00:00
return TypeChatMemberStatusLeft
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// The user or the chat was banned (and hence is not a member of the chat). Implies the user can't return to the chat, view messages, or be used as a participant identifier to join a video chat of the chat
2018-08-30 14:55:42 +00:00
type ChatMemberStatusBanned struct {
2022-03-13 04:04:12 +00:00
meta
// Point in time (Unix timestamp) when the user will be unbanned; 0 if never. If the user is banned for more than 366 days or for less than 30 seconds from the current time, the user is considered to be banned forever. Always 0 in basic groups
BannedUntilDate int32 `json:"banned_until_date"`
2018-08-30 14:55:42 +00:00
}
func (entity *ChatMemberStatusBanned) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatMemberStatusBanned
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*ChatMemberStatusBanned) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatMemberStatus
2018-08-30 14:55:42 +00:00
}
func (*ChatMemberStatusBanned) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatMemberStatusBanned
2018-08-30 14:55:42 +00:00
}
func (*ChatMemberStatusBanned) ChatMemberStatusType() string {
2022-03-13 04:04:12 +00:00
return TypeChatMemberStatusBanned
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// Describes a user or a chat as a member of another chat
2018-08-30 14:55:42 +00:00
type ChatMember struct {
2022-03-13 04:04:12 +00:00
meta
// Identifier of the chat member. Currently, other chats can be only Left or Banned. Only supergroups and channels can have other chats as Left or Banned members and these chats must be supergroups or channels
MemberId MessageSender `json:"member_id"`
// Identifier of a user that invited/promoted/banned this member in the chat; 0 if unknown
InviterUserId int64 `json:"inviter_user_id"`
// Point in time (Unix timestamp) when the user joined the chat
JoinedChatDate int32 `json:"joined_chat_date"`
// Status of the member in the chat
Status ChatMemberStatus `json:"status"`
2018-08-30 14:55:42 +00:00
}
func (entity *ChatMember) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatMember
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*ChatMember) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatMember
2018-08-30 14:55:42 +00:00
}
func (*ChatMember) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatMember
2018-08-30 14:55:42 +00:00
}
func (chatMember *ChatMember) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
MemberId json.RawMessage `json:"member_id"`
InviterUserId int64 `json:"inviter_user_id"`
JoinedChatDate int32 `json:"joined_chat_date"`
Status json.RawMessage `json:"status"`
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
chatMember.InviterUserId = tmp.InviterUserId
chatMember.JoinedChatDate = tmp.JoinedChatDate
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
fieldMemberId, _ := UnmarshalMessageSender(tmp.MemberId)
chatMember.MemberId = fieldMemberId
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
fieldStatus, _ := UnmarshalChatMemberStatus(tmp.Status)
chatMember.Status = fieldStatus
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return nil
2018-08-30 14:55:42 +00:00
}
// Contains a list of chat members
type ChatMembers struct {
2022-03-13 04:04:12 +00:00
meta
// Approximate total number of chat members found
TotalCount int32 `json:"total_count"`
// A list of chat members
Members []*ChatMember `json:"members"`
2018-08-30 14:55:42 +00:00
}
func (entity *ChatMembers) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatMembers
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*ChatMembers) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatMembers
2018-08-30 14:55:42 +00:00
}
func (*ChatMembers) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatMembers
2018-08-30 14:55:42 +00:00
}
2019-09-10 12:36:54 +00:00
// Returns contacts of the user
2022-03-13 04:04:12 +00:00
type ChatMembersFilterContacts struct{
meta
2019-09-10 12:36:54 +00:00
}
func (entity *ChatMembersFilterContacts) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-09-10 12:36:54 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatMembersFilterContacts
2019-09-10 12:36:54 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-09-10 12:36:54 +00:00
}
func (*ChatMembersFilterContacts) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatMembersFilter
2019-09-10 12:36:54 +00:00
}
func (*ChatMembersFilterContacts) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatMembersFilterContacts
2019-09-10 12:36:54 +00:00
}
func (*ChatMembersFilterContacts) ChatMembersFilterType() string {
2022-03-13 04:04:12 +00:00
return TypeChatMembersFilterContacts
2019-09-10 12:36:54 +00:00
}
2020-02-03 12:56:20 +00:00
// Returns the owner and administrators
2022-03-13 04:04:12 +00:00
type ChatMembersFilterAdministrators struct{
meta
2018-09-05 21:45:29 +00:00
}
func (entity *ChatMembersFilterAdministrators) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatMembersFilterAdministrators
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
func (*ChatMembersFilterAdministrators) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatMembersFilter
2018-09-05 21:45:29 +00:00
}
func (*ChatMembersFilterAdministrators) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatMembersFilterAdministrators
2018-09-05 21:45:29 +00:00
}
func (*ChatMembersFilterAdministrators) ChatMembersFilterType() string {
2022-03-13 04:04:12 +00:00
return TypeChatMembersFilterAdministrators
2018-09-05 21:45:29 +00:00
}
// Returns all chat members, including restricted chat members
2022-03-13 04:04:12 +00:00
type ChatMembersFilterMembers struct{
meta
2018-09-05 21:45:29 +00:00
}
func (entity *ChatMembersFilterMembers) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatMembersFilterMembers
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
func (*ChatMembersFilterMembers) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatMembersFilter
2018-09-05 21:45:29 +00:00
}
func (*ChatMembersFilterMembers) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatMembersFilterMembers
2018-09-05 21:45:29 +00:00
}
func (*ChatMembersFilterMembers) ChatMembersFilterType() string {
2022-03-13 04:04:12 +00:00
return TypeChatMembersFilterMembers
2018-09-05 21:45:29 +00:00
}
2020-11-30 09:33:47 +00:00
// Returns users which can be mentioned in the chat
type ChatMembersFilterMention struct {
2022-03-13 04:04:12 +00:00
meta
// If non-zero, the identifier of the current message thread
MessageThreadId int64 `json:"message_thread_id"`
2020-11-30 09:33:47 +00:00
}
func (entity *ChatMembersFilterMention) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatMembersFilterMention
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-11-30 09:33:47 +00:00
}
func (*ChatMembersFilterMention) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatMembersFilter
2020-11-30 09:33:47 +00:00
}
func (*ChatMembersFilterMention) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatMembersFilterMention
2020-11-30 09:33:47 +00:00
}
func (*ChatMembersFilterMention) ChatMembersFilterType() string {
2022-03-13 04:04:12 +00:00
return TypeChatMembersFilterMention
2020-11-30 09:33:47 +00:00
}
2018-09-05 21:45:29 +00:00
// Returns users under certain restrictions in the chat; can be used only by administrators in a supergroup
2022-03-13 04:04:12 +00:00
type ChatMembersFilterRestricted struct{
meta
2018-09-05 21:45:29 +00:00
}
func (entity *ChatMembersFilterRestricted) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatMembersFilterRestricted
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
func (*ChatMembersFilterRestricted) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatMembersFilter
2018-09-05 21:45:29 +00:00
}
func (*ChatMembersFilterRestricted) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatMembersFilterRestricted
2018-09-05 21:45:29 +00:00
}
func (*ChatMembersFilterRestricted) ChatMembersFilterType() string {
2022-03-13 04:04:12 +00:00
return TypeChatMembersFilterRestricted
2018-09-05 21:45:29 +00:00
}
// Returns users banned from the chat; can be used only by administrators in a supergroup or in a channel
2022-03-13 04:04:12 +00:00
type ChatMembersFilterBanned struct{
meta
2018-09-05 21:45:29 +00:00
}
func (entity *ChatMembersFilterBanned) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatMembersFilterBanned
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
func (*ChatMembersFilterBanned) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatMembersFilter
2018-09-05 21:45:29 +00:00
}
func (*ChatMembersFilterBanned) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatMembersFilterBanned
2018-09-05 21:45:29 +00:00
}
func (*ChatMembersFilterBanned) ChatMembersFilterType() string {
2022-03-13 04:04:12 +00:00
return TypeChatMembersFilterBanned
2018-09-05 21:45:29 +00:00
}
// Returns bot members of the chat
2022-03-13 04:04:12 +00:00
type ChatMembersFilterBots struct{
meta
2018-09-05 21:45:29 +00:00
}
func (entity *ChatMembersFilterBots) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatMembersFilterBots
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
func (*ChatMembersFilterBots) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatMembersFilter
2018-09-05 21:45:29 +00:00
}
func (*ChatMembersFilterBots) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatMembersFilterBots
2018-09-05 21:45:29 +00:00
}
func (*ChatMembersFilterBots) ChatMembersFilterType() string {
2022-03-13 04:04:12 +00:00
return TypeChatMembersFilterBots
2018-09-05 21:45:29 +00:00
}
2018-08-30 14:55:42 +00:00
// Returns recently active users in reverse chronological order
2022-03-13 04:04:12 +00:00
type SupergroupMembersFilterRecent struct{
meta
2018-08-30 14:55:42 +00:00
}
func (entity *SupergroupMembersFilterRecent) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub SupergroupMembersFilterRecent
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*SupergroupMembersFilterRecent) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassSupergroupMembersFilter
2018-08-30 14:55:42 +00:00
}
func (*SupergroupMembersFilterRecent) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeSupergroupMembersFilterRecent
2018-08-30 14:55:42 +00:00
}
func (*SupergroupMembersFilterRecent) SupergroupMembersFilterType() string {
2022-03-13 04:04:12 +00:00
return TypeSupergroupMembersFilterRecent
2018-08-30 14:55:42 +00:00
}
2019-09-10 12:36:54 +00:00
// Returns contacts of the user, which are members of the supergroup or channel
type SupergroupMembersFilterContacts struct {
2022-03-13 04:04:12 +00:00
meta
// Query to search for
Query string `json:"query"`
2019-09-10 12:36:54 +00:00
}
func (entity *SupergroupMembersFilterContacts) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-09-10 12:36:54 +00:00
2022-03-13 04:04:12 +00:00
type stub SupergroupMembersFilterContacts
2019-09-10 12:36:54 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-09-10 12:36:54 +00:00
}
func (*SupergroupMembersFilterContacts) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassSupergroupMembersFilter
2019-09-10 12:36:54 +00:00
}
func (*SupergroupMembersFilterContacts) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeSupergroupMembersFilterContacts
2019-09-10 12:36:54 +00:00
}
func (*SupergroupMembersFilterContacts) SupergroupMembersFilterType() string {
2022-03-13 04:04:12 +00:00
return TypeSupergroupMembersFilterContacts
2019-09-10 12:36:54 +00:00
}
2020-02-03 12:56:20 +00:00
// Returns the owner and administrators
2022-03-13 04:04:12 +00:00
type SupergroupMembersFilterAdministrators struct{
meta
2018-08-30 14:55:42 +00:00
}
func (entity *SupergroupMembersFilterAdministrators) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub SupergroupMembersFilterAdministrators
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*SupergroupMembersFilterAdministrators) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassSupergroupMembersFilter
2018-08-30 14:55:42 +00:00
}
func (*SupergroupMembersFilterAdministrators) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeSupergroupMembersFilterAdministrators
2018-08-30 14:55:42 +00:00
}
func (*SupergroupMembersFilterAdministrators) SupergroupMembersFilterType() string {
2022-03-13 04:04:12 +00:00
return TypeSupergroupMembersFilterAdministrators
2018-08-30 14:55:42 +00:00
}
// Used to search for supergroup or channel members via a (string) query
type SupergroupMembersFilterSearch struct {
2022-03-13 04:04:12 +00:00
meta
// Query to search for
Query string `json:"query"`
2018-08-30 14:55:42 +00:00
}
func (entity *SupergroupMembersFilterSearch) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub SupergroupMembersFilterSearch
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*SupergroupMembersFilterSearch) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassSupergroupMembersFilter
2018-08-30 14:55:42 +00:00
}
func (*SupergroupMembersFilterSearch) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeSupergroupMembersFilterSearch
2018-08-30 14:55:42 +00:00
}
func (*SupergroupMembersFilterSearch) SupergroupMembersFilterType() string {
2022-03-13 04:04:12 +00:00
return TypeSupergroupMembersFilterSearch
2018-08-30 14:55:42 +00:00
}
// Returns restricted supergroup members; can be used only by administrators
type SupergroupMembersFilterRestricted struct {
2022-03-13 04:04:12 +00:00
meta
// Query to search for
Query string `json:"query"`
2018-08-30 14:55:42 +00:00
}
func (entity *SupergroupMembersFilterRestricted) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub SupergroupMembersFilterRestricted
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*SupergroupMembersFilterRestricted) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassSupergroupMembersFilter
2018-08-30 14:55:42 +00:00
}
func (*SupergroupMembersFilterRestricted) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeSupergroupMembersFilterRestricted
2018-08-30 14:55:42 +00:00
}
func (*SupergroupMembersFilterRestricted) SupergroupMembersFilterType() string {
2022-03-13 04:04:12 +00:00
return TypeSupergroupMembersFilterRestricted
2018-08-30 14:55:42 +00:00
}
// Returns users banned from the supergroup or channel; can be used only by administrators
type SupergroupMembersFilterBanned struct {
2022-03-13 04:04:12 +00:00
meta
// Query to search for
Query string `json:"query"`
2018-08-30 14:55:42 +00:00
}
func (entity *SupergroupMembersFilterBanned) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub SupergroupMembersFilterBanned
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*SupergroupMembersFilterBanned) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassSupergroupMembersFilter
2018-08-30 14:55:42 +00:00
}
func (*SupergroupMembersFilterBanned) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeSupergroupMembersFilterBanned
2018-08-30 14:55:42 +00:00
}
func (*SupergroupMembersFilterBanned) SupergroupMembersFilterType() string {
2022-03-13 04:04:12 +00:00
return TypeSupergroupMembersFilterBanned
2018-08-30 14:55:42 +00:00
}
2020-11-30 09:33:47 +00:00
// Returns users which can be mentioned in the supergroup
type SupergroupMembersFilterMention struct {
2022-03-13 04:04:12 +00:00
meta
// Query to search for
Query string `json:"query"`
// If non-zero, the identifier of the current message thread
MessageThreadId int64 `json:"message_thread_id"`
2020-11-30 09:33:47 +00:00
}
func (entity *SupergroupMembersFilterMention) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
type stub SupergroupMembersFilterMention
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-11-30 09:33:47 +00:00
}
func (*SupergroupMembersFilterMention) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassSupergroupMembersFilter
2020-11-30 09:33:47 +00:00
}
func (*SupergroupMembersFilterMention) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeSupergroupMembersFilterMention
2020-11-30 09:33:47 +00:00
}
func (*SupergroupMembersFilterMention) SupergroupMembersFilterType() string {
2022-03-13 04:04:12 +00:00
return TypeSupergroupMembersFilterMention
2020-11-30 09:33:47 +00:00
}
2018-08-30 14:55:42 +00:00
// Returns bot members of the supergroup or channel
2022-03-13 04:04:12 +00:00
type SupergroupMembersFilterBots struct{
meta
2018-08-30 14:55:42 +00:00
}
func (entity *SupergroupMembersFilterBots) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub SupergroupMembersFilterBots
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*SupergroupMembersFilterBots) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassSupergroupMembersFilter
2018-08-30 14:55:42 +00:00
}
func (*SupergroupMembersFilterBots) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeSupergroupMembersFilterBots
2018-08-30 14:55:42 +00:00
}
func (*SupergroupMembersFilterBots) SupergroupMembersFilterType() string {
2022-03-13 04:04:12 +00:00
return TypeSupergroupMembersFilterBots
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// Contains a chat invite link
type ChatInviteLink struct {
2022-03-13 04:04:12 +00:00
meta
// Chat invite link
InviteLink string `json:"invite_link"`
// Name of the link
Name string `json:"name"`
// User identifier of an administrator created the link
CreatorUserId int64 `json:"creator_user_id"`
// Point in time (Unix timestamp) when the link was created
Date int32 `json:"date"`
// Point in time (Unix timestamp) when the link was last edited; 0 if never or unknown
EditDate int32 `json:"edit_date"`
// Point in time (Unix timestamp) when the link will expire; 0 if never
ExpirationDate int32 `json:"expiration_date"`
// The maximum number of members, which can join the chat using the link simultaneously; 0 if not limited. Always 0 if the link requires approval
MemberLimit int32 `json:"member_limit"`
// Number of chat members, which joined the chat using the link
MemberCount int32 `json:"member_count"`
// Number of pending join requests created using this link
PendingJoinRequestCount int32 `json:"pending_join_request_count"`
// True, if the link only creates join request. If true, total number of joining members will be unlimited
CreatesJoinRequest bool `json:"creates_join_request"`
// True, if the link is primary. Primary invite link can't have name, expiration date, or usage limit. There is exactly one primary invite link for each administrator with can_invite_users right at a given time
IsPrimary bool `json:"is_primary"`
// True, if the link was revoked
IsRevoked bool `json:"is_revoked"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *ChatInviteLink) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatInviteLink
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatInviteLink) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatInviteLink
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatInviteLink) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatInviteLink
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// Contains a list of chat invite links
type ChatInviteLinks struct {
2022-03-13 04:04:12 +00:00
meta
// Approximate total number of chat invite links found
TotalCount int32 `json:"total_count"`
// List of invite links
InviteLinks []*ChatInviteLink `json:"invite_links"`
2021-12-30 05:55:02 +00:00
}
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
func (entity *ChatInviteLinks) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatInviteLinks
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
func (*ChatInviteLinks) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatInviteLinks
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatInviteLinks) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatInviteLinks
2021-12-30 05:55:02 +00:00
}
// Describes a chat administrator with a number of active and revoked chat invite links
type ChatInviteLinkCount struct {
2022-03-13 04:04:12 +00:00
meta
// Administrator's user identifier
UserId int64 `json:"user_id"`
// Number of active invite links
InviteLinkCount int32 `json:"invite_link_count"`
// Number of revoked invite links
RevokedInviteLinkCount int32 `json:"revoked_invite_link_count"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *ChatInviteLinkCount) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatInviteLinkCount
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatInviteLinkCount) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatInviteLinkCount
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatInviteLinkCount) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatInviteLinkCount
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// Contains a list of chat invite link counts
type ChatInviteLinkCounts struct {
2022-03-13 04:04:12 +00:00
meta
// List of invite link counts
InviteLinkCounts []*ChatInviteLinkCount `json:"invite_link_counts"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *ChatInviteLinkCounts) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatInviteLinkCounts
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatInviteLinkCounts) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatInviteLinkCounts
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatInviteLinkCounts) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatInviteLinkCounts
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// Describes a chat member joined a chat via an invite link
type ChatInviteLinkMember struct {
2022-03-13 04:04:12 +00:00
meta
// User identifier
UserId int64 `json:"user_id"`
// Point in time (Unix timestamp) when the user joined the chat
JoinedChatDate int32 `json:"joined_chat_date"`
// User identifier of the chat administrator, approved user join request
ApproverUserId int64 `json:"approver_user_id"`
2021-12-30 05:55:02 +00:00
}
2018-10-23 12:38:10 +00:00
2021-12-30 05:55:02 +00:00
func (entity *ChatInviteLinkMember) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-10-23 12:38:10 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatInviteLinkMember
2018-10-23 12:38:10 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
2018-10-23 12:38:10 +00:00
2021-12-30 05:55:02 +00:00
func (*ChatInviteLinkMember) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatInviteLinkMember
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatInviteLinkMember) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatInviteLinkMember
2021-12-30 05:55:02 +00:00
}
// Contains a list of chat members joined a chat via an invite link
type ChatInviteLinkMembers struct {
2022-03-13 04:04:12 +00:00
meta
// Approximate total number of chat members found
TotalCount int32 `json:"total_count"`
// List of chat members, joined a chat via an invite link
Members []*ChatInviteLinkMember `json:"members"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *ChatInviteLinkMembers) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatInviteLinkMembers
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatInviteLinkMembers) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatInviteLinkMembers
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatInviteLinkMembers) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatInviteLinkMembers
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// Contains information about a chat invite link
type ChatInviteLinkInfo struct {
2022-03-13 04:04:12 +00:00
meta
// Chat identifier of the invite link; 0 if the user has no access to the chat before joining
ChatId int64 `json:"chat_id"`
// If non-zero, the amount of time for which read access to the chat will remain available, in seconds
AccessibleFor int32 `json:"accessible_for"`
// Type of the chat
Type ChatType `json:"type"`
// Title of the chat
Title string `json:"title"`
// Chat photo; may be null
Photo *ChatPhotoInfo `json:"photo"`
// Chat description
Description string `json:"description"`
// Number of members in the chat
MemberCount int32 `json:"member_count"`
// User identifiers of some chat members that may be known to the current user
MemberUserIds []int64 `json:"member_user_ids"`
// True, if the link only creates join request
CreatesJoinRequest bool `json:"creates_join_request"`
// True, if the chat is a public supergroup or channel, i.e. it has a username or it is a location-based supergroup
IsPublic bool `json:"is_public"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *ChatInviteLinkInfo) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatInviteLinkInfo
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatInviteLinkInfo) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatInviteLinkInfo
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatInviteLinkInfo) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatInviteLinkInfo
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (chatInviteLinkInfo *ChatInviteLinkInfo) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
ChatId int64 `json:"chat_id"`
AccessibleFor int32 `json:"accessible_for"`
Type json.RawMessage `json:"type"`
Title string `json:"title"`
Photo *ChatPhotoInfo `json:"photo"`
Description string `json:"description"`
MemberCount int32 `json:"member_count"`
MemberUserIds []int64 `json:"member_user_ids"`
CreatesJoinRequest bool `json:"creates_join_request"`
IsPublic bool `json:"is_public"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
chatInviteLinkInfo.ChatId = tmp.ChatId
chatInviteLinkInfo.AccessibleFor = tmp.AccessibleFor
chatInviteLinkInfo.Title = tmp.Title
chatInviteLinkInfo.Photo = tmp.Photo
chatInviteLinkInfo.Description = tmp.Description
chatInviteLinkInfo.MemberCount = tmp.MemberCount
chatInviteLinkInfo.MemberUserIds = tmp.MemberUserIds
chatInviteLinkInfo.CreatesJoinRequest = tmp.CreatesJoinRequest
chatInviteLinkInfo.IsPublic = tmp.IsPublic
fieldType, _ := UnmarshalChatType(tmp.Type)
chatInviteLinkInfo.Type = fieldType
return nil
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// Describes a user that sent a join request and waits for administrator approval
type ChatJoinRequest struct {
2022-03-13 04:04:12 +00:00
meta
// User identifier
UserId int64 `json:"user_id"`
// Point in time (Unix timestamp) when the user sent the join request
Date int32 `json:"date"`
// A short bio of the user
Bio string `json:"bio"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *ChatJoinRequest) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatJoinRequest
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatJoinRequest) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatJoinRequest
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatJoinRequest) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatJoinRequest
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// Contains a list of requests to join a chat
type ChatJoinRequests struct {
2022-03-13 04:04:12 +00:00
meta
// Approximate total number of requests found
TotalCount int32 `json:"total_count"`
// List of the requests
Requests []*ChatJoinRequest `json:"requests"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *ChatJoinRequests) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatJoinRequests
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatJoinRequests) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatJoinRequests
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatJoinRequests) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatJoinRequests
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// Contains information about pending join requests for a chat
type ChatJoinRequestsInfo struct {
2022-03-13 04:04:12 +00:00
meta
// Total number of pending join requests
TotalCount int32 `json:"total_count"`
// Identifiers of at most 3 users sent the newest pending join requests
UserIds []int64 `json:"user_ids"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *ChatJoinRequestsInfo) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatJoinRequestsInfo
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*ChatJoinRequestsInfo) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatJoinRequestsInfo
2021-12-30 05:55:02 +00:00
}
func (*ChatJoinRequestsInfo) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatJoinRequestsInfo
2021-12-30 05:55:02 +00:00
}
// Represents a basic group of 0-200 users (must be upgraded to a supergroup to accommodate more than 200 users)
type BasicGroup struct {
2022-03-13 04:04:12 +00:00
meta
// Group identifier
Id int64 `json:"id"`
// Group access hash
AccessHash JsonInt64 `json:"access_hash"`
// Number of members in the group
MemberCount int32 `json:"member_count"`
// Status of the current user in the group
Status ChatMemberStatus `json:"status"`
// True, if the group is active
IsActive bool `json:"is_active"`
// Identifier of the supergroup to which this group was upgraded; 0 if none
UpgradedToSupergroupId int64 `json:"upgraded_to_supergroup_id"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *BasicGroup) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub BasicGroup
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*BasicGroup) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassBasicGroup
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*BasicGroup) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeBasicGroup
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (basicGroup *BasicGroup) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Id int64 `json:"id"`
AccessHash JsonInt64 `json:"access_hash"`
MemberCount int32 `json:"member_count"`
Status json.RawMessage `json:"status"`
IsActive bool `json:"is_active"`
UpgradedToSupergroupId int64 `json:"upgraded_to_supergroup_id"`
}
2018-10-23 12:38:10 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2018-10-23 12:38:10 +00:00
2022-03-13 04:04:12 +00:00
basicGroup.Id = tmp.Id
basicGroup.AccessHash = tmp.AccessHash
basicGroup.MemberCount = tmp.MemberCount
basicGroup.IsActive = tmp.IsActive
basicGroup.UpgradedToSupergroupId = tmp.UpgradedToSupergroupId
2018-10-23 12:38:10 +00:00
2022-03-13 04:04:12 +00:00
fieldStatus, _ := UnmarshalChatMemberStatus(tmp.Status)
basicGroup.Status = fieldStatus
2018-10-23 12:38:10 +00:00
2022-03-13 04:04:12 +00:00
return nil
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// Contains full information about a basic group
type BasicGroupFullInfo struct {
2022-03-13 04:04:12 +00:00
meta
// Chat photo; may be null
Photo *ChatPhoto `json:"photo"`
// Group description. Updated only after the basic group is opened
Description string `json:"description"`
// User identifier of the creator of the group; 0 if unknown
CreatorUserId int64 `json:"creator_user_id"`
// Group members
Members []*ChatMember `json:"members"`
// Primary invite link for this group; may be null. For chat administrators with can_invite_users right only. Updated only after the basic group is opened
InviteLink *ChatInviteLink `json:"invite_link"`
// List of commands of bots in the group
BotCommands []*BotCommands `json:"bot_commands"`
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *BasicGroupFullInfo) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
type stub BasicGroupFullInfo
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*BasicGroupFullInfo) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassBasicGroupFullInfo
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*BasicGroupFullInfo) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeBasicGroupFullInfo
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
// Represents a supergroup or channel with zero or more members (subscribers in the case of channels). From the point of view of the system, a channel is a special kind of a supergroup: only administrators can post and see the list of members, and posts from all administrators use the name and photo of the channel instead of individual names and profile photos. Unlike supergroups, channels can have an unlimited number of subscribers
type Supergroup struct {
2022-03-13 04:04:12 +00:00
meta
// Supergroup or channel identifier
Id int64 `json:"id"`
// Supergroup or channel access hash
AccessHash JsonInt64 `json:"access_hash"`
// Username of the supergroup or channel; empty for private supergroups or channels
Username string `json:"username"`
// Point in time (Unix timestamp) when the current user joined, or the point in time when the supergroup or channel was created, in case the user is not a member
Date int32 `json:"date"`
// Status of the current user in the supergroup or channel; custom title will be always empty
Status ChatMemberStatus `json:"status"`
// Number of members in the supergroup or channel; 0 if unknown. Currently, it is guaranteed to be known only if the supergroup or channel was received through searchPublicChats, searchChatsNearby, getInactiveSupergroupChats, getSuitableDiscussionChats, getGroupsInCommon, or getUserPrivacySettingRules
MemberCount int32 `json:"member_count"`
// True, if the channel has a discussion group, or the supergroup is the designated discussion group for a channel
HasLinkedChat bool `json:"has_linked_chat"`
// True, if the supergroup is connected to a location, i.e. the supergroup is a location-based supergroup
HasLocation bool `json:"has_location"`
// True, if messages sent to the channel need to contain information about the sender. This field is only applicable to channels
SignMessages bool `json:"sign_messages"`
// True, if the slow mode is enabled in the supergroup
IsSlowModeEnabled bool `json:"is_slow_mode_enabled"`
// True, if the supergroup is a channel
IsChannel bool `json:"is_channel"`
// True, if the supergroup is a broadcast group, i.e. only administrators can send messages and there is no limit on the number of members
IsBroadcastGroup bool `json:"is_broadcast_group"`
// True, if the supergroup or channel is verified
IsVerified bool `json:"is_verified"`
// If non-empty, contains a human-readable description of the reason why access to this supergroup or channel must be restricted
RestrictionReason string `json:"restriction_reason"`
// True, if many users reported this supergroup or channel as a scam
IsScam bool `json:"is_scam"`
// True, if many users reported this supergroup or channel as a fake account
IsFake bool `json:"is_fake"`
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *Supergroup) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
type stub Supergroup
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*Supergroup) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassSupergroup
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*Supergroup) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeSupergroup
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (supergroup *Supergroup) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Id int64 `json:"id"`
AccessHash JsonInt64 `json:"access_hash"`
Username string `json:"username"`
Date int32 `json:"date"`
Status json.RawMessage `json:"status"`
MemberCount int32 `json:"member_count"`
HasLinkedChat bool `json:"has_linked_chat"`
HasLocation bool `json:"has_location"`
SignMessages bool `json:"sign_messages"`
IsSlowModeEnabled bool `json:"is_slow_mode_enabled"`
IsChannel bool `json:"is_channel"`
IsBroadcastGroup bool `json:"is_broadcast_group"`
IsVerified bool `json:"is_verified"`
RestrictionReason string `json:"restriction_reason"`
IsScam bool `json:"is_scam"`
IsFake bool `json:"is_fake"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
supergroup.Id = tmp.Id
supergroup.AccessHash = tmp.AccessHash
supergroup.Username = tmp.Username
supergroup.Date = tmp.Date
supergroup.MemberCount = tmp.MemberCount
supergroup.HasLinkedChat = tmp.HasLinkedChat
supergroup.HasLocation = tmp.HasLocation
supergroup.SignMessages = tmp.SignMessages
supergroup.IsSlowModeEnabled = tmp.IsSlowModeEnabled
supergroup.IsChannel = tmp.IsChannel
supergroup.IsBroadcastGroup = tmp.IsBroadcastGroup
supergroup.IsVerified = tmp.IsVerified
supergroup.RestrictionReason = tmp.RestrictionReason
supergroup.IsScam = tmp.IsScam
supergroup.IsFake = tmp.IsFake
fieldStatus, _ := UnmarshalChatMemberStatus(tmp.Status)
supergroup.Status = fieldStatus
return nil
2021-01-18 14:16:52 +00:00
}
2021-12-30 05:55:02 +00:00
// Contains full information about a supergroup or channel
type SupergroupFullInfo struct {
2022-03-13 04:04:12 +00:00
meta
// Chat photo; may be null
Photo *ChatPhoto `json:"photo"`
// Supergroup or channel description
Description string `json:"description"`
// Number of members in the supergroup or channel; 0 if unknown
MemberCount int32 `json:"member_count"`
// Number of privileged users in the supergroup or channel; 0 if unknown
AdministratorCount int32 `json:"administrator_count"`
// Number of restricted users in the supergroup; 0 if unknown
RestrictedCount int32 `json:"restricted_count"`
// Number of users banned from chat; 0 if unknown
BannedCount int32 `json:"banned_count"`
// Chat identifier of a discussion group for the channel, or a channel, for which the supergroup is the designated discussion group; 0 if none or unknown
LinkedChatId int64 `json:"linked_chat_id"`
// Delay between consecutive sent messages for non-administrator supergroup members, in seconds
SlowModeDelay int32 `json:"slow_mode_delay"`
// Time left before next message can be sent in the supergroup, in seconds. An updateSupergroupFullInfo update is not triggered when value of this field changes, but both new and old values are non-zero
SlowModeDelayExpiresIn float64 `json:"slow_mode_delay_expires_in"`
// True, if members of the chat can be retrieved
CanGetMembers bool `json:"can_get_members"`
// True, if the chat username can be changed
CanSetUsername bool `json:"can_set_username"`
// True, if the supergroup sticker set can be changed
CanSetStickerSet bool `json:"can_set_sticker_set"`
// True, if the supergroup location can be changed
CanSetLocation bool `json:"can_set_location"`
// True, if the supergroup or channel statistics are available
CanGetStatistics bool `json:"can_get_statistics"`
// True, if new chat members will have access to old messages. In public or discussion groups and both public and private channels, old messages are always available, so this option affects only private supergroups without a linked chat. The value of this field is only available for chat administrators
IsAllHistoryAvailable bool `json:"is_all_history_available"`
// Identifier of the supergroup sticker set; 0 if none
StickerSetId JsonInt64 `json:"sticker_set_id"`
// Location to which the supergroup is connected; may be null
Location *ChatLocation `json:"location"`
// Primary invite link for the chat; may be null. For chat administrators with can_invite_users right only
InviteLink *ChatInviteLink `json:"invite_link"`
// List of commands of bots in the group
BotCommands []*BotCommands `json:"bot_commands"`
// Identifier of the basic group from which supergroup was upgraded; 0 if none
UpgradedFromBasicGroupId int64 `json:"upgraded_from_basic_group_id"`
// Identifier of the last message in the basic group from which supergroup was upgraded; 0 if none
UpgradedFromMaxMessageId int64 `json:"upgraded_from_max_message_id"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *SupergroupFullInfo) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub SupergroupFullInfo
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*SupergroupFullInfo) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassSupergroupFullInfo
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*SupergroupFullInfo) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeSupergroupFullInfo
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// The secret chat is not yet created; waiting for the other user to get online
2022-03-13 04:04:12 +00:00
type SecretChatStatePending struct{
meta
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *SecretChatStatePending) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
type stub SecretChatStatePending
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*SecretChatStatePending) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassSecretChatState
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*SecretChatStatePending) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeSecretChatStatePending
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*SecretChatStatePending) SecretChatStateType() string {
2022-03-13 04:04:12 +00:00
return TypeSecretChatStatePending
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
// The secret chat is ready to use
2022-03-13 04:04:12 +00:00
type SecretChatStateReady struct{
meta
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *SecretChatStateReady) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub SecretChatStateReady
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*SecretChatStateReady) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassSecretChatState
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*SecretChatStateReady) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeSecretChatStateReady
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*SecretChatStateReady) SecretChatStateType() string {
2022-03-13 04:04:12 +00:00
return TypeSecretChatStateReady
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// The secret chat is closed
2022-03-13 04:04:12 +00:00
type SecretChatStateClosed struct{
meta
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *SecretChatStateClosed) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub SecretChatStateClosed
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*SecretChatStateClosed) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassSecretChatState
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*SecretChatStateClosed) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeSecretChatStateClosed
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*SecretChatStateClosed) SecretChatStateType() string {
2022-03-13 04:04:12 +00:00
return TypeSecretChatStateClosed
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// Represents a secret chat
type SecretChat struct {
2022-03-13 04:04:12 +00:00
meta
// Secret chat identifier
Id int32 `json:"id"`
// Identifier of the chat partner
UserId int64 `json:"user_id"`
// State of the secret chat
State SecretChatState `json:"state"`
// True, if the chat was created by the current user; otherwise false
IsOutbound bool `json:"is_outbound"`
// Hash of the currently used key for comparison with the hash of the chat partner's key. This is a string of 36 little-endian bytes, which must be split into groups of 2 bits, each denoting a pixel of one of 4 colors FFFFFF, D5E6F3, 2D5775, and 2F99C9. The pixels must be used to make a 12x12 square image filled from left to right, top to bottom. Alternatively, the first 32 bytes of the hash can be converted to the hexadecimal format and printed as 32 2-digit hex numbers
KeyHash []byte `json:"key_hash"`
// Secret chat layer; determines features supported by the chat partner's application. Nested text entities and underline and strikethrough entities are supported if the layer >= 101
Layer int32 `json:"layer"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *SecretChat) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub SecretChat
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*SecretChat) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassSecretChat
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*SecretChat) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeSecretChat
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (secretChat *SecretChat) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Id int32 `json:"id"`
UserId int64 `json:"user_id"`
State json.RawMessage `json:"state"`
IsOutbound bool `json:"is_outbound"`
KeyHash []byte `json:"key_hash"`
Layer int32 `json:"layer"`
}
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
secretChat.Id = tmp.Id
secretChat.UserId = tmp.UserId
secretChat.IsOutbound = tmp.IsOutbound
secretChat.KeyHash = tmp.KeyHash
secretChat.Layer = tmp.Layer
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
fieldState, _ := UnmarshalSecretChatState(tmp.State)
secretChat.State = fieldState
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return nil
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// The message was sent by a known user
type MessageSenderUser struct {
2022-03-13 04:04:12 +00:00
meta
// Identifier of the user that sent the message
UserId int64 `json:"user_id"`
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *MessageSenderUser) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
type stub MessageSenderUser
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageSenderUser) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageSender
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageSenderUser) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageSenderUser
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageSenderUser) MessageSenderType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageSenderUser
2021-12-30 05:55:02 +00:00
}
// The message was sent on behalf of a chat
type MessageSenderChat struct {
2022-03-13 04:04:12 +00:00
meta
// Identifier of the chat that sent the message
ChatId int64 `json:"chat_id"`
2021-12-30 05:55:02 +00:00
}
func (entity *MessageSenderChat) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub MessageSenderChat
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*MessageSenderChat) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageSender
2021-12-30 05:55:02 +00:00
}
func (*MessageSenderChat) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageSenderChat
2021-12-30 05:55:02 +00:00
}
func (*MessageSenderChat) MessageSenderType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageSenderChat
2021-12-30 05:55:02 +00:00
}
// Represents a list of message senders
type MessageSenders struct {
2022-03-13 04:04:12 +00:00
meta
// Approximate total number of messages senders found
TotalCount int32 `json:"total_count"`
// List of message senders
Senders []MessageSender `json:"senders"`
2021-12-30 05:55:02 +00:00
}
func (entity *MessageSenders) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub MessageSenders
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*MessageSenders) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageSenders
2021-12-30 05:55:02 +00:00
}
func (*MessageSenders) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageSenders
2021-12-30 05:55:02 +00:00
}
func (messageSenders *MessageSenders) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
TotalCount int32 `json:"total_count"`
Senders []json.RawMessage `json:"senders"`
}
2021-01-18 14:16:52 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-01-18 14:16:52 +00:00
2022-03-13 04:04:12 +00:00
messageSenders.TotalCount = tmp.TotalCount
2021-01-18 14:16:52 +00:00
2022-03-13 04:04:12 +00:00
fieldSenders, _ := UnmarshalListOfMessageSender(tmp.Senders)
messageSenders.Senders = fieldSenders
2021-01-18 14:16:52 +00:00
2022-03-13 04:04:12 +00:00
return nil
2021-01-18 14:16:52 +00:00
}
2021-12-30 05:55:02 +00:00
// The message was originally sent by a known user
type MessageForwardOriginUser struct {
2022-03-13 04:04:12 +00:00
meta
// Identifier of the user that originally sent the message
SenderUserId int64 `json:"sender_user_id"`
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *MessageForwardOriginUser) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
type stub MessageForwardOriginUser
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageForwardOriginUser) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageForwardOrigin
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageForwardOriginUser) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageForwardOriginUser
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageForwardOriginUser) MessageForwardOriginType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageForwardOriginUser
2021-12-30 05:55:02 +00:00
}
// The message was originally sent on behalf of a chat
type MessageForwardOriginChat struct {
2022-03-13 04:04:12 +00:00
meta
// Identifier of the chat that originally sent the message
SenderChatId int64 `json:"sender_chat_id"`
// For messages originally sent by an anonymous chat administrator, original message author signature
AuthorSignature string `json:"author_signature"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *MessageForwardOriginChat) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub MessageForwardOriginChat
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageForwardOriginChat) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageForwardOrigin
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageForwardOriginChat) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageForwardOriginChat
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageForwardOriginChat) MessageForwardOriginType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageForwardOriginChat
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// The message was originally sent by a user, which is hidden by their privacy settings
type MessageForwardOriginHiddenUser struct {
2022-03-13 04:04:12 +00:00
meta
// Name of the sender
SenderName string `json:"sender_name"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *MessageForwardOriginHiddenUser) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub MessageForwardOriginHiddenUser
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageForwardOriginHiddenUser) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageForwardOrigin
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageForwardOriginHiddenUser) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageForwardOriginHiddenUser
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageForwardOriginHiddenUser) MessageForwardOriginType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageForwardOriginHiddenUser
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// The message was originally a post in a channel
type MessageForwardOriginChannel struct {
2022-03-13 04:04:12 +00:00
meta
// Identifier of the chat from which the message was originally forwarded
ChatId int64 `json:"chat_id"`
// Message identifier of the original message
MessageId int64 `json:"message_id"`
// Original post author signature
AuthorSignature string `json:"author_signature"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *MessageForwardOriginChannel) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub MessageForwardOriginChannel
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageForwardOriginChannel) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageForwardOrigin
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageForwardOriginChannel) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageForwardOriginChannel
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageForwardOriginChannel) MessageForwardOriginType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageForwardOriginChannel
2021-12-30 05:55:02 +00:00
}
2018-10-23 12:38:10 +00:00
2021-12-30 05:55:02 +00:00
// The message was imported from an exported message history
type MessageForwardOriginMessageImport struct {
2022-03-13 04:04:12 +00:00
meta
// Name of the sender
SenderName string `json:"sender_name"`
2021-12-30 05:55:02 +00:00
}
2018-10-23 12:38:10 +00:00
2021-12-30 05:55:02 +00:00
func (entity *MessageForwardOriginMessageImport) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
type stub MessageForwardOriginMessageImport
2018-10-23 12:38:10 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
2020-02-03 12:56:20 +00:00
2021-12-30 05:55:02 +00:00
func (*MessageForwardOriginMessageImport) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageForwardOrigin
2021-12-30 05:55:02 +00:00
}
2018-10-23 12:38:10 +00:00
2021-12-30 05:55:02 +00:00
func (*MessageForwardOriginMessageImport) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageForwardOriginMessageImport
2021-12-30 05:55:02 +00:00
}
2018-10-23 12:38:10 +00:00
2021-12-30 05:55:02 +00:00
func (*MessageForwardOriginMessageImport) MessageForwardOriginType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageForwardOriginMessageImport
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// Contains information about a forwarded message
type MessageForwardInfo struct {
2022-03-13 04:04:12 +00:00
meta
// Origin of a forwarded message
Origin MessageForwardOrigin `json:"origin"`
// Point in time (Unix timestamp) when the message was originally sent
Date int32 `json:"date"`
// The type of a public service announcement for the forwarded message
PublicServiceAnnouncementType string `json:"public_service_announcement_type"`
// For messages forwarded to the chat with the current user (Saved Messages), to the Replies bot chat, or to the channel's discussion group, the identifier of the chat from which the message was forwarded last time; 0 if unknown
FromChatId int64 `json:"from_chat_id"`
// For messages forwarded to the chat with the current user (Saved Messages), to the Replies bot chat, or to the channel's discussion group, the identifier of the original message from which the new message was forwarded last time; 0 if unknown
FromMessageId int64 `json:"from_message_id"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *MessageForwardInfo) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub MessageForwardInfo
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageForwardInfo) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageForwardInfo
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageForwardInfo) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageForwardInfo
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (messageForwardInfo *MessageForwardInfo) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Origin json.RawMessage `json:"origin"`
Date int32 `json:"date"`
PublicServiceAnnouncementType string `json:"public_service_announcement_type"`
FromChatId int64 `json:"from_chat_id"`
FromMessageId int64 `json:"from_message_id"`
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
messageForwardInfo.Date = tmp.Date
messageForwardInfo.PublicServiceAnnouncementType = tmp.PublicServiceAnnouncementType
messageForwardInfo.FromChatId = tmp.FromChatId
messageForwardInfo.FromMessageId = tmp.FromMessageId
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
fieldOrigin, _ := UnmarshalMessageForwardOrigin(tmp.Origin)
messageForwardInfo.Origin = fieldOrigin
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return nil
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// Contains information about replies to a message
type MessageReplyInfo struct {
2022-03-13 04:04:12 +00:00
meta
// Number of times the message was directly or indirectly replied
ReplyCount int32 `json:"reply_count"`
// Identifiers of at most 3 recent repliers to the message; available in channels with a discussion supergroup. The users and chats are expected to be inaccessible: only their photo and name will be available
RecentReplierIds []MessageSender `json:"recent_replier_ids"`
// Identifier of the last read incoming reply to the message
LastReadInboxMessageId int64 `json:"last_read_inbox_message_id"`
// Identifier of the last read outgoing reply to the message
LastReadOutboxMessageId int64 `json:"last_read_outbox_message_id"`
// Identifier of the last reply to the message
LastMessageId int64 `json:"last_message_id"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *MessageReplyInfo) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub MessageReplyInfo
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageReplyInfo) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageReplyInfo
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageReplyInfo) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageReplyInfo
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (messageReplyInfo *MessageReplyInfo) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
ReplyCount int32 `json:"reply_count"`
RecentReplierIds []json.RawMessage `json:"recent_replier_ids"`
LastReadInboxMessageId int64 `json:"last_read_inbox_message_id"`
LastReadOutboxMessageId int64 `json:"last_read_outbox_message_id"`
LastMessageId int64 `json:"last_message_id"`
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
messageReplyInfo.ReplyCount = tmp.ReplyCount
messageReplyInfo.LastReadInboxMessageId = tmp.LastReadInboxMessageId
messageReplyInfo.LastReadOutboxMessageId = tmp.LastReadOutboxMessageId
messageReplyInfo.LastMessageId = tmp.LastMessageId
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
fieldRecentReplierIds, _ := UnmarshalListOfMessageSender(tmp.RecentReplierIds)
messageReplyInfo.RecentReplierIds = fieldRecentReplierIds
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return nil
2018-08-30 14:55:42 +00:00
}
2022-02-06 18:36:17 +00:00
// Contains information about a reaction to a message
type MessageReaction struct {
2022-03-13 04:04:12 +00:00
meta
// Text representation of the reaction
Reaction string `json:"reaction"`
// Number of times the reaction was added
TotalCount int32 `json:"total_count"`
// True, if the reaction is chosen by the current user
IsChosen bool `json:"is_chosen"`
// Identifiers of at most 3 recent message senders, added the reaction; available in private chats, basic groups and supergroups
RecentSenderIds []MessageSender `json:"recent_sender_ids"`
2022-02-06 18:36:17 +00:00
}
func (entity *MessageReaction) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2022-02-06 18:36:17 +00:00
2022-03-13 04:04:12 +00:00
type stub MessageReaction
2022-02-06 18:36:17 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2022-02-06 18:36:17 +00:00
}
func (*MessageReaction) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageReaction
2022-02-06 18:36:17 +00:00
}
func (*MessageReaction) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageReaction
2022-02-06 18:36:17 +00:00
}
func (messageReaction *MessageReaction) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Reaction string `json:"reaction"`
TotalCount int32 `json:"total_count"`
IsChosen bool `json:"is_chosen"`
RecentSenderIds []json.RawMessage `json:"recent_sender_ids"`
}
2022-02-06 18:36:17 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2022-02-06 18:36:17 +00:00
2022-03-13 04:04:12 +00:00
messageReaction.Reaction = tmp.Reaction
messageReaction.TotalCount = tmp.TotalCount
messageReaction.IsChosen = tmp.IsChosen
2022-02-06 18:36:17 +00:00
2022-03-13 04:04:12 +00:00
fieldRecentSenderIds, _ := UnmarshalListOfMessageSender(tmp.RecentSenderIds)
messageReaction.RecentSenderIds = fieldRecentSenderIds
2022-02-06 18:36:17 +00:00
2022-03-13 04:04:12 +00:00
return nil
2022-02-06 18:36:17 +00:00
}
2021-12-30 05:55:02 +00:00
// Contains information about interactions with a message
type MessageInteractionInfo struct {
2022-03-13 04:04:12 +00:00
meta
// Number of times the message was viewed
ViewCount int32 `json:"view_count"`
// Number of times the message was forwarded
ForwardCount int32 `json:"forward_count"`
// Information about direct or indirect replies to the message; may be null. Currently, available only in channels with a discussion supergroup and discussion supergroups for messages, which are not replies itself
ReplyInfo *MessageReplyInfo `json:"reply_info"`
// The list of reactions added to the message
Reactions []*MessageReaction `json:"reactions"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *MessageInteractionInfo) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub MessageInteractionInfo
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageInteractionInfo) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageInteractionInfo
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageInteractionInfo) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageInteractionInfo
2018-08-30 14:55:42 +00:00
}
2022-02-06 18:36:17 +00:00
// Contains information about an unread reaction to a message
type UnreadReaction struct {
2022-03-13 04:04:12 +00:00
meta
// Text representation of the reaction
Reaction string `json:"reaction"`
// Identifier of the sender, added the reaction
SenderId MessageSender `json:"sender_id"`
// True, if the reaction was added with a big animation
IsBig bool `json:"is_big"`
2019-06-07 10:56:06 +00:00
}
2022-02-06 18:36:17 +00:00
func (entity *UnreadReaction) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub UnreadReaction
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2022-02-06 18:36:17 +00:00
func (*UnreadReaction) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUnreadReaction
2019-06-07 10:56:06 +00:00
}
2022-02-06 18:36:17 +00:00
func (*UnreadReaction) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUnreadReaction
2019-06-07 10:56:06 +00:00
}
2022-02-06 18:36:17 +00:00
func (unreadReaction *UnreadReaction) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Reaction string `json:"reaction"`
SenderId json.RawMessage `json:"sender_id"`
IsBig bool `json:"is_big"`
}
2022-02-06 18:36:17 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2022-02-06 18:36:17 +00:00
2022-03-13 04:04:12 +00:00
unreadReaction.Reaction = tmp.Reaction
unreadReaction.IsBig = tmp.IsBig
2022-02-06 18:36:17 +00:00
2022-03-13 04:04:12 +00:00
fieldSenderId, _ := UnmarshalMessageSender(tmp.SenderId)
unreadReaction.SenderId = fieldSenderId
2022-02-06 18:36:17 +00:00
2022-03-13 04:04:12 +00:00
return nil
2019-06-07 10:56:06 +00:00
}
2022-02-06 18:36:17 +00:00
// The message is being sent now, but has not yet been delivered to the server
2022-03-13 04:04:12 +00:00
type MessageSendingStatePending struct{
meta
2022-02-06 18:36:17 +00:00
}
func (entity *MessageSendingStatePending) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2022-02-06 18:36:17 +00:00
2022-03-13 04:04:12 +00:00
type stub MessageSendingStatePending
2022-02-06 18:36:17 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2022-02-06 18:36:17 +00:00
}
func (*MessageSendingStatePending) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageSendingState
2022-02-06 18:36:17 +00:00
}
func (*MessageSendingStatePending) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageSendingStatePending
2022-02-06 18:36:17 +00:00
}
func (*MessageSendingStatePending) MessageSendingStateType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageSendingStatePending
2022-02-06 18:36:17 +00:00
}
// The message failed to be sent
type MessageSendingStateFailed struct {
2022-03-13 04:04:12 +00:00
meta
// An error code; 0 if unknown
ErrorCode int32 `json:"error_code"`
// Error message
ErrorMessage string `json:"error_message"`
// True, if the message can be re-sent
CanRetry bool `json:"can_retry"`
// True, if the message can be re-sent only on behalf of a different sender
NeedAnotherSender bool `json:"need_another_sender"`
// Time left before the message can be re-sent, in seconds. No update is sent when this field changes
RetryAfter float64 `json:"retry_after"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *MessageSendingStateFailed) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub MessageSendingStateFailed
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageSendingStateFailed) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageSendingState
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageSendingStateFailed) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageSendingStateFailed
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageSendingStateFailed) MessageSendingStateType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageSendingStateFailed
2021-12-30 05:55:02 +00:00
}
// Describes a message
type Message struct {
2022-03-13 04:04:12 +00:00
meta
// Message identifier; unique for the chat to which the message belongs
Id int64 `json:"id"`
// Identifier of the sender of the message
SenderId MessageSender `json:"sender_id"`
// Chat identifier
ChatId int64 `json:"chat_id"`
// The sending state of the message; may be null
SendingState MessageSendingState `json:"sending_state"`
// The scheduling state of the message; may be null
SchedulingState MessageSchedulingState `json:"scheduling_state"`
// True, if the message is outgoing
IsOutgoing bool `json:"is_outgoing"`
// True, if the message is pinned
IsPinned bool `json:"is_pinned"`
// True, if the message can be edited. For live location and poll messages this fields shows whether editMessageLiveLocation or stopPoll can be used with this message by the application
CanBeEdited bool `json:"can_be_edited"`
// True, if the message can be forwarded
CanBeForwarded bool `json:"can_be_forwarded"`
// True, if content of the message can be saved locally or copied
CanBeSaved bool `json:"can_be_saved"`
// True, if the message can be deleted only for the current user while other users will continue to see it
CanBeDeletedOnlyForSelf bool `json:"can_be_deleted_only_for_self"`
// True, if the message can be deleted for all users
CanBeDeletedForAllUsers bool `json:"can_be_deleted_for_all_users"`
// True, if the list of added reactions is available through getMessageAddedReactions
CanGetAddedReactions bool `json:"can_get_added_reactions"`
// True, if the message statistics are available through getMessageStatistics
CanGetStatistics bool `json:"can_get_statistics"`
// True, if information about the message thread is available through getMessageThread
CanGetMessageThread bool `json:"can_get_message_thread"`
// True, if chat members already viewed the message can be received through getMessageViewers
CanGetViewers bool `json:"can_get_viewers"`
// True, if media timestamp links can be generated for media timestamp entities in the message text, caption or web page description through getMessageLink
CanGetMediaTimestampLinks bool `json:"can_get_media_timestamp_links"`
// True, if media timestamp entities refers to a media in this message as opposed to a media in the replied message
HasTimestampedMedia bool `json:"has_timestamped_media"`
// True, if the message is a channel post. All messages to channels are channel posts, all other messages are not channel posts
IsChannelPost bool `json:"is_channel_post"`
// True, if the message contains an unread mention for the current user
ContainsUnreadMention bool `json:"contains_unread_mention"`
// Point in time (Unix timestamp) when the message was sent
Date int32 `json:"date"`
// Point in time (Unix timestamp) when the message was last edited
EditDate int32 `json:"edit_date"`
// Information about the initial message sender; may be null
ForwardInfo *MessageForwardInfo `json:"forward_info"`
// Information about interactions with the message; may be null
InteractionInfo *MessageInteractionInfo `json:"interaction_info"`
// Information about unread reactions added to the message
UnreadReactions []*UnreadReaction `json:"unread_reactions"`
// If non-zero, the identifier of the chat to which the replied message belongs; Currently, only messages in the Replies chat can have different reply_in_chat_id and chat_id
ReplyInChatId int64 `json:"reply_in_chat_id"`
// If non-zero, the identifier of the message this message is replying to; can be the identifier of a deleted message
ReplyToMessageId int64 `json:"reply_to_message_id"`
// If non-zero, the identifier of the message thread the message belongs to; unique within the chat to which the message belongs
MessageThreadId int64 `json:"message_thread_id"`
// For self-destructing messages, the message's TTL (Time To Live), in seconds; 0 if none. TDLib will send updateDeleteMessages or updateMessageContent once the TTL expires
Ttl int32 `json:"ttl"`
// Time left before the message expires, in seconds. If the TTL timer isn't started yet, equals to the value of the ttl field
TtlExpiresIn float64 `json:"ttl_expires_in"`
// If non-zero, the user identifier of the bot through which this message was sent
ViaBotUserId int64 `json:"via_bot_user_id"`
// For channel posts and anonymous group messages, optional author signature
AuthorSignature string `json:"author_signature"`
// Unique identifier of an album this message belongs to. Only audios, documents, photos and videos can be grouped together in albums
MediaAlbumId JsonInt64 `json:"media_album_id"`
// If non-empty, contains a human-readable description of the reason why access to this message must be restricted
RestrictionReason string `json:"restriction_reason"`
// Content of the message
Content MessageContent `json:"content"`
// Reply markup for the message; may be null
ReplyMarkup ReplyMarkup `json:"reply_markup"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *Message) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub Message
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*Message) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessage
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*Message) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessage
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (message *Message) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Id int64 `json:"id"`
SenderId json.RawMessage `json:"sender_id"`
ChatId int64 `json:"chat_id"`
SendingState json.RawMessage `json:"sending_state"`
SchedulingState json.RawMessage `json:"scheduling_state"`
IsOutgoing bool `json:"is_outgoing"`
IsPinned bool `json:"is_pinned"`
CanBeEdited bool `json:"can_be_edited"`
CanBeForwarded bool `json:"can_be_forwarded"`
CanBeSaved bool `json:"can_be_saved"`
CanBeDeletedOnlyForSelf bool `json:"can_be_deleted_only_for_self"`
CanBeDeletedForAllUsers bool `json:"can_be_deleted_for_all_users"`
CanGetAddedReactions bool `json:"can_get_added_reactions"`
CanGetStatistics bool `json:"can_get_statistics"`
CanGetMessageThread bool `json:"can_get_message_thread"`
CanGetViewers bool `json:"can_get_viewers"`
CanGetMediaTimestampLinks bool `json:"can_get_media_timestamp_links"`
HasTimestampedMedia bool `json:"has_timestamped_media"`
IsChannelPost bool `json:"is_channel_post"`
ContainsUnreadMention bool `json:"contains_unread_mention"`
Date int32 `json:"date"`
EditDate int32 `json:"edit_date"`
ForwardInfo *MessageForwardInfo `json:"forward_info"`
InteractionInfo *MessageInteractionInfo `json:"interaction_info"`
UnreadReactions []*UnreadReaction `json:"unread_reactions"`
ReplyInChatId int64 `json:"reply_in_chat_id"`
ReplyToMessageId int64 `json:"reply_to_message_id"`
MessageThreadId int64 `json:"message_thread_id"`
Ttl int32 `json:"ttl"`
TtlExpiresIn float64 `json:"ttl_expires_in"`
ViaBotUserId int64 `json:"via_bot_user_id"`
AuthorSignature string `json:"author_signature"`
MediaAlbumId JsonInt64 `json:"media_album_id"`
RestrictionReason string `json:"restriction_reason"`
Content json.RawMessage `json:"content"`
ReplyMarkup json.RawMessage `json:"reply_markup"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
message.Id = tmp.Id
message.ChatId = tmp.ChatId
message.IsOutgoing = tmp.IsOutgoing
message.IsPinned = tmp.IsPinned
message.CanBeEdited = tmp.CanBeEdited
message.CanBeForwarded = tmp.CanBeForwarded
message.CanBeSaved = tmp.CanBeSaved
message.CanBeDeletedOnlyForSelf = tmp.CanBeDeletedOnlyForSelf
message.CanBeDeletedForAllUsers = tmp.CanBeDeletedForAllUsers
message.CanGetAddedReactions = tmp.CanGetAddedReactions
message.CanGetStatistics = tmp.CanGetStatistics
message.CanGetMessageThread = tmp.CanGetMessageThread
message.CanGetViewers = tmp.CanGetViewers
message.CanGetMediaTimestampLinks = tmp.CanGetMediaTimestampLinks
message.HasTimestampedMedia = tmp.HasTimestampedMedia
message.IsChannelPost = tmp.IsChannelPost
message.ContainsUnreadMention = tmp.ContainsUnreadMention
message.Date = tmp.Date
message.EditDate = tmp.EditDate
message.ForwardInfo = tmp.ForwardInfo
message.InteractionInfo = tmp.InteractionInfo
message.UnreadReactions = tmp.UnreadReactions
message.ReplyInChatId = tmp.ReplyInChatId
message.ReplyToMessageId = tmp.ReplyToMessageId
message.MessageThreadId = tmp.MessageThreadId
message.Ttl = tmp.Ttl
message.TtlExpiresIn = tmp.TtlExpiresIn
message.ViaBotUserId = tmp.ViaBotUserId
message.AuthorSignature = tmp.AuthorSignature
message.MediaAlbumId = tmp.MediaAlbumId
message.RestrictionReason = tmp.RestrictionReason
fieldSenderId, _ := UnmarshalMessageSender(tmp.SenderId)
message.SenderId = fieldSenderId
fieldSendingState, _ := UnmarshalMessageSendingState(tmp.SendingState)
message.SendingState = fieldSendingState
fieldSchedulingState, _ := UnmarshalMessageSchedulingState(tmp.SchedulingState)
message.SchedulingState = fieldSchedulingState
fieldContent, _ := UnmarshalMessageContent(tmp.Content)
message.Content = fieldContent
fieldReplyMarkup, _ := UnmarshalReplyMarkup(tmp.ReplyMarkup)
message.ReplyMarkup = fieldReplyMarkup
return nil
2021-12-30 05:55:02 +00:00
}
// Contains a list of messages
type Messages struct {
2022-03-13 04:04:12 +00:00
meta
// Approximate total number of messages found
TotalCount int32 `json:"total_count"`
// List of messages; messages may be null
Messages []*Message `json:"messages"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *Messages) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub Messages
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*Messages) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessages
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*Messages) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessages
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// Contains a list of messages found by a search
type FoundMessages struct {
2022-03-13 04:04:12 +00:00
meta
// Approximate total number of messages found; -1 if unknown
TotalCount int32 `json:"total_count"`
// List of messages
Messages []*Message `json:"messages"`
// The offset for the next request. If empty, there are no more results
NextOffset string `json:"next_offset"`
2021-12-30 05:55:02 +00:00
}
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
func (entity *FoundMessages) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub FoundMessages
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
func (*FoundMessages) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassFoundMessages
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*FoundMessages) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeFoundMessages
2021-12-30 05:55:02 +00:00
}
// Contains information about a message in a specific position
type MessagePosition struct {
2022-03-13 04:04:12 +00:00
meta
// 0-based message position in the full list of suitable messages
Position int32 `json:"position"`
// Message identifier
MessageId int64 `json:"message_id"`
// Point in time (Unix timestamp) when the message was sent
Date int32 `json:"date"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *MessagePosition) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub MessagePosition
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessagePosition) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessagePosition
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessagePosition) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessagePosition
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// Contains a list of message positions
type MessagePositions struct {
2022-03-13 04:04:12 +00:00
meta
// Total number of messages found
TotalCount int32 `json:"total_count"`
// List of message positions
Positions []*MessagePosition `json:"positions"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *MessagePositions) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub MessagePositions
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessagePositions) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessagePositions
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessagePositions) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessagePositions
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// Contains information about found messages sent on a specific day
type MessageCalendarDay struct {
2022-03-13 04:04:12 +00:00
meta
// Total number of found messages sent on the day
TotalCount int32 `json:"total_count"`
// First message sent on the day
Message *Message `json:"message"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *MessageCalendarDay) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub MessageCalendarDay
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageCalendarDay) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageCalendarDay
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageCalendarDay) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageCalendarDay
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// Contains information about found messages, split by days according to the option "utc_time_offset"
type MessageCalendar struct {
2022-03-13 04:04:12 +00:00
meta
// Total number of found messages
TotalCount int32 `json:"total_count"`
// Information about messages sent
Days []*MessageCalendarDay `json:"days"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *MessageCalendar) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub MessageCalendar
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageCalendar) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageCalendar
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageCalendar) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageCalendar
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// Describes a sponsored message
type SponsoredMessage struct {
2022-03-13 04:04:12 +00:00
meta
// Message identifier; unique for the chat to which the sponsored message belongs among both ordinary and sponsored messages
MessageId int64 `json:"message_id"`
// Sponsor chat identifier; 0 if the sponsor chat is accessible through an invite link
SponsorChatId int64 `json:"sponsor_chat_id"`
// Information about the sponsor chat; may be null unless sponsor_chat_id == 0
SponsorChatInfo *ChatInviteLinkInfo `json:"sponsor_chat_info"`
// An internal link to be opened when the sponsored message is clicked; may be null. If null, the sponsor chat needs to be opened instead
Link InternalLinkType `json:"link"`
// Content of the message. Currently, can be only of the type messageText
Content MessageContent `json:"content"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *SponsoredMessage) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
type stub SponsoredMessage
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*SponsoredMessage) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassSponsoredMessage
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*SponsoredMessage) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeSponsoredMessage
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (sponsoredMessage *SponsoredMessage) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
MessageId int64 `json:"message_id"`
SponsorChatId int64 `json:"sponsor_chat_id"`
SponsorChatInfo *ChatInviteLinkInfo `json:"sponsor_chat_info"`
Link json.RawMessage `json:"link"`
Content json.RawMessage `json:"content"`
}
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
sponsoredMessage.MessageId = tmp.MessageId
sponsoredMessage.SponsorChatId = tmp.SponsorChatId
sponsoredMessage.SponsorChatInfo = tmp.SponsorChatInfo
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
fieldLink, _ := UnmarshalInternalLinkType(tmp.Link)
sponsoredMessage.Link = fieldLink
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
fieldContent, _ := UnmarshalMessageContent(tmp.Content)
sponsoredMessage.Content = fieldContent
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return nil
}
// Describes a file added to file download list
type FileDownload struct {
meta
// File identifier
FileId int32 `json:"file_id"`
// The message with the file
Message *Message `json:"message"`
// Point in time (Unix timestamp) when the file was added to the download list
AddDate int32 `json:"add_date"`
// Point in time (Unix timestamp) when the file downloading was completed; 0 if the file downloading isn't completed
CompleteDate int32 `json:"complete_date"`
// True, if downloading of the file is paused
IsPaused bool `json:"is_paused"`
}
func (entity *FileDownload) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub FileDownload
return json.Marshal((*stub)(entity))
}
func (*FileDownload) GetClass() string {
return ClassFileDownload
}
func (*FileDownload) GetType() string {
return TypeFileDownload
}
// Contains number of being downloaded and recently downloaded files found
type DownloadedFileCounts struct {
meta
// Number of active file downloads found, including paused
ActiveCount int32 `json:"active_count"`
// Number of paused file downloads found
PausedCount int32 `json:"paused_count"`
// Number of completed file downloads found
CompletedCount int32 `json:"completed_count"`
}
func (entity *DownloadedFileCounts) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub DownloadedFileCounts
return json.Marshal((*stub)(entity))
}
func (*DownloadedFileCounts) GetClass() string {
return ClassDownloadedFileCounts
}
func (*DownloadedFileCounts) GetType() string {
return TypeDownloadedFileCounts
}
// Contains a list of downloaded files, found by a search
type FoundFileDownloads struct {
meta
// Total number of suitable files, ignoring offset
TotalCounts *DownloadedFileCounts `json:"total_counts"`
// The list of files
Files []*FileDownload `json:"files"`
// The offset for the next request. If empty, there are no more results
NextOffset string `json:"next_offset"`
}
func (entity *FoundFileDownloads) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub FoundFileDownloads
return json.Marshal((*stub)(entity))
}
func (*FoundFileDownloads) GetClass() string {
return ClassFoundFileDownloads
}
func (*FoundFileDownloads) GetType() string {
return TypeFoundFileDownloads
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
// Notification settings applied to all private and secret chats when the corresponding chat setting has a default value
2022-03-13 04:04:12 +00:00
type NotificationSettingsScopePrivateChats struct{
meta
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *NotificationSettingsScopePrivateChats) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
type stub NotificationSettingsScopePrivateChats
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*NotificationSettingsScopePrivateChats) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassNotificationSettingsScope
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*NotificationSettingsScopePrivateChats) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeNotificationSettingsScopePrivateChats
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*NotificationSettingsScopePrivateChats) NotificationSettingsScopeType() string {
2022-03-13 04:04:12 +00:00
return TypeNotificationSettingsScopePrivateChats
2021-12-30 05:55:02 +00:00
}
// Notification settings applied to all basic groups and supergroups when the corresponding chat setting has a default value
2022-03-13 04:04:12 +00:00
type NotificationSettingsScopeGroupChats struct{
meta
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *NotificationSettingsScopeGroupChats) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
type stub NotificationSettingsScopeGroupChats
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*NotificationSettingsScopeGroupChats) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassNotificationSettingsScope
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*NotificationSettingsScopeGroupChats) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeNotificationSettingsScopeGroupChats
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*NotificationSettingsScopeGroupChats) NotificationSettingsScopeType() string {
2022-03-13 04:04:12 +00:00
return TypeNotificationSettingsScopeGroupChats
2021-12-30 05:55:02 +00:00
}
// Notification settings applied to all channels when the corresponding chat setting has a default value
2022-03-13 04:04:12 +00:00
type NotificationSettingsScopeChannelChats struct{
meta
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *NotificationSettingsScopeChannelChats) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
type stub NotificationSettingsScopeChannelChats
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*NotificationSettingsScopeChannelChats) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassNotificationSettingsScope
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*NotificationSettingsScopeChannelChats) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeNotificationSettingsScopeChannelChats
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*NotificationSettingsScopeChannelChats) NotificationSettingsScopeType() string {
2022-03-13 04:04:12 +00:00
return TypeNotificationSettingsScopeChannelChats
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
// Contains information about notification settings for a chat
type ChatNotificationSettings struct {
2022-03-13 04:04:12 +00:00
meta
// If true, mute_for is ignored and the value for the relevant type of chat is used instead
UseDefaultMuteFor bool `json:"use_default_mute_for"`
// Time left before notifications will be unmuted, in seconds
MuteFor int32 `json:"mute_for"`
// If true, sound is ignored and the value for the relevant type of chat is used instead
UseDefaultSound bool `json:"use_default_sound"`
// The name of an audio file to be used for notification sounds; only applies to iOS applications
Sound string `json:"sound"`
// If true, show_preview is ignored and the value for the relevant type of chat is used instead
UseDefaultShowPreview bool `json:"use_default_show_preview"`
// True, if message content must be displayed in notifications
ShowPreview bool `json:"show_preview"`
// If true, disable_pinned_message_notifications is ignored and the value for the relevant type of chat is used instead
UseDefaultDisablePinnedMessageNotifications bool `json:"use_default_disable_pinned_message_notifications"`
// If true, notifications for incoming pinned messages will be created as for an ordinary unread message
DisablePinnedMessageNotifications bool `json:"disable_pinned_message_notifications"`
// If true, disable_mention_notifications is ignored and the value for the relevant type of chat is used instead
UseDefaultDisableMentionNotifications bool `json:"use_default_disable_mention_notifications"`
// If true, notifications for messages with mentions will be created as for an ordinary unread message
DisableMentionNotifications bool `json:"disable_mention_notifications"`
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *ChatNotificationSettings) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatNotificationSettings
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatNotificationSettings) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatNotificationSettings
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatNotificationSettings) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatNotificationSettings
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
// Contains information about notification settings for several chats
type ScopeNotificationSettings struct {
2022-03-13 04:04:12 +00:00
meta
// Time left before notifications will be unmuted, in seconds
MuteFor int32 `json:"mute_for"`
// The name of an audio file to be used for notification sounds; only applies to iOS applications
Sound string `json:"sound"`
// True, if message content must be displayed in notifications
ShowPreview bool `json:"show_preview"`
// True, if notifications for incoming pinned messages will be created as for an ordinary unread message
DisablePinnedMessageNotifications bool `json:"disable_pinned_message_notifications"`
// True, if notifications for messages with mentions will be created as for an ordinary unread message
DisableMentionNotifications bool `json:"disable_mention_notifications"`
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *ScopeNotificationSettings) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
type stub ScopeNotificationSettings
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ScopeNotificationSettings) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassScopeNotificationSettings
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ScopeNotificationSettings) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeScopeNotificationSettings
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
// Contains information about a message draft
type DraftMessage struct {
2022-03-13 04:04:12 +00:00
meta
// Identifier of the message to reply to; 0 if none
ReplyToMessageId int64 `json:"reply_to_message_id"`
// Point in time (Unix timestamp) when the draft was created
Date int32 `json:"date"`
// Content of the message draft; must be of the type inputMessageText
InputMessageText InputMessageContent `json:"input_message_text"`
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *DraftMessage) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
type stub DraftMessage
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*DraftMessage) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassDraftMessage
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*DraftMessage) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeDraftMessage
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (draftMessage *DraftMessage) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
ReplyToMessageId int64 `json:"reply_to_message_id"`
Date int32 `json:"date"`
InputMessageText json.RawMessage `json:"input_message_text"`
}
2021-01-18 14:16:52 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-01-18 14:16:52 +00:00
2022-03-13 04:04:12 +00:00
draftMessage.ReplyToMessageId = tmp.ReplyToMessageId
draftMessage.Date = tmp.Date
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
fieldInputMessageText, _ := UnmarshalInputMessageContent(tmp.InputMessageText)
draftMessage.InputMessageText = fieldInputMessageText
2021-01-18 14:16:52 +00:00
2022-03-13 04:04:12 +00:00
return nil
2021-01-18 14:16:52 +00:00
}
2021-12-30 05:55:02 +00:00
// An ordinary chat with a user
type ChatTypePrivate struct {
2022-03-13 04:04:12 +00:00
meta
// User identifier
UserId int64 `json:"user_id"`
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *ChatTypePrivate) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatTypePrivate
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatTypePrivate) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatType
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatTypePrivate) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatTypePrivate
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatTypePrivate) ChatTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeChatTypePrivate
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
// A basic group (a chat with 0-200 other users)
type ChatTypeBasicGroup struct {
2022-03-13 04:04:12 +00:00
meta
// Basic group identifier
BasicGroupId int64 `json:"basic_group_id"`
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *ChatTypeBasicGroup) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatTypeBasicGroup
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatTypeBasicGroup) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatType
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatTypeBasicGroup) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatTypeBasicGroup
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatTypeBasicGroup) ChatTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeChatTypeBasicGroup
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
// A supergroup or channel (with unlimited members)
type ChatTypeSupergroup struct {
2022-03-13 04:04:12 +00:00
meta
// Supergroup or channel identifier
SupergroupId int64 `json:"supergroup_id"`
// True, if the supergroup is a channel
IsChannel bool `json:"is_channel"`
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *ChatTypeSupergroup) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatTypeSupergroup
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatTypeSupergroup) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatType
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatTypeSupergroup) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatTypeSupergroup
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatTypeSupergroup) ChatTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeChatTypeSupergroup
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
// A secret chat with a user
type ChatTypeSecret struct {
2022-03-13 04:04:12 +00:00
meta
// Secret chat identifier
SecretChatId int32 `json:"secret_chat_id"`
// User identifier of the secret chat peer
UserId int64 `json:"user_id"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *ChatTypeSecret) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatTypeSecret
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatTypeSecret) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatType
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatTypeSecret) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatTypeSecret
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatTypeSecret) ChatTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeChatTypeSecret
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// Represents a filter of user chats
type ChatFilter struct {
2022-03-13 04:04:12 +00:00
meta
// The title of the filter; 1-12 characters without line feeds
Title string `json:"title"`
// The chosen icon name for short filter representation. If non-empty, must be one of "All", "Unread", "Unmuted", "Bots", "Channels", "Groups", "Private", "Custom", "Setup", "Cat", "Crown", "Favorite", "Flower", "Game", "Home", "Love", "Mask", "Party", "Sport", "Study", "Trade", "Travel", "Work". If empty, use getChatFilterDefaultIconName to get default icon name for the filter
IconName string `json:"icon_name"`
// The chat identifiers of pinned chats in the filtered chat list
PinnedChatIds []int64 `json:"pinned_chat_ids"`
// The chat identifiers of always included chats in the filtered chat list
IncludedChatIds []int64 `json:"included_chat_ids"`
// The chat identifiers of always excluded chats in the filtered chat list
ExcludedChatIds []int64 `json:"excluded_chat_ids"`
// True, if muted chats need to be excluded
ExcludeMuted bool `json:"exclude_muted"`
// True, if read chats need to be excluded
ExcludeRead bool `json:"exclude_read"`
// True, if archived chats need to be excluded
ExcludeArchived bool `json:"exclude_archived"`
// True, if contacts need to be included
IncludeContacts bool `json:"include_contacts"`
// True, if non-contact users need to be included
IncludeNonContacts bool `json:"include_non_contacts"`
// True, if bots need to be included
IncludeBots bool `json:"include_bots"`
// True, if basic groups and supergroups need to be included
IncludeGroups bool `json:"include_groups"`
// True, if channels need to be included
IncludeChannels bool `json:"include_channels"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *ChatFilter) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatFilter
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatFilter) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatFilter
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatFilter) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatFilter
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// Contains basic information about a chat filter
type ChatFilterInfo struct {
2022-03-13 04:04:12 +00:00
meta
// Unique chat filter identifier
Id int32 `json:"id"`
// The title of the filter; 1-12 characters without line feeds
Title string `json:"title"`
// The chosen or default icon name for short filter representation. One of "All", "Unread", "Unmuted", "Bots", "Channels", "Groups", "Private", "Custom", "Setup", "Cat", "Crown", "Favorite", "Flower", "Game", "Home", "Love", "Mask", "Party", "Sport", "Study", "Trade", "Travel", "Work"
IconName string `json:"icon_name"`
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *ChatFilterInfo) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatFilterInfo
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatFilterInfo) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatFilterInfo
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatFilterInfo) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatFilterInfo
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
// Describes a recommended chat filter
type RecommendedChatFilter struct {
2022-03-13 04:04:12 +00:00
meta
// The chat filter
Filter *ChatFilter `json:"filter"`
// Chat filter description
Description string `json:"description"`
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *RecommendedChatFilter) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
type stub RecommendedChatFilter
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*RecommendedChatFilter) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassRecommendedChatFilter
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*RecommendedChatFilter) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeRecommendedChatFilter
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
// Contains a list of recommended chat filters
type RecommendedChatFilters struct {
2022-03-13 04:04:12 +00:00
meta
// List of recommended chat filters
ChatFilters []*RecommendedChatFilter `json:"chat_filters"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *RecommendedChatFilters) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub RecommendedChatFilters
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*RecommendedChatFilters) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassRecommendedChatFilters
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*RecommendedChatFilters) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeRecommendedChatFilters
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
// A main list of chats
2022-03-13 04:04:12 +00:00
type ChatListMain struct{
meta
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *ChatListMain) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatListMain
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatListMain) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatList
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatListMain) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatListMain
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatListMain) ChatListType() string {
2022-03-13 04:04:12 +00:00
return TypeChatListMain
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
// A list of chats usually located at the top of the main chat list. Unmuted chats are automatically moved from the Archive to the Main chat list when a new message arrives
2022-03-13 04:04:12 +00:00
type ChatListArchive struct{
meta
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *ChatListArchive) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatListArchive
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatListArchive) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatList
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatListArchive) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatListArchive
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatListArchive) ChatListType() string {
2022-03-13 04:04:12 +00:00
return TypeChatListArchive
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
// A list of chats belonging to a chat filter
type ChatListFilter struct {
2022-03-13 04:04:12 +00:00
meta
// Chat filter identifier
ChatFilterId int32 `json:"chat_filter_id"`
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *ChatListFilter) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatListFilter
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatListFilter) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatList
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatListFilter) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatListFilter
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatListFilter) ChatListType() string {
2022-03-13 04:04:12 +00:00
return TypeChatListFilter
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
// Contains a list of chat lists
type ChatLists struct {
2022-03-13 04:04:12 +00:00
meta
// List of chat lists
ChatLists []ChatList `json:"chat_lists"`
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *ChatLists) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatLists
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatLists) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatLists
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatLists) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatLists
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (chatLists *ChatLists) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
ChatLists []json.RawMessage `json:"chat_lists"`
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
fieldChatLists, _ := UnmarshalListOfChatList(tmp.ChatLists)
chatLists.ChatLists = fieldChatLists
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return nil
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
// The chat is sponsored by the user's MTProxy server
2022-03-13 04:04:12 +00:00
type ChatSourceMtprotoProxy struct{
meta
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *ChatSourceMtprotoProxy) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatSourceMtprotoProxy
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatSourceMtprotoProxy) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatSource
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatSourceMtprotoProxy) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatSourceMtprotoProxy
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatSourceMtprotoProxy) ChatSourceType() string {
2022-03-13 04:04:12 +00:00
return TypeChatSourceMtprotoProxy
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
// The chat contains a public service announcement
type ChatSourcePublicServiceAnnouncement struct {
2022-03-13 04:04:12 +00:00
meta
// The type of the announcement
Type string `json:"type"`
// The text of the announcement
Text string `json:"text"`
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *ChatSourcePublicServiceAnnouncement) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatSourcePublicServiceAnnouncement
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatSourcePublicServiceAnnouncement) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatSource
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatSourcePublicServiceAnnouncement) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatSourcePublicServiceAnnouncement
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatSourcePublicServiceAnnouncement) ChatSourceType() string {
2022-03-13 04:04:12 +00:00
return TypeChatSourcePublicServiceAnnouncement
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
// Describes a position of a chat in a chat list
type ChatPosition struct {
2022-03-13 04:04:12 +00:00
meta
// The chat list
List ChatList `json:"list"`
// A parameter used to determine order of the chat in the chat list. Chats must be sorted by the pair (order, chat.id) in descending order
Order JsonInt64 `json:"order"`
// True, if the chat is pinned in the chat list
IsPinned bool `json:"is_pinned"`
// Source of the chat in the chat list; may be null
Source ChatSource `json:"source"`
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *ChatPosition) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatPosition
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatPosition) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatPosition
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatPosition) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatPosition
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (chatPosition *ChatPosition) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
List json.RawMessage `json:"list"`
Order JsonInt64 `json:"order"`
IsPinned bool `json:"is_pinned"`
Source json.RawMessage `json:"source"`
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
chatPosition.Order = tmp.Order
chatPosition.IsPinned = tmp.IsPinned
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
fieldList, _ := UnmarshalChatList(tmp.List)
chatPosition.List = fieldList
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
fieldSource, _ := UnmarshalChatSource(tmp.Source)
chatPosition.Source = fieldSource
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return nil
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// Describes a video chat
type VideoChat struct {
2022-03-13 04:04:12 +00:00
meta
// Group call identifier of an active video chat; 0 if none. Full information about the video chat can be received through the method getGroupCall
GroupCallId int32 `json:"group_call_id"`
// True, if the video chat has participants
HasParticipants bool `json:"has_participants"`
// Default group call participant identifier to join the video chat; may be null
DefaultParticipantId MessageSender `json:"default_participant_id"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *VideoChat) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub VideoChat
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*VideoChat) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassVideoChat
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*VideoChat) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeVideoChat
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (videoChat *VideoChat) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
GroupCallId int32 `json:"group_call_id"`
HasParticipants bool `json:"has_participants"`
DefaultParticipantId json.RawMessage `json:"default_participant_id"`
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
videoChat.GroupCallId = tmp.GroupCallId
videoChat.HasParticipants = tmp.HasParticipants
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
fieldDefaultParticipantId, _ := UnmarshalMessageSender(tmp.DefaultParticipantId)
videoChat.DefaultParticipantId = fieldDefaultParticipantId
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return nil
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A chat. (Can be a private chat, basic group, supergroup, or secret chat)
type Chat struct {
2022-03-13 04:04:12 +00:00
meta
// Chat unique identifier
Id int64 `json:"id"`
// Type of the chat
Type ChatType `json:"type"`
// Chat title
Title string `json:"title"`
// Chat photo; may be null
Photo *ChatPhotoInfo `json:"photo"`
// Actions that non-administrator chat members are allowed to take in the chat
Permissions *ChatPermissions `json:"permissions"`
// Last message in the chat; may be null
LastMessage *Message `json:"last_message"`
// Positions of the chat in chat lists
Positions []*ChatPosition `json:"positions"`
// Identifier of a user or chat that is selected to send messages in the chat; may be null if the user can't change message sender
MessageSenderId MessageSender `json:"message_sender_id"`
// True, if chat content can't be saved locally, forwarded, or copied
HasProtectedContent bool `json:"has_protected_content"`
// True, if the chat is marked as unread
IsMarkedAsUnread bool `json:"is_marked_as_unread"`
// True, if the chat is blocked by the current user and private messages from the chat can't be received
IsBlocked bool `json:"is_blocked"`
// True, if the chat has scheduled messages
HasScheduledMessages bool `json:"has_scheduled_messages"`
// True, if the chat messages can be deleted only for the current user while other users will continue to see the messages
CanBeDeletedOnlyForSelf bool `json:"can_be_deleted_only_for_self"`
// True, if the chat messages can be deleted for all users
CanBeDeletedForAllUsers bool `json:"can_be_deleted_for_all_users"`
// True, if the chat can be reported to Telegram moderators through reportChat or reportChatPhoto
CanBeReported bool `json:"can_be_reported"`
// Default value of the disable_notification parameter, used when a message is sent to the chat
DefaultDisableNotification bool `json:"default_disable_notification"`
// Number of unread messages in the chat
UnreadCount int32 `json:"unread_count"`
// Identifier of the last read incoming message
LastReadInboxMessageId int64 `json:"last_read_inbox_message_id"`
// Identifier of the last read outgoing message
LastReadOutboxMessageId int64 `json:"last_read_outbox_message_id"`
// Number of unread messages with a mention/reply in the chat
UnreadMentionCount int32 `json:"unread_mention_count"`
// Number of messages with unread reactions in the chat
UnreadReactionCount int32 `json:"unread_reaction_count"`
// Notification settings for the chat
NotificationSettings *ChatNotificationSettings `json:"notification_settings"`
// List of reactions, available in the chat
AvailableReactions []string `json:"available_reactions"`
// Current message Time To Live setting (self-destruct timer) for the chat; 0 if not defined. TTL is counted from the time message or its content is viewed in secret chats and from the send date in other chats
MessageTtl int32 `json:"message_ttl"`
// If non-empty, name of a theme, set for the chat
ThemeName string `json:"theme_name"`
// Information about actions which must be possible to do through the chat action bar; may be null
ActionBar ChatActionBar `json:"action_bar"`
// Information about video chat of the chat
VideoChat *VideoChat `json:"video_chat"`
// Information about pending join requests; may be null
PendingJoinRequests *ChatJoinRequestsInfo `json:"pending_join_requests"`
// Identifier of the message from which reply markup needs to be used; 0 if there is no default custom reply markup in the chat
ReplyMarkupMessageId int64 `json:"reply_markup_message_id"`
// A draft of a message in the chat; may be null
DraftMessage *DraftMessage `json:"draft_message"`
// Application-specific data associated with the chat. (For example, the chat scroll position or local chat notification settings can be stored here.) Persistent if the message database is used
ClientData string `json:"client_data"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *Chat) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub Chat
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*Chat) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChat
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*Chat) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChat
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (chat *Chat) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Id int64 `json:"id"`
Type json.RawMessage `json:"type"`
Title string `json:"title"`
Photo *ChatPhotoInfo `json:"photo"`
Permissions *ChatPermissions `json:"permissions"`
LastMessage *Message `json:"last_message"`
Positions []*ChatPosition `json:"positions"`
MessageSenderId json.RawMessage `json:"message_sender_id"`
HasProtectedContent bool `json:"has_protected_content"`
IsMarkedAsUnread bool `json:"is_marked_as_unread"`
IsBlocked bool `json:"is_blocked"`
HasScheduledMessages bool `json:"has_scheduled_messages"`
CanBeDeletedOnlyForSelf bool `json:"can_be_deleted_only_for_self"`
CanBeDeletedForAllUsers bool `json:"can_be_deleted_for_all_users"`
CanBeReported bool `json:"can_be_reported"`
DefaultDisableNotification bool `json:"default_disable_notification"`
UnreadCount int32 `json:"unread_count"`
LastReadInboxMessageId int64 `json:"last_read_inbox_message_id"`
LastReadOutboxMessageId int64 `json:"last_read_outbox_message_id"`
UnreadMentionCount int32 `json:"unread_mention_count"`
UnreadReactionCount int32 `json:"unread_reaction_count"`
NotificationSettings *ChatNotificationSettings `json:"notification_settings"`
AvailableReactions []string `json:"available_reactions"`
MessageTtl int32 `json:"message_ttl"`
ThemeName string `json:"theme_name"`
ActionBar json.RawMessage `json:"action_bar"`
VideoChat *VideoChat `json:"video_chat"`
PendingJoinRequests *ChatJoinRequestsInfo `json:"pending_join_requests"`
ReplyMarkupMessageId int64 `json:"reply_markup_message_id"`
DraftMessage *DraftMessage `json:"draft_message"`
ClientData string `json:"client_data"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
chat.Id = tmp.Id
chat.Title = tmp.Title
chat.Photo = tmp.Photo
chat.Permissions = tmp.Permissions
chat.LastMessage = tmp.LastMessage
chat.Positions = tmp.Positions
chat.HasProtectedContent = tmp.HasProtectedContent
chat.IsMarkedAsUnread = tmp.IsMarkedAsUnread
chat.IsBlocked = tmp.IsBlocked
chat.HasScheduledMessages = tmp.HasScheduledMessages
chat.CanBeDeletedOnlyForSelf = tmp.CanBeDeletedOnlyForSelf
chat.CanBeDeletedForAllUsers = tmp.CanBeDeletedForAllUsers
chat.CanBeReported = tmp.CanBeReported
chat.DefaultDisableNotification = tmp.DefaultDisableNotification
chat.UnreadCount = tmp.UnreadCount
chat.LastReadInboxMessageId = tmp.LastReadInboxMessageId
chat.LastReadOutboxMessageId = tmp.LastReadOutboxMessageId
chat.UnreadMentionCount = tmp.UnreadMentionCount
chat.UnreadReactionCount = tmp.UnreadReactionCount
chat.NotificationSettings = tmp.NotificationSettings
chat.AvailableReactions = tmp.AvailableReactions
chat.MessageTtl = tmp.MessageTtl
chat.ThemeName = tmp.ThemeName
chat.VideoChat = tmp.VideoChat
chat.PendingJoinRequests = tmp.PendingJoinRequests
chat.ReplyMarkupMessageId = tmp.ReplyMarkupMessageId
chat.DraftMessage = tmp.DraftMessage
chat.ClientData = tmp.ClientData
fieldType, _ := UnmarshalChatType(tmp.Type)
chat.Type = fieldType
fieldMessageSenderId, _ := UnmarshalMessageSender(tmp.MessageSenderId)
chat.MessageSenderId = fieldMessageSenderId
fieldActionBar, _ := UnmarshalChatActionBar(tmp.ActionBar)
chat.ActionBar = fieldActionBar
return nil
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// Represents a list of chats
type Chats struct {
2022-03-13 04:04:12 +00:00
meta
// Approximate total number of chats found
TotalCount int32 `json:"total_count"`
// List of chat identifiers
ChatIds []int64 `json:"chat_ids"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *Chats) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub Chats
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*Chats) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChats
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*Chats) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChats
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// Describes a chat located nearby
type ChatNearby struct {
2022-03-13 04:04:12 +00:00
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
// Distance to the chat location, in meters
Distance int32 `json:"distance"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *ChatNearby) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatNearby
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatNearby) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatNearby
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatNearby) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatNearby
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// Represents a list of chats located nearby
type ChatsNearby struct {
2022-03-13 04:04:12 +00:00
meta
// List of users nearby
UsersNearby []*ChatNearby `json:"users_nearby"`
// List of location-based supergroups nearby
SupergroupsNearby []*ChatNearby `json:"supergroups_nearby"`
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *ChatsNearby) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatsNearby
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatsNearby) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatsNearby
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatsNearby) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatsNearby
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
// The chat is public, because it has username
2022-03-13 04:04:12 +00:00
type PublicChatTypeHasUsername struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PublicChatTypeHasUsername) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub PublicChatTypeHasUsername
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PublicChatTypeHasUsername) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPublicChatType
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PublicChatTypeHasUsername) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePublicChatTypeHasUsername
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PublicChatTypeHasUsername) PublicChatTypeType() string {
2022-03-13 04:04:12 +00:00
return TypePublicChatTypeHasUsername
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// The chat is public, because it is a location-based supergroup
2022-03-13 04:04:12 +00:00
type PublicChatTypeIsLocationBased struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PublicChatTypeIsLocationBased) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub PublicChatTypeIsLocationBased
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PublicChatTypeIsLocationBased) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPublicChatType
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PublicChatTypeIsLocationBased) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePublicChatTypeIsLocationBased
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PublicChatTypeIsLocationBased) PublicChatTypeType() string {
2022-03-13 04:04:12 +00:00
return TypePublicChatTypeIsLocationBased
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// The chat can be reported as spam using the method reportChat with the reason chatReportReasonSpam
type ChatActionBarReportSpam struct {
2022-03-13 04:04:12 +00:00
meta
// If true, the chat was automatically archived and can be moved back to the main chat list using addChatToList simultaneously with setting chat notification settings to default using setChatNotificationSettings
CanUnarchive bool `json:"can_unarchive"`
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *ChatActionBarReportSpam) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-09-10 12:36:54 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatActionBarReportSpam
2019-09-10 12:36:54 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatActionBarReportSpam) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatActionBar
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatActionBarReportSpam) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatActionBarReportSpam
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatActionBarReportSpam) ChatActionBarType() string {
2022-03-13 04:04:12 +00:00
return TypeChatActionBarReportSpam
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
// The chat is a location-based supergroup, which can be reported as having unrelated location using the method reportChat with the reason chatReportReasonUnrelatedLocation
2022-03-13 04:04:12 +00:00
type ChatActionBarReportUnrelatedLocation struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *ChatActionBarReportUnrelatedLocation) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatActionBarReportUnrelatedLocation
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatActionBarReportUnrelatedLocation) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatActionBar
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatActionBarReportUnrelatedLocation) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatActionBarReportUnrelatedLocation
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatActionBarReportUnrelatedLocation) ChatActionBarType() string {
2022-03-13 04:04:12 +00:00
return TypeChatActionBarReportUnrelatedLocation
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// The chat is a recently created group chat to which new members can be invited
2022-03-13 04:04:12 +00:00
type ChatActionBarInviteMembers struct{
meta
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *ChatActionBarInviteMembers) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatActionBarInviteMembers
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatActionBarInviteMembers) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatActionBar
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatActionBarInviteMembers) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatActionBarInviteMembers
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatActionBarInviteMembers) ChatActionBarType() string {
2022-03-13 04:04:12 +00:00
return TypeChatActionBarInviteMembers
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
// The chat is a private or secret chat, which can be reported using the method reportChat, or the other user can be blocked using the method toggleMessageSenderIsBlocked, or the other user can be added to the contact list using the method addContact
type ChatActionBarReportAddBlock struct {
2022-03-13 04:04:12 +00:00
meta
// If true, the chat was automatically archived and can be moved back to the main chat list using addChatToList simultaneously with setting chat notification settings to default using setChatNotificationSettings
CanUnarchive bool `json:"can_unarchive"`
// If non-negative, the current user was found by the peer through searchChatsNearby and this is the distance between the users
Distance int32 `json:"distance"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *ChatActionBarReportAddBlock) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatActionBarReportAddBlock
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatActionBarReportAddBlock) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatActionBar
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatActionBarReportAddBlock) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatActionBarReportAddBlock
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatActionBarReportAddBlock) ChatActionBarType() string {
2022-03-13 04:04:12 +00:00
return TypeChatActionBarReportAddBlock
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// The chat is a private or secret chat and the other user can be added to the contact list using the method addContact
2022-03-13 04:04:12 +00:00
type ChatActionBarAddContact struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *ChatActionBarAddContact) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatActionBarAddContact
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatActionBarAddContact) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatActionBar
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatActionBarAddContact) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatActionBarAddContact
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatActionBarAddContact) ChatActionBarType() string {
2022-03-13 04:04:12 +00:00
return TypeChatActionBarAddContact
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// The chat is a private or secret chat with a mutual contact and the user's phone number can be shared with the other user using the method sharePhoneNumber
2022-03-13 04:04:12 +00:00
type ChatActionBarSharePhoneNumber struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *ChatActionBarSharePhoneNumber) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatActionBarSharePhoneNumber
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatActionBarSharePhoneNumber) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatActionBar
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatActionBarSharePhoneNumber) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatActionBarSharePhoneNumber
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatActionBarSharePhoneNumber) ChatActionBarType() string {
2022-03-13 04:04:12 +00:00
return TypeChatActionBarSharePhoneNumber
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// The chat is a private chat with an administrator of a chat to which the user sent join request
type ChatActionBarJoinRequest struct {
2022-03-13 04:04:12 +00:00
meta
// Title of the chat to which the join request was sent
Title string `json:"title"`
// True, if the join request was sent to a channel chat
IsChannel bool `json:"is_channel"`
// Point in time (Unix timestamp) when the join request was sent
RequestDate int32 `json:"request_date"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *ChatActionBarJoinRequest) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatActionBarJoinRequest
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatActionBarJoinRequest) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatActionBar
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatActionBarJoinRequest) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatActionBarJoinRequest
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatActionBarJoinRequest) ChatActionBarType() string {
2022-03-13 04:04:12 +00:00
return TypeChatActionBarJoinRequest
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A simple button, with text that must be sent when the button is pressed
2022-03-13 04:04:12 +00:00
type KeyboardButtonTypeText struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *KeyboardButtonTypeText) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub KeyboardButtonTypeText
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*KeyboardButtonTypeText) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassKeyboardButtonType
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*KeyboardButtonTypeText) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeKeyboardButtonTypeText
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*KeyboardButtonTypeText) KeyboardButtonTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeKeyboardButtonTypeText
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A button that sends the user's phone number when pressed; available only in private chats
2022-03-13 04:04:12 +00:00
type KeyboardButtonTypeRequestPhoneNumber struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *KeyboardButtonTypeRequestPhoneNumber) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub KeyboardButtonTypeRequestPhoneNumber
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*KeyboardButtonTypeRequestPhoneNumber) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassKeyboardButtonType
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*KeyboardButtonTypeRequestPhoneNumber) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeKeyboardButtonTypeRequestPhoneNumber
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*KeyboardButtonTypeRequestPhoneNumber) KeyboardButtonTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeKeyboardButtonTypeRequestPhoneNumber
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A button that sends the user's location when pressed; available only in private chats
2022-03-13 04:04:12 +00:00
type KeyboardButtonTypeRequestLocation struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *KeyboardButtonTypeRequestLocation) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub KeyboardButtonTypeRequestLocation
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*KeyboardButtonTypeRequestLocation) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassKeyboardButtonType
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*KeyboardButtonTypeRequestLocation) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeKeyboardButtonTypeRequestLocation
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*KeyboardButtonTypeRequestLocation) KeyboardButtonTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeKeyboardButtonTypeRequestLocation
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A button that allows the user to create and send a poll when pressed; available only in private chats
type KeyboardButtonTypeRequestPoll struct {
2022-03-13 04:04:12 +00:00
meta
// If true, only regular polls must be allowed to create
ForceRegular bool `json:"force_regular"`
// If true, only polls in quiz mode must be allowed to create
ForceQuiz bool `json:"force_quiz"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *KeyboardButtonTypeRequestPoll) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub KeyboardButtonTypeRequestPoll
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*KeyboardButtonTypeRequestPoll) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassKeyboardButtonType
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*KeyboardButtonTypeRequestPoll) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeKeyboardButtonTypeRequestPoll
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*KeyboardButtonTypeRequestPoll) KeyboardButtonTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeKeyboardButtonTypeRequestPoll
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// Represents a single button in a bot keyboard
type KeyboardButton struct {
2022-03-13 04:04:12 +00:00
meta
// Text of the button
Text string `json:"text"`
// Type of the button
Type KeyboardButtonType `json:"type"`
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *KeyboardButton) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
type stub KeyboardButton
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*KeyboardButton) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassKeyboardButton
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*KeyboardButton) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeKeyboardButton
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (keyboardButton *KeyboardButton) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Text string `json:"text"`
Type json.RawMessage `json:"type"`
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
keyboardButton.Text = tmp.Text
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
fieldType, _ := UnmarshalKeyboardButtonType(tmp.Type)
keyboardButton.Type = fieldType
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return nil
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
// A button that opens a specified URL
type InlineKeyboardButtonTypeUrl struct {
2022-03-13 04:04:12 +00:00
meta
// HTTP or tg:// URL to open
Url string `json:"url"`
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InlineKeyboardButtonTypeUrl) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
type stub InlineKeyboardButtonTypeUrl
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InlineKeyboardButtonTypeUrl) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInlineKeyboardButtonType
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InlineKeyboardButtonTypeUrl) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInlineKeyboardButtonTypeUrl
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InlineKeyboardButtonTypeUrl) InlineKeyboardButtonTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeInlineKeyboardButtonTypeUrl
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
// A button that opens a specified URL and automatically authorize the current user if allowed to do so
type InlineKeyboardButtonTypeLoginUrl struct {
2022-03-13 04:04:12 +00:00
meta
// An HTTP URL to open
Url string `json:"url"`
// Unique button identifier
Id int64 `json:"id"`
// If non-empty, new text of the button in forwarded messages
ForwardText string `json:"forward_text"`
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InlineKeyboardButtonTypeLoginUrl) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
type stub InlineKeyboardButtonTypeLoginUrl
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InlineKeyboardButtonTypeLoginUrl) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInlineKeyboardButtonType
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InlineKeyboardButtonTypeLoginUrl) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInlineKeyboardButtonTypeLoginUrl
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InlineKeyboardButtonTypeLoginUrl) InlineKeyboardButtonTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeInlineKeyboardButtonTypeLoginUrl
2021-12-30 05:55:02 +00:00
}
// A button that sends a callback query to a bot
type InlineKeyboardButtonTypeCallback struct {
2022-03-13 04:04:12 +00:00
meta
// Data to be sent to the bot via a callback query
Data []byte `json:"data"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InlineKeyboardButtonTypeCallback) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub InlineKeyboardButtonTypeCallback
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InlineKeyboardButtonTypeCallback) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInlineKeyboardButtonType
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InlineKeyboardButtonTypeCallback) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInlineKeyboardButtonTypeCallback
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InlineKeyboardButtonTypeCallback) InlineKeyboardButtonTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeInlineKeyboardButtonTypeCallback
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A button that asks for password of the current user and then sends a callback query to a bot
type InlineKeyboardButtonTypeCallbackWithPassword struct {
2022-03-13 04:04:12 +00:00
meta
// Data to be sent to the bot via a callback query
Data []byte `json:"data"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InlineKeyboardButtonTypeCallbackWithPassword) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub InlineKeyboardButtonTypeCallbackWithPassword
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InlineKeyboardButtonTypeCallbackWithPassword) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInlineKeyboardButtonType
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InlineKeyboardButtonTypeCallbackWithPassword) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInlineKeyboardButtonTypeCallbackWithPassword
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InlineKeyboardButtonTypeCallbackWithPassword) InlineKeyboardButtonTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeInlineKeyboardButtonTypeCallbackWithPassword
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A button with a game that sends a callback query to a bot. This button must be in the first column and row of the keyboard and can be attached only to a message with content of the type messageGame
2022-03-13 04:04:12 +00:00
type InlineKeyboardButtonTypeCallbackGame struct{
meta
2021-12-30 05:55:02 +00:00
}
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
func (entity *InlineKeyboardButtonTypeCallbackGame) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub InlineKeyboardButtonTypeCallbackGame
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InlineKeyboardButtonTypeCallbackGame) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInlineKeyboardButtonType
2021-12-30 05:55:02 +00:00
}
func (*InlineKeyboardButtonTypeCallbackGame) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInlineKeyboardButtonTypeCallbackGame
2021-12-30 05:55:02 +00:00
}
func (*InlineKeyboardButtonTypeCallbackGame) InlineKeyboardButtonTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeInlineKeyboardButtonTypeCallbackGame
2021-12-30 05:55:02 +00:00
}
// A button that forces an inline query to the bot to be inserted in the input field
type InlineKeyboardButtonTypeSwitchInline struct {
2022-03-13 04:04:12 +00:00
meta
// Inline query to be sent to the bot
Query string `json:"query"`
// True, if the inline query must be sent from the current chat
InCurrentChat bool `json:"in_current_chat"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InlineKeyboardButtonTypeSwitchInline) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub InlineKeyboardButtonTypeSwitchInline
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InlineKeyboardButtonTypeSwitchInline) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInlineKeyboardButtonType
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InlineKeyboardButtonTypeSwitchInline) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInlineKeyboardButtonTypeSwitchInline
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InlineKeyboardButtonTypeSwitchInline) InlineKeyboardButtonTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeInlineKeyboardButtonTypeSwitchInline
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A button to buy something. This button must be in the first column and row of the keyboard and can be attached only to a message with content of the type messageInvoice
2022-03-13 04:04:12 +00:00
type InlineKeyboardButtonTypeBuy struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InlineKeyboardButtonTypeBuy) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub InlineKeyboardButtonTypeBuy
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InlineKeyboardButtonTypeBuy) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInlineKeyboardButtonType
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InlineKeyboardButtonTypeBuy) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInlineKeyboardButtonTypeBuy
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InlineKeyboardButtonTypeBuy) InlineKeyboardButtonTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeInlineKeyboardButtonTypeBuy
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A button with a user reference to be handled in the same way as textEntityTypeMentionName entities
type InlineKeyboardButtonTypeUser struct {
2022-03-13 04:04:12 +00:00
meta
// User identifier
UserId int64 `json:"user_id"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InlineKeyboardButtonTypeUser) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub InlineKeyboardButtonTypeUser
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InlineKeyboardButtonTypeUser) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInlineKeyboardButtonType
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InlineKeyboardButtonTypeUser) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInlineKeyboardButtonTypeUser
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InlineKeyboardButtonTypeUser) InlineKeyboardButtonTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeInlineKeyboardButtonTypeUser
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// Represents a single button in an inline keyboard
type InlineKeyboardButton struct {
2022-03-13 04:04:12 +00:00
meta
// Text of the button
Text string `json:"text"`
// Type of the button
Type InlineKeyboardButtonType `json:"type"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InlineKeyboardButton) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub InlineKeyboardButton
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InlineKeyboardButton) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInlineKeyboardButton
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InlineKeyboardButton) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInlineKeyboardButton
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (inlineKeyboardButton *InlineKeyboardButton) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Text string `json:"text"`
Type json.RawMessage `json:"type"`
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
inlineKeyboardButton.Text = tmp.Text
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
fieldType, _ := UnmarshalInlineKeyboardButtonType(tmp.Type)
inlineKeyboardButton.Type = fieldType
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return nil
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// Instructs application to remove the keyboard once this message has been received. This kind of keyboard can't be received in an incoming message; instead, UpdateChatReplyMarkup with message_id == 0 will be sent
type ReplyMarkupRemoveKeyboard struct {
2022-03-13 04:04:12 +00:00
meta
// True, if the keyboard is removed only for the mentioned users or the target user of a reply
IsPersonal bool `json:"is_personal"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *ReplyMarkupRemoveKeyboard) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub ReplyMarkupRemoveKeyboard
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ReplyMarkupRemoveKeyboard) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassReplyMarkup
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ReplyMarkupRemoveKeyboard) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeReplyMarkupRemoveKeyboard
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ReplyMarkupRemoveKeyboard) ReplyMarkupType() string {
2022-03-13 04:04:12 +00:00
return TypeReplyMarkupRemoveKeyboard
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// Instructs application to force a reply to this message
type ReplyMarkupForceReply struct {
2022-03-13 04:04:12 +00:00
meta
// True, if a forced reply must automatically be shown to the current user. For outgoing messages, specify true to show the forced reply only for the mentioned users and for the target user of a reply
IsPersonal bool `json:"is_personal"`
// If non-empty, the placeholder to be shown in the input field when the reply is active; 0-64 characters
InputFieldPlaceholder string `json:"input_field_placeholder"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *ReplyMarkupForceReply) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub ReplyMarkupForceReply
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ReplyMarkupForceReply) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassReplyMarkup
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ReplyMarkupForceReply) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeReplyMarkupForceReply
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ReplyMarkupForceReply) ReplyMarkupType() string {
2022-03-13 04:04:12 +00:00
return TypeReplyMarkupForceReply
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// Contains a custom keyboard layout to quickly reply to bots
type ReplyMarkupShowKeyboard struct {
2022-03-13 04:04:12 +00:00
meta
// A list of rows of bot keyboard buttons
Rows [][]*KeyboardButton `json:"rows"`
// True, if the application needs to resize the keyboard vertically
ResizeKeyboard bool `json:"resize_keyboard"`
// True, if the application needs to hide the keyboard after use
OneTime bool `json:"one_time"`
// True, if the keyboard must automatically be shown to the current user. For outgoing messages, specify true to show the keyboard only for the mentioned users and for the target user of a reply
IsPersonal bool `json:"is_personal"`
// If non-empty, the placeholder to be shown in the input field when the keyboard is active; 0-64 characters
InputFieldPlaceholder string `json:"input_field_placeholder"`
2021-12-30 05:55:02 +00:00
}
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
func (entity *ReplyMarkupShowKeyboard) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub ReplyMarkupShowKeyboard
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
func (*ReplyMarkupShowKeyboard) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassReplyMarkup
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ReplyMarkupShowKeyboard) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeReplyMarkupShowKeyboard
2021-12-30 05:55:02 +00:00
}
func (*ReplyMarkupShowKeyboard) ReplyMarkupType() string {
2022-03-13 04:04:12 +00:00
return TypeReplyMarkupShowKeyboard
2021-12-30 05:55:02 +00:00
}
// Contains an inline keyboard layout
type ReplyMarkupInlineKeyboard struct {
2022-03-13 04:04:12 +00:00
meta
// A list of rows of inline keyboard buttons
Rows [][]*InlineKeyboardButton `json:"rows"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *ReplyMarkupInlineKeyboard) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub ReplyMarkupInlineKeyboard
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ReplyMarkupInlineKeyboard) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassReplyMarkup
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ReplyMarkupInlineKeyboard) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeReplyMarkupInlineKeyboard
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ReplyMarkupInlineKeyboard) ReplyMarkupType() string {
2022-03-13 04:04:12 +00:00
return TypeReplyMarkupInlineKeyboard
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// An HTTP url needs to be open
type LoginUrlInfoOpen struct {
2022-03-13 04:04:12 +00:00
meta
// The URL to open
Url string `json:"url"`
// True, if there is no need to show an ordinary open URL confirm
SkipConfirm bool `json:"skip_confirm"`
2021-12-30 05:55:02 +00:00
}
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
func (entity *LoginUrlInfoOpen) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub LoginUrlInfoOpen
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*LoginUrlInfoOpen) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassLoginUrlInfo
2021-12-30 05:55:02 +00:00
}
func (*LoginUrlInfoOpen) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeLoginUrlInfoOpen
2021-12-30 05:55:02 +00:00
}
func (*LoginUrlInfoOpen) LoginUrlInfoType() string {
2022-03-13 04:04:12 +00:00
return TypeLoginUrlInfoOpen
2021-12-30 05:55:02 +00:00
}
// An authorization confirmation dialog needs to be shown to the user
type LoginUrlInfoRequestConfirmation struct {
2022-03-13 04:04:12 +00:00
meta
// An HTTP URL to be opened
Url string `json:"url"`
// A domain of the URL
Domain string `json:"domain"`
// User identifier of a bot linked with the website
BotUserId int64 `json:"bot_user_id"`
// True, if the user needs to be requested to give the permission to the bot to send them messages
RequestWriteAccess bool `json:"request_write_access"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *LoginUrlInfoRequestConfirmation) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub LoginUrlInfoRequestConfirmation
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*LoginUrlInfoRequestConfirmation) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassLoginUrlInfo
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*LoginUrlInfoRequestConfirmation) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeLoginUrlInfoRequestConfirmation
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*LoginUrlInfoRequestConfirmation) LoginUrlInfoType() string {
2022-03-13 04:04:12 +00:00
return TypeLoginUrlInfoRequestConfirmation
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// Contains information about a message thread
type MessageThreadInfo struct {
2022-03-13 04:04:12 +00:00
meta
// Identifier of the chat to which the message thread belongs
ChatId int64 `json:"chat_id"`
// Message thread identifier, unique within the chat
MessageThreadId int64 `json:"message_thread_id"`
// Information about the message thread
ReplyInfo *MessageReplyInfo `json:"reply_info"`
// Approximate number of unread messages in the message thread
UnreadMessageCount int32 `json:"unread_message_count"`
// The messages from which the thread starts. The messages are returned in a reverse chronological order (i.e., in order of decreasing message_id)
Messages []*Message `json:"messages"`
// A draft of a message in the message thread; may be null
DraftMessage *DraftMessage `json:"draft_message"`
2021-12-30 05:55:02 +00:00
}
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
func (entity *MessageThreadInfo) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub MessageThreadInfo
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageThreadInfo) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageThreadInfo
2021-12-30 05:55:02 +00:00
}
func (*MessageThreadInfo) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageThreadInfo
2021-12-30 05:55:02 +00:00
}
// A plain text
type RichTextPlain struct {
2022-03-13 04:04:12 +00:00
meta
// Text
Text string `json:"text"`
2021-12-30 05:55:02 +00:00
}
func (entity *RichTextPlain) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub RichTextPlain
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*RichTextPlain) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassRichText
2021-12-30 05:55:02 +00:00
}
func (*RichTextPlain) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeRichTextPlain
2021-12-30 05:55:02 +00:00
}
func (*RichTextPlain) RichTextType() string {
2022-03-13 04:04:12 +00:00
return TypeRichTextPlain
2021-12-30 05:55:02 +00:00
}
// A bold rich text
type RichTextBold struct {
2022-03-13 04:04:12 +00:00
meta
// Text
Text RichText `json:"text"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *RichTextBold) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub RichTextBold
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*RichTextBold) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassRichText
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*RichTextBold) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeRichTextBold
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*RichTextBold) RichTextType() string {
2022-03-13 04:04:12 +00:00
return TypeRichTextBold
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (richTextBold *RichTextBold) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Text json.RawMessage `json:"text"`
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
fieldText, _ := UnmarshalRichText(tmp.Text)
richTextBold.Text = fieldText
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return nil
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// An italicized rich text
type RichTextItalic struct {
2022-03-13 04:04:12 +00:00
meta
// Text
Text RichText `json:"text"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *RichTextItalic) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub RichTextItalic
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*RichTextItalic) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassRichText
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*RichTextItalic) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeRichTextItalic
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*RichTextItalic) RichTextType() string {
2022-03-13 04:04:12 +00:00
return TypeRichTextItalic
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (richTextItalic *RichTextItalic) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Text json.RawMessage `json:"text"`
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
fieldText, _ := UnmarshalRichText(tmp.Text)
richTextItalic.Text = fieldText
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return nil
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// An underlined rich text
type RichTextUnderline struct {
2022-03-13 04:04:12 +00:00
meta
// Text
Text RichText `json:"text"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *RichTextUnderline) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub RichTextUnderline
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*RichTextUnderline) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassRichText
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*RichTextUnderline) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeRichTextUnderline
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*RichTextUnderline) RichTextType() string {
2022-03-13 04:04:12 +00:00
return TypeRichTextUnderline
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (richTextUnderline *RichTextUnderline) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Text json.RawMessage `json:"text"`
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
fieldText, _ := UnmarshalRichText(tmp.Text)
richTextUnderline.Text = fieldText
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return nil
2021-12-30 05:55:02 +00:00
}
// A strikethrough rich text
type RichTextStrikethrough struct {
2022-03-13 04:04:12 +00:00
meta
// Text
Text RichText `json:"text"`
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *RichTextStrikethrough) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
type stub RichTextStrikethrough
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*RichTextStrikethrough) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassRichText
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*RichTextStrikethrough) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeRichTextStrikethrough
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*RichTextStrikethrough) RichTextType() string {
2022-03-13 04:04:12 +00:00
return TypeRichTextStrikethrough
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (richTextStrikethrough *RichTextStrikethrough) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Text json.RawMessage `json:"text"`
}
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
fieldText, _ := UnmarshalRichText(tmp.Text)
richTextStrikethrough.Text = fieldText
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return nil
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
// A fixed-width rich text
type RichTextFixed struct {
2022-03-13 04:04:12 +00:00
meta
// Text
Text RichText `json:"text"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *RichTextFixed) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub RichTextFixed
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*RichTextFixed) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassRichText
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*RichTextFixed) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeRichTextFixed
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*RichTextFixed) RichTextType() string {
2022-03-13 04:04:12 +00:00
return TypeRichTextFixed
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (richTextFixed *RichTextFixed) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Text json.RawMessage `json:"text"`
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
fieldText, _ := UnmarshalRichText(tmp.Text)
richTextFixed.Text = fieldText
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return nil
2021-12-30 05:55:02 +00:00
}
// A rich text URL link
type RichTextUrl struct {
2022-03-13 04:04:12 +00:00
meta
// Text
Text RichText `json:"text"`
// URL
Url string `json:"url"`
// True, if the URL has cached instant view server-side
IsCached bool `json:"is_cached"`
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *RichTextUrl) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
type stub RichTextUrl
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*RichTextUrl) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassRichText
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*RichTextUrl) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeRichTextUrl
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*RichTextUrl) RichTextType() string {
2022-03-13 04:04:12 +00:00
return TypeRichTextUrl
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (richTextUrl *RichTextUrl) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Text json.RawMessage `json:"text"`
Url string `json:"url"`
IsCached bool `json:"is_cached"`
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
richTextUrl.Url = tmp.Url
richTextUrl.IsCached = tmp.IsCached
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
fieldText, _ := UnmarshalRichText(tmp.Text)
richTextUrl.Text = fieldText
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return nil
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A rich text email link
type RichTextEmailAddress struct {
2022-03-13 04:04:12 +00:00
meta
// Text
Text RichText `json:"text"`
// Email address
EmailAddress string `json:"email_address"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *RichTextEmailAddress) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub RichTextEmailAddress
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*RichTextEmailAddress) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassRichText
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*RichTextEmailAddress) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeRichTextEmailAddress
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*RichTextEmailAddress) RichTextType() string {
2022-03-13 04:04:12 +00:00
return TypeRichTextEmailAddress
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (richTextEmailAddress *RichTextEmailAddress) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Text json.RawMessage `json:"text"`
EmailAddress string `json:"email_address"`
}
2021-01-18 14:16:52 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-01-18 14:16:52 +00:00
2022-03-13 04:04:12 +00:00
richTextEmailAddress.EmailAddress = tmp.EmailAddress
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
fieldText, _ := UnmarshalRichText(tmp.Text)
richTextEmailAddress.Text = fieldText
2021-01-18 14:16:52 +00:00
2022-03-13 04:04:12 +00:00
return nil
2021-01-18 14:16:52 +00:00
}
2021-12-30 05:55:02 +00:00
// A subscript rich text
type RichTextSubscript struct {
2022-03-13 04:04:12 +00:00
meta
// Text
Text RichText `json:"text"`
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *RichTextSubscript) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub RichTextSubscript
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*RichTextSubscript) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassRichText
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*RichTextSubscript) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeRichTextSubscript
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*RichTextSubscript) RichTextType() string {
2022-03-13 04:04:12 +00:00
return TypeRichTextSubscript
2021-12-30 05:55:02 +00:00
}
func (richTextSubscript *RichTextSubscript) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Text json.RawMessage `json:"text"`
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
fieldText, _ := UnmarshalRichText(tmp.Text)
richTextSubscript.Text = fieldText
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return nil
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A superscript rich text
type RichTextSuperscript struct {
2022-03-13 04:04:12 +00:00
meta
// Text
Text RichText `json:"text"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *RichTextSuperscript) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub RichTextSuperscript
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*RichTextSuperscript) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassRichText
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*RichTextSuperscript) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeRichTextSuperscript
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*RichTextSuperscript) RichTextType() string {
2022-03-13 04:04:12 +00:00
return TypeRichTextSuperscript
2021-12-30 05:55:02 +00:00
}
func (richTextSuperscript *RichTextSuperscript) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Text json.RawMessage `json:"text"`
}
2021-01-18 14:16:52 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-01-18 14:16:52 +00:00
2022-03-13 04:04:12 +00:00
fieldText, _ := UnmarshalRichText(tmp.Text)
richTextSuperscript.Text = fieldText
2021-01-18 14:16:52 +00:00
2022-03-13 04:04:12 +00:00
return nil
2021-01-18 14:16:52 +00:00
}
2021-12-30 05:55:02 +00:00
// A marked rich text
type RichTextMarked struct {
2022-03-13 04:04:12 +00:00
meta
// Text
Text RichText `json:"text"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *RichTextMarked) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub RichTextMarked
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
func (*RichTextMarked) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassRichText
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*RichTextMarked) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeRichTextMarked
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*RichTextMarked) RichTextType() string {
2022-03-13 04:04:12 +00:00
return TypeRichTextMarked
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (richTextMarked *RichTextMarked) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Text json.RawMessage `json:"text"`
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
fieldText, _ := UnmarshalRichText(tmp.Text)
richTextMarked.Text = fieldText
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return nil
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A rich text phone number
type RichTextPhoneNumber struct {
2022-03-13 04:04:12 +00:00
meta
// Text
Text RichText `json:"text"`
// Phone number
PhoneNumber string `json:"phone_number"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *RichTextPhoneNumber) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub RichTextPhoneNumber
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*RichTextPhoneNumber) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassRichText
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*RichTextPhoneNumber) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeRichTextPhoneNumber
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*RichTextPhoneNumber) RichTextType() string {
2022-03-13 04:04:12 +00:00
return TypeRichTextPhoneNumber
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (richTextPhoneNumber *RichTextPhoneNumber) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Text json.RawMessage `json:"text"`
PhoneNumber string `json:"phone_number"`
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
richTextPhoneNumber.PhoneNumber = tmp.PhoneNumber
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
fieldText, _ := UnmarshalRichText(tmp.Text)
richTextPhoneNumber.Text = fieldText
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return nil
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A small image inside the text
type RichTextIcon struct {
2022-03-13 04:04:12 +00:00
meta
// The image represented as a document. The image can be in GIF, JPEG or PNG format
Document *Document `json:"document"`
// Width of a bounding box in which the image must be shown; 0 if unknown
Width int32 `json:"width"`
// Height of a bounding box in which the image must be shown; 0 if unknown
Height int32 `json:"height"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *RichTextIcon) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub RichTextIcon
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*RichTextIcon) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassRichText
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*RichTextIcon) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeRichTextIcon
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*RichTextIcon) RichTextType() string {
2022-03-13 04:04:12 +00:00
return TypeRichTextIcon
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A reference to a richTexts object on the same web page
type RichTextReference struct {
2022-03-13 04:04:12 +00:00
meta
// The text
Text RichText `json:"text"`
// The name of a richTextAnchor object, which is the first element of the target richTexts object
AnchorName string `json:"anchor_name"`
// An HTTP URL, opening the reference
Url string `json:"url"`
2019-06-07 10:56:06 +00:00
}
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
func (entity *RichTextReference) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub RichTextReference
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
func (*RichTextReference) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassRichText
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*RichTextReference) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeRichTextReference
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*RichTextReference) RichTextType() string {
2022-03-13 04:04:12 +00:00
return TypeRichTextReference
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (richTextReference *RichTextReference) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Text json.RawMessage `json:"text"`
AnchorName string `json:"anchor_name"`
Url string `json:"url"`
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
richTextReference.AnchorName = tmp.AnchorName
richTextReference.Url = tmp.Url
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
fieldText, _ := UnmarshalRichText(tmp.Text)
richTextReference.Text = fieldText
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return nil
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// An anchor
type RichTextAnchor struct {
2022-03-13 04:04:12 +00:00
meta
// Anchor name
Name string `json:"name"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *RichTextAnchor) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub RichTextAnchor
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*RichTextAnchor) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassRichText
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*RichTextAnchor) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeRichTextAnchor
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*RichTextAnchor) RichTextType() string {
2022-03-13 04:04:12 +00:00
return TypeRichTextAnchor
2021-12-30 05:55:02 +00:00
}
// A link to an anchor on the same web page
type RichTextAnchorLink struct {
2022-03-13 04:04:12 +00:00
meta
// The link text
Text RichText `json:"text"`
// The anchor name. If the name is empty, the link must bring back to top
AnchorName string `json:"anchor_name"`
// An HTTP URL, opening the anchor
Url string `json:"url"`
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *RichTextAnchorLink) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub RichTextAnchorLink
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*RichTextAnchorLink) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassRichText
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*RichTextAnchorLink) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeRichTextAnchorLink
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*RichTextAnchorLink) RichTextType() string {
2022-03-13 04:04:12 +00:00
return TypeRichTextAnchorLink
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (richTextAnchorLink *RichTextAnchorLink) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Text json.RawMessage `json:"text"`
AnchorName string `json:"anchor_name"`
Url string `json:"url"`
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
richTextAnchorLink.AnchorName = tmp.AnchorName
richTextAnchorLink.Url = tmp.Url
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
fieldText, _ := UnmarshalRichText(tmp.Text)
richTextAnchorLink.Text = fieldText
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return nil
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A concatenation of rich texts
type RichTexts struct {
2022-03-13 04:04:12 +00:00
meta
// Texts
Texts []RichText `json:"texts"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *RichTexts) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub RichTexts
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*RichTexts) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassRichText
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*RichTexts) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeRichTexts
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*RichTexts) RichTextType() string {
2022-03-13 04:04:12 +00:00
return TypeRichTexts
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (richTexts *RichTexts) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Texts []json.RawMessage `json:"texts"`
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
fieldTexts, _ := UnmarshalListOfRichText(tmp.Texts)
richTexts.Texts = fieldTexts
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return nil
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// Contains a caption of an instant view web page block, consisting of a text and a trailing credit
type PageBlockCaption struct {
2022-03-13 04:04:12 +00:00
meta
// Content of the caption
Text RichText `json:"text"`
// Block credit (like HTML tag <cite>)
Credit RichText `json:"credit"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PageBlockCaption) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub PageBlockCaption
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockCaption) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPageBlockCaption
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockCaption) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePageBlockCaption
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (pageBlockCaption *PageBlockCaption) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Text json.RawMessage `json:"text"`
Credit json.RawMessage `json:"credit"`
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
fieldText, _ := UnmarshalRichText(tmp.Text)
pageBlockCaption.Text = fieldText
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
fieldCredit, _ := UnmarshalRichText(tmp.Credit)
pageBlockCaption.Credit = fieldCredit
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return nil
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// Describes an item of a list page block
type PageBlockListItem struct {
2022-03-13 04:04:12 +00:00
meta
// Item label
Label string `json:"label"`
// Item blocks
PageBlocks []PageBlock `json:"page_blocks"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PageBlockListItem) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub PageBlockListItem
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockListItem) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPageBlockListItem
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockListItem) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePageBlockListItem
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (pageBlockListItem *PageBlockListItem) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Label string `json:"label"`
PageBlocks []json.RawMessage `json:"page_blocks"`
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
pageBlockListItem.Label = tmp.Label
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
fieldPageBlocks, _ := UnmarshalListOfPageBlock(tmp.PageBlocks)
pageBlockListItem.PageBlocks = fieldPageBlocks
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return nil
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// The content must be left-aligned
2022-03-13 04:04:12 +00:00
type PageBlockHorizontalAlignmentLeft struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PageBlockHorizontalAlignmentLeft) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub PageBlockHorizontalAlignmentLeft
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockHorizontalAlignmentLeft) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPageBlockHorizontalAlignment
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockHorizontalAlignmentLeft) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePageBlockHorizontalAlignmentLeft
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockHorizontalAlignmentLeft) PageBlockHorizontalAlignmentType() string {
2022-03-13 04:04:12 +00:00
return TypePageBlockHorizontalAlignmentLeft
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// The content must be center-aligned
2022-03-13 04:04:12 +00:00
type PageBlockHorizontalAlignmentCenter struct{
meta
2021-12-30 05:55:02 +00:00
}
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
func (entity *PageBlockHorizontalAlignmentCenter) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub PageBlockHorizontalAlignmentCenter
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockHorizontalAlignmentCenter) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPageBlockHorizontalAlignment
2021-12-30 05:55:02 +00:00
}
func (*PageBlockHorizontalAlignmentCenter) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePageBlockHorizontalAlignmentCenter
2021-12-30 05:55:02 +00:00
}
func (*PageBlockHorizontalAlignmentCenter) PageBlockHorizontalAlignmentType() string {
2022-03-13 04:04:12 +00:00
return TypePageBlockHorizontalAlignmentCenter
2021-12-30 05:55:02 +00:00
}
// The content must be right-aligned
2022-03-13 04:04:12 +00:00
type PageBlockHorizontalAlignmentRight struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PageBlockHorizontalAlignmentRight) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub PageBlockHorizontalAlignmentRight
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockHorizontalAlignmentRight) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPageBlockHorizontalAlignment
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockHorizontalAlignmentRight) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePageBlockHorizontalAlignmentRight
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockHorizontalAlignmentRight) PageBlockHorizontalAlignmentType() string {
2022-03-13 04:04:12 +00:00
return TypePageBlockHorizontalAlignmentRight
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// The content must be top-aligned
2022-03-13 04:04:12 +00:00
type PageBlockVerticalAlignmentTop struct{
meta
2021-12-30 05:55:02 +00:00
}
2018-10-23 12:38:10 +00:00
2021-12-30 05:55:02 +00:00
func (entity *PageBlockVerticalAlignmentTop) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-10-23 12:38:10 +00:00
2022-03-13 04:04:12 +00:00
type stub PageBlockVerticalAlignmentTop
2018-10-23 12:38:10 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockVerticalAlignmentTop) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPageBlockVerticalAlignment
2021-12-30 05:55:02 +00:00
}
func (*PageBlockVerticalAlignmentTop) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePageBlockVerticalAlignmentTop
2021-12-30 05:55:02 +00:00
}
func (*PageBlockVerticalAlignmentTop) PageBlockVerticalAlignmentType() string {
2022-03-13 04:04:12 +00:00
return TypePageBlockVerticalAlignmentTop
2021-12-30 05:55:02 +00:00
}
// The content must be middle-aligned
2022-03-13 04:04:12 +00:00
type PageBlockVerticalAlignmentMiddle struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PageBlockVerticalAlignmentMiddle) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub PageBlockVerticalAlignmentMiddle
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockVerticalAlignmentMiddle) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPageBlockVerticalAlignment
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockVerticalAlignmentMiddle) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePageBlockVerticalAlignmentMiddle
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockVerticalAlignmentMiddle) PageBlockVerticalAlignmentType() string {
2022-03-13 04:04:12 +00:00
return TypePageBlockVerticalAlignmentMiddle
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// The content must be bottom-aligned
2022-03-13 04:04:12 +00:00
type PageBlockVerticalAlignmentBottom struct{
meta
2021-12-30 05:55:02 +00:00
}
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
func (entity *PageBlockVerticalAlignmentBottom) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub PageBlockVerticalAlignmentBottom
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockVerticalAlignmentBottom) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPageBlockVerticalAlignment
2021-12-30 05:55:02 +00:00
}
func (*PageBlockVerticalAlignmentBottom) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePageBlockVerticalAlignmentBottom
2021-12-30 05:55:02 +00:00
}
func (*PageBlockVerticalAlignmentBottom) PageBlockVerticalAlignmentType() string {
2022-03-13 04:04:12 +00:00
return TypePageBlockVerticalAlignmentBottom
2021-12-30 05:55:02 +00:00
}
// Represents a cell of a table
type PageBlockTableCell struct {
2022-03-13 04:04:12 +00:00
meta
// Cell text; may be null. If the text is null, then the cell must be invisible
Text RichText `json:"text"`
// True, if it is a header cell
IsHeader bool `json:"is_header"`
// The number of columns the cell spans
Colspan int32 `json:"colspan"`
// The number of rows the cell spans
Rowspan int32 `json:"rowspan"`
// Horizontal cell content alignment
Align PageBlockHorizontalAlignment `json:"align"`
// Vertical cell content alignment
Valign PageBlockVerticalAlignment `json:"valign"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PageBlockTableCell) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub PageBlockTableCell
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockTableCell) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPageBlockTableCell
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockTableCell) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePageBlockTableCell
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (pageBlockTableCell *PageBlockTableCell) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Text json.RawMessage `json:"text"`
IsHeader bool `json:"is_header"`
Colspan int32 `json:"colspan"`
Rowspan int32 `json:"rowspan"`
Align json.RawMessage `json:"align"`
Valign json.RawMessage `json:"valign"`
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
pageBlockTableCell.IsHeader = tmp.IsHeader
pageBlockTableCell.Colspan = tmp.Colspan
pageBlockTableCell.Rowspan = tmp.Rowspan
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
fieldText, _ := UnmarshalRichText(tmp.Text)
pageBlockTableCell.Text = fieldText
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
fieldAlign, _ := UnmarshalPageBlockHorizontalAlignment(tmp.Align)
pageBlockTableCell.Align = fieldAlign
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
fieldValign, _ := UnmarshalPageBlockVerticalAlignment(tmp.Valign)
pageBlockTableCell.Valign = fieldValign
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return nil
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// Contains information about a related article
type PageBlockRelatedArticle struct {
2022-03-13 04:04:12 +00:00
meta
// Related article URL
Url string `json:"url"`
// Article title; may be empty
Title string `json:"title"`
// Article description; may be empty
Description string `json:"description"`
// Article photo; may be null
Photo *Photo `json:"photo"`
// Article author; may be empty
Author string `json:"author"`
// Point in time (Unix timestamp) when the article was published; 0 if unknown
PublishDate int32 `json:"publish_date"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PageBlockRelatedArticle) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub PageBlockRelatedArticle
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockRelatedArticle) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPageBlockRelatedArticle
2021-12-30 05:55:02 +00:00
}
func (*PageBlockRelatedArticle) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePageBlockRelatedArticle
2021-12-30 05:55:02 +00:00
}
// The title of a page
type PageBlockTitle struct {
2022-03-13 04:04:12 +00:00
meta
// Title
Title RichText `json:"title"`
2021-12-30 05:55:02 +00:00
}
func (entity *PageBlockTitle) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub PageBlockTitle
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*PageBlockTitle) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPageBlock
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockTitle) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePageBlockTitle
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockTitle) PageBlockType() string {
2022-03-13 04:04:12 +00:00
return TypePageBlockTitle
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (pageBlockTitle *PageBlockTitle) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Title json.RawMessage `json:"title"`
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
fieldTitle, _ := UnmarshalRichText(tmp.Title)
pageBlockTitle.Title = fieldTitle
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return nil
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// The subtitle of a page
type PageBlockSubtitle struct {
2022-03-13 04:04:12 +00:00
meta
// Subtitle
Subtitle RichText `json:"subtitle"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PageBlockSubtitle) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub PageBlockSubtitle
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockSubtitle) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPageBlock
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockSubtitle) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePageBlockSubtitle
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockSubtitle) PageBlockType() string {
2022-03-13 04:04:12 +00:00
return TypePageBlockSubtitle
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (pageBlockSubtitle *PageBlockSubtitle) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Subtitle json.RawMessage `json:"subtitle"`
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
fieldSubtitle, _ := UnmarshalRichText(tmp.Subtitle)
pageBlockSubtitle.Subtitle = fieldSubtitle
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return nil
2021-12-30 05:55:02 +00:00
}
// The author and publishing date of a page
type PageBlockAuthorDate struct {
2022-03-13 04:04:12 +00:00
meta
// Author
Author RichText `json:"author"`
// Point in time (Unix timestamp) when the article was published; 0 if unknown
PublishDate int32 `json:"publish_date"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PageBlockAuthorDate) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub PageBlockAuthorDate
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockAuthorDate) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPageBlock
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockAuthorDate) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePageBlockAuthorDate
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockAuthorDate) PageBlockType() string {
2022-03-13 04:04:12 +00:00
return TypePageBlockAuthorDate
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (pageBlockAuthorDate *PageBlockAuthorDate) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Author json.RawMessage `json:"author"`
PublishDate int32 `json:"publish_date"`
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
pageBlockAuthorDate.PublishDate = tmp.PublishDate
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
fieldAuthor, _ := UnmarshalRichText(tmp.Author)
pageBlockAuthorDate.Author = fieldAuthor
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return nil
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// A header
type PageBlockHeader struct {
2022-03-13 04:04:12 +00:00
meta
// Header
Header RichText `json:"header"`
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PageBlockHeader) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub PageBlockHeader
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockHeader) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPageBlock
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockHeader) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePageBlockHeader
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockHeader) PageBlockType() string {
2022-03-13 04:04:12 +00:00
return TypePageBlockHeader
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (pageBlockHeader *PageBlockHeader) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Header json.RawMessage `json:"header"`
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
fieldHeader, _ := UnmarshalRichText(tmp.Header)
pageBlockHeader.Header = fieldHeader
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return nil
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A subheader
type PageBlockSubheader struct {
2022-03-13 04:04:12 +00:00
meta
// Subheader
Subheader RichText `json:"subheader"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PageBlockSubheader) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub PageBlockSubheader
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockSubheader) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPageBlock
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockSubheader) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePageBlockSubheader
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockSubheader) PageBlockType() string {
2022-03-13 04:04:12 +00:00
return TypePageBlockSubheader
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (pageBlockSubheader *PageBlockSubheader) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Subheader json.RawMessage `json:"subheader"`
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
fieldSubheader, _ := UnmarshalRichText(tmp.Subheader)
pageBlockSubheader.Subheader = fieldSubheader
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return nil
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A kicker
type PageBlockKicker struct {
2022-03-13 04:04:12 +00:00
meta
// Kicker
Kicker RichText `json:"kicker"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PageBlockKicker) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub PageBlockKicker
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockKicker) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPageBlock
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockKicker) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePageBlockKicker
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockKicker) PageBlockType() string {
2022-03-13 04:04:12 +00:00
return TypePageBlockKicker
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (pageBlockKicker *PageBlockKicker) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Kicker json.RawMessage `json:"kicker"`
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
fieldKicker, _ := UnmarshalRichText(tmp.Kicker)
pageBlockKicker.Kicker = fieldKicker
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return nil
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// A text paragraph
type PageBlockParagraph struct {
2022-03-13 04:04:12 +00:00
meta
// Paragraph text
Text RichText `json:"text"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PageBlockParagraph) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub PageBlockParagraph
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockParagraph) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPageBlock
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockParagraph) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePageBlockParagraph
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockParagraph) PageBlockType() string {
2022-03-13 04:04:12 +00:00
return TypePageBlockParagraph
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (pageBlockParagraph *PageBlockParagraph) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Text json.RawMessage `json:"text"`
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
fieldText, _ := UnmarshalRichText(tmp.Text)
pageBlockParagraph.Text = fieldText
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return nil
2021-12-30 05:55:02 +00:00
}
// A preformatted text paragraph
type PageBlockPreformatted struct {
2022-03-13 04:04:12 +00:00
meta
// Paragraph text
Text RichText `json:"text"`
// Programming language for which the text needs to be formatted
Language string `json:"language"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PageBlockPreformatted) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub PageBlockPreformatted
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockPreformatted) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPageBlock
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockPreformatted) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePageBlockPreformatted
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockPreformatted) PageBlockType() string {
2022-03-13 04:04:12 +00:00
return TypePageBlockPreformatted
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (pageBlockPreformatted *PageBlockPreformatted) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Text json.RawMessage `json:"text"`
Language string `json:"language"`
}
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
pageBlockPreformatted.Language = tmp.Language
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
fieldText, _ := UnmarshalRichText(tmp.Text)
pageBlockPreformatted.Text = fieldText
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
return nil
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
// The footer of a page
type PageBlockFooter struct {
2022-03-13 04:04:12 +00:00
meta
// Footer
Footer RichText `json:"footer"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PageBlockFooter) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub PageBlockFooter
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockFooter) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPageBlock
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockFooter) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePageBlockFooter
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockFooter) PageBlockType() string {
2022-03-13 04:04:12 +00:00
return TypePageBlockFooter
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (pageBlockFooter *PageBlockFooter) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Footer json.RawMessage `json:"footer"`
}
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
fieldFooter, _ := UnmarshalRichText(tmp.Footer)
pageBlockFooter.Footer = fieldFooter
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return nil
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// An empty block separating a page
2022-03-13 04:04:12 +00:00
type PageBlockDivider struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PageBlockDivider) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub PageBlockDivider
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockDivider) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPageBlock
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockDivider) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePageBlockDivider
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockDivider) PageBlockType() string {
2022-03-13 04:04:12 +00:00
return TypePageBlockDivider
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// An invisible anchor on a page, which can be used in a URL to open the page from the specified anchor
type PageBlockAnchor struct {
2022-03-13 04:04:12 +00:00
meta
// Name of the anchor
Name string `json:"name"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PageBlockAnchor) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub PageBlockAnchor
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockAnchor) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPageBlock
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockAnchor) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePageBlockAnchor
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockAnchor) PageBlockType() string {
2022-03-13 04:04:12 +00:00
return TypePageBlockAnchor
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// A list of data blocks
type PageBlockList struct {
2022-03-13 04:04:12 +00:00
meta
// The items of the list
Items []*PageBlockListItem `json:"items"`
2021-12-30 05:55:02 +00:00
}
2021-01-18 14:16:52 +00:00
2021-12-30 05:55:02 +00:00
func (entity *PageBlockList) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-01-18 14:16:52 +00:00
2022-03-13 04:04:12 +00:00
type stub PageBlockList
2021-01-18 14:16:52 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-01-18 14:16:52 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockList) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPageBlock
2021-12-30 05:55:02 +00:00
}
func (*PageBlockList) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePageBlockList
2021-12-30 05:55:02 +00:00
}
func (*PageBlockList) PageBlockType() string {
2022-03-13 04:04:12 +00:00
return TypePageBlockList
2021-12-30 05:55:02 +00:00
}
// A block quote
type PageBlockBlockQuote struct {
2022-03-13 04:04:12 +00:00
meta
// Quote text
Text RichText `json:"text"`
// Quote credit
Credit RichText `json:"credit"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PageBlockBlockQuote) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub PageBlockBlockQuote
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockBlockQuote) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPageBlock
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockBlockQuote) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePageBlockBlockQuote
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockBlockQuote) PageBlockType() string {
2022-03-13 04:04:12 +00:00
return TypePageBlockBlockQuote
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (pageBlockBlockQuote *PageBlockBlockQuote) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Text json.RawMessage `json:"text"`
Credit json.RawMessage `json:"credit"`
}
2021-01-18 14:16:52 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-01-18 14:16:52 +00:00
2022-03-13 04:04:12 +00:00
fieldText, _ := UnmarshalRichText(tmp.Text)
pageBlockBlockQuote.Text = fieldText
2021-01-18 14:16:52 +00:00
2022-03-13 04:04:12 +00:00
fieldCredit, _ := UnmarshalRichText(tmp.Credit)
pageBlockBlockQuote.Credit = fieldCredit
2021-01-18 14:16:52 +00:00
2022-03-13 04:04:12 +00:00
return nil
2021-01-18 14:16:52 +00:00
}
2021-12-30 05:55:02 +00:00
// A pull quote
type PageBlockPullQuote struct {
2022-03-13 04:04:12 +00:00
meta
// Quote text
Text RichText `json:"text"`
// Quote credit
Credit RichText `json:"credit"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PageBlockPullQuote) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub PageBlockPullQuote
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockPullQuote) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPageBlock
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockPullQuote) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePageBlockPullQuote
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockPullQuote) PageBlockType() string {
2022-03-13 04:04:12 +00:00
return TypePageBlockPullQuote
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (pageBlockPullQuote *PageBlockPullQuote) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Text json.RawMessage `json:"text"`
Credit json.RawMessage `json:"credit"`
}
2021-01-18 14:16:52 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-01-18 14:16:52 +00:00
2022-03-13 04:04:12 +00:00
fieldText, _ := UnmarshalRichText(tmp.Text)
pageBlockPullQuote.Text = fieldText
2021-01-18 14:16:52 +00:00
2022-03-13 04:04:12 +00:00
fieldCredit, _ := UnmarshalRichText(tmp.Credit)
pageBlockPullQuote.Credit = fieldCredit
2021-01-18 14:16:52 +00:00
2022-03-13 04:04:12 +00:00
return nil
2021-01-18 14:16:52 +00:00
}
2021-12-30 05:55:02 +00:00
// An animation
type PageBlockAnimation struct {
2022-03-13 04:04:12 +00:00
meta
// Animation file; may be null
Animation *Animation `json:"animation"`
// Animation caption
Caption *PageBlockCaption `json:"caption"`
// True, if the animation must be played automatically
NeedAutoplay bool `json:"need_autoplay"`
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PageBlockAnimation) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub PageBlockAnimation
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockAnimation) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPageBlock
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockAnimation) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePageBlockAnimation
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockAnimation) PageBlockType() string {
2022-03-13 04:04:12 +00:00
return TypePageBlockAnimation
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// An audio file
type PageBlockAudio struct {
2022-03-13 04:04:12 +00:00
meta
// Audio file; may be null
Audio *Audio `json:"audio"`
// Audio file caption
Caption *PageBlockCaption `json:"caption"`
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PageBlockAudio) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub PageBlockAudio
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockAudio) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPageBlock
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockAudio) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePageBlockAudio
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockAudio) PageBlockType() string {
2022-03-13 04:04:12 +00:00
return TypePageBlockAudio
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
// A photo
type PageBlockPhoto struct {
2022-03-13 04:04:12 +00:00
meta
// Photo file; may be null
Photo *Photo `json:"photo"`
// Photo caption
Caption *PageBlockCaption `json:"caption"`
// URL that needs to be opened when the photo is clicked
Url string `json:"url"`
2021-12-30 05:55:02 +00:00
}
2018-09-05 21:45:29 +00:00
2021-12-30 05:55:02 +00:00
func (entity *PageBlockPhoto) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub PageBlockPhoto
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
2018-09-05 21:45:29 +00:00
2021-12-30 05:55:02 +00:00
func (*PageBlockPhoto) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPageBlock
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockPhoto) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePageBlockPhoto
2021-12-30 05:55:02 +00:00
}
func (*PageBlockPhoto) PageBlockType() string {
2022-03-13 04:04:12 +00:00
return TypePageBlockPhoto
2021-12-30 05:55:02 +00:00
}
// A video
type PageBlockVideo struct {
2022-03-13 04:04:12 +00:00
meta
// Video file; may be null
Video *Video `json:"video"`
// Video caption
Caption *PageBlockCaption `json:"caption"`
// True, if the video must be played automatically
NeedAutoplay bool `json:"need_autoplay"`
// True, if the video must be looped
IsLooped bool `json:"is_looped"`
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PageBlockVideo) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub PageBlockVideo
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockVideo) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPageBlock
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockVideo) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePageBlockVideo
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockVideo) PageBlockType() string {
2022-03-13 04:04:12 +00:00
return TypePageBlockVideo
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
// A voice note
type PageBlockVoiceNote struct {
2022-03-13 04:04:12 +00:00
meta
// Voice note; may be null
VoiceNote *VoiceNote `json:"voice_note"`
// Voice note caption
Caption *PageBlockCaption `json:"caption"`
2021-12-30 05:55:02 +00:00
}
2018-09-05 21:45:29 +00:00
2021-12-30 05:55:02 +00:00
func (entity *PageBlockVoiceNote) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub PageBlockVoiceNote
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
2018-09-05 21:45:29 +00:00
2021-12-30 05:55:02 +00:00
func (*PageBlockVoiceNote) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPageBlock
2021-12-30 05:55:02 +00:00
}
2021-01-18 14:16:52 +00:00
2021-12-30 05:55:02 +00:00
func (*PageBlockVoiceNote) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePageBlockVoiceNote
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockVoiceNote) PageBlockType() string {
2022-03-13 04:04:12 +00:00
return TypePageBlockVoiceNote
2021-12-30 05:55:02 +00:00
}
// A page cover
type PageBlockCover struct {
2022-03-13 04:04:12 +00:00
meta
// Cover
Cover PageBlock `json:"cover"`
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PageBlockCover) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub PageBlockCover
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockCover) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPageBlock
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockCover) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePageBlockCover
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockCover) PageBlockType() string {
2022-03-13 04:04:12 +00:00
return TypePageBlockCover
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (pageBlockCover *PageBlockCover) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Cover json.RawMessage `json:"cover"`
}
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
fieldCover, _ := UnmarshalPageBlock(tmp.Cover)
pageBlockCover.Cover = fieldCover
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return nil
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
// An embedded web page
type PageBlockEmbedded struct {
2022-03-13 04:04:12 +00:00
meta
// Web page URL, if available
Url string `json:"url"`
// HTML-markup of the embedded page
Html string `json:"html"`
// Poster photo, if available; may be null
PosterPhoto *Photo `json:"poster_photo"`
// Block width; 0 if unknown
Width int32 `json:"width"`
// Block height; 0 if unknown
Height int32 `json:"height"`
// Block caption
Caption *PageBlockCaption `json:"caption"`
// True, if the block must be full width
IsFullWidth bool `json:"is_full_width"`
// True, if scrolling needs to be allowed
AllowScrolling bool `json:"allow_scrolling"`
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PageBlockEmbedded) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub PageBlockEmbedded
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockEmbedded) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPageBlock
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockEmbedded) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePageBlockEmbedded
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockEmbedded) PageBlockType() string {
2022-03-13 04:04:12 +00:00
return TypePageBlockEmbedded
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
// An embedded post
type PageBlockEmbeddedPost struct {
2022-03-13 04:04:12 +00:00
meta
// Web page URL
Url string `json:"url"`
// Post author
Author string `json:"author"`
// Post author photo; may be null
AuthorPhoto *Photo `json:"author_photo"`
// Point in time (Unix timestamp) when the post was created; 0 if unknown
Date int32 `json:"date"`
// Post content
PageBlocks []PageBlock `json:"page_blocks"`
// Post caption
Caption *PageBlockCaption `json:"caption"`
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PageBlockEmbeddedPost) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub PageBlockEmbeddedPost
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockEmbeddedPost) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPageBlock
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockEmbeddedPost) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePageBlockEmbeddedPost
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockEmbeddedPost) PageBlockType() string {
2022-03-13 04:04:12 +00:00
return TypePageBlockEmbeddedPost
2021-12-30 05:55:02 +00:00
}
func (pageBlockEmbeddedPost *PageBlockEmbeddedPost) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Url string `json:"url"`
Author string `json:"author"`
AuthorPhoto *Photo `json:"author_photo"`
Date int32 `json:"date"`
PageBlocks []json.RawMessage `json:"page_blocks"`
Caption *PageBlockCaption `json:"caption"`
}
2021-01-18 14:16:52 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-01-18 14:16:52 +00:00
2022-03-13 04:04:12 +00:00
pageBlockEmbeddedPost.Url = tmp.Url
pageBlockEmbeddedPost.Author = tmp.Author
pageBlockEmbeddedPost.AuthorPhoto = tmp.AuthorPhoto
pageBlockEmbeddedPost.Date = tmp.Date
pageBlockEmbeddedPost.Caption = tmp.Caption
2021-01-18 14:16:52 +00:00
2022-03-13 04:04:12 +00:00
fieldPageBlocks, _ := UnmarshalListOfPageBlock(tmp.PageBlocks)
pageBlockEmbeddedPost.PageBlocks = fieldPageBlocks
2021-01-18 14:16:52 +00:00
2022-03-13 04:04:12 +00:00
return nil
2021-01-18 14:16:52 +00:00
}
2021-12-30 05:55:02 +00:00
// A collage
type PageBlockCollage struct {
2022-03-13 04:04:12 +00:00
meta
// Collage item contents
PageBlocks []PageBlock `json:"page_blocks"`
// Block caption
Caption *PageBlockCaption `json:"caption"`
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PageBlockCollage) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub PageBlockCollage
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockCollage) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPageBlock
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockCollage) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePageBlockCollage
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockCollage) PageBlockType() string {
2022-03-13 04:04:12 +00:00
return TypePageBlockCollage
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (pageBlockCollage *PageBlockCollage) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
PageBlocks []json.RawMessage `json:"page_blocks"`
Caption *PageBlockCaption `json:"caption"`
}
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
pageBlockCollage.Caption = tmp.Caption
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
fieldPageBlocks, _ := UnmarshalListOfPageBlock(tmp.PageBlocks)
pageBlockCollage.PageBlocks = fieldPageBlocks
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return nil
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
// A slideshow
type PageBlockSlideshow struct {
2022-03-13 04:04:12 +00:00
meta
// Slideshow item contents
PageBlocks []PageBlock `json:"page_blocks"`
// Block caption
Caption *PageBlockCaption `json:"caption"`
2021-12-30 05:55:02 +00:00
}
func (entity *PageBlockSlideshow) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
type stub PageBlockSlideshow
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockSlideshow) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPageBlock
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockSlideshow) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePageBlockSlideshow
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockSlideshow) PageBlockType() string {
2022-03-13 04:04:12 +00:00
return TypePageBlockSlideshow
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (pageBlockSlideshow *PageBlockSlideshow) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
PageBlocks []json.RawMessage `json:"page_blocks"`
Caption *PageBlockCaption `json:"caption"`
}
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
pageBlockSlideshow.Caption = tmp.Caption
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
fieldPageBlocks, _ := UnmarshalListOfPageBlock(tmp.PageBlocks)
pageBlockSlideshow.PageBlocks = fieldPageBlocks
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return nil
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
// A link to a chat
type PageBlockChatLink struct {
2022-03-13 04:04:12 +00:00
meta
// Chat title
Title string `json:"title"`
// Chat photo; may be null
Photo *ChatPhotoInfo `json:"photo"`
// Chat username, by which all other information about the chat can be resolved
Username string `json:"username"`
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PageBlockChatLink) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
type stub PageBlockChatLink
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockChatLink) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPageBlock
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockChatLink) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePageBlockChatLink
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockChatLink) PageBlockType() string {
2022-03-13 04:04:12 +00:00
return TypePageBlockChatLink
2021-12-30 05:55:02 +00:00
}
// A table
type PageBlockTable struct {
2022-03-13 04:04:12 +00:00
meta
// Table caption
Caption RichText `json:"caption"`
// Table cells
Cells [][]*PageBlockTableCell `json:"cells"`
// True, if the table is bordered
IsBordered bool `json:"is_bordered"`
// True, if the table is striped
IsStriped bool `json:"is_striped"`
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PageBlockTable) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
type stub PageBlockTable
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockTable) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPageBlock
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockTable) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePageBlockTable
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockTable) PageBlockType() string {
2022-03-13 04:04:12 +00:00
return TypePageBlockTable
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (pageBlockTable *PageBlockTable) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Caption json.RawMessage `json:"caption"`
Cells [][]*PageBlockTableCell `json:"cells"`
IsBordered bool `json:"is_bordered"`
IsStriped bool `json:"is_striped"`
}
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
pageBlockTable.Cells = tmp.Cells
pageBlockTable.IsBordered = tmp.IsBordered
pageBlockTable.IsStriped = tmp.IsStriped
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
fieldCaption, _ := UnmarshalRichText(tmp.Caption)
pageBlockTable.Caption = fieldCaption
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return nil
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
// A collapsible block
type PageBlockDetails struct {
2022-03-13 04:04:12 +00:00
meta
// Always visible heading for the block
Header RichText `json:"header"`
// Block contents
PageBlocks []PageBlock `json:"page_blocks"`
// True, if the block is open by default
IsOpen bool `json:"is_open"`
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PageBlockDetails) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub PageBlockDetails
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockDetails) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPageBlock
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockDetails) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePageBlockDetails
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockDetails) PageBlockType() string {
2022-03-13 04:04:12 +00:00
return TypePageBlockDetails
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (pageBlockDetails *PageBlockDetails) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Header json.RawMessage `json:"header"`
PageBlocks []json.RawMessage `json:"page_blocks"`
IsOpen bool `json:"is_open"`
}
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
pageBlockDetails.IsOpen = tmp.IsOpen
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
fieldHeader, _ := UnmarshalRichText(tmp.Header)
pageBlockDetails.Header = fieldHeader
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
fieldPageBlocks, _ := UnmarshalListOfPageBlock(tmp.PageBlocks)
pageBlockDetails.PageBlocks = fieldPageBlocks
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return nil
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
// Related articles
type PageBlockRelatedArticles struct {
2022-03-13 04:04:12 +00:00
meta
// Block header
Header RichText `json:"header"`
// List of related articles
Articles []*PageBlockRelatedArticle `json:"articles"`
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PageBlockRelatedArticles) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub PageBlockRelatedArticles
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockRelatedArticles) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPageBlock
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockRelatedArticles) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePageBlockRelatedArticles
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockRelatedArticles) PageBlockType() string {
2022-03-13 04:04:12 +00:00
return TypePageBlockRelatedArticles
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (pageBlockRelatedArticles *PageBlockRelatedArticles) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Header json.RawMessage `json:"header"`
Articles []*PageBlockRelatedArticle `json:"articles"`
}
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
pageBlockRelatedArticles.Articles = tmp.Articles
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
fieldHeader, _ := UnmarshalRichText(tmp.Header)
pageBlockRelatedArticles.Header = fieldHeader
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return nil
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
// A map
type PageBlockMap struct {
2022-03-13 04:04:12 +00:00
meta
// Location of the map center
Location *Location `json:"location"`
// Map zoom level
Zoom int32 `json:"zoom"`
// Map width
Width int32 `json:"width"`
// Map height
Height int32 `json:"height"`
// Block caption
Caption *PageBlockCaption `json:"caption"`
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PageBlockMap) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub PageBlockMap
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockMap) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPageBlock
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockMap) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePageBlockMap
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PageBlockMap) PageBlockType() string {
2022-03-13 04:04:12 +00:00
return TypePageBlockMap
2021-12-30 05:55:02 +00:00
}
// Describes an instant view page for a web page
type WebPageInstantView struct {
2022-03-13 04:04:12 +00:00
meta
// Content of the web page
PageBlocks []PageBlock `json:"page_blocks"`
// Number of the instant view views; 0 if unknown
ViewCount int32 `json:"view_count"`
// Version of the instant view; currently, can be 1 or 2
Version int32 `json:"version"`
// True, if the instant view must be shown from right to left
IsRtl bool `json:"is_rtl"`
// True, if the instant view contains the full page. A network request might be needed to get the full web page instant view
IsFull bool `json:"is_full"`
// An internal link to be opened to leave feedback about the instant view
FeedbackLink InternalLinkType `json:"feedback_link"`
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *WebPageInstantView) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub WebPageInstantView
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*WebPageInstantView) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassWebPageInstantView
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*WebPageInstantView) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeWebPageInstantView
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (webPageInstantView *WebPageInstantView) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
PageBlocks []json.RawMessage `json:"page_blocks"`
ViewCount int32 `json:"view_count"`
Version int32 `json:"version"`
IsRtl bool `json:"is_rtl"`
IsFull bool `json:"is_full"`
FeedbackLink json.RawMessage `json:"feedback_link"`
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
webPageInstantView.ViewCount = tmp.ViewCount
webPageInstantView.Version = tmp.Version
webPageInstantView.IsRtl = tmp.IsRtl
webPageInstantView.IsFull = tmp.IsFull
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
fieldPageBlocks, _ := UnmarshalListOfPageBlock(tmp.PageBlocks)
webPageInstantView.PageBlocks = fieldPageBlocks
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
fieldFeedbackLink, _ := UnmarshalInternalLinkType(tmp.FeedbackLink)
webPageInstantView.FeedbackLink = fieldFeedbackLink
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return nil
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// Describes a web page preview
type WebPage struct {
2022-03-13 04:04:12 +00:00
meta
// Original URL of the link
Url string `json:"url"`
// URL to display
DisplayUrl string `json:"display_url"`
// Type of the web page. Can be: article, photo, audio, video, document, profile, app, or something else
Type string `json:"type"`
// Short name of the site (e.g., Google Docs, App Store)
SiteName string `json:"site_name"`
// Title of the content
Title string `json:"title"`
// Description of the content
Description *FormattedText `json:"description"`
// Image representing the content; may be null
Photo *Photo `json:"photo"`
// URL to show in the embedded preview
EmbedUrl string `json:"embed_url"`
// MIME type of the embedded preview, (e.g., text/html or video/mp4)
EmbedType string `json:"embed_type"`
// Width of the embedded preview
EmbedWidth int32 `json:"embed_width"`
// Height of the embedded preview
EmbedHeight int32 `json:"embed_height"`
// Duration of the content, in seconds
Duration int32 `json:"duration"`
// Author of the content
Author string `json:"author"`
// Preview of the content as an animation, if available; may be null
Animation *Animation `json:"animation"`
// Preview of the content as an audio file, if available; may be null
Audio *Audio `json:"audio"`
// Preview of the content as a document, if available; may be null
Document *Document `json:"document"`
// Preview of the content as a sticker for small WEBP files, if available; may be null
Sticker *Sticker `json:"sticker"`
// Preview of the content as a video, if available; may be null
Video *Video `json:"video"`
// Preview of the content as a video note, if available; may be null
VideoNote *VideoNote `json:"video_note"`
// Preview of the content as a voice note, if available; may be null
VoiceNote *VoiceNote `json:"voice_note"`
// Version of instant view, available for the web page (currently, can be 1 or 2), 0 if none
InstantViewVersion int32 `json:"instant_view_version"`
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *WebPage) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub WebPage
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*WebPage) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassWebPage
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*WebPage) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeWebPage
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
// Contains information about a country
type CountryInfo struct {
2022-03-13 04:04:12 +00:00
meta
// A two-letter ISO 3166-1 alpha-2 country code
CountryCode string `json:"country_code"`
// Native name of the country
Name string `json:"name"`
// English name of the country
EnglishName string `json:"english_name"`
// True, if the country must be hidden from the list of all countries
IsHidden bool `json:"is_hidden"`
// List of country calling codes
CallingCodes []string `json:"calling_codes"`
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *CountryInfo) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub CountryInfo
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*CountryInfo) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassCountryInfo
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*CountryInfo) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeCountryInfo
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// Contains information about countries
type Countries struct {
2022-03-13 04:04:12 +00:00
meta
// The list of countries
Countries []*CountryInfo `json:"countries"`
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *Countries) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub Countries
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*Countries) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassCountries
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*Countries) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeCountries
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// Contains information about a phone number
type PhoneNumberInfo struct {
2022-03-13 04:04:12 +00:00
meta
// Information about the country to which the phone number belongs; may be null
Country *CountryInfo `json:"country"`
// The part of the phone number denoting country calling code or its part
CountryCallingCode string `json:"country_calling_code"`
// The phone number without country calling code formatted accordingly to local rules. Expected digits are returned as '-', but even more digits might be entered by the user
FormattedPhoneNumber string `json:"formatted_phone_number"`
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PhoneNumberInfo) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub PhoneNumberInfo
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PhoneNumberInfo) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPhoneNumberInfo
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PhoneNumberInfo) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePhoneNumberInfo
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
// Describes an action associated with a bank card number
type BankCardActionOpenUrl struct {
2022-03-13 04:04:12 +00:00
meta
// Action text
Text string `json:"text"`
// The URL to be opened
Url string `json:"url"`
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *BankCardActionOpenUrl) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub BankCardActionOpenUrl
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*BankCardActionOpenUrl) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassBankCardActionOpenUrl
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*BankCardActionOpenUrl) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeBankCardActionOpenUrl
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
// Information about a bank card
type BankCardInfo struct {
2022-03-13 04:04:12 +00:00
meta
// Title of the bank card description
Title string `json:"title"`
// Actions that can be done with the bank card number
Actions []*BankCardActionOpenUrl `json:"actions"`
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *BankCardInfo) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub BankCardInfo
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*BankCardInfo) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassBankCardInfo
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*BankCardInfo) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeBankCardInfo
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
// Describes an address
type Address struct {
2022-03-13 04:04:12 +00:00
meta
// A two-letter ISO 3166-1 alpha-2 country code
CountryCode string `json:"country_code"`
// State, if applicable
State string `json:"state"`
// City
City string `json:"city"`
// First line of the address
StreetLine1 string `json:"street_line1"`
// Second line of the address
StreetLine2 string `json:"street_line2"`
// Address postal code
PostalCode string `json:"postal_code"`
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *Address) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub Address
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*Address) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassAddress
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*Address) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeAddress
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
// Portion of the price of a product (e.g., "delivery cost", "tax amount")
type LabeledPricePart struct {
2022-03-13 04:04:12 +00:00
meta
// Label for this portion of the product price
Label string `json:"label"`
// Currency amount in the smallest units of the currency
Amount int64 `json:"amount"`
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *LabeledPricePart) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub LabeledPricePart
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*LabeledPricePart) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassLabeledPricePart
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*LabeledPricePart) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeLabeledPricePart
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
// Product invoice
type Invoice struct {
2022-03-13 04:04:12 +00:00
meta
// ISO 4217 currency code
Currency string `json:"currency"`
// A list of objects used to calculate the total price of the product
PriceParts []*LabeledPricePart `json:"price_parts"`
// The maximum allowed amount of tip in the smallest units of the currency
MaxTipAmount int64 `json:"max_tip_amount"`
// Suggested amounts of tip in the smallest units of the currency
SuggestedTipAmounts []int64 `json:"suggested_tip_amounts"`
// True, if the payment is a test payment
IsTest bool `json:"is_test"`
// True, if the user's name is needed for payment
NeedName bool `json:"need_name"`
// True, if the user's phone number is needed for payment
NeedPhoneNumber bool `json:"need_phone_number"`
// True, if the user's email address is needed for payment
NeedEmailAddress bool `json:"need_email_address"`
// True, if the user's shipping address is needed for payment
NeedShippingAddress bool `json:"need_shipping_address"`
// True, if the user's phone number will be sent to the provider
SendPhoneNumberToProvider bool `json:"send_phone_number_to_provider"`
// True, if the user's email address will be sent to the provider
SendEmailAddressToProvider bool `json:"send_email_address_to_provider"`
// True, if the total price depends on the shipping method
IsFlexible bool `json:"is_flexible"`
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *Invoice) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub Invoice
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*Invoice) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInvoice
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*Invoice) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInvoice
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
// Order information
type OrderInfo struct {
2022-03-13 04:04:12 +00:00
meta
// Name of the user
Name string `json:"name"`
// Phone number of the user
PhoneNumber string `json:"phone_number"`
// Email address of the user
EmailAddress string `json:"email_address"`
// Shipping address for this order; may be null
ShippingAddress *Address `json:"shipping_address"`
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *OrderInfo) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub OrderInfo
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*OrderInfo) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassOrderInfo
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*OrderInfo) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeOrderInfo
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
// One shipping option
type ShippingOption struct {
2022-03-13 04:04:12 +00:00
meta
// Shipping option identifier
Id string `json:"id"`
// Option title
Title string `json:"title"`
// A list of objects used to calculate the total shipping costs
PriceParts []*LabeledPricePart `json:"price_parts"`
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *ShippingOption) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub ShippingOption
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ShippingOption) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassShippingOption
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ShippingOption) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeShippingOption
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
// Contains information about saved card credentials
type SavedCredentials struct {
2022-03-13 04:04:12 +00:00
meta
// Unique identifier of the saved credentials
Id string `json:"id"`
// Title of the saved credentials
Title string `json:"title"`
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *SavedCredentials) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub SavedCredentials
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*SavedCredentials) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassSavedCredentials
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*SavedCredentials) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeSavedCredentials
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
// Applies if a user chooses some previously saved payment credentials. To use their previously saved credentials, the user must have a valid temporary password
type InputCredentialsSaved struct {
2022-03-13 04:04:12 +00:00
meta
// Identifier of the saved credentials
SavedCredentialsId string `json:"saved_credentials_id"`
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InputCredentialsSaved) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub InputCredentialsSaved
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputCredentialsSaved) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInputCredentials
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputCredentialsSaved) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInputCredentialsSaved
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputCredentialsSaved) InputCredentialsType() string {
2022-03-13 04:04:12 +00:00
return TypeInputCredentialsSaved
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
// Applies if a user enters new credentials on a payment provider website
type InputCredentialsNew struct {
2022-03-13 04:04:12 +00:00
meta
// JSON-encoded data with the credential identifier from the payment provider
Data string `json:"data"`
// True, if the credential identifier can be saved on the server side
AllowSave bool `json:"allow_save"`
2021-12-30 05:55:02 +00:00
}
2018-09-05 21:45:29 +00:00
2021-12-30 05:55:02 +00:00
func (entity *InputCredentialsNew) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub InputCredentialsNew
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputCredentialsNew) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInputCredentials
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputCredentialsNew) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInputCredentialsNew
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputCredentialsNew) InputCredentialsType() string {
2022-03-13 04:04:12 +00:00
return TypeInputCredentialsNew
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
// Applies if a user enters new credentials using Apple Pay
type InputCredentialsApplePay struct {
2022-03-13 04:04:12 +00:00
meta
// JSON-encoded data with the credential identifier
Data string `json:"data"`
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InputCredentialsApplePay) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub InputCredentialsApplePay
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputCredentialsApplePay) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInputCredentials
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputCredentialsApplePay) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInputCredentialsApplePay
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputCredentialsApplePay) InputCredentialsType() string {
2022-03-13 04:04:12 +00:00
return TypeInputCredentialsApplePay
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
// Applies if a user enters new credentials using Google Pay
type InputCredentialsGooglePay struct {
2022-03-13 04:04:12 +00:00
meta
// JSON-encoded data with the credential identifier
Data string `json:"data"`
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InputCredentialsGooglePay) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub InputCredentialsGooglePay
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputCredentialsGooglePay) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInputCredentials
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputCredentialsGooglePay) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInputCredentialsGooglePay
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputCredentialsGooglePay) InputCredentialsType() string {
2022-03-13 04:04:12 +00:00
return TypeInputCredentialsGooglePay
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
// Stripe payment provider
type PaymentsProviderStripe struct {
2022-03-13 04:04:12 +00:00
meta
// Stripe API publishable key
PublishableKey string `json:"publishable_key"`
// True, if the user country must be provided
NeedCountry bool `json:"need_country"`
// True, if the user ZIP/postal code must be provided
NeedPostalCode bool `json:"need_postal_code"`
// True, if the cardholder name must be provided
NeedCardholderName bool `json:"need_cardholder_name"`
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PaymentsProviderStripe) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub PaymentsProviderStripe
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PaymentsProviderStripe) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPaymentsProviderStripe
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PaymentsProviderStripe) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePaymentsProviderStripe
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
// Theme colors for a payment form
type PaymentFormTheme struct {
2022-03-13 04:04:12 +00:00
meta
// A color of the payment form background in the RGB24 format
BackgroundColor int32 `json:"background_color"`
// A color of text in the RGB24 format
TextColor int32 `json:"text_color"`
// A color of hints in the RGB24 format
HintColor int32 `json:"hint_color"`
// A color of links in the RGB24 format
LinkColor int32 `json:"link_color"`
// A color of the buttons in the RGB24 format
ButtonColor int32 `json:"button_color"`
// A color of text on the buttons in the RGB24 format
ButtonTextColor int32 `json:"button_text_color"`
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PaymentFormTheme) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub PaymentFormTheme
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PaymentFormTheme) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPaymentFormTheme
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PaymentFormTheme) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePaymentFormTheme
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
// Contains information about an invoice payment form
type PaymentForm struct {
2022-03-13 04:04:12 +00:00
meta
// The payment form identifier
Id JsonInt64 `json:"id"`
// Full information of the invoice
Invoice *Invoice `json:"invoice"`
// Payment form URL
Url string `json:"url"`
// User identifier of the seller bot
SellerBotUserId int64 `json:"seller_bot_user_id"`
// User identifier of the payment provider bot
PaymentsProviderUserId int64 `json:"payments_provider_user_id"`
// Information about the payment provider, if available, to support it natively without the need for opening the URL; may be null
PaymentsProvider *PaymentsProviderStripe `json:"payments_provider"`
// Saved server-side order information; may be null
SavedOrderInfo *OrderInfo `json:"saved_order_info"`
// Information about saved card credentials; may be null
SavedCredentials *SavedCredentials `json:"saved_credentials"`
// True, if the user can choose to save credentials
CanSaveCredentials bool `json:"can_save_credentials"`
// True, if the user will be able to save credentials protected by a password they set up
NeedPassword bool `json:"need_password"`
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PaymentForm) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub PaymentForm
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PaymentForm) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPaymentForm
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PaymentForm) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePaymentForm
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
// Contains a temporary identifier of validated order information, which is stored for one hour. Also contains the available shipping options
type ValidatedOrderInfo struct {
2022-03-13 04:04:12 +00:00
meta
// Temporary identifier of the order information
OrderInfoId string `json:"order_info_id"`
// Available shipping options
ShippingOptions []*ShippingOption `json:"shipping_options"`
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *ValidatedOrderInfo) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub ValidatedOrderInfo
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ValidatedOrderInfo) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassValidatedOrderInfo
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ValidatedOrderInfo) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeValidatedOrderInfo
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
// Contains the result of a payment request
type PaymentResult struct {
2022-03-13 04:04:12 +00:00
meta
// True, if the payment request was successful; otherwise the verification_url will be non-empty
Success bool `json:"success"`
// URL for additional payment credentials verification
VerificationUrl string `json:"verification_url"`
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PaymentResult) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub PaymentResult
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PaymentResult) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPaymentResult
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PaymentResult) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePaymentResult
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
// Contains information about a successful payment
type PaymentReceipt struct {
2022-03-13 04:04:12 +00:00
meta
// Product title
Title string `json:"title"`
// Product description
Description string `json:"description"`
// Product photo; may be null
Photo *Photo `json:"photo"`
// Point in time (Unix timestamp) when the payment was made
Date int32 `json:"date"`
// User identifier of the seller bot
SellerBotUserId int64 `json:"seller_bot_user_id"`
// User identifier of the payment provider bot
PaymentsProviderUserId int64 `json:"payments_provider_user_id"`
// Information about the invoice
Invoice *Invoice `json:"invoice"`
// Order information; may be null
OrderInfo *OrderInfo `json:"order_info"`
// Chosen shipping option; may be null
ShippingOption *ShippingOption `json:"shipping_option"`
// Title of the saved credentials chosen by the buyer
CredentialsTitle string `json:"credentials_title"`
// The amount of tip chosen by the buyer in the smallest units of the currency
TipAmount int64 `json:"tip_amount"`
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PaymentReceipt) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub PaymentReceipt
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PaymentReceipt) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPaymentReceipt
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PaymentReceipt) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePaymentReceipt
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
// File with the date it was uploaded
type DatedFile struct {
2022-03-13 04:04:12 +00:00
meta
// The file
File *File `json:"file"`
// Point in time (Unix timestamp) when the file was uploaded
Date int32 `json:"date"`
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *DatedFile) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub DatedFile
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*DatedFile) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassDatedFile
2021-12-30 05:55:02 +00:00
}
func (*DatedFile) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeDatedFile
2021-12-30 05:55:02 +00:00
}
// A Telegram Passport element containing the user's personal details
2022-03-13 04:04:12 +00:00
type PassportElementTypePersonalDetails struct{
meta
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PassportElementTypePersonalDetails) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub PassportElementTypePersonalDetails
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementTypePersonalDetails) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPassportElementType
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementTypePersonalDetails) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePassportElementTypePersonalDetails
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementTypePersonalDetails) PassportElementTypeType() string {
2022-03-13 04:04:12 +00:00
return TypePassportElementTypePersonalDetails
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
// A Telegram Passport element containing the user's passport
2022-03-13 04:04:12 +00:00
type PassportElementTypePassport struct{
meta
2021-12-30 05:55:02 +00:00
}
func (entity *PassportElementTypePassport) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub PassportElementTypePassport
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementTypePassport) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPassportElementType
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementTypePassport) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePassportElementTypePassport
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementTypePassport) PassportElementTypeType() string {
2022-03-13 04:04:12 +00:00
return TypePassportElementTypePassport
2021-12-30 05:55:02 +00:00
}
// A Telegram Passport element containing the user's driver license
2022-03-13 04:04:12 +00:00
type PassportElementTypeDriverLicense struct{
meta
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PassportElementTypeDriverLicense) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub PassportElementTypeDriverLicense
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementTypeDriverLicense) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPassportElementType
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementTypeDriverLicense) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePassportElementTypeDriverLicense
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementTypeDriverLicense) PassportElementTypeType() string {
2022-03-13 04:04:12 +00:00
return TypePassportElementTypeDriverLicense
2021-12-30 05:55:02 +00:00
}
// A Telegram Passport element containing the user's identity card
2022-03-13 04:04:12 +00:00
type PassportElementTypeIdentityCard struct{
meta
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PassportElementTypeIdentityCard) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub PassportElementTypeIdentityCard
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementTypeIdentityCard) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPassportElementType
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementTypeIdentityCard) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePassportElementTypeIdentityCard
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementTypeIdentityCard) PassportElementTypeType() string {
2022-03-13 04:04:12 +00:00
return TypePassportElementTypeIdentityCard
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
// A Telegram Passport element containing the user's internal passport
2022-03-13 04:04:12 +00:00
type PassportElementTypeInternalPassport struct{
meta
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PassportElementTypeInternalPassport) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub PassportElementTypeInternalPassport
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementTypeInternalPassport) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPassportElementType
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementTypeInternalPassport) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePassportElementTypeInternalPassport
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementTypeInternalPassport) PassportElementTypeType() string {
2022-03-13 04:04:12 +00:00
return TypePassportElementTypeInternalPassport
2021-12-30 05:55:02 +00:00
}
// A Telegram Passport element containing the user's address
2022-03-13 04:04:12 +00:00
type PassportElementTypeAddress struct{
meta
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PassportElementTypeAddress) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub PassportElementTypeAddress
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementTypeAddress) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPassportElementType
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementTypeAddress) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePassportElementTypeAddress
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementTypeAddress) PassportElementTypeType() string {
2022-03-13 04:04:12 +00:00
return TypePassportElementTypeAddress
2021-01-18 14:16:52 +00:00
}
2021-12-30 05:55:02 +00:00
// A Telegram Passport element containing the user's utility bill
2022-03-13 04:04:12 +00:00
type PassportElementTypeUtilityBill struct{
meta
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PassportElementTypeUtilityBill) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub PassportElementTypeUtilityBill
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementTypeUtilityBill) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPassportElementType
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementTypeUtilityBill) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePassportElementTypeUtilityBill
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementTypeUtilityBill) PassportElementTypeType() string {
2022-03-13 04:04:12 +00:00
return TypePassportElementTypeUtilityBill
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// A Telegram Passport element containing the user's bank statement
2022-03-13 04:04:12 +00:00
type PassportElementTypeBankStatement struct{
meta
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PassportElementTypeBankStatement) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub PassportElementTypeBankStatement
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementTypeBankStatement) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPassportElementType
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementTypeBankStatement) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePassportElementTypeBankStatement
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementTypeBankStatement) PassportElementTypeType() string {
2022-03-13 04:04:12 +00:00
return TypePassportElementTypeBankStatement
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
// A Telegram Passport element containing the user's rental agreement
2022-03-13 04:04:12 +00:00
type PassportElementTypeRentalAgreement struct{
meta
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PassportElementTypeRentalAgreement) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub PassportElementTypeRentalAgreement
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementTypeRentalAgreement) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPassportElementType
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementTypeRentalAgreement) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePassportElementTypeRentalAgreement
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementTypeRentalAgreement) PassportElementTypeType() string {
2022-03-13 04:04:12 +00:00
return TypePassportElementTypeRentalAgreement
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
// A Telegram Passport element containing the registration page of the user's passport
2022-03-13 04:04:12 +00:00
type PassportElementTypePassportRegistration struct{
meta
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PassportElementTypePassportRegistration) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub PassportElementTypePassportRegistration
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementTypePassportRegistration) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPassportElementType
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementTypePassportRegistration) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePassportElementTypePassportRegistration
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementTypePassportRegistration) PassportElementTypeType() string {
2022-03-13 04:04:12 +00:00
return TypePassportElementTypePassportRegistration
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
// A Telegram Passport element containing the user's temporary registration
2022-03-13 04:04:12 +00:00
type PassportElementTypeTemporaryRegistration struct{
meta
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PassportElementTypeTemporaryRegistration) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub PassportElementTypeTemporaryRegistration
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementTypeTemporaryRegistration) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPassportElementType
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementTypeTemporaryRegistration) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePassportElementTypeTemporaryRegistration
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementTypeTemporaryRegistration) PassportElementTypeType() string {
2022-03-13 04:04:12 +00:00
return TypePassportElementTypeTemporaryRegistration
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
// A Telegram Passport element containing the user's phone number
2022-03-13 04:04:12 +00:00
type PassportElementTypePhoneNumber struct{
meta
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PassportElementTypePhoneNumber) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub PassportElementTypePhoneNumber
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementTypePhoneNumber) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPassportElementType
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementTypePhoneNumber) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePassportElementTypePhoneNumber
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementTypePhoneNumber) PassportElementTypeType() string {
2022-03-13 04:04:12 +00:00
return TypePassportElementTypePhoneNumber
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
// A Telegram Passport element containing the user's email address
2022-03-13 04:04:12 +00:00
type PassportElementTypeEmailAddress struct{
meta
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PassportElementTypeEmailAddress) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub PassportElementTypeEmailAddress
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementTypeEmailAddress) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPassportElementType
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementTypeEmailAddress) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePassportElementTypeEmailAddress
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementTypeEmailAddress) PassportElementTypeType() string {
2022-03-13 04:04:12 +00:00
return TypePassportElementTypeEmailAddress
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
// Represents a date according to the Gregorian calendar
type Date struct {
2022-03-13 04:04:12 +00:00
meta
// Day of the month; 1-31
Day int32 `json:"day"`
// Month; 1-12
Month int32 `json:"month"`
// Year; 1-9999
Year int32 `json:"year"`
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *Date) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub Date
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*Date) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassDate
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*Date) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeDate
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
// Contains the user's personal details
type PersonalDetails struct {
2022-03-13 04:04:12 +00:00
meta
// First name of the user written in English; 1-255 characters
FirstName string `json:"first_name"`
// Middle name of the user written in English; 0-255 characters
MiddleName string `json:"middle_name"`
// Last name of the user written in English; 1-255 characters
LastName string `json:"last_name"`
// Native first name of the user; 1-255 characters
NativeFirstName string `json:"native_first_name"`
// Native middle name of the user; 0-255 characters
NativeMiddleName string `json:"native_middle_name"`
// Native last name of the user; 1-255 characters
NativeLastName string `json:"native_last_name"`
// Birthdate of the user
Birthdate *Date `json:"birthdate"`
// Gender of the user, "male" or "female"
Gender string `json:"gender"`
// A two-letter ISO 3166-1 alpha-2 country code of the user's country
CountryCode string `json:"country_code"`
// A two-letter ISO 3166-1 alpha-2 country code of the user's residence country
ResidenceCountryCode string `json:"residence_country_code"`
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PersonalDetails) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub PersonalDetails
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PersonalDetails) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPersonalDetails
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PersonalDetails) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePersonalDetails
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
// An identity document
type IdentityDocument struct {
2022-03-13 04:04:12 +00:00
meta
// Document number; 1-24 characters
Number string `json:"number"`
// Document expiry date; may be null if not applicable
ExpiryDate *Date `json:"expiry_date"`
// Front side of the document
FrontSide *DatedFile `json:"front_side"`
// Reverse side of the document; only for driver license and identity card; may be null
ReverseSide *DatedFile `json:"reverse_side"`
// Selfie with the document; may be null
Selfie *DatedFile `json:"selfie"`
// List of files containing a certified English translation of the document
Translation []*DatedFile `json:"translation"`
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *IdentityDocument) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub IdentityDocument
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*IdentityDocument) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassIdentityDocument
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*IdentityDocument) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeIdentityDocument
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
// An identity document to be saved to Telegram Passport
type InputIdentityDocument struct {
2022-03-13 04:04:12 +00:00
meta
// Document number; 1-24 characters
Number string `json:"number"`
// Document expiry date; pass null if not applicable
ExpiryDate *Date `json:"expiry_date"`
// Front side of the document
FrontSide InputFile `json:"front_side"`
// Reverse side of the document; only for driver license and identity card; pass null otherwise
ReverseSide InputFile `json:"reverse_side"`
// Selfie with the document; pass null if unavailable
Selfie InputFile `json:"selfie"`
// List of files containing a certified English translation of the document
Translation []InputFile `json:"translation"`
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InputIdentityDocument) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub InputIdentityDocument
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputIdentityDocument) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInputIdentityDocument
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputIdentityDocument) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInputIdentityDocument
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (inputIdentityDocument *InputIdentityDocument) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Number string `json:"number"`
ExpiryDate *Date `json:"expiry_date"`
FrontSide json.RawMessage `json:"front_side"`
ReverseSide json.RawMessage `json:"reverse_side"`
Selfie json.RawMessage `json:"selfie"`
Translation []json.RawMessage `json:"translation"`
}
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
inputIdentityDocument.Number = tmp.Number
inputIdentityDocument.ExpiryDate = tmp.ExpiryDate
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
fieldFrontSide, _ := UnmarshalInputFile(tmp.FrontSide)
inputIdentityDocument.FrontSide = fieldFrontSide
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
fieldReverseSide, _ := UnmarshalInputFile(tmp.ReverseSide)
inputIdentityDocument.ReverseSide = fieldReverseSide
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
fieldSelfie, _ := UnmarshalInputFile(tmp.Selfie)
inputIdentityDocument.Selfie = fieldSelfie
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
fieldTranslation, _ := UnmarshalListOfInputFile(tmp.Translation)
inputIdentityDocument.Translation = fieldTranslation
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return nil
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
// A personal document, containing some information about a user
type PersonalDocument struct {
2022-03-13 04:04:12 +00:00
meta
// List of files containing the pages of the document
Files []*DatedFile `json:"files"`
// List of files containing a certified English translation of the document
Translation []*DatedFile `json:"translation"`
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PersonalDocument) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub PersonalDocument
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PersonalDocument) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPersonalDocument
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PersonalDocument) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePersonalDocument
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// A personal document to be saved to Telegram Passport
type InputPersonalDocument struct {
2022-03-13 04:04:12 +00:00
meta
// List of files containing the pages of the document
Files []InputFile `json:"files"`
// List of files containing a certified English translation of the document
Translation []InputFile `json:"translation"`
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InputPersonalDocument) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub InputPersonalDocument
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputPersonalDocument) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInputPersonalDocument
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputPersonalDocument) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInputPersonalDocument
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (inputPersonalDocument *InputPersonalDocument) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Files []json.RawMessage `json:"files"`
Translation []json.RawMessage `json:"translation"`
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
fieldFiles, _ := UnmarshalListOfInputFile(tmp.Files)
inputPersonalDocument.Files = fieldFiles
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
fieldTranslation, _ := UnmarshalListOfInputFile(tmp.Translation)
inputPersonalDocument.Translation = fieldTranslation
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return nil
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// A Telegram Passport element containing the user's personal details
type PassportElementPersonalDetails struct {
2022-03-13 04:04:12 +00:00
meta
// Personal details of the user
PersonalDetails *PersonalDetails `json:"personal_details"`
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PassportElementPersonalDetails) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub PassportElementPersonalDetails
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementPersonalDetails) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPassportElement
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementPersonalDetails) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePassportElementPersonalDetails
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementPersonalDetails) PassportElementType() string {
2022-03-13 04:04:12 +00:00
return TypePassportElementPersonalDetails
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// A Telegram Passport element containing the user's passport
type PassportElementPassport struct {
2022-03-13 04:04:12 +00:00
meta
// Passport
Passport *IdentityDocument `json:"passport"`
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PassportElementPassport) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub PassportElementPassport
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementPassport) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPassportElement
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementPassport) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePassportElementPassport
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementPassport) PassportElementType() string {
2022-03-13 04:04:12 +00:00
return TypePassportElementPassport
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
// A Telegram Passport element containing the user's driver license
type PassportElementDriverLicense struct {
2022-03-13 04:04:12 +00:00
meta
// Driver license
DriverLicense *IdentityDocument `json:"driver_license"`
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PassportElementDriverLicense) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub PassportElementDriverLicense
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementDriverLicense) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPassportElement
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementDriverLicense) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePassportElementDriverLicense
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementDriverLicense) PassportElementType() string {
2022-03-13 04:04:12 +00:00
return TypePassportElementDriverLicense
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
// A Telegram Passport element containing the user's identity card
type PassportElementIdentityCard struct {
2022-03-13 04:04:12 +00:00
meta
// Identity card
IdentityCard *IdentityDocument `json:"identity_card"`
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PassportElementIdentityCard) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub PassportElementIdentityCard
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementIdentityCard) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPassportElement
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementIdentityCard) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePassportElementIdentityCard
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementIdentityCard) PassportElementType() string {
2022-03-13 04:04:12 +00:00
return TypePassportElementIdentityCard
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
// A Telegram Passport element containing the user's internal passport
type PassportElementInternalPassport struct {
2022-03-13 04:04:12 +00:00
meta
// Internal passport
InternalPassport *IdentityDocument `json:"internal_passport"`
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PassportElementInternalPassport) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub PassportElementInternalPassport
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementInternalPassport) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPassportElement
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementInternalPassport) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePassportElementInternalPassport
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementInternalPassport) PassportElementType() string {
2022-03-13 04:04:12 +00:00
return TypePassportElementInternalPassport
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
// A Telegram Passport element containing the user's address
type PassportElementAddress struct {
2022-03-13 04:04:12 +00:00
meta
// Address
Address *Address `json:"address"`
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PassportElementAddress) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub PassportElementAddress
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementAddress) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPassportElement
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementAddress) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePassportElementAddress
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementAddress) PassportElementType() string {
2022-03-13 04:04:12 +00:00
return TypePassportElementAddress
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
// A Telegram Passport element containing the user's utility bill
type PassportElementUtilityBill struct {
2022-03-13 04:04:12 +00:00
meta
// Utility bill
UtilityBill *PersonalDocument `json:"utility_bill"`
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PassportElementUtilityBill) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub PassportElementUtilityBill
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementUtilityBill) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPassportElement
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementUtilityBill) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePassportElementUtilityBill
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementUtilityBill) PassportElementType() string {
2022-03-13 04:04:12 +00:00
return TypePassportElementUtilityBill
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
// A Telegram Passport element containing the user's bank statement
type PassportElementBankStatement struct {
2022-03-13 04:04:12 +00:00
meta
// Bank statement
BankStatement *PersonalDocument `json:"bank_statement"`
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PassportElementBankStatement) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub PassportElementBankStatement
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementBankStatement) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPassportElement
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementBankStatement) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePassportElementBankStatement
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementBankStatement) PassportElementType() string {
2022-03-13 04:04:12 +00:00
return TypePassportElementBankStatement
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
// A Telegram Passport element containing the user's rental agreement
type PassportElementRentalAgreement struct {
2022-03-13 04:04:12 +00:00
meta
// Rental agreement
RentalAgreement *PersonalDocument `json:"rental_agreement"`
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PassportElementRentalAgreement) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub PassportElementRentalAgreement
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementRentalAgreement) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPassportElement
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementRentalAgreement) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePassportElementRentalAgreement
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementRentalAgreement) PassportElementType() string {
2022-03-13 04:04:12 +00:00
return TypePassportElementRentalAgreement
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
// A Telegram Passport element containing the user's passport registration pages
type PassportElementPassportRegistration struct {
2022-03-13 04:04:12 +00:00
meta
// Passport registration pages
PassportRegistration *PersonalDocument `json:"passport_registration"`
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PassportElementPassportRegistration) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub PassportElementPassportRegistration
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementPassportRegistration) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPassportElement
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementPassportRegistration) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePassportElementPassportRegistration
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementPassportRegistration) PassportElementType() string {
2022-03-13 04:04:12 +00:00
return TypePassportElementPassportRegistration
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
// A Telegram Passport element containing the user's temporary registration
type PassportElementTemporaryRegistration struct {
2022-03-13 04:04:12 +00:00
meta
// Temporary registration
TemporaryRegistration *PersonalDocument `json:"temporary_registration"`
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PassportElementTemporaryRegistration) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub PassportElementTemporaryRegistration
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementTemporaryRegistration) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPassportElement
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementTemporaryRegistration) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePassportElementTemporaryRegistration
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementTemporaryRegistration) PassportElementType() string {
2022-03-13 04:04:12 +00:00
return TypePassportElementTemporaryRegistration
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
// A Telegram Passport element containing the user's phone number
type PassportElementPhoneNumber struct {
2022-03-13 04:04:12 +00:00
meta
// Phone number
PhoneNumber string `json:"phone_number"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PassportElementPhoneNumber) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub PassportElementPhoneNumber
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementPhoneNumber) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPassportElement
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementPhoneNumber) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePassportElementPhoneNumber
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementPhoneNumber) PassportElementType() string {
2022-03-13 04:04:12 +00:00
return TypePassportElementPhoneNumber
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A Telegram Passport element containing the user's email address
type PassportElementEmailAddress struct {
2022-03-13 04:04:12 +00:00
meta
// Email address
EmailAddress string `json:"email_address"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PassportElementEmailAddress) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub PassportElementEmailAddress
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementEmailAddress) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPassportElement
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementEmailAddress) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePassportElementEmailAddress
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementEmailAddress) PassportElementType() string {
2022-03-13 04:04:12 +00:00
return TypePassportElementEmailAddress
2021-01-18 14:16:52 +00:00
}
2021-12-30 05:55:02 +00:00
// A Telegram Passport element to be saved containing the user's personal details
type InputPassportElementPersonalDetails struct {
2022-03-13 04:04:12 +00:00
meta
// Personal details of the user
PersonalDetails *PersonalDetails `json:"personal_details"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InputPassportElementPersonalDetails) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub InputPassportElementPersonalDetails
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputPassportElementPersonalDetails) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInputPassportElement
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputPassportElementPersonalDetails) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInputPassportElementPersonalDetails
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputPassportElementPersonalDetails) InputPassportElementType() string {
2022-03-13 04:04:12 +00:00
return TypeInputPassportElementPersonalDetails
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A Telegram Passport element to be saved containing the user's passport
type InputPassportElementPassport struct {
2022-03-13 04:04:12 +00:00
meta
// The passport to be saved
Passport *InputIdentityDocument `json:"passport"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InputPassportElementPassport) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub InputPassportElementPassport
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputPassportElementPassport) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInputPassportElement
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputPassportElementPassport) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInputPassportElementPassport
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputPassportElementPassport) InputPassportElementType() string {
2022-03-13 04:04:12 +00:00
return TypeInputPassportElementPassport
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A Telegram Passport element to be saved containing the user's driver license
type InputPassportElementDriverLicense struct {
2022-03-13 04:04:12 +00:00
meta
// The driver license to be saved
DriverLicense *InputIdentityDocument `json:"driver_license"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InputPassportElementDriverLicense) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub InputPassportElementDriverLicense
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputPassportElementDriverLicense) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInputPassportElement
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputPassportElementDriverLicense) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInputPassportElementDriverLicense
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputPassportElementDriverLicense) InputPassportElementType() string {
2022-03-13 04:04:12 +00:00
return TypeInputPassportElementDriverLicense
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A Telegram Passport element to be saved containing the user's identity card
type InputPassportElementIdentityCard struct {
2022-03-13 04:04:12 +00:00
meta
// The identity card to be saved
IdentityCard *InputIdentityDocument `json:"identity_card"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InputPassportElementIdentityCard) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub InputPassportElementIdentityCard
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputPassportElementIdentityCard) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInputPassportElement
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputPassportElementIdentityCard) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInputPassportElementIdentityCard
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputPassportElementIdentityCard) InputPassportElementType() string {
2022-03-13 04:04:12 +00:00
return TypeInputPassportElementIdentityCard
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A Telegram Passport element to be saved containing the user's internal passport
type InputPassportElementInternalPassport struct {
2022-03-13 04:04:12 +00:00
meta
// The internal passport to be saved
InternalPassport *InputIdentityDocument `json:"internal_passport"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InputPassportElementInternalPassport) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub InputPassportElementInternalPassport
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputPassportElementInternalPassport) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInputPassportElement
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputPassportElementInternalPassport) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInputPassportElementInternalPassport
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputPassportElementInternalPassport) InputPassportElementType() string {
2022-03-13 04:04:12 +00:00
return TypeInputPassportElementInternalPassport
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A Telegram Passport element to be saved containing the user's address
type InputPassportElementAddress struct {
2022-03-13 04:04:12 +00:00
meta
// The address to be saved
Address *Address `json:"address"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InputPassportElementAddress) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub InputPassportElementAddress
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputPassportElementAddress) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInputPassportElement
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputPassportElementAddress) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInputPassportElementAddress
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputPassportElementAddress) InputPassportElementType() string {
2022-03-13 04:04:12 +00:00
return TypeInputPassportElementAddress
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A Telegram Passport element to be saved containing the user's utility bill
type InputPassportElementUtilityBill struct {
2022-03-13 04:04:12 +00:00
meta
// The utility bill to be saved
UtilityBill *InputPersonalDocument `json:"utility_bill"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InputPassportElementUtilityBill) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub InputPassportElementUtilityBill
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputPassportElementUtilityBill) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInputPassportElement
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputPassportElementUtilityBill) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInputPassportElementUtilityBill
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputPassportElementUtilityBill) InputPassportElementType() string {
2022-03-13 04:04:12 +00:00
return TypeInputPassportElementUtilityBill
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A Telegram Passport element to be saved containing the user's bank statement
type InputPassportElementBankStatement struct {
2022-03-13 04:04:12 +00:00
meta
// The bank statement to be saved
BankStatement *InputPersonalDocument `json:"bank_statement"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InputPassportElementBankStatement) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub InputPassportElementBankStatement
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputPassportElementBankStatement) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInputPassportElement
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputPassportElementBankStatement) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInputPassportElementBankStatement
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputPassportElementBankStatement) InputPassportElementType() string {
2022-03-13 04:04:12 +00:00
return TypeInputPassportElementBankStatement
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A Telegram Passport element to be saved containing the user's rental agreement
type InputPassportElementRentalAgreement struct {
2022-03-13 04:04:12 +00:00
meta
// The rental agreement to be saved
RentalAgreement *InputPersonalDocument `json:"rental_agreement"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InputPassportElementRentalAgreement) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub InputPassportElementRentalAgreement
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputPassportElementRentalAgreement) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInputPassportElement
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputPassportElementRentalAgreement) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInputPassportElementRentalAgreement
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputPassportElementRentalAgreement) InputPassportElementType() string {
2022-03-13 04:04:12 +00:00
return TypeInputPassportElementRentalAgreement
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A Telegram Passport element to be saved containing the user's passport registration
type InputPassportElementPassportRegistration struct {
2022-03-13 04:04:12 +00:00
meta
// The passport registration page to be saved
PassportRegistration *InputPersonalDocument `json:"passport_registration"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InputPassportElementPassportRegistration) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub InputPassportElementPassportRegistration
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputPassportElementPassportRegistration) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInputPassportElement
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputPassportElementPassportRegistration) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInputPassportElementPassportRegistration
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputPassportElementPassportRegistration) InputPassportElementType() string {
2022-03-13 04:04:12 +00:00
return TypeInputPassportElementPassportRegistration
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A Telegram Passport element to be saved containing the user's temporary registration
type InputPassportElementTemporaryRegistration struct {
2022-03-13 04:04:12 +00:00
meta
// The temporary registration document to be saved
TemporaryRegistration *InputPersonalDocument `json:"temporary_registration"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InputPassportElementTemporaryRegistration) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub InputPassportElementTemporaryRegistration
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputPassportElementTemporaryRegistration) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInputPassportElement
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputPassportElementTemporaryRegistration) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInputPassportElementTemporaryRegistration
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputPassportElementTemporaryRegistration) InputPassportElementType() string {
2022-03-13 04:04:12 +00:00
return TypeInputPassportElementTemporaryRegistration
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A Telegram Passport element to be saved containing the user's phone number
type InputPassportElementPhoneNumber struct {
2022-03-13 04:04:12 +00:00
meta
// The phone number to be saved
PhoneNumber string `json:"phone_number"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InputPassportElementPhoneNumber) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub InputPassportElementPhoneNumber
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputPassportElementPhoneNumber) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInputPassportElement
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputPassportElementPhoneNumber) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInputPassportElementPhoneNumber
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputPassportElementPhoneNumber) InputPassportElementType() string {
2022-03-13 04:04:12 +00:00
return TypeInputPassportElementPhoneNumber
2021-12-30 05:55:02 +00:00
}
// A Telegram Passport element to be saved containing the user's email address
type InputPassportElementEmailAddress struct {
2022-03-13 04:04:12 +00:00
meta
// The email address to be saved
EmailAddress string `json:"email_address"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InputPassportElementEmailAddress) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub InputPassportElementEmailAddress
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputPassportElementEmailAddress) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInputPassportElement
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputPassportElementEmailAddress) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInputPassportElementEmailAddress
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputPassportElementEmailAddress) InputPassportElementType() string {
2022-03-13 04:04:12 +00:00
return TypeInputPassportElementEmailAddress
2021-12-30 05:55:02 +00:00
}
// Contains information about saved Telegram Passport elements
type PassportElements struct {
2022-03-13 04:04:12 +00:00
meta
// Telegram Passport elements
Elements []PassportElement `json:"elements"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PassportElements) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub PassportElements
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElements) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPassportElements
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElements) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePassportElements
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (passportElements *PassportElements) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Elements []json.RawMessage `json:"elements"`
}
2021-01-18 14:16:52 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-01-18 14:16:52 +00:00
2022-03-13 04:04:12 +00:00
fieldElements, _ := UnmarshalListOfPassportElement(tmp.Elements)
passportElements.Elements = fieldElements
2021-01-18 14:16:52 +00:00
2022-03-13 04:04:12 +00:00
return nil
2021-01-18 14:16:52 +00:00
}
2021-12-30 05:55:02 +00:00
// The element contains an error in an unspecified place. The error will be considered resolved when new data is added
2022-03-13 04:04:12 +00:00
type PassportElementErrorSourceUnspecified struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PassportElementErrorSourceUnspecified) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub PassportElementErrorSourceUnspecified
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementErrorSourceUnspecified) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPassportElementErrorSource
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementErrorSourceUnspecified) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePassportElementErrorSourceUnspecified
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementErrorSourceUnspecified) PassportElementErrorSourceType() string {
2022-03-13 04:04:12 +00:00
return TypePassportElementErrorSourceUnspecified
2021-12-30 05:55:02 +00:00
}
// One of the data fields contains an error. The error will be considered resolved when the value of the field changes
type PassportElementErrorSourceDataField struct {
2022-03-13 04:04:12 +00:00
meta
// Field name
FieldName string `json:"field_name"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PassportElementErrorSourceDataField) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub PassportElementErrorSourceDataField
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementErrorSourceDataField) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPassportElementErrorSource
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementErrorSourceDataField) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePassportElementErrorSourceDataField
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementErrorSourceDataField) PassportElementErrorSourceType() string {
2022-03-13 04:04:12 +00:00
return TypePassportElementErrorSourceDataField
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// The front side of the document contains an error. The error will be considered resolved when the file with the front side changes
2022-03-13 04:04:12 +00:00
type PassportElementErrorSourceFrontSide struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PassportElementErrorSourceFrontSide) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub PassportElementErrorSourceFrontSide
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementErrorSourceFrontSide) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPassportElementErrorSource
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementErrorSourceFrontSide) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePassportElementErrorSourceFrontSide
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementErrorSourceFrontSide) PassportElementErrorSourceType() string {
2022-03-13 04:04:12 +00:00
return TypePassportElementErrorSourceFrontSide
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// The reverse side of the document contains an error. The error will be considered resolved when the file with the reverse side changes
2022-03-13 04:04:12 +00:00
type PassportElementErrorSourceReverseSide struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PassportElementErrorSourceReverseSide) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub PassportElementErrorSourceReverseSide
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementErrorSourceReverseSide) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPassportElementErrorSource
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementErrorSourceReverseSide) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePassportElementErrorSourceReverseSide
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementErrorSourceReverseSide) PassportElementErrorSourceType() string {
2022-03-13 04:04:12 +00:00
return TypePassportElementErrorSourceReverseSide
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// The selfie with the document contains an error. The error will be considered resolved when the file with the selfie changes
2022-03-13 04:04:12 +00:00
type PassportElementErrorSourceSelfie struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PassportElementErrorSourceSelfie) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub PassportElementErrorSourceSelfie
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementErrorSourceSelfie) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPassportElementErrorSource
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementErrorSourceSelfie) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePassportElementErrorSourceSelfie
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementErrorSourceSelfie) PassportElementErrorSourceType() string {
2022-03-13 04:04:12 +00:00
return TypePassportElementErrorSourceSelfie
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// One of files with the translation of the document contains an error. The error will be considered resolved when the file changes
type PassportElementErrorSourceTranslationFile struct {
2022-03-13 04:04:12 +00:00
meta
// Index of a file with the error
FileIndex int32 `json:"file_index"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PassportElementErrorSourceTranslationFile) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub PassportElementErrorSourceTranslationFile
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementErrorSourceTranslationFile) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPassportElementErrorSource
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementErrorSourceTranslationFile) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePassportElementErrorSourceTranslationFile
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementErrorSourceTranslationFile) PassportElementErrorSourceType() string {
2022-03-13 04:04:12 +00:00
return TypePassportElementErrorSourceTranslationFile
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// The translation of the document contains an error. The error will be considered resolved when the list of translation files changes
2022-03-13 04:04:12 +00:00
type PassportElementErrorSourceTranslationFiles struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PassportElementErrorSourceTranslationFiles) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub PassportElementErrorSourceTranslationFiles
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementErrorSourceTranslationFiles) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPassportElementErrorSource
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementErrorSourceTranslationFiles) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePassportElementErrorSourceTranslationFiles
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementErrorSourceTranslationFiles) PassportElementErrorSourceType() string {
2022-03-13 04:04:12 +00:00
return TypePassportElementErrorSourceTranslationFiles
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// The file contains an error. The error will be considered resolved when the file changes
type PassportElementErrorSourceFile struct {
2022-03-13 04:04:12 +00:00
meta
// Index of a file with the error
FileIndex int32 `json:"file_index"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PassportElementErrorSourceFile) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub PassportElementErrorSourceFile
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementErrorSourceFile) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPassportElementErrorSource
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementErrorSourceFile) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePassportElementErrorSourceFile
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementErrorSourceFile) PassportElementErrorSourceType() string {
2022-03-13 04:04:12 +00:00
return TypePassportElementErrorSourceFile
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// The list of attached files contains an error. The error will be considered resolved when the list of files changes
2022-03-13 04:04:12 +00:00
type PassportElementErrorSourceFiles struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PassportElementErrorSourceFiles) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub PassportElementErrorSourceFiles
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementErrorSourceFiles) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPassportElementErrorSource
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementErrorSourceFiles) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePassportElementErrorSourceFiles
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementErrorSourceFiles) PassportElementErrorSourceType() string {
2022-03-13 04:04:12 +00:00
return TypePassportElementErrorSourceFiles
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// Contains the description of an error in a Telegram Passport element
type PassportElementError struct {
2022-03-13 04:04:12 +00:00
meta
// Type of the Telegram Passport element which has the error
Type PassportElementType `json:"type"`
// Error message
Message string `json:"message"`
// Error source
Source PassportElementErrorSource `json:"source"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PassportElementError) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub PassportElementError
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementError) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPassportElementError
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementError) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePassportElementError
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (passportElementError *PassportElementError) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Type json.RawMessage `json:"type"`
Message string `json:"message"`
Source json.RawMessage `json:"source"`
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
passportElementError.Message = tmp.Message
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
fieldType, _ := UnmarshalPassportElementType(tmp.Type)
passportElementError.Type = fieldType
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
fieldSource, _ := UnmarshalPassportElementErrorSource(tmp.Source)
passportElementError.Source = fieldSource
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return nil
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// Contains information about a Telegram Passport element that was requested by a service
type PassportSuitableElement struct {
2022-03-13 04:04:12 +00:00
meta
// Type of the element
Type PassportElementType `json:"type"`
// True, if a selfie is required with the identity document
IsSelfieRequired bool `json:"is_selfie_required"`
// True, if a certified English translation is required with the document
IsTranslationRequired bool `json:"is_translation_required"`
// True, if personal details must include the user's name in the language of their country of residence
IsNativeNameRequired bool `json:"is_native_name_required"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PassportSuitableElement) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub PassportSuitableElement
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportSuitableElement) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPassportSuitableElement
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportSuitableElement) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePassportSuitableElement
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (passportSuitableElement *PassportSuitableElement) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Type json.RawMessage `json:"type"`
IsSelfieRequired bool `json:"is_selfie_required"`
IsTranslationRequired bool `json:"is_translation_required"`
IsNativeNameRequired bool `json:"is_native_name_required"`
}
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
passportSuitableElement.IsSelfieRequired = tmp.IsSelfieRequired
passportSuitableElement.IsTranslationRequired = tmp.IsTranslationRequired
passportSuitableElement.IsNativeNameRequired = tmp.IsNativeNameRequired
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
fieldType, _ := UnmarshalPassportElementType(tmp.Type)
passportSuitableElement.Type = fieldType
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return nil
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// Contains a description of the required Telegram Passport element that was requested by a service
type PassportRequiredElement struct {
2022-03-13 04:04:12 +00:00
meta
// List of Telegram Passport elements any of which is enough to provide
SuitableElements []*PassportSuitableElement `json:"suitable_elements"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PassportRequiredElement) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub PassportRequiredElement
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportRequiredElement) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPassportRequiredElement
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportRequiredElement) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePassportRequiredElement
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// Contains information about a Telegram Passport authorization form that was requested
type PassportAuthorizationForm struct {
2022-03-13 04:04:12 +00:00
meta
// Unique identifier of the authorization form
Id int32 `json:"id"`
// Telegram Passport elements that must be provided to complete the form
RequiredElements []*PassportRequiredElement `json:"required_elements"`
// URL for the privacy policy of the service; may be empty
PrivacyPolicyUrl string `json:"privacy_policy_url"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PassportAuthorizationForm) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub PassportAuthorizationForm
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportAuthorizationForm) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPassportAuthorizationForm
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportAuthorizationForm) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePassportAuthorizationForm
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// Contains information about a Telegram Passport elements and corresponding errors
type PassportElementsWithErrors struct {
2022-03-13 04:04:12 +00:00
meta
// Telegram Passport elements
Elements []PassportElement `json:"elements"`
// Errors in the elements that are already available
Errors []*PassportElementError `json:"errors"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PassportElementsWithErrors) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub PassportElementsWithErrors
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementsWithErrors) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPassportElementsWithErrors
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PassportElementsWithErrors) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePassportElementsWithErrors
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (passportElementsWithErrors *PassportElementsWithErrors) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Elements []json.RawMessage `json:"elements"`
Errors []*PassportElementError `json:"errors"`
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
passportElementsWithErrors.Errors = tmp.Errors
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
fieldElements, _ := UnmarshalListOfPassportElement(tmp.Elements)
passportElementsWithErrors.Elements = fieldElements
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return nil
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// Contains encrypted Telegram Passport data credentials
type EncryptedCredentials struct {
2022-03-13 04:04:12 +00:00
meta
// The encrypted credentials
Data []byte `json:"data"`
// The decrypted data hash
Hash []byte `json:"hash"`
// Secret for data decryption, encrypted with the service's public key
Secret []byte `json:"secret"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *EncryptedCredentials) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub EncryptedCredentials
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*EncryptedCredentials) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassEncryptedCredentials
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*EncryptedCredentials) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeEncryptedCredentials
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// Contains information about an encrypted Telegram Passport element; for bots only
type EncryptedPassportElement struct {
2022-03-13 04:04:12 +00:00
meta
// Type of Telegram Passport element
Type PassportElementType `json:"type"`
// Encrypted JSON-encoded data about the user
Data []byte `json:"data"`
// The front side of an identity document
FrontSide *DatedFile `json:"front_side"`
// The reverse side of an identity document; may be null
ReverseSide *DatedFile `json:"reverse_side"`
// Selfie with the document; may be null
Selfie *DatedFile `json:"selfie"`
// List of files containing a certified English translation of the document
Translation []*DatedFile `json:"translation"`
// List of attached files
Files []*DatedFile `json:"files"`
// Unencrypted data, phone number or email address
Value string `json:"value"`
// Hash of the entire element
Hash string `json:"hash"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *EncryptedPassportElement) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub EncryptedPassportElement
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*EncryptedPassportElement) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassEncryptedPassportElement
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*EncryptedPassportElement) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeEncryptedPassportElement
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (encryptedPassportElement *EncryptedPassportElement) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Type json.RawMessage `json:"type"`
Data []byte `json:"data"`
FrontSide *DatedFile `json:"front_side"`
ReverseSide *DatedFile `json:"reverse_side"`
Selfie *DatedFile `json:"selfie"`
Translation []*DatedFile `json:"translation"`
Files []*DatedFile `json:"files"`
Value string `json:"value"`
Hash string `json:"hash"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
encryptedPassportElement.Data = tmp.Data
encryptedPassportElement.FrontSide = tmp.FrontSide
encryptedPassportElement.ReverseSide = tmp.ReverseSide
encryptedPassportElement.Selfie = tmp.Selfie
encryptedPassportElement.Translation = tmp.Translation
encryptedPassportElement.Files = tmp.Files
encryptedPassportElement.Value = tmp.Value
encryptedPassportElement.Hash = tmp.Hash
fieldType, _ := UnmarshalPassportElementType(tmp.Type)
encryptedPassportElement.Type = fieldType
return nil
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// The element contains an error in an unspecified place. The error will be considered resolved when new data is added
type InputPassportElementErrorSourceUnspecified struct {
2022-03-13 04:04:12 +00:00
meta
// Current hash of the entire element
ElementHash []byte `json:"element_hash"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InputPassportElementErrorSourceUnspecified) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub InputPassportElementErrorSourceUnspecified
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputPassportElementErrorSourceUnspecified) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInputPassportElementErrorSource
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputPassportElementErrorSourceUnspecified) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInputPassportElementErrorSourceUnspecified
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputPassportElementErrorSourceUnspecified) InputPassportElementErrorSourceType() string {
2022-03-13 04:04:12 +00:00
return TypeInputPassportElementErrorSourceUnspecified
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A data field contains an error. The error is considered resolved when the field's value changes
type InputPassportElementErrorSourceDataField struct {
2022-03-13 04:04:12 +00:00
meta
// Field name
FieldName string `json:"field_name"`
// Current data hash
DataHash []byte `json:"data_hash"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InputPassportElementErrorSourceDataField) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub InputPassportElementErrorSourceDataField
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputPassportElementErrorSourceDataField) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInputPassportElementErrorSource
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputPassportElementErrorSourceDataField) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInputPassportElementErrorSourceDataField
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputPassportElementErrorSourceDataField) InputPassportElementErrorSourceType() string {
2022-03-13 04:04:12 +00:00
return TypeInputPassportElementErrorSourceDataField
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// The front side of the document contains an error. The error is considered resolved when the file with the front side of the document changes
type InputPassportElementErrorSourceFrontSide struct {
2022-03-13 04:04:12 +00:00
meta
// Current hash of the file containing the front side
FileHash []byte `json:"file_hash"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InputPassportElementErrorSourceFrontSide) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub InputPassportElementErrorSourceFrontSide
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputPassportElementErrorSourceFrontSide) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInputPassportElementErrorSource
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputPassportElementErrorSourceFrontSide) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInputPassportElementErrorSourceFrontSide
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputPassportElementErrorSourceFrontSide) InputPassportElementErrorSourceType() string {
2022-03-13 04:04:12 +00:00
return TypeInputPassportElementErrorSourceFrontSide
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// The reverse side of the document contains an error. The error is considered resolved when the file with the reverse side of the document changes
type InputPassportElementErrorSourceReverseSide struct {
2022-03-13 04:04:12 +00:00
meta
// Current hash of the file containing the reverse side
FileHash []byte `json:"file_hash"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InputPassportElementErrorSourceReverseSide) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub InputPassportElementErrorSourceReverseSide
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputPassportElementErrorSourceReverseSide) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInputPassportElementErrorSource
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputPassportElementErrorSourceReverseSide) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInputPassportElementErrorSourceReverseSide
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputPassportElementErrorSourceReverseSide) InputPassportElementErrorSourceType() string {
2022-03-13 04:04:12 +00:00
return TypeInputPassportElementErrorSourceReverseSide
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// The selfie contains an error. The error is considered resolved when the file with the selfie changes
type InputPassportElementErrorSourceSelfie struct {
2022-03-13 04:04:12 +00:00
meta
// Current hash of the file containing the selfie
FileHash []byte `json:"file_hash"`
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InputPassportElementErrorSourceSelfie) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub InputPassportElementErrorSourceSelfie
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputPassportElementErrorSourceSelfie) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInputPassportElementErrorSource
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputPassportElementErrorSourceSelfie) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInputPassportElementErrorSourceSelfie
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputPassportElementErrorSourceSelfie) InputPassportElementErrorSourceType() string {
2022-03-13 04:04:12 +00:00
return TypeInputPassportElementErrorSourceSelfie
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
// One of the files containing the translation of the document contains an error. The error is considered resolved when the file with the translation changes
type InputPassportElementErrorSourceTranslationFile struct {
2022-03-13 04:04:12 +00:00
meta
// Current hash of the file containing the translation
FileHash []byte `json:"file_hash"`
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InputPassportElementErrorSourceTranslationFile) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub InputPassportElementErrorSourceTranslationFile
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputPassportElementErrorSourceTranslationFile) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInputPassportElementErrorSource
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputPassportElementErrorSourceTranslationFile) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInputPassportElementErrorSourceTranslationFile
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputPassportElementErrorSourceTranslationFile) InputPassportElementErrorSourceType() string {
2022-03-13 04:04:12 +00:00
return TypeInputPassportElementErrorSourceTranslationFile
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
// The translation of the document contains an error. The error is considered resolved when the list of files changes
type InputPassportElementErrorSourceTranslationFiles struct {
2022-03-13 04:04:12 +00:00
meta
// Current hashes of all files with the translation
FileHashes [][]byte `json:"file_hashes"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InputPassportElementErrorSourceTranslationFiles) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub InputPassportElementErrorSourceTranslationFiles
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputPassportElementErrorSourceTranslationFiles) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInputPassportElementErrorSource
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputPassportElementErrorSourceTranslationFiles) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInputPassportElementErrorSourceTranslationFiles
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputPassportElementErrorSourceTranslationFiles) InputPassportElementErrorSourceType() string {
2022-03-13 04:04:12 +00:00
return TypeInputPassportElementErrorSourceTranslationFiles
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// The file contains an error. The error is considered resolved when the file changes
type InputPassportElementErrorSourceFile struct {
2022-03-13 04:04:12 +00:00
meta
// Current hash of the file which has the error
FileHash []byte `json:"file_hash"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InputPassportElementErrorSourceFile) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub InputPassportElementErrorSourceFile
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputPassportElementErrorSourceFile) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInputPassportElementErrorSource
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputPassportElementErrorSourceFile) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInputPassportElementErrorSourceFile
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputPassportElementErrorSourceFile) InputPassportElementErrorSourceType() string {
2022-03-13 04:04:12 +00:00
return TypeInputPassportElementErrorSourceFile
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// The list of attached files contains an error. The error is considered resolved when the file list changes
type InputPassportElementErrorSourceFiles struct {
2022-03-13 04:04:12 +00:00
meta
// Current hashes of all attached files
FileHashes [][]byte `json:"file_hashes"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InputPassportElementErrorSourceFiles) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub InputPassportElementErrorSourceFiles
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputPassportElementErrorSourceFiles) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInputPassportElementErrorSource
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputPassportElementErrorSourceFiles) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInputPassportElementErrorSourceFiles
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputPassportElementErrorSourceFiles) InputPassportElementErrorSourceType() string {
2022-03-13 04:04:12 +00:00
return TypeInputPassportElementErrorSourceFiles
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// Contains the description of an error in a Telegram Passport element; for bots only
type InputPassportElementError struct {
2022-03-13 04:04:12 +00:00
meta
// Type of Telegram Passport element that has the error
Type PassportElementType `json:"type"`
// Error message
Message string `json:"message"`
// Error source
Source InputPassportElementErrorSource `json:"source"`
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InputPassportElementError) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
type stub InputPassportElementError
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputPassportElementError) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInputPassportElementError
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputPassportElementError) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInputPassportElementError
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (inputPassportElementError *InputPassportElementError) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Type json.RawMessage `json:"type"`
Message string `json:"message"`
Source json.RawMessage `json:"source"`
}
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
inputPassportElementError.Message = tmp.Message
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
fieldType, _ := UnmarshalPassportElementType(tmp.Type)
inputPassportElementError.Type = fieldType
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
fieldSource, _ := UnmarshalInputPassportElementErrorSource(tmp.Source)
inputPassportElementError.Source = fieldSource
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return nil
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
// A text message
type MessageText struct {
2022-03-13 04:04:12 +00:00
meta
// Text of the message
Text *FormattedText `json:"text"`
// A preview of the web page that's mentioned in the text; may be null
WebPage *WebPage `json:"web_page"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *MessageText) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub MessageText
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageText) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageContent
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageText) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageText
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageText) MessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageText
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// An animation message (GIF-style).
type MessageAnimation struct {
2022-03-13 04:04:12 +00:00
meta
// The animation description
Animation *Animation `json:"animation"`
// Animation caption
Caption *FormattedText `json:"caption"`
// True, if the animation thumbnail must be blurred and the animation must be shown only while tapped
IsSecret bool `json:"is_secret"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *MessageAnimation) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub MessageAnimation
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageAnimation) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageContent
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageAnimation) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageAnimation
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageAnimation) MessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageAnimation
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// An audio message
type MessageAudio struct {
2022-03-13 04:04:12 +00:00
meta
// The audio description
Audio *Audio `json:"audio"`
// Audio caption
Caption *FormattedText `json:"caption"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *MessageAudio) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub MessageAudio
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageAudio) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageContent
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageAudio) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageAudio
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageAudio) MessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageAudio
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A document message (general file)
type MessageDocument struct {
2022-03-13 04:04:12 +00:00
meta
// The document description
Document *Document `json:"document"`
// Document caption
Caption *FormattedText `json:"caption"`
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *MessageDocument) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub MessageDocument
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageDocument) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageContent
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageDocument) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageDocument
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageDocument) MessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageDocument
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// A photo message
type MessagePhoto struct {
2022-03-13 04:04:12 +00:00
meta
// The photo description
Photo *Photo `json:"photo"`
// Photo caption
Caption *FormattedText `json:"caption"`
// True, if the photo must be blurred and must be shown only while tapped
IsSecret bool `json:"is_secret"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *MessagePhoto) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub MessagePhoto
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessagePhoto) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageContent
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessagePhoto) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessagePhoto
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessagePhoto) MessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypeMessagePhoto
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// An expired photo message (self-destructed after TTL has elapsed)
2022-03-13 04:04:12 +00:00
type MessageExpiredPhoto struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *MessageExpiredPhoto) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub MessageExpiredPhoto
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageExpiredPhoto) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageContent
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageExpiredPhoto) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageExpiredPhoto
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageExpiredPhoto) MessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageExpiredPhoto
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A sticker message
type MessageSticker struct {
2022-03-13 04:04:12 +00:00
meta
// The sticker description
Sticker *Sticker `json:"sticker"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *MessageSticker) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub MessageSticker
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageSticker) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageContent
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageSticker) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageSticker
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageSticker) MessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageSticker
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A video message
type MessageVideo struct {
2022-03-13 04:04:12 +00:00
meta
// The video description
Video *Video `json:"video"`
// Video caption
Caption *FormattedText `json:"caption"`
// True, if the video thumbnail must be blurred and the video must be shown only while tapped
IsSecret bool `json:"is_secret"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *MessageVideo) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub MessageVideo
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageVideo) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageContent
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageVideo) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageVideo
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageVideo) MessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageVideo
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// An expired video message (self-destructed after TTL has elapsed)
2022-03-13 04:04:12 +00:00
type MessageExpiredVideo struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *MessageExpiredVideo) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub MessageExpiredVideo
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageExpiredVideo) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageContent
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageExpiredVideo) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageExpiredVideo
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageExpiredVideo) MessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageExpiredVideo
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A video note message
type MessageVideoNote struct {
2022-03-13 04:04:12 +00:00
meta
// The video note description
VideoNote *VideoNote `json:"video_note"`
// True, if at least one of the recipients has viewed the video note
IsViewed bool `json:"is_viewed"`
// True, if the video note thumbnail must be blurred and the video note must be shown only while tapped
IsSecret bool `json:"is_secret"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *MessageVideoNote) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub MessageVideoNote
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageVideoNote) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageContent
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageVideoNote) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageVideoNote
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageVideoNote) MessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageVideoNote
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A voice note message
type MessageVoiceNote struct {
2022-03-13 04:04:12 +00:00
meta
// The voice note description
VoiceNote *VoiceNote `json:"voice_note"`
// Voice note caption
Caption *FormattedText `json:"caption"`
// True, if at least one of the recipients has listened to the voice note
IsListened bool `json:"is_listened"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *MessageVoiceNote) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub MessageVoiceNote
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageVoiceNote) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageContent
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageVoiceNote) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageVoiceNote
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageVoiceNote) MessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageVoiceNote
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A message with a location
type MessageLocation struct {
2022-03-13 04:04:12 +00:00
meta
// The location description
Location *Location `json:"location"`
// Time relative to the message send date, for which the location can be updated, in seconds
LivePeriod int32 `json:"live_period"`
// Left time for which the location can be updated, in seconds. updateMessageContent is not sent when this field changes
ExpiresIn int32 `json:"expires_in"`
// For live locations, a direction in which the location moves, in degrees; 1-360. If 0 the direction is unknown
Heading int32 `json:"heading"`
// For live locations, a maximum distance to another chat member for proximity alerts, in meters (0-100000). 0 if the notification is disabled. Available only for the message sender
ProximityAlertRadius int32 `json:"proximity_alert_radius"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *MessageLocation) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub MessageLocation
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageLocation) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageContent
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageLocation) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageLocation
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageLocation) MessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageLocation
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A message with information about a venue
type MessageVenue struct {
2022-03-13 04:04:12 +00:00
meta
// The venue description
Venue *Venue `json:"venue"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *MessageVenue) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub MessageVenue
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageVenue) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageContent
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageVenue) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageVenue
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageVenue) MessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageVenue
2019-06-07 10:56:06 +00:00
}
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
// A message with a user contact
type MessageContact struct {
2022-03-13 04:04:12 +00:00
meta
// The contact description
Contact *Contact `json:"contact"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *MessageContact) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub MessageContact
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageContact) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageContent
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageContact) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageContact
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageContact) MessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageContact
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A message with an animated emoji
type MessageAnimatedEmoji struct {
2022-03-13 04:04:12 +00:00
meta
// The animated emoji
AnimatedEmoji *AnimatedEmoji `json:"animated_emoji"`
// The corresponding emoji
Emoji string `json:"emoji"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *MessageAnimatedEmoji) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub MessageAnimatedEmoji
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageAnimatedEmoji) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageContent
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageAnimatedEmoji) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageAnimatedEmoji
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageAnimatedEmoji) MessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageAnimatedEmoji
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A dice message. The dice value is randomly generated by the server
type MessageDice struct {
2022-03-13 04:04:12 +00:00
meta
// The animated stickers with the initial dice animation; may be null if unknown. updateMessageContent will be sent when the sticker became known
InitialState DiceStickers `json:"initial_state"`
// The animated stickers with the final dice animation; may be null if unknown. updateMessageContent will be sent when the sticker became known
FinalState DiceStickers `json:"final_state"`
// Emoji on which the dice throw animation is based
Emoji string `json:"emoji"`
// The dice value. If the value is 0, the dice don't have final state yet
Value int32 `json:"value"`
// Number of frame after which a success animation like a shower of confetti needs to be shown on updateMessageSendSucceeded
SuccessAnimationFrameNumber int32 `json:"success_animation_frame_number"`
2019-06-07 10:56:06 +00:00
}
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
func (entity *MessageDice) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub MessageDice
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
func (*MessageDice) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageContent
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageDice) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageDice
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageDice) MessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageDice
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (messageDice *MessageDice) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
InitialState json.RawMessage `json:"initial_state"`
FinalState json.RawMessage `json:"final_state"`
Emoji string `json:"emoji"`
Value int32 `json:"value"`
SuccessAnimationFrameNumber int32 `json:"success_animation_frame_number"`
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
messageDice.Emoji = tmp.Emoji
messageDice.Value = tmp.Value
messageDice.SuccessAnimationFrameNumber = tmp.SuccessAnimationFrameNumber
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
fieldInitialState, _ := UnmarshalDiceStickers(tmp.InitialState)
messageDice.InitialState = fieldInitialState
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
fieldFinalState, _ := UnmarshalDiceStickers(tmp.FinalState)
messageDice.FinalState = fieldFinalState
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return nil
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A message with a game
type MessageGame struct {
2022-03-13 04:04:12 +00:00
meta
// The game description
Game *Game `json:"game"`
2019-06-07 10:56:06 +00:00
}
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
func (entity *MessageGame) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub MessageGame
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
func (*MessageGame) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageContent
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageGame) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageGame
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageGame) MessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageGame
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// A message with a poll
type MessagePoll struct {
2022-03-13 04:04:12 +00:00
meta
// The poll description
Poll *Poll `json:"poll"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *MessagePoll) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub MessagePoll
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessagePoll) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageContent
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessagePoll) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessagePoll
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessagePoll) MessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypeMessagePoll
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A message with an invoice from a bot
type MessageInvoice struct {
2022-03-13 04:04:12 +00:00
meta
// Product title
Title string `json:"title"`
// Product description
Description string `json:"description"`
// Product photo; may be null
Photo *Photo `json:"photo"`
// Currency for the product price
Currency string `json:"currency"`
// Product total price in the smallest units of the currency
TotalAmount int64 `json:"total_amount"`
// Unique invoice bot start_parameter. To share an invoice use the URL https://t.me/{bot_username}?start={start_parameter}
StartParameter string `json:"start_parameter"`
// True, if the invoice is a test invoice
IsTest bool `json:"is_test"`
// True, if the shipping address must be specified
NeedShippingAddress bool `json:"need_shipping_address"`
// The identifier of the message with the receipt, after the product has been purchased
ReceiptMessageId int64 `json:"receipt_message_id"`
2019-06-07 10:56:06 +00:00
}
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
func (entity *MessageInvoice) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub MessageInvoice
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
func (*MessageInvoice) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageContent
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageInvoice) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageInvoice
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageInvoice) MessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageInvoice
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// A message with information about an ended call
type MessageCall struct {
2022-03-13 04:04:12 +00:00
meta
// True, if the call was a video call
IsVideo bool `json:"is_video"`
// Reason why the call was discarded
DiscardReason CallDiscardReason `json:"discard_reason"`
// Call duration, in seconds
Duration int32 `json:"duration"`
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *MessageCall) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub MessageCall
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageCall) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageContent
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageCall) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageCall
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageCall) MessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageCall
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (messageCall *MessageCall) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
IsVideo bool `json:"is_video"`
DiscardReason json.RawMessage `json:"discard_reason"`
Duration int32 `json:"duration"`
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
messageCall.IsVideo = tmp.IsVideo
messageCall.Duration = tmp.Duration
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
fieldDiscardReason, _ := UnmarshalCallDiscardReason(tmp.DiscardReason)
messageCall.DiscardReason = fieldDiscardReason
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return nil
2021-12-30 05:55:02 +00:00
}
// A new video chat was scheduled
type MessageVideoChatScheduled struct {
2022-03-13 04:04:12 +00:00
meta
// Identifier of the video chat. The video chat can be received through the method getGroupCall
GroupCallId int32 `json:"group_call_id"`
// Point in time (Unix timestamp) when the group call is supposed to be started by an administrator
StartDate int32 `json:"start_date"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *MessageVideoChatScheduled) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub MessageVideoChatScheduled
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageVideoChatScheduled) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageContent
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageVideoChatScheduled) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageVideoChatScheduled
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageVideoChatScheduled) MessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageVideoChatScheduled
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A newly created video chat
type MessageVideoChatStarted struct {
2022-03-13 04:04:12 +00:00
meta
// Identifier of the video chat. The video chat can be received through the method getGroupCall
GroupCallId int32 `json:"group_call_id"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *MessageVideoChatStarted) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub MessageVideoChatStarted
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageVideoChatStarted) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageContent
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageVideoChatStarted) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageVideoChatStarted
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageVideoChatStarted) MessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageVideoChatStarted
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A message with information about an ended video chat
type MessageVideoChatEnded struct {
2022-03-13 04:04:12 +00:00
meta
// Call duration, in seconds
Duration int32 `json:"duration"`
2019-06-07 10:56:06 +00:00
}
2018-10-23 12:38:10 +00:00
2021-12-30 05:55:02 +00:00
func (entity *MessageVideoChatEnded) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-10-23 12:38:10 +00:00
2022-03-13 04:04:12 +00:00
type stub MessageVideoChatEnded
2018-10-23 12:38:10 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2018-10-23 12:38:10 +00:00
2021-12-30 05:55:02 +00:00
func (*MessageVideoChatEnded) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageContent
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageVideoChatEnded) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageVideoChatEnded
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageVideoChatEnded) MessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageVideoChatEnded
2021-01-18 14:16:52 +00:00
}
2021-12-30 05:55:02 +00:00
// A message with information about an invite to a video chat
type MessageInviteVideoChatParticipants struct {
2022-03-13 04:04:12 +00:00
meta
// Identifier of the video chat. The video chat can be received through the method getGroupCall
GroupCallId int32 `json:"group_call_id"`
// Invited user identifiers
UserIds []int64 `json:"user_ids"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *MessageInviteVideoChatParticipants) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub MessageInviteVideoChatParticipants
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageInviteVideoChatParticipants) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageContent
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageInviteVideoChatParticipants) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageInviteVideoChatParticipants
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageInviteVideoChatParticipants) MessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageInviteVideoChatParticipants
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A newly created basic group
type MessageBasicGroupChatCreate struct {
2022-03-13 04:04:12 +00:00
meta
// Title of the basic group
Title string `json:"title"`
// User identifiers of members in the basic group
MemberUserIds []int64 `json:"member_user_ids"`
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *MessageBasicGroupChatCreate) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
type stub MessageBasicGroupChatCreate
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageBasicGroupChatCreate) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageContent
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageBasicGroupChatCreate) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageBasicGroupChatCreate
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageBasicGroupChatCreate) MessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageBasicGroupChatCreate
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
// A newly created supergroup or channel
type MessageSupergroupChatCreate struct {
2022-03-13 04:04:12 +00:00
meta
// Title of the supergroup or channel
Title string `json:"title"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *MessageSupergroupChatCreate) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub MessageSupergroupChatCreate
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageSupergroupChatCreate) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageContent
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageSupergroupChatCreate) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageSupergroupChatCreate
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageSupergroupChatCreate) MessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageSupergroupChatCreate
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// An updated chat title
type MessageChatChangeTitle struct {
2022-03-13 04:04:12 +00:00
meta
// New chat title
Title string `json:"title"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *MessageChatChangeTitle) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub MessageChatChangeTitle
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageChatChangeTitle) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageContent
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageChatChangeTitle) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageChatChangeTitle
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageChatChangeTitle) MessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageChatChangeTitle
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// An updated chat photo
type MessageChatChangePhoto struct {
2022-03-13 04:04:12 +00:00
meta
// New chat photo
Photo *ChatPhoto `json:"photo"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *MessageChatChangePhoto) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub MessageChatChangePhoto
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageChatChangePhoto) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageContent
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageChatChangePhoto) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageChatChangePhoto
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageChatChangePhoto) MessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageChatChangePhoto
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A deleted chat photo
2022-03-13 04:04:12 +00:00
type MessageChatDeletePhoto struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *MessageChatDeletePhoto) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub MessageChatDeletePhoto
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageChatDeletePhoto) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageContent
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageChatDeletePhoto) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageChatDeletePhoto
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageChatDeletePhoto) MessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageChatDeletePhoto
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// New chat members were added
type MessageChatAddMembers struct {
2022-03-13 04:04:12 +00:00
meta
// User identifiers of the new members
MemberUserIds []int64 `json:"member_user_ids"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *MessageChatAddMembers) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub MessageChatAddMembers
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageChatAddMembers) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageContent
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageChatAddMembers) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageChatAddMembers
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageChatAddMembers) MessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageChatAddMembers
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A new member joined the chat via an invite link
2022-03-13 04:04:12 +00:00
type MessageChatJoinByLink struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *MessageChatJoinByLink) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub MessageChatJoinByLink
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageChatJoinByLink) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageContent
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageChatJoinByLink) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageChatJoinByLink
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageChatJoinByLink) MessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageChatJoinByLink
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A new member was accepted to the chat by an administrator
2022-03-13 04:04:12 +00:00
type MessageChatJoinByRequest struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *MessageChatJoinByRequest) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub MessageChatJoinByRequest
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageChatJoinByRequest) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageContent
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageChatJoinByRequest) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageChatJoinByRequest
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageChatJoinByRequest) MessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageChatJoinByRequest
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A chat member was deleted
type MessageChatDeleteMember struct {
2022-03-13 04:04:12 +00:00
meta
// User identifier of the deleted chat member
UserId int64 `json:"user_id"`
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *MessageChatDeleteMember) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
type stub MessageChatDeleteMember
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageChatDeleteMember) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageContent
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageChatDeleteMember) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageChatDeleteMember
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageChatDeleteMember) MessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageChatDeleteMember
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
// A basic group was upgraded to a supergroup and was deactivated as the result
type MessageChatUpgradeTo struct {
2022-03-13 04:04:12 +00:00
meta
// Identifier of the supergroup to which the basic group was upgraded
SupergroupId int64 `json:"supergroup_id"`
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *MessageChatUpgradeTo) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
type stub MessageChatUpgradeTo
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageChatUpgradeTo) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageContent
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageChatUpgradeTo) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageChatUpgradeTo
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageChatUpgradeTo) MessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageChatUpgradeTo
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
// A supergroup has been created from a basic group
type MessageChatUpgradeFrom struct {
2022-03-13 04:04:12 +00:00
meta
// Title of the newly created supergroup
Title string `json:"title"`
// The identifier of the original basic group
BasicGroupId int64 `json:"basic_group_id"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *MessageChatUpgradeFrom) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub MessageChatUpgradeFrom
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageChatUpgradeFrom) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageContent
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageChatUpgradeFrom) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageChatUpgradeFrom
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageChatUpgradeFrom) MessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageChatUpgradeFrom
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A message has been pinned
type MessagePinMessage struct {
2022-03-13 04:04:12 +00:00
meta
// Identifier of the pinned message, can be an identifier of a deleted message or 0
MessageId int64 `json:"message_id"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *MessagePinMessage) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub MessagePinMessage
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessagePinMessage) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageContent
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessagePinMessage) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessagePinMessage
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessagePinMessage) MessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypeMessagePinMessage
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A screenshot of a message in the chat has been taken
2022-03-13 04:04:12 +00:00
type MessageScreenshotTaken struct{
meta
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *MessageScreenshotTaken) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
type stub MessageScreenshotTaken
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageScreenshotTaken) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageContent
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageScreenshotTaken) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageScreenshotTaken
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageScreenshotTaken) MessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageScreenshotTaken
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
// A theme in the chat has been changed
type MessageChatSetTheme struct {
2022-03-13 04:04:12 +00:00
meta
// If non-empty, name of a new theme, set for the chat. Otherwise chat theme was reset to the default one
ThemeName string `json:"theme_name"`
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *MessageChatSetTheme) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
type stub MessageChatSetTheme
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageChatSetTheme) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageContent
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageChatSetTheme) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageChatSetTheme
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageChatSetTheme) MessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageChatSetTheme
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
// The TTL (Time To Live) setting for messages in the chat has been changed
type MessageChatSetTtl struct {
2022-03-13 04:04:12 +00:00
meta
// New message TTL
Ttl int32 `json:"ttl"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *MessageChatSetTtl) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub MessageChatSetTtl
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageChatSetTtl) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageContent
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageChatSetTtl) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageChatSetTtl
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageChatSetTtl) MessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageChatSetTtl
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A non-standard action has happened in the chat
type MessageCustomServiceAction struct {
2022-03-13 04:04:12 +00:00
meta
// Message text to be shown in the chat
Text string `json:"text"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *MessageCustomServiceAction) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub MessageCustomServiceAction
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageCustomServiceAction) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageContent
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageCustomServiceAction) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageCustomServiceAction
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageCustomServiceAction) MessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageCustomServiceAction
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A new high score was achieved in a game
type MessageGameScore struct {
2022-03-13 04:04:12 +00:00
meta
// Identifier of the message with the game, can be an identifier of a deleted message
GameMessageId int64 `json:"game_message_id"`
// Identifier of the game; may be different from the games presented in the message with the game
GameId JsonInt64 `json:"game_id"`
// New score
Score int32 `json:"score"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *MessageGameScore) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub MessageGameScore
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageGameScore) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageContent
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageGameScore) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageGameScore
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageGameScore) MessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageGameScore
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A payment has been completed
type MessagePaymentSuccessful struct {
2022-03-13 04:04:12 +00:00
meta
// Identifier of the chat, containing the corresponding invoice message; 0 if unknown
InvoiceChatId int64 `json:"invoice_chat_id"`
// Identifier of the message with the corresponding invoice; can be an identifier of a deleted message
InvoiceMessageId int64 `json:"invoice_message_id"`
// Currency for the price of the product
Currency string `json:"currency"`
// Total price for the product, in the smallest units of the currency
TotalAmount int64 `json:"total_amount"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *MessagePaymentSuccessful) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub MessagePaymentSuccessful
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessagePaymentSuccessful) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageContent
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessagePaymentSuccessful) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessagePaymentSuccessful
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessagePaymentSuccessful) MessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypeMessagePaymentSuccessful
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
// A payment has been completed; for bots only
type MessagePaymentSuccessfulBot struct {
2022-03-13 04:04:12 +00:00
meta
// Currency for price of the product
Currency string `json:"currency"`
// Total price for the product, in the smallest units of the currency
TotalAmount int64 `json:"total_amount"`
// Invoice payload
InvoicePayload []byte `json:"invoice_payload"`
// Identifier of the shipping option chosen by the user; may be empty if not applicable
ShippingOptionId string `json:"shipping_option_id"`
// Information about the order; may be null
OrderInfo *OrderInfo `json:"order_info"`
// Telegram payment identifier
TelegramPaymentChargeId string `json:"telegram_payment_charge_id"`
// Provider payment identifier
ProviderPaymentChargeId string `json:"provider_payment_charge_id"`
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *MessagePaymentSuccessfulBot) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
type stub MessagePaymentSuccessfulBot
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessagePaymentSuccessfulBot) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageContent
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessagePaymentSuccessfulBot) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessagePaymentSuccessfulBot
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessagePaymentSuccessfulBot) MessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypeMessagePaymentSuccessfulBot
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
// A contact has registered with Telegram
2022-03-13 04:04:12 +00:00
type MessageContactRegistered struct{
meta
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *MessageContactRegistered) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
type stub MessageContactRegistered
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageContactRegistered) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageContent
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageContactRegistered) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageContactRegistered
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageContactRegistered) MessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageContactRegistered
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// The current user has connected a website by logging in using Telegram Login Widget on it
type MessageWebsiteConnected struct {
2022-03-13 04:04:12 +00:00
meta
// Domain name of the connected website
DomainName string `json:"domain_name"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *MessageWebsiteConnected) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub MessageWebsiteConnected
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageWebsiteConnected) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageContent
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageWebsiteConnected) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageWebsiteConnected
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageWebsiteConnected) MessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageWebsiteConnected
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// Telegram Passport data has been sent
type MessagePassportDataSent struct {
2022-03-13 04:04:12 +00:00
meta
// List of Telegram Passport element types sent
Types []PassportElementType `json:"types"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *MessagePassportDataSent) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub MessagePassportDataSent
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessagePassportDataSent) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageContent
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessagePassportDataSent) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessagePassportDataSent
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessagePassportDataSent) MessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypeMessagePassportDataSent
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (messagePassportDataSent *MessagePassportDataSent) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Types []json.RawMessage `json:"types"`
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
fieldTypes, _ := UnmarshalListOfPassportElementType(tmp.Types)
messagePassportDataSent.Types = fieldTypes
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return nil
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// Telegram Passport data has been received; for bots only
type MessagePassportDataReceived struct {
2022-03-13 04:04:12 +00:00
meta
// List of received Telegram Passport elements
Elements []*EncryptedPassportElement `json:"elements"`
// Encrypted data credentials
Credentials *EncryptedCredentials `json:"credentials"`
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *MessagePassportDataReceived) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
type stub MessagePassportDataReceived
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessagePassportDataReceived) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageContent
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessagePassportDataReceived) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessagePassportDataReceived
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessagePassportDataReceived) MessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypeMessagePassportDataReceived
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A user in the chat came within proximity alert range
type MessageProximityAlertTriggered struct {
2022-03-13 04:04:12 +00:00
meta
// The identifier of a user or chat that triggered the proximity alert
TravelerId MessageSender `json:"traveler_id"`
// The identifier of a user or chat that subscribed for the proximity alert
WatcherId MessageSender `json:"watcher_id"`
// The distance between the users
Distance int32 `json:"distance"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *MessageProximityAlertTriggered) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub MessageProximityAlertTriggered
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageProximityAlertTriggered) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageContent
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageProximityAlertTriggered) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageProximityAlertTriggered
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageProximityAlertTriggered) MessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageProximityAlertTriggered
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (messageProximityAlertTriggered *MessageProximityAlertTriggered) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
TravelerId json.RawMessage `json:"traveler_id"`
WatcherId json.RawMessage `json:"watcher_id"`
Distance int32 `json:"distance"`
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
messageProximityAlertTriggered.Distance = tmp.Distance
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
fieldTravelerId, _ := UnmarshalMessageSender(tmp.TravelerId)
messageProximityAlertTriggered.TravelerId = fieldTravelerId
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
fieldWatcherId, _ := UnmarshalMessageSender(tmp.WatcherId)
messageProximityAlertTriggered.WatcherId = fieldWatcherId
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return nil
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// Message content that is not supported in the current TDLib version
2022-03-13 04:04:12 +00:00
type MessageUnsupported struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *MessageUnsupported) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub MessageUnsupported
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageUnsupported) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageContent
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageUnsupported) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageUnsupported
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageUnsupported) MessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageUnsupported
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A mention of a user by their username
2022-03-13 04:04:12 +00:00
type TextEntityTypeMention struct{
meta
2021-12-30 05:55:02 +00:00
}
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
func (entity *TextEntityTypeMention) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub TextEntityTypeMention
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
func (*TextEntityTypeMention) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassTextEntityType
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*TextEntityTypeMention) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeTextEntityTypeMention
2021-12-30 05:55:02 +00:00
}
func (*TextEntityTypeMention) TextEntityTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeTextEntityTypeMention
2021-12-30 05:55:02 +00:00
}
// A hashtag text, beginning with "#"
2022-03-13 04:04:12 +00:00
type TextEntityTypeHashtag struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *TextEntityTypeHashtag) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub TextEntityTypeHashtag
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*TextEntityTypeHashtag) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassTextEntityType
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*TextEntityTypeHashtag) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeTextEntityTypeHashtag
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*TextEntityTypeHashtag) TextEntityTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeTextEntityTypeHashtag
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A cashtag text, beginning with "$" and consisting of capital English letters (e.g., "$USD")
2022-03-13 04:04:12 +00:00
type TextEntityTypeCashtag struct{
meta
2021-12-30 05:55:02 +00:00
}
2019-06-07 10:56:06 +00:00
2021-12-30 05:55:02 +00:00
func (entity *TextEntityTypeCashtag) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub TextEntityTypeCashtag
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*TextEntityTypeCashtag) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassTextEntityType
2021-12-30 05:55:02 +00:00
}
func (*TextEntityTypeCashtag) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeTextEntityTypeCashtag
2021-12-30 05:55:02 +00:00
}
func (*TextEntityTypeCashtag) TextEntityTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeTextEntityTypeCashtag
2021-12-30 05:55:02 +00:00
}
// A bot command, beginning with "/"
2022-03-13 04:04:12 +00:00
type TextEntityTypeBotCommand struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *TextEntityTypeBotCommand) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub TextEntityTypeBotCommand
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*TextEntityTypeBotCommand) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassTextEntityType
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*TextEntityTypeBotCommand) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeTextEntityTypeBotCommand
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*TextEntityTypeBotCommand) TextEntityTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeTextEntityTypeBotCommand
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// An HTTP URL
2022-03-13 04:04:12 +00:00
type TextEntityTypeUrl struct{
meta
2021-12-30 05:55:02 +00:00
}
2019-06-07 10:56:06 +00:00
2021-12-30 05:55:02 +00:00
func (entity *TextEntityTypeUrl) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub TextEntityTypeUrl
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
2019-06-07 10:56:06 +00:00
2021-12-30 05:55:02 +00:00
func (*TextEntityTypeUrl) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassTextEntityType
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*TextEntityTypeUrl) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeTextEntityTypeUrl
2021-12-30 05:55:02 +00:00
}
func (*TextEntityTypeUrl) TextEntityTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeTextEntityTypeUrl
2021-12-30 05:55:02 +00:00
}
// An email address
2022-03-13 04:04:12 +00:00
type TextEntityTypeEmailAddress struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *TextEntityTypeEmailAddress) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub TextEntityTypeEmailAddress
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*TextEntityTypeEmailAddress) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassTextEntityType
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*TextEntityTypeEmailAddress) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeTextEntityTypeEmailAddress
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*TextEntityTypeEmailAddress) TextEntityTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeTextEntityTypeEmailAddress
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A phone number
2022-03-13 04:04:12 +00:00
type TextEntityTypePhoneNumber struct{
meta
2021-12-30 05:55:02 +00:00
}
2019-06-07 10:56:06 +00:00
2021-12-30 05:55:02 +00:00
func (entity *TextEntityTypePhoneNumber) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub TextEntityTypePhoneNumber
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
2019-06-07 10:56:06 +00:00
2021-12-30 05:55:02 +00:00
func (*TextEntityTypePhoneNumber) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassTextEntityType
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*TextEntityTypePhoneNumber) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeTextEntityTypePhoneNumber
2021-12-30 05:55:02 +00:00
}
func (*TextEntityTypePhoneNumber) TextEntityTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeTextEntityTypePhoneNumber
2021-12-30 05:55:02 +00:00
}
// A bank card number. The getBankCardInfo method can be used to get information about the bank card
2022-03-13 04:04:12 +00:00
type TextEntityTypeBankCardNumber struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *TextEntityTypeBankCardNumber) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub TextEntityTypeBankCardNumber
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*TextEntityTypeBankCardNumber) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassTextEntityType
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*TextEntityTypeBankCardNumber) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeTextEntityTypeBankCardNumber
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*TextEntityTypeBankCardNumber) TextEntityTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeTextEntityTypeBankCardNumber
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A bold text
2022-03-13 04:04:12 +00:00
type TextEntityTypeBold struct{
meta
2021-12-30 05:55:02 +00:00
}
2019-06-07 10:56:06 +00:00
2021-12-30 05:55:02 +00:00
func (entity *TextEntityTypeBold) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub TextEntityTypeBold
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
2019-06-07 10:56:06 +00:00
2021-12-30 05:55:02 +00:00
func (*TextEntityTypeBold) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassTextEntityType
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*TextEntityTypeBold) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeTextEntityTypeBold
2021-12-30 05:55:02 +00:00
}
func (*TextEntityTypeBold) TextEntityTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeTextEntityTypeBold
2021-12-30 05:55:02 +00:00
}
// An italic text
2022-03-13 04:04:12 +00:00
type TextEntityTypeItalic struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *TextEntityTypeItalic) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub TextEntityTypeItalic
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*TextEntityTypeItalic) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassTextEntityType
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*TextEntityTypeItalic) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeTextEntityTypeItalic
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*TextEntityTypeItalic) TextEntityTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeTextEntityTypeItalic
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// An underlined text
2022-03-13 04:04:12 +00:00
type TextEntityTypeUnderline struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *TextEntityTypeUnderline) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub TextEntityTypeUnderline
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*TextEntityTypeUnderline) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassTextEntityType
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*TextEntityTypeUnderline) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeTextEntityTypeUnderline
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*TextEntityTypeUnderline) TextEntityTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeTextEntityTypeUnderline
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// A strikethrough text
2022-03-13 04:04:12 +00:00
type TextEntityTypeStrikethrough struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *TextEntityTypeStrikethrough) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub TextEntityTypeStrikethrough
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*TextEntityTypeStrikethrough) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassTextEntityType
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*TextEntityTypeStrikethrough) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeTextEntityTypeStrikethrough
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*TextEntityTypeStrikethrough) TextEntityTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeTextEntityTypeStrikethrough
2018-08-30 14:55:42 +00:00
}
2022-01-26 21:06:41 +00:00
// A spoiler text. Not supported in secret chats
2022-03-13 04:04:12 +00:00
type TextEntityTypeSpoiler struct{
meta
2022-01-26 21:06:41 +00:00
}
func (entity *TextEntityTypeSpoiler) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2022-01-26 21:06:41 +00:00
2022-03-13 04:04:12 +00:00
type stub TextEntityTypeSpoiler
2022-01-26 21:06:41 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2022-01-26 21:06:41 +00:00
}
func (*TextEntityTypeSpoiler) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassTextEntityType
2022-01-26 21:06:41 +00:00
}
func (*TextEntityTypeSpoiler) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeTextEntityTypeSpoiler
2022-01-26 21:06:41 +00:00
}
func (*TextEntityTypeSpoiler) TextEntityTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeTextEntityTypeSpoiler
2022-01-26 21:06:41 +00:00
}
2021-12-30 05:55:02 +00:00
// Text that must be formatted as if inside a code HTML tag
2022-03-13 04:04:12 +00:00
type TextEntityTypeCode struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *TextEntityTypeCode) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub TextEntityTypeCode
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*TextEntityTypeCode) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassTextEntityType
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*TextEntityTypeCode) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeTextEntityTypeCode
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*TextEntityTypeCode) TextEntityTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeTextEntityTypeCode
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// Text that must be formatted as if inside a pre HTML tag
2022-03-13 04:04:12 +00:00
type TextEntityTypePre struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *TextEntityTypePre) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub TextEntityTypePre
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*TextEntityTypePre) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassTextEntityType
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*TextEntityTypePre) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeTextEntityTypePre
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*TextEntityTypePre) TextEntityTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeTextEntityTypePre
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// Text that must be formatted as if inside pre, and code HTML tags
type TextEntityTypePreCode struct {
2022-03-13 04:04:12 +00:00
meta
// Programming language of the code; as defined by the sender
Language string `json:"language"`
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *TextEntityTypePreCode) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
type stub TextEntityTypePreCode
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*TextEntityTypePreCode) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassTextEntityType
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*TextEntityTypePreCode) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeTextEntityTypePreCode
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*TextEntityTypePreCode) TextEntityTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeTextEntityTypePreCode
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
// A text description shown instead of a raw URL
type TextEntityTypeTextUrl struct {
2022-03-13 04:04:12 +00:00
meta
// HTTP or tg:// URL to be opened when the link is clicked
Url string `json:"url"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *TextEntityTypeTextUrl) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub TextEntityTypeTextUrl
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*TextEntityTypeTextUrl) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassTextEntityType
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*TextEntityTypeTextUrl) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeTextEntityTypeTextUrl
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*TextEntityTypeTextUrl) TextEntityTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeTextEntityTypeTextUrl
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A text shows instead of a raw mention of the user (e.g., when the user has no username)
type TextEntityTypeMentionName struct {
2022-03-13 04:04:12 +00:00
meta
// Identifier of the mentioned user
UserId int64 `json:"user_id"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *TextEntityTypeMentionName) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub TextEntityTypeMentionName
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*TextEntityTypeMentionName) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassTextEntityType
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*TextEntityTypeMentionName) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeTextEntityTypeMentionName
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*TextEntityTypeMentionName) TextEntityTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeTextEntityTypeMentionName
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A media timestamp
type TextEntityTypeMediaTimestamp struct {
2022-03-13 04:04:12 +00:00
meta
// Timestamp from which a video/audio/video note/voice note playing must start, in seconds. The media can be in the content or the web page preview of the current message, or in the same places in the replied message
MediaTimestamp int32 `json:"media_timestamp"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *TextEntityTypeMediaTimestamp) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub TextEntityTypeMediaTimestamp
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*TextEntityTypeMediaTimestamp) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassTextEntityType
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*TextEntityTypeMediaTimestamp) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeTextEntityTypeMediaTimestamp
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*TextEntityTypeMediaTimestamp) TextEntityTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeTextEntityTypeMediaTimestamp
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A thumbnail to be sent along with a file; must be in JPEG or WEBP format for stickers, and less than 200 KB in size
type InputThumbnail struct {
2022-03-13 04:04:12 +00:00
meta
// Thumbnail file to send. Sending thumbnails by file_id is currently not supported
Thumbnail InputFile `json:"thumbnail"`
// Thumbnail width, usually shouldn't exceed 320. Use 0 if unknown
Width int32 `json:"width"`
// Thumbnail height, usually shouldn't exceed 320. Use 0 if unknown
Height int32 `json:"height"`
2021-12-30 05:55:02 +00:00
}
func (entity *InputThumbnail) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub InputThumbnail
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*InputThumbnail) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInputThumbnail
2021-12-30 05:55:02 +00:00
}
func (*InputThumbnail) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInputThumbnail
2021-12-30 05:55:02 +00:00
}
func (inputThumbnail *InputThumbnail) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Thumbnail json.RawMessage `json:"thumbnail"`
Width int32 `json:"width"`
Height int32 `json:"height"`
}
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
inputThumbnail.Width = tmp.Width
inputThumbnail.Height = tmp.Height
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
fieldThumbnail, _ := UnmarshalInputFile(tmp.Thumbnail)
inputThumbnail.Thumbnail = fieldThumbnail
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
return nil
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
// The message will be sent at the specified date
type MessageSchedulingStateSendAtDate struct {
2022-03-13 04:04:12 +00:00
meta
// Date the message will be sent. The date must be within 367 days in the future
SendDate int32 `json:"send_date"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *MessageSchedulingStateSendAtDate) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub MessageSchedulingStateSendAtDate
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageSchedulingStateSendAtDate) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageSchedulingState
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageSchedulingStateSendAtDate) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageSchedulingStateSendAtDate
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageSchedulingStateSendAtDate) MessageSchedulingStateType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageSchedulingStateSendAtDate
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// The message will be sent when the peer will be online. Applicable to private chats only and when the exact online status of the peer is known
2022-03-13 04:04:12 +00:00
type MessageSchedulingStateSendWhenOnline struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *MessageSchedulingStateSendWhenOnline) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub MessageSchedulingStateSendWhenOnline
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageSchedulingStateSendWhenOnline) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageSchedulingState
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageSchedulingStateSendWhenOnline) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageSchedulingStateSendWhenOnline
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageSchedulingStateSendWhenOnline) MessageSchedulingStateType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageSchedulingStateSendWhenOnline
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// Options to be used when a message is sent
type MessageSendOptions struct {
2022-03-13 04:04:12 +00:00
meta
// Pass true to disable notification for the message
DisableNotification bool `json:"disable_notification"`
// Pass true if the message is sent from the background
FromBackground bool `json:"from_background"`
// Pass true if the content of the message must be protected from forwarding and saving; for bots only
ProtectContent bool `json:"protect_content"`
// Message scheduling state; pass null to send message immediately. Messages sent to a secret chat, live location messages and self-destructing messages can't be scheduled
SchedulingState MessageSchedulingState `json:"scheduling_state"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *MessageSendOptions) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub MessageSendOptions
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageSendOptions) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageSendOptions
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageSendOptions) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageSendOptions
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (messageSendOptions *MessageSendOptions) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
DisableNotification bool `json:"disable_notification"`
FromBackground bool `json:"from_background"`
ProtectContent bool `json:"protect_content"`
SchedulingState json.RawMessage `json:"scheduling_state"`
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
messageSendOptions.DisableNotification = tmp.DisableNotification
messageSendOptions.FromBackground = tmp.FromBackground
messageSendOptions.ProtectContent = tmp.ProtectContent
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
fieldSchedulingState, _ := UnmarshalMessageSchedulingState(tmp.SchedulingState)
messageSendOptions.SchedulingState = fieldSchedulingState
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return nil
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// Options to be used when a message content is copied without reference to the original sender. Service messages and messageInvoice can't be copied
type MessageCopyOptions struct {
2022-03-13 04:04:12 +00:00
meta
// True, if content of the message needs to be copied without reference to the original sender. Always true if the message is forwarded to a secret chat or is local
SendCopy bool `json:"send_copy"`
// True, if media caption of the message copy needs to be replaced. Ignored if send_copy is false
ReplaceCaption bool `json:"replace_caption"`
// New message caption; pass null to copy message without caption. Ignored if replace_caption is false
NewCaption *FormattedText `json:"new_caption"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *MessageCopyOptions) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub MessageCopyOptions
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageCopyOptions) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageCopyOptions
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageCopyOptions) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageCopyOptions
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A text message
type InputMessageText struct {
2022-03-13 04:04:12 +00:00
meta
// Formatted text to be sent; 1-GetOption("message_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, Code, Pre, PreCode, TextUrl and MentionName entities are allowed to be specified manually
Text *FormattedText `json:"text"`
// True, if rich web page previews for URLs in the message text must be disabled
DisableWebPagePreview bool `json:"disable_web_page_preview"`
// True, if a chat message draft must be deleted
ClearDraft bool `json:"clear_draft"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InputMessageText) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub InputMessageText
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputMessageText) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInputMessageContent
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputMessageText) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInputMessageText
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputMessageText) InputMessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypeInputMessageText
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// An animation message (GIF-style).
type InputMessageAnimation struct {
2022-03-13 04:04:12 +00:00
meta
// Animation file to be sent
Animation InputFile `json:"animation"`
// Animation thumbnail; pass null to skip thumbnail uploading
Thumbnail *InputThumbnail `json:"thumbnail"`
// File identifiers of the stickers added to the animation, if applicable
AddedStickerFileIds []int32 `json:"added_sticker_file_ids"`
// Duration of the animation, in seconds
Duration int32 `json:"duration"`
// Width of the animation; may be replaced by the server
Width int32 `json:"width"`
// Height of the animation; may be replaced by the server
Height int32 `json:"height"`
// Animation caption; pass null to use an empty caption; 0-GetOption("message_caption_length_max") characters
Caption *FormattedText `json:"caption"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InputMessageAnimation) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub InputMessageAnimation
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputMessageAnimation) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInputMessageContent
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputMessageAnimation) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInputMessageAnimation
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputMessageAnimation) InputMessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypeInputMessageAnimation
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (inputMessageAnimation *InputMessageAnimation) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Animation json.RawMessage `json:"animation"`
Thumbnail *InputThumbnail `json:"thumbnail"`
AddedStickerFileIds []int32 `json:"added_sticker_file_ids"`
Duration int32 `json:"duration"`
Width int32 `json:"width"`
Height int32 `json:"height"`
Caption *FormattedText `json:"caption"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
inputMessageAnimation.Thumbnail = tmp.Thumbnail
inputMessageAnimation.AddedStickerFileIds = tmp.AddedStickerFileIds
inputMessageAnimation.Duration = tmp.Duration
inputMessageAnimation.Width = tmp.Width
inputMessageAnimation.Height = tmp.Height
inputMessageAnimation.Caption = tmp.Caption
fieldAnimation, _ := UnmarshalInputFile(tmp.Animation)
inputMessageAnimation.Animation = fieldAnimation
return nil
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// An audio message
type InputMessageAudio struct {
2022-03-13 04:04:12 +00:00
meta
// Audio file to be sent
Audio InputFile `json:"audio"`
// Thumbnail of the cover for the album; pass null to skip thumbnail uploading
AlbumCoverThumbnail *InputThumbnail `json:"album_cover_thumbnail"`
// Duration of the audio, in seconds; may be replaced by the server
Duration int32 `json:"duration"`
// Title of the audio; 0-64 characters; may be replaced by the server
Title string `json:"title"`
// Performer of the audio; 0-64 characters, may be replaced by the server
Performer string `json:"performer"`
// Audio caption; pass null to use an empty caption; 0-GetOption("message_caption_length_max") characters
Caption *FormattedText `json:"caption"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InputMessageAudio) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub InputMessageAudio
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputMessageAudio) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInputMessageContent
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputMessageAudio) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInputMessageAudio
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputMessageAudio) InputMessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypeInputMessageAudio
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (inputMessageAudio *InputMessageAudio) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Audio json.RawMessage `json:"audio"`
AlbumCoverThumbnail *InputThumbnail `json:"album_cover_thumbnail"`
Duration int32 `json:"duration"`
Title string `json:"title"`
Performer string `json:"performer"`
Caption *FormattedText `json:"caption"`
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
inputMessageAudio.AlbumCoverThumbnail = tmp.AlbumCoverThumbnail
inputMessageAudio.Duration = tmp.Duration
inputMessageAudio.Title = tmp.Title
inputMessageAudio.Performer = tmp.Performer
inputMessageAudio.Caption = tmp.Caption
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
fieldAudio, _ := UnmarshalInputFile(tmp.Audio)
inputMessageAudio.Audio = fieldAudio
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return nil
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// A document message (general file)
type InputMessageDocument struct {
2022-03-13 04:04:12 +00:00
meta
// Document to be sent
Document InputFile `json:"document"`
// Document thumbnail; pass null to skip thumbnail uploading
Thumbnail *InputThumbnail `json:"thumbnail"`
// If true, automatic file type detection will be disabled and the document will be always sent as file. Always true for files sent to secret chats
DisableContentTypeDetection bool `json:"disable_content_type_detection"`
// Document caption; pass null to use an empty caption; 0-GetOption("message_caption_length_max") characters
Caption *FormattedText `json:"caption"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InputMessageDocument) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub InputMessageDocument
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputMessageDocument) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInputMessageContent
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputMessageDocument) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInputMessageDocument
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputMessageDocument) InputMessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypeInputMessageDocument
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (inputMessageDocument *InputMessageDocument) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Document json.RawMessage `json:"document"`
Thumbnail *InputThumbnail `json:"thumbnail"`
DisableContentTypeDetection bool `json:"disable_content_type_detection"`
Caption *FormattedText `json:"caption"`
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
inputMessageDocument.Thumbnail = tmp.Thumbnail
inputMessageDocument.DisableContentTypeDetection = tmp.DisableContentTypeDetection
inputMessageDocument.Caption = tmp.Caption
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
fieldDocument, _ := UnmarshalInputFile(tmp.Document)
inputMessageDocument.Document = fieldDocument
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return nil
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// A photo message
type InputMessagePhoto struct {
2022-03-13 04:04:12 +00:00
meta
// Photo to send
Photo InputFile `json:"photo"`
// Photo thumbnail to be sent; pass null to skip thumbnail uploading. The thumbnail is sent to the other party only in secret chats
Thumbnail *InputThumbnail `json:"thumbnail"`
// File identifiers of the stickers added to the photo, if applicable
AddedStickerFileIds []int32 `json:"added_sticker_file_ids"`
// Photo width
Width int32 `json:"width"`
// Photo height
Height int32 `json:"height"`
// Photo caption; pass null to use an empty caption; 0-GetOption("message_caption_length_max") characters
Caption *FormattedText `json:"caption"`
// Photo TTL (Time To Live), in seconds (0-60). A non-zero TTL can be specified only in private chats
Ttl int32 `json:"ttl"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InputMessagePhoto) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub InputMessagePhoto
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputMessagePhoto) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInputMessageContent
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputMessagePhoto) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInputMessagePhoto
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputMessagePhoto) InputMessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypeInputMessagePhoto
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (inputMessagePhoto *InputMessagePhoto) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Photo json.RawMessage `json:"photo"`
Thumbnail *InputThumbnail `json:"thumbnail"`
AddedStickerFileIds []int32 `json:"added_sticker_file_ids"`
Width int32 `json:"width"`
Height int32 `json:"height"`
Caption *FormattedText `json:"caption"`
Ttl int32 `json:"ttl"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
inputMessagePhoto.Thumbnail = tmp.Thumbnail
inputMessagePhoto.AddedStickerFileIds = tmp.AddedStickerFileIds
inputMessagePhoto.Width = tmp.Width
inputMessagePhoto.Height = tmp.Height
inputMessagePhoto.Caption = tmp.Caption
inputMessagePhoto.Ttl = tmp.Ttl
fieldPhoto, _ := UnmarshalInputFile(tmp.Photo)
inputMessagePhoto.Photo = fieldPhoto
return nil
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// A sticker message
type InputMessageSticker struct {
2022-03-13 04:04:12 +00:00
meta
// Sticker to be sent
Sticker InputFile `json:"sticker"`
// Sticker thumbnail; pass null to skip thumbnail uploading
Thumbnail *InputThumbnail `json:"thumbnail"`
// Sticker width
Width int32 `json:"width"`
// Sticker height
Height int32 `json:"height"`
// Emoji used to choose the sticker
Emoji string `json:"emoji"`
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InputMessageSticker) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub InputMessageSticker
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputMessageSticker) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInputMessageContent
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputMessageSticker) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInputMessageSticker
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputMessageSticker) InputMessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypeInputMessageSticker
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (inputMessageSticker *InputMessageSticker) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Sticker json.RawMessage `json:"sticker"`
Thumbnail *InputThumbnail `json:"thumbnail"`
Width int32 `json:"width"`
Height int32 `json:"height"`
Emoji string `json:"emoji"`
}
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
inputMessageSticker.Thumbnail = tmp.Thumbnail
inputMessageSticker.Width = tmp.Width
inputMessageSticker.Height = tmp.Height
inputMessageSticker.Emoji = tmp.Emoji
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
fieldSticker, _ := UnmarshalInputFile(tmp.Sticker)
inputMessageSticker.Sticker = fieldSticker
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return nil
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// A video message
type InputMessageVideo struct {
2022-03-13 04:04:12 +00:00
meta
// Video to be sent
Video InputFile `json:"video"`
// Video thumbnail; pass null to skip thumbnail uploading
Thumbnail *InputThumbnail `json:"thumbnail"`
// File identifiers of the stickers added to the video, if applicable
AddedStickerFileIds []int32 `json:"added_sticker_file_ids"`
// Duration of the video, in seconds
Duration int32 `json:"duration"`
// Video width
Width int32 `json:"width"`
// Video height
Height int32 `json:"height"`
// True, if the video is supposed to be streamed
SupportsStreaming bool `json:"supports_streaming"`
// Video caption; pass null to use an empty caption; 0-GetOption("message_caption_length_max") characters
Caption *FormattedText `json:"caption"`
// Video TTL (Time To Live), in seconds (0-60). A non-zero TTL can be specified only in private chats
Ttl int32 `json:"ttl"`
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InputMessageVideo) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub InputMessageVideo
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputMessageVideo) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInputMessageContent
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputMessageVideo) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInputMessageVideo
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputMessageVideo) InputMessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypeInputMessageVideo
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (inputMessageVideo *InputMessageVideo) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Video json.RawMessage `json:"video"`
Thumbnail *InputThumbnail `json:"thumbnail"`
AddedStickerFileIds []int32 `json:"added_sticker_file_ids"`
Duration int32 `json:"duration"`
Width int32 `json:"width"`
Height int32 `json:"height"`
SupportsStreaming bool `json:"supports_streaming"`
Caption *FormattedText `json:"caption"`
Ttl int32 `json:"ttl"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
inputMessageVideo.Thumbnail = tmp.Thumbnail
inputMessageVideo.AddedStickerFileIds = tmp.AddedStickerFileIds
inputMessageVideo.Duration = tmp.Duration
inputMessageVideo.Width = tmp.Width
inputMessageVideo.Height = tmp.Height
inputMessageVideo.SupportsStreaming = tmp.SupportsStreaming
inputMessageVideo.Caption = tmp.Caption
inputMessageVideo.Ttl = tmp.Ttl
fieldVideo, _ := UnmarshalInputFile(tmp.Video)
inputMessageVideo.Video = fieldVideo
return nil
2021-12-30 05:55:02 +00:00
}
// A video note message
type InputMessageVideoNote struct {
2022-03-13 04:04:12 +00:00
meta
// Video note to be sent
VideoNote InputFile `json:"video_note"`
// Video thumbnail; pass null to skip thumbnail uploading
Thumbnail *InputThumbnail `json:"thumbnail"`
// Duration of the video, in seconds
Duration int32 `json:"duration"`
// Video width and height; must be positive and not greater than 640
Length int32 `json:"length"`
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InputMessageVideoNote) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub InputMessageVideoNote
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputMessageVideoNote) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInputMessageContent
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputMessageVideoNote) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInputMessageVideoNote
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputMessageVideoNote) InputMessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypeInputMessageVideoNote
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (inputMessageVideoNote *InputMessageVideoNote) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
VideoNote json.RawMessage `json:"video_note"`
Thumbnail *InputThumbnail `json:"thumbnail"`
Duration int32 `json:"duration"`
Length int32 `json:"length"`
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
inputMessageVideoNote.Thumbnail = tmp.Thumbnail
inputMessageVideoNote.Duration = tmp.Duration
inputMessageVideoNote.Length = tmp.Length
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
fieldVideoNote, _ := UnmarshalInputFile(tmp.VideoNote)
inputMessageVideoNote.VideoNote = fieldVideoNote
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return nil
2021-12-30 05:55:02 +00:00
}
// A voice note message
type InputMessageVoiceNote struct {
2022-03-13 04:04:12 +00:00
meta
// Voice note to be sent
VoiceNote InputFile `json:"voice_note"`
// Duration of the voice note, in seconds
Duration int32 `json:"duration"`
// Waveform representation of the voice note, in 5-bit format
Waveform []byte `json:"waveform"`
// Voice note caption; pass null to use an empty caption; 0-GetOption("message_caption_length_max") characters
Caption *FormattedText `json:"caption"`
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InputMessageVoiceNote) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
type stub InputMessageVoiceNote
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputMessageVoiceNote) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInputMessageContent
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputMessageVoiceNote) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInputMessageVoiceNote
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputMessageVoiceNote) InputMessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypeInputMessageVoiceNote
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (inputMessageVoiceNote *InputMessageVoiceNote) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
VoiceNote json.RawMessage `json:"voice_note"`
Duration int32 `json:"duration"`
Waveform []byte `json:"waveform"`
Caption *FormattedText `json:"caption"`
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
inputMessageVoiceNote.Duration = tmp.Duration
inputMessageVoiceNote.Waveform = tmp.Waveform
inputMessageVoiceNote.Caption = tmp.Caption
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
fieldVoiceNote, _ := UnmarshalInputFile(tmp.VoiceNote)
inputMessageVoiceNote.VoiceNote = fieldVoiceNote
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return nil
2021-12-30 05:55:02 +00:00
}
// A message with a location
type InputMessageLocation struct {
2022-03-13 04:04:12 +00:00
meta
// Location to be sent
Location *Location `json:"location"`
// Period for which the location can be updated, in seconds; must be between 60 and 86400 for a live location and 0 otherwise
LivePeriod int32 `json:"live_period"`
// For live locations, a direction in which the location moves, in degrees; 1-360. Pass 0 if unknown
Heading int32 `json:"heading"`
// For live locations, a maximum distance to another chat member for proximity alerts, in meters (0-100000). Pass 0 if the notification is disabled. Can't be enabled in channels and Saved Messages
ProximityAlertRadius int32 `json:"proximity_alert_radius"`
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InputMessageLocation) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
type stub InputMessageLocation
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputMessageLocation) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInputMessageContent
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputMessageLocation) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInputMessageLocation
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputMessageLocation) InputMessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypeInputMessageLocation
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
// A message with information about a venue
type InputMessageVenue struct {
2022-03-13 04:04:12 +00:00
meta
// Venue to send
Venue *Venue `json:"venue"`
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InputMessageVenue) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub InputMessageVenue
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputMessageVenue) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInputMessageContent
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputMessageVenue) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInputMessageVenue
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputMessageVenue) InputMessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypeInputMessageVenue
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// A message containing a user contact
type InputMessageContact struct {
2022-03-13 04:04:12 +00:00
meta
// Contact to send
Contact *Contact `json:"contact"`
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InputMessageContact) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub InputMessageContact
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputMessageContact) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInputMessageContent
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputMessageContact) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInputMessageContact
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputMessageContact) InputMessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypeInputMessageContact
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// A dice message
type InputMessageDice struct {
2022-03-13 04:04:12 +00:00
meta
// Emoji on which the dice throw animation is based
Emoji string `json:"emoji"`
// True, if the chat message draft must be deleted
ClearDraft bool `json:"clear_draft"`
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InputMessageDice) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub InputMessageDice
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputMessageDice) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInputMessageContent
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputMessageDice) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInputMessageDice
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputMessageDice) InputMessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypeInputMessageDice
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// A message with a game; not supported for channels or secret chats
type InputMessageGame struct {
2022-03-13 04:04:12 +00:00
meta
// User identifier of the bot that owns the game
BotUserId int64 `json:"bot_user_id"`
// Short name of the game
GameShortName string `json:"game_short_name"`
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InputMessageGame) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub InputMessageGame
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputMessageGame) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInputMessageContent
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputMessageGame) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInputMessageGame
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputMessageGame) InputMessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypeInputMessageGame
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// A message with an invoice; can be used only by bots
type InputMessageInvoice struct {
2022-03-13 04:04:12 +00:00
meta
// Invoice
Invoice *Invoice `json:"invoice"`
// Product title; 1-32 characters
Title string `json:"title"`
// Product description; 0-255 characters
Description string `json:"description"`
// Product photo URL; optional
PhotoUrl string `json:"photo_url"`
// Product photo size
PhotoSize int32 `json:"photo_size"`
// Product photo width
PhotoWidth int32 `json:"photo_width"`
// Product photo height
PhotoHeight int32 `json:"photo_height"`
// The invoice payload
Payload []byte `json:"payload"`
// Payment provider token
ProviderToken string `json:"provider_token"`
// JSON-encoded data about the invoice, which will be shared with the payment provider
ProviderData string `json:"provider_data"`
// Unique invoice bot deep link parameter for the generation of this invoice. If empty, it would be possible to pay directly from forwards of the invoice message
StartParameter string `json:"start_parameter"`
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InputMessageInvoice) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub InputMessageInvoice
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputMessageInvoice) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInputMessageContent
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputMessageInvoice) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInputMessageInvoice
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputMessageInvoice) InputMessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypeInputMessageInvoice
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// A message with a poll. Polls can't be sent to secret chats. Polls can be sent only to a private chat with a bot
type InputMessagePoll struct {
2022-03-13 04:04:12 +00:00
meta
// Poll question; 1-255 characters (up to 300 characters for bots)
Question string `json:"question"`
// List of poll answer options, 2-10 strings 1-100 characters each
Options []string `json:"options"`
// True, if the poll voters are anonymous. Non-anonymous polls can't be sent or forwarded to channels
IsAnonymous bool `json:"is_anonymous"`
// Type of the poll
Type PollType `json:"type"`
// Amount of time the poll will be active after creation, in seconds; for bots only
OpenPeriod int32 `json:"open_period"`
// Point in time (Unix timestamp) when the poll will automatically be closed; for bots only
CloseDate int32 `json:"close_date"`
// True, if the poll needs to be sent already closed; for bots only
IsClosed bool `json:"is_closed"`
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InputMessagePoll) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub InputMessagePoll
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputMessagePoll) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInputMessageContent
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputMessagePoll) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInputMessagePoll
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputMessagePoll) InputMessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypeInputMessagePoll
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (inputMessagePoll *InputMessagePoll) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Question string `json:"question"`
Options []string `json:"options"`
IsAnonymous bool `json:"is_anonymous"`
Type json.RawMessage `json:"type"`
OpenPeriod int32 `json:"open_period"`
CloseDate int32 `json:"close_date"`
IsClosed bool `json:"is_closed"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
inputMessagePoll.Question = tmp.Question
inputMessagePoll.Options = tmp.Options
inputMessagePoll.IsAnonymous = tmp.IsAnonymous
inputMessagePoll.OpenPeriod = tmp.OpenPeriod
inputMessagePoll.CloseDate = tmp.CloseDate
inputMessagePoll.IsClosed = tmp.IsClosed
fieldType, _ := UnmarshalPollType(tmp.Type)
inputMessagePoll.Type = fieldType
return nil
2021-12-30 05:55:02 +00:00
}
// A forwarded message
type InputMessageForwarded struct {
2022-03-13 04:04:12 +00:00
meta
// Identifier for the chat this forwarded message came from
FromChatId int64 `json:"from_chat_id"`
// Identifier of the message to forward
MessageId int64 `json:"message_id"`
// True, if a game message is being shared from a launched game; applies only to game messages
InGameShare bool `json:"in_game_share"`
// Options to be used to copy content of the message without reference to the original sender; pass null to forward the message as usual
CopyOptions *MessageCopyOptions `json:"copy_options"`
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InputMessageForwarded) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub InputMessageForwarded
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputMessageForwarded) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInputMessageContent
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputMessageForwarded) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInputMessageForwarded
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputMessageForwarded) InputMessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypeInputMessageForwarded
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// Returns all found messages, no filter is applied
2022-03-13 04:04:12 +00:00
type SearchMessagesFilterEmpty struct{
meta
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *SearchMessagesFilterEmpty) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub SearchMessagesFilterEmpty
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*SearchMessagesFilterEmpty) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassSearchMessagesFilter
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*SearchMessagesFilterEmpty) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeSearchMessagesFilterEmpty
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*SearchMessagesFilterEmpty) SearchMessagesFilterType() string {
2022-03-13 04:04:12 +00:00
return TypeSearchMessagesFilterEmpty
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// Returns only animation messages
2022-03-13 04:04:12 +00:00
type SearchMessagesFilterAnimation struct{
meta
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *SearchMessagesFilterAnimation) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub SearchMessagesFilterAnimation
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*SearchMessagesFilterAnimation) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassSearchMessagesFilter
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*SearchMessagesFilterAnimation) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeSearchMessagesFilterAnimation
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*SearchMessagesFilterAnimation) SearchMessagesFilterType() string {
2022-03-13 04:04:12 +00:00
return TypeSearchMessagesFilterAnimation
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// Returns only audio messages
2022-03-13 04:04:12 +00:00
type SearchMessagesFilterAudio struct{
meta
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *SearchMessagesFilterAudio) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub SearchMessagesFilterAudio
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*SearchMessagesFilterAudio) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassSearchMessagesFilter
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*SearchMessagesFilterAudio) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeSearchMessagesFilterAudio
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*SearchMessagesFilterAudio) SearchMessagesFilterType() string {
2022-03-13 04:04:12 +00:00
return TypeSearchMessagesFilterAudio
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// Returns only document messages
2022-03-13 04:04:12 +00:00
type SearchMessagesFilterDocument struct{
meta
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *SearchMessagesFilterDocument) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub SearchMessagesFilterDocument
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*SearchMessagesFilterDocument) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassSearchMessagesFilter
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*SearchMessagesFilterDocument) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeSearchMessagesFilterDocument
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*SearchMessagesFilterDocument) SearchMessagesFilterType() string {
2022-03-13 04:04:12 +00:00
return TypeSearchMessagesFilterDocument
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// Returns only photo messages
2022-03-13 04:04:12 +00:00
type SearchMessagesFilterPhoto struct{
meta
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *SearchMessagesFilterPhoto) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub SearchMessagesFilterPhoto
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*SearchMessagesFilterPhoto) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassSearchMessagesFilter
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*SearchMessagesFilterPhoto) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeSearchMessagesFilterPhoto
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*SearchMessagesFilterPhoto) SearchMessagesFilterType() string {
2022-03-13 04:04:12 +00:00
return TypeSearchMessagesFilterPhoto
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// Returns only video messages
2022-03-13 04:04:12 +00:00
type SearchMessagesFilterVideo struct{
meta
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *SearchMessagesFilterVideo) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub SearchMessagesFilterVideo
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*SearchMessagesFilterVideo) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassSearchMessagesFilter
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*SearchMessagesFilterVideo) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeSearchMessagesFilterVideo
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*SearchMessagesFilterVideo) SearchMessagesFilterType() string {
2022-03-13 04:04:12 +00:00
return TypeSearchMessagesFilterVideo
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// Returns only voice note messages
2022-03-13 04:04:12 +00:00
type SearchMessagesFilterVoiceNote struct{
meta
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *SearchMessagesFilterVoiceNote) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub SearchMessagesFilterVoiceNote
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*SearchMessagesFilterVoiceNote) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassSearchMessagesFilter
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*SearchMessagesFilterVoiceNote) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeSearchMessagesFilterVoiceNote
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*SearchMessagesFilterVoiceNote) SearchMessagesFilterType() string {
2022-03-13 04:04:12 +00:00
return TypeSearchMessagesFilterVoiceNote
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// Returns only photo and video messages
2022-03-13 04:04:12 +00:00
type SearchMessagesFilterPhotoAndVideo struct{
meta
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *SearchMessagesFilterPhotoAndVideo) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub SearchMessagesFilterPhotoAndVideo
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*SearchMessagesFilterPhotoAndVideo) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassSearchMessagesFilter
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*SearchMessagesFilterPhotoAndVideo) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeSearchMessagesFilterPhotoAndVideo
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*SearchMessagesFilterPhotoAndVideo) SearchMessagesFilterType() string {
2022-03-13 04:04:12 +00:00
return TypeSearchMessagesFilterPhotoAndVideo
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// Returns only messages containing URLs
2022-03-13 04:04:12 +00:00
type SearchMessagesFilterUrl struct{
meta
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *SearchMessagesFilterUrl) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub SearchMessagesFilterUrl
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*SearchMessagesFilterUrl) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassSearchMessagesFilter
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*SearchMessagesFilterUrl) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeSearchMessagesFilterUrl
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*SearchMessagesFilterUrl) SearchMessagesFilterType() string {
2022-03-13 04:04:12 +00:00
return TypeSearchMessagesFilterUrl
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// Returns only messages containing chat photos
2022-03-13 04:04:12 +00:00
type SearchMessagesFilterChatPhoto struct{
meta
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *SearchMessagesFilterChatPhoto) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub SearchMessagesFilterChatPhoto
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*SearchMessagesFilterChatPhoto) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassSearchMessagesFilter
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*SearchMessagesFilterChatPhoto) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeSearchMessagesFilterChatPhoto
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*SearchMessagesFilterChatPhoto) SearchMessagesFilterType() string {
2022-03-13 04:04:12 +00:00
return TypeSearchMessagesFilterChatPhoto
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// Returns only video note messages
2022-03-13 04:04:12 +00:00
type SearchMessagesFilterVideoNote struct{
meta
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *SearchMessagesFilterVideoNote) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub SearchMessagesFilterVideoNote
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*SearchMessagesFilterVideoNote) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassSearchMessagesFilter
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*SearchMessagesFilterVideoNote) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeSearchMessagesFilterVideoNote
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*SearchMessagesFilterVideoNote) SearchMessagesFilterType() string {
2022-03-13 04:04:12 +00:00
return TypeSearchMessagesFilterVideoNote
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// Returns only voice and video note messages
2022-03-13 04:04:12 +00:00
type SearchMessagesFilterVoiceAndVideoNote struct{
meta
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *SearchMessagesFilterVoiceAndVideoNote) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub SearchMessagesFilterVoiceAndVideoNote
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*SearchMessagesFilterVoiceAndVideoNote) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassSearchMessagesFilter
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*SearchMessagesFilterVoiceAndVideoNote) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeSearchMessagesFilterVoiceAndVideoNote
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*SearchMessagesFilterVoiceAndVideoNote) SearchMessagesFilterType() string {
2022-03-13 04:04:12 +00:00
return TypeSearchMessagesFilterVoiceAndVideoNote
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// Returns only messages with mentions of the current user, or messages that are replies to their messages
2022-03-13 04:04:12 +00:00
type SearchMessagesFilterMention struct{
meta
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *SearchMessagesFilterMention) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub SearchMessagesFilterMention
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*SearchMessagesFilterMention) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassSearchMessagesFilter
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*SearchMessagesFilterMention) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeSearchMessagesFilterMention
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*SearchMessagesFilterMention) SearchMessagesFilterType() string {
2022-03-13 04:04:12 +00:00
return TypeSearchMessagesFilterMention
2021-12-30 05:55:02 +00:00
}
// Returns only messages with unread mentions of the current user, or messages that are replies to their messages. When using this filter the results can't be additionally filtered by a query, a message thread or by the sending user
2022-03-13 04:04:12 +00:00
type SearchMessagesFilterUnreadMention struct{
meta
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *SearchMessagesFilterUnreadMention) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub SearchMessagesFilterUnreadMention
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*SearchMessagesFilterUnreadMention) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassSearchMessagesFilter
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*SearchMessagesFilterUnreadMention) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeSearchMessagesFilterUnreadMention
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*SearchMessagesFilterUnreadMention) SearchMessagesFilterType() string {
2022-03-13 04:04:12 +00:00
return TypeSearchMessagesFilterUnreadMention
2021-12-30 05:55:02 +00:00
}
2022-02-06 18:36:17 +00:00
// Returns only messages with unread reactions for the current user. When using this filter the results can't be additionally filtered by a query, a message thread or by the sending user
2022-03-13 04:04:12 +00:00
type SearchMessagesFilterUnreadReaction struct{
meta
2022-02-06 18:36:17 +00:00
}
func (entity *SearchMessagesFilterUnreadReaction) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2022-02-06 18:36:17 +00:00
2022-03-13 04:04:12 +00:00
type stub SearchMessagesFilterUnreadReaction
2022-02-06 18:36:17 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2022-02-06 18:36:17 +00:00
}
func (*SearchMessagesFilterUnreadReaction) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassSearchMessagesFilter
2022-02-06 18:36:17 +00:00
}
func (*SearchMessagesFilterUnreadReaction) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeSearchMessagesFilterUnreadReaction
2022-02-06 18:36:17 +00:00
}
func (*SearchMessagesFilterUnreadReaction) SearchMessagesFilterType() string {
2022-03-13 04:04:12 +00:00
return TypeSearchMessagesFilterUnreadReaction
2022-02-06 18:36:17 +00:00
}
2021-12-30 05:55:02 +00:00
// Returns only failed to send messages. This filter can be used only if the message database is used
2022-03-13 04:04:12 +00:00
type SearchMessagesFilterFailedToSend struct{
meta
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *SearchMessagesFilterFailedToSend) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub SearchMessagesFilterFailedToSend
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*SearchMessagesFilterFailedToSend) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassSearchMessagesFilter
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*SearchMessagesFilterFailedToSend) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeSearchMessagesFilterFailedToSend
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*SearchMessagesFilterFailedToSend) SearchMessagesFilterType() string {
2022-03-13 04:04:12 +00:00
return TypeSearchMessagesFilterFailedToSend
2021-12-30 05:55:02 +00:00
}
// Returns only pinned messages
2022-03-13 04:04:12 +00:00
type SearchMessagesFilterPinned struct{
meta
2021-12-30 05:55:02 +00:00
}
func (entity *SearchMessagesFilterPinned) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub SearchMessagesFilterPinned
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*SearchMessagesFilterPinned) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassSearchMessagesFilter
2021-12-30 05:55:02 +00:00
}
func (*SearchMessagesFilterPinned) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeSearchMessagesFilterPinned
2021-12-30 05:55:02 +00:00
}
func (*SearchMessagesFilterPinned) SearchMessagesFilterType() string {
2022-03-13 04:04:12 +00:00
return TypeSearchMessagesFilterPinned
2021-12-30 05:55:02 +00:00
}
// The user is typing a message
2022-03-13 04:04:12 +00:00
type ChatActionTyping struct{
meta
2021-12-30 05:55:02 +00:00
}
func (entity *ChatActionTyping) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatActionTyping
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*ChatActionTyping) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatAction
2021-12-30 05:55:02 +00:00
}
func (*ChatActionTyping) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatActionTyping
2021-12-30 05:55:02 +00:00
}
func (*ChatActionTyping) ChatActionType() string {
2022-03-13 04:04:12 +00:00
return TypeChatActionTyping
2021-12-30 05:55:02 +00:00
}
// The user is recording a video
2022-03-13 04:04:12 +00:00
type ChatActionRecordingVideo struct{
meta
2021-12-30 05:55:02 +00:00
}
func (entity *ChatActionRecordingVideo) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatActionRecordingVideo
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*ChatActionRecordingVideo) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatAction
2021-12-30 05:55:02 +00:00
}
func (*ChatActionRecordingVideo) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatActionRecordingVideo
2021-12-30 05:55:02 +00:00
}
func (*ChatActionRecordingVideo) ChatActionType() string {
2022-03-13 04:04:12 +00:00
return TypeChatActionRecordingVideo
2021-12-30 05:55:02 +00:00
}
// The user is uploading a video
type ChatActionUploadingVideo struct {
2022-03-13 04:04:12 +00:00
meta
// Upload progress, as a percentage
Progress int32 `json:"progress"`
2021-12-30 05:55:02 +00:00
}
func (entity *ChatActionUploadingVideo) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatActionUploadingVideo
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*ChatActionUploadingVideo) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatAction
2021-12-30 05:55:02 +00:00
}
func (*ChatActionUploadingVideo) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatActionUploadingVideo
2021-12-30 05:55:02 +00:00
}
func (*ChatActionUploadingVideo) ChatActionType() string {
2022-03-13 04:04:12 +00:00
return TypeChatActionUploadingVideo
2021-12-30 05:55:02 +00:00
}
// The user is recording a voice note
2022-03-13 04:04:12 +00:00
type ChatActionRecordingVoiceNote struct{
meta
2021-12-30 05:55:02 +00:00
}
func (entity *ChatActionRecordingVoiceNote) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatActionRecordingVoiceNote
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*ChatActionRecordingVoiceNote) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatAction
2021-12-30 05:55:02 +00:00
}
func (*ChatActionRecordingVoiceNote) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatActionRecordingVoiceNote
2021-12-30 05:55:02 +00:00
}
func (*ChatActionRecordingVoiceNote) ChatActionType() string {
2022-03-13 04:04:12 +00:00
return TypeChatActionRecordingVoiceNote
2021-12-30 05:55:02 +00:00
}
// The user is uploading a voice note
type ChatActionUploadingVoiceNote struct {
2022-03-13 04:04:12 +00:00
meta
// Upload progress, as a percentage
Progress int32 `json:"progress"`
2021-12-30 05:55:02 +00:00
}
func (entity *ChatActionUploadingVoiceNote) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatActionUploadingVoiceNote
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*ChatActionUploadingVoiceNote) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatAction
2021-12-30 05:55:02 +00:00
}
func (*ChatActionUploadingVoiceNote) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatActionUploadingVoiceNote
2021-12-30 05:55:02 +00:00
}
func (*ChatActionUploadingVoiceNote) ChatActionType() string {
2022-03-13 04:04:12 +00:00
return TypeChatActionUploadingVoiceNote
2021-12-30 05:55:02 +00:00
}
// The user is uploading a photo
type ChatActionUploadingPhoto struct {
2022-03-13 04:04:12 +00:00
meta
// Upload progress, as a percentage
Progress int32 `json:"progress"`
2021-12-30 05:55:02 +00:00
}
func (entity *ChatActionUploadingPhoto) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatActionUploadingPhoto
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*ChatActionUploadingPhoto) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatAction
2021-12-30 05:55:02 +00:00
}
func (*ChatActionUploadingPhoto) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatActionUploadingPhoto
2021-12-30 05:55:02 +00:00
}
func (*ChatActionUploadingPhoto) ChatActionType() string {
2022-03-13 04:04:12 +00:00
return TypeChatActionUploadingPhoto
2021-12-30 05:55:02 +00:00
}
// The user is uploading a document
type ChatActionUploadingDocument struct {
2022-03-13 04:04:12 +00:00
meta
// Upload progress, as a percentage
Progress int32 `json:"progress"`
2021-12-30 05:55:02 +00:00
}
func (entity *ChatActionUploadingDocument) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatActionUploadingDocument
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*ChatActionUploadingDocument) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatAction
2021-12-30 05:55:02 +00:00
}
func (*ChatActionUploadingDocument) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatActionUploadingDocument
2021-12-30 05:55:02 +00:00
}
func (*ChatActionUploadingDocument) ChatActionType() string {
2022-03-13 04:04:12 +00:00
return TypeChatActionUploadingDocument
2021-12-30 05:55:02 +00:00
}
// The user is picking a sticker to send
2022-03-13 04:04:12 +00:00
type ChatActionChoosingSticker struct{
meta
2021-12-30 05:55:02 +00:00
}
func (entity *ChatActionChoosingSticker) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatActionChoosingSticker
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*ChatActionChoosingSticker) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatAction
2021-12-30 05:55:02 +00:00
}
func (*ChatActionChoosingSticker) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatActionChoosingSticker
2021-12-30 05:55:02 +00:00
}
func (*ChatActionChoosingSticker) ChatActionType() string {
2022-03-13 04:04:12 +00:00
return TypeChatActionChoosingSticker
2021-12-30 05:55:02 +00:00
}
// The user is picking a location or venue to send
2022-03-13 04:04:12 +00:00
type ChatActionChoosingLocation struct{
meta
2021-12-30 05:55:02 +00:00
}
func (entity *ChatActionChoosingLocation) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatActionChoosingLocation
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*ChatActionChoosingLocation) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatAction
2021-12-30 05:55:02 +00:00
}
func (*ChatActionChoosingLocation) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatActionChoosingLocation
2021-12-30 05:55:02 +00:00
}
func (*ChatActionChoosingLocation) ChatActionType() string {
2022-03-13 04:04:12 +00:00
return TypeChatActionChoosingLocation
2021-12-30 05:55:02 +00:00
}
// The user is picking a contact to send
2022-03-13 04:04:12 +00:00
type ChatActionChoosingContact struct{
meta
2021-12-30 05:55:02 +00:00
}
func (entity *ChatActionChoosingContact) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatActionChoosingContact
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*ChatActionChoosingContact) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatAction
2021-12-30 05:55:02 +00:00
}
func (*ChatActionChoosingContact) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatActionChoosingContact
2021-12-30 05:55:02 +00:00
}
func (*ChatActionChoosingContact) ChatActionType() string {
2022-03-13 04:04:12 +00:00
return TypeChatActionChoosingContact
2021-12-30 05:55:02 +00:00
}
// The user has started to play a game
2022-03-13 04:04:12 +00:00
type ChatActionStartPlayingGame struct{
meta
2021-12-30 05:55:02 +00:00
}
func (entity *ChatActionStartPlayingGame) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatActionStartPlayingGame
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*ChatActionStartPlayingGame) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatAction
2021-12-30 05:55:02 +00:00
}
func (*ChatActionStartPlayingGame) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatActionStartPlayingGame
2021-12-30 05:55:02 +00:00
}
func (*ChatActionStartPlayingGame) ChatActionType() string {
2022-03-13 04:04:12 +00:00
return TypeChatActionStartPlayingGame
2021-12-30 05:55:02 +00:00
}
// The user is recording a video note
2022-03-13 04:04:12 +00:00
type ChatActionRecordingVideoNote struct{
meta
2021-12-30 05:55:02 +00:00
}
func (entity *ChatActionRecordingVideoNote) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatActionRecordingVideoNote
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*ChatActionRecordingVideoNote) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatAction
2021-12-30 05:55:02 +00:00
}
func (*ChatActionRecordingVideoNote) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatActionRecordingVideoNote
2021-12-30 05:55:02 +00:00
}
func (*ChatActionRecordingVideoNote) ChatActionType() string {
2022-03-13 04:04:12 +00:00
return TypeChatActionRecordingVideoNote
2021-12-30 05:55:02 +00:00
}
// The user is uploading a video note
type ChatActionUploadingVideoNote struct {
2022-03-13 04:04:12 +00:00
meta
// Upload progress, as a percentage
Progress int32 `json:"progress"`
2021-12-30 05:55:02 +00:00
}
func (entity *ChatActionUploadingVideoNote) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatActionUploadingVideoNote
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*ChatActionUploadingVideoNote) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatAction
2021-12-30 05:55:02 +00:00
}
func (*ChatActionUploadingVideoNote) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatActionUploadingVideoNote
2021-12-30 05:55:02 +00:00
}
func (*ChatActionUploadingVideoNote) ChatActionType() string {
2022-03-13 04:04:12 +00:00
return TypeChatActionUploadingVideoNote
2021-12-30 05:55:02 +00:00
}
// The user is watching animations sent by the other party by clicking on an animated emoji
type ChatActionWatchingAnimations struct {
2022-03-13 04:04:12 +00:00
meta
// The animated emoji
Emoji string `json:"emoji"`
2021-12-30 05:55:02 +00:00
}
func (entity *ChatActionWatchingAnimations) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatActionWatchingAnimations
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*ChatActionWatchingAnimations) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatAction
2021-12-30 05:55:02 +00:00
}
func (*ChatActionWatchingAnimations) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatActionWatchingAnimations
2021-12-30 05:55:02 +00:00
}
func (*ChatActionWatchingAnimations) ChatActionType() string {
2022-03-13 04:04:12 +00:00
return TypeChatActionWatchingAnimations
2021-12-30 05:55:02 +00:00
}
// The user has canceled the previous action
2022-03-13 04:04:12 +00:00
type ChatActionCancel struct{
meta
2021-12-30 05:55:02 +00:00
}
func (entity *ChatActionCancel) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatActionCancel
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*ChatActionCancel) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatAction
2021-12-30 05:55:02 +00:00
}
func (*ChatActionCancel) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatActionCancel
2021-12-30 05:55:02 +00:00
}
func (*ChatActionCancel) ChatActionType() string {
2022-03-13 04:04:12 +00:00
return TypeChatActionCancel
2021-12-30 05:55:02 +00:00
}
// The user status was never changed
2022-03-13 04:04:12 +00:00
type UserStatusEmpty struct{
meta
2021-12-30 05:55:02 +00:00
}
func (entity *UserStatusEmpty) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub UserStatusEmpty
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*UserStatusEmpty) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUserStatus
2021-12-30 05:55:02 +00:00
}
func (*UserStatusEmpty) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUserStatusEmpty
2021-12-30 05:55:02 +00:00
}
func (*UserStatusEmpty) UserStatusType() string {
2022-03-13 04:04:12 +00:00
return TypeUserStatusEmpty
2021-12-30 05:55:02 +00:00
}
// The user is online
type UserStatusOnline struct {
2022-03-13 04:04:12 +00:00
meta
// Point in time (Unix timestamp) when the user's online status will expire
Expires int32 `json:"expires"`
2021-12-30 05:55:02 +00:00
}
func (entity *UserStatusOnline) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub UserStatusOnline
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*UserStatusOnline) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUserStatus
2021-12-30 05:55:02 +00:00
}
func (*UserStatusOnline) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUserStatusOnline
2021-12-30 05:55:02 +00:00
}
func (*UserStatusOnline) UserStatusType() string {
2022-03-13 04:04:12 +00:00
return TypeUserStatusOnline
2021-12-30 05:55:02 +00:00
}
// The user is offline
type UserStatusOffline struct {
2022-03-13 04:04:12 +00:00
meta
// Point in time (Unix timestamp) when the user was last online
WasOnline int32 `json:"was_online"`
2021-12-30 05:55:02 +00:00
}
func (entity *UserStatusOffline) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub UserStatusOffline
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*UserStatusOffline) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUserStatus
2021-12-30 05:55:02 +00:00
}
func (*UserStatusOffline) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUserStatusOffline
2021-12-30 05:55:02 +00:00
}
func (*UserStatusOffline) UserStatusType() string {
2022-03-13 04:04:12 +00:00
return TypeUserStatusOffline
2021-12-30 05:55:02 +00:00
}
// The user was online recently
2022-03-13 04:04:12 +00:00
type UserStatusRecently struct{
meta
2021-12-30 05:55:02 +00:00
}
func (entity *UserStatusRecently) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub UserStatusRecently
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*UserStatusRecently) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUserStatus
2021-12-30 05:55:02 +00:00
}
func (*UserStatusRecently) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUserStatusRecently
2021-12-30 05:55:02 +00:00
}
func (*UserStatusRecently) UserStatusType() string {
2022-03-13 04:04:12 +00:00
return TypeUserStatusRecently
2021-12-30 05:55:02 +00:00
}
// The user is offline, but was online last week
2022-03-13 04:04:12 +00:00
type UserStatusLastWeek struct{
meta
2021-12-30 05:55:02 +00:00
}
func (entity *UserStatusLastWeek) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub UserStatusLastWeek
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*UserStatusLastWeek) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUserStatus
2021-12-30 05:55:02 +00:00
}
func (*UserStatusLastWeek) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUserStatusLastWeek
2021-12-30 05:55:02 +00:00
}
func (*UserStatusLastWeek) UserStatusType() string {
2022-03-13 04:04:12 +00:00
return TypeUserStatusLastWeek
2021-12-30 05:55:02 +00:00
}
// The user is offline, but was online last month
2022-03-13 04:04:12 +00:00
type UserStatusLastMonth struct{
meta
2021-12-30 05:55:02 +00:00
}
func (entity *UserStatusLastMonth) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub UserStatusLastMonth
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*UserStatusLastMonth) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUserStatus
2021-12-30 05:55:02 +00:00
}
func (*UserStatusLastMonth) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUserStatusLastMonth
2021-12-30 05:55:02 +00:00
}
func (*UserStatusLastMonth) UserStatusType() string {
2022-03-13 04:04:12 +00:00
return TypeUserStatusLastMonth
2021-12-30 05:55:02 +00:00
}
// Represents a list of stickers
type Stickers struct {
2022-03-13 04:04:12 +00:00
meta
// List of stickers
Stickers []*Sticker `json:"stickers"`
2021-12-30 05:55:02 +00:00
}
func (entity *Stickers) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub Stickers
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*Stickers) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassStickers
2021-12-30 05:55:02 +00:00
}
func (*Stickers) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeStickers
2021-12-30 05:55:02 +00:00
}
// Represents a list of emoji
type Emojis struct {
2022-03-13 04:04:12 +00:00
meta
// List of emojis
Emojis []string `json:"emojis"`
2021-12-30 05:55:02 +00:00
}
func (entity *Emojis) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub Emojis
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*Emojis) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassEmojis
2021-12-30 05:55:02 +00:00
}
func (*Emojis) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeEmojis
2021-12-30 05:55:02 +00:00
}
// Represents a sticker set
type StickerSet struct {
2022-03-13 04:04:12 +00:00
meta
// Identifier of the sticker set
Id JsonInt64 `json:"id"`
// Title of the sticker set
Title string `json:"title"`
// Name of the sticker set
Name string `json:"name"`
// Sticker set thumbnail in WEBP, TGS, or WEBM format with width and height 100; may be null. The file can be downloaded only before the thumbnail is changed
Thumbnail *Thumbnail `json:"thumbnail"`
// Sticker set thumbnail's outline represented as a list of closed vector paths; may be empty. The coordinate system origin is in the upper-left corner
ThumbnailOutline []*ClosedVectorPath `json:"thumbnail_outline"`
// True, if the sticker set has been installed by the current user
IsInstalled bool `json:"is_installed"`
// True, if the sticker set has been archived. A sticker set can't be installed and archived simultaneously
IsArchived bool `json:"is_archived"`
// True, if the sticker set is official
IsOfficial bool `json:"is_official"`
// Type of the stickers in the set
StickerType StickerType `json:"sticker_type"`
// True for already viewed trending sticker sets
IsViewed bool `json:"is_viewed"`
// List of stickers in this set
Stickers []*Sticker `json:"stickers"`
// A list of emoji corresponding to the stickers in the same order. The list is only for informational purposes, because a sticker is always sent with a fixed emoji from the corresponding Sticker object
Emojis []*Emojis `json:"emojis"`
2021-12-30 05:55:02 +00:00
}
func (entity *StickerSet) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub StickerSet
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*StickerSet) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassStickerSet
2021-12-30 05:55:02 +00:00
}
func (*StickerSet) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeStickerSet
2021-12-30 05:55:02 +00:00
}
2022-02-06 18:36:17 +00:00
func (stickerSet *StickerSet) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Id JsonInt64 `json:"id"`
Title string `json:"title"`
Name string `json:"name"`
Thumbnail *Thumbnail `json:"thumbnail"`
ThumbnailOutline []*ClosedVectorPath `json:"thumbnail_outline"`
IsInstalled bool `json:"is_installed"`
IsArchived bool `json:"is_archived"`
IsOfficial bool `json:"is_official"`
StickerType json.RawMessage `json:"sticker_type"`
IsViewed bool `json:"is_viewed"`
Stickers []*Sticker `json:"stickers"`
Emojis []*Emojis `json:"emojis"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
stickerSet.Id = tmp.Id
stickerSet.Title = tmp.Title
stickerSet.Name = tmp.Name
stickerSet.Thumbnail = tmp.Thumbnail
stickerSet.ThumbnailOutline = tmp.ThumbnailOutline
stickerSet.IsInstalled = tmp.IsInstalled
stickerSet.IsArchived = tmp.IsArchived
stickerSet.IsOfficial = tmp.IsOfficial
stickerSet.IsViewed = tmp.IsViewed
stickerSet.Stickers = tmp.Stickers
stickerSet.Emojis = tmp.Emojis
fieldStickerType, _ := UnmarshalStickerType(tmp.StickerType)
stickerSet.StickerType = fieldStickerType
return nil
2022-02-06 18:36:17 +00:00
}
2021-12-30 05:55:02 +00:00
// Represents short information about a sticker set
type StickerSetInfo struct {
2022-03-13 04:04:12 +00:00
meta
// Identifier of the sticker set
Id JsonInt64 `json:"id"`
// Title of the sticker set
Title string `json:"title"`
// Name of the sticker set
Name string `json:"name"`
// Sticker set thumbnail in WEBP, TGS, or WEBM format with width and height 100; may be null
Thumbnail *Thumbnail `json:"thumbnail"`
// Sticker set thumbnail's outline represented as a list of closed vector paths; may be empty. The coordinate system origin is in the upper-left corner
ThumbnailOutline []*ClosedVectorPath `json:"thumbnail_outline"`
// True, if the sticker set has been installed by the current user
IsInstalled bool `json:"is_installed"`
// True, if the sticker set has been archived. A sticker set can't be installed and archived simultaneously
IsArchived bool `json:"is_archived"`
// True, if the sticker set is official
IsOfficial bool `json:"is_official"`
// Type of the stickers in the set
StickerType StickerType `json:"sticker_type"`
// True for already viewed trending sticker sets
IsViewed bool `json:"is_viewed"`
// Total number of stickers in the set
Size int32 `json:"size"`
// Up to the first 5 stickers from the set, depending on the context. If the application needs more stickers the full sticker set needs to be requested
Covers []*Sticker `json:"covers"`
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *StickerSetInfo) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub StickerSetInfo
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*StickerSetInfo) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassStickerSetInfo
2021-12-30 05:55:02 +00:00
}
func (*StickerSetInfo) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeStickerSetInfo
2021-12-30 05:55:02 +00:00
}
2022-02-06 18:36:17 +00:00
func (stickerSetInfo *StickerSetInfo) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Id JsonInt64 `json:"id"`
Title string `json:"title"`
Name string `json:"name"`
Thumbnail *Thumbnail `json:"thumbnail"`
ThumbnailOutline []*ClosedVectorPath `json:"thumbnail_outline"`
IsInstalled bool `json:"is_installed"`
IsArchived bool `json:"is_archived"`
IsOfficial bool `json:"is_official"`
StickerType json.RawMessage `json:"sticker_type"`
IsViewed bool `json:"is_viewed"`
Size int32 `json:"size"`
Covers []*Sticker `json:"covers"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
stickerSetInfo.Id = tmp.Id
stickerSetInfo.Title = tmp.Title
stickerSetInfo.Name = tmp.Name
stickerSetInfo.Thumbnail = tmp.Thumbnail
stickerSetInfo.ThumbnailOutline = tmp.ThumbnailOutline
stickerSetInfo.IsInstalled = tmp.IsInstalled
stickerSetInfo.IsArchived = tmp.IsArchived
stickerSetInfo.IsOfficial = tmp.IsOfficial
stickerSetInfo.IsViewed = tmp.IsViewed
stickerSetInfo.Size = tmp.Size
stickerSetInfo.Covers = tmp.Covers
fieldStickerType, _ := UnmarshalStickerType(tmp.StickerType)
stickerSetInfo.StickerType = fieldStickerType
return nil
2022-02-06 18:36:17 +00:00
}
2021-12-30 05:55:02 +00:00
// Represents a list of sticker sets
type StickerSets struct {
2022-03-13 04:04:12 +00:00
meta
// Approximate total number of sticker sets found
TotalCount int32 `json:"total_count"`
// List of sticker sets
Sets []*StickerSetInfo `json:"sets"`
2021-12-30 05:55:02 +00:00
}
func (entity *StickerSets) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub StickerSets
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*StickerSets) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassStickerSets
2021-12-30 05:55:02 +00:00
}
func (*StickerSets) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeStickerSets
2021-12-30 05:55:02 +00:00
}
// The call wasn't discarded, or the reason is unknown
2022-03-13 04:04:12 +00:00
type CallDiscardReasonEmpty struct{
meta
2021-12-30 05:55:02 +00:00
}
func (entity *CallDiscardReasonEmpty) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub CallDiscardReasonEmpty
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*CallDiscardReasonEmpty) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassCallDiscardReason
2021-12-30 05:55:02 +00:00
}
func (*CallDiscardReasonEmpty) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeCallDiscardReasonEmpty
2021-12-30 05:55:02 +00:00
}
func (*CallDiscardReasonEmpty) CallDiscardReasonType() string {
2022-03-13 04:04:12 +00:00
return TypeCallDiscardReasonEmpty
2021-12-30 05:55:02 +00:00
}
// The call was ended before the conversation started. It was canceled by the caller or missed by the other party
2022-03-13 04:04:12 +00:00
type CallDiscardReasonMissed struct{
meta
2021-12-30 05:55:02 +00:00
}
func (entity *CallDiscardReasonMissed) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub CallDiscardReasonMissed
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*CallDiscardReasonMissed) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassCallDiscardReason
2021-12-30 05:55:02 +00:00
}
func (*CallDiscardReasonMissed) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeCallDiscardReasonMissed
2021-12-30 05:55:02 +00:00
}
func (*CallDiscardReasonMissed) CallDiscardReasonType() string {
2022-03-13 04:04:12 +00:00
return TypeCallDiscardReasonMissed
2021-12-30 05:55:02 +00:00
}
// The call was ended before the conversation started. It was declined by the other party
2022-03-13 04:04:12 +00:00
type CallDiscardReasonDeclined struct{
meta
2021-12-30 05:55:02 +00:00
}
func (entity *CallDiscardReasonDeclined) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub CallDiscardReasonDeclined
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*CallDiscardReasonDeclined) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassCallDiscardReason
2021-12-30 05:55:02 +00:00
}
func (*CallDiscardReasonDeclined) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeCallDiscardReasonDeclined
2021-12-30 05:55:02 +00:00
}
func (*CallDiscardReasonDeclined) CallDiscardReasonType() string {
2022-03-13 04:04:12 +00:00
return TypeCallDiscardReasonDeclined
2021-12-30 05:55:02 +00:00
}
// The call was ended during the conversation because the users were disconnected
2022-03-13 04:04:12 +00:00
type CallDiscardReasonDisconnected struct{
meta
2021-12-30 05:55:02 +00:00
}
func (entity *CallDiscardReasonDisconnected) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub CallDiscardReasonDisconnected
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*CallDiscardReasonDisconnected) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassCallDiscardReason
2021-12-30 05:55:02 +00:00
}
func (*CallDiscardReasonDisconnected) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeCallDiscardReasonDisconnected
2021-12-30 05:55:02 +00:00
}
func (*CallDiscardReasonDisconnected) CallDiscardReasonType() string {
2022-03-13 04:04:12 +00:00
return TypeCallDiscardReasonDisconnected
2021-12-30 05:55:02 +00:00
}
// The call was ended because one of the parties hung up
2022-03-13 04:04:12 +00:00
type CallDiscardReasonHungUp struct{
meta
2021-12-30 05:55:02 +00:00
}
func (entity *CallDiscardReasonHungUp) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub CallDiscardReasonHungUp
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*CallDiscardReasonHungUp) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassCallDiscardReason
2021-12-30 05:55:02 +00:00
}
func (*CallDiscardReasonHungUp) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeCallDiscardReasonHungUp
2021-12-30 05:55:02 +00:00
}
func (*CallDiscardReasonHungUp) CallDiscardReasonType() string {
2022-03-13 04:04:12 +00:00
return TypeCallDiscardReasonHungUp
2021-12-30 05:55:02 +00:00
}
// Specifies the supported call protocols
type CallProtocol struct {
2022-03-13 04:04:12 +00:00
meta
// True, if UDP peer-to-peer connections are supported
UdpP2p bool `json:"udp_p2p"`
// True, if connection through UDP reflectors is supported
UdpReflector bool `json:"udp_reflector"`
// The minimum supported API layer; use 65
MinLayer int32 `json:"min_layer"`
// The maximum supported API layer; use 65
MaxLayer int32 `json:"max_layer"`
// List of supported tgcalls versions
LibraryVersions []string `json:"library_versions"`
2021-12-30 05:55:02 +00:00
}
func (entity *CallProtocol) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub CallProtocol
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*CallProtocol) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassCallProtocol
2021-12-30 05:55:02 +00:00
}
func (*CallProtocol) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeCallProtocol
2021-12-30 05:55:02 +00:00
}
// A Telegram call reflector
type CallServerTypeTelegramReflector struct {
2022-03-13 04:04:12 +00:00
meta
// A peer tag to be used with the reflector
PeerTag []byte `json:"peer_tag"`
2021-12-30 05:55:02 +00:00
}
func (entity *CallServerTypeTelegramReflector) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub CallServerTypeTelegramReflector
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*CallServerTypeTelegramReflector) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassCallServerType
2021-12-30 05:55:02 +00:00
}
func (*CallServerTypeTelegramReflector) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeCallServerTypeTelegramReflector
2021-12-30 05:55:02 +00:00
}
func (*CallServerTypeTelegramReflector) CallServerTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeCallServerTypeTelegramReflector
2021-12-30 05:55:02 +00:00
}
// A WebRTC server
type CallServerTypeWebrtc struct {
2022-03-13 04:04:12 +00:00
meta
// Username to be used for authentication
Username string `json:"username"`
// Authentication password
Password string `json:"password"`
// True, if the server supports TURN
SupportsTurn bool `json:"supports_turn"`
// True, if the server supports STUN
SupportsStun bool `json:"supports_stun"`
2021-12-30 05:55:02 +00:00
}
func (entity *CallServerTypeWebrtc) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub CallServerTypeWebrtc
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*CallServerTypeWebrtc) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassCallServerType
2021-12-30 05:55:02 +00:00
}
func (*CallServerTypeWebrtc) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeCallServerTypeWebrtc
2021-12-30 05:55:02 +00:00
}
func (*CallServerTypeWebrtc) CallServerTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeCallServerTypeWebrtc
2021-12-30 05:55:02 +00:00
}
// Describes a server for relaying call data
type CallServer struct {
2022-03-13 04:04:12 +00:00
meta
// Server identifier
Id JsonInt64 `json:"id"`
// Server IPv4 address
IpAddress string `json:"ip_address"`
// Server IPv6 address
Ipv6Address string `json:"ipv6_address"`
// Server port number
Port int32 `json:"port"`
// Server type
Type CallServerType `json:"type"`
2021-12-30 05:55:02 +00:00
}
func (entity *CallServer) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub CallServer
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*CallServer) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassCallServer
2021-12-30 05:55:02 +00:00
}
func (*CallServer) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeCallServer
2021-12-30 05:55:02 +00:00
}
func (callServer *CallServer) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Id JsonInt64 `json:"id"`
IpAddress string `json:"ip_address"`
Ipv6Address string `json:"ipv6_address"`
Port int32 `json:"port"`
Type json.RawMessage `json:"type"`
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
callServer.Id = tmp.Id
callServer.IpAddress = tmp.IpAddress
callServer.Ipv6Address = tmp.Ipv6Address
callServer.Port = tmp.Port
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
fieldType, _ := UnmarshalCallServerType(tmp.Type)
callServer.Type = fieldType
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return nil
2021-12-30 05:55:02 +00:00
}
// Contains the call identifier
type CallId struct {
2022-03-13 04:04:12 +00:00
meta
// Call identifier
Id int32 `json:"id"`
2021-12-30 05:55:02 +00:00
}
func (entity *CallId) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub CallId
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*CallId) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassCallId
2021-12-30 05:55:02 +00:00
}
func (*CallId) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeCallId
2021-12-30 05:55:02 +00:00
}
// Contains the group call identifier
type GroupCallId struct {
2022-03-13 04:04:12 +00:00
meta
// Group call identifier
Id int32 `json:"id"`
2021-12-30 05:55:02 +00:00
}
func (entity *GroupCallId) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub GroupCallId
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*GroupCallId) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassGroupCallId
2021-12-30 05:55:02 +00:00
}
func (*GroupCallId) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeGroupCallId
2021-12-30 05:55:02 +00:00
}
// The call is pending, waiting to be accepted by a user
type CallStatePending struct {
2022-03-13 04:04:12 +00:00
meta
// True, if the call has already been created by the server
IsCreated bool `json:"is_created"`
// True, if the call has already been received by the other party
IsReceived bool `json:"is_received"`
2021-12-30 05:55:02 +00:00
}
func (entity *CallStatePending) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub CallStatePending
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*CallStatePending) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassCallState
2021-12-30 05:55:02 +00:00
}
func (*CallStatePending) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeCallStatePending
2021-12-30 05:55:02 +00:00
}
func (*CallStatePending) CallStateType() string {
2022-03-13 04:04:12 +00:00
return TypeCallStatePending
2021-12-30 05:55:02 +00:00
}
// The call has been answered and encryption keys are being exchanged
2022-03-13 04:04:12 +00:00
type CallStateExchangingKeys struct{
meta
2021-12-30 05:55:02 +00:00
}
func (entity *CallStateExchangingKeys) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub CallStateExchangingKeys
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*CallStateExchangingKeys) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassCallState
2021-12-30 05:55:02 +00:00
}
func (*CallStateExchangingKeys) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeCallStateExchangingKeys
2021-12-30 05:55:02 +00:00
}
func (*CallStateExchangingKeys) CallStateType() string {
2022-03-13 04:04:12 +00:00
return TypeCallStateExchangingKeys
2021-12-30 05:55:02 +00:00
}
// The call is ready to use
type CallStateReady struct {
2022-03-13 04:04:12 +00:00
meta
// Call protocols supported by the peer
Protocol *CallProtocol `json:"protocol"`
// List of available call servers
Servers []*CallServer `json:"servers"`
// A JSON-encoded call config
Config string `json:"config"`
// Call encryption key
EncryptionKey []byte `json:"encryption_key"`
// Encryption key emojis fingerprint
Emojis []string `json:"emojis"`
// True, if peer-to-peer connection is allowed by users privacy settings
AllowP2p bool `json:"allow_p2p"`
2021-12-30 05:55:02 +00:00
}
func (entity *CallStateReady) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub CallStateReady
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*CallStateReady) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassCallState
2021-12-30 05:55:02 +00:00
}
func (*CallStateReady) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeCallStateReady
2021-12-30 05:55:02 +00:00
}
func (*CallStateReady) CallStateType() string {
2022-03-13 04:04:12 +00:00
return TypeCallStateReady
2021-12-30 05:55:02 +00:00
}
// The call is hanging up after discardCall has been called
2022-03-13 04:04:12 +00:00
type CallStateHangingUp struct{
meta
2021-12-30 05:55:02 +00:00
}
func (entity *CallStateHangingUp) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub CallStateHangingUp
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*CallStateHangingUp) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassCallState
2021-12-30 05:55:02 +00:00
}
func (*CallStateHangingUp) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeCallStateHangingUp
2021-12-30 05:55:02 +00:00
}
func (*CallStateHangingUp) CallStateType() string {
2022-03-13 04:04:12 +00:00
return TypeCallStateHangingUp
2021-12-30 05:55:02 +00:00
}
// The call has ended successfully
type CallStateDiscarded struct {
2022-03-13 04:04:12 +00:00
meta
// The reason, why the call has ended
Reason CallDiscardReason `json:"reason"`
// True, if the call rating must be sent to the server
NeedRating bool `json:"need_rating"`
// True, if the call debug information must be sent to the server
NeedDebugInformation bool `json:"need_debug_information"`
2021-12-30 05:55:02 +00:00
}
func (entity *CallStateDiscarded) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub CallStateDiscarded
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*CallStateDiscarded) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassCallState
2021-12-30 05:55:02 +00:00
}
func (*CallStateDiscarded) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeCallStateDiscarded
2021-12-30 05:55:02 +00:00
}
func (*CallStateDiscarded) CallStateType() string {
2022-03-13 04:04:12 +00:00
return TypeCallStateDiscarded
2021-12-30 05:55:02 +00:00
}
func (callStateDiscarded *CallStateDiscarded) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Reason json.RawMessage `json:"reason"`
NeedRating bool `json:"need_rating"`
NeedDebugInformation bool `json:"need_debug_information"`
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
callStateDiscarded.NeedRating = tmp.NeedRating
callStateDiscarded.NeedDebugInformation = tmp.NeedDebugInformation
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
fieldReason, _ := UnmarshalCallDiscardReason(tmp.Reason)
callStateDiscarded.Reason = fieldReason
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return nil
2021-12-30 05:55:02 +00:00
}
// The call has ended with an error
type CallStateError struct {
2022-03-13 04:04:12 +00:00
meta
// Error. An error with the code 4005000 will be returned if an outgoing call is missed because of an expired timeout
Error *Error `json:"error"`
2021-12-30 05:55:02 +00:00
}
func (entity *CallStateError) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub CallStateError
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*CallStateError) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassCallState
2021-12-30 05:55:02 +00:00
}
func (*CallStateError) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeCallStateError
2021-12-30 05:55:02 +00:00
}
func (*CallStateError) CallStateType() string {
2022-03-13 04:04:12 +00:00
return TypeCallStateError
2021-12-30 05:55:02 +00:00
}
// The worst available video quality
2022-03-13 04:04:12 +00:00
type GroupCallVideoQualityThumbnail struct{
meta
2021-12-30 05:55:02 +00:00
}
func (entity *GroupCallVideoQualityThumbnail) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub GroupCallVideoQualityThumbnail
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*GroupCallVideoQualityThumbnail) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassGroupCallVideoQuality
2021-12-30 05:55:02 +00:00
}
func (*GroupCallVideoQualityThumbnail) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeGroupCallVideoQualityThumbnail
2021-12-30 05:55:02 +00:00
}
func (*GroupCallVideoQualityThumbnail) GroupCallVideoQualityType() string {
2022-03-13 04:04:12 +00:00
return TypeGroupCallVideoQualityThumbnail
2021-12-30 05:55:02 +00:00
}
// The medium video quality
2022-03-13 04:04:12 +00:00
type GroupCallVideoQualityMedium struct{
meta
2021-12-30 05:55:02 +00:00
}
func (entity *GroupCallVideoQualityMedium) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub GroupCallVideoQualityMedium
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*GroupCallVideoQualityMedium) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassGroupCallVideoQuality
2021-12-30 05:55:02 +00:00
}
func (*GroupCallVideoQualityMedium) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeGroupCallVideoQualityMedium
2021-12-30 05:55:02 +00:00
}
func (*GroupCallVideoQualityMedium) GroupCallVideoQualityType() string {
2022-03-13 04:04:12 +00:00
return TypeGroupCallVideoQualityMedium
2021-12-30 05:55:02 +00:00
}
// The best available video quality
2022-03-13 04:04:12 +00:00
type GroupCallVideoQualityFull struct{
meta
2021-12-30 05:55:02 +00:00
}
func (entity *GroupCallVideoQualityFull) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub GroupCallVideoQualityFull
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*GroupCallVideoQualityFull) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassGroupCallVideoQuality
2021-12-30 05:55:02 +00:00
}
func (*GroupCallVideoQualityFull) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeGroupCallVideoQualityFull
2021-12-30 05:55:02 +00:00
}
func (*GroupCallVideoQualityFull) GroupCallVideoQualityType() string {
2022-03-13 04:04:12 +00:00
return TypeGroupCallVideoQualityFull
}
// Describes an available stream in a group call
type GroupCallStream struct {
meta
// Identifier of an audio/video channel
ChannelId int32 `json:"channel_id"`
// Scale of segment durations in the stream. The duration is 1000/(2**scale) milliseconds
Scale int32 `json:"scale"`
// Point in time when the stream currently ends; Unix timestamp in milliseconds
TimeOffset int64 `json:"time_offset"`
}
func (entity *GroupCallStream) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub GroupCallStream
return json.Marshal((*stub)(entity))
}
func (*GroupCallStream) GetClass() string {
return ClassGroupCallStream
}
func (*GroupCallStream) GetType() string {
return TypeGroupCallStream
}
// Represents a list of group call streams
type GroupCallStreams struct {
meta
// A list of group call streams
Streams []*GroupCallStream `json:"streams"`
}
func (entity *GroupCallStreams) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub GroupCallStreams
return json.Marshal((*stub)(entity))
}
func (*GroupCallStreams) GetClass() string {
return ClassGroupCallStreams
}
func (*GroupCallStreams) GetType() string {
return TypeGroupCallStreams
}
// Represents an RTMP url
type RtmpUrl struct {
meta
// The URL
Url string `json:"url"`
// Stream key
StreamKey string `json:"stream_key"`
}
func (entity *RtmpUrl) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub RtmpUrl
return json.Marshal((*stub)(entity))
}
func (*RtmpUrl) GetClass() string {
return ClassRtmpUrl
}
func (*RtmpUrl) GetType() string {
return TypeRtmpUrl
2021-12-30 05:55:02 +00:00
}
// Describes a recently speaking participant in a group call
type GroupCallRecentSpeaker struct {
2022-03-13 04:04:12 +00:00
meta
// Group call participant identifier
ParticipantId MessageSender `json:"participant_id"`
// True, is the user has spoken recently
IsSpeaking bool `json:"is_speaking"`
2021-12-30 05:55:02 +00:00
}
func (entity *GroupCallRecentSpeaker) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub GroupCallRecentSpeaker
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*GroupCallRecentSpeaker) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassGroupCallRecentSpeaker
2021-12-30 05:55:02 +00:00
}
func (*GroupCallRecentSpeaker) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeGroupCallRecentSpeaker
2021-12-30 05:55:02 +00:00
}
func (groupCallRecentSpeaker *GroupCallRecentSpeaker) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
ParticipantId json.RawMessage `json:"participant_id"`
IsSpeaking bool `json:"is_speaking"`
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
groupCallRecentSpeaker.IsSpeaking = tmp.IsSpeaking
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
fieldParticipantId, _ := UnmarshalMessageSender(tmp.ParticipantId)
groupCallRecentSpeaker.ParticipantId = fieldParticipantId
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return nil
2021-12-30 05:55:02 +00:00
}
// Describes a group call
type GroupCall struct {
2022-03-13 04:04:12 +00:00
meta
// Group call identifier
Id int32 `json:"id"`
// Group call title
Title string `json:"title"`
// Point in time (Unix timestamp) when the group call is supposed to be started by an administrator; 0 if it is already active or was ended
ScheduledStartDate int32 `json:"scheduled_start_date"`
// True, if the group call is scheduled and the current user will receive a notification when the group call will start
EnabledStartNotification bool `json:"enabled_start_notification"`
// True, if the call is active
IsActive bool `json:"is_active"`
// True, if the chat is an RTMP stream instead of an ordinary video chat
IsRtmpStream bool `json:"is_rtmp_stream"`
// True, if the call is joined
IsJoined bool `json:"is_joined"`
// True, if user was kicked from the call because of network loss and the call needs to be rejoined
NeedRejoin bool `json:"need_rejoin"`
// True, if the current user can manage the group call
CanBeManaged bool `json:"can_be_managed"`
// Number of participants in the group call
ParticipantCount int32 `json:"participant_count"`
// True, if group call participants, which are muted, aren't returned in participant list
HasHiddenListeners bool `json:"has_hidden_listeners"`
// True, if all group call participants are loaded
LoadedAllParticipants bool `json:"loaded_all_participants"`
// At most 3 recently speaking users in the group call
RecentSpeakers []*GroupCallRecentSpeaker `json:"recent_speakers"`
// True, if the current user's video is enabled
IsMyVideoEnabled bool `json:"is_my_video_enabled"`
// True, if the current user's video is paused
IsMyVideoPaused bool `json:"is_my_video_paused"`
// True, if the current user can broadcast video or share screen
CanEnableVideo bool `json:"can_enable_video"`
// True, if only group call administrators can unmute new participants
MuteNewParticipants bool `json:"mute_new_participants"`
// True, if the current user can enable or disable mute_new_participants setting
CanToggleMuteNewParticipants bool `json:"can_toggle_mute_new_participants"`
// Duration of the ongoing group call recording, in seconds; 0 if none. An updateGroupCall update is not triggered when value of this field changes, but the same recording goes on
RecordDuration int32 `json:"record_duration"`
// True, if a video file is being recorded for the call
IsVideoRecorded bool `json:"is_video_recorded"`
// Call duration, in seconds; for ended calls only
Duration int32 `json:"duration"`
2021-12-30 05:55:02 +00:00
}
func (entity *GroupCall) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub GroupCall
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*GroupCall) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassGroupCall
2021-12-30 05:55:02 +00:00
}
func (*GroupCall) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeGroupCall
2021-12-30 05:55:02 +00:00
}
// Describes a group of video synchronization source identifiers
type GroupCallVideoSourceGroup struct {
2022-03-13 04:04:12 +00:00
meta
// The semantics of sources, one of "SIM" or "FID"
Semantics string `json:"semantics"`
// The list of synchronization source identifiers
SourceIds []int32 `json:"source_ids"`
2021-12-30 05:55:02 +00:00
}
func (entity *GroupCallVideoSourceGroup) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub GroupCallVideoSourceGroup
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*GroupCallVideoSourceGroup) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassGroupCallVideoSourceGroup
2021-12-30 05:55:02 +00:00
}
func (*GroupCallVideoSourceGroup) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeGroupCallVideoSourceGroup
2021-12-30 05:55:02 +00:00
}
// Contains information about a group call participant's video channel
type GroupCallParticipantVideoInfo struct {
2022-03-13 04:04:12 +00:00
meta
// List of synchronization source groups of the video
SourceGroups []*GroupCallVideoSourceGroup `json:"source_groups"`
// Video channel endpoint identifier
EndpointId string `json:"endpoint_id"`
// True if the video is paused. This flag needs to be ignored, if new video frames are received
IsPaused bool `json:"is_paused"`
2021-12-30 05:55:02 +00:00
}
func (entity *GroupCallParticipantVideoInfo) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub GroupCallParticipantVideoInfo
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*GroupCallParticipantVideoInfo) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassGroupCallParticipantVideoInfo
2021-12-30 05:55:02 +00:00
}
func (*GroupCallParticipantVideoInfo) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeGroupCallParticipantVideoInfo
2021-12-30 05:55:02 +00:00
}
// Represents a group call participant
type GroupCallParticipant struct {
2022-03-13 04:04:12 +00:00
meta
// Identifier of the group call participant
ParticipantId MessageSender `json:"participant_id"`
// User's audio channel synchronization source identifier
AudioSourceId int32 `json:"audio_source_id"`
// User's screen sharing audio channel synchronization source identifier
ScreenSharingAudioSourceId int32 `json:"screen_sharing_audio_source_id"`
// Information about user's video channel; may be null if there is no active video
VideoInfo *GroupCallParticipantVideoInfo `json:"video_info"`
// Information about user's screen sharing video channel; may be null if there is no active screen sharing video
ScreenSharingVideoInfo *GroupCallParticipantVideoInfo `json:"screen_sharing_video_info"`
// The participant user's bio or the participant chat's description
Bio string `json:"bio"`
// True, if the participant is the current user
IsCurrentUser bool `json:"is_current_user"`
// True, if the participant is speaking as set by setGroupCallParticipantIsSpeaking
IsSpeaking bool `json:"is_speaking"`
// True, if the participant hand is raised
IsHandRaised bool `json:"is_hand_raised"`
// True, if the current user can mute the participant for all other group call participants
CanBeMutedForAllUsers bool `json:"can_be_muted_for_all_users"`
// True, if the current user can allow the participant to unmute themselves or unmute the participant (if the participant is the current user)
CanBeUnmutedForAllUsers bool `json:"can_be_unmuted_for_all_users"`
// True, if the current user can mute the participant only for self
CanBeMutedForCurrentUser bool `json:"can_be_muted_for_current_user"`
// True, if the current user can unmute the participant for self
CanBeUnmutedForCurrentUser bool `json:"can_be_unmuted_for_current_user"`
// True, if the participant is muted for all users
IsMutedForAllUsers bool `json:"is_muted_for_all_users"`
// True, if the participant is muted for the current user
IsMutedForCurrentUser bool `json:"is_muted_for_current_user"`
// True, if the participant is muted for all users, but can unmute themselves
CanUnmuteSelf bool `json:"can_unmute_self"`
// Participant's volume level; 1-20000 in hundreds of percents
VolumeLevel int32 `json:"volume_level"`
// User's order in the group call participant list. Orders must be compared lexicographically. The bigger is order, the higher is user in the list. If order is empty, the user must be removed from the participant list
Order string `json:"order"`
2021-12-30 05:55:02 +00:00
}
func (entity *GroupCallParticipant) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub GroupCallParticipant
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*GroupCallParticipant) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassGroupCallParticipant
2021-12-30 05:55:02 +00:00
}
func (*GroupCallParticipant) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeGroupCallParticipant
2021-12-30 05:55:02 +00:00
}
func (groupCallParticipant *GroupCallParticipant) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
ParticipantId json.RawMessage `json:"participant_id"`
AudioSourceId int32 `json:"audio_source_id"`
ScreenSharingAudioSourceId int32 `json:"screen_sharing_audio_source_id"`
VideoInfo *GroupCallParticipantVideoInfo `json:"video_info"`
ScreenSharingVideoInfo *GroupCallParticipantVideoInfo `json:"screen_sharing_video_info"`
Bio string `json:"bio"`
IsCurrentUser bool `json:"is_current_user"`
IsSpeaking bool `json:"is_speaking"`
IsHandRaised bool `json:"is_hand_raised"`
CanBeMutedForAllUsers bool `json:"can_be_muted_for_all_users"`
CanBeUnmutedForAllUsers bool `json:"can_be_unmuted_for_all_users"`
CanBeMutedForCurrentUser bool `json:"can_be_muted_for_current_user"`
CanBeUnmutedForCurrentUser bool `json:"can_be_unmuted_for_current_user"`
IsMutedForAllUsers bool `json:"is_muted_for_all_users"`
IsMutedForCurrentUser bool `json:"is_muted_for_current_user"`
CanUnmuteSelf bool `json:"can_unmute_self"`
VolumeLevel int32 `json:"volume_level"`
Order string `json:"order"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
groupCallParticipant.AudioSourceId = tmp.AudioSourceId
groupCallParticipant.ScreenSharingAudioSourceId = tmp.ScreenSharingAudioSourceId
groupCallParticipant.VideoInfo = tmp.VideoInfo
groupCallParticipant.ScreenSharingVideoInfo = tmp.ScreenSharingVideoInfo
groupCallParticipant.Bio = tmp.Bio
groupCallParticipant.IsCurrentUser = tmp.IsCurrentUser
groupCallParticipant.IsSpeaking = tmp.IsSpeaking
groupCallParticipant.IsHandRaised = tmp.IsHandRaised
groupCallParticipant.CanBeMutedForAllUsers = tmp.CanBeMutedForAllUsers
groupCallParticipant.CanBeUnmutedForAllUsers = tmp.CanBeUnmutedForAllUsers
groupCallParticipant.CanBeMutedForCurrentUser = tmp.CanBeMutedForCurrentUser
groupCallParticipant.CanBeUnmutedForCurrentUser = tmp.CanBeUnmutedForCurrentUser
groupCallParticipant.IsMutedForAllUsers = tmp.IsMutedForAllUsers
groupCallParticipant.IsMutedForCurrentUser = tmp.IsMutedForCurrentUser
groupCallParticipant.CanUnmuteSelf = tmp.CanUnmuteSelf
groupCallParticipant.VolumeLevel = tmp.VolumeLevel
groupCallParticipant.Order = tmp.Order
fieldParticipantId, _ := UnmarshalMessageSender(tmp.ParticipantId)
groupCallParticipant.ParticipantId = fieldParticipantId
return nil
2021-12-30 05:55:02 +00:00
}
// The user heard their own voice
2022-03-13 04:04:12 +00:00
type CallProblemEcho struct{
meta
2021-12-30 05:55:02 +00:00
}
func (entity *CallProblemEcho) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub CallProblemEcho
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*CallProblemEcho) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassCallProblem
2021-12-30 05:55:02 +00:00
}
func (*CallProblemEcho) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeCallProblemEcho
2021-12-30 05:55:02 +00:00
}
func (*CallProblemEcho) CallProblemType() string {
2022-03-13 04:04:12 +00:00
return TypeCallProblemEcho
2021-12-30 05:55:02 +00:00
}
// The user heard background noise
2022-03-13 04:04:12 +00:00
type CallProblemNoise struct{
meta
2021-12-30 05:55:02 +00:00
}
func (entity *CallProblemNoise) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub CallProblemNoise
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*CallProblemNoise) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassCallProblem
2021-12-30 05:55:02 +00:00
}
func (*CallProblemNoise) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeCallProblemNoise
2021-12-30 05:55:02 +00:00
}
func (*CallProblemNoise) CallProblemType() string {
2022-03-13 04:04:12 +00:00
return TypeCallProblemNoise
2021-12-30 05:55:02 +00:00
}
// The other side kept disappearing
2022-03-13 04:04:12 +00:00
type CallProblemInterruptions struct{
meta
2021-12-30 05:55:02 +00:00
}
func (entity *CallProblemInterruptions) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub CallProblemInterruptions
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*CallProblemInterruptions) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassCallProblem
2021-12-30 05:55:02 +00:00
}
func (*CallProblemInterruptions) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeCallProblemInterruptions
2021-12-30 05:55:02 +00:00
}
func (*CallProblemInterruptions) CallProblemType() string {
2022-03-13 04:04:12 +00:00
return TypeCallProblemInterruptions
2021-12-30 05:55:02 +00:00
}
// The speech was distorted
2022-03-13 04:04:12 +00:00
type CallProblemDistortedSpeech struct{
meta
2021-12-30 05:55:02 +00:00
}
func (entity *CallProblemDistortedSpeech) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub CallProblemDistortedSpeech
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*CallProblemDistortedSpeech) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassCallProblem
2021-12-30 05:55:02 +00:00
}
func (*CallProblemDistortedSpeech) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeCallProblemDistortedSpeech
2021-12-30 05:55:02 +00:00
}
func (*CallProblemDistortedSpeech) CallProblemType() string {
2022-03-13 04:04:12 +00:00
return TypeCallProblemDistortedSpeech
2021-12-30 05:55:02 +00:00
}
// The user couldn't hear the other side
2022-03-13 04:04:12 +00:00
type CallProblemSilentLocal struct{
meta
2021-12-30 05:55:02 +00:00
}
func (entity *CallProblemSilentLocal) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub CallProblemSilentLocal
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*CallProblemSilentLocal) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassCallProblem
2021-12-30 05:55:02 +00:00
}
func (*CallProblemSilentLocal) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeCallProblemSilentLocal
2021-12-30 05:55:02 +00:00
}
func (*CallProblemSilentLocal) CallProblemType() string {
2022-03-13 04:04:12 +00:00
return TypeCallProblemSilentLocal
2021-12-30 05:55:02 +00:00
}
// The other side couldn't hear the user
2022-03-13 04:04:12 +00:00
type CallProblemSilentRemote struct{
meta
2021-12-30 05:55:02 +00:00
}
func (entity *CallProblemSilentRemote) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub CallProblemSilentRemote
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*CallProblemSilentRemote) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassCallProblem
2021-12-30 05:55:02 +00:00
}
func (*CallProblemSilentRemote) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeCallProblemSilentRemote
2021-12-30 05:55:02 +00:00
}
func (*CallProblemSilentRemote) CallProblemType() string {
2022-03-13 04:04:12 +00:00
return TypeCallProblemSilentRemote
2021-12-30 05:55:02 +00:00
}
// The call ended unexpectedly
2022-03-13 04:04:12 +00:00
type CallProblemDropped struct{
meta
2021-12-30 05:55:02 +00:00
}
func (entity *CallProblemDropped) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub CallProblemDropped
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*CallProblemDropped) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassCallProblem
2021-12-30 05:55:02 +00:00
}
func (*CallProblemDropped) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeCallProblemDropped
2021-12-30 05:55:02 +00:00
}
func (*CallProblemDropped) CallProblemType() string {
2022-03-13 04:04:12 +00:00
return TypeCallProblemDropped
2021-12-30 05:55:02 +00:00
}
// The video was distorted
2022-03-13 04:04:12 +00:00
type CallProblemDistortedVideo struct{
meta
2021-12-30 05:55:02 +00:00
}
func (entity *CallProblemDistortedVideo) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub CallProblemDistortedVideo
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*CallProblemDistortedVideo) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassCallProblem
2021-12-30 05:55:02 +00:00
}
func (*CallProblemDistortedVideo) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeCallProblemDistortedVideo
2021-12-30 05:55:02 +00:00
}
func (*CallProblemDistortedVideo) CallProblemType() string {
2022-03-13 04:04:12 +00:00
return TypeCallProblemDistortedVideo
2021-12-30 05:55:02 +00:00
}
// The video was pixelated
2022-03-13 04:04:12 +00:00
type CallProblemPixelatedVideo struct{
meta
2021-12-30 05:55:02 +00:00
}
func (entity *CallProblemPixelatedVideo) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub CallProblemPixelatedVideo
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*CallProblemPixelatedVideo) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassCallProblem
2021-12-30 05:55:02 +00:00
}
func (*CallProblemPixelatedVideo) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeCallProblemPixelatedVideo
2021-12-30 05:55:02 +00:00
}
func (*CallProblemPixelatedVideo) CallProblemType() string {
2022-03-13 04:04:12 +00:00
return TypeCallProblemPixelatedVideo
2021-12-30 05:55:02 +00:00
}
// Describes a call
type Call struct {
2022-03-13 04:04:12 +00:00
meta
// Call identifier, not persistent
Id int32 `json:"id"`
// Peer user identifier
UserId int64 `json:"user_id"`
// True, if the call is outgoing
IsOutgoing bool `json:"is_outgoing"`
// True, if the call is a video call
IsVideo bool `json:"is_video"`
// Call state
State CallState `json:"state"`
2021-12-30 05:55:02 +00:00
}
func (entity *Call) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub Call
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*Call) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassCall
2021-12-30 05:55:02 +00:00
}
func (*Call) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeCall
2021-12-30 05:55:02 +00:00
}
func (call *Call) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Id int32 `json:"id"`
UserId int64 `json:"user_id"`
IsOutgoing bool `json:"is_outgoing"`
IsVideo bool `json:"is_video"`
State json.RawMessage `json:"state"`
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
call.Id = tmp.Id
call.UserId = tmp.UserId
call.IsOutgoing = tmp.IsOutgoing
call.IsVideo = tmp.IsVideo
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
fieldState, _ := UnmarshalCallState(tmp.State)
call.State = fieldState
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return nil
2021-12-30 05:55:02 +00:00
}
// Contains settings for the authentication of the user's phone number
type PhoneNumberAuthenticationSettings struct {
2022-03-13 04:04:12 +00:00
meta
// Pass true if the authentication code may be sent via a flash call to the specified phone number
AllowFlashCall bool `json:"allow_flash_call"`
// Pass true if the authentication code may be sent via a missed call to the specified phone number
AllowMissedCall bool `json:"allow_missed_call"`
// Pass true if the authenticated phone number is used on the current device
IsCurrentPhoneNumber bool `json:"is_current_phone_number"`
// For official applications only. True, if the application can use Android SMS Retriever API (requires Google Play Services >= 10.2) to automatically receive the authentication code from the SMS. See https://developers.google.com/identity/sms-retriever/ for more details
AllowSmsRetrieverApi bool `json:"allow_sms_retriever_api"`
// List of up to 20 authentication tokens, recently received in updateOption("authentication_token") in previously logged out sessions
AuthenticationTokens []string `json:"authentication_tokens"`
2021-12-30 05:55:02 +00:00
}
func (entity *PhoneNumberAuthenticationSettings) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub PhoneNumberAuthenticationSettings
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*PhoneNumberAuthenticationSettings) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPhoneNumberAuthenticationSettings
2021-12-30 05:55:02 +00:00
}
func (*PhoneNumberAuthenticationSettings) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePhoneNumberAuthenticationSettings
2021-12-30 05:55:02 +00:00
}
2022-02-06 18:36:17 +00:00
// Represents a reaction applied to a message
type AddedReaction struct {
2022-03-13 04:04:12 +00:00
meta
// Text representation of the reaction
Reaction string `json:"reaction"`
// Identifier of the chat member, applied the reaction
SenderId MessageSender `json:"sender_id"`
2022-02-06 18:36:17 +00:00
}
func (entity *AddedReaction) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2022-02-06 18:36:17 +00:00
2022-03-13 04:04:12 +00:00
type stub AddedReaction
2022-02-06 18:36:17 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2022-02-06 18:36:17 +00:00
}
func (*AddedReaction) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassAddedReaction
2022-02-06 18:36:17 +00:00
}
func (*AddedReaction) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeAddedReaction
2022-02-06 18:36:17 +00:00
}
func (addedReaction *AddedReaction) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Reaction string `json:"reaction"`
SenderId json.RawMessage `json:"sender_id"`
}
2022-02-06 18:36:17 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2022-02-06 18:36:17 +00:00
2022-03-13 04:04:12 +00:00
addedReaction.Reaction = tmp.Reaction
2022-02-06 18:36:17 +00:00
2022-03-13 04:04:12 +00:00
fieldSenderId, _ := UnmarshalMessageSender(tmp.SenderId)
addedReaction.SenderId = fieldSenderId
2022-02-06 18:36:17 +00:00
2022-03-13 04:04:12 +00:00
return nil
2022-02-06 18:36:17 +00:00
}
// Represents a list of reactions added to a message
type AddedReactions struct {
2022-03-13 04:04:12 +00:00
meta
// The total number of found reactions
TotalCount int32 `json:"total_count"`
// The list of added reactions
Reactions []*AddedReaction `json:"reactions"`
// The offset for the next request. If empty, there are no more results
NextOffset string `json:"next_offset"`
2022-02-06 18:36:17 +00:00
}
func (entity *AddedReactions) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2022-02-06 18:36:17 +00:00
2022-03-13 04:04:12 +00:00
type stub AddedReactions
2022-02-06 18:36:17 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2022-02-06 18:36:17 +00:00
}
func (*AddedReactions) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassAddedReactions
2022-02-06 18:36:17 +00:00
}
func (*AddedReactions) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeAddedReactions
2022-02-06 18:36:17 +00:00
}
// Represents a list of available reactions
type AvailableReactions struct {
2022-03-13 04:04:12 +00:00
meta
// List of reactions
Reactions []string `json:"reactions"`
2022-02-06 18:36:17 +00:00
}
func (entity *AvailableReactions) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2022-02-06 18:36:17 +00:00
2022-03-13 04:04:12 +00:00
type stub AvailableReactions
2022-02-06 18:36:17 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2022-02-06 18:36:17 +00:00
}
func (*AvailableReactions) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassAvailableReactions
2022-02-06 18:36:17 +00:00
}
func (*AvailableReactions) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeAvailableReactions
2022-02-06 18:36:17 +00:00
}
// Contains stickers which must be used for reaction animation rendering
type Reaction struct {
2022-03-13 04:04:12 +00:00
meta
// Text representation of the reaction
Reaction string `json:"reaction"`
// Reaction title
Title string `json:"title"`
// True, if the reaction can be added to new messages and enabled in chats
IsActive bool `json:"is_active"`
// Static icon for the reaction
StaticIcon *Sticker `json:"static_icon"`
// Appear animation for the reaction
AppearAnimation *Sticker `json:"appear_animation"`
// Select animation for the reaction
SelectAnimation *Sticker `json:"select_animation"`
// Activate animation for the reaction
ActivateAnimation *Sticker `json:"activate_animation"`
// Effect animation for the reaction
EffectAnimation *Sticker `json:"effect_animation"`
// Around animation for the reaction; may be null
AroundAnimation *Sticker `json:"around_animation"`
// Center animation for the reaction; may be null
CenterAnimation *Sticker `json:"center_animation"`
2022-02-06 18:36:17 +00:00
}
func (entity *Reaction) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2022-02-06 18:36:17 +00:00
2022-03-13 04:04:12 +00:00
type stub Reaction
2022-02-06 18:36:17 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2022-02-06 18:36:17 +00:00
}
func (*Reaction) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassReaction
2022-02-06 18:36:17 +00:00
}
func (*Reaction) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeReaction
2022-02-06 18:36:17 +00:00
}
2021-12-30 05:55:02 +00:00
// Represents a list of animations
type Animations struct {
2022-03-13 04:04:12 +00:00
meta
// List of animations
Animations []*Animation `json:"animations"`
2021-12-30 05:55:02 +00:00
}
func (entity *Animations) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub Animations
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*Animations) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassAnimations
2021-12-30 05:55:02 +00:00
}
func (*Animations) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeAnimations
2021-12-30 05:55:02 +00:00
}
// A regular animated sticker
type DiceStickersRegular struct {
2022-03-13 04:04:12 +00:00
meta
// The animated sticker with the dice animation
Sticker *Sticker `json:"sticker"`
2021-12-30 05:55:02 +00:00
}
func (entity *DiceStickersRegular) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub DiceStickersRegular
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*DiceStickersRegular) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassDiceStickers
2021-12-30 05:55:02 +00:00
}
func (*DiceStickersRegular) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeDiceStickersRegular
2021-12-30 05:55:02 +00:00
}
func (*DiceStickersRegular) DiceStickersType() string {
2022-03-13 04:04:12 +00:00
return TypeDiceStickersRegular
2021-12-30 05:55:02 +00:00
}
// Animated stickers to be combined into a slot machine
type DiceStickersSlotMachine struct {
2022-03-13 04:04:12 +00:00
meta
// The animated sticker with the slot machine background. The background animation must start playing after all reel animations finish
Background *Sticker `json:"background"`
// The animated sticker with the lever animation. The lever animation must play once in the initial dice state
Lever *Sticker `json:"lever"`
// The animated sticker with the left reel
LeftReel *Sticker `json:"left_reel"`
// The animated sticker with the center reel
CenterReel *Sticker `json:"center_reel"`
// The animated sticker with the right reel
RightReel *Sticker `json:"right_reel"`
2021-12-30 05:55:02 +00:00
}
func (entity *DiceStickersSlotMachine) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub DiceStickersSlotMachine
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*DiceStickersSlotMachine) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassDiceStickers
2021-12-30 05:55:02 +00:00
}
func (*DiceStickersSlotMachine) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeDiceStickersSlotMachine
2021-12-30 05:55:02 +00:00
}
func (*DiceStickersSlotMachine) DiceStickersType() string {
2022-03-13 04:04:12 +00:00
return TypeDiceStickersSlotMachine
2021-12-30 05:55:02 +00:00
}
// Represents the result of an ImportContacts request
type ImportedContacts struct {
2022-03-13 04:04:12 +00:00
meta
// User identifiers of the imported contacts in the same order as they were specified in the request; 0 if the contact is not yet a registered user
UserIds []int64 `json:"user_ids"`
// The number of users that imported the corresponding contact; 0 for already registered users or if unavailable
ImporterCount []int32 `json:"importer_count"`
2021-12-30 05:55:02 +00:00
}
func (entity *ImportedContacts) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub ImportedContacts
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*ImportedContacts) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassImportedContacts
2021-12-30 05:55:02 +00:00
}
func (*ImportedContacts) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeImportedContacts
2021-12-30 05:55:02 +00:00
}
// Contains an HTTP URL
type HttpUrl struct {
2022-03-13 04:04:12 +00:00
meta
// The URL
Url string `json:"url"`
2021-12-30 05:55:02 +00:00
}
func (entity *HttpUrl) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub HttpUrl
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*HttpUrl) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassHttpUrl
2021-12-30 05:55:02 +00:00
}
func (*HttpUrl) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeHttpUrl
2021-12-30 05:55:02 +00:00
}
// Represents a link to an animated GIF or an animated (i.e., without sound) H.264/MPEG-4 AVC video
type InputInlineQueryResultAnimation struct {
2022-03-13 04:04:12 +00:00
meta
// Unique identifier of the query result
Id string `json:"id"`
// Title of the query result
Title string `json:"title"`
// URL of the result thumbnail (JPEG, GIF, or MPEG4), if it exists
ThumbnailUrl string `json:"thumbnail_url"`
// MIME type of the video thumbnail. If non-empty, must be one of "image/jpeg", "image/gif" and "video/mp4"
ThumbnailMimeType string `json:"thumbnail_mime_type"`
// The URL of the video file (file size must not exceed 1MB)
VideoUrl string `json:"video_url"`
// MIME type of the video file. Must be one of "image/gif" and "video/mp4"
VideoMimeType string `json:"video_mime_type"`
// Duration of the video, in seconds
VideoDuration int32 `json:"video_duration"`
// Width of the video
VideoWidth int32 `json:"video_width"`
// Height of the video
VideoHeight int32 `json:"video_height"`
// The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null
ReplyMarkup ReplyMarkup `json:"reply_markup"`
// The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageAnimation, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact
InputMessageContent InputMessageContent `json:"input_message_content"`
2021-12-30 05:55:02 +00:00
}
func (entity *InputInlineQueryResultAnimation) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub InputInlineQueryResultAnimation
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*InputInlineQueryResultAnimation) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInputInlineQueryResult
2021-12-30 05:55:02 +00:00
}
func (*InputInlineQueryResultAnimation) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInputInlineQueryResultAnimation
2021-12-30 05:55:02 +00:00
}
func (*InputInlineQueryResultAnimation) InputInlineQueryResultType() string {
2022-03-13 04:04:12 +00:00
return TypeInputInlineQueryResultAnimation
2021-12-30 05:55:02 +00:00
}
func (inputInlineQueryResultAnimation *InputInlineQueryResultAnimation) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Id string `json:"id"`
Title string `json:"title"`
ThumbnailUrl string `json:"thumbnail_url"`
ThumbnailMimeType string `json:"thumbnail_mime_type"`
VideoUrl string `json:"video_url"`
VideoMimeType string `json:"video_mime_type"`
VideoDuration int32 `json:"video_duration"`
VideoWidth int32 `json:"video_width"`
VideoHeight int32 `json:"video_height"`
ReplyMarkup json.RawMessage `json:"reply_markup"`
InputMessageContent json.RawMessage `json:"input_message_content"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
inputInlineQueryResultAnimation.Id = tmp.Id
inputInlineQueryResultAnimation.Title = tmp.Title
inputInlineQueryResultAnimation.ThumbnailUrl = tmp.ThumbnailUrl
inputInlineQueryResultAnimation.ThumbnailMimeType = tmp.ThumbnailMimeType
inputInlineQueryResultAnimation.VideoUrl = tmp.VideoUrl
inputInlineQueryResultAnimation.VideoMimeType = tmp.VideoMimeType
inputInlineQueryResultAnimation.VideoDuration = tmp.VideoDuration
inputInlineQueryResultAnimation.VideoWidth = tmp.VideoWidth
inputInlineQueryResultAnimation.VideoHeight = tmp.VideoHeight
fieldReplyMarkup, _ := UnmarshalReplyMarkup(tmp.ReplyMarkup)
inputInlineQueryResultAnimation.ReplyMarkup = fieldReplyMarkup
fieldInputMessageContent, _ := UnmarshalInputMessageContent(tmp.InputMessageContent)
inputInlineQueryResultAnimation.InputMessageContent = fieldInputMessageContent
return nil
2021-12-30 05:55:02 +00:00
}
// Represents a link to an article or web page
type InputInlineQueryResultArticle struct {
2022-03-13 04:04:12 +00:00
meta
// Unique identifier of the query result
Id string `json:"id"`
// URL of the result, if it exists
Url string `json:"url"`
// True, if the URL must be not shown
HideUrl bool `json:"hide_url"`
// Title of the result
Title string `json:"title"`
// A short description of the result
Description string `json:"description"`
// URL of the result thumbnail, if it exists
ThumbnailUrl string `json:"thumbnail_url"`
// Thumbnail width, if known
ThumbnailWidth int32 `json:"thumbnail_width"`
// Thumbnail height, if known
ThumbnailHeight int32 `json:"thumbnail_height"`
// The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null
ReplyMarkup ReplyMarkup `json:"reply_markup"`
// The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact
InputMessageContent InputMessageContent `json:"input_message_content"`
2021-12-30 05:55:02 +00:00
}
func (entity *InputInlineQueryResultArticle) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub InputInlineQueryResultArticle
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*InputInlineQueryResultArticle) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInputInlineQueryResult
2021-12-30 05:55:02 +00:00
}
func (*InputInlineQueryResultArticle) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInputInlineQueryResultArticle
2021-12-30 05:55:02 +00:00
}
func (*InputInlineQueryResultArticle) InputInlineQueryResultType() string {
2022-03-13 04:04:12 +00:00
return TypeInputInlineQueryResultArticle
2021-12-30 05:55:02 +00:00
}
func (inputInlineQueryResultArticle *InputInlineQueryResultArticle) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Id string `json:"id"`
Url string `json:"url"`
HideUrl bool `json:"hide_url"`
Title string `json:"title"`
Description string `json:"description"`
ThumbnailUrl string `json:"thumbnail_url"`
ThumbnailWidth int32 `json:"thumbnail_width"`
ThumbnailHeight int32 `json:"thumbnail_height"`
ReplyMarkup json.RawMessage `json:"reply_markup"`
InputMessageContent json.RawMessage `json:"input_message_content"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
inputInlineQueryResultArticle.Id = tmp.Id
inputInlineQueryResultArticle.Url = tmp.Url
inputInlineQueryResultArticle.HideUrl = tmp.HideUrl
inputInlineQueryResultArticle.Title = tmp.Title
inputInlineQueryResultArticle.Description = tmp.Description
inputInlineQueryResultArticle.ThumbnailUrl = tmp.ThumbnailUrl
inputInlineQueryResultArticle.ThumbnailWidth = tmp.ThumbnailWidth
inputInlineQueryResultArticle.ThumbnailHeight = tmp.ThumbnailHeight
fieldReplyMarkup, _ := UnmarshalReplyMarkup(tmp.ReplyMarkup)
inputInlineQueryResultArticle.ReplyMarkup = fieldReplyMarkup
fieldInputMessageContent, _ := UnmarshalInputMessageContent(tmp.InputMessageContent)
inputInlineQueryResultArticle.InputMessageContent = fieldInputMessageContent
return nil
2021-12-30 05:55:02 +00:00
}
// Represents a link to an MP3 audio file
type InputInlineQueryResultAudio struct {
2022-03-13 04:04:12 +00:00
meta
// Unique identifier of the query result
Id string `json:"id"`
// Title of the audio file
Title string `json:"title"`
// Performer of the audio file
Performer string `json:"performer"`
// The URL of the audio file
AudioUrl string `json:"audio_url"`
// Audio file duration, in seconds
AudioDuration int32 `json:"audio_duration"`
// The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null
ReplyMarkup ReplyMarkup `json:"reply_markup"`
// The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageAudio, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact
InputMessageContent InputMessageContent `json:"input_message_content"`
2021-12-30 05:55:02 +00:00
}
func (entity *InputInlineQueryResultAudio) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub InputInlineQueryResultAudio
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputInlineQueryResultAudio) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInputInlineQueryResult
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputInlineQueryResultAudio) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInputInlineQueryResultAudio
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputInlineQueryResultAudio) InputInlineQueryResultType() string {
2022-03-13 04:04:12 +00:00
return TypeInputInlineQueryResultAudio
2021-12-30 05:55:02 +00:00
}
func (inputInlineQueryResultAudio *InputInlineQueryResultAudio) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Id string `json:"id"`
Title string `json:"title"`
Performer string `json:"performer"`
AudioUrl string `json:"audio_url"`
AudioDuration int32 `json:"audio_duration"`
ReplyMarkup json.RawMessage `json:"reply_markup"`
InputMessageContent json.RawMessage `json:"input_message_content"`
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
inputInlineQueryResultAudio.Id = tmp.Id
inputInlineQueryResultAudio.Title = tmp.Title
inputInlineQueryResultAudio.Performer = tmp.Performer
inputInlineQueryResultAudio.AudioUrl = tmp.AudioUrl
inputInlineQueryResultAudio.AudioDuration = tmp.AudioDuration
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
fieldReplyMarkup, _ := UnmarshalReplyMarkup(tmp.ReplyMarkup)
inputInlineQueryResultAudio.ReplyMarkup = fieldReplyMarkup
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
fieldInputMessageContent, _ := UnmarshalInputMessageContent(tmp.InputMessageContent)
inputInlineQueryResultAudio.InputMessageContent = fieldInputMessageContent
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return nil
2021-12-30 05:55:02 +00:00
}
// Represents a user contact
type InputInlineQueryResultContact struct {
2022-03-13 04:04:12 +00:00
meta
// Unique identifier of the query result
Id string `json:"id"`
// User contact
Contact *Contact `json:"contact"`
// URL of the result thumbnail, if it exists
ThumbnailUrl string `json:"thumbnail_url"`
// Thumbnail width, if known
ThumbnailWidth int32 `json:"thumbnail_width"`
// Thumbnail height, if known
ThumbnailHeight int32 `json:"thumbnail_height"`
// The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null
ReplyMarkup ReplyMarkup `json:"reply_markup"`
// The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact
InputMessageContent InputMessageContent `json:"input_message_content"`
2021-12-30 05:55:02 +00:00
}
func (entity *InputInlineQueryResultContact) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub InputInlineQueryResultContact
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*InputInlineQueryResultContact) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInputInlineQueryResult
2021-12-30 05:55:02 +00:00
}
func (*InputInlineQueryResultContact) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInputInlineQueryResultContact
2021-12-30 05:55:02 +00:00
}
func (*InputInlineQueryResultContact) InputInlineQueryResultType() string {
2022-03-13 04:04:12 +00:00
return TypeInputInlineQueryResultContact
2021-12-30 05:55:02 +00:00
}
func (inputInlineQueryResultContact *InputInlineQueryResultContact) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Id string `json:"id"`
Contact *Contact `json:"contact"`
ThumbnailUrl string `json:"thumbnail_url"`
ThumbnailWidth int32 `json:"thumbnail_width"`
ThumbnailHeight int32 `json:"thumbnail_height"`
ReplyMarkup json.RawMessage `json:"reply_markup"`
InputMessageContent json.RawMessage `json:"input_message_content"`
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
inputInlineQueryResultContact.Id = tmp.Id
inputInlineQueryResultContact.Contact = tmp.Contact
inputInlineQueryResultContact.ThumbnailUrl = tmp.ThumbnailUrl
inputInlineQueryResultContact.ThumbnailWidth = tmp.ThumbnailWidth
inputInlineQueryResultContact.ThumbnailHeight = tmp.ThumbnailHeight
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
fieldReplyMarkup, _ := UnmarshalReplyMarkup(tmp.ReplyMarkup)
inputInlineQueryResultContact.ReplyMarkup = fieldReplyMarkup
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
fieldInputMessageContent, _ := UnmarshalInputMessageContent(tmp.InputMessageContent)
inputInlineQueryResultContact.InputMessageContent = fieldInputMessageContent
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return nil
2021-12-30 05:55:02 +00:00
}
// Represents a link to a file
type InputInlineQueryResultDocument struct {
2022-03-13 04:04:12 +00:00
meta
// Unique identifier of the query result
Id string `json:"id"`
// Title of the resulting file
Title string `json:"title"`
// Short description of the result, if known
Description string `json:"description"`
// URL of the file
DocumentUrl string `json:"document_url"`
// MIME type of the file content; only "application/pdf" and "application/zip" are currently allowed
MimeType string `json:"mime_type"`
// The URL of the file thumbnail, if it exists
ThumbnailUrl string `json:"thumbnail_url"`
// Width of the thumbnail
ThumbnailWidth int32 `json:"thumbnail_width"`
// Height of the thumbnail
ThumbnailHeight int32 `json:"thumbnail_height"`
// The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null
ReplyMarkup ReplyMarkup `json:"reply_markup"`
// The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageDocument, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact
InputMessageContent InputMessageContent `json:"input_message_content"`
2021-12-30 05:55:02 +00:00
}
func (entity *InputInlineQueryResultDocument) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub InputInlineQueryResultDocument
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*InputInlineQueryResultDocument) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInputInlineQueryResult
2021-12-30 05:55:02 +00:00
}
func (*InputInlineQueryResultDocument) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInputInlineQueryResultDocument
2021-12-30 05:55:02 +00:00
}
func (*InputInlineQueryResultDocument) InputInlineQueryResultType() string {
2022-03-13 04:04:12 +00:00
return TypeInputInlineQueryResultDocument
2021-12-30 05:55:02 +00:00
}
func (inputInlineQueryResultDocument *InputInlineQueryResultDocument) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Id string `json:"id"`
Title string `json:"title"`
Description string `json:"description"`
DocumentUrl string `json:"document_url"`
MimeType string `json:"mime_type"`
ThumbnailUrl string `json:"thumbnail_url"`
ThumbnailWidth int32 `json:"thumbnail_width"`
ThumbnailHeight int32 `json:"thumbnail_height"`
ReplyMarkup json.RawMessage `json:"reply_markup"`
InputMessageContent json.RawMessage `json:"input_message_content"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
inputInlineQueryResultDocument.Id = tmp.Id
inputInlineQueryResultDocument.Title = tmp.Title
inputInlineQueryResultDocument.Description = tmp.Description
inputInlineQueryResultDocument.DocumentUrl = tmp.DocumentUrl
inputInlineQueryResultDocument.MimeType = tmp.MimeType
inputInlineQueryResultDocument.ThumbnailUrl = tmp.ThumbnailUrl
inputInlineQueryResultDocument.ThumbnailWidth = tmp.ThumbnailWidth
inputInlineQueryResultDocument.ThumbnailHeight = tmp.ThumbnailHeight
fieldReplyMarkup, _ := UnmarshalReplyMarkup(tmp.ReplyMarkup)
inputInlineQueryResultDocument.ReplyMarkup = fieldReplyMarkup
fieldInputMessageContent, _ := UnmarshalInputMessageContent(tmp.InputMessageContent)
inputInlineQueryResultDocument.InputMessageContent = fieldInputMessageContent
return nil
2021-12-30 05:55:02 +00:00
}
// Represents a game
type InputInlineQueryResultGame struct {
2022-03-13 04:04:12 +00:00
meta
// Unique identifier of the query result
Id string `json:"id"`
// Short name of the game
GameShortName string `json:"game_short_name"`
// The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null
ReplyMarkup ReplyMarkup `json:"reply_markup"`
2021-12-30 05:55:02 +00:00
}
func (entity *InputInlineQueryResultGame) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub InputInlineQueryResultGame
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*InputInlineQueryResultGame) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInputInlineQueryResult
2021-12-30 05:55:02 +00:00
}
func (*InputInlineQueryResultGame) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInputInlineQueryResultGame
2021-12-30 05:55:02 +00:00
}
func (*InputInlineQueryResultGame) InputInlineQueryResultType() string {
2022-03-13 04:04:12 +00:00
return TypeInputInlineQueryResultGame
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (inputInlineQueryResultGame *InputInlineQueryResultGame) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Id string `json:"id"`
GameShortName string `json:"game_short_name"`
ReplyMarkup json.RawMessage `json:"reply_markup"`
}
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
inputInlineQueryResultGame.Id = tmp.Id
inputInlineQueryResultGame.GameShortName = tmp.GameShortName
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
fieldReplyMarkup, _ := UnmarshalReplyMarkup(tmp.ReplyMarkup)
inputInlineQueryResultGame.ReplyMarkup = fieldReplyMarkup
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return nil
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// Represents a point on the map
type InputInlineQueryResultLocation struct {
2022-03-13 04:04:12 +00:00
meta
// Unique identifier of the query result
Id string `json:"id"`
// Location result
Location *Location `json:"location"`
// Amount of time relative to the message sent time until the location can be updated, in seconds
LivePeriod int32 `json:"live_period"`
// Title of the result
Title string `json:"title"`
// URL of the result thumbnail, if it exists
ThumbnailUrl string `json:"thumbnail_url"`
// Thumbnail width, if known
ThumbnailWidth int32 `json:"thumbnail_width"`
// Thumbnail height, if known
ThumbnailHeight int32 `json:"thumbnail_height"`
// The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null
ReplyMarkup ReplyMarkup `json:"reply_markup"`
// The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact
InputMessageContent InputMessageContent `json:"input_message_content"`
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InputInlineQueryResultLocation) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub InputInlineQueryResultLocation
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputInlineQueryResultLocation) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInputInlineQueryResult
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputInlineQueryResultLocation) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInputInlineQueryResultLocation
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputInlineQueryResultLocation) InputInlineQueryResultType() string {
2022-03-13 04:04:12 +00:00
return TypeInputInlineQueryResultLocation
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (inputInlineQueryResultLocation *InputInlineQueryResultLocation) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Id string `json:"id"`
Location *Location `json:"location"`
LivePeriod int32 `json:"live_period"`
Title string `json:"title"`
ThumbnailUrl string `json:"thumbnail_url"`
ThumbnailWidth int32 `json:"thumbnail_width"`
ThumbnailHeight int32 `json:"thumbnail_height"`
ReplyMarkup json.RawMessage `json:"reply_markup"`
InputMessageContent json.RawMessage `json:"input_message_content"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
inputInlineQueryResultLocation.Id = tmp.Id
inputInlineQueryResultLocation.Location = tmp.Location
inputInlineQueryResultLocation.LivePeriod = tmp.LivePeriod
inputInlineQueryResultLocation.Title = tmp.Title
inputInlineQueryResultLocation.ThumbnailUrl = tmp.ThumbnailUrl
inputInlineQueryResultLocation.ThumbnailWidth = tmp.ThumbnailWidth
inputInlineQueryResultLocation.ThumbnailHeight = tmp.ThumbnailHeight
fieldReplyMarkup, _ := UnmarshalReplyMarkup(tmp.ReplyMarkup)
inputInlineQueryResultLocation.ReplyMarkup = fieldReplyMarkup
fieldInputMessageContent, _ := UnmarshalInputMessageContent(tmp.InputMessageContent)
inputInlineQueryResultLocation.InputMessageContent = fieldInputMessageContent
return nil
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// Represents link to a JPEG image
type InputInlineQueryResultPhoto struct {
2022-03-13 04:04:12 +00:00
meta
// Unique identifier of the query result
Id string `json:"id"`
// Title of the result, if known
Title string `json:"title"`
// A short description of the result, if known
Description string `json:"description"`
// URL of the photo thumbnail, if it exists
ThumbnailUrl string `json:"thumbnail_url"`
// The URL of the JPEG photo (photo size must not exceed 5MB)
PhotoUrl string `json:"photo_url"`
// Width of the photo
PhotoWidth int32 `json:"photo_width"`
// Height of the photo
PhotoHeight int32 `json:"photo_height"`
// The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null
ReplyMarkup ReplyMarkup `json:"reply_markup"`
// The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessagePhoto, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact
InputMessageContent InputMessageContent `json:"input_message_content"`
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InputInlineQueryResultPhoto) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub InputInlineQueryResultPhoto
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputInlineQueryResultPhoto) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInputInlineQueryResult
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputInlineQueryResultPhoto) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInputInlineQueryResultPhoto
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputInlineQueryResultPhoto) InputInlineQueryResultType() string {
2022-03-13 04:04:12 +00:00
return TypeInputInlineQueryResultPhoto
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (inputInlineQueryResultPhoto *InputInlineQueryResultPhoto) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Id string `json:"id"`
Title string `json:"title"`
Description string `json:"description"`
ThumbnailUrl string `json:"thumbnail_url"`
PhotoUrl string `json:"photo_url"`
PhotoWidth int32 `json:"photo_width"`
PhotoHeight int32 `json:"photo_height"`
ReplyMarkup json.RawMessage `json:"reply_markup"`
InputMessageContent json.RawMessage `json:"input_message_content"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
inputInlineQueryResultPhoto.Id = tmp.Id
inputInlineQueryResultPhoto.Title = tmp.Title
inputInlineQueryResultPhoto.Description = tmp.Description
inputInlineQueryResultPhoto.ThumbnailUrl = tmp.ThumbnailUrl
inputInlineQueryResultPhoto.PhotoUrl = tmp.PhotoUrl
inputInlineQueryResultPhoto.PhotoWidth = tmp.PhotoWidth
inputInlineQueryResultPhoto.PhotoHeight = tmp.PhotoHeight
fieldReplyMarkup, _ := UnmarshalReplyMarkup(tmp.ReplyMarkup)
inputInlineQueryResultPhoto.ReplyMarkup = fieldReplyMarkup
fieldInputMessageContent, _ := UnmarshalInputMessageContent(tmp.InputMessageContent)
inputInlineQueryResultPhoto.InputMessageContent = fieldInputMessageContent
return nil
2019-06-07 10:56:06 +00:00
}
2022-02-06 18:36:17 +00:00
// Represents a link to a WEBP, TGS, or WEBM sticker
2021-12-30 05:55:02 +00:00
type InputInlineQueryResultSticker struct {
2022-03-13 04:04:12 +00:00
meta
// Unique identifier of the query result
Id string `json:"id"`
// URL of the sticker thumbnail, if it exists
ThumbnailUrl string `json:"thumbnail_url"`
// The URL of the WEBP, TGS, or WEBM sticker (sticker file size must not exceed 5MB)
StickerUrl string `json:"sticker_url"`
// Width of the sticker
StickerWidth int32 `json:"sticker_width"`
// Height of the sticker
StickerHeight int32 `json:"sticker_height"`
// The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null
ReplyMarkup ReplyMarkup `json:"reply_markup"`
// The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageSticker, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact
InputMessageContent InputMessageContent `json:"input_message_content"`
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InputInlineQueryResultSticker) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub InputInlineQueryResultSticker
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputInlineQueryResultSticker) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInputInlineQueryResult
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputInlineQueryResultSticker) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInputInlineQueryResultSticker
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputInlineQueryResultSticker) InputInlineQueryResultType() string {
2022-03-13 04:04:12 +00:00
return TypeInputInlineQueryResultSticker
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (inputInlineQueryResultSticker *InputInlineQueryResultSticker) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Id string `json:"id"`
ThumbnailUrl string `json:"thumbnail_url"`
StickerUrl string `json:"sticker_url"`
StickerWidth int32 `json:"sticker_width"`
StickerHeight int32 `json:"sticker_height"`
ReplyMarkup json.RawMessage `json:"reply_markup"`
InputMessageContent json.RawMessage `json:"input_message_content"`
}
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
inputInlineQueryResultSticker.Id = tmp.Id
inputInlineQueryResultSticker.ThumbnailUrl = tmp.ThumbnailUrl
inputInlineQueryResultSticker.StickerUrl = tmp.StickerUrl
inputInlineQueryResultSticker.StickerWidth = tmp.StickerWidth
inputInlineQueryResultSticker.StickerHeight = tmp.StickerHeight
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
fieldReplyMarkup, _ := UnmarshalReplyMarkup(tmp.ReplyMarkup)
inputInlineQueryResultSticker.ReplyMarkup = fieldReplyMarkup
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
fieldInputMessageContent, _ := UnmarshalInputMessageContent(tmp.InputMessageContent)
inputInlineQueryResultSticker.InputMessageContent = fieldInputMessageContent
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return nil
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// Represents information about a venue
type InputInlineQueryResultVenue struct {
2022-03-13 04:04:12 +00:00
meta
// Unique identifier of the query result
Id string `json:"id"`
// Venue result
Venue *Venue `json:"venue"`
// URL of the result thumbnail, if it exists
ThumbnailUrl string `json:"thumbnail_url"`
// Thumbnail width, if known
ThumbnailWidth int32 `json:"thumbnail_width"`
// Thumbnail height, if known
ThumbnailHeight int32 `json:"thumbnail_height"`
// The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null
ReplyMarkup ReplyMarkup `json:"reply_markup"`
// The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact
InputMessageContent InputMessageContent `json:"input_message_content"`
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InputInlineQueryResultVenue) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
type stub InputInlineQueryResultVenue
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputInlineQueryResultVenue) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInputInlineQueryResult
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputInlineQueryResultVenue) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInputInlineQueryResultVenue
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputInlineQueryResultVenue) InputInlineQueryResultType() string {
2022-03-13 04:04:12 +00:00
return TypeInputInlineQueryResultVenue
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (inputInlineQueryResultVenue *InputInlineQueryResultVenue) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Id string `json:"id"`
Venue *Venue `json:"venue"`
ThumbnailUrl string `json:"thumbnail_url"`
ThumbnailWidth int32 `json:"thumbnail_width"`
ThumbnailHeight int32 `json:"thumbnail_height"`
ReplyMarkup json.RawMessage `json:"reply_markup"`
InputMessageContent json.RawMessage `json:"input_message_content"`
}
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
inputInlineQueryResultVenue.Id = tmp.Id
inputInlineQueryResultVenue.Venue = tmp.Venue
inputInlineQueryResultVenue.ThumbnailUrl = tmp.ThumbnailUrl
inputInlineQueryResultVenue.ThumbnailWidth = tmp.ThumbnailWidth
inputInlineQueryResultVenue.ThumbnailHeight = tmp.ThumbnailHeight
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
fieldReplyMarkup, _ := UnmarshalReplyMarkup(tmp.ReplyMarkup)
inputInlineQueryResultVenue.ReplyMarkup = fieldReplyMarkup
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
fieldInputMessageContent, _ := UnmarshalInputMessageContent(tmp.InputMessageContent)
inputInlineQueryResultVenue.InputMessageContent = fieldInputMessageContent
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return nil
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
// Represents a link to a page containing an embedded video player or a video file
type InputInlineQueryResultVideo struct {
2022-03-13 04:04:12 +00:00
meta
// Unique identifier of the query result
Id string `json:"id"`
// Title of the result
Title string `json:"title"`
// A short description of the result, if known
Description string `json:"description"`
// The URL of the video thumbnail (JPEG), if it exists
ThumbnailUrl string `json:"thumbnail_url"`
// URL of the embedded video player or video file
VideoUrl string `json:"video_url"`
// MIME type of the content of the video URL, only "text/html" or "video/mp4" are currently supported
MimeType string `json:"mime_type"`
// Width of the video
VideoWidth int32 `json:"video_width"`
// Height of the video
VideoHeight int32 `json:"video_height"`
// Video duration, in seconds
VideoDuration int32 `json:"video_duration"`
// The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null
ReplyMarkup ReplyMarkup `json:"reply_markup"`
// The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageVideo, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact
InputMessageContent InputMessageContent `json:"input_message_content"`
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InputInlineQueryResultVideo) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub InputInlineQueryResultVideo
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputInlineQueryResultVideo) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInputInlineQueryResult
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputInlineQueryResultVideo) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInputInlineQueryResultVideo
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputInlineQueryResultVideo) InputInlineQueryResultType() string {
2022-03-13 04:04:12 +00:00
return TypeInputInlineQueryResultVideo
2021-12-30 05:55:02 +00:00
}
func (inputInlineQueryResultVideo *InputInlineQueryResultVideo) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Id string `json:"id"`
Title string `json:"title"`
Description string `json:"description"`
ThumbnailUrl string `json:"thumbnail_url"`
VideoUrl string `json:"video_url"`
MimeType string `json:"mime_type"`
VideoWidth int32 `json:"video_width"`
VideoHeight int32 `json:"video_height"`
VideoDuration int32 `json:"video_duration"`
ReplyMarkup json.RawMessage `json:"reply_markup"`
InputMessageContent json.RawMessage `json:"input_message_content"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
inputInlineQueryResultVideo.Id = tmp.Id
inputInlineQueryResultVideo.Title = tmp.Title
inputInlineQueryResultVideo.Description = tmp.Description
inputInlineQueryResultVideo.ThumbnailUrl = tmp.ThumbnailUrl
inputInlineQueryResultVideo.VideoUrl = tmp.VideoUrl
inputInlineQueryResultVideo.MimeType = tmp.MimeType
inputInlineQueryResultVideo.VideoWidth = tmp.VideoWidth
inputInlineQueryResultVideo.VideoHeight = tmp.VideoHeight
inputInlineQueryResultVideo.VideoDuration = tmp.VideoDuration
fieldReplyMarkup, _ := UnmarshalReplyMarkup(tmp.ReplyMarkup)
inputInlineQueryResultVideo.ReplyMarkup = fieldReplyMarkup
fieldInputMessageContent, _ := UnmarshalInputMessageContent(tmp.InputMessageContent)
inputInlineQueryResultVideo.InputMessageContent = fieldInputMessageContent
return nil
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// Represents a link to an opus-encoded audio file within an OGG container, single channel audio
type InputInlineQueryResultVoiceNote struct {
2022-03-13 04:04:12 +00:00
meta
// Unique identifier of the query result
Id string `json:"id"`
// Title of the voice note
Title string `json:"title"`
// The URL of the voice note file
VoiceNoteUrl string `json:"voice_note_url"`
// Duration of the voice note, in seconds
VoiceNoteDuration int32 `json:"voice_note_duration"`
// The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null
ReplyMarkup ReplyMarkup `json:"reply_markup"`
// The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageVoiceNote, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact
InputMessageContent InputMessageContent `json:"input_message_content"`
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InputInlineQueryResultVoiceNote) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub InputInlineQueryResultVoiceNote
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputInlineQueryResultVoiceNote) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInputInlineQueryResult
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputInlineQueryResultVoiceNote) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInputInlineQueryResultVoiceNote
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputInlineQueryResultVoiceNote) InputInlineQueryResultType() string {
2022-03-13 04:04:12 +00:00
return TypeInputInlineQueryResultVoiceNote
2021-12-30 05:55:02 +00:00
}
func (inputInlineQueryResultVoiceNote *InputInlineQueryResultVoiceNote) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Id string `json:"id"`
Title string `json:"title"`
VoiceNoteUrl string `json:"voice_note_url"`
VoiceNoteDuration int32 `json:"voice_note_duration"`
ReplyMarkup json.RawMessage `json:"reply_markup"`
InputMessageContent json.RawMessage `json:"input_message_content"`
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
inputInlineQueryResultVoiceNote.Id = tmp.Id
inputInlineQueryResultVoiceNote.Title = tmp.Title
inputInlineQueryResultVoiceNote.VoiceNoteUrl = tmp.VoiceNoteUrl
inputInlineQueryResultVoiceNote.VoiceNoteDuration = tmp.VoiceNoteDuration
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
fieldReplyMarkup, _ := UnmarshalReplyMarkup(tmp.ReplyMarkup)
inputInlineQueryResultVoiceNote.ReplyMarkup = fieldReplyMarkup
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
fieldInputMessageContent, _ := UnmarshalInputMessageContent(tmp.InputMessageContent)
inputInlineQueryResultVoiceNote.InputMessageContent = fieldInputMessageContent
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return nil
2021-12-30 05:55:02 +00:00
}
// Represents a link to an article or web page
type InlineQueryResultArticle struct {
2022-03-13 04:04:12 +00:00
meta
// Unique identifier of the query result
Id string `json:"id"`
// URL of the result, if it exists
Url string `json:"url"`
// True, if the URL must be not shown
HideUrl bool `json:"hide_url"`
// Title of the result
Title string `json:"title"`
// A short description of the result
Description string `json:"description"`
// Result thumbnail in JPEG format; may be null
Thumbnail *Thumbnail `json:"thumbnail"`
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InlineQueryResultArticle) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub InlineQueryResultArticle
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InlineQueryResultArticle) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInlineQueryResult
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InlineQueryResultArticle) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInlineQueryResultArticle
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InlineQueryResultArticle) InlineQueryResultType() string {
2022-03-13 04:04:12 +00:00
return TypeInlineQueryResultArticle
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// Represents a user contact
type InlineQueryResultContact struct {
2022-03-13 04:04:12 +00:00
meta
// Unique identifier of the query result
Id string `json:"id"`
// A user contact
Contact *Contact `json:"contact"`
// Result thumbnail in JPEG format; may be null
Thumbnail *Thumbnail `json:"thumbnail"`
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InlineQueryResultContact) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub InlineQueryResultContact
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InlineQueryResultContact) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInlineQueryResult
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InlineQueryResultContact) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInlineQueryResultContact
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InlineQueryResultContact) InlineQueryResultType() string {
2022-03-13 04:04:12 +00:00
return TypeInlineQueryResultContact
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// Represents a point on the map
type InlineQueryResultLocation struct {
2022-03-13 04:04:12 +00:00
meta
// Unique identifier of the query result
Id string `json:"id"`
// Location result
Location *Location `json:"location"`
// Title of the result
Title string `json:"title"`
// Result thumbnail in JPEG format; may be null
Thumbnail *Thumbnail `json:"thumbnail"`
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InlineQueryResultLocation) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub InlineQueryResultLocation
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InlineQueryResultLocation) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInlineQueryResult
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InlineQueryResultLocation) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInlineQueryResultLocation
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InlineQueryResultLocation) InlineQueryResultType() string {
2022-03-13 04:04:12 +00:00
return TypeInlineQueryResultLocation
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// Represents information about a venue
type InlineQueryResultVenue struct {
2022-03-13 04:04:12 +00:00
meta
// Unique identifier of the query result
Id string `json:"id"`
// Venue result
Venue *Venue `json:"venue"`
// Result thumbnail in JPEG format; may be null
Thumbnail *Thumbnail `json:"thumbnail"`
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InlineQueryResultVenue) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub InlineQueryResultVenue
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InlineQueryResultVenue) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInlineQueryResult
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InlineQueryResultVenue) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInlineQueryResultVenue
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InlineQueryResultVenue) InlineQueryResultType() string {
2022-03-13 04:04:12 +00:00
return TypeInlineQueryResultVenue
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// Represents information about a game
type InlineQueryResultGame struct {
2022-03-13 04:04:12 +00:00
meta
// Unique identifier of the query result
Id string `json:"id"`
// Game result
Game *Game `json:"game"`
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InlineQueryResultGame) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub InlineQueryResultGame
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InlineQueryResultGame) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInlineQueryResult
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InlineQueryResultGame) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInlineQueryResultGame
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InlineQueryResultGame) InlineQueryResultType() string {
2022-03-13 04:04:12 +00:00
return TypeInlineQueryResultGame
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// Represents an animation file
type InlineQueryResultAnimation struct {
2022-03-13 04:04:12 +00:00
meta
// Unique identifier of the query result
Id string `json:"id"`
// Animation file
Animation *Animation `json:"animation"`
// Animation title
Title string `json:"title"`
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InlineQueryResultAnimation) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub InlineQueryResultAnimation
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InlineQueryResultAnimation) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInlineQueryResult
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InlineQueryResultAnimation) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInlineQueryResultAnimation
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InlineQueryResultAnimation) InlineQueryResultType() string {
2022-03-13 04:04:12 +00:00
return TypeInlineQueryResultAnimation
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// Represents an audio file
type InlineQueryResultAudio struct {
2022-03-13 04:04:12 +00:00
meta
// Unique identifier of the query result
Id string `json:"id"`
// Audio file
Audio *Audio `json:"audio"`
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InlineQueryResultAudio) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-09-10 12:36:54 +00:00
2022-03-13 04:04:12 +00:00
type stub InlineQueryResultAudio
2019-09-10 12:36:54 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InlineQueryResultAudio) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInlineQueryResult
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InlineQueryResultAudio) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInlineQueryResultAudio
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InlineQueryResultAudio) InlineQueryResultType() string {
2022-03-13 04:04:12 +00:00
return TypeInlineQueryResultAudio
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
// Represents a document
type InlineQueryResultDocument struct {
2022-03-13 04:04:12 +00:00
meta
// Unique identifier of the query result
Id string `json:"id"`
// Document
Document *Document `json:"document"`
// Document title
Title string `json:"title"`
// Document description
Description string `json:"description"`
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InlineQueryResultDocument) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-09-10 12:36:54 +00:00
2022-03-13 04:04:12 +00:00
type stub InlineQueryResultDocument
2019-09-10 12:36:54 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InlineQueryResultDocument) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInlineQueryResult
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InlineQueryResultDocument) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInlineQueryResultDocument
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InlineQueryResultDocument) InlineQueryResultType() string {
2022-03-13 04:04:12 +00:00
return TypeInlineQueryResultDocument
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
// Represents a photo
type InlineQueryResultPhoto struct {
2022-03-13 04:04:12 +00:00
meta
// Unique identifier of the query result
Id string `json:"id"`
// Photo
Photo *Photo `json:"photo"`
// Title of the result, if known
Title string `json:"title"`
// A short description of the result, if known
Description string `json:"description"`
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InlineQueryResultPhoto) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-09-10 12:36:54 +00:00
2022-03-13 04:04:12 +00:00
type stub InlineQueryResultPhoto
2019-09-10 12:36:54 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InlineQueryResultPhoto) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInlineQueryResult
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InlineQueryResultPhoto) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInlineQueryResultPhoto
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InlineQueryResultPhoto) InlineQueryResultType() string {
2022-03-13 04:04:12 +00:00
return TypeInlineQueryResultPhoto
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
// Represents a sticker
type InlineQueryResultSticker struct {
2022-03-13 04:04:12 +00:00
meta
// Unique identifier of the query result
Id string `json:"id"`
// Sticker
Sticker *Sticker `json:"sticker"`
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InlineQueryResultSticker) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-09-10 12:36:54 +00:00
2022-03-13 04:04:12 +00:00
type stub InlineQueryResultSticker
2019-09-10 12:36:54 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InlineQueryResultSticker) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInlineQueryResult
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InlineQueryResultSticker) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInlineQueryResultSticker
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InlineQueryResultSticker) InlineQueryResultType() string {
2022-03-13 04:04:12 +00:00
return TypeInlineQueryResultSticker
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
// Represents a video
type InlineQueryResultVideo struct {
2022-03-13 04:04:12 +00:00
meta
// Unique identifier of the query result
Id string `json:"id"`
// Video
Video *Video `json:"video"`
// Title of the video
Title string `json:"title"`
// Description of the video
Description string `json:"description"`
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InlineQueryResultVideo) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-09-10 12:36:54 +00:00
2022-03-13 04:04:12 +00:00
type stub InlineQueryResultVideo
2019-09-10 12:36:54 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InlineQueryResultVideo) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInlineQueryResult
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InlineQueryResultVideo) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInlineQueryResultVideo
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InlineQueryResultVideo) InlineQueryResultType() string {
2022-03-13 04:04:12 +00:00
return TypeInlineQueryResultVideo
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
// Represents a voice note
type InlineQueryResultVoiceNote struct {
2022-03-13 04:04:12 +00:00
meta
// Unique identifier of the query result
Id string `json:"id"`
// Voice note
VoiceNote *VoiceNote `json:"voice_note"`
// Title of the voice note
Title string `json:"title"`
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InlineQueryResultVoiceNote) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-09-10 12:36:54 +00:00
2022-03-13 04:04:12 +00:00
type stub InlineQueryResultVoiceNote
2019-09-10 12:36:54 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InlineQueryResultVoiceNote) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInlineQueryResult
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InlineQueryResultVoiceNote) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInlineQueryResultVoiceNote
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InlineQueryResultVoiceNote) InlineQueryResultType() string {
2022-03-13 04:04:12 +00:00
return TypeInlineQueryResultVoiceNote
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
// Represents the results of the inline query. Use sendInlineQueryResultMessage to send the result of the query
type InlineQueryResults struct {
2022-03-13 04:04:12 +00:00
meta
// Unique identifier of the inline query
InlineQueryId JsonInt64 `json:"inline_query_id"`
// The offset for the next request. If empty, there are no more results
NextOffset string `json:"next_offset"`
// Results of the query
Results []InlineQueryResult `json:"results"`
// If non-empty, this text must be shown on the button, which opens a private chat with the bot and sends the bot a start message with the switch_pm_parameter
SwitchPmText string `json:"switch_pm_text"`
// Parameter for the bot start message
SwitchPmParameter string `json:"switch_pm_parameter"`
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InlineQueryResults) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-09-10 12:36:54 +00:00
2022-03-13 04:04:12 +00:00
type stub InlineQueryResults
2019-09-10 12:36:54 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InlineQueryResults) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInlineQueryResults
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InlineQueryResults) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInlineQueryResults
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (inlineQueryResults *InlineQueryResults) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
InlineQueryId JsonInt64 `json:"inline_query_id"`
NextOffset string `json:"next_offset"`
Results []json.RawMessage `json:"results"`
SwitchPmText string `json:"switch_pm_text"`
SwitchPmParameter string `json:"switch_pm_parameter"`
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
inlineQueryResults.InlineQueryId = tmp.InlineQueryId
inlineQueryResults.NextOffset = tmp.NextOffset
inlineQueryResults.SwitchPmText = tmp.SwitchPmText
inlineQueryResults.SwitchPmParameter = tmp.SwitchPmParameter
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
fieldResults, _ := UnmarshalListOfInlineQueryResult(tmp.Results)
inlineQueryResults.Results = fieldResults
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return nil
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
// The payload for a general callback button
type CallbackQueryPayloadData struct {
2022-03-13 04:04:12 +00:00
meta
// Data that was attached to the callback button
Data []byte `json:"data"`
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *CallbackQueryPayloadData) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
type stub CallbackQueryPayloadData
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*CallbackQueryPayloadData) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassCallbackQueryPayload
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*CallbackQueryPayloadData) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeCallbackQueryPayloadData
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*CallbackQueryPayloadData) CallbackQueryPayloadType() string {
2022-03-13 04:04:12 +00:00
return TypeCallbackQueryPayloadData
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
// The payload for a callback button requiring password
type CallbackQueryPayloadDataWithPassword struct {
2022-03-13 04:04:12 +00:00
meta
// The password for the current user
Password string `json:"password"`
// Data that was attached to the callback button
Data []byte `json:"data"`
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *CallbackQueryPayloadDataWithPassword) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
type stub CallbackQueryPayloadDataWithPassword
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*CallbackQueryPayloadDataWithPassword) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassCallbackQueryPayload
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*CallbackQueryPayloadDataWithPassword) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeCallbackQueryPayloadDataWithPassword
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*CallbackQueryPayloadDataWithPassword) CallbackQueryPayloadType() string {
2022-03-13 04:04:12 +00:00
return TypeCallbackQueryPayloadDataWithPassword
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
// The payload for a game callback button
type CallbackQueryPayloadGame struct {
2022-03-13 04:04:12 +00:00
meta
// A short name of the game that was attached to the callback button
GameShortName string `json:"game_short_name"`
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *CallbackQueryPayloadGame) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub CallbackQueryPayloadGame
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*CallbackQueryPayloadGame) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassCallbackQueryPayload
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*CallbackQueryPayloadGame) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeCallbackQueryPayloadGame
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*CallbackQueryPayloadGame) CallbackQueryPayloadType() string {
2022-03-13 04:04:12 +00:00
return TypeCallbackQueryPayloadGame
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// Contains a bot's answer to a callback query
type CallbackQueryAnswer struct {
2022-03-13 04:04:12 +00:00
meta
// Text of the answer
Text string `json:"text"`
// True, if an alert must be shown to the user instead of a toast notification
ShowAlert bool `json:"show_alert"`
// URL to be opened
Url string `json:"url"`
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *CallbackQueryAnswer) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-09-10 12:36:54 +00:00
2022-03-13 04:04:12 +00:00
type stub CallbackQueryAnswer
2019-09-10 12:36:54 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (*CallbackQueryAnswer) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassCallbackQueryAnswer
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (*CallbackQueryAnswer) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeCallbackQueryAnswer
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
// Contains the result of a custom request
type CustomRequestResult struct {
2022-03-13 04:04:12 +00:00
meta
// A JSON-serialized result
Result string `json:"result"`
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *CustomRequestResult) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub CustomRequestResult
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*CustomRequestResult) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassCustomRequestResult
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*CustomRequestResult) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeCustomRequestResult
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// Contains one row of the game high score table
type GameHighScore struct {
2022-03-13 04:04:12 +00:00
meta
// Position in the high score table
Position int32 `json:"position"`
// User identifier
UserId int64 `json:"user_id"`
// User score
Score int32 `json:"score"`
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *GameHighScore) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
type stub GameHighScore
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*GameHighScore) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassGameHighScore
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*GameHighScore) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeGameHighScore
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
// Contains a list of game high scores
type GameHighScores struct {
2022-03-13 04:04:12 +00:00
meta
// A list of game high scores
Scores []*GameHighScore `json:"scores"`
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *GameHighScores) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
type stub GameHighScores
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*GameHighScores) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassGameHighScores
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*GameHighScores) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeGameHighScores
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
// A message was edited
type ChatEventMessageEdited struct {
2022-03-13 04:04:12 +00:00
meta
// The original message before the edit
OldMessage *Message `json:"old_message"`
// The message after it was edited
NewMessage *Message `json:"new_message"`
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *ChatEventMessageEdited) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatEventMessageEdited
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatEventMessageEdited) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatEventAction
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatEventMessageEdited) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatEventMessageEdited
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatEventMessageEdited) ChatEventActionType() string {
2022-03-13 04:04:12 +00:00
return TypeChatEventMessageEdited
2021-12-30 05:55:02 +00:00
}
// A message was deleted
type ChatEventMessageDeleted struct {
2022-03-13 04:04:12 +00:00
meta
// Deleted message
Message *Message `json:"message"`
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *ChatEventMessageDeleted) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatEventMessageDeleted
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatEventMessageDeleted) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatEventAction
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatEventMessageDeleted) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatEventMessageDeleted
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatEventMessageDeleted) ChatEventActionType() string {
2022-03-13 04:04:12 +00:00
return TypeChatEventMessageDeleted
2021-12-30 05:55:02 +00:00
}
// A message was pinned
type ChatEventMessagePinned struct {
2022-03-13 04:04:12 +00:00
meta
// Pinned message
Message *Message `json:"message"`
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *ChatEventMessagePinned) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatEventMessagePinned
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatEventMessagePinned) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatEventAction
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatEventMessagePinned) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatEventMessagePinned
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatEventMessagePinned) ChatEventActionType() string {
2022-03-13 04:04:12 +00:00
return TypeChatEventMessagePinned
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// A message was unpinned
type ChatEventMessageUnpinned struct {
2022-03-13 04:04:12 +00:00
meta
// Unpinned message
Message *Message `json:"message"`
2021-12-30 05:55:02 +00:00
}
2019-06-07 10:56:06 +00:00
2021-12-30 05:55:02 +00:00
func (entity *ChatEventMessageUnpinned) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatEventMessageUnpinned
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
2019-06-07 10:56:06 +00:00
2021-12-30 05:55:02 +00:00
func (*ChatEventMessageUnpinned) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatEventAction
2021-12-30 05:55:02 +00:00
}
2019-06-07 10:56:06 +00:00
2021-12-30 05:55:02 +00:00
func (*ChatEventMessageUnpinned) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatEventMessageUnpinned
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatEventMessageUnpinned) ChatEventActionType() string {
2022-03-13 04:04:12 +00:00
return TypeChatEventMessageUnpinned
2021-12-30 05:55:02 +00:00
}
2022-02-06 18:36:17 +00:00
// A poll in a message was stopped
type ChatEventPollStopped struct {
2022-03-13 04:04:12 +00:00
meta
// The message with the poll
Message *Message `json:"message"`
2022-02-06 18:36:17 +00:00
}
func (entity *ChatEventPollStopped) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2022-02-06 18:36:17 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatEventPollStopped
2022-02-06 18:36:17 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2022-02-06 18:36:17 +00:00
}
func (*ChatEventPollStopped) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatEventAction
2022-02-06 18:36:17 +00:00
}
func (*ChatEventPollStopped) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatEventPollStopped
2022-02-06 18:36:17 +00:00
}
func (*ChatEventPollStopped) ChatEventActionType() string {
2022-03-13 04:04:12 +00:00
return TypeChatEventPollStopped
2022-02-06 18:36:17 +00:00
}
2021-12-30 05:55:02 +00:00
// A new member joined the chat
2022-03-13 04:04:12 +00:00
type ChatEventMemberJoined struct{
meta
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *ChatEventMemberJoined) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatEventMemberJoined
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatEventMemberJoined) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatEventAction
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatEventMemberJoined) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatEventMemberJoined
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatEventMemberJoined) ChatEventActionType() string {
2022-03-13 04:04:12 +00:00
return TypeChatEventMemberJoined
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// A new member joined the chat via an invite link
type ChatEventMemberJoinedByInviteLink struct {
2022-03-13 04:04:12 +00:00
meta
// Invite link used to join the chat
InviteLink *ChatInviteLink `json:"invite_link"`
2021-12-30 05:55:02 +00:00
}
2019-06-07 10:56:06 +00:00
2021-12-30 05:55:02 +00:00
func (entity *ChatEventMemberJoinedByInviteLink) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatEventMemberJoinedByInviteLink
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
2019-06-07 10:56:06 +00:00
2021-12-30 05:55:02 +00:00
func (*ChatEventMemberJoinedByInviteLink) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatEventAction
2021-12-30 05:55:02 +00:00
}
2019-06-07 10:56:06 +00:00
2021-12-30 05:55:02 +00:00
func (*ChatEventMemberJoinedByInviteLink) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatEventMemberJoinedByInviteLink
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatEventMemberJoinedByInviteLink) ChatEventActionType() string {
2022-03-13 04:04:12 +00:00
return TypeChatEventMemberJoinedByInviteLink
2021-12-30 05:55:02 +00:00
}
// A new member was accepted to the chat by an administrator
type ChatEventMemberJoinedByRequest struct {
2022-03-13 04:04:12 +00:00
meta
// User identifier of the chat administrator, approved user join request
ApproverUserId int64 `json:"approver_user_id"`
// Invite link used to join the chat; may be null
InviteLink *ChatInviteLink `json:"invite_link"`
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *ChatEventMemberJoinedByRequest) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatEventMemberJoinedByRequest
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatEventMemberJoinedByRequest) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatEventAction
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatEventMemberJoinedByRequest) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatEventMemberJoinedByRequest
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatEventMemberJoinedByRequest) ChatEventActionType() string {
2022-03-13 04:04:12 +00:00
return TypeChatEventMemberJoinedByRequest
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// A new chat member was invited
type ChatEventMemberInvited struct {
2022-03-13 04:04:12 +00:00
meta
// New member user identifier
UserId int64 `json:"user_id"`
// New member status
Status ChatMemberStatus `json:"status"`
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *ChatEventMemberInvited) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatEventMemberInvited
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatEventMemberInvited) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatEventAction
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatEventMemberInvited) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatEventMemberInvited
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatEventMemberInvited) ChatEventActionType() string {
2022-03-13 04:04:12 +00:00
return TypeChatEventMemberInvited
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (chatEventMemberInvited *ChatEventMemberInvited) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
UserId int64 `json:"user_id"`
Status json.RawMessage `json:"status"`
}
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
chatEventMemberInvited.UserId = tmp.UserId
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
fieldStatus, _ := UnmarshalChatMemberStatus(tmp.Status)
chatEventMemberInvited.Status = fieldStatus
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return nil
2019-06-07 10:56:06 +00:00
}
2022-02-06 18:36:17 +00:00
// A member left the chat
2022-03-13 04:04:12 +00:00
type ChatEventMemberLeft struct{
meta
2022-02-06 18:36:17 +00:00
}
func (entity *ChatEventMemberLeft) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2022-02-06 18:36:17 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatEventMemberLeft
2022-02-06 18:36:17 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2022-02-06 18:36:17 +00:00
}
func (*ChatEventMemberLeft) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatEventAction
2022-02-06 18:36:17 +00:00
}
func (*ChatEventMemberLeft) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatEventMemberLeft
2022-02-06 18:36:17 +00:00
}
func (*ChatEventMemberLeft) ChatEventActionType() string {
2022-03-13 04:04:12 +00:00
return TypeChatEventMemberLeft
2022-02-06 18:36:17 +00:00
}
2021-12-30 05:55:02 +00:00
// A chat member has gained/lost administrator status, or the list of their administrator privileges has changed
type ChatEventMemberPromoted struct {
2022-03-13 04:04:12 +00:00
meta
// Affected chat member user identifier
UserId int64 `json:"user_id"`
// Previous status of the chat member
OldStatus ChatMemberStatus `json:"old_status"`
// New status of the chat member
NewStatus ChatMemberStatus `json:"new_status"`
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *ChatEventMemberPromoted) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatEventMemberPromoted
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatEventMemberPromoted) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatEventAction
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatEventMemberPromoted) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatEventMemberPromoted
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatEventMemberPromoted) ChatEventActionType() string {
2022-03-13 04:04:12 +00:00
return TypeChatEventMemberPromoted
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (chatEventMemberPromoted *ChatEventMemberPromoted) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
UserId int64 `json:"user_id"`
OldStatus json.RawMessage `json:"old_status"`
NewStatus json.RawMessage `json:"new_status"`
}
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
chatEventMemberPromoted.UserId = tmp.UserId
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
fieldOldStatus, _ := UnmarshalChatMemberStatus(tmp.OldStatus)
chatEventMemberPromoted.OldStatus = fieldOldStatus
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
fieldNewStatus, _ := UnmarshalChatMemberStatus(tmp.NewStatus)
chatEventMemberPromoted.NewStatus = fieldNewStatus
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return nil
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// A chat member was restricted/unrestricted or banned/unbanned, or the list of their restrictions has changed
type ChatEventMemberRestricted struct {
2022-03-13 04:04:12 +00:00
meta
// Affected chat member identifier
MemberId MessageSender `json:"member_id"`
// Previous status of the chat member
OldStatus ChatMemberStatus `json:"old_status"`
// New status of the chat member
NewStatus ChatMemberStatus `json:"new_status"`
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *ChatEventMemberRestricted) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatEventMemberRestricted
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatEventMemberRestricted) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatEventAction
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatEventMemberRestricted) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatEventMemberRestricted
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatEventMemberRestricted) ChatEventActionType() string {
2022-03-13 04:04:12 +00:00
return TypeChatEventMemberRestricted
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (chatEventMemberRestricted *ChatEventMemberRestricted) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
MemberId json.RawMessage `json:"member_id"`
OldStatus json.RawMessage `json:"old_status"`
NewStatus json.RawMessage `json:"new_status"`
}
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
fieldMemberId, _ := UnmarshalMessageSender(tmp.MemberId)
chatEventMemberRestricted.MemberId = fieldMemberId
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
fieldOldStatus, _ := UnmarshalChatMemberStatus(tmp.OldStatus)
chatEventMemberRestricted.OldStatus = fieldOldStatus
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
fieldNewStatus, _ := UnmarshalChatMemberStatus(tmp.NewStatus)
chatEventMemberRestricted.NewStatus = fieldNewStatus
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return nil
2019-06-07 10:56:06 +00:00
}
2022-02-06 18:36:17 +00:00
// The chat available reactions were changed
type ChatEventAvailableReactionsChanged struct {
2022-03-13 04:04:12 +00:00
meta
// Previous chat available reactions
OldAvailableReactions []string `json:"old_available_reactions"`
// New chat available reactions
NewAvailableReactions []string `json:"new_available_reactions"`
2019-06-07 10:56:06 +00:00
}
2022-02-06 18:36:17 +00:00
func (entity *ChatEventAvailableReactionsChanged) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatEventAvailableReactionsChanged
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2022-02-06 18:36:17 +00:00
func (*ChatEventAvailableReactionsChanged) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatEventAction
2019-06-07 10:56:06 +00:00
}
2022-02-06 18:36:17 +00:00
func (*ChatEventAvailableReactionsChanged) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatEventAvailableReactionsChanged
2019-06-07 10:56:06 +00:00
}
2022-02-06 18:36:17 +00:00
func (*ChatEventAvailableReactionsChanged) ChatEventActionType() string {
2022-03-13 04:04:12 +00:00
return TypeChatEventAvailableReactionsChanged
2019-06-07 10:56:06 +00:00
}
2022-02-06 18:36:17 +00:00
// The chat description was changed
type ChatEventDescriptionChanged struct {
2022-03-13 04:04:12 +00:00
meta
// Previous chat description
OldDescription string `json:"old_description"`
// New chat description
NewDescription string `json:"new_description"`
2021-12-30 05:55:02 +00:00
}
2019-06-07 10:56:06 +00:00
2022-02-06 18:36:17 +00:00
func (entity *ChatEventDescriptionChanged) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatEventDescriptionChanged
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
2019-06-07 10:56:06 +00:00
2022-02-06 18:36:17 +00:00
func (*ChatEventDescriptionChanged) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatEventAction
2021-12-30 05:55:02 +00:00
}
2019-06-07 10:56:06 +00:00
2022-02-06 18:36:17 +00:00
func (*ChatEventDescriptionChanged) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatEventDescriptionChanged
2019-06-07 10:56:06 +00:00
}
2022-02-06 18:36:17 +00:00
func (*ChatEventDescriptionChanged) ChatEventActionType() string {
2022-03-13 04:04:12 +00:00
return TypeChatEventDescriptionChanged
2021-12-30 05:55:02 +00:00
}
2022-02-06 18:36:17 +00:00
// The linked chat of a supergroup was changed
type ChatEventLinkedChatChanged struct {
2022-03-13 04:04:12 +00:00
meta
// Previous supergroup linked chat identifier
OldLinkedChatId int64 `json:"old_linked_chat_id"`
// New supergroup linked chat identifier
NewLinkedChatId int64 `json:"new_linked_chat_id"`
2019-06-07 10:56:06 +00:00
}
2022-02-06 18:36:17 +00:00
func (entity *ChatEventLinkedChatChanged) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatEventLinkedChatChanged
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2022-02-06 18:36:17 +00:00
func (*ChatEventLinkedChatChanged) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatEventAction
2019-06-07 10:56:06 +00:00
}
2022-02-06 18:36:17 +00:00
func (*ChatEventLinkedChatChanged) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatEventLinkedChatChanged
2019-06-07 10:56:06 +00:00
}
2022-02-06 18:36:17 +00:00
func (*ChatEventLinkedChatChanged) ChatEventActionType() string {
2022-03-13 04:04:12 +00:00
return TypeChatEventLinkedChatChanged
2021-12-30 05:55:02 +00:00
}
2022-02-06 18:36:17 +00:00
// The supergroup location was changed
type ChatEventLocationChanged struct {
2022-03-13 04:04:12 +00:00
meta
// Previous location; may be null
OldLocation *ChatLocation `json:"old_location"`
// New location; may be null
NewLocation *ChatLocation `json:"new_location"`
2019-06-07 10:56:06 +00:00
}
2022-02-06 18:36:17 +00:00
func (entity *ChatEventLocationChanged) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatEventLocationChanged
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
2019-06-07 10:56:06 +00:00
2022-02-06 18:36:17 +00:00
func (*ChatEventLocationChanged) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatEventAction
2021-12-30 05:55:02 +00:00
}
2019-06-07 10:56:06 +00:00
2022-02-06 18:36:17 +00:00
func (*ChatEventLocationChanged) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatEventLocationChanged
2021-12-30 05:55:02 +00:00
}
2019-06-07 10:56:06 +00:00
2022-02-06 18:36:17 +00:00
func (*ChatEventLocationChanged) ChatEventActionType() string {
2022-03-13 04:04:12 +00:00
return TypeChatEventLocationChanged
2019-06-07 10:56:06 +00:00
}
2022-02-06 18:36:17 +00:00
// The message TTL was changed
type ChatEventMessageTtlChanged struct {
2022-03-13 04:04:12 +00:00
meta
// Previous value of message_ttl
OldMessageTtl int32 `json:"old_message_ttl"`
// New value of message_ttl
NewMessageTtl int32 `json:"new_message_ttl"`
2019-06-07 10:56:06 +00:00
}
2022-02-06 18:36:17 +00:00
func (entity *ChatEventMessageTtlChanged) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatEventMessageTtlChanged
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2022-02-06 18:36:17 +00:00
func (*ChatEventMessageTtlChanged) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatEventAction
2019-06-07 10:56:06 +00:00
}
2022-02-06 18:36:17 +00:00
func (*ChatEventMessageTtlChanged) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatEventMessageTtlChanged
2019-06-07 10:56:06 +00:00
}
2022-02-06 18:36:17 +00:00
func (*ChatEventMessageTtlChanged) ChatEventActionType() string {
2022-03-13 04:04:12 +00:00
return TypeChatEventMessageTtlChanged
2019-06-07 10:56:06 +00:00
}
2022-02-06 18:36:17 +00:00
// The chat permissions was changed
type ChatEventPermissionsChanged struct {
2022-03-13 04:04:12 +00:00
meta
// Previous chat permissions
OldPermissions *ChatPermissions `json:"old_permissions"`
// New chat permissions
NewPermissions *ChatPermissions `json:"new_permissions"`
2021-12-30 05:55:02 +00:00
}
2019-06-07 10:56:06 +00:00
2022-02-06 18:36:17 +00:00
func (entity *ChatEventPermissionsChanged) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatEventPermissionsChanged
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
2019-06-07 10:56:06 +00:00
2022-02-06 18:36:17 +00:00
func (*ChatEventPermissionsChanged) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatEventAction
2021-12-30 05:55:02 +00:00
}
2019-06-07 10:56:06 +00:00
2022-02-06 18:36:17 +00:00
func (*ChatEventPermissionsChanged) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatEventPermissionsChanged
2019-06-07 10:56:06 +00:00
}
2022-02-06 18:36:17 +00:00
func (*ChatEventPermissionsChanged) ChatEventActionType() string {
2022-03-13 04:04:12 +00:00
return TypeChatEventPermissionsChanged
2021-12-30 05:55:02 +00:00
}
2022-02-06 18:36:17 +00:00
// The chat photo was changed
type ChatEventPhotoChanged struct {
2022-03-13 04:04:12 +00:00
meta
// Previous chat photo value; may be null
OldPhoto *ChatPhoto `json:"old_photo"`
// New chat photo value; may be null
NewPhoto *ChatPhoto `json:"new_photo"`
2019-06-07 10:56:06 +00:00
}
2022-02-06 18:36:17 +00:00
func (entity *ChatEventPhotoChanged) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatEventPhotoChanged
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2022-02-06 18:36:17 +00:00
func (*ChatEventPhotoChanged) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatEventAction
2018-08-30 14:55:42 +00:00
}
2022-02-06 18:36:17 +00:00
func (*ChatEventPhotoChanged) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatEventPhotoChanged
2018-08-30 14:55:42 +00:00
}
2022-02-06 18:36:17 +00:00
func (*ChatEventPhotoChanged) ChatEventActionType() string {
2022-03-13 04:04:12 +00:00
return TypeChatEventPhotoChanged
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// The slow_mode_delay setting of a supergroup was changed
type ChatEventSlowModeDelayChanged struct {
2022-03-13 04:04:12 +00:00
meta
// Previous value of slow_mode_delay, in seconds
OldSlowModeDelay int32 `json:"old_slow_mode_delay"`
// New value of slow_mode_delay, in seconds
NewSlowModeDelay int32 `json:"new_slow_mode_delay"`
2021-12-30 05:55:02 +00:00
}
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
func (entity *ChatEventSlowModeDelayChanged) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatEventSlowModeDelayChanged
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
func (*ChatEventSlowModeDelayChanged) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatEventAction
2021-12-30 05:55:02 +00:00
}
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
func (*ChatEventSlowModeDelayChanged) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatEventSlowModeDelayChanged
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatEventSlowModeDelayChanged) ChatEventActionType() string {
2022-03-13 04:04:12 +00:00
return TypeChatEventSlowModeDelayChanged
2021-12-30 05:55:02 +00:00
}
2022-02-06 18:36:17 +00:00
// The supergroup sticker set was changed
type ChatEventStickerSetChanged struct {
2022-03-13 04:04:12 +00:00
meta
// Previous identifier of the chat sticker set; 0 if none
OldStickerSetId JsonInt64 `json:"old_sticker_set_id"`
// New identifier of the chat sticker set; 0 if none
NewStickerSetId JsonInt64 `json:"new_sticker_set_id"`
2018-08-30 14:55:42 +00:00
}
2022-02-06 18:36:17 +00:00
func (entity *ChatEventStickerSetChanged) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatEventStickerSetChanged
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2022-02-06 18:36:17 +00:00
func (*ChatEventStickerSetChanged) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatEventAction
2018-08-30 14:55:42 +00:00
}
2022-02-06 18:36:17 +00:00
func (*ChatEventStickerSetChanged) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatEventStickerSetChanged
2018-08-30 14:55:42 +00:00
}
2022-02-06 18:36:17 +00:00
func (*ChatEventStickerSetChanged) ChatEventActionType() string {
2022-03-13 04:04:12 +00:00
return TypeChatEventStickerSetChanged
2018-08-30 14:55:42 +00:00
}
2022-02-06 18:36:17 +00:00
// The chat title was changed
type ChatEventTitleChanged struct {
2022-03-13 04:04:12 +00:00
meta
// Previous chat title
OldTitle string `json:"old_title"`
// New chat title
NewTitle string `json:"new_title"`
2022-02-06 18:36:17 +00:00
}
func (entity *ChatEventTitleChanged) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2022-02-06 18:36:17 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatEventTitleChanged
2022-02-06 18:36:17 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2022-02-06 18:36:17 +00:00
}
func (*ChatEventTitleChanged) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatEventAction
2022-02-06 18:36:17 +00:00
}
func (*ChatEventTitleChanged) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatEventTitleChanged
2022-02-06 18:36:17 +00:00
}
func (*ChatEventTitleChanged) ChatEventActionType() string {
2022-03-13 04:04:12 +00:00
return TypeChatEventTitleChanged
2022-02-06 18:36:17 +00:00
}
// The chat username was changed
type ChatEventUsernameChanged struct {
2022-03-13 04:04:12 +00:00
meta
// Previous chat username
OldUsername string `json:"old_username"`
// New chat username
NewUsername string `json:"new_username"`
2021-12-30 05:55:02 +00:00
}
2018-08-30 14:55:42 +00:00
2022-02-06 18:36:17 +00:00
func (entity *ChatEventUsernameChanged) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatEventUsernameChanged
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
2018-08-30 14:55:42 +00:00
2022-02-06 18:36:17 +00:00
func (*ChatEventUsernameChanged) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatEventAction
2021-12-30 05:55:02 +00:00
}
2018-08-30 14:55:42 +00:00
2022-02-06 18:36:17 +00:00
func (*ChatEventUsernameChanged) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatEventUsernameChanged
2021-12-30 05:55:02 +00:00
}
2018-08-30 14:55:42 +00:00
2022-02-06 18:36:17 +00:00
func (*ChatEventUsernameChanged) ChatEventActionType() string {
2022-03-13 04:04:12 +00:00
return TypeChatEventUsernameChanged
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// The has_protected_content setting of a channel was toggled
type ChatEventHasProtectedContentToggled struct {
2022-03-13 04:04:12 +00:00
meta
// New value of has_protected_content
HasProtectedContent bool `json:"has_protected_content"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *ChatEventHasProtectedContentToggled) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatEventHasProtectedContentToggled
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatEventHasProtectedContentToggled) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatEventAction
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatEventHasProtectedContentToggled) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatEventHasProtectedContentToggled
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatEventHasProtectedContentToggled) ChatEventActionType() string {
2022-03-13 04:04:12 +00:00
return TypeChatEventHasProtectedContentToggled
2018-08-30 14:55:42 +00:00
}
2022-02-06 18:36:17 +00:00
// The can_invite_users permission of a supergroup chat was toggled
type ChatEventInvitesToggled struct {
2022-03-13 04:04:12 +00:00
meta
// New value of can_invite_users permission
CanInviteUsers bool `json:"can_invite_users"`
2018-08-30 14:55:42 +00:00
}
2022-02-06 18:36:17 +00:00
func (entity *ChatEventInvitesToggled) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatEventInvitesToggled
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2022-02-06 18:36:17 +00:00
func (*ChatEventInvitesToggled) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatEventAction
2018-08-30 14:55:42 +00:00
}
2022-02-06 18:36:17 +00:00
func (*ChatEventInvitesToggled) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatEventInvitesToggled
2018-08-30 14:55:42 +00:00
}
2022-02-06 18:36:17 +00:00
func (*ChatEventInvitesToggled) ChatEventActionType() string {
2022-03-13 04:04:12 +00:00
return TypeChatEventInvitesToggled
2018-08-30 14:55:42 +00:00
}
2022-02-06 18:36:17 +00:00
// The is_all_history_available setting of a supergroup was toggled
type ChatEventIsAllHistoryAvailableToggled struct {
2022-03-13 04:04:12 +00:00
meta
// New value of is_all_history_available
IsAllHistoryAvailable bool `json:"is_all_history_available"`
2018-08-30 14:55:42 +00:00
}
2022-02-06 18:36:17 +00:00
func (entity *ChatEventIsAllHistoryAvailableToggled) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatEventIsAllHistoryAvailableToggled
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2022-02-06 18:36:17 +00:00
func (*ChatEventIsAllHistoryAvailableToggled) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatEventAction
2018-08-30 14:55:42 +00:00
}
2022-02-06 18:36:17 +00:00
func (*ChatEventIsAllHistoryAvailableToggled) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatEventIsAllHistoryAvailableToggled
2018-08-30 14:55:42 +00:00
}
2022-02-06 18:36:17 +00:00
func (*ChatEventIsAllHistoryAvailableToggled) ChatEventActionType() string {
2022-03-13 04:04:12 +00:00
return TypeChatEventIsAllHistoryAvailableToggled
2019-06-07 10:56:06 +00:00
}
2022-02-06 18:36:17 +00:00
// The sign_messages setting of a channel was toggled
type ChatEventSignMessagesToggled struct {
2022-03-13 04:04:12 +00:00
meta
// New value of sign_messages
SignMessages bool `json:"sign_messages"`
2018-08-30 14:55:42 +00:00
}
2022-02-06 18:36:17 +00:00
func (entity *ChatEventSignMessagesToggled) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatEventSignMessagesToggled
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2022-02-06 18:36:17 +00:00
func (*ChatEventSignMessagesToggled) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatEventAction
2018-08-30 14:55:42 +00:00
}
2022-02-06 18:36:17 +00:00
func (*ChatEventSignMessagesToggled) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatEventSignMessagesToggled
2018-08-30 14:55:42 +00:00
}
2022-02-06 18:36:17 +00:00
func (*ChatEventSignMessagesToggled) ChatEventActionType() string {
2022-03-13 04:04:12 +00:00
return TypeChatEventSignMessagesToggled
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// A chat invite link was edited
type ChatEventInviteLinkEdited struct {
2022-03-13 04:04:12 +00:00
meta
// Previous information about the invite link
OldInviteLink *ChatInviteLink `json:"old_invite_link"`
// New information about the invite link
NewInviteLink *ChatInviteLink `json:"new_invite_link"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *ChatEventInviteLinkEdited) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatEventInviteLinkEdited
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatEventInviteLinkEdited) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatEventAction
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatEventInviteLinkEdited) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatEventInviteLinkEdited
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatEventInviteLinkEdited) ChatEventActionType() string {
2022-03-13 04:04:12 +00:00
return TypeChatEventInviteLinkEdited
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// A chat invite link was revoked
type ChatEventInviteLinkRevoked struct {
2022-03-13 04:04:12 +00:00
meta
// The invite link
InviteLink *ChatInviteLink `json:"invite_link"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *ChatEventInviteLinkRevoked) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatEventInviteLinkRevoked
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatEventInviteLinkRevoked) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatEventAction
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatEventInviteLinkRevoked) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatEventInviteLinkRevoked
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatEventInviteLinkRevoked) ChatEventActionType() string {
2022-03-13 04:04:12 +00:00
return TypeChatEventInviteLinkRevoked
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A revoked chat invite link was deleted
type ChatEventInviteLinkDeleted struct {
2022-03-13 04:04:12 +00:00
meta
// The invite link
InviteLink *ChatInviteLink `json:"invite_link"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *ChatEventInviteLinkDeleted) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatEventInviteLinkDeleted
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatEventInviteLinkDeleted) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatEventAction
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatEventInviteLinkDeleted) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatEventInviteLinkDeleted
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatEventInviteLinkDeleted) ChatEventActionType() string {
2022-03-13 04:04:12 +00:00
return TypeChatEventInviteLinkDeleted
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A video chat was created
type ChatEventVideoChatCreated struct {
2022-03-13 04:04:12 +00:00
meta
// Identifier of the video chat. The video chat can be received through the method getGroupCall
GroupCallId int32 `json:"group_call_id"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *ChatEventVideoChatCreated) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatEventVideoChatCreated
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatEventVideoChatCreated) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatEventAction
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatEventVideoChatCreated) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatEventVideoChatCreated
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatEventVideoChatCreated) ChatEventActionType() string {
2022-03-13 04:04:12 +00:00
return TypeChatEventVideoChatCreated
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A video chat was ended
type ChatEventVideoChatEnded struct {
2022-03-13 04:04:12 +00:00
meta
// Identifier of the video chat. The video chat can be received through the method getGroupCall
GroupCallId int32 `json:"group_call_id"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *ChatEventVideoChatEnded) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatEventVideoChatEnded
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatEventVideoChatEnded) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatEventAction
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatEventVideoChatEnded) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatEventVideoChatEnded
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatEventVideoChatEnded) ChatEventActionType() string {
2022-03-13 04:04:12 +00:00
return TypeChatEventVideoChatEnded
2018-08-30 14:55:42 +00:00
}
2022-02-06 18:36:17 +00:00
// The mute_new_participants setting of a video chat was toggled
type ChatEventVideoChatMuteNewParticipantsToggled struct {
2022-03-13 04:04:12 +00:00
meta
// New value of the mute_new_participants setting
MuteNewParticipants bool `json:"mute_new_participants"`
2022-02-06 18:36:17 +00:00
}
func (entity *ChatEventVideoChatMuteNewParticipantsToggled) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2022-02-06 18:36:17 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatEventVideoChatMuteNewParticipantsToggled
2022-02-06 18:36:17 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2022-02-06 18:36:17 +00:00
}
func (*ChatEventVideoChatMuteNewParticipantsToggled) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatEventAction
2022-02-06 18:36:17 +00:00
}
func (*ChatEventVideoChatMuteNewParticipantsToggled) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatEventVideoChatMuteNewParticipantsToggled
2022-02-06 18:36:17 +00:00
}
func (*ChatEventVideoChatMuteNewParticipantsToggled) ChatEventActionType() string {
2022-03-13 04:04:12 +00:00
return TypeChatEventVideoChatMuteNewParticipantsToggled
2022-02-06 18:36:17 +00:00
}
2021-12-30 05:55:02 +00:00
// A video chat participant was muted or unmuted
type ChatEventVideoChatParticipantIsMutedToggled struct {
2022-03-13 04:04:12 +00:00
meta
// Identifier of the affected group call participant
ParticipantId MessageSender `json:"participant_id"`
// New value of is_muted
IsMuted bool `json:"is_muted"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *ChatEventVideoChatParticipantIsMutedToggled) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatEventVideoChatParticipantIsMutedToggled
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatEventVideoChatParticipantIsMutedToggled) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatEventAction
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatEventVideoChatParticipantIsMutedToggled) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatEventVideoChatParticipantIsMutedToggled
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatEventVideoChatParticipantIsMutedToggled) ChatEventActionType() string {
2022-03-13 04:04:12 +00:00
return TypeChatEventVideoChatParticipantIsMutedToggled
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (chatEventVideoChatParticipantIsMutedToggled *ChatEventVideoChatParticipantIsMutedToggled) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
ParticipantId json.RawMessage `json:"participant_id"`
IsMuted bool `json:"is_muted"`
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
chatEventVideoChatParticipantIsMutedToggled.IsMuted = tmp.IsMuted
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
fieldParticipantId, _ := UnmarshalMessageSender(tmp.ParticipantId)
chatEventVideoChatParticipantIsMutedToggled.ParticipantId = fieldParticipantId
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return nil
2021-12-30 05:55:02 +00:00
}
// A video chat participant volume level was changed
type ChatEventVideoChatParticipantVolumeLevelChanged struct {
2022-03-13 04:04:12 +00:00
meta
// Identifier of the affected group call participant
ParticipantId MessageSender `json:"participant_id"`
// New value of volume_level; 1-20000 in hundreds of percents
VolumeLevel int32 `json:"volume_level"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *ChatEventVideoChatParticipantVolumeLevelChanged) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatEventVideoChatParticipantVolumeLevelChanged
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatEventVideoChatParticipantVolumeLevelChanged) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatEventAction
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatEventVideoChatParticipantVolumeLevelChanged) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatEventVideoChatParticipantVolumeLevelChanged
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatEventVideoChatParticipantVolumeLevelChanged) ChatEventActionType() string {
2022-03-13 04:04:12 +00:00
return TypeChatEventVideoChatParticipantVolumeLevelChanged
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (chatEventVideoChatParticipantVolumeLevelChanged *ChatEventVideoChatParticipantVolumeLevelChanged) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
ParticipantId json.RawMessage `json:"participant_id"`
VolumeLevel int32 `json:"volume_level"`
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
chatEventVideoChatParticipantVolumeLevelChanged.VolumeLevel = tmp.VolumeLevel
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
fieldParticipantId, _ := UnmarshalMessageSender(tmp.ParticipantId)
chatEventVideoChatParticipantVolumeLevelChanged.ParticipantId = fieldParticipantId
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return nil
2021-12-30 05:55:02 +00:00
}
// Represents a chat event
type ChatEvent struct {
2022-03-13 04:04:12 +00:00
meta
// Chat event identifier
Id JsonInt64 `json:"id"`
// Point in time (Unix timestamp) when the event happened
Date int32 `json:"date"`
// Identifier of the user or chat who performed the action
MemberId MessageSender `json:"member_id"`
// The action
Action ChatEventAction `json:"action"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *ChatEvent) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatEvent
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatEvent) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatEvent
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatEvent) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatEvent
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (chatEvent *ChatEvent) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Id JsonInt64 `json:"id"`
Date int32 `json:"date"`
MemberId json.RawMessage `json:"member_id"`
Action json.RawMessage `json:"action"`
}
2021-01-18 14:16:52 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-01-18 14:16:52 +00:00
2022-03-13 04:04:12 +00:00
chatEvent.Id = tmp.Id
chatEvent.Date = tmp.Date
2021-01-18 14:16:52 +00:00
2022-03-13 04:04:12 +00:00
fieldMemberId, _ := UnmarshalMessageSender(tmp.MemberId)
chatEvent.MemberId = fieldMemberId
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
fieldAction, _ := UnmarshalChatEventAction(tmp.Action)
chatEvent.Action = fieldAction
2021-01-18 14:16:52 +00:00
2022-03-13 04:04:12 +00:00
return nil
2021-01-18 14:16:52 +00:00
}
2021-12-30 05:55:02 +00:00
// Contains a list of chat events
type ChatEvents struct {
2022-03-13 04:04:12 +00:00
meta
// List of events
Events []*ChatEvent `json:"events"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *ChatEvents) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatEvents
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatEvents) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatEvents
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatEvents) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatEvents
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// Represents a set of filters used to obtain a chat event log
type ChatEventLogFilters struct {
2022-03-13 04:04:12 +00:00
meta
// True, if message edits need to be returned
MessageEdits bool `json:"message_edits"`
// True, if message deletions need to be returned
MessageDeletions bool `json:"message_deletions"`
// True, if pin/unpin events need to be returned
MessagePins bool `json:"message_pins"`
// True, if members joining events need to be returned
MemberJoins bool `json:"member_joins"`
// True, if members leaving events need to be returned
MemberLeaves bool `json:"member_leaves"`
// True, if invited member events need to be returned
MemberInvites bool `json:"member_invites"`
// True, if member promotion/demotion events need to be returned
MemberPromotions bool `json:"member_promotions"`
// True, if member restricted/unrestricted/banned/unbanned events need to be returned
MemberRestrictions bool `json:"member_restrictions"`
// True, if changes in chat information need to be returned
InfoChanges bool `json:"info_changes"`
// True, if changes in chat settings need to be returned
SettingChanges bool `json:"setting_changes"`
// True, if changes to invite links need to be returned
InviteLinkChanges bool `json:"invite_link_changes"`
// True, if video chat actions need to be returned
VideoChatChanges bool `json:"video_chat_changes"`
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *ChatEventLogFilters) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatEventLogFilters
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*ChatEventLogFilters) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatEventLogFilters
2021-12-30 05:55:02 +00:00
}
func (*ChatEventLogFilters) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatEventLogFilters
2021-12-30 05:55:02 +00:00
}
// An ordinary language pack string
type LanguagePackStringValueOrdinary struct {
2022-03-13 04:04:12 +00:00
meta
// String value
Value string `json:"value"`
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *LanguagePackStringValueOrdinary) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
type stub LanguagePackStringValueOrdinary
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*LanguagePackStringValueOrdinary) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassLanguagePackStringValue
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*LanguagePackStringValueOrdinary) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeLanguagePackStringValueOrdinary
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*LanguagePackStringValueOrdinary) LanguagePackStringValueType() string {
2022-03-13 04:04:12 +00:00
return TypeLanguagePackStringValueOrdinary
2020-11-30 09:33:47 +00:00
}
2022-03-13 04:04:12 +00:00
// A language pack string which has different forms based on the number of some object it mentions. See https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html for more information
2021-12-30 05:55:02 +00:00
type LanguagePackStringValuePluralized struct {
2022-03-13 04:04:12 +00:00
meta
// Value for zero objects
ZeroValue string `json:"zero_value"`
// Value for one object
OneValue string `json:"one_value"`
// Value for two objects
TwoValue string `json:"two_value"`
// Value for few objects
FewValue string `json:"few_value"`
// Value for many objects
ManyValue string `json:"many_value"`
// Default value
OtherValue string `json:"other_value"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *LanguagePackStringValuePluralized) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub LanguagePackStringValuePluralized
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*LanguagePackStringValuePluralized) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassLanguagePackStringValue
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*LanguagePackStringValuePluralized) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeLanguagePackStringValuePluralized
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*LanguagePackStringValuePluralized) LanguagePackStringValueType() string {
2022-03-13 04:04:12 +00:00
return TypeLanguagePackStringValuePluralized
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A deleted language pack string, the value must be taken from the built-in English language pack
2022-03-13 04:04:12 +00:00
type LanguagePackStringValueDeleted struct{
meta
2019-06-07 10:56:06 +00:00
}
2018-10-23 12:38:10 +00:00
2021-12-30 05:55:02 +00:00
func (entity *LanguagePackStringValueDeleted) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub LanguagePackStringValueDeleted
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*LanguagePackStringValueDeleted) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassLanguagePackStringValue
2021-12-30 05:55:02 +00:00
}
func (*LanguagePackStringValueDeleted) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeLanguagePackStringValueDeleted
2021-12-30 05:55:02 +00:00
}
func (*LanguagePackStringValueDeleted) LanguagePackStringValueType() string {
2022-03-13 04:04:12 +00:00
return TypeLanguagePackStringValueDeleted
2021-12-30 05:55:02 +00:00
}
// Represents one language pack string
type LanguagePackString struct {
2022-03-13 04:04:12 +00:00
meta
// String key
Key string `json:"key"`
// String value; pass null if the string needs to be taken from the built-in English language pack
Value LanguagePackStringValue `json:"value"`
2021-12-30 05:55:02 +00:00
}
func (entity *LanguagePackString) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-10-23 12:38:10 +00:00
2022-03-13 04:04:12 +00:00
type stub LanguagePackString
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*LanguagePackString) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassLanguagePackString
2021-12-30 05:55:02 +00:00
}
func (*LanguagePackString) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeLanguagePackString
2021-12-30 05:55:02 +00:00
}
func (languagePackString *LanguagePackString) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Key string `json:"key"`
Value json.RawMessage `json:"value"`
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2018-10-23 12:38:10 +00:00
2022-03-13 04:04:12 +00:00
languagePackString.Key = tmp.Key
2018-10-23 12:38:10 +00:00
2022-03-13 04:04:12 +00:00
fieldValue, _ := UnmarshalLanguagePackStringValue(tmp.Value)
languagePackString.Value = fieldValue
2018-10-23 12:38:10 +00:00
2022-03-13 04:04:12 +00:00
return nil
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// Contains a list of language pack strings
type LanguagePackStrings struct {
2022-03-13 04:04:12 +00:00
meta
// A list of language pack strings
Strings []*LanguagePackString `json:"strings"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *LanguagePackStrings) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub LanguagePackStrings
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*LanguagePackStrings) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassLanguagePackStrings
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*LanguagePackStrings) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeLanguagePackStrings
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// Contains information about a language pack
type LanguagePackInfo struct {
2022-03-13 04:04:12 +00:00
meta
// Unique language pack identifier
Id string `json:"id"`
// Identifier of a base language pack; may be empty. If a string is missed in the language pack, then it must be fetched from base language pack. Unsupported in custom language packs
BaseLanguagePackId string `json:"base_language_pack_id"`
// Language name
Name string `json:"name"`
// Name of the language in that language
NativeName string `json:"native_name"`
// A language code to be used to apply plural forms. See https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html for more information
PluralCode string `json:"plural_code"`
// True, if the language pack is official
IsOfficial bool `json:"is_official"`
// True, if the language pack strings are RTL
IsRtl bool `json:"is_rtl"`
// True, if the language pack is a beta language pack
IsBeta bool `json:"is_beta"`
// True, if the language pack is installed by the current user
IsInstalled bool `json:"is_installed"`
// Total number of non-deleted strings from the language pack
TotalStringCount int32 `json:"total_string_count"`
// Total number of translated strings from the language pack
TranslatedStringCount int32 `json:"translated_string_count"`
// Total number of non-deleted strings from the language pack available locally
LocalStringCount int32 `json:"local_string_count"`
// Link to language translation interface; empty for custom local language packs
TranslationUrl string `json:"translation_url"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *LanguagePackInfo) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-10-23 12:38:10 +00:00
2022-03-13 04:04:12 +00:00
type stub LanguagePackInfo
2018-10-23 12:38:10 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2018-10-23 12:38:10 +00:00
2021-12-30 05:55:02 +00:00
func (*LanguagePackInfo) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassLanguagePackInfo
2019-06-07 10:56:06 +00:00
}
2018-10-23 12:38:10 +00:00
2021-12-30 05:55:02 +00:00
func (*LanguagePackInfo) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeLanguagePackInfo
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// Contains information about the current localization target
type LocalizationTargetInfo struct {
2022-03-13 04:04:12 +00:00
meta
// List of available language packs for this application
LanguagePacks []*LanguagePackInfo `json:"language_packs"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *LocalizationTargetInfo) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub LocalizationTargetInfo
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*LocalizationTargetInfo) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassLocalizationTargetInfo
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*LocalizationTargetInfo) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeLocalizationTargetInfo
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A token for Firebase Cloud Messaging
type DeviceTokenFirebaseCloudMessaging struct {
2022-03-13 04:04:12 +00:00
meta
// Device registration token; may be empty to deregister a device
Token string `json:"token"`
// True, if push notifications must be additionally encrypted
Encrypt bool `json:"encrypt"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *DeviceTokenFirebaseCloudMessaging) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-10-23 12:38:10 +00:00
2022-03-13 04:04:12 +00:00
type stub DeviceTokenFirebaseCloudMessaging
2018-10-23 12:38:10 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2018-10-23 12:38:10 +00:00
2021-12-30 05:55:02 +00:00
func (*DeviceTokenFirebaseCloudMessaging) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassDeviceToken
2019-06-07 10:56:06 +00:00
}
2018-10-23 12:38:10 +00:00
2021-12-30 05:55:02 +00:00
func (*DeviceTokenFirebaseCloudMessaging) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeDeviceTokenFirebaseCloudMessaging
2019-06-07 10:56:06 +00:00
}
2018-10-23 12:38:10 +00:00
2021-12-30 05:55:02 +00:00
func (*DeviceTokenFirebaseCloudMessaging) DeviceTokenType() string {
2022-03-13 04:04:12 +00:00
return TypeDeviceTokenFirebaseCloudMessaging
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A token for Apple Push Notification service
type DeviceTokenApplePush struct {
2022-03-13 04:04:12 +00:00
meta
// Device token; may be empty to deregister a device
DeviceToken string `json:"device_token"`
// True, if App Sandbox is enabled
IsAppSandbox bool `json:"is_app_sandbox"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *DeviceTokenApplePush) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub DeviceTokenApplePush
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*DeviceTokenApplePush) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassDeviceToken
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*DeviceTokenApplePush) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeDeviceTokenApplePush
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*DeviceTokenApplePush) DeviceTokenType() string {
2022-03-13 04:04:12 +00:00
return TypeDeviceTokenApplePush
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A token for Apple Push Notification service VoIP notifications
type DeviceTokenApplePushVoIP struct {
2022-03-13 04:04:12 +00:00
meta
// Device token; may be empty to deregister a device
DeviceToken string `json:"device_token"`
// True, if App Sandbox is enabled
IsAppSandbox bool `json:"is_app_sandbox"`
// True, if push notifications must be additionally encrypted
Encrypt bool `json:"encrypt"`
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *DeviceTokenApplePushVoIP) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-09-10 12:36:54 +00:00
2022-03-13 04:04:12 +00:00
type stub DeviceTokenApplePushVoIP
2019-09-10 12:36:54 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (*DeviceTokenApplePushVoIP) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassDeviceToken
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (*DeviceTokenApplePushVoIP) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeDeviceTokenApplePushVoIP
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (*DeviceTokenApplePushVoIP) DeviceTokenType() string {
2022-03-13 04:04:12 +00:00
return TypeDeviceTokenApplePushVoIP
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
// A token for Windows Push Notification Services
type DeviceTokenWindowsPush struct {
2022-03-13 04:04:12 +00:00
meta
// The access token that will be used to send notifications; may be empty to deregister a device
AccessToken string `json:"access_token"`
2019-06-07 10:56:06 +00:00
}
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
func (entity *DeviceTokenWindowsPush) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub DeviceTokenWindowsPush
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
func (*DeviceTokenWindowsPush) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassDeviceToken
2019-06-07 10:56:06 +00:00
}
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
func (*DeviceTokenWindowsPush) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeDeviceTokenWindowsPush
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*DeviceTokenWindowsPush) DeviceTokenType() string {
2022-03-13 04:04:12 +00:00
return TypeDeviceTokenWindowsPush
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// A token for Microsoft Push Notification Service
type DeviceTokenMicrosoftPush struct {
2022-03-13 04:04:12 +00:00
meta
// Push notification channel URI; may be empty to deregister a device
ChannelUri string `json:"channel_uri"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *DeviceTokenMicrosoftPush) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub DeviceTokenMicrosoftPush
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*DeviceTokenMicrosoftPush) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassDeviceToken
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*DeviceTokenMicrosoftPush) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeDeviceTokenMicrosoftPush
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*DeviceTokenMicrosoftPush) DeviceTokenType() string {
2022-03-13 04:04:12 +00:00
return TypeDeviceTokenMicrosoftPush
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A token for Microsoft Push Notification Service VoIP channel
type DeviceTokenMicrosoftPushVoIP struct {
2022-03-13 04:04:12 +00:00
meta
// Push notification channel URI; may be empty to deregister a device
ChannelUri string `json:"channel_uri"`
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *DeviceTokenMicrosoftPushVoIP) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub DeviceTokenMicrosoftPushVoIP
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*DeviceTokenMicrosoftPushVoIP) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassDeviceToken
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*DeviceTokenMicrosoftPushVoIP) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeDeviceTokenMicrosoftPushVoIP
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*DeviceTokenMicrosoftPushVoIP) DeviceTokenType() string {
2022-03-13 04:04:12 +00:00
return TypeDeviceTokenMicrosoftPushVoIP
2019-06-07 10:56:06 +00:00
}
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
// A token for web Push API
type DeviceTokenWebPush struct {
2022-03-13 04:04:12 +00:00
meta
// Absolute URL exposed by the push service where the application server can send push messages; may be empty to deregister a device
Endpoint string `json:"endpoint"`
// Base64url-encoded P-256 elliptic curve Diffie-Hellman public key
P256dhBase64url string `json:"p256dh_base64url"`
// Base64url-encoded authentication secret
AuthBase64url string `json:"auth_base64url"`
2019-06-07 10:56:06 +00:00
}
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
func (entity *DeviceTokenWebPush) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub DeviceTokenWebPush
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
func (*DeviceTokenWebPush) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassDeviceToken
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*DeviceTokenWebPush) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeDeviceTokenWebPush
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*DeviceTokenWebPush) DeviceTokenType() string {
2022-03-13 04:04:12 +00:00
return TypeDeviceTokenWebPush
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// A token for Simple Push API for Firefox OS
type DeviceTokenSimplePush struct {
2022-03-13 04:04:12 +00:00
meta
// Absolute URL exposed by the push service where the application server can send push messages; may be empty to deregister a device
Endpoint string `json:"endpoint"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *DeviceTokenSimplePush) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub DeviceTokenSimplePush
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*DeviceTokenSimplePush) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassDeviceToken
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*DeviceTokenSimplePush) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeDeviceTokenSimplePush
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*DeviceTokenSimplePush) DeviceTokenType() string {
2022-03-13 04:04:12 +00:00
return TypeDeviceTokenSimplePush
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A token for Ubuntu Push Client service
type DeviceTokenUbuntuPush struct {
2022-03-13 04:04:12 +00:00
meta
// Token; may be empty to deregister a device
Token string `json:"token"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *DeviceTokenUbuntuPush) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub DeviceTokenUbuntuPush
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*DeviceTokenUbuntuPush) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassDeviceToken
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*DeviceTokenUbuntuPush) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeDeviceTokenUbuntuPush
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*DeviceTokenUbuntuPush) DeviceTokenType() string {
2022-03-13 04:04:12 +00:00
return TypeDeviceTokenUbuntuPush
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A token for BlackBerry Push Service
type DeviceTokenBlackBerryPush struct {
2022-03-13 04:04:12 +00:00
meta
// Token; may be empty to deregister a device
Token string `json:"token"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *DeviceTokenBlackBerryPush) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub DeviceTokenBlackBerryPush
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*DeviceTokenBlackBerryPush) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassDeviceToken
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*DeviceTokenBlackBerryPush) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeDeviceTokenBlackBerryPush
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*DeviceTokenBlackBerryPush) DeviceTokenType() string {
2022-03-13 04:04:12 +00:00
return TypeDeviceTokenBlackBerryPush
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A token for Tizen Push Service
type DeviceTokenTizenPush struct {
2022-03-13 04:04:12 +00:00
meta
// Push service registration identifier; may be empty to deregister a device
RegId string `json:"reg_id"`
2021-12-30 05:55:02 +00:00
}
2018-10-23 12:38:10 +00:00
2021-12-30 05:55:02 +00:00
func (entity *DeviceTokenTizenPush) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-10-23 12:38:10 +00:00
2022-03-13 04:04:12 +00:00
type stub DeviceTokenTizenPush
2018-10-23 12:38:10 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
2018-10-23 12:38:10 +00:00
2021-12-30 05:55:02 +00:00
func (*DeviceTokenTizenPush) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassDeviceToken
2021-12-30 05:55:02 +00:00
}
2018-10-23 12:38:10 +00:00
2021-12-30 05:55:02 +00:00
func (*DeviceTokenTizenPush) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeDeviceTokenTizenPush
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*DeviceTokenTizenPush) DeviceTokenType() string {
2022-03-13 04:04:12 +00:00
return TypeDeviceTokenTizenPush
2021-12-30 05:55:02 +00:00
}
// Contains a globally unique push receiver identifier, which can be used to identify which account has received a push notification
type PushReceiverId struct {
2022-03-13 04:04:12 +00:00
meta
// The globally unique identifier of push notification subscription
Id JsonInt64 `json:"id"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PushReceiverId) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub PushReceiverId
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushReceiverId) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPushReceiverId
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushReceiverId) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePushReceiverId
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// Describes a solid fill of a background
type BackgroundFillSolid struct {
2022-03-13 04:04:12 +00:00
meta
// A color of the background in the RGB24 format
Color int32 `json:"color"`
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *BackgroundFillSolid) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-09-10 12:36:54 +00:00
2022-03-13 04:04:12 +00:00
type stub BackgroundFillSolid
2019-09-10 12:36:54 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (*BackgroundFillSolid) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassBackgroundFill
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (*BackgroundFillSolid) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeBackgroundFillSolid
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (*BackgroundFillSolid) BackgroundFillType() string {
2022-03-13 04:04:12 +00:00
return TypeBackgroundFillSolid
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
// Describes a gradient fill of a background
type BackgroundFillGradient struct {
2022-03-13 04:04:12 +00:00
meta
// A top color of the background in the RGB24 format
TopColor int32 `json:"top_color"`
// A bottom color of the background in the RGB24 format
BottomColor int32 `json:"bottom_color"`
// Clockwise rotation angle of the gradient, in degrees; 0-359. Must be always divisible by 45
RotationAngle int32 `json:"rotation_angle"`
2019-06-07 10:56:06 +00:00
}
2018-10-23 12:38:10 +00:00
2021-12-30 05:55:02 +00:00
func (entity *BackgroundFillGradient) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-10-23 12:38:10 +00:00
2022-03-13 04:04:12 +00:00
type stub BackgroundFillGradient
2018-10-23 12:38:10 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2018-10-23 12:38:10 +00:00
2021-12-30 05:55:02 +00:00
func (*BackgroundFillGradient) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassBackgroundFill
2019-06-07 10:56:06 +00:00
}
2018-10-23 12:38:10 +00:00
2021-12-30 05:55:02 +00:00
func (*BackgroundFillGradient) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeBackgroundFillGradient
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*BackgroundFillGradient) BackgroundFillType() string {
2022-03-13 04:04:12 +00:00
return TypeBackgroundFillGradient
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// Describes a freeform gradient fill of a background
type BackgroundFillFreeformGradient struct {
2022-03-13 04:04:12 +00:00
meta
// A list of 3 or 4 colors of the freeform gradients in the RGB24 format
Colors []int32 `json:"colors"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *BackgroundFillFreeformGradient) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub BackgroundFillFreeformGradient
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*BackgroundFillFreeformGradient) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassBackgroundFill
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*BackgroundFillFreeformGradient) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeBackgroundFillFreeformGradient
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*BackgroundFillFreeformGradient) BackgroundFillType() string {
2022-03-13 04:04:12 +00:00
return TypeBackgroundFillFreeformGradient
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A wallpaper in JPEG format
type BackgroundTypeWallpaper struct {
2022-03-13 04:04:12 +00:00
meta
// True, if the wallpaper must be downscaled to fit in 450x450 square and then box-blurred with radius 12
IsBlurred bool `json:"is_blurred"`
// True, if the background needs to be slightly moved when device is tilted
IsMoving bool `json:"is_moving"`
2019-06-07 10:56:06 +00:00
}
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
func (entity *BackgroundTypeWallpaper) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub BackgroundTypeWallpaper
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
func (*BackgroundTypeWallpaper) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassBackgroundType
2019-06-07 10:56:06 +00:00
}
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
func (*BackgroundTypeWallpaper) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeBackgroundTypeWallpaper
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*BackgroundTypeWallpaper) BackgroundTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeBackgroundTypeWallpaper
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// A PNG or TGV (gzipped subset of SVG with MIME type "application/x-tgwallpattern") pattern to be combined with the background fill chosen by the user
type BackgroundTypePattern struct {
2022-03-13 04:04:12 +00:00
meta
// Fill of the background
Fill BackgroundFill `json:"fill"`
// Intensity of the pattern when it is shown above the filled background; 0-100.
Intensity int32 `json:"intensity"`
// True, if the background fill must be applied only to the pattern itself. All other pixels are black in this case. For dark themes only
IsInverted bool `json:"is_inverted"`
// True, if the background needs to be slightly moved when device is tilted
IsMoving bool `json:"is_moving"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *BackgroundTypePattern) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub BackgroundTypePattern
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*BackgroundTypePattern) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassBackgroundType
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*BackgroundTypePattern) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeBackgroundTypePattern
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*BackgroundTypePattern) BackgroundTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeBackgroundTypePattern
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (backgroundTypePattern *BackgroundTypePattern) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Fill json.RawMessage `json:"fill"`
Intensity int32 `json:"intensity"`
IsInverted bool `json:"is_inverted"`
IsMoving bool `json:"is_moving"`
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
backgroundTypePattern.Intensity = tmp.Intensity
backgroundTypePattern.IsInverted = tmp.IsInverted
backgroundTypePattern.IsMoving = tmp.IsMoving
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
fieldFill, _ := UnmarshalBackgroundFill(tmp.Fill)
backgroundTypePattern.Fill = fieldFill
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return nil
2021-12-30 05:55:02 +00:00
}
// A filled background
type BackgroundTypeFill struct {
2022-03-13 04:04:12 +00:00
meta
// The background fill
Fill BackgroundFill `json:"fill"`
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *BackgroundTypeFill) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
type stub BackgroundTypeFill
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*BackgroundTypeFill) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassBackgroundType
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*BackgroundTypeFill) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeBackgroundTypeFill
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*BackgroundTypeFill) BackgroundTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeBackgroundTypeFill
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (backgroundTypeFill *BackgroundTypeFill) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Fill json.RawMessage `json:"fill"`
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
fieldFill, _ := UnmarshalBackgroundFill(tmp.Fill)
backgroundTypeFill.Fill = fieldFill
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return nil
2021-12-30 05:55:02 +00:00
}
// Describes a chat background
type Background struct {
2022-03-13 04:04:12 +00:00
meta
// Unique background identifier
Id JsonInt64 `json:"id"`
// True, if this is one of default backgrounds
IsDefault bool `json:"is_default"`
// True, if the background is dark and is recommended to be used with dark theme
IsDark bool `json:"is_dark"`
// Unique background name
Name string `json:"name"`
// Document with the background; may be null. Null only for filled backgrounds
Document *Document `json:"document"`
// Type of the background
Type BackgroundType `json:"type"`
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *Background) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
type stub Background
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*Background) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassBackground
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*Background) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeBackground
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (background *Background) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Id JsonInt64 `json:"id"`
IsDefault bool `json:"is_default"`
IsDark bool `json:"is_dark"`
Name string `json:"name"`
Document *Document `json:"document"`
Type json.RawMessage `json:"type"`
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
background.Id = tmp.Id
background.IsDefault = tmp.IsDefault
background.IsDark = tmp.IsDark
background.Name = tmp.Name
background.Document = tmp.Document
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
fieldType, _ := UnmarshalBackgroundType(tmp.Type)
background.Type = fieldType
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return nil
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
// Contains a list of backgrounds
type Backgrounds struct {
2022-03-13 04:04:12 +00:00
meta
// A list of backgrounds
Backgrounds []*Background `json:"backgrounds"`
2019-06-07 10:56:06 +00:00
}
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
func (entity *Backgrounds) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub Backgrounds
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
func (*Backgrounds) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassBackgrounds
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*Backgrounds) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeBackgrounds
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A background from a local file
type InputBackgroundLocal struct {
2022-03-13 04:04:12 +00:00
meta
// Background file to use. Only inputFileLocal and inputFileGenerated are supported. The file must be in JPEG format for wallpapers and in PNG format for patterns
Background InputFile `json:"background"`
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InputBackgroundLocal) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub InputBackgroundLocal
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputBackgroundLocal) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInputBackground
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputBackgroundLocal) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInputBackgroundLocal
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputBackgroundLocal) InputBackgroundType() string {
2022-03-13 04:04:12 +00:00
return TypeInputBackgroundLocal
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (inputBackgroundLocal *InputBackgroundLocal) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Background json.RawMessage `json:"background"`
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
fieldBackground, _ := UnmarshalInputFile(tmp.Background)
inputBackgroundLocal.Background = fieldBackground
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return nil
2021-12-30 05:55:02 +00:00
}
// A background from the server
type InputBackgroundRemote struct {
2022-03-13 04:04:12 +00:00
meta
// The background identifier
BackgroundId JsonInt64 `json:"background_id"`
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InputBackgroundRemote) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
type stub InputBackgroundRemote
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputBackgroundRemote) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInputBackground
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputBackgroundRemote) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInputBackgroundRemote
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InputBackgroundRemote) InputBackgroundType() string {
2022-03-13 04:04:12 +00:00
return TypeInputBackgroundRemote
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
// Describes theme settings
type ThemeSettings struct {
2022-03-13 04:04:12 +00:00
meta
// Theme accent color in ARGB format
AccentColor int32 `json:"accent_color"`
// The background to be used in chats; may be null
Background *Background `json:"background"`
// The fill to be used as a background for outgoing messages
OutgoingMessageFill BackgroundFill `json:"outgoing_message_fill"`
// If true, the freeform gradient fill needs to be animated on every sent message
AnimateOutgoingMessageFill bool `json:"animate_outgoing_message_fill"`
// Accent color of outgoing messages in ARGB format
OutgoingMessageAccentColor int32 `json:"outgoing_message_accent_color"`
2019-06-07 10:56:06 +00:00
}
2018-10-23 12:38:10 +00:00
2021-12-30 05:55:02 +00:00
func (entity *ThemeSettings) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-10-23 12:38:10 +00:00
2022-03-13 04:04:12 +00:00
type stub ThemeSettings
2018-10-23 12:38:10 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2018-10-23 12:38:10 +00:00
2021-12-30 05:55:02 +00:00
func (*ThemeSettings) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassThemeSettings
2019-06-07 10:56:06 +00:00
}
2018-10-23 12:38:10 +00:00
2021-12-30 05:55:02 +00:00
func (*ThemeSettings) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeThemeSettings
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (themeSettings *ThemeSettings) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
AccentColor int32 `json:"accent_color"`
Background *Background `json:"background"`
OutgoingMessageFill json.RawMessage `json:"outgoing_message_fill"`
AnimateOutgoingMessageFill bool `json:"animate_outgoing_message_fill"`
OutgoingMessageAccentColor int32 `json:"outgoing_message_accent_color"`
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
themeSettings.AccentColor = tmp.AccentColor
themeSettings.Background = tmp.Background
themeSettings.AnimateOutgoingMessageFill = tmp.AnimateOutgoingMessageFill
themeSettings.OutgoingMessageAccentColor = tmp.OutgoingMessageAccentColor
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
fieldOutgoingMessageFill, _ := UnmarshalBackgroundFill(tmp.OutgoingMessageFill)
themeSettings.OutgoingMessageFill = fieldOutgoingMessageFill
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return nil
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// Describes a chat theme
type ChatTheme struct {
2022-03-13 04:04:12 +00:00
meta
// Theme name
Name string `json:"name"`
// Theme settings for a light chat theme
LightSettings *ThemeSettings `json:"light_settings"`
// Theme settings for a dark chat theme
DarkSettings *ThemeSettings `json:"dark_settings"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *ChatTheme) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatTheme
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatTheme) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatTheme
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatTheme) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatTheme
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// Contains a list of hashtags
type Hashtags struct {
2022-03-13 04:04:12 +00:00
meta
// A list of hashtags
Hashtags []string `json:"hashtags"`
2021-12-30 05:55:02 +00:00
}
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
func (entity *Hashtags) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub Hashtags
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
func (*Hashtags) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassHashtags
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*Hashtags) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeHashtags
2021-12-30 05:55:02 +00:00
}
// The session can be used
2022-03-13 04:04:12 +00:00
type CanTransferOwnershipResultOk struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *CanTransferOwnershipResultOk) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub CanTransferOwnershipResultOk
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*CanTransferOwnershipResultOk) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassCanTransferOwnershipResult
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*CanTransferOwnershipResultOk) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeCanTransferOwnershipResultOk
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*CanTransferOwnershipResultOk) CanTransferOwnershipResultType() string {
2022-03-13 04:04:12 +00:00
return TypeCanTransferOwnershipResultOk
2021-12-30 05:55:02 +00:00
}
// The 2-step verification needs to be enabled first
2022-03-13 04:04:12 +00:00
type CanTransferOwnershipResultPasswordNeeded struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *CanTransferOwnershipResultPasswordNeeded) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub CanTransferOwnershipResultPasswordNeeded
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*CanTransferOwnershipResultPasswordNeeded) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassCanTransferOwnershipResult
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*CanTransferOwnershipResultPasswordNeeded) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeCanTransferOwnershipResultPasswordNeeded
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*CanTransferOwnershipResultPasswordNeeded) CanTransferOwnershipResultType() string {
2022-03-13 04:04:12 +00:00
return TypeCanTransferOwnershipResultPasswordNeeded
2021-12-30 05:55:02 +00:00
}
// The 2-step verification was enabled recently, user needs to wait
type CanTransferOwnershipResultPasswordTooFresh struct {
2022-03-13 04:04:12 +00:00
meta
// Time left before the session can be used to transfer ownership of a chat, in seconds
RetryAfter int32 `json:"retry_after"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *CanTransferOwnershipResultPasswordTooFresh) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub CanTransferOwnershipResultPasswordTooFresh
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*CanTransferOwnershipResultPasswordTooFresh) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassCanTransferOwnershipResult
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*CanTransferOwnershipResultPasswordTooFresh) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeCanTransferOwnershipResultPasswordTooFresh
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*CanTransferOwnershipResultPasswordTooFresh) CanTransferOwnershipResultType() string {
2022-03-13 04:04:12 +00:00
return TypeCanTransferOwnershipResultPasswordTooFresh
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// The session was created recently, user needs to wait
type CanTransferOwnershipResultSessionTooFresh struct {
2022-03-13 04:04:12 +00:00
meta
// Time left before the session can be used to transfer ownership of a chat, in seconds
RetryAfter int32 `json:"retry_after"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *CanTransferOwnershipResultSessionTooFresh) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub CanTransferOwnershipResultSessionTooFresh
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*CanTransferOwnershipResultSessionTooFresh) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassCanTransferOwnershipResult
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*CanTransferOwnershipResultSessionTooFresh) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeCanTransferOwnershipResultSessionTooFresh
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*CanTransferOwnershipResultSessionTooFresh) CanTransferOwnershipResultType() string {
2022-03-13 04:04:12 +00:00
return TypeCanTransferOwnershipResultSessionTooFresh
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// The username can be set
2022-03-13 04:04:12 +00:00
type CheckChatUsernameResultOk struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *CheckChatUsernameResultOk) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub CheckChatUsernameResultOk
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*CheckChatUsernameResultOk) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassCheckChatUsernameResult
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*CheckChatUsernameResultOk) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeCheckChatUsernameResultOk
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*CheckChatUsernameResultOk) CheckChatUsernameResultType() string {
2022-03-13 04:04:12 +00:00
return TypeCheckChatUsernameResultOk
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// The username is invalid
2022-03-13 04:04:12 +00:00
type CheckChatUsernameResultUsernameInvalid struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *CheckChatUsernameResultUsernameInvalid) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub CheckChatUsernameResultUsernameInvalid
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*CheckChatUsernameResultUsernameInvalid) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassCheckChatUsernameResult
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*CheckChatUsernameResultUsernameInvalid) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeCheckChatUsernameResultUsernameInvalid
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*CheckChatUsernameResultUsernameInvalid) CheckChatUsernameResultType() string {
2022-03-13 04:04:12 +00:00
return TypeCheckChatUsernameResultUsernameInvalid
2021-12-30 05:55:02 +00:00
}
2019-06-07 10:56:06 +00:00
2021-12-30 05:55:02 +00:00
// The username is occupied
2022-03-13 04:04:12 +00:00
type CheckChatUsernameResultUsernameOccupied struct{
meta
2021-12-30 05:55:02 +00:00
}
2019-06-07 10:56:06 +00:00
2021-12-30 05:55:02 +00:00
func (entity *CheckChatUsernameResultUsernameOccupied) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub CheckChatUsernameResultUsernameOccupied
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*CheckChatUsernameResultUsernameOccupied) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassCheckChatUsernameResult
2021-12-30 05:55:02 +00:00
}
2019-06-07 10:56:06 +00:00
2021-12-30 05:55:02 +00:00
func (*CheckChatUsernameResultUsernameOccupied) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeCheckChatUsernameResultUsernameOccupied
2021-12-30 05:55:02 +00:00
}
2019-06-07 10:56:06 +00:00
2021-12-30 05:55:02 +00:00
func (*CheckChatUsernameResultUsernameOccupied) CheckChatUsernameResultType() string {
2022-03-13 04:04:12 +00:00
return TypeCheckChatUsernameResultUsernameOccupied
2018-08-30 14:55:42 +00:00
}
2022-01-26 21:06:41 +00:00
// The user has too many chats with username, one of them must be made private first
2022-03-13 04:04:12 +00:00
type CheckChatUsernameResultPublicChatsTooMuch struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *CheckChatUsernameResultPublicChatsTooMuch) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub CheckChatUsernameResultPublicChatsTooMuch
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*CheckChatUsernameResultPublicChatsTooMuch) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassCheckChatUsernameResult
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*CheckChatUsernameResultPublicChatsTooMuch) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeCheckChatUsernameResultPublicChatsTooMuch
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*CheckChatUsernameResultPublicChatsTooMuch) CheckChatUsernameResultType() string {
2022-03-13 04:04:12 +00:00
return TypeCheckChatUsernameResultPublicChatsTooMuch
2021-12-30 05:55:02 +00:00
}
// The user can't be a member of a public supergroup
2022-03-13 04:04:12 +00:00
type CheckChatUsernameResultPublicGroupsUnavailable struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *CheckChatUsernameResultPublicGroupsUnavailable) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub CheckChatUsernameResultPublicGroupsUnavailable
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*CheckChatUsernameResultPublicGroupsUnavailable) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassCheckChatUsernameResult
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*CheckChatUsernameResultPublicGroupsUnavailable) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeCheckChatUsernameResultPublicGroupsUnavailable
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*CheckChatUsernameResultPublicGroupsUnavailable) CheckChatUsernameResultType() string {
2022-03-13 04:04:12 +00:00
return TypeCheckChatUsernameResultPublicGroupsUnavailable
2021-12-30 05:55:02 +00:00
}
// The name can be set
2022-03-13 04:04:12 +00:00
type CheckStickerSetNameResultOk struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *CheckStickerSetNameResultOk) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub CheckStickerSetNameResultOk
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*CheckStickerSetNameResultOk) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassCheckStickerSetNameResult
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*CheckStickerSetNameResultOk) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeCheckStickerSetNameResultOk
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*CheckStickerSetNameResultOk) CheckStickerSetNameResultType() string {
2022-03-13 04:04:12 +00:00
return TypeCheckStickerSetNameResultOk
2021-12-30 05:55:02 +00:00
}
// The name is invalid
2022-03-13 04:04:12 +00:00
type CheckStickerSetNameResultNameInvalid struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *CheckStickerSetNameResultNameInvalid) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub CheckStickerSetNameResultNameInvalid
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*CheckStickerSetNameResultNameInvalid) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassCheckStickerSetNameResult
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*CheckStickerSetNameResultNameInvalid) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeCheckStickerSetNameResultNameInvalid
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*CheckStickerSetNameResultNameInvalid) CheckStickerSetNameResultType() string {
2022-03-13 04:04:12 +00:00
return TypeCheckStickerSetNameResultNameInvalid
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// The name is occupied
2022-03-13 04:04:12 +00:00
type CheckStickerSetNameResultNameOccupied struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *CheckStickerSetNameResultNameOccupied) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub CheckStickerSetNameResultNameOccupied
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*CheckStickerSetNameResultNameOccupied) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassCheckStickerSetNameResult
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*CheckStickerSetNameResultNameOccupied) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeCheckStickerSetNameResultNameOccupied
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*CheckStickerSetNameResultNameOccupied) CheckStickerSetNameResultType() string {
2022-03-13 04:04:12 +00:00
return TypeCheckStickerSetNameResultNameOccupied
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// The password was reset
2022-03-13 04:04:12 +00:00
type ResetPasswordResultOk struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *ResetPasswordResultOk) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub ResetPasswordResultOk
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ResetPasswordResultOk) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassResetPasswordResult
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ResetPasswordResultOk) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeResetPasswordResultOk
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ResetPasswordResultOk) ResetPasswordResultType() string {
2022-03-13 04:04:12 +00:00
return TypeResetPasswordResultOk
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// The password reset request is pending
type ResetPasswordResultPending struct {
2022-03-13 04:04:12 +00:00
meta
// Point in time (Unix timestamp) after which the password can be reset immediately using resetPassword
PendingResetDate int32 `json:"pending_reset_date"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *ResetPasswordResultPending) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub ResetPasswordResultPending
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ResetPasswordResultPending) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassResetPasswordResult
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ResetPasswordResultPending) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeResetPasswordResultPending
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ResetPasswordResultPending) ResetPasswordResultType() string {
2022-03-13 04:04:12 +00:00
return TypeResetPasswordResultPending
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// The password reset request was declined
type ResetPasswordResultDeclined struct {
2022-03-13 04:04:12 +00:00
meta
// Point in time (Unix timestamp) when the password reset can be retried
RetryDate int32 `json:"retry_date"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *ResetPasswordResultDeclined) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub ResetPasswordResultDeclined
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ResetPasswordResultDeclined) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassResetPasswordResult
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ResetPasswordResultDeclined) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeResetPasswordResultDeclined
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ResetPasswordResultDeclined) ResetPasswordResultType() string {
2022-03-13 04:04:12 +00:00
return TypeResetPasswordResultDeclined
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// The messages was exported from a private chat
type MessageFileTypePrivate struct {
2022-03-13 04:04:12 +00:00
meta
// Name of the other party; may be empty if unrecognized
Name string `json:"name"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *MessageFileTypePrivate) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub MessageFileTypePrivate
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageFileTypePrivate) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageFileType
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageFileTypePrivate) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageFileTypePrivate
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageFileTypePrivate) MessageFileTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageFileTypePrivate
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// The messages was exported from a group chat
type MessageFileTypeGroup struct {
2022-03-13 04:04:12 +00:00
meta
// Title of the group chat; may be empty if unrecognized
Title string `json:"title"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *MessageFileTypeGroup) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub MessageFileTypeGroup
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageFileTypeGroup) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageFileType
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageFileTypeGroup) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageFileTypeGroup
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageFileTypeGroup) MessageFileTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageFileTypeGroup
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// The messages was exported from a chat of unknown type
2022-03-13 04:04:12 +00:00
type MessageFileTypeUnknown struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *MessageFileTypeUnknown) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub MessageFileTypeUnknown
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageFileTypeUnknown) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageFileType
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageFileTypeUnknown) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageFileTypeUnknown
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*MessageFileTypeUnknown) MessageFileTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageFileTypeUnknown
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// A general message with hidden content
type PushMessageContentHidden struct {
2022-03-13 04:04:12 +00:00
meta
// True, if the message is a pinned message with the specified content
IsPinned bool `json:"is_pinned"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PushMessageContentHidden) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub PushMessageContentHidden
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentHidden) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPushMessageContent
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentHidden) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePushMessageContentHidden
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentHidden) PushMessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypePushMessageContentHidden
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// An animation message (GIF-style).
type PushMessageContentAnimation struct {
2022-03-13 04:04:12 +00:00
meta
// Message content; may be null
Animation *Animation `json:"animation"`
// Animation caption
Caption string `json:"caption"`
// True, if the message is a pinned message with the specified content
IsPinned bool `json:"is_pinned"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PushMessageContentAnimation) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub PushMessageContentAnimation
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentAnimation) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPushMessageContent
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentAnimation) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePushMessageContentAnimation
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentAnimation) PushMessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypePushMessageContentAnimation
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// An audio message
type PushMessageContentAudio struct {
2022-03-13 04:04:12 +00:00
meta
// Message content; may be null
Audio *Audio `json:"audio"`
// True, if the message is a pinned message with the specified content
IsPinned bool `json:"is_pinned"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PushMessageContentAudio) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub PushMessageContentAudio
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentAudio) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPushMessageContent
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentAudio) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePushMessageContentAudio
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentAudio) PushMessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypePushMessageContentAudio
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// A message with a user contact
type PushMessageContentContact struct {
2022-03-13 04:04:12 +00:00
meta
// Contact's name
Name string `json:"name"`
// True, if the message is a pinned message with the specified content
IsPinned bool `json:"is_pinned"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PushMessageContentContact) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub PushMessageContentContact
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentContact) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPushMessageContent
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentContact) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePushMessageContentContact
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentContact) PushMessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypePushMessageContentContact
2021-12-30 05:55:02 +00:00
}
// A contact has registered with Telegram
2022-03-13 04:04:12 +00:00
type PushMessageContentContactRegistered struct{
meta
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PushMessageContentContactRegistered) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
type stub PushMessageContentContactRegistered
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentContactRegistered) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPushMessageContent
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentContactRegistered) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePushMessageContentContactRegistered
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentContactRegistered) PushMessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypePushMessageContentContactRegistered
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
// A document message (a general file)
type PushMessageContentDocument struct {
2022-03-13 04:04:12 +00:00
meta
// Message content; may be null
Document *Document `json:"document"`
// True, if the message is a pinned message with the specified content
IsPinned bool `json:"is_pinned"`
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PushMessageContentDocument) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
type stub PushMessageContentDocument
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentDocument) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPushMessageContent
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentDocument) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePushMessageContentDocument
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentDocument) PushMessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypePushMessageContentDocument
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
// A message with a game
type PushMessageContentGame struct {
2022-03-13 04:04:12 +00:00
meta
// Game title, empty for pinned game message
Title string `json:"title"`
// True, if the message is a pinned message with the specified content
IsPinned bool `json:"is_pinned"`
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PushMessageContentGame) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-09-10 12:36:54 +00:00
2022-03-13 04:04:12 +00:00
type stub PushMessageContentGame
2019-09-10 12:36:54 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentGame) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPushMessageContent
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentGame) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePushMessageContentGame
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentGame) PushMessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypePushMessageContentGame
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
// A new high score was achieved in a game
type PushMessageContentGameScore struct {
2022-03-13 04:04:12 +00:00
meta
// Game title, empty for pinned message
Title string `json:"title"`
// New score, 0 for pinned message
Score int32 `json:"score"`
// True, if the message is a pinned message with the specified content
IsPinned bool `json:"is_pinned"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PushMessageContentGameScore) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub PushMessageContentGameScore
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentGameScore) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPushMessageContent
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentGameScore) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePushMessageContentGameScore
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentGameScore) PushMessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypePushMessageContentGameScore
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
// A message with an invoice from a bot
type PushMessageContentInvoice struct {
2022-03-13 04:04:12 +00:00
meta
// Product price
Price string `json:"price"`
// True, if the message is a pinned message with the specified content
IsPinned bool `json:"is_pinned"`
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PushMessageContentInvoice) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-09-10 12:36:54 +00:00
2022-03-13 04:04:12 +00:00
type stub PushMessageContentInvoice
2019-09-10 12:36:54 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentInvoice) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPushMessageContent
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentInvoice) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePushMessageContentInvoice
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentInvoice) PushMessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypePushMessageContentInvoice
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
// A message with a location
type PushMessageContentLocation struct {
2022-03-13 04:04:12 +00:00
meta
// True, if the location is live
IsLive bool `json:"is_live"`
// True, if the message is a pinned message with the specified content
IsPinned bool `json:"is_pinned"`
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PushMessageContentLocation) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-09-10 12:36:54 +00:00
2022-03-13 04:04:12 +00:00
type stub PushMessageContentLocation
2019-09-10 12:36:54 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentLocation) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPushMessageContent
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentLocation) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePushMessageContentLocation
2021-12-30 05:55:02 +00:00
}
2019-09-10 12:36:54 +00:00
2021-12-30 05:55:02 +00:00
func (*PushMessageContentLocation) PushMessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypePushMessageContentLocation
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
// A photo message
type PushMessageContentPhoto struct {
2022-03-13 04:04:12 +00:00
meta
// Message content; may be null
Photo *Photo `json:"photo"`
// Photo caption
Caption string `json:"caption"`
// True, if the photo is secret
IsSecret bool `json:"is_secret"`
// True, if the message is a pinned message with the specified content
IsPinned bool `json:"is_pinned"`
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PushMessageContentPhoto) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-09-10 12:36:54 +00:00
2022-03-13 04:04:12 +00:00
type stub PushMessageContentPhoto
2019-09-10 12:36:54 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentPhoto) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPushMessageContent
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentPhoto) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePushMessageContentPhoto
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentPhoto) PushMessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypePushMessageContentPhoto
2021-12-30 05:55:02 +00:00
}
// A message with a poll
type PushMessageContentPoll struct {
2022-03-13 04:04:12 +00:00
meta
// Poll question
Question string `json:"question"`
// True, if the poll is regular and not in quiz mode
IsRegular bool `json:"is_regular"`
// True, if the message is a pinned message with the specified content
IsPinned bool `json:"is_pinned"`
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PushMessageContentPoll) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-09-10 12:36:54 +00:00
2022-03-13 04:04:12 +00:00
type stub PushMessageContentPoll
2019-09-10 12:36:54 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentPoll) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPushMessageContent
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentPoll) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePushMessageContentPoll
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentPoll) PushMessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypePushMessageContentPoll
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
// A screenshot of a message in the chat has been taken
2022-03-13 04:04:12 +00:00
type PushMessageContentScreenshotTaken struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PushMessageContentScreenshotTaken) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub PushMessageContentScreenshotTaken
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentScreenshotTaken) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPushMessageContent
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentScreenshotTaken) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePushMessageContentScreenshotTaken
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentScreenshotTaken) PushMessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypePushMessageContentScreenshotTaken
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A message with a sticker
type PushMessageContentSticker struct {
2022-03-13 04:04:12 +00:00
meta
// Message content; may be null
Sticker *Sticker `json:"sticker"`
// Emoji corresponding to the sticker; may be empty
Emoji string `json:"emoji"`
// True, if the message is a pinned message with the specified content
IsPinned bool `json:"is_pinned"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PushMessageContentSticker) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub PushMessageContentSticker
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentSticker) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPushMessageContent
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentSticker) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePushMessageContentSticker
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentSticker) PushMessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypePushMessageContentSticker
2021-12-30 05:55:02 +00:00
}
// A text message
type PushMessageContentText struct {
2022-03-13 04:04:12 +00:00
meta
// Message text
Text string `json:"text"`
// True, if the message is a pinned message with the specified content
IsPinned bool `json:"is_pinned"`
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PushMessageContentText) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
type stub PushMessageContentText
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentText) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPushMessageContent
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentText) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePushMessageContentText
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentText) PushMessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypePushMessageContentText
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
// A video message
type PushMessageContentVideo struct {
2022-03-13 04:04:12 +00:00
meta
// Message content; may be null
Video *Video `json:"video"`
// Video caption
Caption string `json:"caption"`
// True, if the video is secret
IsSecret bool `json:"is_secret"`
// True, if the message is a pinned message with the specified content
IsPinned bool `json:"is_pinned"`
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PushMessageContentVideo) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
type stub PushMessageContentVideo
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentVideo) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPushMessageContent
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentVideo) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePushMessageContentVideo
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentVideo) PushMessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypePushMessageContentVideo
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
// A video note message
type PushMessageContentVideoNote struct {
2022-03-13 04:04:12 +00:00
meta
// Message content; may be null
VideoNote *VideoNote `json:"video_note"`
// True, if the message is a pinned message with the specified content
IsPinned bool `json:"is_pinned"`
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PushMessageContentVideoNote) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
type stub PushMessageContentVideoNote
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentVideoNote) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPushMessageContent
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentVideoNote) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePushMessageContentVideoNote
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentVideoNote) PushMessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypePushMessageContentVideoNote
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
// A voice note message
type PushMessageContentVoiceNote struct {
2022-03-13 04:04:12 +00:00
meta
// Message content; may be null
VoiceNote *VoiceNote `json:"voice_note"`
// True, if the message is a pinned message with the specified content
IsPinned bool `json:"is_pinned"`
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PushMessageContentVoiceNote) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
type stub PushMessageContentVoiceNote
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentVoiceNote) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPushMessageContent
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentVoiceNote) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePushMessageContentVoiceNote
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentVoiceNote) PushMessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypePushMessageContentVoiceNote
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
// A newly created basic group
2022-03-13 04:04:12 +00:00
type PushMessageContentBasicGroupChatCreate struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PushMessageContentBasicGroupChatCreate) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub PushMessageContentBasicGroupChatCreate
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentBasicGroupChatCreate) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPushMessageContent
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentBasicGroupChatCreate) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePushMessageContentBasicGroupChatCreate
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentBasicGroupChatCreate) PushMessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypePushMessageContentBasicGroupChatCreate
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// New chat members were invited to a group
type PushMessageContentChatAddMembers struct {
2022-03-13 04:04:12 +00:00
meta
// Name of the added member
MemberName string `json:"member_name"`
// True, if the current user was added to the group
IsCurrentUser bool `json:"is_current_user"`
// True, if the user has returned to the group themselves
IsReturned bool `json:"is_returned"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PushMessageContentChatAddMembers) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub PushMessageContentChatAddMembers
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentChatAddMembers) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPushMessageContent
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentChatAddMembers) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePushMessageContentChatAddMembers
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentChatAddMembers) PushMessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypePushMessageContentChatAddMembers
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A chat photo was edited
2022-03-13 04:04:12 +00:00
type PushMessageContentChatChangePhoto struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PushMessageContentChatChangePhoto) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub PushMessageContentChatChangePhoto
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentChatChangePhoto) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPushMessageContent
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentChatChangePhoto) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePushMessageContentChatChangePhoto
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentChatChangePhoto) PushMessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypePushMessageContentChatChangePhoto
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A chat title was edited
type PushMessageContentChatChangeTitle struct {
2022-03-13 04:04:12 +00:00
meta
// New chat title
Title string `json:"title"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PushMessageContentChatChangeTitle) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub PushMessageContentChatChangeTitle
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentChatChangeTitle) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPushMessageContent
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentChatChangeTitle) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePushMessageContentChatChangeTitle
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentChatChangeTitle) PushMessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypePushMessageContentChatChangeTitle
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A chat theme was edited
type PushMessageContentChatSetTheme struct {
2022-03-13 04:04:12 +00:00
meta
// If non-empty, name of a new theme, set for the chat. Otherwise chat theme was reset to the default one
ThemeName string `json:"theme_name"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PushMessageContentChatSetTheme) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub PushMessageContentChatSetTheme
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentChatSetTheme) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPushMessageContent
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentChatSetTheme) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePushMessageContentChatSetTheme
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentChatSetTheme) PushMessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypePushMessageContentChatSetTheme
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A chat member was deleted
type PushMessageContentChatDeleteMember struct {
2022-03-13 04:04:12 +00:00
meta
// Name of the deleted member
MemberName string `json:"member_name"`
// True, if the current user was deleted from the group
IsCurrentUser bool `json:"is_current_user"`
// True, if the user has left the group themselves
IsLeft bool `json:"is_left"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PushMessageContentChatDeleteMember) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub PushMessageContentChatDeleteMember
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentChatDeleteMember) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPushMessageContent
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentChatDeleteMember) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePushMessageContentChatDeleteMember
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentChatDeleteMember) PushMessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypePushMessageContentChatDeleteMember
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A new member joined the chat via an invite link
2022-03-13 04:04:12 +00:00
type PushMessageContentChatJoinByLink struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PushMessageContentChatJoinByLink) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub PushMessageContentChatJoinByLink
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentChatJoinByLink) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPushMessageContent
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentChatJoinByLink) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePushMessageContentChatJoinByLink
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentChatJoinByLink) PushMessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypePushMessageContentChatJoinByLink
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A new member was accepted to the chat by an administrator
2022-03-13 04:04:12 +00:00
type PushMessageContentChatJoinByRequest struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PushMessageContentChatJoinByRequest) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub PushMessageContentChatJoinByRequest
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentChatJoinByRequest) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPushMessageContent
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentChatJoinByRequest) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePushMessageContentChatJoinByRequest
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentChatJoinByRequest) PushMessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypePushMessageContentChatJoinByRequest
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A forwarded messages
type PushMessageContentMessageForwards struct {
2022-03-13 04:04:12 +00:00
meta
// Number of forwarded messages
TotalCount int32 `json:"total_count"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PushMessageContentMessageForwards) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub PushMessageContentMessageForwards
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentMessageForwards) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPushMessageContent
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentMessageForwards) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePushMessageContentMessageForwards
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentMessageForwards) PushMessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypePushMessageContentMessageForwards
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A media album
type PushMessageContentMediaAlbum struct {
2022-03-13 04:04:12 +00:00
meta
// Number of messages in the album
TotalCount int32 `json:"total_count"`
// True, if the album has at least one photo
HasPhotos bool `json:"has_photos"`
// True, if the album has at least one video
HasVideos bool `json:"has_videos"`
// True, if the album has at least one audio file
HasAudios bool `json:"has_audios"`
// True, if the album has at least one document
HasDocuments bool `json:"has_documents"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *PushMessageContentMediaAlbum) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub PushMessageContentMediaAlbum
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentMediaAlbum) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPushMessageContent
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentMediaAlbum) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePushMessageContentMediaAlbum
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*PushMessageContentMediaAlbum) PushMessageContentType() string {
2022-03-13 04:04:12 +00:00
return TypePushMessageContentMediaAlbum
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// New message was received
type NotificationTypeNewMessage struct {
2022-03-13 04:04:12 +00:00
meta
// The message
Message *Message `json:"message"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *NotificationTypeNewMessage) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub NotificationTypeNewMessage
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*NotificationTypeNewMessage) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassNotificationType
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*NotificationTypeNewMessage) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeNotificationTypeNewMessage
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*NotificationTypeNewMessage) NotificationTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeNotificationTypeNewMessage
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// New secret chat was created
2022-03-13 04:04:12 +00:00
type NotificationTypeNewSecretChat struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *NotificationTypeNewSecretChat) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub NotificationTypeNewSecretChat
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*NotificationTypeNewSecretChat) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassNotificationType
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*NotificationTypeNewSecretChat) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeNotificationTypeNewSecretChat
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*NotificationTypeNewSecretChat) NotificationTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeNotificationTypeNewSecretChat
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// New call was received
type NotificationTypeNewCall struct {
2022-03-13 04:04:12 +00:00
meta
// Call identifier
CallId int32 `json:"call_id"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *NotificationTypeNewCall) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub NotificationTypeNewCall
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*NotificationTypeNewCall) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassNotificationType
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*NotificationTypeNewCall) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeNotificationTypeNewCall
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*NotificationTypeNewCall) NotificationTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeNotificationTypeNewCall
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// New message was received through a push notification
type NotificationTypeNewPushMessage struct {
2022-03-13 04:04:12 +00:00
meta
// The message identifier. The message will not be available in the chat history, but the ID can be used in viewMessages, or as reply_to_message_id
MessageId int64 `json:"message_id"`
// Identifier of the sender of the message. Corresponding user or chat may be inaccessible
SenderId MessageSender `json:"sender_id"`
// Name of the sender
SenderName string `json:"sender_name"`
// True, if the message is outgoing
IsOutgoing bool `json:"is_outgoing"`
// Push message content
Content PushMessageContent `json:"content"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *NotificationTypeNewPushMessage) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub NotificationTypeNewPushMessage
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*NotificationTypeNewPushMessage) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassNotificationType
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*NotificationTypeNewPushMessage) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeNotificationTypeNewPushMessage
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*NotificationTypeNewPushMessage) NotificationTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeNotificationTypeNewPushMessage
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (notificationTypeNewPushMessage *NotificationTypeNewPushMessage) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
MessageId int64 `json:"message_id"`
SenderId json.RawMessage `json:"sender_id"`
SenderName string `json:"sender_name"`
IsOutgoing bool `json:"is_outgoing"`
Content json.RawMessage `json:"content"`
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
notificationTypeNewPushMessage.MessageId = tmp.MessageId
notificationTypeNewPushMessage.SenderName = tmp.SenderName
notificationTypeNewPushMessage.IsOutgoing = tmp.IsOutgoing
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
fieldSenderId, _ := UnmarshalMessageSender(tmp.SenderId)
notificationTypeNewPushMessage.SenderId = fieldSenderId
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
fieldContent, _ := UnmarshalPushMessageContent(tmp.Content)
notificationTypeNewPushMessage.Content = fieldContent
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return nil
2021-12-30 05:55:02 +00:00
}
// A group containing notifications of type notificationTypeNewMessage and notificationTypeNewPushMessage with ordinary unread messages
2022-03-13 04:04:12 +00:00
type NotificationGroupTypeMessages struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *NotificationGroupTypeMessages) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub NotificationGroupTypeMessages
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*NotificationGroupTypeMessages) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassNotificationGroupType
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*NotificationGroupTypeMessages) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeNotificationGroupTypeMessages
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*NotificationGroupTypeMessages) NotificationGroupTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeNotificationGroupTypeMessages
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// A group containing notifications of type notificationTypeNewMessage and notificationTypeNewPushMessage with unread mentions of the current user, replies to their messages, or a pinned message
2022-03-13 04:04:12 +00:00
type NotificationGroupTypeMentions struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *NotificationGroupTypeMentions) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub NotificationGroupTypeMentions
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*NotificationGroupTypeMentions) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassNotificationGroupType
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*NotificationGroupTypeMentions) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeNotificationGroupTypeMentions
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*NotificationGroupTypeMentions) NotificationGroupTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeNotificationGroupTypeMentions
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// A group containing a notification of type notificationTypeNewSecretChat
2022-03-13 04:04:12 +00:00
type NotificationGroupTypeSecretChat struct{
meta
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *NotificationGroupTypeSecretChat) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub NotificationGroupTypeSecretChat
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*NotificationGroupTypeSecretChat) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassNotificationGroupType
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*NotificationGroupTypeSecretChat) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeNotificationGroupTypeSecretChat
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*NotificationGroupTypeSecretChat) NotificationGroupTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeNotificationGroupTypeSecretChat
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
// A group containing notifications of type notificationTypeNewCall
2022-03-13 04:04:12 +00:00
type NotificationGroupTypeCalls struct{
meta
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *NotificationGroupTypeCalls) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub NotificationGroupTypeCalls
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*NotificationGroupTypeCalls) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassNotificationGroupType
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*NotificationGroupTypeCalls) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeNotificationGroupTypeCalls
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*NotificationGroupTypeCalls) NotificationGroupTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeNotificationGroupTypeCalls
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
// Contains information about a notification
type Notification struct {
2022-03-13 04:04:12 +00:00
meta
// Unique persistent identifier of this notification
Id int32 `json:"id"`
// Notification date
Date int32 `json:"date"`
// True, if the notification was initially silent
IsSilent bool `json:"is_silent"`
// Notification type
Type NotificationType `json:"type"`
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *Notification) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub Notification
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*Notification) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassNotification
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*Notification) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeNotification
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (notification *Notification) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Id int32 `json:"id"`
Date int32 `json:"date"`
IsSilent bool `json:"is_silent"`
Type json.RawMessage `json:"type"`
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
notification.Id = tmp.Id
notification.Date = tmp.Date
notification.IsSilent = tmp.IsSilent
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
fieldType, _ := UnmarshalNotificationType(tmp.Type)
notification.Type = fieldType
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return nil
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
// Describes a group of notifications
type NotificationGroup struct {
2022-03-13 04:04:12 +00:00
meta
// Unique persistent auto-incremented from 1 identifier of the notification group
Id int32 `json:"id"`
// Type of the group
Type NotificationGroupType `json:"type"`
// Identifier of a chat to which all notifications in the group belong
ChatId int64 `json:"chat_id"`
// Total number of active notifications in the group
TotalCount int32 `json:"total_count"`
// The list of active notifications
Notifications []*Notification `json:"notifications"`
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *NotificationGroup) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub NotificationGroup
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*NotificationGroup) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassNotificationGroup
2021-12-30 05:55:02 +00:00
}
func (*NotificationGroup) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeNotificationGroup
2021-12-30 05:55:02 +00:00
}
func (notificationGroup *NotificationGroup) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Id int32 `json:"id"`
Type json.RawMessage `json:"type"`
ChatId int64 `json:"chat_id"`
TotalCount int32 `json:"total_count"`
Notifications []*Notification `json:"notifications"`
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
notificationGroup.Id = tmp.Id
notificationGroup.ChatId = tmp.ChatId
notificationGroup.TotalCount = tmp.TotalCount
notificationGroup.Notifications = tmp.Notifications
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
fieldType, _ := UnmarshalNotificationGroupType(tmp.Type)
notificationGroup.Type = fieldType
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return nil
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
// Represents a boolean option
type OptionValueBoolean struct {
2022-03-13 04:04:12 +00:00
meta
// The value of the option
Value bool `json:"value"`
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *OptionValueBoolean) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub OptionValueBoolean
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*OptionValueBoolean) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassOptionValue
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*OptionValueBoolean) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeOptionValueBoolean
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*OptionValueBoolean) OptionValueType() string {
2022-03-13 04:04:12 +00:00
return TypeOptionValueBoolean
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// Represents an unknown option or an option which has a default value
2022-03-13 04:04:12 +00:00
type OptionValueEmpty struct{
meta
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *OptionValueEmpty) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub OptionValueEmpty
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*OptionValueEmpty) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassOptionValue
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*OptionValueEmpty) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeOptionValueEmpty
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*OptionValueEmpty) OptionValueType() string {
2022-03-13 04:04:12 +00:00
return TypeOptionValueEmpty
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// Represents an integer option
type OptionValueInteger struct {
2022-03-13 04:04:12 +00:00
meta
// The value of the option
Value JsonInt64 `json:"value"`
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *OptionValueInteger) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub OptionValueInteger
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*OptionValueInteger) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassOptionValue
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*OptionValueInteger) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeOptionValueInteger
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*OptionValueInteger) OptionValueType() string {
2022-03-13 04:04:12 +00:00
return TypeOptionValueInteger
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
// Represents a string option
type OptionValueString struct {
2022-03-13 04:04:12 +00:00
meta
// The value of the option
Value string `json:"value"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *OptionValueString) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub OptionValueString
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*OptionValueString) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassOptionValue
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*OptionValueString) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeOptionValueString
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*OptionValueString) OptionValueType() string {
2022-03-13 04:04:12 +00:00
return TypeOptionValueString
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// Represents one member of a JSON object
type JsonObjectMember struct {
2022-03-13 04:04:12 +00:00
meta
// Member's key
Key string `json:"key"`
// Member's value
Value JsonValue `json:"value"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *JsonObjectMember) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub JsonObjectMember
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*JsonObjectMember) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassJsonObjectMember
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*JsonObjectMember) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeJsonObjectMember
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (jsonObjectMember *JsonObjectMember) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Key string `json:"key"`
Value json.RawMessage `json:"value"`
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
jsonObjectMember.Key = tmp.Key
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
fieldValue, _ := UnmarshalJsonValue(tmp.Value)
jsonObjectMember.Value = fieldValue
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return nil
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// Represents a null JSON value
2022-03-13 04:04:12 +00:00
type JsonValueNull struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *JsonValueNull) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub JsonValueNull
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*JsonValueNull) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassJsonValue
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*JsonValueNull) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeJsonValueNull
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*JsonValueNull) JsonValueType() string {
2022-03-13 04:04:12 +00:00
return TypeJsonValueNull
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// Represents a boolean JSON value
type JsonValueBoolean struct {
2022-03-13 04:04:12 +00:00
meta
// The value
Value bool `json:"value"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *JsonValueBoolean) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub JsonValueBoolean
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*JsonValueBoolean) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassJsonValue
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*JsonValueBoolean) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeJsonValueBoolean
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*JsonValueBoolean) JsonValueType() string {
2022-03-13 04:04:12 +00:00
return TypeJsonValueBoolean
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// Represents a numeric JSON value
type JsonValueNumber struct {
2022-03-13 04:04:12 +00:00
meta
// The value
Value float64 `json:"value"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *JsonValueNumber) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub JsonValueNumber
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*JsonValueNumber) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassJsonValue
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*JsonValueNumber) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeJsonValueNumber
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*JsonValueNumber) JsonValueType() string {
2022-03-13 04:04:12 +00:00
return TypeJsonValueNumber
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// Represents a string JSON value
type JsonValueString struct {
2022-03-13 04:04:12 +00:00
meta
// The value
Value string `json:"value"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *JsonValueString) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub JsonValueString
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*JsonValueString) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassJsonValue
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*JsonValueString) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeJsonValueString
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*JsonValueString) JsonValueType() string {
2022-03-13 04:04:12 +00:00
return TypeJsonValueString
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// Represents a JSON array
type JsonValueArray struct {
2022-03-13 04:04:12 +00:00
meta
// The list of array elements
Values []JsonValue `json:"values"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *JsonValueArray) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub JsonValueArray
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*JsonValueArray) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassJsonValue
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*JsonValueArray) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeJsonValueArray
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*JsonValueArray) JsonValueType() string {
2022-03-13 04:04:12 +00:00
return TypeJsonValueArray
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (jsonValueArray *JsonValueArray) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Values []json.RawMessage `json:"values"`
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
fieldValues, _ := UnmarshalListOfJsonValue(tmp.Values)
jsonValueArray.Values = fieldValues
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return nil
2021-12-30 05:55:02 +00:00
}
// Represents a JSON object
type JsonValueObject struct {
2022-03-13 04:04:12 +00:00
meta
// The list of object members
Members []*JsonObjectMember `json:"members"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *JsonValueObject) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub JsonValueObject
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*JsonValueObject) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassJsonValue
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*JsonValueObject) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeJsonValueObject
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*JsonValueObject) JsonValueType() string {
2022-03-13 04:04:12 +00:00
return TypeJsonValueObject
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A rule to allow all users to do something
2022-03-13 04:04:12 +00:00
type UserPrivacySettingRuleAllowAll struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *UserPrivacySettingRuleAllowAll) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub UserPrivacySettingRuleAllowAll
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UserPrivacySettingRuleAllowAll) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUserPrivacySettingRule
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UserPrivacySettingRuleAllowAll) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUserPrivacySettingRuleAllowAll
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UserPrivacySettingRuleAllowAll) UserPrivacySettingRuleType() string {
2022-03-13 04:04:12 +00:00
return TypeUserPrivacySettingRuleAllowAll
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A rule to allow all of a user's contacts to do something
2022-03-13 04:04:12 +00:00
type UserPrivacySettingRuleAllowContacts struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *UserPrivacySettingRuleAllowContacts) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub UserPrivacySettingRuleAllowContacts
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UserPrivacySettingRuleAllowContacts) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUserPrivacySettingRule
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UserPrivacySettingRuleAllowContacts) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUserPrivacySettingRuleAllowContacts
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UserPrivacySettingRuleAllowContacts) UserPrivacySettingRuleType() string {
2022-03-13 04:04:12 +00:00
return TypeUserPrivacySettingRuleAllowContacts
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A rule to allow certain specified users to do something
type UserPrivacySettingRuleAllowUsers struct {
2022-03-13 04:04:12 +00:00
meta
// The user identifiers, total number of users in all rules must not exceed 1000
UserIds []int64 `json:"user_ids"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *UserPrivacySettingRuleAllowUsers) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub UserPrivacySettingRuleAllowUsers
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UserPrivacySettingRuleAllowUsers) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUserPrivacySettingRule
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UserPrivacySettingRuleAllowUsers) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUserPrivacySettingRuleAllowUsers
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UserPrivacySettingRuleAllowUsers) UserPrivacySettingRuleType() string {
2022-03-13 04:04:12 +00:00
return TypeUserPrivacySettingRuleAllowUsers
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A rule to allow all members of certain specified basic groups and supergroups to doing something
type UserPrivacySettingRuleAllowChatMembers struct {
2022-03-13 04:04:12 +00:00
meta
// The chat identifiers, total number of chats in all rules must not exceed 20
ChatIds []int64 `json:"chat_ids"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *UserPrivacySettingRuleAllowChatMembers) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub UserPrivacySettingRuleAllowChatMembers
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UserPrivacySettingRuleAllowChatMembers) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUserPrivacySettingRule
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UserPrivacySettingRuleAllowChatMembers) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUserPrivacySettingRuleAllowChatMembers
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UserPrivacySettingRuleAllowChatMembers) UserPrivacySettingRuleType() string {
2022-03-13 04:04:12 +00:00
return TypeUserPrivacySettingRuleAllowChatMembers
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A rule to restrict all users from doing something
2022-03-13 04:04:12 +00:00
type UserPrivacySettingRuleRestrictAll struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *UserPrivacySettingRuleRestrictAll) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub UserPrivacySettingRuleRestrictAll
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UserPrivacySettingRuleRestrictAll) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUserPrivacySettingRule
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UserPrivacySettingRuleRestrictAll) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUserPrivacySettingRuleRestrictAll
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UserPrivacySettingRuleRestrictAll) UserPrivacySettingRuleType() string {
2022-03-13 04:04:12 +00:00
return TypeUserPrivacySettingRuleRestrictAll
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// A rule to restrict all contacts of a user from doing something
2022-03-13 04:04:12 +00:00
type UserPrivacySettingRuleRestrictContacts struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *UserPrivacySettingRuleRestrictContacts) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub UserPrivacySettingRuleRestrictContacts
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UserPrivacySettingRuleRestrictContacts) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUserPrivacySettingRule
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UserPrivacySettingRuleRestrictContacts) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUserPrivacySettingRuleRestrictContacts
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UserPrivacySettingRuleRestrictContacts) UserPrivacySettingRuleType() string {
2022-03-13 04:04:12 +00:00
return TypeUserPrivacySettingRuleRestrictContacts
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A rule to restrict all specified users from doing something
type UserPrivacySettingRuleRestrictUsers struct {
2022-03-13 04:04:12 +00:00
meta
// The user identifiers, total number of users in all rules must not exceed 1000
UserIds []int64 `json:"user_ids"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *UserPrivacySettingRuleRestrictUsers) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub UserPrivacySettingRuleRestrictUsers
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UserPrivacySettingRuleRestrictUsers) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUserPrivacySettingRule
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UserPrivacySettingRuleRestrictUsers) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUserPrivacySettingRuleRestrictUsers
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UserPrivacySettingRuleRestrictUsers) UserPrivacySettingRuleType() string {
2022-03-13 04:04:12 +00:00
return TypeUserPrivacySettingRuleRestrictUsers
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A rule to restrict all members of specified basic groups and supergroups from doing something
type UserPrivacySettingRuleRestrictChatMembers struct {
2022-03-13 04:04:12 +00:00
meta
// The chat identifiers, total number of chats in all rules must not exceed 20
ChatIds []int64 `json:"chat_ids"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *UserPrivacySettingRuleRestrictChatMembers) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub UserPrivacySettingRuleRestrictChatMembers
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UserPrivacySettingRuleRestrictChatMembers) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUserPrivacySettingRule
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UserPrivacySettingRuleRestrictChatMembers) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUserPrivacySettingRuleRestrictChatMembers
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UserPrivacySettingRuleRestrictChatMembers) UserPrivacySettingRuleType() string {
2022-03-13 04:04:12 +00:00
return TypeUserPrivacySettingRuleRestrictChatMembers
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A list of privacy rules. Rules are matched in the specified order. The first matched rule defines the privacy setting for a given user. If no rule matches, the action is not allowed
type UserPrivacySettingRules struct {
2022-03-13 04:04:12 +00:00
meta
// A list of rules
Rules []UserPrivacySettingRule `json:"rules"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *UserPrivacySettingRules) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub UserPrivacySettingRules
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UserPrivacySettingRules) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUserPrivacySettingRules
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UserPrivacySettingRules) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUserPrivacySettingRules
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (userPrivacySettingRules *UserPrivacySettingRules) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Rules []json.RawMessage `json:"rules"`
}
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
fieldRules, _ := UnmarshalListOfUserPrivacySettingRule(tmp.Rules)
userPrivacySettingRules.Rules = fieldRules
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return nil
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A privacy setting for managing whether the user's online status is visible
2022-03-13 04:04:12 +00:00
type UserPrivacySettingShowStatus struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *UserPrivacySettingShowStatus) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub UserPrivacySettingShowStatus
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UserPrivacySettingShowStatus) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUserPrivacySetting
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UserPrivacySettingShowStatus) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUserPrivacySettingShowStatus
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UserPrivacySettingShowStatus) UserPrivacySettingType() string {
2022-03-13 04:04:12 +00:00
return TypeUserPrivacySettingShowStatus
2021-12-30 05:55:02 +00:00
}
2019-06-07 10:56:06 +00:00
2021-12-30 05:55:02 +00:00
// A privacy setting for managing whether the user's profile photo is visible
2022-03-13 04:04:12 +00:00
type UserPrivacySettingShowProfilePhoto struct{
meta
2021-12-30 05:55:02 +00:00
}
2019-06-07 10:56:06 +00:00
2021-12-30 05:55:02 +00:00
func (entity *UserPrivacySettingShowProfilePhoto) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub UserPrivacySettingShowProfilePhoto
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UserPrivacySettingShowProfilePhoto) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUserPrivacySetting
2021-12-30 05:55:02 +00:00
}
func (*UserPrivacySettingShowProfilePhoto) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUserPrivacySettingShowProfilePhoto
2021-12-30 05:55:02 +00:00
}
func (*UserPrivacySettingShowProfilePhoto) UserPrivacySettingType() string {
2022-03-13 04:04:12 +00:00
return TypeUserPrivacySettingShowProfilePhoto
2021-12-30 05:55:02 +00:00
}
// A privacy setting for managing whether a link to the user's account is included in forwarded messages
2022-03-13 04:04:12 +00:00
type UserPrivacySettingShowLinkInForwardedMessages struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *UserPrivacySettingShowLinkInForwardedMessages) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub UserPrivacySettingShowLinkInForwardedMessages
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UserPrivacySettingShowLinkInForwardedMessages) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUserPrivacySetting
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UserPrivacySettingShowLinkInForwardedMessages) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUserPrivacySettingShowLinkInForwardedMessages
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UserPrivacySettingShowLinkInForwardedMessages) UserPrivacySettingType() string {
2022-03-13 04:04:12 +00:00
return TypeUserPrivacySettingShowLinkInForwardedMessages
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A privacy setting for managing whether the user's phone number is visible
2022-03-13 04:04:12 +00:00
type UserPrivacySettingShowPhoneNumber struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *UserPrivacySettingShowPhoneNumber) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub UserPrivacySettingShowPhoneNumber
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UserPrivacySettingShowPhoneNumber) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUserPrivacySetting
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UserPrivacySettingShowPhoneNumber) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUserPrivacySettingShowPhoneNumber
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UserPrivacySettingShowPhoneNumber) UserPrivacySettingType() string {
2022-03-13 04:04:12 +00:00
return TypeUserPrivacySettingShowPhoneNumber
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A privacy setting for managing whether the user can be invited to chats
2022-03-13 04:04:12 +00:00
type UserPrivacySettingAllowChatInvites struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *UserPrivacySettingAllowChatInvites) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub UserPrivacySettingAllowChatInvites
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UserPrivacySettingAllowChatInvites) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUserPrivacySetting
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UserPrivacySettingAllowChatInvites) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUserPrivacySettingAllowChatInvites
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UserPrivacySettingAllowChatInvites) UserPrivacySettingType() string {
2022-03-13 04:04:12 +00:00
return TypeUserPrivacySettingAllowChatInvites
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A privacy setting for managing whether the user can be called
2022-03-13 04:04:12 +00:00
type UserPrivacySettingAllowCalls struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *UserPrivacySettingAllowCalls) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub UserPrivacySettingAllowCalls
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UserPrivacySettingAllowCalls) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUserPrivacySetting
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UserPrivacySettingAllowCalls) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUserPrivacySettingAllowCalls
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UserPrivacySettingAllowCalls) UserPrivacySettingType() string {
2022-03-13 04:04:12 +00:00
return TypeUserPrivacySettingAllowCalls
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A privacy setting for managing whether peer-to-peer connections can be used for calls
2022-03-13 04:04:12 +00:00
type UserPrivacySettingAllowPeerToPeerCalls struct{
meta
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *UserPrivacySettingAllowPeerToPeerCalls) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub UserPrivacySettingAllowPeerToPeerCalls
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UserPrivacySettingAllowPeerToPeerCalls) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUserPrivacySetting
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UserPrivacySettingAllowPeerToPeerCalls) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUserPrivacySettingAllowPeerToPeerCalls
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UserPrivacySettingAllowPeerToPeerCalls) UserPrivacySettingType() string {
2022-03-13 04:04:12 +00:00
return TypeUserPrivacySettingAllowPeerToPeerCalls
2021-12-30 05:55:02 +00:00
}
2019-06-07 10:56:06 +00:00
2021-12-30 05:55:02 +00:00
// A privacy setting for managing whether the user can be found by their phone number. Checked only if the phone number is not known to the other user. Can be set only to "Allow contacts" or "Allow all"
2022-03-13 04:04:12 +00:00
type UserPrivacySettingAllowFindingByPhoneNumber struct{
meta
2021-12-30 05:55:02 +00:00
}
func (entity *UserPrivacySettingAllowFindingByPhoneNumber) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub UserPrivacySettingAllowFindingByPhoneNumber
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
2019-06-07 10:56:06 +00:00
2021-12-30 05:55:02 +00:00
func (*UserPrivacySettingAllowFindingByPhoneNumber) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUserPrivacySetting
2021-12-30 05:55:02 +00:00
}
2019-06-07 10:56:06 +00:00
2021-12-30 05:55:02 +00:00
func (*UserPrivacySettingAllowFindingByPhoneNumber) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUserPrivacySettingAllowFindingByPhoneNumber
2021-12-30 05:55:02 +00:00
}
2019-06-07 10:56:06 +00:00
2021-12-30 05:55:02 +00:00
func (*UserPrivacySettingAllowFindingByPhoneNumber) UserPrivacySettingType() string {
2022-03-13 04:04:12 +00:00
return TypeUserPrivacySettingAllowFindingByPhoneNumber
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// Contains information about the period of inactivity after which the current user's account will automatically be deleted
type AccountTtl struct {
2022-03-13 04:04:12 +00:00
meta
// Number of days of inactivity before the account will be flagged for deletion; 30-366 days
Days int32 `json:"days"`
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *AccountTtl) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub AccountTtl
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*AccountTtl) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassAccountTtl
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*AccountTtl) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeAccountTtl
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// Contains information about one session in a Telegram application used by the current user. Sessions must be shown to the user in the returned order
type Session struct {
2022-03-13 04:04:12 +00:00
meta
// Session identifier
Id JsonInt64 `json:"id"`
// True, if this session is the current session
IsCurrent bool `json:"is_current"`
// True, if a password is needed to complete authorization of the session
IsPasswordPending bool `json:"is_password_pending"`
// True, if incoming secret chats can be accepted by the session
CanAcceptSecretChats bool `json:"can_accept_secret_chats"`
// True, if incoming calls can be accepted by the session
CanAcceptCalls bool `json:"can_accept_calls"`
// Telegram API identifier, as provided by the application
ApiId int32 `json:"api_id"`
// Name of the application, as provided by the application
ApplicationName string `json:"application_name"`
// The version of the application, as provided by the application
ApplicationVersion string `json:"application_version"`
// True, if the application is an official application or uses the api_id of an official application
IsOfficialApplication bool `json:"is_official_application"`
// Model of the device the application has been run or is running on, as provided by the application
DeviceModel string `json:"device_model"`
// Operating system the application has been run or is running on, as provided by the application
Platform string `json:"platform"`
// Version of the operating system the application has been run or is running on, as provided by the application
SystemVersion string `json:"system_version"`
// Point in time (Unix timestamp) when the user has logged in
LogInDate int32 `json:"log_in_date"`
// Point in time (Unix timestamp) when the session was last used
LastActiveDate int32 `json:"last_active_date"`
// IP address from which the session was created, in human-readable format
Ip string `json:"ip"`
// A two-letter country code for the country from which the session was created, based on the IP address
Country string `json:"country"`
// Region code from which the session was created, based on the IP address
Region string `json:"region"`
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *Session) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub Session
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*Session) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassSession
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*Session) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeSession
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// Contains a list of sessions
type Sessions struct {
2022-03-13 04:04:12 +00:00
meta
// List of sessions
Sessions []*Session `json:"sessions"`
// Number of days of inactivity before sessions will automatically be terminated; 1-366 days
InactiveSessionTtlDays int32 `json:"inactive_session_ttl_days"`
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *Sessions) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub Sessions
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*Sessions) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassSessions
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*Sessions) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeSessions
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// Contains information about one website the current user is logged in with Telegram
type ConnectedWebsite struct {
2022-03-13 04:04:12 +00:00
meta
// Website identifier
Id JsonInt64 `json:"id"`
// The domain name of the website
DomainName string `json:"domain_name"`
// User identifier of a bot linked with the website
BotUserId int64 `json:"bot_user_id"`
// The version of a browser used to log in
Browser string `json:"browser"`
// Operating system the browser is running on
Platform string `json:"platform"`
// Point in time (Unix timestamp) when the user was logged in
LogInDate int32 `json:"log_in_date"`
// Point in time (Unix timestamp) when obtained authorization was last used
LastActiveDate int32 `json:"last_active_date"`
// IP address from which the user was logged in, in human-readable format
Ip string `json:"ip"`
// Human-readable description of a country and a region, from which the user was logged in, based on the IP address
Location string `json:"location"`
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *ConnectedWebsite) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub ConnectedWebsite
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ConnectedWebsite) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassConnectedWebsite
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ConnectedWebsite) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeConnectedWebsite
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// Contains a list of websites the current user is logged in with Telegram
type ConnectedWebsites struct {
2022-03-13 04:04:12 +00:00
meta
// List of connected websites
Websites []*ConnectedWebsite `json:"websites"`
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *ConnectedWebsites) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub ConnectedWebsites
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ConnectedWebsites) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassConnectedWebsites
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ConnectedWebsites) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeConnectedWebsites
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// The chat contains spam messages
2022-03-13 04:04:12 +00:00
type ChatReportReasonSpam struct{
meta
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *ChatReportReasonSpam) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-01-18 14:16:52 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatReportReasonSpam
2021-01-18 14:16:52 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
2021-01-18 14:16:52 +00:00
2021-12-30 05:55:02 +00:00
func (*ChatReportReasonSpam) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatReportReason
2021-01-18 14:16:52 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatReportReasonSpam) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatReportReasonSpam
2021-12-30 05:55:02 +00:00
}
func (*ChatReportReasonSpam) ChatReportReasonType() string {
2022-03-13 04:04:12 +00:00
return TypeChatReportReasonSpam
2021-12-30 05:55:02 +00:00
}
// The chat promotes violence
2022-03-13 04:04:12 +00:00
type ChatReportReasonViolence struct{
meta
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *ChatReportReasonViolence) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatReportReasonViolence
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatReportReasonViolence) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatReportReason
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatReportReasonViolence) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatReportReasonViolence
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatReportReasonViolence) ChatReportReasonType() string {
2022-03-13 04:04:12 +00:00
return TypeChatReportReasonViolence
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// The chat contains pornographic messages
2022-03-13 04:04:12 +00:00
type ChatReportReasonPornography struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *ChatReportReasonPornography) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatReportReasonPornography
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatReportReasonPornography) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatReportReason
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatReportReasonPornography) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatReportReasonPornography
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatReportReasonPornography) ChatReportReasonType() string {
2022-03-13 04:04:12 +00:00
return TypeChatReportReasonPornography
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// The chat has child abuse related content
2022-03-13 04:04:12 +00:00
type ChatReportReasonChildAbuse struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *ChatReportReasonChildAbuse) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatReportReasonChildAbuse
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatReportReasonChildAbuse) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatReportReason
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatReportReasonChildAbuse) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatReportReasonChildAbuse
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatReportReasonChildAbuse) ChatReportReasonType() string {
2022-03-13 04:04:12 +00:00
return TypeChatReportReasonChildAbuse
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// The chat contains copyrighted content
2022-03-13 04:04:12 +00:00
type ChatReportReasonCopyright struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *ChatReportReasonCopyright) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatReportReasonCopyright
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatReportReasonCopyright) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatReportReason
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatReportReasonCopyright) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatReportReasonCopyright
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatReportReasonCopyright) ChatReportReasonType() string {
2022-03-13 04:04:12 +00:00
return TypeChatReportReasonCopyright
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// The location-based chat is unrelated to its stated location
2022-03-13 04:04:12 +00:00
type ChatReportReasonUnrelatedLocation struct{
meta
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *ChatReportReasonUnrelatedLocation) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatReportReasonUnrelatedLocation
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatReportReasonUnrelatedLocation) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatReportReason
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatReportReasonUnrelatedLocation) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatReportReasonUnrelatedLocation
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatReportReasonUnrelatedLocation) ChatReportReasonType() string {
2022-03-13 04:04:12 +00:00
return TypeChatReportReasonUnrelatedLocation
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
// The chat represents a fake account
2022-03-13 04:04:12 +00:00
type ChatReportReasonFake struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *ChatReportReasonFake) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatReportReasonFake
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatReportReasonFake) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatReportReason
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatReportReasonFake) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatReportReasonFake
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatReportReasonFake) ChatReportReasonType() string {
2022-03-13 04:04:12 +00:00
return TypeChatReportReasonFake
}
// The chat has illegal drugs related content
type ChatReportReasonIllegalDrugs struct{
meta
}
func (entity *ChatReportReasonIllegalDrugs) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ChatReportReasonIllegalDrugs
return json.Marshal((*stub)(entity))
}
func (*ChatReportReasonIllegalDrugs) GetClass() string {
return ClassChatReportReason
}
func (*ChatReportReasonIllegalDrugs) GetType() string {
return TypeChatReportReasonIllegalDrugs
}
func (*ChatReportReasonIllegalDrugs) ChatReportReasonType() string {
return TypeChatReportReasonIllegalDrugs
}
// The chat contains messages with personal details
type ChatReportReasonPersonalDetails struct{
meta
}
func (entity *ChatReportReasonPersonalDetails) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ChatReportReasonPersonalDetails
return json.Marshal((*stub)(entity))
}
func (*ChatReportReasonPersonalDetails) GetClass() string {
return ClassChatReportReason
}
func (*ChatReportReasonPersonalDetails) GetType() string {
return TypeChatReportReasonPersonalDetails
}
func (*ChatReportReasonPersonalDetails) ChatReportReasonType() string {
return TypeChatReportReasonPersonalDetails
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A custom reason provided by the user
2022-03-13 04:04:12 +00:00
type ChatReportReasonCustom struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *ChatReportReasonCustom) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatReportReasonCustom
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatReportReasonCustom) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatReportReason
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatReportReasonCustom) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatReportReasonCustom
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*ChatReportReasonCustom) ChatReportReasonType() string {
2022-03-13 04:04:12 +00:00
return TypeChatReportReasonCustom
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// The link is a link to the active sessions section of the app. Use getActiveSessions to handle the link
2022-03-13 04:04:12 +00:00
type InternalLinkTypeActiveSessions struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InternalLinkTypeActiveSessions) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub InternalLinkTypeActiveSessions
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InternalLinkTypeActiveSessions) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInternalLinkType
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InternalLinkTypeActiveSessions) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInternalLinkTypeActiveSessions
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InternalLinkTypeActiveSessions) InternalLinkTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeInternalLinkTypeActiveSessions
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// The link contains an authentication code. Call checkAuthenticationCode with the code if the current authorization state is authorizationStateWaitCode
type InternalLinkTypeAuthenticationCode struct {
2022-03-13 04:04:12 +00:00
meta
// The authentication code
Code string `json:"code"`
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InternalLinkTypeAuthenticationCode) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
type stub InternalLinkTypeAuthenticationCode
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InternalLinkTypeAuthenticationCode) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInternalLinkType
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InternalLinkTypeAuthenticationCode) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInternalLinkTypeAuthenticationCode
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InternalLinkTypeAuthenticationCode) InternalLinkTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeInternalLinkTypeAuthenticationCode
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
// The link is a link to a background. Call searchBackground with the given background name to process the link
type InternalLinkTypeBackground struct {
2022-03-13 04:04:12 +00:00
meta
// Name of the background
BackgroundName string `json:"background_name"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InternalLinkTypeBackground) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub InternalLinkTypeBackground
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InternalLinkTypeBackground) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInternalLinkType
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InternalLinkTypeBackground) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInternalLinkTypeBackground
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InternalLinkTypeBackground) InternalLinkTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeInternalLinkTypeBackground
2021-01-18 14:16:52 +00:00
}
2021-12-30 05:55:02 +00:00
// The link is a link to a chat with a Telegram bot. Call searchPublicChat with the given bot username, check that the user is a bot, show START button in the chat with the bot, and then call sendBotStartMessage with the given start parameter after the button is pressed
type InternalLinkTypeBotStart struct {
2022-03-13 04:04:12 +00:00
meta
// Username of the bot
BotUsername string `json:"bot_username"`
// The parameter to be passed to sendBotStartMessage
StartParameter string `json:"start_parameter"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InternalLinkTypeBotStart) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub InternalLinkTypeBotStart
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InternalLinkTypeBotStart) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInternalLinkType
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InternalLinkTypeBotStart) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInternalLinkTypeBotStart
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InternalLinkTypeBotStart) InternalLinkTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeInternalLinkTypeBotStart
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// The link is a link to a Telegram bot, which is supposed to be added to a group chat. Call searchPublicChat with the given bot username, check that the user is a bot and can be added to groups, ask the current user to select a group to add the bot to, and then call sendBotStartMessage with the given start parameter and the chosen group chat. Bots can be added to a public group only by administrators of the group
type InternalLinkTypeBotStartInGroup struct {
2022-03-13 04:04:12 +00:00
meta
// Username of the bot
BotUsername string `json:"bot_username"`
// The parameter to be passed to sendBotStartMessage
StartParameter string `json:"start_parameter"`
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InternalLinkTypeBotStartInGroup) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-09-10 12:36:54 +00:00
2022-03-13 04:04:12 +00:00
type stub InternalLinkTypeBotStartInGroup
2019-09-10 12:36:54 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InternalLinkTypeBotStartInGroup) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInternalLinkType
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InternalLinkTypeBotStartInGroup) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInternalLinkTypeBotStartInGroup
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InternalLinkTypeBotStartInGroup) InternalLinkTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeInternalLinkTypeBotStartInGroup
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
// The link is a link to the change phone number section of the app
2022-03-13 04:04:12 +00:00
type InternalLinkTypeChangePhoneNumber struct{
meta
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InternalLinkTypeChangePhoneNumber) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-09-10 12:36:54 +00:00
2022-03-13 04:04:12 +00:00
type stub InternalLinkTypeChangePhoneNumber
2019-09-10 12:36:54 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InternalLinkTypeChangePhoneNumber) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInternalLinkType
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InternalLinkTypeChangePhoneNumber) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInternalLinkTypeChangePhoneNumber
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InternalLinkTypeChangePhoneNumber) InternalLinkTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeInternalLinkTypeChangePhoneNumber
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
// The link is a chat invite link. Call checkChatInviteLink with the given invite link to process the link
type InternalLinkTypeChatInvite struct {
2022-03-13 04:04:12 +00:00
meta
// Internal representation of the invite link
InviteLink string `json:"invite_link"`
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InternalLinkTypeChatInvite) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
type stub InternalLinkTypeChatInvite
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InternalLinkTypeChatInvite) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInternalLinkType
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InternalLinkTypeChatInvite) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInternalLinkTypeChatInvite
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InternalLinkTypeChatInvite) InternalLinkTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeInternalLinkTypeChatInvite
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
// The link is a link to the filter settings section of the app
2022-03-13 04:04:12 +00:00
type InternalLinkTypeFilterSettings struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InternalLinkTypeFilterSettings) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub InternalLinkTypeFilterSettings
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InternalLinkTypeFilterSettings) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInternalLinkType
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InternalLinkTypeFilterSettings) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInternalLinkTypeFilterSettings
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InternalLinkTypeFilterSettings) InternalLinkTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeInternalLinkTypeFilterSettings
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// The link is a link to a game. Call searchPublicChat with the given bot username, check that the user is a bot, ask the current user to select a chat to send the game, and then call sendMessage with inputMessageGame
type InternalLinkTypeGame struct {
2022-03-13 04:04:12 +00:00
meta
// Username of the bot that owns the game
BotUsername string `json:"bot_username"`
// Short name of the game
GameShortName string `json:"game_short_name"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InternalLinkTypeGame) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub InternalLinkTypeGame
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InternalLinkTypeGame) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInternalLinkType
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InternalLinkTypeGame) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInternalLinkTypeGame
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InternalLinkTypeGame) InternalLinkTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeInternalLinkTypeGame
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// The link is a link to a language pack. Call getLanguagePackInfo with the given language pack identifier to process the link
type InternalLinkTypeLanguagePack struct {
2022-03-13 04:04:12 +00:00
meta
// Language pack identifier
LanguagePackId string `json:"language_pack_id"`
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InternalLinkTypeLanguagePack) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub InternalLinkTypeLanguagePack
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InternalLinkTypeLanguagePack) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInternalLinkType
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InternalLinkTypeLanguagePack) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInternalLinkTypeLanguagePack
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InternalLinkTypeLanguagePack) InternalLinkTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeInternalLinkTypeLanguagePack
2019-06-07 10:56:06 +00:00
}
2022-03-31 08:54:35 +00:00
// The link is a link to the language settings section of the app
type InternalLinkTypeLanguageSettings struct{
meta
}
func (entity *InternalLinkTypeLanguageSettings) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub InternalLinkTypeLanguageSettings
return json.Marshal((*stub)(entity))
}
func (*InternalLinkTypeLanguageSettings) GetClass() string {
return ClassInternalLinkType
}
func (*InternalLinkTypeLanguageSettings) GetType() string {
return TypeInternalLinkTypeLanguageSettings
}
func (*InternalLinkTypeLanguageSettings) InternalLinkTypeType() string {
return TypeInternalLinkTypeLanguageSettings
}
2021-12-30 05:55:02 +00:00
// The link is a link to a Telegram message. Call getMessageLinkInfo with the given URL to process the link
type InternalLinkTypeMessage struct {
2022-03-13 04:04:12 +00:00
meta
// URL to be passed to getMessageLinkInfo
Url string `json:"url"`
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InternalLinkTypeMessage) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
type stub InternalLinkTypeMessage
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InternalLinkTypeMessage) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInternalLinkType
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InternalLinkTypeMessage) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInternalLinkTypeMessage
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InternalLinkTypeMessage) InternalLinkTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeInternalLinkTypeMessage
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
// The link contains a message draft text. A share screen needs to be shown to the user, then the chosen chat must be opened and the text is added to the input field
type InternalLinkTypeMessageDraft struct {
2022-03-13 04:04:12 +00:00
meta
// Message draft text
Text *FormattedText `json:"text"`
// True, if the first line of the text contains a link. If true, the input field needs to be focused and the text after the link must be selected
ContainsLink bool `json:"contains_link"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InternalLinkTypeMessageDraft) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub InternalLinkTypeMessageDraft
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InternalLinkTypeMessageDraft) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInternalLinkType
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InternalLinkTypeMessageDraft) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInternalLinkTypeMessageDraft
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InternalLinkTypeMessageDraft) InternalLinkTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeInternalLinkTypeMessageDraft
2021-12-30 05:55:02 +00:00
}
// The link contains a request of Telegram passport data. Call getPassportAuthorizationForm with the given parameters to process the link if the link was received from outside of the app, otherwise ignore it
type InternalLinkTypePassportDataRequest struct {
2022-03-13 04:04:12 +00:00
meta
// User identifier of the service's bot
BotUserId int64 `json:"bot_user_id"`
// Telegram Passport element types requested by the service
Scope string `json:"scope"`
// Service's public key
PublicKey string `json:"public_key"`
// Unique request identifier provided by the service
Nonce string `json:"nonce"`
// An HTTP URL to open once the request is finished or canceled with the parameter tg_passport=success or tg_passport=cancel respectively. If empty, then the link tgbot{bot_user_id}://passport/success or tgbot{bot_user_id}://passport/cancel needs to be opened instead
CallbackUrl string `json:"callback_url"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InternalLinkTypePassportDataRequest) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub InternalLinkTypePassportDataRequest
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InternalLinkTypePassportDataRequest) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInternalLinkType
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InternalLinkTypePassportDataRequest) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInternalLinkTypePassportDataRequest
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InternalLinkTypePassportDataRequest) InternalLinkTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeInternalLinkTypePassportDataRequest
2021-12-30 05:55:02 +00:00
}
// The link can be used to confirm ownership of a phone number to prevent account deletion. Call sendPhoneNumberConfirmationCode with the given hash and phone number to process the link
type InternalLinkTypePhoneNumberConfirmation struct {
2022-03-13 04:04:12 +00:00
meta
// Hash value from the link
Hash string `json:"hash"`
// Phone number value from the link
PhoneNumber string `json:"phone_number"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InternalLinkTypePhoneNumberConfirmation) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub InternalLinkTypePhoneNumberConfirmation
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InternalLinkTypePhoneNumberConfirmation) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInternalLinkType
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InternalLinkTypePhoneNumberConfirmation) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInternalLinkTypePhoneNumberConfirmation
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InternalLinkTypePhoneNumberConfirmation) InternalLinkTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeInternalLinkTypePhoneNumberConfirmation
2021-12-30 05:55:02 +00:00
}
2022-03-31 08:54:35 +00:00
// The link is a link to the privacy and security settings section of the app
type InternalLinkTypePrivacyAndSecuritySettings struct{
meta
}
func (entity *InternalLinkTypePrivacyAndSecuritySettings) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub InternalLinkTypePrivacyAndSecuritySettings
return json.Marshal((*stub)(entity))
}
func (*InternalLinkTypePrivacyAndSecuritySettings) GetClass() string {
return ClassInternalLinkType
}
func (*InternalLinkTypePrivacyAndSecuritySettings) GetType() string {
return TypeInternalLinkTypePrivacyAndSecuritySettings
}
func (*InternalLinkTypePrivacyAndSecuritySettings) InternalLinkTypeType() string {
return TypeInternalLinkTypePrivacyAndSecuritySettings
}
2021-12-30 05:55:02 +00:00
// The link is a link to a proxy. Call addProxy with the given parameters to process the link and add the proxy
type InternalLinkTypeProxy struct {
2022-03-13 04:04:12 +00:00
meta
// Proxy server IP address
Server string `json:"server"`
// Proxy server port
Port int32 `json:"port"`
// Type of the proxy
Type ProxyType `json:"type"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InternalLinkTypeProxy) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub InternalLinkTypeProxy
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InternalLinkTypeProxy) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInternalLinkType
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InternalLinkTypeProxy) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInternalLinkTypeProxy
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InternalLinkTypeProxy) InternalLinkTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeInternalLinkTypeProxy
2021-12-30 05:55:02 +00:00
}
func (internalLinkTypeProxy *InternalLinkTypeProxy) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Server string `json:"server"`
Port int32 `json:"port"`
Type json.RawMessage `json:"type"`
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
internalLinkTypeProxy.Server = tmp.Server
internalLinkTypeProxy.Port = tmp.Port
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
fieldType, _ := UnmarshalProxyType(tmp.Type)
internalLinkTypeProxy.Type = fieldType
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return nil
2021-12-30 05:55:02 +00:00
}
// The link is a link to a chat by its username. Call searchPublicChat with the given chat username to process the link
type InternalLinkTypePublicChat struct {
2022-03-13 04:04:12 +00:00
meta
// Username of the chat
ChatUsername string `json:"chat_username"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InternalLinkTypePublicChat) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub InternalLinkTypePublicChat
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InternalLinkTypePublicChat) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInternalLinkType
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InternalLinkTypePublicChat) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInternalLinkTypePublicChat
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InternalLinkTypePublicChat) InternalLinkTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeInternalLinkTypePublicChat
2021-12-30 05:55:02 +00:00
}
// The link can be used to login the current user on another device, but it must be scanned from QR-code using in-app camera. An alert similar to "This code can be used to allow someone to log in to your Telegram account. To confirm Telegram login, please go to Settings > Devices > Scan QR and scan the code" needs to be shown
2022-03-13 04:04:12 +00:00
type InternalLinkTypeQrCodeAuthentication struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InternalLinkTypeQrCodeAuthentication) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub InternalLinkTypeQrCodeAuthentication
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InternalLinkTypeQrCodeAuthentication) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInternalLinkType
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InternalLinkTypeQrCodeAuthentication) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInternalLinkTypeQrCodeAuthentication
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InternalLinkTypeQrCodeAuthentication) InternalLinkTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeInternalLinkTypeQrCodeAuthentication
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// The link is a link to app settings
2022-03-13 04:04:12 +00:00
type InternalLinkTypeSettings struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InternalLinkTypeSettings) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub InternalLinkTypeSettings
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InternalLinkTypeSettings) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInternalLinkType
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InternalLinkTypeSettings) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInternalLinkTypeSettings
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InternalLinkTypeSettings) InternalLinkTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeInternalLinkTypeSettings
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// The link is a link to a sticker set. Call searchStickerSet with the given sticker set name to process the link and show the sticker set
type InternalLinkTypeStickerSet struct {
2022-03-13 04:04:12 +00:00
meta
// Name of the sticker set
StickerSetName string `json:"sticker_set_name"`
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InternalLinkTypeStickerSet) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub InternalLinkTypeStickerSet
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InternalLinkTypeStickerSet) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInternalLinkType
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InternalLinkTypeStickerSet) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInternalLinkTypeStickerSet
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InternalLinkTypeStickerSet) InternalLinkTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeInternalLinkTypeStickerSet
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// The link is a link to a theme. TDLib has no theme support yet
type InternalLinkTypeTheme struct {
2022-03-13 04:04:12 +00:00
meta
// Name of the theme
ThemeName string `json:"theme_name"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InternalLinkTypeTheme) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub InternalLinkTypeTheme
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InternalLinkTypeTheme) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInternalLinkType
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InternalLinkTypeTheme) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInternalLinkTypeTheme
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InternalLinkTypeTheme) InternalLinkTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeInternalLinkTypeTheme
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// The link is a link to the theme settings section of the app
2022-03-13 04:04:12 +00:00
type InternalLinkTypeThemeSettings struct{
meta
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InternalLinkTypeThemeSettings) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub InternalLinkTypeThemeSettings
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InternalLinkTypeThemeSettings) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInternalLinkType
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InternalLinkTypeThemeSettings) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInternalLinkTypeThemeSettings
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InternalLinkTypeThemeSettings) InternalLinkTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeInternalLinkTypeThemeSettings
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
// The link is an unknown tg: link. Call getDeepLinkInfo to process the link
type InternalLinkTypeUnknownDeepLink struct {
2022-03-13 04:04:12 +00:00
meta
// Link to be passed to getDeepLinkInfo
Link string `json:"link"`
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InternalLinkTypeUnknownDeepLink) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
type stub InternalLinkTypeUnknownDeepLink
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InternalLinkTypeUnknownDeepLink) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInternalLinkType
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InternalLinkTypeUnknownDeepLink) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInternalLinkTypeUnknownDeepLink
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InternalLinkTypeUnknownDeepLink) InternalLinkTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeInternalLinkTypeUnknownDeepLink
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
// The link is a link to an unsupported proxy. An alert can be shown to the user
2022-03-13 04:04:12 +00:00
type InternalLinkTypeUnsupportedProxy struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *InternalLinkTypeUnsupportedProxy) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub InternalLinkTypeUnsupportedProxy
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InternalLinkTypeUnsupportedProxy) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInternalLinkType
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InternalLinkTypeUnsupportedProxy) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInternalLinkTypeUnsupportedProxy
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*InternalLinkTypeUnsupportedProxy) InternalLinkTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeInternalLinkTypeUnsupportedProxy
}
// The link is a link to a user by its phone number. Call searchUserByPhoneNumber with the given phone number to process the link
type InternalLinkTypeUserPhoneNumber struct {
meta
// Phone number of the user
PhoneNumber string `json:"phone_number"`
}
func (entity *InternalLinkTypeUserPhoneNumber) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub InternalLinkTypeUserPhoneNumber
return json.Marshal((*stub)(entity))
}
func (*InternalLinkTypeUserPhoneNumber) GetClass() string {
return ClassInternalLinkType
}
func (*InternalLinkTypeUserPhoneNumber) GetType() string {
return TypeInternalLinkTypeUserPhoneNumber
}
func (*InternalLinkTypeUserPhoneNumber) InternalLinkTypeType() string {
return TypeInternalLinkTypeUserPhoneNumber
2021-12-30 05:55:02 +00:00
}
2022-02-06 18:36:17 +00:00
// The link is a link to a video chat. Call searchPublicChat with the given chat username, and then joinGroupCall with the given invite hash to process the link
2021-12-30 05:55:02 +00:00
type InternalLinkTypeVideoChat struct {
2022-03-13 04:04:12 +00:00
meta
// Username of the chat with the video chat
ChatUsername string `json:"chat_username"`
// If non-empty, invite hash to be used to join the video chat without being muted by administrators
InviteHash string `json:"invite_hash"`
// True, if the video chat is expected to be a live stream in a channel or a broadcast group
IsLiveStream bool `json:"is_live_stream"`
2021-12-30 05:55:02 +00:00
}
func (entity *InternalLinkTypeVideoChat) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub InternalLinkTypeVideoChat
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*InternalLinkTypeVideoChat) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInternalLinkType
2021-12-30 05:55:02 +00:00
}
func (*InternalLinkTypeVideoChat) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInternalLinkTypeVideoChat
2021-12-30 05:55:02 +00:00
}
func (*InternalLinkTypeVideoChat) InternalLinkTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeInternalLinkTypeVideoChat
2018-08-30 14:55:42 +00:00
}
2020-11-30 09:33:47 +00:00
// Contains an HTTPS link to a message in a supergroup or channel
type MessageLink struct {
2022-03-13 04:04:12 +00:00
meta
// Message link
Link string `json:"link"`
// True, if the link will work for non-members of the chat
IsPublic bool `json:"is_public"`
2018-08-30 14:55:42 +00:00
}
2020-11-30 09:33:47 +00:00
func (entity *MessageLink) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub MessageLink
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2020-11-30 09:33:47 +00:00
func (*MessageLink) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageLink
2018-08-30 14:55:42 +00:00
}
2020-11-30 09:33:47 +00:00
func (*MessageLink) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageLink
2018-08-30 14:55:42 +00:00
}
2019-09-10 12:36:54 +00:00
// Contains information about a link to a message in a chat
type MessageLinkInfo struct {
2022-03-13 04:04:12 +00:00
meta
// True, if the link is a public link for a message in a chat
IsPublic bool `json:"is_public"`
// If found, identifier of the chat to which the message belongs, 0 otherwise
ChatId int64 `json:"chat_id"`
// If found, the linked message; may be null
Message *Message `json:"message"`
// Timestamp from which the video/audio/video note/voice note playing must start, in seconds; 0 if not specified. The media can be in the message content or in its web page preview
MediaTimestamp int32 `json:"media_timestamp"`
// True, if the whole media album to which the message belongs is linked
ForAlbum bool `json:"for_album"`
// True, if the message is linked as a channel post comment or from a message thread
ForComment bool `json:"for_comment"`
2019-09-10 12:36:54 +00:00
}
func (entity *MessageLinkInfo) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-09-10 12:36:54 +00:00
2022-03-13 04:04:12 +00:00
type stub MessageLinkInfo
2019-09-10 12:36:54 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-09-10 12:36:54 +00:00
}
func (*MessageLinkInfo) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageLinkInfo
2019-09-10 12:36:54 +00:00
}
func (*MessageLinkInfo) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageLinkInfo
2019-09-10 12:36:54 +00:00
}
2019-06-07 10:56:06 +00:00
// Contains a part of a file
type FilePart struct {
2022-03-13 04:04:12 +00:00
meta
// File bytes
Data []byte `json:"data"`
2019-06-07 10:56:06 +00:00
}
func (entity *FilePart) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub FilePart
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
func (*FilePart) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassFilePart
2019-06-07 10:56:06 +00:00
}
func (*FilePart) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeFilePart
2019-06-07 10:56:06 +00:00
}
2018-08-30 14:55:42 +00:00
// The data is not a file
2022-03-13 04:04:12 +00:00
type FileTypeNone struct{
meta
2018-08-30 14:55:42 +00:00
}
func (entity *FileTypeNone) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub FileTypeNone
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*FileTypeNone) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassFileType
2018-08-30 14:55:42 +00:00
}
func (*FileTypeNone) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeFileTypeNone
2018-08-30 14:55:42 +00:00
}
func (*FileTypeNone) FileTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeFileTypeNone
2018-08-30 14:55:42 +00:00
}
// The file is an animation
2022-03-13 04:04:12 +00:00
type FileTypeAnimation struct{
meta
2018-08-30 14:55:42 +00:00
}
func (entity *FileTypeAnimation) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub FileTypeAnimation
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*FileTypeAnimation) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassFileType
2018-08-30 14:55:42 +00:00
}
func (*FileTypeAnimation) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeFileTypeAnimation
2018-08-30 14:55:42 +00:00
}
func (*FileTypeAnimation) FileTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeFileTypeAnimation
2018-08-30 14:55:42 +00:00
}
// The file is an audio file
2022-03-13 04:04:12 +00:00
type FileTypeAudio struct{
meta
2018-08-30 14:55:42 +00:00
}
func (entity *FileTypeAudio) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub FileTypeAudio
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*FileTypeAudio) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassFileType
2018-08-30 14:55:42 +00:00
}
func (*FileTypeAudio) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeFileTypeAudio
2018-08-30 14:55:42 +00:00
}
func (*FileTypeAudio) FileTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeFileTypeAudio
2018-08-30 14:55:42 +00:00
}
// The file is a document
2022-03-13 04:04:12 +00:00
type FileTypeDocument struct{
meta
2018-08-30 14:55:42 +00:00
}
func (entity *FileTypeDocument) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub FileTypeDocument
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*FileTypeDocument) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassFileType
2018-08-30 14:55:42 +00:00
}
func (*FileTypeDocument) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeFileTypeDocument
2018-08-30 14:55:42 +00:00
}
func (*FileTypeDocument) FileTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeFileTypeDocument
2018-08-30 14:55:42 +00:00
}
// The file is a photo
2022-03-13 04:04:12 +00:00
type FileTypePhoto struct{
meta
2018-08-30 14:55:42 +00:00
}
func (entity *FileTypePhoto) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub FileTypePhoto
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*FileTypePhoto) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassFileType
2018-08-30 14:55:42 +00:00
}
func (*FileTypePhoto) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeFileTypePhoto
2018-08-30 14:55:42 +00:00
}
func (*FileTypePhoto) FileTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeFileTypePhoto
2018-08-30 14:55:42 +00:00
}
// The file is a profile photo
2022-03-13 04:04:12 +00:00
type FileTypeProfilePhoto struct{
meta
2018-08-30 14:55:42 +00:00
}
func (entity *FileTypeProfilePhoto) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub FileTypeProfilePhoto
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*FileTypeProfilePhoto) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassFileType
2018-08-30 14:55:42 +00:00
}
func (*FileTypeProfilePhoto) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeFileTypeProfilePhoto
2018-08-30 14:55:42 +00:00
}
2018-09-05 21:45:29 +00:00
func (*FileTypeProfilePhoto) FileTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeFileTypeProfilePhoto
2018-09-05 21:45:29 +00:00
}
// The file was sent to a secret chat (the file type is not known to the server)
2022-03-13 04:04:12 +00:00
type FileTypeSecret struct{
meta
2018-09-05 21:45:29 +00:00
}
func (entity *FileTypeSecret) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub FileTypeSecret
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
func (*FileTypeSecret) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassFileType
2018-09-05 21:45:29 +00:00
}
func (*FileTypeSecret) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeFileTypeSecret
2018-09-05 21:45:29 +00:00
}
func (*FileTypeSecret) FileTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeFileTypeSecret
2018-09-05 21:45:29 +00:00
}
// The file is a thumbnail of a file from a secret chat
2022-03-13 04:04:12 +00:00
type FileTypeSecretThumbnail struct{
meta
2018-09-05 21:45:29 +00:00
}
func (entity *FileTypeSecretThumbnail) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub FileTypeSecretThumbnail
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
func (*FileTypeSecretThumbnail) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassFileType
2018-09-05 21:45:29 +00:00
}
func (*FileTypeSecretThumbnail) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeFileTypeSecretThumbnail
2018-09-05 21:45:29 +00:00
}
func (*FileTypeSecretThumbnail) FileTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeFileTypeSecretThumbnail
2018-08-30 14:55:42 +00:00
}
2018-09-05 21:45:29 +00:00
// The file is a file from Secure storage used for storing Telegram Passport files
2022-03-13 04:04:12 +00:00
type FileTypeSecure struct{
meta
2018-08-30 14:55:42 +00:00
}
2018-09-05 21:45:29 +00:00
func (entity *FileTypeSecure) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub FileTypeSecure
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2018-09-05 21:45:29 +00:00
func (*FileTypeSecure) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassFileType
2018-08-30 14:55:42 +00:00
}
2018-09-05 21:45:29 +00:00
func (*FileTypeSecure) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeFileTypeSecure
2018-08-30 14:55:42 +00:00
}
2018-09-05 21:45:29 +00:00
func (*FileTypeSecure) FileTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeFileTypeSecure
2018-08-30 14:55:42 +00:00
}
// The file is a sticker
2022-03-13 04:04:12 +00:00
type FileTypeSticker struct{
meta
2018-08-30 14:55:42 +00:00
}
func (entity *FileTypeSticker) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub FileTypeSticker
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*FileTypeSticker) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassFileType
2018-08-30 14:55:42 +00:00
}
func (*FileTypeSticker) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeFileTypeSticker
2018-08-30 14:55:42 +00:00
}
func (*FileTypeSticker) FileTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeFileTypeSticker
2018-08-30 14:55:42 +00:00
}
// The file is a thumbnail of another file
2022-03-13 04:04:12 +00:00
type FileTypeThumbnail struct{
meta
2018-08-30 14:55:42 +00:00
}
func (entity *FileTypeThumbnail) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub FileTypeThumbnail
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*FileTypeThumbnail) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassFileType
2018-08-30 14:55:42 +00:00
}
func (*FileTypeThumbnail) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeFileTypeThumbnail
2018-08-30 14:55:42 +00:00
}
func (*FileTypeThumbnail) FileTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeFileTypeThumbnail
2018-08-30 14:55:42 +00:00
}
// The file type is not yet known
2022-03-13 04:04:12 +00:00
type FileTypeUnknown struct{
meta
2018-08-30 14:55:42 +00:00
}
func (entity *FileTypeUnknown) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub FileTypeUnknown
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*FileTypeUnknown) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassFileType
2018-08-30 14:55:42 +00:00
}
func (*FileTypeUnknown) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeFileTypeUnknown
2018-08-30 14:55:42 +00:00
}
func (*FileTypeUnknown) FileTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeFileTypeUnknown
2018-08-30 14:55:42 +00:00
}
// The file is a video
2022-03-13 04:04:12 +00:00
type FileTypeVideo struct{
meta
2018-08-30 14:55:42 +00:00
}
func (entity *FileTypeVideo) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub FileTypeVideo
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*FileTypeVideo) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassFileType
2018-08-30 14:55:42 +00:00
}
func (*FileTypeVideo) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeFileTypeVideo
2018-08-30 14:55:42 +00:00
}
func (*FileTypeVideo) FileTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeFileTypeVideo
2018-08-30 14:55:42 +00:00
}
// The file is a video note
2022-03-13 04:04:12 +00:00
type FileTypeVideoNote struct{
meta
2018-08-30 14:55:42 +00:00
}
func (entity *FileTypeVideoNote) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub FileTypeVideoNote
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*FileTypeVideoNote) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassFileType
2018-08-30 14:55:42 +00:00
}
func (*FileTypeVideoNote) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeFileTypeVideoNote
2018-08-30 14:55:42 +00:00
}
func (*FileTypeVideoNote) FileTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeFileTypeVideoNote
2018-08-30 14:55:42 +00:00
}
// The file is a voice note
2022-03-13 04:04:12 +00:00
type FileTypeVoiceNote struct{
meta
2018-08-30 14:55:42 +00:00
}
func (entity *FileTypeVoiceNote) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub FileTypeVoiceNote
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*FileTypeVoiceNote) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassFileType
2018-08-30 14:55:42 +00:00
}
func (*FileTypeVoiceNote) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeFileTypeVoiceNote
2018-08-30 14:55:42 +00:00
}
func (*FileTypeVoiceNote) FileTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeFileTypeVoiceNote
2018-08-30 14:55:42 +00:00
}
2019-09-10 12:36:54 +00:00
// The file is a wallpaper or a background pattern
2022-03-13 04:04:12 +00:00
type FileTypeWallpaper struct{
meta
2018-08-30 14:55:42 +00:00
}
func (entity *FileTypeWallpaper) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub FileTypeWallpaper
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*FileTypeWallpaper) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassFileType
2018-08-30 14:55:42 +00:00
}
func (*FileTypeWallpaper) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeFileTypeWallpaper
2018-08-30 14:55:42 +00:00
}
func (*FileTypeWallpaper) FileTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeFileTypeWallpaper
2018-08-30 14:55:42 +00:00
}
// Contains the storage usage statistics for a specific file type
type StorageStatisticsByFileType struct {
2022-03-13 04:04:12 +00:00
meta
// File type
FileType FileType `json:"file_type"`
// Total size of the files, in bytes
Size int64 `json:"size"`
// Total number of files
Count int32 `json:"count"`
2018-08-30 14:55:42 +00:00
}
func (entity *StorageStatisticsByFileType) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub StorageStatisticsByFileType
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*StorageStatisticsByFileType) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassStorageStatisticsByFileType
2018-08-30 14:55:42 +00:00
}
func (*StorageStatisticsByFileType) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeStorageStatisticsByFileType
2018-08-30 14:55:42 +00:00
}
func (storageStatisticsByFileType *StorageStatisticsByFileType) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
FileType json.RawMessage `json:"file_type"`
Size int64 `json:"size"`
Count int32 `json:"count"`
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
storageStatisticsByFileType.Size = tmp.Size
storageStatisticsByFileType.Count = tmp.Count
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
fieldFileType, _ := UnmarshalFileType(tmp.FileType)
storageStatisticsByFileType.FileType = fieldFileType
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return nil
2018-08-30 14:55:42 +00:00
}
// Contains the storage usage statistics for a specific chat
type StorageStatisticsByChat struct {
2022-03-13 04:04:12 +00:00
meta
// Chat identifier; 0 if none
ChatId int64 `json:"chat_id"`
// Total size of the files in the chat, in bytes
Size int64 `json:"size"`
// Total number of files in the chat
Count int32 `json:"count"`
// Statistics split by file types
ByFileType []*StorageStatisticsByFileType `json:"by_file_type"`
2018-08-30 14:55:42 +00:00
}
func (entity *StorageStatisticsByChat) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub StorageStatisticsByChat
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*StorageStatisticsByChat) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassStorageStatisticsByChat
2018-08-30 14:55:42 +00:00
}
func (*StorageStatisticsByChat) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeStorageStatisticsByChat
2018-08-30 14:55:42 +00:00
}
// Contains the exact storage usage statistics split by chats and file type
type StorageStatistics struct {
2022-03-13 04:04:12 +00:00
meta
// Total size of files, in bytes
Size int64 `json:"size"`
// Total number of files
Count int32 `json:"count"`
// Statistics split by chats
ByChat []*StorageStatisticsByChat `json:"by_chat"`
2018-08-30 14:55:42 +00:00
}
func (entity *StorageStatistics) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub StorageStatistics
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*StorageStatistics) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassStorageStatistics
2018-08-30 14:55:42 +00:00
}
func (*StorageStatistics) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeStorageStatistics
2018-08-30 14:55:42 +00:00
}
// Contains approximate storage usage statistics, excluding files of unknown file type
type StorageStatisticsFast struct {
2022-03-13 04:04:12 +00:00
meta
// Approximate total size of files, in bytes
FilesSize int64 `json:"files_size"`
// Approximate number of files
FileCount int32 `json:"file_count"`
// Size of the database
DatabaseSize int64 `json:"database_size"`
// Size of the language pack database
LanguagePackDatabaseSize int64 `json:"language_pack_database_size"`
// Size of the TDLib internal log
LogSize int64 `json:"log_size"`
2018-08-30 14:55:42 +00:00
}
func (entity *StorageStatisticsFast) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub StorageStatisticsFast
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*StorageStatisticsFast) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassStorageStatisticsFast
2018-08-30 14:55:42 +00:00
}
func (*StorageStatisticsFast) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeStorageStatisticsFast
2018-08-30 14:55:42 +00:00
}
2019-06-07 10:56:06 +00:00
// Contains database statistics
type DatabaseStatistics struct {
2022-03-13 04:04:12 +00:00
meta
// Database statistics in an unspecified human-readable format
Statistics string `json:"statistics"`
2019-06-07 10:56:06 +00:00
}
func (entity *DatabaseStatistics) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub DatabaseStatistics
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
func (*DatabaseStatistics) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassDatabaseStatistics
2019-06-07 10:56:06 +00:00
}
func (*DatabaseStatistics) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeDatabaseStatistics
2019-06-07 10:56:06 +00:00
}
2018-08-30 14:55:42 +00:00
// The network is not available
2022-03-13 04:04:12 +00:00
type NetworkTypeNone struct{
meta
2018-08-30 14:55:42 +00:00
}
func (entity *NetworkTypeNone) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub NetworkTypeNone
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*NetworkTypeNone) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassNetworkType
2018-08-30 14:55:42 +00:00
}
func (*NetworkTypeNone) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeNetworkTypeNone
2018-08-30 14:55:42 +00:00
}
func (*NetworkTypeNone) NetworkTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeNetworkTypeNone
2018-08-30 14:55:42 +00:00
}
// A mobile network
2022-03-13 04:04:12 +00:00
type NetworkTypeMobile struct{
meta
2018-08-30 14:55:42 +00:00
}
func (entity *NetworkTypeMobile) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub NetworkTypeMobile
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*NetworkTypeMobile) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassNetworkType
2018-08-30 14:55:42 +00:00
}
func (*NetworkTypeMobile) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeNetworkTypeMobile
2018-08-30 14:55:42 +00:00
}
func (*NetworkTypeMobile) NetworkTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeNetworkTypeMobile
2018-08-30 14:55:42 +00:00
}
// A mobile roaming network
2022-03-13 04:04:12 +00:00
type NetworkTypeMobileRoaming struct{
meta
2018-08-30 14:55:42 +00:00
}
func (entity *NetworkTypeMobileRoaming) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub NetworkTypeMobileRoaming
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*NetworkTypeMobileRoaming) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassNetworkType
2018-08-30 14:55:42 +00:00
}
func (*NetworkTypeMobileRoaming) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeNetworkTypeMobileRoaming
2018-08-30 14:55:42 +00:00
}
func (*NetworkTypeMobileRoaming) NetworkTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeNetworkTypeMobileRoaming
2018-08-30 14:55:42 +00:00
}
// A Wi-Fi network
2022-03-13 04:04:12 +00:00
type NetworkTypeWiFi struct{
meta
2018-08-30 14:55:42 +00:00
}
func (entity *NetworkTypeWiFi) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub NetworkTypeWiFi
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*NetworkTypeWiFi) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassNetworkType
2018-08-30 14:55:42 +00:00
}
func (*NetworkTypeWiFi) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeNetworkTypeWiFi
2018-08-30 14:55:42 +00:00
}
func (*NetworkTypeWiFi) NetworkTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeNetworkTypeWiFi
2018-08-30 14:55:42 +00:00
}
// A different network type (e.g., Ethernet network)
2022-03-13 04:04:12 +00:00
type NetworkTypeOther struct{
meta
2018-08-30 14:55:42 +00:00
}
func (entity *NetworkTypeOther) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub NetworkTypeOther
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*NetworkTypeOther) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassNetworkType
2018-08-30 14:55:42 +00:00
}
func (*NetworkTypeOther) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeNetworkTypeOther
2018-08-30 14:55:42 +00:00
}
func (*NetworkTypeOther) NetworkTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeNetworkTypeOther
2018-08-30 14:55:42 +00:00
}
// Contains information about the total amount of data that was used to send and receive files
type NetworkStatisticsEntryFile struct {
2022-03-13 04:04:12 +00:00
meta
// Type of the file the data is part of; pass null if the data isn't related to files
FileType FileType `json:"file_type"`
// Type of the network the data was sent through. Call setNetworkType to maintain the actual network type
NetworkType NetworkType `json:"network_type"`
// Total number of bytes sent
SentBytes int64 `json:"sent_bytes"`
// Total number of bytes received
ReceivedBytes int64 `json:"received_bytes"`
2018-08-30 14:55:42 +00:00
}
func (entity *NetworkStatisticsEntryFile) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub NetworkStatisticsEntryFile
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*NetworkStatisticsEntryFile) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassNetworkStatisticsEntry
2018-08-30 14:55:42 +00:00
}
func (*NetworkStatisticsEntryFile) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeNetworkStatisticsEntryFile
2018-08-30 14:55:42 +00:00
}
func (*NetworkStatisticsEntryFile) NetworkStatisticsEntryType() string {
2022-03-13 04:04:12 +00:00
return TypeNetworkStatisticsEntryFile
2018-08-30 14:55:42 +00:00
}
func (networkStatisticsEntryFile *NetworkStatisticsEntryFile) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
FileType json.RawMessage `json:"file_type"`
NetworkType json.RawMessage `json:"network_type"`
SentBytes int64 `json:"sent_bytes"`
ReceivedBytes int64 `json:"received_bytes"`
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
networkStatisticsEntryFile.SentBytes = tmp.SentBytes
networkStatisticsEntryFile.ReceivedBytes = tmp.ReceivedBytes
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
fieldFileType, _ := UnmarshalFileType(tmp.FileType)
networkStatisticsEntryFile.FileType = fieldFileType
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
fieldNetworkType, _ := UnmarshalNetworkType(tmp.NetworkType)
networkStatisticsEntryFile.NetworkType = fieldNetworkType
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return nil
2018-08-30 14:55:42 +00:00
}
// Contains information about the total amount of data that was used for calls
type NetworkStatisticsEntryCall struct {
2022-03-13 04:04:12 +00:00
meta
// Type of the network the data was sent through. Call setNetworkType to maintain the actual network type
NetworkType NetworkType `json:"network_type"`
// Total number of bytes sent
SentBytes int64 `json:"sent_bytes"`
// Total number of bytes received
ReceivedBytes int64 `json:"received_bytes"`
// Total call duration, in seconds
Duration float64 `json:"duration"`
2018-08-30 14:55:42 +00:00
}
func (entity *NetworkStatisticsEntryCall) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub NetworkStatisticsEntryCall
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*NetworkStatisticsEntryCall) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassNetworkStatisticsEntry
2018-08-30 14:55:42 +00:00
}
func (*NetworkStatisticsEntryCall) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeNetworkStatisticsEntryCall
2018-08-30 14:55:42 +00:00
}
func (*NetworkStatisticsEntryCall) NetworkStatisticsEntryType() string {
2022-03-13 04:04:12 +00:00
return TypeNetworkStatisticsEntryCall
2018-08-30 14:55:42 +00:00
}
func (networkStatisticsEntryCall *NetworkStatisticsEntryCall) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
NetworkType json.RawMessage `json:"network_type"`
SentBytes int64 `json:"sent_bytes"`
ReceivedBytes int64 `json:"received_bytes"`
Duration float64 `json:"duration"`
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
networkStatisticsEntryCall.SentBytes = tmp.SentBytes
networkStatisticsEntryCall.ReceivedBytes = tmp.ReceivedBytes
networkStatisticsEntryCall.Duration = tmp.Duration
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
fieldNetworkType, _ := UnmarshalNetworkType(tmp.NetworkType)
networkStatisticsEntryCall.NetworkType = fieldNetworkType
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return nil
2018-08-30 14:55:42 +00:00
}
// A full list of available network statistic entries
type NetworkStatistics struct {
2022-03-13 04:04:12 +00:00
meta
// Point in time (Unix timestamp) from which the statistics are collected
SinceDate int32 `json:"since_date"`
// Network statistics entries
Entries []NetworkStatisticsEntry `json:"entries"`
2018-08-30 14:55:42 +00:00
}
func (entity *NetworkStatistics) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub NetworkStatistics
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*NetworkStatistics) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassNetworkStatistics
2018-08-30 14:55:42 +00:00
}
func (*NetworkStatistics) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeNetworkStatistics
2018-08-30 14:55:42 +00:00
}
2021-01-18 14:16:52 +00:00
func (networkStatistics *NetworkStatistics) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
SinceDate int32 `json:"since_date"`
Entries []json.RawMessage `json:"entries"`
}
2021-01-18 14:16:52 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-01-18 14:16:52 +00:00
2022-03-13 04:04:12 +00:00
networkStatistics.SinceDate = tmp.SinceDate
2021-01-18 14:16:52 +00:00
2022-03-13 04:04:12 +00:00
fieldEntries, _ := UnmarshalListOfNetworkStatisticsEntry(tmp.Entries)
networkStatistics.Entries = fieldEntries
2021-01-18 14:16:52 +00:00
2022-03-13 04:04:12 +00:00
return nil
2021-01-18 14:16:52 +00:00
}
2019-09-10 12:36:54 +00:00
// Contains auto-download settings
type AutoDownloadSettings struct {
2022-03-13 04:04:12 +00:00
meta
// True, if the auto-download is enabled
IsAutoDownloadEnabled bool `json:"is_auto_download_enabled"`
// The maximum size of a photo file to be auto-downloaded, in bytes
MaxPhotoFileSize int32 `json:"max_photo_file_size"`
// The maximum size of a video file to be auto-downloaded, in bytes
MaxVideoFileSize int32 `json:"max_video_file_size"`
// The maximum size of other file types to be auto-downloaded, in bytes
MaxOtherFileSize int32 `json:"max_other_file_size"`
// The maximum suggested bitrate for uploaded videos, in kbit/s
VideoUploadBitrate int32 `json:"video_upload_bitrate"`
// True, if the beginning of video files needs to be preloaded for instant playback
PreloadLargeVideos bool `json:"preload_large_videos"`
// True, if the next audio track needs to be preloaded while the user is listening to an audio file
PreloadNextAudio bool `json:"preload_next_audio"`
// True, if "use less data for calls" option needs to be enabled
UseLessDataForCalls bool `json:"use_less_data_for_calls"`
2019-09-10 12:36:54 +00:00
}
func (entity *AutoDownloadSettings) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-09-10 12:36:54 +00:00
2022-03-13 04:04:12 +00:00
type stub AutoDownloadSettings
2019-09-10 12:36:54 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-09-10 12:36:54 +00:00
}
func (*AutoDownloadSettings) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassAutoDownloadSettings
2019-09-10 12:36:54 +00:00
}
func (*AutoDownloadSettings) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeAutoDownloadSettings
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
// Contains auto-download settings presets for the current user
2019-09-10 12:36:54 +00:00
type AutoDownloadSettingsPresets struct {
2022-03-13 04:04:12 +00:00
meta
// Preset with lowest settings; supposed to be used by default when roaming
Low *AutoDownloadSettings `json:"low"`
// Preset with medium settings; supposed to be used by default when using mobile data
Medium *AutoDownloadSettings `json:"medium"`
// Preset with highest settings; supposed to be used by default when connected on Wi-Fi
High *AutoDownloadSettings `json:"high"`
2019-09-10 12:36:54 +00:00
}
func (entity *AutoDownloadSettingsPresets) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-09-10 12:36:54 +00:00
2022-03-13 04:04:12 +00:00
type stub AutoDownloadSettingsPresets
2019-09-10 12:36:54 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-09-10 12:36:54 +00:00
}
func (*AutoDownloadSettingsPresets) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassAutoDownloadSettingsPresets
2019-09-10 12:36:54 +00:00
}
func (*AutoDownloadSettingsPresets) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeAutoDownloadSettingsPresets
2019-09-10 12:36:54 +00:00
}
// Currently waiting for the network to become available. Use setNetworkType to change the available network type
2022-03-13 04:04:12 +00:00
type ConnectionStateWaitingForNetwork struct{
meta
2018-08-30 14:55:42 +00:00
}
func (entity *ConnectionStateWaitingForNetwork) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub ConnectionStateWaitingForNetwork
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*ConnectionStateWaitingForNetwork) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassConnectionState
2018-08-30 14:55:42 +00:00
}
func (*ConnectionStateWaitingForNetwork) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeConnectionStateWaitingForNetwork
2018-08-30 14:55:42 +00:00
}
func (*ConnectionStateWaitingForNetwork) ConnectionStateType() string {
2022-03-13 04:04:12 +00:00
return TypeConnectionStateWaitingForNetwork
2018-08-30 14:55:42 +00:00
}
// Currently establishing a connection with a proxy server
2022-03-13 04:04:12 +00:00
type ConnectionStateConnectingToProxy struct{
meta
2018-08-30 14:55:42 +00:00
}
func (entity *ConnectionStateConnectingToProxy) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub ConnectionStateConnectingToProxy
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*ConnectionStateConnectingToProxy) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassConnectionState
2018-08-30 14:55:42 +00:00
}
func (*ConnectionStateConnectingToProxy) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeConnectionStateConnectingToProxy
2018-08-30 14:55:42 +00:00
}
func (*ConnectionStateConnectingToProxy) ConnectionStateType() string {
2022-03-13 04:04:12 +00:00
return TypeConnectionStateConnectingToProxy
2018-08-30 14:55:42 +00:00
}
// Currently establishing a connection to the Telegram servers
2022-03-13 04:04:12 +00:00
type ConnectionStateConnecting struct{
meta
2018-08-30 14:55:42 +00:00
}
func (entity *ConnectionStateConnecting) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub ConnectionStateConnecting
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*ConnectionStateConnecting) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassConnectionState
2018-08-30 14:55:42 +00:00
}
func (*ConnectionStateConnecting) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeConnectionStateConnecting
2018-08-30 14:55:42 +00:00
}
func (*ConnectionStateConnecting) ConnectionStateType() string {
2022-03-13 04:04:12 +00:00
return TypeConnectionStateConnecting
2018-08-30 14:55:42 +00:00
}
2020-11-30 09:33:47 +00:00
// Downloading data received while the application was offline
2022-03-13 04:04:12 +00:00
type ConnectionStateUpdating struct{
meta
2018-08-30 14:55:42 +00:00
}
func (entity *ConnectionStateUpdating) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub ConnectionStateUpdating
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*ConnectionStateUpdating) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassConnectionState
2018-08-30 14:55:42 +00:00
}
func (*ConnectionStateUpdating) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeConnectionStateUpdating
2018-08-30 14:55:42 +00:00
}
func (*ConnectionStateUpdating) ConnectionStateType() string {
2022-03-13 04:04:12 +00:00
return TypeConnectionStateUpdating
2018-08-30 14:55:42 +00:00
}
// There is a working connection to the Telegram servers
2022-03-13 04:04:12 +00:00
type ConnectionStateReady struct{
meta
2018-08-30 14:55:42 +00:00
}
func (entity *ConnectionStateReady) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub ConnectionStateReady
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*ConnectionStateReady) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassConnectionState
2018-08-30 14:55:42 +00:00
}
func (*ConnectionStateReady) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeConnectionStateReady
2018-08-30 14:55:42 +00:00
}
func (*ConnectionStateReady) ConnectionStateType() string {
2022-03-13 04:04:12 +00:00
return TypeConnectionStateReady
2018-08-30 14:55:42 +00:00
}
// A category containing frequently used private chats with non-bot users
2022-03-13 04:04:12 +00:00
type TopChatCategoryUsers struct{
meta
2018-08-30 14:55:42 +00:00
}
func (entity *TopChatCategoryUsers) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub TopChatCategoryUsers
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*TopChatCategoryUsers) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassTopChatCategory
2018-08-30 14:55:42 +00:00
}
func (*TopChatCategoryUsers) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeTopChatCategoryUsers
2018-08-30 14:55:42 +00:00
}
func (*TopChatCategoryUsers) TopChatCategoryType() string {
2022-03-13 04:04:12 +00:00
return TypeTopChatCategoryUsers
2018-08-30 14:55:42 +00:00
}
// A category containing frequently used private chats with bot users
2022-03-13 04:04:12 +00:00
type TopChatCategoryBots struct{
meta
2018-08-30 14:55:42 +00:00
}
func (entity *TopChatCategoryBots) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub TopChatCategoryBots
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*TopChatCategoryBots) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassTopChatCategory
2018-08-30 14:55:42 +00:00
}
func (*TopChatCategoryBots) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeTopChatCategoryBots
2018-08-30 14:55:42 +00:00
}
func (*TopChatCategoryBots) TopChatCategoryType() string {
2022-03-13 04:04:12 +00:00
return TypeTopChatCategoryBots
2018-08-30 14:55:42 +00:00
}
// A category containing frequently used basic groups and supergroups
2022-03-13 04:04:12 +00:00
type TopChatCategoryGroups struct{
meta
2018-08-30 14:55:42 +00:00
}
func (entity *TopChatCategoryGroups) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub TopChatCategoryGroups
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*TopChatCategoryGroups) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassTopChatCategory
2018-08-30 14:55:42 +00:00
}
func (*TopChatCategoryGroups) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeTopChatCategoryGroups
2018-08-30 14:55:42 +00:00
}
func (*TopChatCategoryGroups) TopChatCategoryType() string {
2022-03-13 04:04:12 +00:00
return TypeTopChatCategoryGroups
2018-08-30 14:55:42 +00:00
}
// A category containing frequently used channels
2022-03-13 04:04:12 +00:00
type TopChatCategoryChannels struct{
meta
2018-08-30 14:55:42 +00:00
}
func (entity *TopChatCategoryChannels) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub TopChatCategoryChannels
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*TopChatCategoryChannels) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassTopChatCategory
2018-08-30 14:55:42 +00:00
}
func (*TopChatCategoryChannels) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeTopChatCategoryChannels
2018-08-30 14:55:42 +00:00
}
func (*TopChatCategoryChannels) TopChatCategoryType() string {
2022-03-13 04:04:12 +00:00
return TypeTopChatCategoryChannels
2018-08-30 14:55:42 +00:00
}
// A category containing frequently used chats with inline bots sorted by their usage in inline mode
2022-03-13 04:04:12 +00:00
type TopChatCategoryInlineBots struct{
meta
2018-08-30 14:55:42 +00:00
}
func (entity *TopChatCategoryInlineBots) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub TopChatCategoryInlineBots
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*TopChatCategoryInlineBots) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassTopChatCategory
2018-08-30 14:55:42 +00:00
}
func (*TopChatCategoryInlineBots) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeTopChatCategoryInlineBots
2018-08-30 14:55:42 +00:00
}
func (*TopChatCategoryInlineBots) TopChatCategoryType() string {
2022-03-13 04:04:12 +00:00
return TypeTopChatCategoryInlineBots
2018-08-30 14:55:42 +00:00
}
// A category containing frequently used chats used for calls
2022-03-13 04:04:12 +00:00
type TopChatCategoryCalls struct{
meta
2018-08-30 14:55:42 +00:00
}
func (entity *TopChatCategoryCalls) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub TopChatCategoryCalls
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*TopChatCategoryCalls) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassTopChatCategory
2018-08-30 14:55:42 +00:00
}
func (*TopChatCategoryCalls) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeTopChatCategoryCalls
2018-08-30 14:55:42 +00:00
}
func (*TopChatCategoryCalls) TopChatCategoryType() string {
2022-03-13 04:04:12 +00:00
return TypeTopChatCategoryCalls
2018-08-30 14:55:42 +00:00
}
2020-02-03 12:56:20 +00:00
// A category containing frequently used chats used to forward messages
2022-03-13 04:04:12 +00:00
type TopChatCategoryForwardChats struct{
meta
2020-02-03 12:56:20 +00:00
}
func (entity *TopChatCategoryForwardChats) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
type stub TopChatCategoryForwardChats
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-02-03 12:56:20 +00:00
}
func (*TopChatCategoryForwardChats) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassTopChatCategory
2020-02-03 12:56:20 +00:00
}
func (*TopChatCategoryForwardChats) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeTopChatCategoryForwardChats
2020-02-03 12:56:20 +00:00
}
func (*TopChatCategoryForwardChats) TopChatCategoryType() string {
2022-03-13 04:04:12 +00:00
return TypeTopChatCategoryForwardChats
2020-02-03 12:56:20 +00:00
}
2018-08-30 14:55:42 +00:00
// A URL linking to a user
type TMeUrlTypeUser struct {
2022-03-13 04:04:12 +00:00
meta
// Identifier of the user
UserId int64 `json:"user_id"`
2018-08-30 14:55:42 +00:00
}
func (entity *TMeUrlTypeUser) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub TMeUrlTypeUser
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*TMeUrlTypeUser) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassTMeUrlType
2018-08-30 14:55:42 +00:00
}
func (*TMeUrlTypeUser) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeTMeUrlTypeUser
2018-08-30 14:55:42 +00:00
}
func (*TMeUrlTypeUser) TMeUrlTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeTMeUrlTypeUser
2018-08-30 14:55:42 +00:00
}
// A URL linking to a public supergroup or channel
type TMeUrlTypeSupergroup struct {
2022-03-13 04:04:12 +00:00
meta
// Identifier of the supergroup or channel
SupergroupId int64 `json:"supergroup_id"`
2018-08-30 14:55:42 +00:00
}
func (entity *TMeUrlTypeSupergroup) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub TMeUrlTypeSupergroup
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*TMeUrlTypeSupergroup) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassTMeUrlType
2018-08-30 14:55:42 +00:00
}
func (*TMeUrlTypeSupergroup) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeTMeUrlTypeSupergroup
2018-08-30 14:55:42 +00:00
}
func (*TMeUrlTypeSupergroup) TMeUrlTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeTMeUrlTypeSupergroup
2018-08-30 14:55:42 +00:00
}
// A chat invite link
type TMeUrlTypeChatInvite struct {
2022-03-13 04:04:12 +00:00
meta
// Information about the chat invite link
Info *ChatInviteLinkInfo `json:"info"`
2018-08-30 14:55:42 +00:00
}
func (entity *TMeUrlTypeChatInvite) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub TMeUrlTypeChatInvite
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*TMeUrlTypeChatInvite) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassTMeUrlType
2018-08-30 14:55:42 +00:00
}
func (*TMeUrlTypeChatInvite) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeTMeUrlTypeChatInvite
2018-08-30 14:55:42 +00:00
}
func (*TMeUrlTypeChatInvite) TMeUrlTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeTMeUrlTypeChatInvite
2018-08-30 14:55:42 +00:00
}
// A URL linking to a sticker set
type TMeUrlTypeStickerSet struct {
2022-03-13 04:04:12 +00:00
meta
// Identifier of the sticker set
StickerSetId JsonInt64 `json:"sticker_set_id"`
2018-08-30 14:55:42 +00:00
}
func (entity *TMeUrlTypeStickerSet) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub TMeUrlTypeStickerSet
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*TMeUrlTypeStickerSet) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassTMeUrlType
2018-08-30 14:55:42 +00:00
}
func (*TMeUrlTypeStickerSet) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeTMeUrlTypeStickerSet
2018-08-30 14:55:42 +00:00
}
func (*TMeUrlTypeStickerSet) TMeUrlTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeTMeUrlTypeStickerSet
2018-08-30 14:55:42 +00:00
}
// Represents a URL linking to an internal Telegram entity
type TMeUrl struct {
2022-03-13 04:04:12 +00:00
meta
// URL
Url string `json:"url"`
// Type of the URL
Type TMeUrlType `json:"type"`
2018-08-30 14:55:42 +00:00
}
func (entity *TMeUrl) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub TMeUrl
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*TMeUrl) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassTMeUrl
2018-08-30 14:55:42 +00:00
}
func (*TMeUrl) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeTMeUrl
2018-08-30 14:55:42 +00:00
}
func (tMeUrl *TMeUrl) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Url string `json:"url"`
Type json.RawMessage `json:"type"`
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
tMeUrl.Url = tmp.Url
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
fieldType, _ := UnmarshalTMeUrlType(tmp.Type)
tMeUrl.Type = fieldType
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return nil
2021-12-30 05:55:02 +00:00
}
// Contains a list of t.me URLs
type TMeUrls struct {
2022-03-13 04:04:12 +00:00
meta
// List of URLs
Urls []*TMeUrl `json:"urls"`
2021-12-30 05:55:02 +00:00
}
func (entity *TMeUrls) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub TMeUrls
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*TMeUrls) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassTMeUrls
2021-12-30 05:55:02 +00:00
}
func (*TMeUrls) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeTMeUrls
2021-12-30 05:55:02 +00:00
}
// Suggests the user to enable "archive_and_mute_new_chats_from_unknown_users" option
2022-03-13 04:04:12 +00:00
type SuggestedActionEnableArchiveAndMuteNewChats struct{
meta
2021-12-30 05:55:02 +00:00
}
func (entity *SuggestedActionEnableArchiveAndMuteNewChats) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub SuggestedActionEnableArchiveAndMuteNewChats
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*SuggestedActionEnableArchiveAndMuteNewChats) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassSuggestedAction
2021-12-30 05:55:02 +00:00
}
func (*SuggestedActionEnableArchiveAndMuteNewChats) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeSuggestedActionEnableArchiveAndMuteNewChats
2021-12-30 05:55:02 +00:00
}
func (*SuggestedActionEnableArchiveAndMuteNewChats) SuggestedActionType() string {
2022-03-13 04:04:12 +00:00
return TypeSuggestedActionEnableArchiveAndMuteNewChats
2021-12-30 05:55:02 +00:00
}
// Suggests the user to check whether they still remember their 2-step verification password
2022-03-13 04:04:12 +00:00
type SuggestedActionCheckPassword struct{
meta
2021-12-30 05:55:02 +00:00
}
func (entity *SuggestedActionCheckPassword) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub SuggestedActionCheckPassword
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*SuggestedActionCheckPassword) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassSuggestedAction
2021-12-30 05:55:02 +00:00
}
func (*SuggestedActionCheckPassword) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeSuggestedActionCheckPassword
2021-12-30 05:55:02 +00:00
}
func (*SuggestedActionCheckPassword) SuggestedActionType() string {
2022-03-13 04:04:12 +00:00
return TypeSuggestedActionCheckPassword
2021-12-30 05:55:02 +00:00
}
// Suggests the user to check whether authorization phone number is correct and change the phone number if it is inaccessible
2022-03-13 04:04:12 +00:00
type SuggestedActionCheckPhoneNumber struct{
meta
2021-12-30 05:55:02 +00:00
}
func (entity *SuggestedActionCheckPhoneNumber) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub SuggestedActionCheckPhoneNumber
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
func (*SuggestedActionCheckPhoneNumber) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassSuggestedAction
2021-12-30 05:55:02 +00:00
}
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
func (*SuggestedActionCheckPhoneNumber) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeSuggestedActionCheckPhoneNumber
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*SuggestedActionCheckPhoneNumber) SuggestedActionType() string {
2022-03-13 04:04:12 +00:00
return TypeSuggestedActionCheckPhoneNumber
2021-12-30 05:55:02 +00:00
}
// Suggests the user to view a hint about the meaning of one and two check marks on sent messages
2022-03-13 04:04:12 +00:00
type SuggestedActionViewChecksHint struct{
meta
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *SuggestedActionViewChecksHint) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub SuggestedActionViewChecksHint
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*SuggestedActionViewChecksHint) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassSuggestedAction
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*SuggestedActionViewChecksHint) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeSuggestedActionViewChecksHint
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*SuggestedActionViewChecksHint) SuggestedActionType() string {
2022-03-13 04:04:12 +00:00
return TypeSuggestedActionViewChecksHint
2021-12-30 05:55:02 +00:00
}
// Suggests the user to convert specified supergroup to a broadcast group
type SuggestedActionConvertToBroadcastGroup struct {
2022-03-13 04:04:12 +00:00
meta
// Supergroup identifier
SupergroupId int64 `json:"supergroup_id"`
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *SuggestedActionConvertToBroadcastGroup) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
type stub SuggestedActionConvertToBroadcastGroup
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*SuggestedActionConvertToBroadcastGroup) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassSuggestedAction
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*SuggestedActionConvertToBroadcastGroup) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeSuggestedActionConvertToBroadcastGroup
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*SuggestedActionConvertToBroadcastGroup) SuggestedActionType() string {
2022-03-13 04:04:12 +00:00
return TypeSuggestedActionConvertToBroadcastGroup
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
// Suggests the user to set a 2-step verification password to be able to log in again
type SuggestedActionSetPassword struct {
2022-03-13 04:04:12 +00:00
meta
// The number of days to pass between consecutive authorizations if the user declines to set password
AuthorizationDelay int32 `json:"authorization_delay"`
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *SuggestedActionSetPassword) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
type stub SuggestedActionSetPassword
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*SuggestedActionSetPassword) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassSuggestedAction
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*SuggestedActionSetPassword) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeSuggestedActionSetPassword
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (*SuggestedActionSetPassword) SuggestedActionType() string {
2022-03-13 04:04:12 +00:00
return TypeSuggestedActionSetPassword
2020-11-30 09:33:47 +00:00
}
2018-08-30 14:55:42 +00:00
// Contains a counter
type Count struct {
2022-03-13 04:04:12 +00:00
meta
// Count
Count int32 `json:"count"`
2018-08-30 14:55:42 +00:00
}
func (entity *Count) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub Count
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*Count) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassCount
2018-08-30 14:55:42 +00:00
}
func (*Count) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeCount
2018-08-30 14:55:42 +00:00
}
// Contains some text
type Text struct {
2022-03-13 04:04:12 +00:00
meta
// Text
Text string `json:"text"`
2018-08-30 14:55:42 +00:00
}
func (entity *Text) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub Text
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*Text) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassText
2018-08-30 14:55:42 +00:00
}
func (*Text) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeText
2018-08-30 14:55:42 +00:00
}
2018-09-05 21:45:29 +00:00
// Contains a value representing a number of seconds
type Seconds struct {
2022-03-13 04:04:12 +00:00
meta
// Number of seconds
Seconds float64 `json:"seconds"`
2018-09-05 21:45:29 +00:00
}
func (entity *Seconds) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub Seconds
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
func (*Seconds) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassSeconds
2018-09-05 21:45:29 +00:00
}
func (*Seconds) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeSeconds
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
// Contains information about a tg: deep link
2018-09-05 21:45:29 +00:00
type DeepLinkInfo struct {
2022-03-13 04:04:12 +00:00
meta
// Text to be shown to the user
Text *FormattedText `json:"text"`
// True, if the user must be asked to update the application
NeedUpdateApplication bool `json:"need_update_application"`
2018-09-05 21:45:29 +00:00
}
func (entity *DeepLinkInfo) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub DeepLinkInfo
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
func (*DeepLinkInfo) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassDeepLinkInfo
2018-09-05 21:45:29 +00:00
}
func (*DeepLinkInfo) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeDeepLinkInfo
2018-09-05 21:45:29 +00:00
}
2020-11-30 09:33:47 +00:00
// The text uses Markdown-style formatting
2018-10-23 12:38:10 +00:00
type TextParseModeMarkdown struct {
2022-03-13 04:04:12 +00:00
meta
// Version of the parser: 0 or 1 - Telegram Bot API "Markdown" parse mode, 2 - Telegram Bot API "MarkdownV2" parse mode
Version int32 `json:"version"`
2018-08-30 14:55:42 +00:00
}
func (entity *TextParseModeMarkdown) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub TextParseModeMarkdown
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*TextParseModeMarkdown) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassTextParseMode
2018-08-30 14:55:42 +00:00
}
func (*TextParseModeMarkdown) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeTextParseModeMarkdown
2018-08-30 14:55:42 +00:00
}
func (*TextParseModeMarkdown) TextParseModeType() string {
2022-03-13 04:04:12 +00:00
return TypeTextParseModeMarkdown
2018-08-30 14:55:42 +00:00
}
2020-11-30 09:33:47 +00:00
// The text uses HTML-style formatting. The same as Telegram Bot API "HTML" parse mode
2022-03-13 04:04:12 +00:00
type TextParseModeHTML struct{
meta
2018-08-30 14:55:42 +00:00
}
func (entity *TextParseModeHTML) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub TextParseModeHTML
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*TextParseModeHTML) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassTextParseMode
2018-08-30 14:55:42 +00:00
}
func (*TextParseModeHTML) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeTextParseModeHTML
2018-08-30 14:55:42 +00:00
}
func (*TextParseModeHTML) TextParseModeType() string {
2022-03-13 04:04:12 +00:00
return TypeTextParseModeHTML
2018-08-30 14:55:42 +00:00
}
2018-09-05 21:45:29 +00:00
// A SOCKS5 proxy server
type ProxyTypeSocks5 struct {
2022-03-13 04:04:12 +00:00
meta
// Username for logging in; may be empty
Username string `json:"username"`
// Password for logging in; may be empty
Password string `json:"password"`
2018-08-30 14:55:42 +00:00
}
2018-09-05 21:45:29 +00:00
func (entity *ProxyTypeSocks5) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub ProxyTypeSocks5
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2018-09-05 21:45:29 +00:00
func (*ProxyTypeSocks5) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassProxyType
2018-08-30 14:55:42 +00:00
}
2018-09-05 21:45:29 +00:00
func (*ProxyTypeSocks5) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeProxyTypeSocks5
2018-08-30 14:55:42 +00:00
}
2018-09-05 21:45:29 +00:00
func (*ProxyTypeSocks5) ProxyTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeProxyTypeSocks5
2018-08-30 14:55:42 +00:00
}
2018-09-05 21:45:29 +00:00
// A HTTP transparent proxy server
type ProxyTypeHttp struct {
2022-03-13 04:04:12 +00:00
meta
// Username for logging in; may be empty
Username string `json:"username"`
// Password for logging in; may be empty
Password string `json:"password"`
// Pass true if the proxy supports only HTTP requests and doesn't support transparent TCP connections via HTTP CONNECT method
HttpOnly bool `json:"http_only"`
2018-09-05 21:45:29 +00:00
}
func (entity *ProxyTypeHttp) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub ProxyTypeHttp
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
func (*ProxyTypeHttp) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassProxyType
2018-09-05 21:45:29 +00:00
}
func (*ProxyTypeHttp) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeProxyTypeHttp
2018-09-05 21:45:29 +00:00
}
func (*ProxyTypeHttp) ProxyTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeProxyTypeHttp
2018-09-05 21:45:29 +00:00
}
// An MTProto proxy server
type ProxyTypeMtproto struct {
2022-03-13 04:04:12 +00:00
meta
// The proxy's secret in hexadecimal encoding
Secret string `json:"secret"`
2018-09-05 21:45:29 +00:00
}
func (entity *ProxyTypeMtproto) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub ProxyTypeMtproto
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
func (*ProxyTypeMtproto) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassProxyType
2018-09-05 21:45:29 +00:00
}
func (*ProxyTypeMtproto) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeProxyTypeMtproto
2018-09-05 21:45:29 +00:00
}
func (*ProxyTypeMtproto) ProxyTypeType() string {
2022-03-13 04:04:12 +00:00
return TypeProxyTypeMtproto
2018-09-05 21:45:29 +00:00
}
// Contains information about a proxy server
type Proxy struct {
2022-03-13 04:04:12 +00:00
meta
// Unique identifier of the proxy
Id int32 `json:"id"`
// Proxy server IP address
Server string `json:"server"`
// Proxy server port
Port int32 `json:"port"`
// Point in time (Unix timestamp) when the proxy was last used; 0 if never
LastUsedDate int32 `json:"last_used_date"`
// True, if the proxy is enabled now
IsEnabled bool `json:"is_enabled"`
// Type of the proxy
Type ProxyType `json:"type"`
2018-08-30 14:55:42 +00:00
}
2020-11-30 09:33:47 +00:00
func (entity *Proxy) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
type stub Proxy
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-11-30 09:33:47 +00:00
}
func (*Proxy) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassProxy
2020-11-30 09:33:47 +00:00
}
func (*Proxy) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeProxy
2020-11-30 09:33:47 +00:00
}
func (proxy *Proxy) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Id int32 `json:"id"`
Server string `json:"server"`
Port int32 `json:"port"`
LastUsedDate int32 `json:"last_used_date"`
IsEnabled bool `json:"is_enabled"`
Type json.RawMessage `json:"type"`
}
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
proxy.Id = tmp.Id
proxy.Server = tmp.Server
proxy.Port = tmp.Port
proxy.LastUsedDate = tmp.LastUsedDate
proxy.IsEnabled = tmp.IsEnabled
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
fieldType, _ := UnmarshalProxyType(tmp.Type)
proxy.Type = fieldType
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return nil
2020-11-30 09:33:47 +00:00
}
// Represents a list of proxy servers
type Proxies struct {
2022-03-13 04:04:12 +00:00
meta
// List of proxy servers
Proxies []*Proxy `json:"proxies"`
2020-11-30 09:33:47 +00:00
}
func (entity *Proxies) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
type stub Proxies
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-11-30 09:33:47 +00:00
}
func (*Proxies) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassProxies
2020-11-30 09:33:47 +00:00
}
func (*Proxies) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeProxies
2020-11-30 09:33:47 +00:00
}
2022-02-06 18:36:17 +00:00
// A sticker to be added to a sticker set
type InputSticker struct {
2022-03-13 04:04:12 +00:00
meta
// File with the sticker; must fit in a 512x512 square. For WEBP stickers and masks the file must be in PNG format, which will be converted to WEBP server-side. Otherwise, the file must be local or uploaded within a week. See https://core.telegram.org/animated_stickers#technical-requirements for technical requirements
Sticker InputFile `json:"sticker"`
// Emojis corresponding to the sticker
Emojis string `json:"emojis"`
// Sticker type
Type StickerType `json:"type"`
2020-11-30 09:33:47 +00:00
}
2022-02-06 18:36:17 +00:00
func (entity *InputSticker) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
type stub InputSticker
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-11-30 09:33:47 +00:00
}
2022-02-06 18:36:17 +00:00
func (*InputSticker) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassInputSticker
2020-11-30 09:33:47 +00:00
}
2022-02-06 18:36:17 +00:00
func (*InputSticker) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeInputSticker
2020-11-30 09:33:47 +00:00
}
2022-02-06 18:36:17 +00:00
func (inputSticker *InputSticker) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Sticker json.RawMessage `json:"sticker"`
Emojis string `json:"emojis"`
Type json.RawMessage `json:"type"`
}
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
inputSticker.Emojis = tmp.Emojis
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
fieldSticker, _ := UnmarshalInputFile(tmp.Sticker)
inputSticker.Sticker = fieldSticker
2022-02-06 18:36:17 +00:00
2022-03-13 04:04:12 +00:00
fieldType, _ := UnmarshalStickerType(tmp.Type)
inputSticker.Type = fieldType
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return nil
2020-11-30 09:33:47 +00:00
}
// Represents a date range
type DateRange struct {
2022-03-13 04:04:12 +00:00
meta
// Point in time (Unix timestamp) at which the date range begins
StartDate int32 `json:"start_date"`
// Point in time (Unix timestamp) at which the date range ends
EndDate int32 `json:"end_date"`
2020-11-30 09:33:47 +00:00
}
func (entity *DateRange) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
type stub DateRange
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-11-30 09:33:47 +00:00
}
func (*DateRange) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassDateRange
2020-11-30 09:33:47 +00:00
}
func (*DateRange) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeDateRange
2020-11-30 09:33:47 +00:00
}
// A value with information about its recent changes
type StatisticalValue struct {
2022-03-13 04:04:12 +00:00
meta
// The current value
Value float64 `json:"value"`
// The value for the previous day
PreviousValue float64 `json:"previous_value"`
// The growth rate of the value, as a percentage
GrowthRatePercentage float64 `json:"growth_rate_percentage"`
2020-11-30 09:33:47 +00:00
}
func (entity *StatisticalValue) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
type stub StatisticalValue
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-11-30 09:33:47 +00:00
}
func (*StatisticalValue) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassStatisticalValue
2020-11-30 09:33:47 +00:00
}
func (*StatisticalValue) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeStatisticalValue
2020-11-30 09:33:47 +00:00
}
// A graph data
type StatisticalGraphData struct {
2022-03-13 04:04:12 +00:00
meta
// Graph data in JSON format
JsonData string `json:"json_data"`
// If non-empty, a token which can be used to receive a zoomed in graph
ZoomToken string `json:"zoom_token"`
2020-11-30 09:33:47 +00:00
}
func (entity *StatisticalGraphData) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
type stub StatisticalGraphData
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-11-30 09:33:47 +00:00
}
func (*StatisticalGraphData) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassStatisticalGraph
2020-11-30 09:33:47 +00:00
}
func (*StatisticalGraphData) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeStatisticalGraphData
2020-11-30 09:33:47 +00:00
}
func (*StatisticalGraphData) StatisticalGraphType() string {
2022-03-13 04:04:12 +00:00
return TypeStatisticalGraphData
2020-11-30 09:33:47 +00:00
}
// The graph data to be asynchronously loaded through getStatisticalGraph
type StatisticalGraphAsync struct {
2022-03-13 04:04:12 +00:00
meta
// The token to use for data loading
Token string `json:"token"`
2020-11-30 09:33:47 +00:00
}
func (entity *StatisticalGraphAsync) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
type stub StatisticalGraphAsync
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-11-30 09:33:47 +00:00
}
func (*StatisticalGraphAsync) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassStatisticalGraph
2020-11-30 09:33:47 +00:00
}
func (*StatisticalGraphAsync) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeStatisticalGraphAsync
2020-11-30 09:33:47 +00:00
}
func (*StatisticalGraphAsync) StatisticalGraphType() string {
2022-03-13 04:04:12 +00:00
return TypeStatisticalGraphAsync
2020-11-30 09:33:47 +00:00
}
// An error message to be shown to the user instead of the graph
type StatisticalGraphError struct {
2022-03-13 04:04:12 +00:00
meta
// The error message
ErrorMessage string `json:"error_message"`
2020-11-30 09:33:47 +00:00
}
func (entity *StatisticalGraphError) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
type stub StatisticalGraphError
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-11-30 09:33:47 +00:00
}
func (*StatisticalGraphError) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassStatisticalGraph
2020-11-30 09:33:47 +00:00
}
func (*StatisticalGraphError) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeStatisticalGraphError
2020-11-30 09:33:47 +00:00
}
func (*StatisticalGraphError) StatisticalGraphType() string {
2022-03-13 04:04:12 +00:00
return TypeStatisticalGraphError
2020-11-30 09:33:47 +00:00
}
// Contains statistics about interactions with a message
type ChatStatisticsMessageInteractionInfo struct {
2022-03-13 04:04:12 +00:00
meta
// Message identifier
MessageId int64 `json:"message_id"`
// Number of times the message was viewed
ViewCount int32 `json:"view_count"`
// Number of times the message was forwarded
ForwardCount int32 `json:"forward_count"`
2020-11-30 09:33:47 +00:00
}
func (entity *ChatStatisticsMessageInteractionInfo) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatStatisticsMessageInteractionInfo
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-11-30 09:33:47 +00:00
}
func (*ChatStatisticsMessageInteractionInfo) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatStatisticsMessageInteractionInfo
2020-11-30 09:33:47 +00:00
}
func (*ChatStatisticsMessageInteractionInfo) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatStatisticsMessageInteractionInfo
2020-11-30 09:33:47 +00:00
}
// Contains statistics about messages sent by a user
type ChatStatisticsMessageSenderInfo struct {
2022-03-13 04:04:12 +00:00
meta
// User identifier
UserId int64 `json:"user_id"`
// Number of sent messages
SentMessageCount int32 `json:"sent_message_count"`
// Average number of characters in sent messages; 0 if unknown
AverageCharacterCount int32 `json:"average_character_count"`
2020-11-30 09:33:47 +00:00
}
func (entity *ChatStatisticsMessageSenderInfo) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatStatisticsMessageSenderInfo
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-11-30 09:33:47 +00:00
}
func (*ChatStatisticsMessageSenderInfo) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatStatisticsMessageSenderInfo
2020-11-30 09:33:47 +00:00
}
func (*ChatStatisticsMessageSenderInfo) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatStatisticsMessageSenderInfo
2020-11-30 09:33:47 +00:00
}
// Contains statistics about administrator actions done by a user
type ChatStatisticsAdministratorActionsInfo struct {
2022-03-13 04:04:12 +00:00
meta
// Administrator user identifier
UserId int64 `json:"user_id"`
// Number of messages deleted by the administrator
DeletedMessageCount int32 `json:"deleted_message_count"`
// Number of users banned by the administrator
BannedUserCount int32 `json:"banned_user_count"`
// Number of users restricted by the administrator
RestrictedUserCount int32 `json:"restricted_user_count"`
2020-11-30 09:33:47 +00:00
}
func (entity *ChatStatisticsAdministratorActionsInfo) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatStatisticsAdministratorActionsInfo
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-11-30 09:33:47 +00:00
}
func (*ChatStatisticsAdministratorActionsInfo) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatStatisticsAdministratorActionsInfo
2020-11-30 09:33:47 +00:00
}
func (*ChatStatisticsAdministratorActionsInfo) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatStatisticsAdministratorActionsInfo
2020-11-30 09:33:47 +00:00
}
// Contains statistics about number of new members invited by a user
type ChatStatisticsInviterInfo struct {
2022-03-13 04:04:12 +00:00
meta
// User identifier
UserId int64 `json:"user_id"`
// Number of new members invited by the user
AddedMemberCount int32 `json:"added_member_count"`
2020-11-30 09:33:47 +00:00
}
func (entity *ChatStatisticsInviterInfo) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatStatisticsInviterInfo
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-11-30 09:33:47 +00:00
}
func (*ChatStatisticsInviterInfo) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatStatisticsInviterInfo
2020-11-30 09:33:47 +00:00
}
func (*ChatStatisticsInviterInfo) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatStatisticsInviterInfo
2020-11-30 09:33:47 +00:00
}
// A detailed statistics about a supergroup chat
type ChatStatisticsSupergroup struct {
2022-03-13 04:04:12 +00:00
meta
// A period to which the statistics applies
Period *DateRange `json:"period"`
// Number of members in the chat
MemberCount *StatisticalValue `json:"member_count"`
// Number of messages sent to the chat
MessageCount *StatisticalValue `json:"message_count"`
// Number of users who viewed messages in the chat
ViewerCount *StatisticalValue `json:"viewer_count"`
// Number of users who sent messages to the chat
SenderCount *StatisticalValue `json:"sender_count"`
// A graph containing number of members in the chat
MemberCountGraph StatisticalGraph `json:"member_count_graph"`
// A graph containing number of members joined and left the chat
JoinGraph StatisticalGraph `json:"join_graph"`
// A graph containing number of new member joins per source
JoinBySourceGraph StatisticalGraph `json:"join_by_source_graph"`
// A graph containing distribution of active users per language
LanguageGraph StatisticalGraph `json:"language_graph"`
// A graph containing distribution of sent messages by content type
MessageContentGraph StatisticalGraph `json:"message_content_graph"`
// A graph containing number of different actions in the chat
ActionGraph StatisticalGraph `json:"action_graph"`
// A graph containing distribution of message views per hour
DayGraph StatisticalGraph `json:"day_graph"`
// A graph containing distribution of message views per day of week
WeekGraph StatisticalGraph `json:"week_graph"`
// List of users sent most messages in the last week
TopSenders []*ChatStatisticsMessageSenderInfo `json:"top_senders"`
// List of most active administrators in the last week
TopAdministrators []*ChatStatisticsAdministratorActionsInfo `json:"top_administrators"`
// List of most active inviters of new members in the last week
TopInviters []*ChatStatisticsInviterInfo `json:"top_inviters"`
2020-11-30 09:33:47 +00:00
}
func (entity *ChatStatisticsSupergroup) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatStatisticsSupergroup
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-11-30 09:33:47 +00:00
}
func (*ChatStatisticsSupergroup) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatStatistics
2020-11-30 09:33:47 +00:00
}
func (*ChatStatisticsSupergroup) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatStatisticsSupergroup
2020-11-30 09:33:47 +00:00
}
func (*ChatStatisticsSupergroup) ChatStatisticsType() string {
2022-03-13 04:04:12 +00:00
return TypeChatStatisticsSupergroup
2020-11-30 09:33:47 +00:00
}
func (chatStatisticsSupergroup *ChatStatisticsSupergroup) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Period *DateRange `json:"period"`
MemberCount *StatisticalValue `json:"member_count"`
MessageCount *StatisticalValue `json:"message_count"`
ViewerCount *StatisticalValue `json:"viewer_count"`
SenderCount *StatisticalValue `json:"sender_count"`
MemberCountGraph json.RawMessage `json:"member_count_graph"`
JoinGraph json.RawMessage `json:"join_graph"`
JoinBySourceGraph json.RawMessage `json:"join_by_source_graph"`
LanguageGraph json.RawMessage `json:"language_graph"`
MessageContentGraph json.RawMessage `json:"message_content_graph"`
ActionGraph json.RawMessage `json:"action_graph"`
DayGraph json.RawMessage `json:"day_graph"`
WeekGraph json.RawMessage `json:"week_graph"`
TopSenders []*ChatStatisticsMessageSenderInfo `json:"top_senders"`
TopAdministrators []*ChatStatisticsAdministratorActionsInfo `json:"top_administrators"`
TopInviters []*ChatStatisticsInviterInfo `json:"top_inviters"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
chatStatisticsSupergroup.Period = tmp.Period
chatStatisticsSupergroup.MemberCount = tmp.MemberCount
chatStatisticsSupergroup.MessageCount = tmp.MessageCount
chatStatisticsSupergroup.ViewerCount = tmp.ViewerCount
chatStatisticsSupergroup.SenderCount = tmp.SenderCount
chatStatisticsSupergroup.TopSenders = tmp.TopSenders
chatStatisticsSupergroup.TopAdministrators = tmp.TopAdministrators
chatStatisticsSupergroup.TopInviters = tmp.TopInviters
fieldMemberCountGraph, _ := UnmarshalStatisticalGraph(tmp.MemberCountGraph)
chatStatisticsSupergroup.MemberCountGraph = fieldMemberCountGraph
fieldJoinGraph, _ := UnmarshalStatisticalGraph(tmp.JoinGraph)
chatStatisticsSupergroup.JoinGraph = fieldJoinGraph
fieldJoinBySourceGraph, _ := UnmarshalStatisticalGraph(tmp.JoinBySourceGraph)
chatStatisticsSupergroup.JoinBySourceGraph = fieldJoinBySourceGraph
fieldLanguageGraph, _ := UnmarshalStatisticalGraph(tmp.LanguageGraph)
chatStatisticsSupergroup.LanguageGraph = fieldLanguageGraph
fieldMessageContentGraph, _ := UnmarshalStatisticalGraph(tmp.MessageContentGraph)
chatStatisticsSupergroup.MessageContentGraph = fieldMessageContentGraph
fieldActionGraph, _ := UnmarshalStatisticalGraph(tmp.ActionGraph)
chatStatisticsSupergroup.ActionGraph = fieldActionGraph
fieldDayGraph, _ := UnmarshalStatisticalGraph(tmp.DayGraph)
chatStatisticsSupergroup.DayGraph = fieldDayGraph
fieldWeekGraph, _ := UnmarshalStatisticalGraph(tmp.WeekGraph)
chatStatisticsSupergroup.WeekGraph = fieldWeekGraph
return nil
2020-11-30 09:33:47 +00:00
}
// A detailed statistics about a channel chat
type ChatStatisticsChannel struct {
2022-03-13 04:04:12 +00:00
meta
// A period to which the statistics applies
Period *DateRange `json:"period"`
// Number of members in the chat
MemberCount *StatisticalValue `json:"member_count"`
// Mean number of times the recently sent messages was viewed
MeanViewCount *StatisticalValue `json:"mean_view_count"`
// Mean number of times the recently sent messages was shared
MeanShareCount *StatisticalValue `json:"mean_share_count"`
// A percentage of users with enabled notifications for the chat
EnabledNotificationsPercentage float64 `json:"enabled_notifications_percentage"`
// A graph containing number of members in the chat
MemberCountGraph StatisticalGraph `json:"member_count_graph"`
// A graph containing number of members joined and left the chat
JoinGraph StatisticalGraph `json:"join_graph"`
// A graph containing number of members muted and unmuted the chat
MuteGraph StatisticalGraph `json:"mute_graph"`
// A graph containing number of message views in a given hour in the last two weeks
ViewCountByHourGraph StatisticalGraph `json:"view_count_by_hour_graph"`
// A graph containing number of message views per source
ViewCountBySourceGraph StatisticalGraph `json:"view_count_by_source_graph"`
// A graph containing number of new member joins per source
JoinBySourceGraph StatisticalGraph `json:"join_by_source_graph"`
// A graph containing number of users viewed chat messages per language
LanguageGraph StatisticalGraph `json:"language_graph"`
// A graph containing number of chat message views and shares
MessageInteractionGraph StatisticalGraph `json:"message_interaction_graph"`
// A graph containing number of views of associated with the chat instant views
InstantViewInteractionGraph StatisticalGraph `json:"instant_view_interaction_graph"`
// Detailed statistics about number of views and shares of recently sent messages
RecentMessageInteractions []*ChatStatisticsMessageInteractionInfo `json:"recent_message_interactions"`
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *ChatStatisticsChannel) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub ChatStatisticsChannel
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*ChatStatisticsChannel) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassChatStatistics
2021-12-30 05:55:02 +00:00
}
func (*ChatStatisticsChannel) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeChatStatisticsChannel
2021-12-30 05:55:02 +00:00
}
func (*ChatStatisticsChannel) ChatStatisticsType() string {
2022-03-13 04:04:12 +00:00
return TypeChatStatisticsChannel
2021-12-30 05:55:02 +00:00
}
func (chatStatisticsChannel *ChatStatisticsChannel) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Period *DateRange `json:"period"`
MemberCount *StatisticalValue `json:"member_count"`
MeanViewCount *StatisticalValue `json:"mean_view_count"`
MeanShareCount *StatisticalValue `json:"mean_share_count"`
EnabledNotificationsPercentage float64 `json:"enabled_notifications_percentage"`
MemberCountGraph json.RawMessage `json:"member_count_graph"`
JoinGraph json.RawMessage `json:"join_graph"`
MuteGraph json.RawMessage `json:"mute_graph"`
ViewCountByHourGraph json.RawMessage `json:"view_count_by_hour_graph"`
ViewCountBySourceGraph json.RawMessage `json:"view_count_by_source_graph"`
JoinBySourceGraph json.RawMessage `json:"join_by_source_graph"`
LanguageGraph json.RawMessage `json:"language_graph"`
MessageInteractionGraph json.RawMessage `json:"message_interaction_graph"`
InstantViewInteractionGraph json.RawMessage `json:"instant_view_interaction_graph"`
RecentMessageInteractions []*ChatStatisticsMessageInteractionInfo `json:"recent_message_interactions"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
chatStatisticsChannel.Period = tmp.Period
chatStatisticsChannel.MemberCount = tmp.MemberCount
chatStatisticsChannel.MeanViewCount = tmp.MeanViewCount
chatStatisticsChannel.MeanShareCount = tmp.MeanShareCount
chatStatisticsChannel.EnabledNotificationsPercentage = tmp.EnabledNotificationsPercentage
chatStatisticsChannel.RecentMessageInteractions = tmp.RecentMessageInteractions
fieldMemberCountGraph, _ := UnmarshalStatisticalGraph(tmp.MemberCountGraph)
chatStatisticsChannel.MemberCountGraph = fieldMemberCountGraph
fieldJoinGraph, _ := UnmarshalStatisticalGraph(tmp.JoinGraph)
chatStatisticsChannel.JoinGraph = fieldJoinGraph
fieldMuteGraph, _ := UnmarshalStatisticalGraph(tmp.MuteGraph)
chatStatisticsChannel.MuteGraph = fieldMuteGraph
fieldViewCountByHourGraph, _ := UnmarshalStatisticalGraph(tmp.ViewCountByHourGraph)
chatStatisticsChannel.ViewCountByHourGraph = fieldViewCountByHourGraph
fieldViewCountBySourceGraph, _ := UnmarshalStatisticalGraph(tmp.ViewCountBySourceGraph)
chatStatisticsChannel.ViewCountBySourceGraph = fieldViewCountBySourceGraph
fieldJoinBySourceGraph, _ := UnmarshalStatisticalGraph(tmp.JoinBySourceGraph)
chatStatisticsChannel.JoinBySourceGraph = fieldJoinBySourceGraph
fieldLanguageGraph, _ := UnmarshalStatisticalGraph(tmp.LanguageGraph)
chatStatisticsChannel.LanguageGraph = fieldLanguageGraph
fieldMessageInteractionGraph, _ := UnmarshalStatisticalGraph(tmp.MessageInteractionGraph)
chatStatisticsChannel.MessageInteractionGraph = fieldMessageInteractionGraph
fieldInstantViewInteractionGraph, _ := UnmarshalStatisticalGraph(tmp.InstantViewInteractionGraph)
chatStatisticsChannel.InstantViewInteractionGraph = fieldInstantViewInteractionGraph
return nil
2021-12-30 05:55:02 +00:00
}
// A detailed statistics about a message
type MessageStatistics struct {
2022-03-13 04:04:12 +00:00
meta
// A graph containing number of message views and shares
MessageInteractionGraph StatisticalGraph `json:"message_interaction_graph"`
2021-12-30 05:55:02 +00:00
}
func (entity *MessageStatistics) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub MessageStatistics
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*MessageStatistics) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassMessageStatistics
2021-12-30 05:55:02 +00:00
}
func (*MessageStatistics) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeMessageStatistics
2021-12-30 05:55:02 +00:00
}
func (messageStatistics *MessageStatistics) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
MessageInteractionGraph json.RawMessage `json:"message_interaction_graph"`
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
fieldMessageInteractionGraph, _ := UnmarshalStatisticalGraph(tmp.MessageInteractionGraph)
messageStatistics.MessageInteractionGraph = fieldMessageInteractionGraph
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return nil
2021-12-30 05:55:02 +00:00
}
// A point on a Cartesian plane
type Point struct {
2022-03-13 04:04:12 +00:00
meta
// The point's first coordinate
X float64 `json:"x"`
// The point's second coordinate
Y float64 `json:"y"`
2021-12-30 05:55:02 +00:00
}
func (entity *Point) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub Point
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*Point) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassPoint
2021-12-30 05:55:02 +00:00
}
func (*Point) GetType() string {
2022-03-13 04:04:12 +00:00
return TypePoint
2021-12-30 05:55:02 +00:00
}
// A straight line to a given point
type VectorPathCommandLine struct {
2022-03-13 04:04:12 +00:00
meta
// The end point of the straight line
EndPoint *Point `json:"end_point"`
2021-12-30 05:55:02 +00:00
}
func (entity *VectorPathCommandLine) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub VectorPathCommandLine
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*VectorPathCommandLine) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassVectorPathCommand
2021-12-30 05:55:02 +00:00
}
func (*VectorPathCommandLine) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeVectorPathCommandLine
2021-12-30 05:55:02 +00:00
}
func (*VectorPathCommandLine) VectorPathCommandType() string {
2022-03-13 04:04:12 +00:00
return TypeVectorPathCommandLine
2021-12-30 05:55:02 +00:00
}
// A cubic Bézier curve to a given point
type VectorPathCommandCubicBezierCurve struct {
2022-03-13 04:04:12 +00:00
meta
// The start control point of the curve
StartControlPoint *Point `json:"start_control_point"`
// The end control point of the curve
EndControlPoint *Point `json:"end_control_point"`
// The end point of the curve
EndPoint *Point `json:"end_point"`
2021-12-30 05:55:02 +00:00
}
func (entity *VectorPathCommandCubicBezierCurve) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub VectorPathCommandCubicBezierCurve
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*VectorPathCommandCubicBezierCurve) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassVectorPathCommand
2021-12-30 05:55:02 +00:00
}
func (*VectorPathCommandCubicBezierCurve) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeVectorPathCommandCubicBezierCurve
2021-12-30 05:55:02 +00:00
}
func (*VectorPathCommandCubicBezierCurve) VectorPathCommandType() string {
2022-03-13 04:04:12 +00:00
return TypeVectorPathCommandCubicBezierCurve
2021-12-30 05:55:02 +00:00
}
// A scope covering all users
2022-03-13 04:04:12 +00:00
type BotCommandScopeDefault struct{
meta
2021-12-30 05:55:02 +00:00
}
func (entity *BotCommandScopeDefault) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub BotCommandScopeDefault
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*BotCommandScopeDefault) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassBotCommandScope
2021-12-30 05:55:02 +00:00
}
func (*BotCommandScopeDefault) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeBotCommandScopeDefault
2021-12-30 05:55:02 +00:00
}
func (*BotCommandScopeDefault) BotCommandScopeType() string {
2022-03-13 04:04:12 +00:00
return TypeBotCommandScopeDefault
2021-12-30 05:55:02 +00:00
}
// A scope covering all private chats
2022-03-13 04:04:12 +00:00
type BotCommandScopeAllPrivateChats struct{
meta
2021-12-30 05:55:02 +00:00
}
func (entity *BotCommandScopeAllPrivateChats) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub BotCommandScopeAllPrivateChats
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*BotCommandScopeAllPrivateChats) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassBotCommandScope
2021-12-30 05:55:02 +00:00
}
func (*BotCommandScopeAllPrivateChats) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeBotCommandScopeAllPrivateChats
2021-12-30 05:55:02 +00:00
}
func (*BotCommandScopeAllPrivateChats) BotCommandScopeType() string {
2022-03-13 04:04:12 +00:00
return TypeBotCommandScopeAllPrivateChats
2021-12-30 05:55:02 +00:00
}
// A scope covering all group and supergroup chats
2022-03-13 04:04:12 +00:00
type BotCommandScopeAllGroupChats struct{
meta
2021-12-30 05:55:02 +00:00
}
func (entity *BotCommandScopeAllGroupChats) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub BotCommandScopeAllGroupChats
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*BotCommandScopeAllGroupChats) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassBotCommandScope
2021-12-30 05:55:02 +00:00
}
func (*BotCommandScopeAllGroupChats) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeBotCommandScopeAllGroupChats
2021-12-30 05:55:02 +00:00
}
func (*BotCommandScopeAllGroupChats) BotCommandScopeType() string {
2022-03-13 04:04:12 +00:00
return TypeBotCommandScopeAllGroupChats
2021-12-30 05:55:02 +00:00
}
// A scope covering all group and supergroup chat administrators
2022-03-13 04:04:12 +00:00
type BotCommandScopeAllChatAdministrators struct{
meta
2021-12-30 05:55:02 +00:00
}
func (entity *BotCommandScopeAllChatAdministrators) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub BotCommandScopeAllChatAdministrators
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*BotCommandScopeAllChatAdministrators) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassBotCommandScope
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*BotCommandScopeAllChatAdministrators) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeBotCommandScopeAllChatAdministrators
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*BotCommandScopeAllChatAdministrators) BotCommandScopeType() string {
2022-03-13 04:04:12 +00:00
return TypeBotCommandScopeAllChatAdministrators
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
// A scope covering all members of a chat
type BotCommandScopeChat struct {
2022-03-13 04:04:12 +00:00
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
2021-12-30 05:55:02 +00:00
}
2018-09-05 21:45:29 +00:00
2021-12-30 05:55:02 +00:00
func (entity *BotCommandScopeChat) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub BotCommandScopeChat
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
2018-09-05 21:45:29 +00:00
2021-12-30 05:55:02 +00:00
func (*BotCommandScopeChat) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassBotCommandScope
2021-12-30 05:55:02 +00:00
}
2018-09-05 21:45:29 +00:00
2021-12-30 05:55:02 +00:00
func (*BotCommandScopeChat) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeBotCommandScopeChat
2021-12-30 05:55:02 +00:00
}
2018-09-05 21:45:29 +00:00
2021-12-30 05:55:02 +00:00
func (*BotCommandScopeChat) BotCommandScopeType() string {
2022-03-13 04:04:12 +00:00
return TypeBotCommandScopeChat
2021-12-30 05:55:02 +00:00
}
2018-09-05 21:45:29 +00:00
2021-12-30 05:55:02 +00:00
// A scope covering all administrators of a chat
type BotCommandScopeChatAdministrators struct {
2022-03-13 04:04:12 +00:00
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
2021-12-30 05:55:02 +00:00
}
2018-09-05 21:45:29 +00:00
2021-12-30 05:55:02 +00:00
func (entity *BotCommandScopeChatAdministrators) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub BotCommandScopeChatAdministrators
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
2020-11-30 09:33:47 +00:00
2021-12-30 05:55:02 +00:00
func (*BotCommandScopeChatAdministrators) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassBotCommandScope
2021-12-30 05:55:02 +00:00
}
2020-11-30 09:33:47 +00:00
2021-12-30 05:55:02 +00:00
func (*BotCommandScopeChatAdministrators) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeBotCommandScopeChatAdministrators
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*BotCommandScopeChatAdministrators) BotCommandScopeType() string {
2022-03-13 04:04:12 +00:00
return TypeBotCommandScopeChatAdministrators
2021-12-30 05:55:02 +00:00
}
// A scope covering a member of a chat
type BotCommandScopeChatMember struct {
2022-03-13 04:04:12 +00:00
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
// User identifier
UserId int64 `json:"user_id"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *BotCommandScopeChatMember) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub BotCommandScopeChatMember
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*BotCommandScopeChatMember) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassBotCommandScope
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*BotCommandScopeChatMember) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeBotCommandScopeChatMember
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*BotCommandScopeChatMember) BotCommandScopeType() string {
2022-03-13 04:04:12 +00:00
return TypeBotCommandScopeChatMember
2018-08-30 14:55:42 +00:00
}
// The user authorization state has changed
type UpdateAuthorizationState struct {
2022-03-13 04:04:12 +00:00
meta
// New authorization state
AuthorizationState AuthorizationState `json:"authorization_state"`
2018-08-30 14:55:42 +00:00
}
func (entity *UpdateAuthorizationState) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateAuthorizationState
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*UpdateAuthorizationState) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2018-08-30 14:55:42 +00:00
}
func (*UpdateAuthorizationState) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateAuthorizationState
2018-08-30 14:55:42 +00:00
}
func (*UpdateAuthorizationState) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateAuthorizationState
2018-08-30 14:55:42 +00:00
}
func (updateAuthorizationState *UpdateAuthorizationState) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
AuthorizationState json.RawMessage `json:"authorization_state"`
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
fieldAuthorizationState, _ := UnmarshalAuthorizationState(tmp.AuthorizationState)
updateAuthorizationState.AuthorizationState = fieldAuthorizationState
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return nil
2018-08-30 14:55:42 +00:00
}
// A new message was received; can also be an outgoing message
type UpdateNewMessage struct {
2022-03-13 04:04:12 +00:00
meta
// The new message
Message *Message `json:"message"`
2018-08-30 14:55:42 +00:00
}
func (entity *UpdateNewMessage) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateNewMessage
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*UpdateNewMessage) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2018-08-30 14:55:42 +00:00
}
func (*UpdateNewMessage) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateNewMessage
2018-08-30 14:55:42 +00:00
}
func (*UpdateNewMessage) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateNewMessage
2018-08-30 14:55:42 +00:00
}
// A request to send a message has reached the Telegram server. This doesn't mean that the message will be sent successfully or even that the send message request will be processed. This update will be sent only if the option "use_quick_ack" is set to true. This update may be sent multiple times for the same message
type UpdateMessageSendAcknowledged struct {
2022-03-13 04:04:12 +00:00
meta
// The chat identifier of the sent message
ChatId int64 `json:"chat_id"`
// A temporary message identifier
MessageId int64 `json:"message_id"`
2018-08-30 14:55:42 +00:00
}
func (entity *UpdateMessageSendAcknowledged) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateMessageSendAcknowledged
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*UpdateMessageSendAcknowledged) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2018-08-30 14:55:42 +00:00
}
func (*UpdateMessageSendAcknowledged) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateMessageSendAcknowledged
2018-08-30 14:55:42 +00:00
}
func (*UpdateMessageSendAcknowledged) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateMessageSendAcknowledged
2018-08-30 14:55:42 +00:00
}
// A message has been successfully sent
type UpdateMessageSendSucceeded struct {
2022-03-13 04:04:12 +00:00
meta
// The sent message. Usually only the message identifier, date, and content are changed, but almost all other fields can also change
Message *Message `json:"message"`
// The previous temporary message identifier
OldMessageId int64 `json:"old_message_id"`
2018-08-30 14:55:42 +00:00
}
func (entity *UpdateMessageSendSucceeded) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateMessageSendSucceeded
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*UpdateMessageSendSucceeded) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2018-08-30 14:55:42 +00:00
}
func (*UpdateMessageSendSucceeded) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateMessageSendSucceeded
2018-08-30 14:55:42 +00:00
}
func (*UpdateMessageSendSucceeded) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateMessageSendSucceeded
2018-08-30 14:55:42 +00:00
}
// A message failed to send. Be aware that some messages being sent can be irrecoverably deleted, in which case updateDeleteMessages will be received instead of this update
type UpdateMessageSendFailed struct {
2022-03-13 04:04:12 +00:00
meta
// The failed to send message
Message *Message `json:"message"`
// The previous temporary message identifier
OldMessageId int64 `json:"old_message_id"`
// An error code
ErrorCode int32 `json:"error_code"`
// Error message
ErrorMessage string `json:"error_message"`
2018-08-30 14:55:42 +00:00
}
func (entity *UpdateMessageSendFailed) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateMessageSendFailed
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*UpdateMessageSendFailed) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2018-08-30 14:55:42 +00:00
}
func (*UpdateMessageSendFailed) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateMessageSendFailed
2018-08-30 14:55:42 +00:00
}
func (*UpdateMessageSendFailed) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateMessageSendFailed
2018-08-30 14:55:42 +00:00
}
// The message content has changed
type UpdateMessageContent struct {
2022-03-13 04:04:12 +00:00
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
// Message identifier
MessageId int64 `json:"message_id"`
// New message content
NewContent MessageContent `json:"new_content"`
2018-08-30 14:55:42 +00:00
}
func (entity *UpdateMessageContent) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateMessageContent
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*UpdateMessageContent) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2018-08-30 14:55:42 +00:00
}
func (*UpdateMessageContent) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateMessageContent
2018-08-30 14:55:42 +00:00
}
func (*UpdateMessageContent) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateMessageContent
2018-08-30 14:55:42 +00:00
}
func (updateMessageContent *UpdateMessageContent) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
ChatId int64 `json:"chat_id"`
MessageId int64 `json:"message_id"`
NewContent json.RawMessage `json:"new_content"`
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
updateMessageContent.ChatId = tmp.ChatId
updateMessageContent.MessageId = tmp.MessageId
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
fieldNewContent, _ := UnmarshalMessageContent(tmp.NewContent)
updateMessageContent.NewContent = fieldNewContent
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return nil
2018-08-30 14:55:42 +00:00
}
// A message was edited. Changes in the message content will come in a separate updateMessageContent
type UpdateMessageEdited struct {
2022-03-13 04:04:12 +00:00
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
// Message identifier
MessageId int64 `json:"message_id"`
// Point in time (Unix timestamp) when the message was edited
EditDate int32 `json:"edit_date"`
// New message reply markup; may be null
ReplyMarkup ReplyMarkup `json:"reply_markup"`
2018-08-30 14:55:42 +00:00
}
func (entity *UpdateMessageEdited) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateMessageEdited
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*UpdateMessageEdited) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2018-08-30 14:55:42 +00:00
}
func (*UpdateMessageEdited) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateMessageEdited
2018-08-30 14:55:42 +00:00
}
func (*UpdateMessageEdited) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateMessageEdited
2018-08-30 14:55:42 +00:00
}
func (updateMessageEdited *UpdateMessageEdited) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
ChatId int64 `json:"chat_id"`
MessageId int64 `json:"message_id"`
EditDate int32 `json:"edit_date"`
ReplyMarkup json.RawMessage `json:"reply_markup"`
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
updateMessageEdited.ChatId = tmp.ChatId
updateMessageEdited.MessageId = tmp.MessageId
updateMessageEdited.EditDate = tmp.EditDate
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
fieldReplyMarkup, _ := UnmarshalReplyMarkup(tmp.ReplyMarkup)
updateMessageEdited.ReplyMarkup = fieldReplyMarkup
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return nil
2018-08-30 14:55:42 +00:00
}
2020-11-30 09:33:47 +00:00
// The message pinned state was changed
type UpdateMessageIsPinned struct {
2022-03-13 04:04:12 +00:00
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
// The message identifier
MessageId int64 `json:"message_id"`
// True, if the message is pinned
IsPinned bool `json:"is_pinned"`
2020-11-30 09:33:47 +00:00
}
func (entity *UpdateMessageIsPinned) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateMessageIsPinned
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-11-30 09:33:47 +00:00
}
func (*UpdateMessageIsPinned) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2020-11-30 09:33:47 +00:00
}
func (*UpdateMessageIsPinned) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateMessageIsPinned
2020-11-30 09:33:47 +00:00
}
func (*UpdateMessageIsPinned) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateMessageIsPinned
2020-11-30 09:33:47 +00:00
}
// The information about interactions with a message has changed
type UpdateMessageInteractionInfo struct {
2022-03-13 04:04:12 +00:00
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
// Message identifier
MessageId int64 `json:"message_id"`
// New information about interactions with the message; may be null
InteractionInfo *MessageInteractionInfo `json:"interaction_info"`
2018-08-30 14:55:42 +00:00
}
2020-11-30 09:33:47 +00:00
func (entity *UpdateMessageInteractionInfo) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateMessageInteractionInfo
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2020-11-30 09:33:47 +00:00
func (*UpdateMessageInteractionInfo) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2018-08-30 14:55:42 +00:00
}
2020-11-30 09:33:47 +00:00
func (*UpdateMessageInteractionInfo) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateMessageInteractionInfo
2018-08-30 14:55:42 +00:00
}
2020-11-30 09:33:47 +00:00
func (*UpdateMessageInteractionInfo) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateMessageInteractionInfo
2018-08-30 14:55:42 +00:00
}
// The message content was opened. Updates voice note messages to "listened", video note messages to "viewed" and starts the TTL timer for self-destructing messages
type UpdateMessageContentOpened struct {
2022-03-13 04:04:12 +00:00
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
// Message identifier
MessageId int64 `json:"message_id"`
2018-08-30 14:55:42 +00:00
}
func (entity *UpdateMessageContentOpened) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateMessageContentOpened
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*UpdateMessageContentOpened) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2018-08-30 14:55:42 +00:00
}
func (*UpdateMessageContentOpened) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateMessageContentOpened
2018-08-30 14:55:42 +00:00
}
func (*UpdateMessageContentOpened) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateMessageContentOpened
2018-08-30 14:55:42 +00:00
}
// A message with an unread mention was read
type UpdateMessageMentionRead struct {
2022-03-13 04:04:12 +00:00
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
// Message identifier
MessageId int64 `json:"message_id"`
// The new number of unread mention messages left in the chat
UnreadMentionCount int32 `json:"unread_mention_count"`
2018-08-30 14:55:42 +00:00
}
func (entity *UpdateMessageMentionRead) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateMessageMentionRead
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*UpdateMessageMentionRead) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2018-08-30 14:55:42 +00:00
}
func (*UpdateMessageMentionRead) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateMessageMentionRead
2018-08-30 14:55:42 +00:00
}
func (*UpdateMessageMentionRead) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateMessageMentionRead
2018-08-30 14:55:42 +00:00
}
2022-02-06 18:36:17 +00:00
// The list of unread reactions added to a message was changed
type UpdateMessageUnreadReactions struct {
2022-03-13 04:04:12 +00:00
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
// Message identifier
MessageId int64 `json:"message_id"`
// The new list of unread reactions
UnreadReactions []*UnreadReaction `json:"unread_reactions"`
// The new number of messages with unread reactions left in the chat
UnreadReactionCount int32 `json:"unread_reaction_count"`
2022-02-06 18:36:17 +00:00
}
func (entity *UpdateMessageUnreadReactions) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2022-02-06 18:36:17 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateMessageUnreadReactions
2022-02-06 18:36:17 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2022-02-06 18:36:17 +00:00
}
func (*UpdateMessageUnreadReactions) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2022-02-06 18:36:17 +00:00
}
func (*UpdateMessageUnreadReactions) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateMessageUnreadReactions
2022-02-06 18:36:17 +00:00
}
func (*UpdateMessageUnreadReactions) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateMessageUnreadReactions
2022-02-06 18:36:17 +00:00
}
2020-11-30 09:33:47 +00:00
// A message with a live location was viewed. When the update is received, the application is supposed to update the live location
2020-02-03 12:56:20 +00:00
type UpdateMessageLiveLocationViewed struct {
2022-03-13 04:04:12 +00:00
meta
// Identifier of the chat with the live location message
ChatId int64 `json:"chat_id"`
// Identifier of the message with live location
MessageId int64 `json:"message_id"`
2020-02-03 12:56:20 +00:00
}
func (entity *UpdateMessageLiveLocationViewed) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateMessageLiveLocationViewed
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-02-03 12:56:20 +00:00
}
func (*UpdateMessageLiveLocationViewed) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2020-02-03 12:56:20 +00:00
}
func (*UpdateMessageLiveLocationViewed) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateMessageLiveLocationViewed
2020-02-03 12:56:20 +00:00
}
func (*UpdateMessageLiveLocationViewed) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateMessageLiveLocationViewed
2020-02-03 12:56:20 +00:00
}
2020-11-30 09:33:47 +00:00
// A new chat has been loaded/created. This update is guaranteed to come before the chat identifier is returned to the application. The chat field changes will be reported through separate updates
2018-08-30 14:55:42 +00:00
type UpdateNewChat struct {
2022-03-13 04:04:12 +00:00
meta
// The chat
Chat *Chat `json:"chat"`
2018-08-30 14:55:42 +00:00
}
func (entity *UpdateNewChat) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateNewChat
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*UpdateNewChat) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2018-08-30 14:55:42 +00:00
}
func (*UpdateNewChat) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateNewChat
2018-08-30 14:55:42 +00:00
}
func (*UpdateNewChat) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateNewChat
2018-08-30 14:55:42 +00:00
}
// The title of a chat was changed
type UpdateChatTitle struct {
2022-03-13 04:04:12 +00:00
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
// The new chat title
Title string `json:"title"`
2018-08-30 14:55:42 +00:00
}
func (entity *UpdateChatTitle) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateChatTitle
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*UpdateChatTitle) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2018-08-30 14:55:42 +00:00
}
func (*UpdateChatTitle) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateChatTitle
2018-08-30 14:55:42 +00:00
}
func (*UpdateChatTitle) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateChatTitle
2018-08-30 14:55:42 +00:00
}
// A chat photo was changed
type UpdateChatPhoto struct {
2022-03-13 04:04:12 +00:00
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
// The new chat photo; may be null
Photo *ChatPhotoInfo `json:"photo"`
2018-08-30 14:55:42 +00:00
}
func (entity *UpdateChatPhoto) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateChatPhoto
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*UpdateChatPhoto) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2021-12-30 05:55:02 +00:00
}
func (*UpdateChatPhoto) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateChatPhoto
2021-12-30 05:55:02 +00:00
}
func (*UpdateChatPhoto) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateChatPhoto
2021-12-30 05:55:02 +00:00
}
// Chat permissions was changed
type UpdateChatPermissions struct {
2022-03-13 04:04:12 +00:00
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
// The new chat permissions
Permissions *ChatPermissions `json:"permissions"`
2021-12-30 05:55:02 +00:00
}
func (entity *UpdateChatPermissions) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateChatPermissions
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*UpdateChatPermissions) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2021-12-30 05:55:02 +00:00
}
func (*UpdateChatPermissions) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateChatPermissions
2021-12-30 05:55:02 +00:00
}
func (*UpdateChatPermissions) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateChatPermissions
2021-12-30 05:55:02 +00:00
}
// The last message of a chat was changed. If last_message is null, then the last message in the chat became unknown. Some new unknown messages might be added to the chat in this case
type UpdateChatLastMessage struct {
2022-03-13 04:04:12 +00:00
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
// The new last message in the chat; may be null
LastMessage *Message `json:"last_message"`
// The new chat positions in the chat lists
Positions []*ChatPosition `json:"positions"`
2021-12-30 05:55:02 +00:00
}
func (entity *UpdateChatLastMessage) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateChatLastMessage
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*UpdateChatLastMessage) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2021-12-30 05:55:02 +00:00
}
func (*UpdateChatLastMessage) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateChatLastMessage
2021-12-30 05:55:02 +00:00
}
func (*UpdateChatLastMessage) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateChatLastMessage
2021-12-30 05:55:02 +00:00
}
// The position of a chat in a chat list has changed. Instead of this update updateChatLastMessage or updateChatDraftMessage might be sent
type UpdateChatPosition struct {
2022-03-13 04:04:12 +00:00
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
// New chat position. If new order is 0, then the chat needs to be removed from the list
Position *ChatPosition `json:"position"`
2021-12-30 05:55:02 +00:00
}
func (entity *UpdateChatPosition) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateChatPosition
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*UpdateChatPosition) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2021-12-30 05:55:02 +00:00
}
func (*UpdateChatPosition) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateChatPosition
2021-12-30 05:55:02 +00:00
}
func (*UpdateChatPosition) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateChatPosition
2021-12-30 05:55:02 +00:00
}
// Incoming messages were read or the number of unread messages has been changed
type UpdateChatReadInbox struct {
2022-03-13 04:04:12 +00:00
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
// Identifier of the last read incoming message
LastReadInboxMessageId int64 `json:"last_read_inbox_message_id"`
// The number of unread messages left in the chat
UnreadCount int32 `json:"unread_count"`
2021-12-30 05:55:02 +00:00
}
func (entity *UpdateChatReadInbox) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateChatReadInbox
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*UpdateChatReadInbox) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2021-12-30 05:55:02 +00:00
}
func (*UpdateChatReadInbox) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateChatReadInbox
2021-12-30 05:55:02 +00:00
}
func (*UpdateChatReadInbox) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateChatReadInbox
2021-12-30 05:55:02 +00:00
}
// Outgoing messages were read
type UpdateChatReadOutbox struct {
2022-03-13 04:04:12 +00:00
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
// Identifier of last read outgoing message
LastReadOutboxMessageId int64 `json:"last_read_outbox_message_id"`
2021-12-30 05:55:02 +00:00
}
func (entity *UpdateChatReadOutbox) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateChatReadOutbox
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UpdateChatReadOutbox) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UpdateChatReadOutbox) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateChatReadOutbox
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UpdateChatReadOutbox) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateChatReadOutbox
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// The chat action bar was changed
type UpdateChatActionBar struct {
2022-03-13 04:04:12 +00:00
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
// The new value of the action bar; may be null
ActionBar ChatActionBar `json:"action_bar"`
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *UpdateChatActionBar) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-09-10 12:36:54 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateChatActionBar
2019-09-10 12:36:54 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UpdateChatActionBar) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UpdateChatActionBar) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateChatActionBar
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UpdateChatActionBar) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateChatActionBar
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
func (updateChatActionBar *UpdateChatActionBar) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
ChatId int64 `json:"chat_id"`
ActionBar json.RawMessage `json:"action_bar"`
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
updateChatActionBar.ChatId = tmp.ChatId
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
fieldActionBar, _ := UnmarshalChatActionBar(tmp.ActionBar)
updateChatActionBar.ActionBar = fieldActionBar
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return nil
2021-12-30 05:55:02 +00:00
}
2022-02-06 18:36:17 +00:00
// The chat available reactions were changed
type UpdateChatAvailableReactions struct {
2022-03-13 04:04:12 +00:00
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
// The new list of reactions, available in the chat
AvailableReactions []string `json:"available_reactions"`
2022-02-06 18:36:17 +00:00
}
func (entity *UpdateChatAvailableReactions) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2022-02-06 18:36:17 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateChatAvailableReactions
2022-02-06 18:36:17 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2022-02-06 18:36:17 +00:00
}
func (*UpdateChatAvailableReactions) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2022-02-06 18:36:17 +00:00
}
func (*UpdateChatAvailableReactions) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateChatAvailableReactions
2022-02-06 18:36:17 +00:00
}
func (*UpdateChatAvailableReactions) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateChatAvailableReactions
2022-02-06 18:36:17 +00:00
}
2021-12-30 05:55:02 +00:00
// A chat draft has changed. Be aware that the update may come in the currently opened chat but with old content of the draft. If the user has changed the content of the draft, this update mustn't be applied
type UpdateChatDraftMessage struct {
2022-03-13 04:04:12 +00:00
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
// The new draft message; may be null
DraftMessage *DraftMessage `json:"draft_message"`
// The new chat positions in the chat lists
Positions []*ChatPosition `json:"positions"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *UpdateChatDraftMessage) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateChatDraftMessage
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UpdateChatDraftMessage) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UpdateChatDraftMessage) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateChatDraftMessage
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UpdateChatDraftMessage) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateChatDraftMessage
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// The message sender that is selected to send messages in a chat has changed
type UpdateChatMessageSender struct {
2022-03-13 04:04:12 +00:00
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
// New value of message_sender_id; may be null if the user can't change message sender
MessageSenderId MessageSender `json:"message_sender_id"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *UpdateChatMessageSender) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateChatMessageSender
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UpdateChatMessageSender) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UpdateChatMessageSender) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateChatMessageSender
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UpdateChatMessageSender) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateChatMessageSender
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (updateChatMessageSender *UpdateChatMessageSender) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
ChatId int64 `json:"chat_id"`
MessageSenderId json.RawMessage `json:"message_sender_id"`
}
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
updateChatMessageSender.ChatId = tmp.ChatId
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
fieldMessageSenderId, _ := UnmarshalMessageSender(tmp.MessageSenderId)
updateChatMessageSender.MessageSenderId = fieldMessageSenderId
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return nil
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
// The message Time To Live setting for a chat was changed
type UpdateChatMessageTtl struct {
2022-03-13 04:04:12 +00:00
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
// New value of message_ttl
MessageTtl int32 `json:"message_ttl"`
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *UpdateChatMessageTtl) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateChatMessageTtl
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UpdateChatMessageTtl) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UpdateChatMessageTtl) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateChatMessageTtl
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UpdateChatMessageTtl) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateChatMessageTtl
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
// Notification settings for a chat were changed
type UpdateChatNotificationSettings struct {
2022-03-13 04:04:12 +00:00
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
// The new notification settings
NotificationSettings *ChatNotificationSettings `json:"notification_settings"`
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *UpdateChatNotificationSettings) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateChatNotificationSettings
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UpdateChatNotificationSettings) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UpdateChatNotificationSettings) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateChatNotificationSettings
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UpdateChatNotificationSettings) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateChatNotificationSettings
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
// The chat pending join requests were changed
type UpdateChatPendingJoinRequests struct {
2022-03-13 04:04:12 +00:00
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
// The new data about pending join requests; may be null
PendingJoinRequests *ChatJoinRequestsInfo `json:"pending_join_requests"`
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *UpdateChatPendingJoinRequests) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateChatPendingJoinRequests
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UpdateChatPendingJoinRequests) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UpdateChatPendingJoinRequests) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateChatPendingJoinRequests
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UpdateChatPendingJoinRequests) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateChatPendingJoinRequests
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
// The default chat reply markup was changed. Can occur because new messages with reply markup were received or because an old reply markup was hidden by the user
type UpdateChatReplyMarkup struct {
2022-03-13 04:04:12 +00:00
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
// Identifier of the message from which reply markup needs to be used; 0 if there is no default custom reply markup in the chat
ReplyMarkupMessageId int64 `json:"reply_markup_message_id"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *UpdateChatReplyMarkup) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateChatReplyMarkup
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UpdateChatReplyMarkup) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UpdateChatReplyMarkup) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateChatReplyMarkup
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UpdateChatReplyMarkup) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateChatReplyMarkup
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// The chat theme was changed
type UpdateChatTheme struct {
2022-03-13 04:04:12 +00:00
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
// The new name of the chat theme; may be empty if theme was reset to default
ThemeName string `json:"theme_name"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *UpdateChatTheme) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateChatTheme
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UpdateChatTheme) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UpdateChatTheme) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateChatTheme
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UpdateChatTheme) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateChatTheme
2018-08-30 14:55:42 +00:00
}
// The chat unread_mention_count has changed
type UpdateChatUnreadMentionCount struct {
2022-03-13 04:04:12 +00:00
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
// The number of unread mention messages left in the chat
UnreadMentionCount int32 `json:"unread_mention_count"`
2018-08-30 14:55:42 +00:00
}
func (entity *UpdateChatUnreadMentionCount) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateChatUnreadMentionCount
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*UpdateChatUnreadMentionCount) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2018-08-30 14:55:42 +00:00
}
func (*UpdateChatUnreadMentionCount) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateChatUnreadMentionCount
2018-08-30 14:55:42 +00:00
}
func (*UpdateChatUnreadMentionCount) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateChatUnreadMentionCount
2018-08-30 14:55:42 +00:00
}
2022-02-06 18:36:17 +00:00
// The chat unread_reaction_count has changed
type UpdateChatUnreadReactionCount struct {
2022-03-13 04:04:12 +00:00
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
// The number of messages with unread reactions left in the chat
UnreadReactionCount int32 `json:"unread_reaction_count"`
2022-02-06 18:36:17 +00:00
}
func (entity *UpdateChatUnreadReactionCount) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2022-02-06 18:36:17 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateChatUnreadReactionCount
2022-02-06 18:36:17 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2022-02-06 18:36:17 +00:00
}
func (*UpdateChatUnreadReactionCount) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2022-02-06 18:36:17 +00:00
}
func (*UpdateChatUnreadReactionCount) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateChatUnreadReactionCount
2022-02-06 18:36:17 +00:00
}
func (*UpdateChatUnreadReactionCount) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateChatUnreadReactionCount
2022-02-06 18:36:17 +00:00
}
2021-12-30 05:55:02 +00:00
// A chat video chat state has changed
type UpdateChatVideoChat struct {
2022-03-13 04:04:12 +00:00
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
// New value of video_chat
VideoChat *VideoChat `json:"video_chat"`
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *UpdateChatVideoChat) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateChatVideoChat
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UpdateChatVideoChat) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UpdateChatVideoChat) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateChatVideoChat
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UpdateChatVideoChat) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateChatVideoChat
2018-09-05 21:45:29 +00:00
}
2021-12-30 05:55:02 +00:00
// The value of the default disable_notification parameter, used when a message is sent to the chat, was changed
type UpdateChatDefaultDisableNotification struct {
2022-03-13 04:04:12 +00:00
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
// The new default_disable_notification value
DefaultDisableNotification bool `json:"default_disable_notification"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *UpdateChatDefaultDisableNotification) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateChatDefaultDisableNotification
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UpdateChatDefaultDisableNotification) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UpdateChatDefaultDisableNotification) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateChatDefaultDisableNotification
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UpdateChatDefaultDisableNotification) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateChatDefaultDisableNotification
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A chat content was allowed or restricted for saving
type UpdateChatHasProtectedContent struct {
2022-03-13 04:04:12 +00:00
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
// New value of has_protected_content
HasProtectedContent bool `json:"has_protected_content"`
2021-12-30 05:55:02 +00:00
}
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
func (entity *UpdateChatHasProtectedContent) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateChatHasProtectedContent
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
2018-08-30 14:55:42 +00:00
2021-12-30 05:55:02 +00:00
func (*UpdateChatHasProtectedContent) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2021-12-30 05:55:02 +00:00
}
func (*UpdateChatHasProtectedContent) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateChatHasProtectedContent
2021-12-30 05:55:02 +00:00
}
func (*UpdateChatHasProtectedContent) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateChatHasProtectedContent
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A chat's has_scheduled_messages field has changed
type UpdateChatHasScheduledMessages struct {
2022-03-13 04:04:12 +00:00
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
// New value of has_scheduled_messages
HasScheduledMessages bool `json:"has_scheduled_messages"`
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *UpdateChatHasScheduledMessages) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateChatHasScheduledMessages
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UpdateChatHasScheduledMessages) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UpdateChatHasScheduledMessages) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateChatHasScheduledMessages
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UpdateChatHasScheduledMessages) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateChatHasScheduledMessages
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
// A chat was blocked or unblocked
type UpdateChatIsBlocked struct {
2022-03-13 04:04:12 +00:00
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
// New value of is_blocked
IsBlocked bool `json:"is_blocked"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *UpdateChatIsBlocked) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateChatIsBlocked
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UpdateChatIsBlocked) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UpdateChatIsBlocked) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateChatIsBlocked
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UpdateChatIsBlocked) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateChatIsBlocked
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A chat was marked as unread or was read
type UpdateChatIsMarkedAsUnread struct {
2022-03-13 04:04:12 +00:00
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
// New value of is_marked_as_unread
IsMarkedAsUnread bool `json:"is_marked_as_unread"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *UpdateChatIsMarkedAsUnread) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateChatIsMarkedAsUnread
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UpdateChatIsMarkedAsUnread) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UpdateChatIsMarkedAsUnread) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateChatIsMarkedAsUnread
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UpdateChatIsMarkedAsUnread) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateChatIsMarkedAsUnread
2018-08-30 14:55:42 +00:00
}
2020-11-30 09:33:47 +00:00
// The list of chat filters or a chat filter has changed
type UpdateChatFilters struct {
2022-03-13 04:04:12 +00:00
meta
// The new list of chat filters
ChatFilters []*ChatFilterInfo `json:"chat_filters"`
2020-11-30 09:33:47 +00:00
}
func (entity *UpdateChatFilters) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateChatFilters
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-11-30 09:33:47 +00:00
}
func (*UpdateChatFilters) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2020-11-30 09:33:47 +00:00
}
func (*UpdateChatFilters) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateChatFilters
2020-11-30 09:33:47 +00:00
}
func (*UpdateChatFilters) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateChatFilters
2020-11-30 09:33:47 +00:00
}
2022-03-13 04:04:12 +00:00
// The number of online group members has changed. This update with non-zero number of online group members is sent only for currently opened chats. There is no guarantee that it will be sent just after the number of online users has changed
2019-06-07 10:56:06 +00:00
type UpdateChatOnlineMemberCount struct {
2022-03-13 04:04:12 +00:00
meta
// Identifier of the chat
ChatId int64 `json:"chat_id"`
// New number of online members in the chat, or 0 if unknown
OnlineMemberCount int32 `json:"online_member_count"`
2019-06-07 10:56:06 +00:00
}
func (entity *UpdateChatOnlineMemberCount) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateChatOnlineMemberCount
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
func (*UpdateChatOnlineMemberCount) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2019-06-07 10:56:06 +00:00
}
func (*UpdateChatOnlineMemberCount) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateChatOnlineMemberCount
2019-06-07 10:56:06 +00:00
}
func (*UpdateChatOnlineMemberCount) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateChatOnlineMemberCount
2019-06-07 10:56:06 +00:00
}
2021-12-30 05:55:02 +00:00
// Notification settings for some type of chats were updated
type UpdateScopeNotificationSettings struct {
2022-03-13 04:04:12 +00:00
meta
// Types of chats for which notification settings were updated
Scope NotificationSettingsScope `json:"scope"`
// The new notification settings
NotificationSettings *ScopeNotificationSettings `json:"notification_settings"`
2021-12-30 05:55:02 +00:00
}
func (entity *UpdateScopeNotificationSettings) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateScopeNotificationSettings
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*UpdateScopeNotificationSettings) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2021-12-30 05:55:02 +00:00
}
func (*UpdateScopeNotificationSettings) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateScopeNotificationSettings
2021-12-30 05:55:02 +00:00
}
func (*UpdateScopeNotificationSettings) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateScopeNotificationSettings
2021-12-30 05:55:02 +00:00
}
func (updateScopeNotificationSettings *UpdateScopeNotificationSettings) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Scope json.RawMessage `json:"scope"`
NotificationSettings *ScopeNotificationSettings `json:"notification_settings"`
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
updateScopeNotificationSettings.NotificationSettings = tmp.NotificationSettings
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
fieldScope, _ := UnmarshalNotificationSettingsScope(tmp.Scope)
updateScopeNotificationSettings.Scope = fieldScope
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return nil
2021-12-30 05:55:02 +00:00
}
2019-06-07 10:56:06 +00:00
// A notification was changed
type UpdateNotification struct {
2022-03-13 04:04:12 +00:00
meta
// Unique notification group identifier
NotificationGroupId int32 `json:"notification_group_id"`
// Changed notification
Notification *Notification `json:"notification"`
2019-06-07 10:56:06 +00:00
}
func (entity *UpdateNotification) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateNotification
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
func (*UpdateNotification) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2019-06-07 10:56:06 +00:00
}
func (*UpdateNotification) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateNotification
2019-06-07 10:56:06 +00:00
}
func (*UpdateNotification) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateNotification
2019-06-07 10:56:06 +00:00
}
// A list of active notifications in a notification group has changed
type UpdateNotificationGroup struct {
2022-03-13 04:04:12 +00:00
meta
// Unique notification group identifier
NotificationGroupId int32 `json:"notification_group_id"`
// New type of the notification group
Type NotificationGroupType `json:"type"`
// Identifier of a chat to which all notifications in the group belong
ChatId int64 `json:"chat_id"`
// Chat identifier, which notification settings must be applied to the added notifications
NotificationSettingsChatId int64 `json:"notification_settings_chat_id"`
// True, if the notifications must be shown without sound
IsSilent bool `json:"is_silent"`
// Total number of unread notifications in the group, can be bigger than number of active notifications
TotalCount int32 `json:"total_count"`
// List of added group notifications, sorted by notification ID
AddedNotifications []*Notification `json:"added_notifications"`
// Identifiers of removed group notifications, sorted by notification ID
RemovedNotificationIds []int32 `json:"removed_notification_ids"`
2019-06-07 10:56:06 +00:00
}
func (entity *UpdateNotificationGroup) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateNotificationGroup
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
func (*UpdateNotificationGroup) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2019-06-07 10:56:06 +00:00
}
func (*UpdateNotificationGroup) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateNotificationGroup
2019-06-07 10:56:06 +00:00
}
func (*UpdateNotificationGroup) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateNotificationGroup
2019-06-07 10:56:06 +00:00
}
func (updateNotificationGroup *UpdateNotificationGroup) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
NotificationGroupId int32 `json:"notification_group_id"`
Type json.RawMessage `json:"type"`
ChatId int64 `json:"chat_id"`
NotificationSettingsChatId int64 `json:"notification_settings_chat_id"`
IsSilent bool `json:"is_silent"`
TotalCount int32 `json:"total_count"`
AddedNotifications []*Notification `json:"added_notifications"`
RemovedNotificationIds []int32 `json:"removed_notification_ids"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
updateNotificationGroup.NotificationGroupId = tmp.NotificationGroupId
updateNotificationGroup.ChatId = tmp.ChatId
updateNotificationGroup.NotificationSettingsChatId = tmp.NotificationSettingsChatId
updateNotificationGroup.IsSilent = tmp.IsSilent
updateNotificationGroup.TotalCount = tmp.TotalCount
updateNotificationGroup.AddedNotifications = tmp.AddedNotifications
updateNotificationGroup.RemovedNotificationIds = tmp.RemovedNotificationIds
fieldType, _ := UnmarshalNotificationGroupType(tmp.Type)
updateNotificationGroup.Type = fieldType
return nil
2019-06-07 10:56:06 +00:00
}
2020-02-03 12:56:20 +00:00
// Contains active notifications that was shown on previous application launches. This update is sent only if the message database is used. In that case it comes once before any updateNotification and updateNotificationGroup update
2019-06-07 10:56:06 +00:00
type UpdateActiveNotifications struct {
2022-03-13 04:04:12 +00:00
meta
// Lists of active notification groups
Groups []*NotificationGroup `json:"groups"`
2019-06-07 10:56:06 +00:00
}
func (entity *UpdateActiveNotifications) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateActiveNotifications
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
func (*UpdateActiveNotifications) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2019-06-07 10:56:06 +00:00
}
func (*UpdateActiveNotifications) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateActiveNotifications
2019-06-07 10:56:06 +00:00
}
func (*UpdateActiveNotifications) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateActiveNotifications
2019-06-07 10:56:06 +00:00
}
2020-02-03 12:56:20 +00:00
// Describes whether there are some pending notification updates. Can be used to prevent application from killing, while there are some pending notifications
2019-06-07 10:56:06 +00:00
type UpdateHavePendingNotifications struct {
2022-03-13 04:04:12 +00:00
meta
// True, if there are some delayed notification updates, which will be sent soon
HaveDelayedNotifications bool `json:"have_delayed_notifications"`
// True, if there can be some yet unreceived notifications, which are being fetched from the server
HaveUnreceivedNotifications bool `json:"have_unreceived_notifications"`
2019-06-07 10:56:06 +00:00
}
func (entity *UpdateHavePendingNotifications) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateHavePendingNotifications
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
func (*UpdateHavePendingNotifications) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2019-06-07 10:56:06 +00:00
}
func (*UpdateHavePendingNotifications) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateHavePendingNotifications
2019-06-07 10:56:06 +00:00
}
func (*UpdateHavePendingNotifications) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateHavePendingNotifications
2019-06-07 10:56:06 +00:00
}
2018-08-30 14:55:42 +00:00
// Some messages were deleted
type UpdateDeleteMessages struct {
2022-03-13 04:04:12 +00:00
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
// Identifiers of the deleted messages
MessageIds []int64 `json:"message_ids"`
// True, if the messages are permanently deleted by a user (as opposed to just becoming inaccessible)
IsPermanent bool `json:"is_permanent"`
// True, if the messages are deleted only from the cache and can possibly be retrieved again in the future
FromCache bool `json:"from_cache"`
2018-08-30 14:55:42 +00:00
}
func (entity *UpdateDeleteMessages) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateDeleteMessages
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*UpdateDeleteMessages) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2018-08-30 14:55:42 +00:00
}
func (*UpdateDeleteMessages) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateDeleteMessages
2018-08-30 14:55:42 +00:00
}
func (*UpdateDeleteMessages) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateDeleteMessages
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A message sender activity in the chat has changed
type UpdateChatAction struct {
2022-03-13 04:04:12 +00:00
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
// If not 0, a message thread identifier in which the action was performed
MessageThreadId int64 `json:"message_thread_id"`
// Identifier of a message sender performing the action
SenderId MessageSender `json:"sender_id"`
// The action
Action ChatAction `json:"action"`
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (entity *UpdateChatAction) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateChatAction
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UpdateChatAction) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UpdateChatAction) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateChatAction
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (*UpdateChatAction) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateChatAction
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (updateChatAction *UpdateChatAction) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
ChatId int64 `json:"chat_id"`
MessageThreadId int64 `json:"message_thread_id"`
SenderId json.RawMessage `json:"sender_id"`
Action json.RawMessage `json:"action"`
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
updateChatAction.ChatId = tmp.ChatId
updateChatAction.MessageThreadId = tmp.MessageThreadId
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
fieldSenderId, _ := UnmarshalMessageSender(tmp.SenderId)
updateChatAction.SenderId = fieldSenderId
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
fieldAction, _ := UnmarshalChatAction(tmp.Action)
updateChatAction.Action = fieldAction
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return nil
2018-08-30 14:55:42 +00:00
}
// The user went online or offline
type UpdateUserStatus struct {
2022-03-13 04:04:12 +00:00
meta
// User identifier
UserId int64 `json:"user_id"`
// New status of the user
Status UserStatus `json:"status"`
2018-08-30 14:55:42 +00:00
}
func (entity *UpdateUserStatus) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateUserStatus
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*UpdateUserStatus) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2018-08-30 14:55:42 +00:00
}
func (*UpdateUserStatus) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateUserStatus
2018-08-30 14:55:42 +00:00
}
func (*UpdateUserStatus) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateUserStatus
2018-08-30 14:55:42 +00:00
}
func (updateUserStatus *UpdateUserStatus) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
UserId int64 `json:"user_id"`
Status json.RawMessage `json:"status"`
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
updateUserStatus.UserId = tmp.UserId
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
fieldStatus, _ := UnmarshalUserStatus(tmp.Status)
updateUserStatus.Status = fieldStatus
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return nil
2018-08-30 14:55:42 +00:00
}
2020-11-30 09:33:47 +00:00
// Some data of a user has changed. This update is guaranteed to come before the user identifier is returned to the application
2018-08-30 14:55:42 +00:00
type UpdateUser struct {
2022-03-13 04:04:12 +00:00
meta
// New data about the user
User *User `json:"user"`
2018-08-30 14:55:42 +00:00
}
func (entity *UpdateUser) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateUser
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*UpdateUser) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2018-08-30 14:55:42 +00:00
}
func (*UpdateUser) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateUser
2018-08-30 14:55:42 +00:00
}
func (*UpdateUser) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateUser
2018-08-30 14:55:42 +00:00
}
2020-11-30 09:33:47 +00:00
// Some data of a basic group has changed. This update is guaranteed to come before the basic group identifier is returned to the application
2018-08-30 14:55:42 +00:00
type UpdateBasicGroup struct {
2022-03-13 04:04:12 +00:00
meta
// New data about the group
BasicGroup *BasicGroup `json:"basic_group"`
2018-08-30 14:55:42 +00:00
}
func (entity *UpdateBasicGroup) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateBasicGroup
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*UpdateBasicGroup) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2018-08-30 14:55:42 +00:00
}
func (*UpdateBasicGroup) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateBasicGroup
2018-08-30 14:55:42 +00:00
}
func (*UpdateBasicGroup) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateBasicGroup
2018-08-30 14:55:42 +00:00
}
2020-11-30 09:33:47 +00:00
// Some data of a supergroup or a channel has changed. This update is guaranteed to come before the supergroup identifier is returned to the application
2018-08-30 14:55:42 +00:00
type UpdateSupergroup struct {
2022-03-13 04:04:12 +00:00
meta
// New data about the supergroup
Supergroup *Supergroup `json:"supergroup"`
2018-08-30 14:55:42 +00:00
}
func (entity *UpdateSupergroup) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateSupergroup
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*UpdateSupergroup) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2018-08-30 14:55:42 +00:00
}
func (*UpdateSupergroup) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateSupergroup
2018-08-30 14:55:42 +00:00
}
func (*UpdateSupergroup) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateSupergroup
2018-08-30 14:55:42 +00:00
}
2020-11-30 09:33:47 +00:00
// Some data of a secret chat has changed. This update is guaranteed to come before the secret chat identifier is returned to the application
2018-08-30 14:55:42 +00:00
type UpdateSecretChat struct {
2022-03-13 04:04:12 +00:00
meta
// New data about the secret chat
SecretChat *SecretChat `json:"secret_chat"`
2018-08-30 14:55:42 +00:00
}
func (entity *UpdateSecretChat) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateSecretChat
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*UpdateSecretChat) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2018-08-30 14:55:42 +00:00
}
func (*UpdateSecretChat) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateSecretChat
2018-08-30 14:55:42 +00:00
}
func (*UpdateSecretChat) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateSecretChat
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// Some data in userFullInfo has been changed
2018-08-30 14:55:42 +00:00
type UpdateUserFullInfo struct {
2022-03-13 04:04:12 +00:00
meta
// User identifier
UserId int64 `json:"user_id"`
// New full information about the user
UserFullInfo *UserFullInfo `json:"user_full_info"`
2018-08-30 14:55:42 +00:00
}
func (entity *UpdateUserFullInfo) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateUserFullInfo
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*UpdateUserFullInfo) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2018-08-30 14:55:42 +00:00
}
func (*UpdateUserFullInfo) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateUserFullInfo
2018-08-30 14:55:42 +00:00
}
func (*UpdateUserFullInfo) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateUserFullInfo
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// Some data in basicGroupFullInfo has been changed
2018-08-30 14:55:42 +00:00
type UpdateBasicGroupFullInfo struct {
2022-03-13 04:04:12 +00:00
meta
// Identifier of a basic group
BasicGroupId int64 `json:"basic_group_id"`
// New full information about the group
BasicGroupFullInfo *BasicGroupFullInfo `json:"basic_group_full_info"`
2018-08-30 14:55:42 +00:00
}
func (entity *UpdateBasicGroupFullInfo) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateBasicGroupFullInfo
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*UpdateBasicGroupFullInfo) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2018-08-30 14:55:42 +00:00
}
func (*UpdateBasicGroupFullInfo) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateBasicGroupFullInfo
2018-08-30 14:55:42 +00:00
}
func (*UpdateBasicGroupFullInfo) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateBasicGroupFullInfo
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// Some data in supergroupFullInfo has been changed
2018-08-30 14:55:42 +00:00
type UpdateSupergroupFullInfo struct {
2022-03-13 04:04:12 +00:00
meta
// Identifier of the supergroup or channel
SupergroupId int64 `json:"supergroup_id"`
// New full information about the supergroup
SupergroupFullInfo *SupergroupFullInfo `json:"supergroup_full_info"`
2018-08-30 14:55:42 +00:00
}
func (entity *UpdateSupergroupFullInfo) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateSupergroupFullInfo
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*UpdateSupergroupFullInfo) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2018-08-30 14:55:42 +00:00
}
func (*UpdateSupergroupFullInfo) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateSupergroupFullInfo
2018-08-30 14:55:42 +00:00
}
func (*UpdateSupergroupFullInfo) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateSupergroupFullInfo
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// A service notification from the server was received. Upon receiving this the application must show a popup with the content of the notification
2018-08-30 14:55:42 +00:00
type UpdateServiceNotification struct {
2022-03-13 04:04:12 +00:00
meta
// Notification type. If type begins with "AUTH_KEY_DROP_", then two buttons "Cancel" and "Log out" must be shown under notification; if user presses the second, all local data must be destroyed using Destroy method
Type string `json:"type"`
// Notification content
Content MessageContent `json:"content"`
2018-08-30 14:55:42 +00:00
}
func (entity *UpdateServiceNotification) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateServiceNotification
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*UpdateServiceNotification) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2018-08-30 14:55:42 +00:00
}
func (*UpdateServiceNotification) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateServiceNotification
2018-08-30 14:55:42 +00:00
}
func (*UpdateServiceNotification) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateServiceNotification
2018-08-30 14:55:42 +00:00
}
func (updateServiceNotification *UpdateServiceNotification) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Type string `json:"type"`
Content json.RawMessage `json:"content"`
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
updateServiceNotification.Type = tmp.Type
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
fieldContent, _ := UnmarshalMessageContent(tmp.Content)
updateServiceNotification.Content = fieldContent
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return nil
2018-08-30 14:55:42 +00:00
}
// Information about a file was updated
type UpdateFile struct {
2022-03-13 04:04:12 +00:00
meta
// New data about the file
File *File `json:"file"`
2018-08-30 14:55:42 +00:00
}
func (entity *UpdateFile) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateFile
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*UpdateFile) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2018-08-30 14:55:42 +00:00
}
func (*UpdateFile) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateFile
2018-08-30 14:55:42 +00:00
}
func (*UpdateFile) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateFile
2018-08-30 14:55:42 +00:00
}
2020-11-30 09:33:47 +00:00
// The file generation process needs to be started by the application
2018-08-30 14:55:42 +00:00
type UpdateFileGenerationStart struct {
2022-03-13 04:04:12 +00:00
meta
// Unique identifier for the generation process
GenerationId JsonInt64 `json:"generation_id"`
// The path to a file from which a new file is generated; may be empty
OriginalPath string `json:"original_path"`
// The path to a file that must be created and where the new file is generated
DestinationPath string `json:"destination_path"`
// String specifying the conversion applied to the original file. If conversion is "#url#" than original_path contains an HTTP/HTTPS URL of a file, which must be downloaded by the application
Conversion string `json:"conversion"`
2018-08-30 14:55:42 +00:00
}
func (entity *UpdateFileGenerationStart) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateFileGenerationStart
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*UpdateFileGenerationStart) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2018-08-30 14:55:42 +00:00
}
func (*UpdateFileGenerationStart) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateFileGenerationStart
2018-08-30 14:55:42 +00:00
}
func (*UpdateFileGenerationStart) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateFileGenerationStart
2018-08-30 14:55:42 +00:00
}
// File generation is no longer needed
type UpdateFileGenerationStop struct {
2022-03-13 04:04:12 +00:00
meta
// Unique identifier for the generation process
GenerationId JsonInt64 `json:"generation_id"`
2018-08-30 14:55:42 +00:00
}
func (entity *UpdateFileGenerationStop) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateFileGenerationStop
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*UpdateFileGenerationStop) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2018-08-30 14:55:42 +00:00
}
func (*UpdateFileGenerationStop) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateFileGenerationStop
2018-08-30 14:55:42 +00:00
}
func (*UpdateFileGenerationStop) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateFileGenerationStop
}
// The state of the file download list has changed
type UpdateFileDownloads struct {
meta
// Total size of files in the file download list, in bytes
TotalSize int64 `json:"total_size"`
// Total number of files in the file download list
TotalCount int32 `json:"total_count"`
// Total downloaded size of files in the file download list, in bytes
DownloadedSize int64 `json:"downloaded_size"`
}
func (entity *UpdateFileDownloads) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateFileDownloads
return json.Marshal((*stub)(entity))
}
func (*UpdateFileDownloads) GetClass() string {
return ClassUpdate
}
func (*UpdateFileDownloads) GetType() string {
return TypeUpdateFileDownloads
}
func (*UpdateFileDownloads) UpdateType() string {
return TypeUpdateFileDownloads
}
// A file was added to the file download list. This update is sent only after file download list is loaded for the first time
type UpdateFileAddedToDownloads struct {
meta
// The added file download
FileDownload *FileDownload `json:"file_download"`
// New number of being downloaded and recently downloaded files found
Counts *DownloadedFileCounts `json:"counts"`
}
func (entity *UpdateFileAddedToDownloads) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateFileAddedToDownloads
return json.Marshal((*stub)(entity))
}
func (*UpdateFileAddedToDownloads) GetClass() string {
return ClassUpdate
}
func (*UpdateFileAddedToDownloads) GetType() string {
return TypeUpdateFileAddedToDownloads
}
func (*UpdateFileAddedToDownloads) UpdateType() string {
return TypeUpdateFileAddedToDownloads
}
// A file download was changed. This update is sent only after file download list is loaded for the first time
type UpdateFileDownload struct {
meta
// File identifier
FileId int32 `json:"file_id"`
// Point in time (Unix timestamp) when the file downloading was completed; 0 if the file downloading isn't completed
CompleteDate int32 `json:"complete_date"`
// True, if downloading of the file is paused
IsPaused bool `json:"is_paused"`
// New number of being downloaded and recently downloaded files found
Counts *DownloadedFileCounts `json:"counts"`
}
func (entity *UpdateFileDownload) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateFileDownload
return json.Marshal((*stub)(entity))
}
func (*UpdateFileDownload) GetClass() string {
return ClassUpdate
}
func (*UpdateFileDownload) GetType() string {
return TypeUpdateFileDownload
}
func (*UpdateFileDownload) UpdateType() string {
return TypeUpdateFileDownload
}
// A file was removed from the file download list. This update is sent only after file download list is loaded for the first time
type UpdateFileRemovedFromDownloads struct {
meta
// File identifier
FileId int32 `json:"file_id"`
// New number of being downloaded and recently downloaded files found
Counts *DownloadedFileCounts `json:"counts"`
}
func (entity *UpdateFileRemovedFromDownloads) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateFileRemovedFromDownloads
return json.Marshal((*stub)(entity))
}
func (*UpdateFileRemovedFromDownloads) GetClass() string {
return ClassUpdate
}
func (*UpdateFileRemovedFromDownloads) GetType() string {
return TypeUpdateFileRemovedFromDownloads
}
func (*UpdateFileRemovedFromDownloads) UpdateType() string {
return TypeUpdateFileRemovedFromDownloads
2018-08-30 14:55:42 +00:00
}
// New call was created or information about a call was updated
type UpdateCall struct {
2022-03-13 04:04:12 +00:00
meta
// New data about a call
Call *Call `json:"call"`
2018-08-30 14:55:42 +00:00
}
func (entity *UpdateCall) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateCall
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*UpdateCall) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2018-08-30 14:55:42 +00:00
}
func (*UpdateCall) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateCall
2018-08-30 14:55:42 +00:00
}
func (*UpdateCall) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateCall
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// Information about a group call was updated
type UpdateGroupCall struct {
2022-03-13 04:04:12 +00:00
meta
// New data about a group call
GroupCall *GroupCall `json:"group_call"`
2021-12-30 05:55:02 +00:00
}
func (entity *UpdateGroupCall) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateGroupCall
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*UpdateGroupCall) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2021-12-30 05:55:02 +00:00
}
func (*UpdateGroupCall) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateGroupCall
2021-12-30 05:55:02 +00:00
}
func (*UpdateGroupCall) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateGroupCall
2021-12-30 05:55:02 +00:00
}
// Information about a group call participant was changed. The updates are sent only after the group call is received through getGroupCall and only if the call is joined or being joined
type UpdateGroupCallParticipant struct {
2022-03-13 04:04:12 +00:00
meta
// Identifier of group call
GroupCallId int32 `json:"group_call_id"`
// New data about a participant
Participant *GroupCallParticipant `json:"participant"`
2021-12-30 05:55:02 +00:00
}
func (entity *UpdateGroupCallParticipant) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateGroupCallParticipant
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*UpdateGroupCallParticipant) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2021-12-30 05:55:02 +00:00
}
func (*UpdateGroupCallParticipant) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateGroupCallParticipant
2021-12-30 05:55:02 +00:00
}
func (*UpdateGroupCallParticipant) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateGroupCallParticipant
2021-12-30 05:55:02 +00:00
}
2020-11-30 09:33:47 +00:00
// New call signaling data arrived
type UpdateNewCallSignalingData struct {
2022-03-13 04:04:12 +00:00
meta
// The call identifier
CallId int32 `json:"call_id"`
// The data
Data []byte `json:"data"`
2020-11-30 09:33:47 +00:00
}
func (entity *UpdateNewCallSignalingData) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateNewCallSignalingData
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-11-30 09:33:47 +00:00
}
func (*UpdateNewCallSignalingData) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2020-11-30 09:33:47 +00:00
}
func (*UpdateNewCallSignalingData) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateNewCallSignalingData
2020-11-30 09:33:47 +00:00
}
func (*UpdateNewCallSignalingData) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateNewCallSignalingData
2020-11-30 09:33:47 +00:00
}
2018-08-30 14:55:42 +00:00
// Some privacy setting rules have been changed
type UpdateUserPrivacySettingRules struct {
2022-03-13 04:04:12 +00:00
meta
// The privacy setting
Setting UserPrivacySetting `json:"setting"`
// New privacy rules
Rules *UserPrivacySettingRules `json:"rules"`
2018-08-30 14:55:42 +00:00
}
func (entity *UpdateUserPrivacySettingRules) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateUserPrivacySettingRules
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*UpdateUserPrivacySettingRules) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2018-08-30 14:55:42 +00:00
}
func (*UpdateUserPrivacySettingRules) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateUserPrivacySettingRules
2018-08-30 14:55:42 +00:00
}
func (*UpdateUserPrivacySettingRules) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateUserPrivacySettingRules
2018-08-30 14:55:42 +00:00
}
func (updateUserPrivacySettingRules *UpdateUserPrivacySettingRules) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Setting json.RawMessage `json:"setting"`
Rules *UserPrivacySettingRules `json:"rules"`
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
updateUserPrivacySettingRules.Rules = tmp.Rules
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
fieldSetting, _ := UnmarshalUserPrivacySetting(tmp.Setting)
updateUserPrivacySettingRules.Setting = fieldSetting
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return nil
2018-08-30 14:55:42 +00:00
}
2020-02-03 12:56:20 +00:00
// Number of unread messages in a chat list has changed. This update is sent only if the message database is used
2018-08-30 14:55:42 +00:00
type UpdateUnreadMessageCount struct {
2022-03-13 04:04:12 +00:00
meta
// The chat list with changed number of unread messages
ChatList ChatList `json:"chat_list"`
// Total number of unread messages
UnreadCount int32 `json:"unread_count"`
// Total number of unread messages in unmuted chats
UnreadUnmutedCount int32 `json:"unread_unmuted_count"`
2018-08-30 14:55:42 +00:00
}
func (entity *UpdateUnreadMessageCount) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateUnreadMessageCount
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*UpdateUnreadMessageCount) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2018-08-30 14:55:42 +00:00
}
func (*UpdateUnreadMessageCount) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateUnreadMessageCount
2018-08-30 14:55:42 +00:00
}
func (*UpdateUnreadMessageCount) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateUnreadMessageCount
2018-08-30 14:55:42 +00:00
}
2020-02-03 12:56:20 +00:00
func (updateUnreadMessageCount *UpdateUnreadMessageCount) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
ChatList json.RawMessage `json:"chat_list"`
UnreadCount int32 `json:"unread_count"`
UnreadUnmutedCount int32 `json:"unread_unmuted_count"`
}
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
updateUnreadMessageCount.UnreadCount = tmp.UnreadCount
updateUnreadMessageCount.UnreadUnmutedCount = tmp.UnreadUnmutedCount
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
fieldChatList, _ := UnmarshalChatList(tmp.ChatList)
updateUnreadMessageCount.ChatList = fieldChatList
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
return nil
2020-02-03 12:56:20 +00:00
}
// Number of unread chats, i.e. with unread messages or marked as unread, has changed. This update is sent only if the message database is used
2018-09-05 21:45:29 +00:00
type UpdateUnreadChatCount struct {
2022-03-13 04:04:12 +00:00
meta
// The chat list with changed number of unread messages
ChatList ChatList `json:"chat_list"`
// Approximate total number of chats in the chat list
TotalCount int32 `json:"total_count"`
// Total number of unread chats
UnreadCount int32 `json:"unread_count"`
// Total number of unread unmuted chats
UnreadUnmutedCount int32 `json:"unread_unmuted_count"`
// Total number of chats marked as unread
MarkedAsUnreadCount int32 `json:"marked_as_unread_count"`
// Total number of unmuted chats marked as unread
MarkedAsUnreadUnmutedCount int32 `json:"marked_as_unread_unmuted_count"`
2018-09-05 21:45:29 +00:00
}
func (entity *UpdateUnreadChatCount) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateUnreadChatCount
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
func (*UpdateUnreadChatCount) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2018-09-05 21:45:29 +00:00
}
func (*UpdateUnreadChatCount) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateUnreadChatCount
2018-09-05 21:45:29 +00:00
}
func (*UpdateUnreadChatCount) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateUnreadChatCount
2018-09-05 21:45:29 +00:00
}
2020-02-03 12:56:20 +00:00
func (updateUnreadChatCount *UpdateUnreadChatCount) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
ChatList json.RawMessage `json:"chat_list"`
TotalCount int32 `json:"total_count"`
UnreadCount int32 `json:"unread_count"`
UnreadUnmutedCount int32 `json:"unread_unmuted_count"`
MarkedAsUnreadCount int32 `json:"marked_as_unread_count"`
MarkedAsUnreadUnmutedCount int32 `json:"marked_as_unread_unmuted_count"`
}
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
updateUnreadChatCount.TotalCount = tmp.TotalCount
updateUnreadChatCount.UnreadCount = tmp.UnreadCount
updateUnreadChatCount.UnreadUnmutedCount = tmp.UnreadUnmutedCount
updateUnreadChatCount.MarkedAsUnreadCount = tmp.MarkedAsUnreadCount
updateUnreadChatCount.MarkedAsUnreadUnmutedCount = tmp.MarkedAsUnreadUnmutedCount
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
fieldChatList, _ := UnmarshalChatList(tmp.ChatList)
updateUnreadChatCount.ChatList = fieldChatList
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
return nil
2020-02-03 12:56:20 +00:00
}
2018-08-30 14:55:42 +00:00
// An option changed its value
type UpdateOption struct {
2022-03-13 04:04:12 +00:00
meta
// The option name
Name string `json:"name"`
// The new option value
Value OptionValue `json:"value"`
2018-08-30 14:55:42 +00:00
}
func (entity *UpdateOption) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateOption
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*UpdateOption) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2018-08-30 14:55:42 +00:00
}
func (*UpdateOption) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateOption
2018-08-30 14:55:42 +00:00
}
func (*UpdateOption) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateOption
2018-08-30 14:55:42 +00:00
}
func (updateOption *UpdateOption) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Name string `json:"name"`
Value json.RawMessage `json:"value"`
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
updateOption.Name = tmp.Name
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
fieldValue, _ := UnmarshalOptionValue(tmp.Value)
updateOption.Value = fieldValue
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return nil
2018-08-30 14:55:42 +00:00
}
2020-11-30 09:33:47 +00:00
// A sticker set has changed
type UpdateStickerSet struct {
2022-03-13 04:04:12 +00:00
meta
// The sticker set
StickerSet *StickerSet `json:"sticker_set"`
2020-11-30 09:33:47 +00:00
}
func (entity *UpdateStickerSet) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateStickerSet
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-11-30 09:33:47 +00:00
}
func (*UpdateStickerSet) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2020-11-30 09:33:47 +00:00
}
func (*UpdateStickerSet) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateStickerSet
2020-11-30 09:33:47 +00:00
}
func (*UpdateStickerSet) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateStickerSet
2020-11-30 09:33:47 +00:00
}
2018-08-30 14:55:42 +00:00
// The list of installed sticker sets was updated
type UpdateInstalledStickerSets struct {
2022-03-13 04:04:12 +00:00
meta
// True, if the list of installed mask sticker sets was updated
IsMasks bool `json:"is_masks"`
// The new list of installed ordinary sticker sets
StickerSetIds []JsonInt64 `json:"sticker_set_ids"`
2018-08-30 14:55:42 +00:00
}
func (entity *UpdateInstalledStickerSets) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateInstalledStickerSets
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*UpdateInstalledStickerSets) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2018-08-30 14:55:42 +00:00
}
func (*UpdateInstalledStickerSets) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateInstalledStickerSets
2018-08-30 14:55:42 +00:00
}
func (*UpdateInstalledStickerSets) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateInstalledStickerSets
2018-08-30 14:55:42 +00:00
}
// The list of trending sticker sets was updated or some of them were viewed
type UpdateTrendingStickerSets struct {
2022-03-13 04:04:12 +00:00
meta
// The prefix of the list of trending sticker sets with the newest trending sticker sets
StickerSets *StickerSets `json:"sticker_sets"`
2018-08-30 14:55:42 +00:00
}
func (entity *UpdateTrendingStickerSets) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateTrendingStickerSets
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*UpdateTrendingStickerSets) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2018-08-30 14:55:42 +00:00
}
func (*UpdateTrendingStickerSets) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateTrendingStickerSets
2018-08-30 14:55:42 +00:00
}
func (*UpdateTrendingStickerSets) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateTrendingStickerSets
2018-08-30 14:55:42 +00:00
}
// The list of recently used stickers was updated
type UpdateRecentStickers struct {
2022-03-13 04:04:12 +00:00
meta
// True, if the list of stickers attached to photo or video files was updated, otherwise the list of sent stickers is updated
IsAttached bool `json:"is_attached"`
// The new list of file identifiers of recently used stickers
StickerIds []int32 `json:"sticker_ids"`
2018-08-30 14:55:42 +00:00
}
func (entity *UpdateRecentStickers) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateRecentStickers
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*UpdateRecentStickers) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2018-08-30 14:55:42 +00:00
}
func (*UpdateRecentStickers) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateRecentStickers
2018-08-30 14:55:42 +00:00
}
func (*UpdateRecentStickers) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateRecentStickers
2018-08-30 14:55:42 +00:00
}
// The list of favorite stickers was updated
type UpdateFavoriteStickers struct {
2022-03-13 04:04:12 +00:00
meta
// The new list of file identifiers of favorite stickers
StickerIds []int32 `json:"sticker_ids"`
2018-08-30 14:55:42 +00:00
}
func (entity *UpdateFavoriteStickers) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateFavoriteStickers
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*UpdateFavoriteStickers) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2018-08-30 14:55:42 +00:00
}
func (*UpdateFavoriteStickers) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateFavoriteStickers
2018-08-30 14:55:42 +00:00
}
func (*UpdateFavoriteStickers) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateFavoriteStickers
2018-08-30 14:55:42 +00:00
}
// The list of saved animations was updated
type UpdateSavedAnimations struct {
2022-03-13 04:04:12 +00:00
meta
// The new list of file identifiers of saved animations
AnimationIds []int32 `json:"animation_ids"`
2018-08-30 14:55:42 +00:00
}
func (entity *UpdateSavedAnimations) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateSavedAnimations
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*UpdateSavedAnimations) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2018-08-30 14:55:42 +00:00
}
func (*UpdateSavedAnimations) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateSavedAnimations
2018-08-30 14:55:42 +00:00
}
func (*UpdateSavedAnimations) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateSavedAnimations
2018-08-30 14:55:42 +00:00
}
2019-09-10 12:36:54 +00:00
// The selected background has changed
type UpdateSelectedBackground struct {
2022-03-13 04:04:12 +00:00
meta
// True, if background for dark theme has changed
ForDarkTheme bool `json:"for_dark_theme"`
// The new selected background; may be null
Background *Background `json:"background"`
2019-09-10 12:36:54 +00:00
}
func (entity *UpdateSelectedBackground) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-09-10 12:36:54 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateSelectedBackground
2019-09-10 12:36:54 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-09-10 12:36:54 +00:00
}
func (*UpdateSelectedBackground) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2019-09-10 12:36:54 +00:00
}
func (*UpdateSelectedBackground) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateSelectedBackground
2019-09-10 12:36:54 +00:00
}
func (*UpdateSelectedBackground) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateSelectedBackground
2019-09-10 12:36:54 +00:00
}
2021-12-30 05:55:02 +00:00
// The list of available chat themes has changed
type UpdateChatThemes struct {
2022-03-13 04:04:12 +00:00
meta
// The new list of chat themes
ChatThemes []*ChatTheme `json:"chat_themes"`
2021-12-30 05:55:02 +00:00
}
func (entity *UpdateChatThemes) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateChatThemes
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*UpdateChatThemes) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2021-12-30 05:55:02 +00:00
}
func (*UpdateChatThemes) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateChatThemes
2021-12-30 05:55:02 +00:00
}
func (*UpdateChatThemes) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateChatThemes
2021-12-30 05:55:02 +00:00
}
2018-09-05 21:45:29 +00:00
// Some language pack strings have been updated
type UpdateLanguagePackStrings struct {
2022-03-13 04:04:12 +00:00
meta
// Localization target to which the language pack belongs
LocalizationTarget string `json:"localization_target"`
// Identifier of the updated language pack
LanguagePackId string `json:"language_pack_id"`
// List of changed language pack strings
Strings []*LanguagePackString `json:"strings"`
2018-09-05 21:45:29 +00:00
}
func (entity *UpdateLanguagePackStrings) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateLanguagePackStrings
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
func (*UpdateLanguagePackStrings) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2018-09-05 21:45:29 +00:00
}
func (*UpdateLanguagePackStrings) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateLanguagePackStrings
2018-09-05 21:45:29 +00:00
}
func (*UpdateLanguagePackStrings) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateLanguagePackStrings
2018-09-05 21:45:29 +00:00
}
2020-11-30 09:33:47 +00:00
// The connection state has changed. This update must be used only to show a human-readable description of the connection state
2018-08-30 14:55:42 +00:00
type UpdateConnectionState struct {
2022-03-13 04:04:12 +00:00
meta
// The new connection state
State ConnectionState `json:"state"`
2018-08-30 14:55:42 +00:00
}
func (entity *UpdateConnectionState) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateConnectionState
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*UpdateConnectionState) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2018-08-30 14:55:42 +00:00
}
func (*UpdateConnectionState) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateConnectionState
2018-08-30 14:55:42 +00:00
}
func (*UpdateConnectionState) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateConnectionState
2018-08-30 14:55:42 +00:00
}
func (updateConnectionState *UpdateConnectionState) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
State json.RawMessage `json:"state"`
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
fieldState, _ := UnmarshalConnectionState(tmp.State)
updateConnectionState.State = fieldState
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return nil
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
// New terms of service must be accepted by the user. If the terms of service are declined, then the deleteAccount method must be called with the reason "Decline ToS update"
2018-09-05 21:45:29 +00:00
type UpdateTermsOfService struct {
2022-03-13 04:04:12 +00:00
meta
// Identifier of the terms of service
TermsOfServiceId string `json:"terms_of_service_id"`
// The new terms of service
TermsOfService *TermsOfService `json:"terms_of_service"`
2018-09-05 21:45:29 +00:00
}
func (entity *UpdateTermsOfService) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateTermsOfService
2018-09-05 21:45:29 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-09-05 21:45:29 +00:00
}
func (*UpdateTermsOfService) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2018-09-05 21:45:29 +00:00
}
func (*UpdateTermsOfService) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateTermsOfService
2018-09-05 21:45:29 +00:00
}
func (*UpdateTermsOfService) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateTermsOfService
2018-09-05 21:45:29 +00:00
}
2020-11-30 09:33:47 +00:00
// The list of users nearby has changed. The update is guaranteed to be sent only 60 seconds after a successful searchChatsNearby request
2020-02-03 12:56:20 +00:00
type UpdateUsersNearby struct {
2022-03-13 04:04:12 +00:00
meta
// The new list of users nearby
UsersNearby []*ChatNearby `json:"users_nearby"`
2020-02-03 12:56:20 +00:00
}
func (entity *UpdateUsersNearby) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateUsersNearby
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-02-03 12:56:20 +00:00
}
func (*UpdateUsersNearby) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2020-02-03 12:56:20 +00:00
}
func (*UpdateUsersNearby) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateUsersNearby
2020-02-03 12:56:20 +00:00
}
func (*UpdateUsersNearby) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateUsersNearby
2020-02-03 12:56:20 +00:00
}
2022-02-06 18:36:17 +00:00
// The list of supported reactions has changed
type UpdateReactions struct {
2022-03-13 04:04:12 +00:00
meta
// The new list of supported reactions
Reactions []*Reaction `json:"reactions"`
2022-02-06 18:36:17 +00:00
}
func (entity *UpdateReactions) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2022-02-06 18:36:17 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateReactions
2022-02-06 18:36:17 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2022-02-06 18:36:17 +00:00
}
func (*UpdateReactions) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2022-02-06 18:36:17 +00:00
}
func (*UpdateReactions) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateReactions
2022-02-06 18:36:17 +00:00
}
func (*UpdateReactions) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateReactions
2022-02-06 18:36:17 +00:00
}
2020-11-30 09:33:47 +00:00
// The list of supported dice emojis has changed
type UpdateDiceEmojis struct {
2022-03-13 04:04:12 +00:00
meta
// The new list of supported dice emojis
Emojis []string `json:"emojis"`
2020-11-30 09:33:47 +00:00
}
func (entity *UpdateDiceEmojis) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateDiceEmojis
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-11-30 09:33:47 +00:00
}
func (*UpdateDiceEmojis) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2020-11-30 09:33:47 +00:00
}
func (*UpdateDiceEmojis) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateDiceEmojis
2020-11-30 09:33:47 +00:00
}
func (*UpdateDiceEmojis) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateDiceEmojis
2020-11-30 09:33:47 +00:00
}
2021-12-30 05:55:02 +00:00
// Some animated emoji message was clicked and a big animated sticker must be played if the message is visible on the screen. chatActionWatchingAnimations with the text of the message needs to be sent if the sticker is played
type UpdateAnimatedEmojiMessageClicked struct {
2022-03-13 04:04:12 +00:00
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
// Message identifier
MessageId int64 `json:"message_id"`
// The animated sticker to be played
Sticker *Sticker `json:"sticker"`
2021-12-30 05:55:02 +00:00
}
func (entity *UpdateAnimatedEmojiMessageClicked) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateAnimatedEmojiMessageClicked
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*UpdateAnimatedEmojiMessageClicked) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2021-12-30 05:55:02 +00:00
}
func (*UpdateAnimatedEmojiMessageClicked) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateAnimatedEmojiMessageClicked
2021-12-30 05:55:02 +00:00
}
func (*UpdateAnimatedEmojiMessageClicked) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateAnimatedEmojiMessageClicked
2021-12-30 05:55:02 +00:00
}
2020-11-30 09:33:47 +00:00
// The parameters of animation search through GetOption("animation_search_bot_username") bot has changed
type UpdateAnimationSearchParameters struct {
2022-03-13 04:04:12 +00:00
meta
// Name of the animation search provider
Provider string `json:"provider"`
// The new list of emojis suggested for searching
Emojis []string `json:"emojis"`
2020-11-30 09:33:47 +00:00
}
func (entity *UpdateAnimationSearchParameters) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateAnimationSearchParameters
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-11-30 09:33:47 +00:00
}
func (*UpdateAnimationSearchParameters) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2020-11-30 09:33:47 +00:00
}
func (*UpdateAnimationSearchParameters) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateAnimationSearchParameters
2020-11-30 09:33:47 +00:00
}
func (*UpdateAnimationSearchParameters) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateAnimationSearchParameters
2020-11-30 09:33:47 +00:00
}
// The list of suggested to the user actions has changed
type UpdateSuggestedActions struct {
2022-03-13 04:04:12 +00:00
meta
// Added suggested actions
AddedActions []SuggestedAction `json:"added_actions"`
// Removed suggested actions
RemovedActions []SuggestedAction `json:"removed_actions"`
2020-11-30 09:33:47 +00:00
}
func (entity *UpdateSuggestedActions) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateSuggestedActions
2020-11-30 09:33:47 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-11-30 09:33:47 +00:00
}
func (*UpdateSuggestedActions) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2020-11-30 09:33:47 +00:00
}
func (*UpdateSuggestedActions) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateSuggestedActions
2020-11-30 09:33:47 +00:00
}
func (*UpdateSuggestedActions) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateSuggestedActions
2020-11-30 09:33:47 +00:00
}
2021-01-18 14:16:52 +00:00
func (updateSuggestedActions *UpdateSuggestedActions) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
AddedActions []json.RawMessage `json:"added_actions"`
RemovedActions []json.RawMessage `json:"removed_actions"`
}
2021-01-18 14:16:52 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-01-18 14:16:52 +00:00
2022-03-13 04:04:12 +00:00
fieldAddedActions, _ := UnmarshalListOfSuggestedAction(tmp.AddedActions)
updateSuggestedActions.AddedActions = fieldAddedActions
2021-01-18 14:16:52 +00:00
2022-03-13 04:04:12 +00:00
fieldRemovedActions, _ := UnmarshalListOfSuggestedAction(tmp.RemovedActions)
updateSuggestedActions.RemovedActions = fieldRemovedActions
2021-01-18 14:16:52 +00:00
2022-03-13 04:04:12 +00:00
return nil
2021-01-18 14:16:52 +00:00
}
2018-08-30 14:55:42 +00:00
// A new incoming inline query; for bots only
type UpdateNewInlineQuery struct {
2022-03-13 04:04:12 +00:00
meta
// Unique query identifier
Id JsonInt64 `json:"id"`
// Identifier of the user who sent the query
SenderUserId int64 `json:"sender_user_id"`
// User location; may be null
UserLocation *Location `json:"user_location"`
// The type of the chat, from which the query originated; may be null if unknown
ChatType ChatType `json:"chat_type"`
// Text of the query
Query string `json:"query"`
// Offset of the first entry to return
Offset string `json:"offset"`
2018-08-30 14:55:42 +00:00
}
func (entity *UpdateNewInlineQuery) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateNewInlineQuery
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*UpdateNewInlineQuery) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2018-08-30 14:55:42 +00:00
}
func (*UpdateNewInlineQuery) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateNewInlineQuery
2018-08-30 14:55:42 +00:00
}
func (*UpdateNewInlineQuery) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateNewInlineQuery
2018-08-30 14:55:42 +00:00
}
2021-12-30 05:55:02 +00:00
func (updateNewInlineQuery *UpdateNewInlineQuery) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Id JsonInt64 `json:"id"`
SenderUserId int64 `json:"sender_user_id"`
UserLocation *Location `json:"user_location"`
ChatType json.RawMessage `json:"chat_type"`
Query string `json:"query"`
Offset string `json:"offset"`
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
updateNewInlineQuery.Id = tmp.Id
updateNewInlineQuery.SenderUserId = tmp.SenderUserId
updateNewInlineQuery.UserLocation = tmp.UserLocation
updateNewInlineQuery.Query = tmp.Query
updateNewInlineQuery.Offset = tmp.Offset
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
fieldChatType, _ := UnmarshalChatType(tmp.ChatType)
updateNewInlineQuery.ChatType = fieldChatType
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return nil
2021-12-30 05:55:02 +00:00
}
2018-08-30 14:55:42 +00:00
// The user has chosen a result of an inline query; for bots only
type UpdateNewChosenInlineResult struct {
2022-03-13 04:04:12 +00:00
meta
// Identifier of the user who sent the query
SenderUserId int64 `json:"sender_user_id"`
// User location; may be null
UserLocation *Location `json:"user_location"`
// Text of the query
Query string `json:"query"`
// Identifier of the chosen result
ResultId string `json:"result_id"`
// Identifier of the sent inline message, if known
InlineMessageId string `json:"inline_message_id"`
2018-08-30 14:55:42 +00:00
}
func (entity *UpdateNewChosenInlineResult) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateNewChosenInlineResult
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*UpdateNewChosenInlineResult) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2018-08-30 14:55:42 +00:00
}
func (*UpdateNewChosenInlineResult) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateNewChosenInlineResult
2018-08-30 14:55:42 +00:00
}
func (*UpdateNewChosenInlineResult) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateNewChosenInlineResult
2018-08-30 14:55:42 +00:00
}
// A new incoming callback query; for bots only
type UpdateNewCallbackQuery struct {
2022-03-13 04:04:12 +00:00
meta
// Unique query identifier
Id JsonInt64 `json:"id"`
// Identifier of the user who sent the query
SenderUserId int64 `json:"sender_user_id"`
// Identifier of the chat where the query was sent
ChatId int64 `json:"chat_id"`
// Identifier of the message, from which the query originated
MessageId int64 `json:"message_id"`
// Identifier that uniquely corresponds to the chat to which the message was sent
ChatInstance JsonInt64 `json:"chat_instance"`
// Query payload
Payload CallbackQueryPayload `json:"payload"`
2018-08-30 14:55:42 +00:00
}
func (entity *UpdateNewCallbackQuery) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateNewCallbackQuery
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*UpdateNewCallbackQuery) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2018-08-30 14:55:42 +00:00
}
func (*UpdateNewCallbackQuery) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateNewCallbackQuery
2018-08-30 14:55:42 +00:00
}
func (*UpdateNewCallbackQuery) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateNewCallbackQuery
2018-08-30 14:55:42 +00:00
}
func (updateNewCallbackQuery *UpdateNewCallbackQuery) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Id JsonInt64 `json:"id"`
SenderUserId int64 `json:"sender_user_id"`
ChatId int64 `json:"chat_id"`
MessageId int64 `json:"message_id"`
ChatInstance JsonInt64 `json:"chat_instance"`
Payload json.RawMessage `json:"payload"`
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
updateNewCallbackQuery.Id = tmp.Id
updateNewCallbackQuery.SenderUserId = tmp.SenderUserId
updateNewCallbackQuery.ChatId = tmp.ChatId
updateNewCallbackQuery.MessageId = tmp.MessageId
updateNewCallbackQuery.ChatInstance = tmp.ChatInstance
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
fieldPayload, _ := UnmarshalCallbackQueryPayload(tmp.Payload)
updateNewCallbackQuery.Payload = fieldPayload
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return nil
2018-08-30 14:55:42 +00:00
}
// A new incoming callback query from a message sent via a bot; for bots only
type UpdateNewInlineCallbackQuery struct {
2022-03-13 04:04:12 +00:00
meta
// Unique query identifier
Id JsonInt64 `json:"id"`
// Identifier of the user who sent the query
SenderUserId int64 `json:"sender_user_id"`
// Identifier of the inline message, from which the query originated
InlineMessageId string `json:"inline_message_id"`
// An identifier uniquely corresponding to the chat a message was sent to
ChatInstance JsonInt64 `json:"chat_instance"`
// Query payload
Payload CallbackQueryPayload `json:"payload"`
2018-08-30 14:55:42 +00:00
}
func (entity *UpdateNewInlineCallbackQuery) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateNewInlineCallbackQuery
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*UpdateNewInlineCallbackQuery) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2018-08-30 14:55:42 +00:00
}
func (*UpdateNewInlineCallbackQuery) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateNewInlineCallbackQuery
2018-08-30 14:55:42 +00:00
}
func (*UpdateNewInlineCallbackQuery) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateNewInlineCallbackQuery
2018-08-30 14:55:42 +00:00
}
func (updateNewInlineCallbackQuery *UpdateNewInlineCallbackQuery) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Id JsonInt64 `json:"id"`
SenderUserId int64 `json:"sender_user_id"`
InlineMessageId string `json:"inline_message_id"`
ChatInstance JsonInt64 `json:"chat_instance"`
Payload json.RawMessage `json:"payload"`
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
updateNewInlineCallbackQuery.Id = tmp.Id
updateNewInlineCallbackQuery.SenderUserId = tmp.SenderUserId
updateNewInlineCallbackQuery.InlineMessageId = tmp.InlineMessageId
updateNewInlineCallbackQuery.ChatInstance = tmp.ChatInstance
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
fieldPayload, _ := UnmarshalCallbackQueryPayload(tmp.Payload)
updateNewInlineCallbackQuery.Payload = fieldPayload
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return nil
2018-08-30 14:55:42 +00:00
}
// A new incoming shipping query; for bots only. Only for invoices with flexible price
type UpdateNewShippingQuery struct {
2022-03-13 04:04:12 +00:00
meta
// Unique query identifier
Id JsonInt64 `json:"id"`
// Identifier of the user who sent the query
SenderUserId int64 `json:"sender_user_id"`
// Invoice payload
InvoicePayload string `json:"invoice_payload"`
// User shipping address
ShippingAddress *Address `json:"shipping_address"`
2018-08-30 14:55:42 +00:00
}
func (entity *UpdateNewShippingQuery) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateNewShippingQuery
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*UpdateNewShippingQuery) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2018-08-30 14:55:42 +00:00
}
func (*UpdateNewShippingQuery) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateNewShippingQuery
2018-08-30 14:55:42 +00:00
}
func (*UpdateNewShippingQuery) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateNewShippingQuery
2018-08-30 14:55:42 +00:00
}
// A new incoming pre-checkout query; for bots only. Contains full information about a checkout
type UpdateNewPreCheckoutQuery struct {
2022-03-13 04:04:12 +00:00
meta
// Unique query identifier
Id JsonInt64 `json:"id"`
// Identifier of the user who sent the query
SenderUserId int64 `json:"sender_user_id"`
// Currency for the product price
Currency string `json:"currency"`
// Total price for the product, in the smallest units of the currency
TotalAmount int64 `json:"total_amount"`
// Invoice payload
InvoicePayload []byte `json:"invoice_payload"`
// Identifier of a shipping option chosen by the user; may be empty if not applicable
ShippingOptionId string `json:"shipping_option_id"`
// Information about the order; may be null
OrderInfo *OrderInfo `json:"order_info"`
2018-08-30 14:55:42 +00:00
}
func (entity *UpdateNewPreCheckoutQuery) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateNewPreCheckoutQuery
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*UpdateNewPreCheckoutQuery) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2018-08-30 14:55:42 +00:00
}
func (*UpdateNewPreCheckoutQuery) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateNewPreCheckoutQuery
2018-08-30 14:55:42 +00:00
}
func (*UpdateNewPreCheckoutQuery) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateNewPreCheckoutQuery
2018-08-30 14:55:42 +00:00
}
// A new incoming event; for bots only
type UpdateNewCustomEvent struct {
2022-03-13 04:04:12 +00:00
meta
// A JSON-serialized event
Event string `json:"event"`
2018-08-30 14:55:42 +00:00
}
func (entity *UpdateNewCustomEvent) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateNewCustomEvent
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*UpdateNewCustomEvent) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2018-08-30 14:55:42 +00:00
}
func (*UpdateNewCustomEvent) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateNewCustomEvent
2018-08-30 14:55:42 +00:00
}
func (*UpdateNewCustomEvent) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateNewCustomEvent
2018-08-30 14:55:42 +00:00
}
// A new incoming query; for bots only
type UpdateNewCustomQuery struct {
2022-03-13 04:04:12 +00:00
meta
// The query identifier
Id JsonInt64 `json:"id"`
// JSON-serialized query data
Data string `json:"data"`
// Query timeout
Timeout int32 `json:"timeout"`
2018-08-30 14:55:42 +00:00
}
func (entity *UpdateNewCustomQuery) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateNewCustomQuery
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*UpdateNewCustomQuery) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2018-08-30 14:55:42 +00:00
}
func (*UpdateNewCustomQuery) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateNewCustomQuery
2018-08-30 14:55:42 +00:00
}
func (*UpdateNewCustomQuery) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateNewCustomQuery
2018-08-30 14:55:42 +00:00
}
2020-02-03 12:56:20 +00:00
// A poll was updated; for bots only
2019-06-07 10:56:06 +00:00
type UpdatePoll struct {
2022-03-13 04:04:12 +00:00
meta
// New data about the poll
Poll *Poll `json:"poll"`
2019-06-07 10:56:06 +00:00
}
func (entity *UpdatePoll) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdatePoll
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
func (*UpdatePoll) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2019-06-07 10:56:06 +00:00
}
func (*UpdatePoll) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdatePoll
2019-06-07 10:56:06 +00:00
}
func (*UpdatePoll) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdatePoll
2019-06-07 10:56:06 +00:00
}
2020-02-03 12:56:20 +00:00
// A user changed the answer to a poll; for bots only
type UpdatePollAnswer struct {
2022-03-13 04:04:12 +00:00
meta
// Unique poll identifier
PollId JsonInt64 `json:"poll_id"`
// The user, who changed the answer to the poll
UserId int64 `json:"user_id"`
// 0-based identifiers of answer options, chosen by the user
OptionIds []int32 `json:"option_ids"`
2020-02-03 12:56:20 +00:00
}
func (entity *UpdatePollAnswer) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdatePollAnswer
2020-02-03 12:56:20 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2020-02-03 12:56:20 +00:00
}
func (*UpdatePollAnswer) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2020-02-03 12:56:20 +00:00
}
func (*UpdatePollAnswer) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdatePollAnswer
2020-02-03 12:56:20 +00:00
}
func (*UpdatePollAnswer) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdatePollAnswer
2020-02-03 12:56:20 +00:00
}
2021-12-30 05:55:02 +00:00
// User rights changed in a chat; for bots only
type UpdateChatMember struct {
2022-03-13 04:04:12 +00:00
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
// Identifier of the user, changing the rights
ActorUserId int64 `json:"actor_user_id"`
// Point in time (Unix timestamp) when the user rights was changed
Date int32 `json:"date"`
// If user has joined the chat using an invite link, the invite link; may be null
InviteLink *ChatInviteLink `json:"invite_link"`
// Previous chat member
OldChatMember *ChatMember `json:"old_chat_member"`
// New chat member
NewChatMember *ChatMember `json:"new_chat_member"`
2021-12-30 05:55:02 +00:00
}
func (entity *UpdateChatMember) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateChatMember
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*UpdateChatMember) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2021-12-30 05:55:02 +00:00
}
func (*UpdateChatMember) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateChatMember
2021-12-30 05:55:02 +00:00
}
func (*UpdateChatMember) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateChatMember
2021-12-30 05:55:02 +00:00
}
// A user sent a join request to a chat; for bots only
type UpdateNewChatJoinRequest struct {
2022-03-13 04:04:12 +00:00
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
// Join request
Request *ChatJoinRequest `json:"request"`
// The invite link, which was used to send join request; may be null
InviteLink *ChatInviteLink `json:"invite_link"`
2021-12-30 05:55:02 +00:00
}
func (entity *UpdateNewChatJoinRequest) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
type stub UpdateNewChatJoinRequest
2021-12-30 05:55:02 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2021-12-30 05:55:02 +00:00
}
func (*UpdateNewChatJoinRequest) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdate
2021-12-30 05:55:02 +00:00
}
func (*UpdateNewChatJoinRequest) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateNewChatJoinRequest
2021-12-30 05:55:02 +00:00
}
func (*UpdateNewChatJoinRequest) UpdateType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdateNewChatJoinRequest
2021-12-30 05:55:02 +00:00
}
2019-06-07 10:56:06 +00:00
// Contains a list of updates
type Updates struct {
2022-03-13 04:04:12 +00:00
meta
// List of updates
Updates []Update `json:"updates"`
2019-06-07 10:56:06 +00:00
}
func (entity *Updates) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub Updates
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
func (*Updates) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassUpdates
2019-06-07 10:56:06 +00:00
}
func (*Updates) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeUpdates
2019-06-07 10:56:06 +00:00
}
2021-01-18 14:16:52 +00:00
func (updates *Updates) UnmarshalJSON(data []byte) error {
2022-03-13 04:04:12 +00:00
var tmp struct {
Updates []json.RawMessage `json:"updates"`
}
2021-01-18 14:16:52 +00:00
2022-03-13 04:04:12 +00:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-01-18 14:16:52 +00:00
2022-03-13 04:04:12 +00:00
fieldUpdates, _ := UnmarshalListOfUpdate(tmp.Updates)
updates.Updates = fieldUpdates
2021-01-18 14:16:52 +00:00
2022-03-13 04:04:12 +00:00
return nil
2021-01-18 14:16:52 +00:00
}
2019-06-07 10:56:06 +00:00
// The log is written to stderr or an OS specific log
2022-03-13 04:04:12 +00:00
type LogStreamDefault struct{
meta
2019-06-07 10:56:06 +00:00
}
func (entity *LogStreamDefault) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub LogStreamDefault
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
func (*LogStreamDefault) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassLogStream
2019-06-07 10:56:06 +00:00
}
func (*LogStreamDefault) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeLogStreamDefault
2019-06-07 10:56:06 +00:00
}
func (*LogStreamDefault) LogStreamType() string {
2022-03-13 04:04:12 +00:00
return TypeLogStreamDefault
2019-06-07 10:56:06 +00:00
}
// The log is written to a file
type LogStreamFile struct {
2022-03-13 04:04:12 +00:00
meta
// Path to the file to where the internal TDLib log will be written
Path string `json:"path"`
// The maximum size of the file to where the internal TDLib log is written before the file will automatically be rotated, in bytes
MaxFileSize int64 `json:"max_file_size"`
// Pass true to additionally redirect stderr to the log file. Ignored on Windows
RedirectStderr bool `json:"redirect_stderr"`
2019-06-07 10:56:06 +00:00
}
func (entity *LogStreamFile) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub LogStreamFile
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
func (*LogStreamFile) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassLogStream
2019-06-07 10:56:06 +00:00
}
func (*LogStreamFile) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeLogStreamFile
2019-06-07 10:56:06 +00:00
}
func (*LogStreamFile) LogStreamType() string {
2022-03-13 04:04:12 +00:00
return TypeLogStreamFile
2019-06-07 10:56:06 +00:00
}
// The log is written nowhere
2022-03-13 04:04:12 +00:00
type LogStreamEmpty struct{
meta
2019-06-07 10:56:06 +00:00
}
func (entity *LogStreamEmpty) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub LogStreamEmpty
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
func (*LogStreamEmpty) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassLogStream
2019-06-07 10:56:06 +00:00
}
func (*LogStreamEmpty) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeLogStreamEmpty
2019-06-07 10:56:06 +00:00
}
func (*LogStreamEmpty) LogStreamType() string {
2022-03-13 04:04:12 +00:00
return TypeLogStreamEmpty
2019-06-07 10:56:06 +00:00
}
// Contains a TDLib internal log verbosity level
type LogVerbosityLevel struct {
2022-03-13 04:04:12 +00:00
meta
// Log verbosity level
VerbosityLevel int32 `json:"verbosity_level"`
2019-06-07 10:56:06 +00:00
}
func (entity *LogVerbosityLevel) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub LogVerbosityLevel
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
func (*LogVerbosityLevel) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassLogVerbosityLevel
2019-06-07 10:56:06 +00:00
}
func (*LogVerbosityLevel) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeLogVerbosityLevel
2019-06-07 10:56:06 +00:00
}
// Contains a list of available TDLib internal log tags
type LogTags struct {
2022-03-13 04:04:12 +00:00
meta
// List of log tags
Tags []string `json:"tags"`
2019-06-07 10:56:06 +00:00
}
func (entity *LogTags) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
type stub LogTags
2019-06-07 10:56:06 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2019-06-07 10:56:06 +00:00
}
func (*LogTags) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassLogTags
2019-06-07 10:56:06 +00:00
}
func (*LogTags) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeLogTags
2019-06-07 10:56:06 +00:00
}
2018-08-30 14:55:42 +00:00
// A simple object containing a number; for testing only
type TestInt struct {
2022-03-13 04:04:12 +00:00
meta
// Number
Value int32 `json:"value"`
2018-08-30 14:55:42 +00:00
}
func (entity *TestInt) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub TestInt
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*TestInt) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassTestInt
2018-08-30 14:55:42 +00:00
}
func (*TestInt) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeTestInt
2018-08-30 14:55:42 +00:00
}
// A simple object containing a string; for testing only
type TestString struct {
2022-03-13 04:04:12 +00:00
meta
// String
Value string `json:"value"`
2018-08-30 14:55:42 +00:00
}
func (entity *TestString) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub TestString
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*TestString) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassTestString
2018-08-30 14:55:42 +00:00
}
func (*TestString) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeTestString
2018-08-30 14:55:42 +00:00
}
// A simple object containing a sequence of bytes; for testing only
type TestBytes struct {
2022-03-13 04:04:12 +00:00
meta
// Bytes
Value []byte `json:"value"`
2018-08-30 14:55:42 +00:00
}
func (entity *TestBytes) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub TestBytes
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*TestBytes) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassTestBytes
2018-08-30 14:55:42 +00:00
}
func (*TestBytes) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeTestBytes
2018-08-30 14:55:42 +00:00
}
// A simple object containing a vector of numbers; for testing only
type TestVectorInt struct {
2022-03-13 04:04:12 +00:00
meta
// Vector of numbers
Value []int32 `json:"value"`
2018-08-30 14:55:42 +00:00
}
func (entity *TestVectorInt) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub TestVectorInt
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*TestVectorInt) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassTestVectorInt
2018-08-30 14:55:42 +00:00
}
func (*TestVectorInt) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeTestVectorInt
2018-08-30 14:55:42 +00:00
}
// A simple object containing a vector of objects that hold a number; for testing only
type TestVectorIntObject struct {
2022-03-13 04:04:12 +00:00
meta
// Vector of objects
Value []*TestInt `json:"value"`
2018-08-30 14:55:42 +00:00
}
func (entity *TestVectorIntObject) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub TestVectorIntObject
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*TestVectorIntObject) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassTestVectorIntObject
2018-08-30 14:55:42 +00:00
}
func (*TestVectorIntObject) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeTestVectorIntObject
2018-08-30 14:55:42 +00:00
}
// A simple object containing a vector of strings; for testing only
type TestVectorString struct {
2022-03-13 04:04:12 +00:00
meta
// Vector of strings
Value []string `json:"value"`
2018-08-30 14:55:42 +00:00
}
func (entity *TestVectorString) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub TestVectorString
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*TestVectorString) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassTestVectorString
2018-08-30 14:55:42 +00:00
}
func (*TestVectorString) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeTestVectorString
2018-08-30 14:55:42 +00:00
}
// A simple object containing a vector of objects that hold a string; for testing only
type TestVectorStringObject struct {
2022-03-13 04:04:12 +00:00
meta
// Vector of objects
Value []*TestString `json:"value"`
2018-08-30 14:55:42 +00:00
}
func (entity *TestVectorStringObject) MarshalJSON() ([]byte, error) {
2022-03-13 04:04:12 +00:00
entity.meta.Type = entity.GetType()
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
type stub TestVectorStringObject
2018-08-30 14:55:42 +00:00
2022-03-13 04:04:12 +00:00
return json.Marshal((*stub)(entity))
2018-08-30 14:55:42 +00:00
}
func (*TestVectorStringObject) GetClass() string {
2022-03-13 04:04:12 +00:00
return ClassTestVectorStringObject
2018-08-30 14:55:42 +00:00
}
func (*TestVectorStringObject) GetType() string {
2022-03-13 04:04:12 +00:00
return TypeTestVectorStringObject
2018-08-30 14:55:42 +00:00
}
2022-03-13 04:04:12 +00:00