Files
lukaszraczylo fecef22f48 refactor(scrape): detect prose-style "must be X" discriminator values on variants
Sealed-interface union variants whose Type/Source field is declared as
bare prose (e.g. "Type of the result, must be article" or "Scope type,
must be all_private_chats") were skipped by extractEnumValues because
the existing patterns require curly-quoted values. The genapi emitter
already extracted these values via discBareRE for marshal-side
discriminator injection; lifting the same detection into the scraper
populates Field.EnumValues so planUnifiedUnionEnums folds them into
shared union-level enums automatically.

Unions newly unified (10): BotCommandScope, MenuButton, InputMedia,
InputPaidMedia, InputPollMedia, InputPollOptionMedia, InputProfilePhoto,
InputStoryContent, InlineQueryResult, PassportElementError.

InputMessageContent stays excluded — its variants dispatch
structurally on field presence and have no Type/Source field, so
planUnifiedUnionEnums correctly skips it.

Constants added: 60 typed enum constants across the 10 unions; the
corresponding variant struct fields are retyped from string to the
shared enum.

Internal call-site cleanups: 0 — no internal package referenced these
discriminator values via magic strings.

False positives the prose detector explicitly rejects: terminal
prose-word continuations like "must be sent", "must be shown above",
"must be specified", "must be paid", "must be active", "must be one
of 3, 6, or 12", "must be between 5 and 100000", "must be a Pay
button", "must be repainted". Guarded via terminal-position regex
anchor + closed-list isProseWord filter.

Determinism verified across two consecutive make regen-from-fixture
runs. go test -race ./..., go vet ./..., staticcheck ./... all clean.
2026-05-09 20:37:07 +01:00

448 lines
18 KiB
Go

// Code generated by cmd/genapi. DO NOT EDIT.
//go:build !ignore_autogenerated
package api
type BackgroundFillType string
const (
BackgroundFillTypeSolid BackgroundFillType = "solid"
BackgroundFillTypeGradient BackgroundFillType = "gradient"
BackgroundFillTypeFreeformGradient BackgroundFillType = "freeform_gradient"
)
type BackgroundTypeKind string
const (
BackgroundTypeKindFill BackgroundTypeKind = "fill"
BackgroundTypeKindWallpaper BackgroundTypeKind = "wallpaper"
BackgroundTypeKindPattern BackgroundTypeKind = "pattern"
BackgroundTypeKindChatTheme BackgroundTypeKind = "chat_theme"
)
type BotCommandScopeType string
const (
BotCommandScopeTypeDefault BotCommandScopeType = "default"
BotCommandScopeTypeAllPrivateChats BotCommandScopeType = "all_private_chats"
BotCommandScopeTypeAllGroupChats BotCommandScopeType = "all_group_chats"
BotCommandScopeTypeAllChatAdministrators BotCommandScopeType = "all_chat_administrators"
BotCommandScopeTypeChat BotCommandScopeType = "chat"
BotCommandScopeTypeChatAdministrators BotCommandScopeType = "chat_administrators"
BotCommandScopeTypeChatMember BotCommandScopeType = "chat_member"
)
type ChatBoostSourceKind string
const (
ChatBoostSourceKindPremium ChatBoostSourceKind = "premium"
ChatBoostSourceKindGiftCode ChatBoostSourceKind = "gift_code"
ChatBoostSourceKindGiveaway ChatBoostSourceKind = "giveaway"
)
type ChatMemberStatus string
const (
ChatMemberStatusCreator ChatMemberStatus = "creator"
ChatMemberStatusAdministrator ChatMemberStatus = "administrator"
ChatMemberStatusMember ChatMemberStatus = "member"
ChatMemberStatusRestricted ChatMemberStatus = "restricted"
ChatMemberStatusLeft ChatMemberStatus = "left"
ChatMemberStatusKicked ChatMemberStatus = "kicked"
)
type ChatType string
const (
ChatTypePrivate ChatType = "private"
ChatTypeGroup ChatType = "group"
ChatTypeSupergroup ChatType = "supergroup"
ChatTypeChannel ChatType = "channel"
)
type EncryptedPassportElementType string
const (
EncryptedPassportElementTypePersonalDetails EncryptedPassportElementType = "personal_details"
EncryptedPassportElementTypePassport EncryptedPassportElementType = "passport"
EncryptedPassportElementTypeDriverLicense EncryptedPassportElementType = "driver_license"
EncryptedPassportElementTypeIdentityCard EncryptedPassportElementType = "identity_card"
EncryptedPassportElementTypeInternalPassport EncryptedPassportElementType = "internal_passport"
EncryptedPassportElementTypeAddress EncryptedPassportElementType = "address"
EncryptedPassportElementTypeUtilityBill EncryptedPassportElementType = "utility_bill"
EncryptedPassportElementTypeBankStatement EncryptedPassportElementType = "bank_statement"
EncryptedPassportElementTypeRentalAgreement EncryptedPassportElementType = "rental_agreement"
EncryptedPassportElementTypePassportRegistration EncryptedPassportElementType = "passport_registration"
EncryptedPassportElementTypeTemporaryRegistration EncryptedPassportElementType = "temporary_registration"
EncryptedPassportElementTypePhoneNumber EncryptedPassportElementType = "phone_number"
EncryptedPassportElementTypeEmail EncryptedPassportElementType = "email"
)
type InlineQueryChatType string
const (
InlineQueryChatTypeSender InlineQueryChatType = "sender"
InlineQueryChatTypePrivate InlineQueryChatType = "private"
InlineQueryChatTypeGroup InlineQueryChatType = "group"
InlineQueryChatTypeSupergroup InlineQueryChatType = "supergroup"
InlineQueryChatTypeChannel InlineQueryChatType = "channel"
)
type InlineQueryResultDocumentMimeType string
const (
InlineQueryResultDocumentMimeTypeApplicationOfPdf InlineQueryResultDocumentMimeType = "application/pdf"
InlineQueryResultDocumentMimeTypeApplicationOfZip InlineQueryResultDocumentMimeType = "application/zip"
)
type InlineQueryResultGifThumbnailMimeType string
const (
InlineQueryResultGifThumbnailMimeTypeImageOfJpeg InlineQueryResultGifThumbnailMimeType = "image/jpeg"
InlineQueryResultGifThumbnailMimeTypeImageOfGif InlineQueryResultGifThumbnailMimeType = "image/gif"
InlineQueryResultGifThumbnailMimeTypeVideoOfMp4 InlineQueryResultGifThumbnailMimeType = "video/mp4"
)
type InlineQueryResultType string
const (
InlineQueryResultTypeAudio InlineQueryResultType = "audio"
InlineQueryResultTypeDocument InlineQueryResultType = "document"
InlineQueryResultTypeGif InlineQueryResultType = "gif"
InlineQueryResultTypeMpeg4Gif InlineQueryResultType = "mpeg4_gif"
InlineQueryResultTypePhoto InlineQueryResultType = "photo"
InlineQueryResultTypeSticker InlineQueryResultType = "sticker"
InlineQueryResultTypeVideo InlineQueryResultType = "video"
InlineQueryResultTypeVoice InlineQueryResultType = "voice"
InlineQueryResultTypeArticle InlineQueryResultType = "article"
InlineQueryResultTypeContact InlineQueryResultType = "contact"
InlineQueryResultTypeGame InlineQueryResultType = "game"
InlineQueryResultTypeLocation InlineQueryResultType = "location"
InlineQueryResultTypeVenue InlineQueryResultType = "venue"
)
type InputMediaType string
const (
InputMediaTypeAnimation InputMediaType = "animation"
InputMediaTypeAudio InputMediaType = "audio"
InputMediaTypeDocument InputMediaType = "document"
InputMediaTypeLivePhoto InputMediaType = "live_photo"
InputMediaTypePhoto InputMediaType = "photo"
InputMediaTypeVideo InputMediaType = "video"
)
type InputPaidMediaType string
const (
InputPaidMediaTypeLivePhoto InputPaidMediaType = "live_photo"
InputPaidMediaTypePhoto InputPaidMediaType = "photo"
InputPaidMediaTypeVideo InputPaidMediaType = "video"
)
type InputPollMediaType string
const (
InputPollMediaTypeAnimation InputPollMediaType = "animation"
InputPollMediaTypeAudio InputPollMediaType = "audio"
InputPollMediaTypeDocument InputPollMediaType = "document"
InputPollMediaTypeLivePhoto InputPollMediaType = "live_photo"
InputPollMediaTypeLocation InputPollMediaType = "location"
InputPollMediaTypePhoto InputPollMediaType = "photo"
InputPollMediaTypeVenue InputPollMediaType = "venue"
InputPollMediaTypeVideo InputPollMediaType = "video"
)
type InputPollOptionMediaType string
const (
InputPollOptionMediaTypeAnimation InputPollOptionMediaType = "animation"
InputPollOptionMediaTypeLivePhoto InputPollOptionMediaType = "live_photo"
InputPollOptionMediaTypeLocation InputPollOptionMediaType = "location"
InputPollOptionMediaTypePhoto InputPollOptionMediaType = "photo"
InputPollOptionMediaTypeSticker InputPollOptionMediaType = "sticker"
InputPollOptionMediaTypeVenue InputPollOptionMediaType = "venue"
InputPollOptionMediaTypeVideo InputPollOptionMediaType = "video"
)
type InputProfilePhotoType string
const (
InputProfilePhotoTypeStatic InputProfilePhotoType = "static"
InputProfilePhotoTypeAnimated InputProfilePhotoType = "animated"
)
type InputStickerFormat string
const (
InputStickerFormatStatic InputStickerFormat = "static"
InputStickerFormatAnimated InputStickerFormat = "animated"
InputStickerFormatVideo InputStickerFormat = "video"
)
type InputStoryContentType string
const (
InputStoryContentTypePhoto InputStoryContentType = "photo"
InputStoryContentTypeVideo InputStoryContentType = "video"
)
type KeyboardButtonStyle string
const (
KeyboardButtonStyleDanger KeyboardButtonStyle = "danger"
KeyboardButtonStyleSuccess KeyboardButtonStyle = "success"
KeyboardButtonStylePrimary KeyboardButtonStyle = "primary"
)
type MaskPositionPoint string
const (
MaskPositionPointForehead MaskPositionPoint = "forehead"
MaskPositionPointEyes MaskPositionPoint = "eyes"
MaskPositionPointMouth MaskPositionPoint = "mouth"
MaskPositionPointChin MaskPositionPoint = "chin"
)
type MenuButtonType string
const (
MenuButtonTypeCommands MenuButtonType = "commands"
MenuButtonTypeWebApp MenuButtonType = "web_app"
MenuButtonTypeDefault MenuButtonType = "default"
)
type MessageEntityType string
const (
MessageEntityTypeMention MessageEntityType = "mention"
MessageEntityTypeHashtag MessageEntityType = "hashtag"
MessageEntityTypeCashtag MessageEntityType = "cashtag"
MessageEntityTypeBotCommand MessageEntityType = "bot_command"
MessageEntityTypeURL MessageEntityType = "url"
MessageEntityTypeEmail MessageEntityType = "email"
MessageEntityTypePhoneNumber MessageEntityType = "phone_number"
MessageEntityTypeBold MessageEntityType = "bold"
MessageEntityTypeItalic MessageEntityType = "italic"
MessageEntityTypeUnderline MessageEntityType = "underline"
MessageEntityTypeStrikethrough MessageEntityType = "strikethrough"
MessageEntityTypeSpoiler MessageEntityType = "spoiler"
MessageEntityTypeBlockquote MessageEntityType = "blockquote"
MessageEntityTypeExpandableBlockquote MessageEntityType = "expandable_blockquote"
MessageEntityTypeCode MessageEntityType = "code"
MessageEntityTypePre MessageEntityType = "pre"
MessageEntityTypeTextLink MessageEntityType = "text_link"
MessageEntityTypeTextMention MessageEntityType = "text_mention"
MessageEntityTypeCustomEmoji MessageEntityType = "custom_emoji"
MessageEntityTypeDateTime MessageEntityType = "date_time"
)
type MessageOriginType string
const (
MessageOriginTypeUser MessageOriginType = "user"
MessageOriginTypeHiddenUser MessageOriginType = "hidden_user"
MessageOriginTypeChat MessageOriginType = "chat"
MessageOriginTypeChannel MessageOriginType = "channel"
)
type OwnedGiftType string
const (
OwnedGiftTypeRegular OwnedGiftType = "regular"
OwnedGiftTypeUnique OwnedGiftType = "unique"
)
type PaidMediaType string
const (
PaidMediaTypeLivePhoto PaidMediaType = "live_photo"
PaidMediaTypePhoto PaidMediaType = "photo"
PaidMediaTypePreview PaidMediaType = "preview"
PaidMediaTypeVideo PaidMediaType = "video"
)
type ParseMode string
const (
ParseModeMarkdown ParseMode = "Markdown"
ParseModeMarkdownV2 ParseMode = "MarkdownV2"
ParseModeHTML ParseMode = "HTML"
)
type PassportElementErrorDataFieldType string
const (
PassportElementErrorDataFieldTypePersonalDetails PassportElementErrorDataFieldType = "personal_details"
PassportElementErrorDataFieldTypePassport PassportElementErrorDataFieldType = "passport"
PassportElementErrorDataFieldTypeDriverLicense PassportElementErrorDataFieldType = "driver_license"
PassportElementErrorDataFieldTypeIdentityCard PassportElementErrorDataFieldType = "identity_card"
PassportElementErrorDataFieldTypeInternalPassport PassportElementErrorDataFieldType = "internal_passport"
PassportElementErrorDataFieldTypeAddress PassportElementErrorDataFieldType = "address"
)
type PassportElementErrorFileType string
const (
PassportElementErrorFileTypeUtilityBill PassportElementErrorFileType = "utility_bill"
PassportElementErrorFileTypeBankStatement PassportElementErrorFileType = "bank_statement"
PassportElementErrorFileTypeRentalAgreement PassportElementErrorFileType = "rental_agreement"
PassportElementErrorFileTypePassportRegistration PassportElementErrorFileType = "passport_registration"
PassportElementErrorFileTypeTemporaryRegistration PassportElementErrorFileType = "temporary_registration"
)
type PassportElementErrorReverseSideType string
const (
PassportElementErrorReverseSideTypeDriverLicense PassportElementErrorReverseSideType = "driver_license"
PassportElementErrorReverseSideTypeIdentityCard PassportElementErrorReverseSideType = "identity_card"
)
type PassportElementErrorSelfieType string
const (
PassportElementErrorSelfieTypePassport PassportElementErrorSelfieType = "passport"
PassportElementErrorSelfieTypeDriverLicense PassportElementErrorSelfieType = "driver_license"
PassportElementErrorSelfieTypeIdentityCard PassportElementErrorSelfieType = "identity_card"
PassportElementErrorSelfieTypeInternalPassport PassportElementErrorSelfieType = "internal_passport"
)
type PassportElementErrorSource string
const (
PassportElementErrorSourceData PassportElementErrorSource = "data"
PassportElementErrorSourceFrontSide PassportElementErrorSource = "front_side"
PassportElementErrorSourceReverseSide PassportElementErrorSource = "reverse_side"
PassportElementErrorSourceSelfie PassportElementErrorSource = "selfie"
PassportElementErrorSourceFile PassportElementErrorSource = "file"
PassportElementErrorSourceFiles PassportElementErrorSource = "files"
PassportElementErrorSourceTranslationFile PassportElementErrorSource = "translation_file"
PassportElementErrorSourceTranslationFiles PassportElementErrorSource = "translation_files"
PassportElementErrorSourceUnspecified PassportElementErrorSource = "unspecified"
)
type PassportElementErrorTranslationFileType string
const (
PassportElementErrorTranslationFileTypePassport PassportElementErrorTranslationFileType = "passport"
PassportElementErrorTranslationFileTypeDriverLicense PassportElementErrorTranslationFileType = "driver_license"
PassportElementErrorTranslationFileTypeIdentityCard PassportElementErrorTranslationFileType = "identity_card"
PassportElementErrorTranslationFileTypeInternalPassport PassportElementErrorTranslationFileType = "internal_passport"
PassportElementErrorTranslationFileTypeUtilityBill PassportElementErrorTranslationFileType = "utility_bill"
PassportElementErrorTranslationFileTypeBankStatement PassportElementErrorTranslationFileType = "bank_statement"
PassportElementErrorTranslationFileTypeRentalAgreement PassportElementErrorTranslationFileType = "rental_agreement"
PassportElementErrorTranslationFileTypePassportRegistration PassportElementErrorTranslationFileType = "passport_registration"
PassportElementErrorTranslationFileTypeTemporaryRegistration PassportElementErrorTranslationFileType = "temporary_registration"
)
type PollType string
const (
PollTypeRegular PollType = "regular"
PollTypeQuiz PollType = "quiz"
)
type ReactionTypeKind string
const (
ReactionTypeKindEmoji ReactionTypeKind = "emoji"
ReactionTypeKindCustomEmoji ReactionTypeKind = "custom_emoji"
ReactionTypeKindPaid ReactionTypeKind = "paid"
)
type RefundedPaymentCurrency string
const (
RefundedPaymentCurrencyXTR RefundedPaymentCurrency = "XTR"
)
type RevenueWithdrawalStateKind string
const (
RevenueWithdrawalStateKindPending RevenueWithdrawalStateKind = "pending"
RevenueWithdrawalStateKindSucceeded RevenueWithdrawalStateKind = "succeeded"
RevenueWithdrawalStateKindFailed RevenueWithdrawalStateKind = "failed"
)
type StickerType string
const (
StickerTypeRegular StickerType = "regular"
StickerTypeMask StickerType = "mask"
StickerTypeCustomEmoji StickerType = "custom_emoji"
)
type StoryAreaTypeKind string
const (
StoryAreaTypeKindLocation StoryAreaTypeKind = "location"
StoryAreaTypeKindSuggestedReaction StoryAreaTypeKind = "suggested_reaction"
StoryAreaTypeKindLink StoryAreaTypeKind = "link"
StoryAreaTypeKindWeather StoryAreaTypeKind = "weather"
StoryAreaTypeKindUniqueGift StoryAreaTypeKind = "unique_gift"
)
type SuggestedPostInfoState string
const (
SuggestedPostInfoStatePending SuggestedPostInfoState = "pending"
SuggestedPostInfoStateApproved SuggestedPostInfoState = "approved"
SuggestedPostInfoStateDeclined SuggestedPostInfoState = "declined"
)
type SuggestedPostPaidCurrency string
const (
SuggestedPostPaidCurrencyXTR SuggestedPostPaidCurrency = "XTR"
SuggestedPostPaidCurrencyTON SuggestedPostPaidCurrency = "TON"
)
type SuggestedPostRefundedReason string
const (
SuggestedPostRefundedReasonPostDeleted SuggestedPostRefundedReason = "post_deleted"
SuggestedPostRefundedReasonPaymentRefunded SuggestedPostRefundedReason = "payment_refunded"
)
type TransactionPartnerType string
const (
TransactionPartnerTypeUser TransactionPartnerType = "user"
TransactionPartnerTypeChat TransactionPartnerType = "chat"
TransactionPartnerTypeAffiliateProgram TransactionPartnerType = "affiliate_program"
TransactionPartnerTypeFragment TransactionPartnerType = "fragment"
TransactionPartnerTypeTelegramAds TransactionPartnerType = "telegram_ads"
TransactionPartnerTypeTelegramApi TransactionPartnerType = "telegram_api"
TransactionPartnerTypeOther TransactionPartnerType = "other"
)
type TransactionPartnerUserTransactionType string
const (
TransactionPartnerUserTransactionTypeInvoicePayment TransactionPartnerUserTransactionType = "invoice_payment"
TransactionPartnerUserTransactionTypePaidMediaPayment TransactionPartnerUserTransactionType = "paid_media_payment"
TransactionPartnerUserTransactionTypeGiftPurchase TransactionPartnerUserTransactionType = "gift_purchase"
TransactionPartnerUserTransactionTypePremiumPurchase TransactionPartnerUserTransactionType = "premium_purchase"
TransactionPartnerUserTransactionTypeBusinessAccountTransfer TransactionPartnerUserTransactionType = "business_account_transfer"
)
type UniqueGiftInfoOrigin string
const (
UniqueGiftInfoOriginUpgrade UniqueGiftInfoOrigin = "upgrade"
UniqueGiftInfoOriginTransfer UniqueGiftInfoOrigin = "transfer"
UniqueGiftInfoOriginResale UniqueGiftInfoOrigin = "resale"
UniqueGiftInfoOriginGiftedUpgrade UniqueGiftInfoOrigin = "gifted_upgrade"
UniqueGiftInfoOriginOffer UniqueGiftInfoOrigin = "offer"
)
type UniqueGiftModelRarity string
const (
UniqueGiftModelRarityUncommon UniqueGiftModelRarity = "uncommon"
UniqueGiftModelRarityRare UniqueGiftModelRarity = "rare"
UniqueGiftModelRarityEpic UniqueGiftModelRarity = "epic"
UniqueGiftModelRarityLegendary UniqueGiftModelRarity = "legendary"
)