diff --git a/Makefile b/Makefile index d8ac66a..b7b8938 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -TAG := 93c42f6d7c1209937431469f80427d48907f1b8d +TAG := d7203eb719304866a7eb7033ef03d421459335b8 schema-update: curl https://raw.githubusercontent.com/tdlib/td/${TAG}/td/generate/scheme/td_api.tl 2>/dev/null > ./data/td_api.tl diff --git a/client/function.go b/client/function.go index 0e9b236..0aeb7a0 100755 --- a/client/function.go +++ b/client/function.go @@ -71,7 +71,7 @@ type SetTdlibParametersRequest struct { 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"` - // Encryption key for the database + // Encryption key for the database. If the encryption key is invalid, then an error with code 401 will be returned DatabaseEncryptionKey []byte `json:"database_encryption_key"` // Pass true to keep information about downloaded and uploaded files between application restarts UseFileDatabase bool `json:"use_file_database"` @@ -93,10 +93,6 @@ type SetTdlibParametersRequest struct { SystemVersion string `json:"system_version"` // Application version; must be non-empty ApplicationVersion string `json:"application_version"` - // Pass true to automatically delete old files in background - EnableStorageOptimizer bool `json:"enable_storage_optimizer"` - // Pass true to ignore original file names for downloaded files. Otherwise, downloaded files are saved under names as close as possible to the original name - IgnoreFileNames bool `json:"ignore_file_names"` } // Sets the parameters for TDLib initialization. Works only when the current authorization state is authorizationStateWaitTdlibParameters @@ -106,22 +102,20 @@ func (client *Client) SetTdlibParameters(req *SetTdlibParametersRequest) (*Ok, e Type: "setTdlibParameters", }, Data: map[string]interface{}{ - "use_test_dc": req.UseTestDc, - "database_directory": req.DatabaseDirectory, - "files_directory": req.FilesDirectory, - "database_encryption_key": req.DatabaseEncryptionKey, - "use_file_database": req.UseFileDatabase, - "use_chat_info_database": req.UseChatInfoDatabase, - "use_message_database": req.UseMessageDatabase, - "use_secret_chats": req.UseSecretChats, - "api_id": req.ApiId, - "api_hash": req.ApiHash, - "system_language_code": req.SystemLanguageCode, - "device_model": req.DeviceModel, - "system_version": req.SystemVersion, - "application_version": req.ApplicationVersion, - "enable_storage_optimizer": req.EnableStorageOptimizer, - "ignore_file_names": req.IgnoreFileNames, + "use_test_dc": req.UseTestDc, + "database_directory": req.DatabaseDirectory, + "files_directory": req.FilesDirectory, + "database_encryption_key": req.DatabaseEncryptionKey, + "use_file_database": req.UseFileDatabase, + "use_chat_info_database": req.UseChatInfoDatabase, + "use_message_database": req.UseMessageDatabase, + "use_secret_chats": req.UseSecretChats, + "api_id": req.ApiId, + "api_hash": req.ApiHash, + "system_language_code": req.SystemLanguageCode, + "device_model": req.DeviceModel, + "system_version": req.SystemVersion, + "application_version": req.ApplicationVersion, }, }) if err != nil { @@ -142,7 +136,7 @@ type SetAuthenticationPhoneNumberRequest struct { Settings *PhoneNumberAuthenticationSettings `json:"settings"` } -// Sets the phone number of the user and sends an authentication code to the user. Works only when the current authorization state is authorizationStateWaitPhoneNumber, or if there is no pending authentication query and the current authorization state is authorizationStateWaitCode, authorizationStateWaitRegistration, or authorizationStateWaitPassword +// Sets the phone number of the user and sends an authentication code to the user. Works only when the current authorization state is authorizationStateWaitPhoneNumber, or if there is no pending authentication query and the current authorization state is authorizationStateWaitEmailAddress, authorizationStateWaitEmailCode, authorizationStateWaitCode, authorizationStateWaitRegistration, or authorizationStateWaitPassword func (client *Client) SetAuthenticationPhoneNumber(req *SetAuthenticationPhoneNumberRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -266,7 +260,7 @@ type RequestQrCodeAuthenticationRequest struct { OtherUserIds []int64 `json:"other_user_ids"` } -// Requests QR code authentication by scanning a QR code on another logged in device. Works only when the current authorization state is authorizationStateWaitPhoneNumber, or if there is no pending authentication query and the current authorization state is authorizationStateWaitCode, authorizationStateWaitRegistration, or authorizationStateWaitPassword +// Requests QR code authentication by scanning a QR code on another logged in device. Works only when the current authorization state is authorizationStateWaitPhoneNumber, or if there is no pending authentication query and the current authorization state is authorizationStateWaitEmailAddress, authorizationStateWaitEmailCode, authorizationStateWaitCode, authorizationStateWaitRegistration, or authorizationStateWaitPassword func (client *Client) RequestQrCodeAuthentication(req *RequestQrCodeAuthenticationRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -292,6 +286,8 @@ type RegisterUserRequest struct { FirstName string `json:"first_name"` // The last name of the user; 0-64 characters LastName string `json:"last_name"` + // Pass true to disable notification about the current user joining Telegram for other users that added them to contact list + DisableNotification bool `json:"disable_notification"` } // Finishes user registration. Works only when the current authorization state is authorizationStateWaitRegistration @@ -301,8 +297,9 @@ func (client *Client) RegisterUser(req *RegisterUserRequest) (*Ok, error) { Type: "registerUser", }, Data: map[string]interface{}{ - "first_name": req.FirstName, - "last_name": req.LastName, + "first_name": req.FirstName, + "last_name": req.LastName, + "disable_notification": req.DisableNotification, }, }) if err != nil { @@ -316,6 +313,25 @@ func (client *Client) RegisterUser(req *RegisterUserRequest) (*Ok, error) { return UnmarshalOk(result.Data) } +// Resets the login email address. May return an error with a message "TASK_ALREADY_EXISTS" if reset is still pending. Works only when the current authorization state is authorizationStateWaitEmailCode and authorization_state.can_reset_email_address == true +func (client *Client) ResetAuthenticationEmailAddress() (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "resetAuthenticationEmailAddress", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type CheckAuthenticationPasswordRequest struct { // The 2-step verification password to check Password string `json:"password"` @@ -419,6 +435,32 @@ func (client *Client) RecoverAuthenticationPassword(req *RecoverAuthenticationPa return UnmarshalOk(result.Data) } +type SendAuthenticationFirebaseSmsRequest struct { + // SafetyNet Attestation API token for the Android application, or secret from push notification for the iOS application + Token string `json:"token"` +} + +// Sends Firebase Authentication SMS to the phone number of the user. Works only when the current authorization state is authorizationStateWaitCode and the server returned code of the type authenticationCodeTypeFirebaseAndroid or authenticationCodeTypeFirebaseIos +func (client *Client) SendAuthenticationFirebaseSms(req *SendAuthenticationFirebaseSmsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "sendAuthenticationFirebaseSms", + }, + Data: map[string]interface{}{ + "token": req.Token, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type CheckAuthenticationBotTokenRequest struct { // The bot token Token string `json:"token"` @@ -635,7 +677,7 @@ type SetLoginEmailAddressRequest struct { NewLoginEmailAddress string `json:"new_login_email_address"` } -// Changes the login email address of the user. The change will not be applied until the new login email address is confirmed with checkLoginEmailAddressCode. To use Apple ID/Google ID instead of a email address, call checkLoginEmailAddressCode directly +// Changes the login email address of the user. The email address can be changed only if the current user already has login email and passwordState.login_email_address_pattern is non-empty. The change will not be applied until the new login email address is confirmed with checkLoginEmailAddressCode. To use Apple ID/Google ID instead of a email address, call checkLoginEmailAddressCode directly func (client *Client) SetLoginEmailAddress(req *SetLoginEmailAddressRequest) (*EmailAddressAuthenticationCodeInfo, error) { result, err := client.Send(Request{ meta: meta{ @@ -801,6 +843,25 @@ func (client *Client) ResendRecoveryEmailAddressCode() (*PasswordState, error) { return UnmarshalPasswordState(result.Data) } +// Cancels verification of the 2-step verification recovery email address +func (client *Client) CancelRecoveryEmailAddressVerification() (*PasswordState, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "cancelRecoveryEmailAddressVerification", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalPasswordState(result.Data) +} + // Requests to send a 2-step verification password recovery code to an email address that was previously set up func (client *Client) RequestPasswordRecovery() (*EmailAddressAuthenticationCodeInfo, error) { result, err := client.Send(Request{ @@ -1182,7 +1243,7 @@ type GetChatRequest struct { ChatId int64 `json:"chat_id"` } -// Returns information about a chat by its identifier, this is an offline request if the current user is not a bot +// Returns information about a chat by its identifier; this is an offline request if the current user is not a bot func (client *Client) GetChat(req *GetChatRequest) (*Chat, error) { result, err := client.Send(Request{ meta: meta{ @@ -1268,7 +1329,7 @@ type GetRepliedMessageRequest struct { MessageId int64 `json:"message_id"` } -// Returns information about a message that is replied by a given message. Also returns the pinned message, the game message, the invoice message, and the topic creation message for messages of the types messagePinMessage, messageGameScore, messagePaymentSuccessful, and topic messages without replied message respectively +// Returns information about a non-bundled message that is replied by a given message. Also, returns the pinned message, the game message, the invoice message, the message with a previously set same background, the giveaway message, and the topic creation message for messages of the types messagePinMessage, messageGameScore, messagePaymentSuccessful, messageChatSetBackground, messagePremiumGiveawayCompleted and topic messages without non-bundled replied message respectively func (client *Client) GetRepliedMessage(req *GetRepliedMessageRequest) (*Message, error) { result, err := client.Send(Request{ meta: meta{ @@ -1406,6 +1467,53 @@ func (client *Client) GetMessageThread(req *GetMessageThreadRequest) (*MessageTh return UnmarshalMessageThreadInfo(result.Data) } +type GetMessageReadDateRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // Identifier of the message + MessageId int64 `json:"message_id"` +} + +// Returns read date of a recent outgoing message in a private chat. The method can be called if message.can_get_read_date == true and the message is read +func (client *Client) GetMessageReadDate(req *GetMessageReadDateRequest) (MessageReadDate, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getMessageReadDate", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_id": req.MessageId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + switch result.Type { + case TypeMessageReadDateRead: + return UnmarshalMessageReadDateRead(result.Data) + + case TypeMessageReadDateUnread: + return UnmarshalMessageReadDateUnread(result.Data) + + case TypeMessageReadDateTooOld: + return UnmarshalMessageReadDateTooOld(result.Data) + + case TypeMessageReadDateUserPrivacyRestricted: + return UnmarshalMessageReadDateUserPrivacyRestricted(result.Data) + + case TypeMessageReadDateMyPrivacyRestricted: + return UnmarshalMessageReadDateMyPrivacyRestricted(result.Data) + + default: + return nil, errors.New("invalid type") + } +} + type GetMessageViewersRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` @@ -1414,7 +1522,7 @@ type GetMessageViewersRequest struct { } // Returns viewers of a recent outgoing message in a basic group or a supergroup chat. For video notes and voice notes only users, opened content of the message, are returned. The method can be called if message.can_get_viewers == true -func (client *Client) GetMessageViewers(req *GetMessageViewersRequest) (*Users, error) { +func (client *Client) GetMessageViewers(req *GetMessageViewersRequest) (*MessageViewers, error) { result, err := client.Send(Request{ meta: meta{ Type: "getMessageViewers", @@ -1432,7 +1540,7 @@ func (client *Client) GetMessageViewers(req *GetMessageViewersRequest) (*Users, return nil, buildResponseError(result.Data) } - return UnmarshalUsers(result.Data) + return UnmarshalMessageViewers(result.Data) } type GetFileRequest struct { @@ -1468,7 +1576,7 @@ type GetRemoteFileRequest struct { FileType FileType `json:"file_type"` } -// Returns information about a file by its remote ID; this is an offline request. Can be used to register a URL as a file for further uploading, or sending as a message. Even the request succeeds, the file can be used only if it is still accessible to the user. 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 +// Returns information about a file by its remote identifier; this is an offline request. Can be used to register a URL as a file for further uploading, or sending as a message. Even the request succeeds, the file can be used only if it is still accessible to the user. 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 func (client *Client) GetRemoteFile(req *GetRemoteFileRequest) (*File, error) { result, err := client.Send(Request{ meta: meta{ @@ -1553,7 +1661,7 @@ type SearchPublicChatRequest struct { Username string `json:"username"` } -// Searches a public chat by its username. Currently, only private chats, supergroups and channels can be public. Returns the chat if found; otherwise an error is returned +// Searches a public chat by its username. Currently, only private chats, supergroups and channels can be public. Returns the chat if found; otherwise, an error is returned func (client *Client) SearchPublicChat(req *SearchPublicChatRequest) (*Chat, error) { result, err := client.Send(Request{ meta: meta{ @@ -1607,7 +1715,7 @@ type SearchChatsRequest struct { Limit int32 `json:"limit"` } -// Searches for the specified query in the title and username of already known chats, this is an offline request. Returns chats in the order seen in the main chat list +// Searches for the specified query in the title and username of already known chats; this is an offline request. Returns chats in the order seen in the main chat list func (client *Client) SearchChats(req *SearchChatsRequest) (*Chats, error) { result, err := client.Send(Request{ meta: meta{ @@ -1684,6 +1792,90 @@ func (client *Client) SearchChatsNearby(req *SearchChatsNearbyRequest) (*ChatsNe return UnmarshalChatsNearby(result.Data) } +type GetChatSimilarChatsRequest struct { + // Identifier of the target chat; must be an identifier of a channel chat + ChatId int64 `json:"chat_id"` +} + +// Returns a list of chats similar to the given chat +func (client *Client) GetChatSimilarChats(req *GetChatSimilarChatsRequest) (*Chats, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getChatSimilarChats", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChats(result.Data) +} + +type GetChatSimilarChatCountRequest struct { + // Identifier of the target chat; must be an identifier of a channel chat + ChatId int64 `json:"chat_id"` + // Pass true to get the number of chats without sending network requests, or -1 if the number of chats is unknown locally + ReturnLocal bool `json:"return_local"` +} + +// Returns approximate number of chats similar to the given chat +func (client *Client) GetChatSimilarChatCount(req *GetChatSimilarChatCountRequest) (*Count, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getChatSimilarChatCount", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "return_local": req.ReturnLocal, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalCount(result.Data) +} + +type OpenChatSimilarChatRequest struct { + // Identifier of the original chat, which similar chats were requested + ChatId int64 `json:"chat_id"` + // Identifier of the opened chat + OpenedChatId int64 `json:"opened_chat_id"` +} + +// Informs TDLib that a chat was opened from the list of similar chats. The method is independent from openChat and closeChat methods +func (client *Client) OpenChatSimilarChat(req *OpenChatSimilarChatRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "openChatSimilarChat", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "opened_chat_id": req.OpenedChatId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type GetTopChatsRequest struct { // Category of chats to be returned Category TopChatCategory `json:"category"` @@ -1691,7 +1883,7 @@ type GetTopChatsRequest struct { Limit int32 `json:"limit"` } -// Returns a list of frequently used chats. Supported only if the chat info database is enabled +// Returns a list of frequently used chats func (client *Client) GetTopChats(req *GetTopChatsRequest) (*Chats, error) { result, err := client.Send(Request{ meta: meta{ @@ -1742,6 +1934,35 @@ func (client *Client) RemoveTopChat(req *RemoveTopChatRequest) (*Ok, error) { return UnmarshalOk(result.Data) } +type SearchRecentlyFoundChatsRequest struct { + // Query to search for + Query string `json:"query"` + // The maximum number of chats to be returned + Limit int32 `json:"limit"` +} + +// Searches for the specified query in the title and username of up to 50 recently found chats; this is an offline request +func (client *Client) SearchRecentlyFoundChats(req *SearchRecentlyFoundChatsRequest) (*Chats, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "searchRecentlyFoundChats", + }, + Data: map[string]interface{}{ + "query": req.Query, + "limit": req.Limit, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChats(result.Data) +} + type AddRecentlyFoundChatRequest struct { // Identifier of the chat to add ChatId int64 `json:"chat_id"` @@ -1818,7 +2039,7 @@ type GetRecentlyOpenedChatsRequest struct { Limit int32 `json:"limit"` } -// Returns recently opened chats, this is an offline request. Returns chats in the order of last opening +// Returns recently opened chats; this is an offline request. Returns chats in the order of last opening func (client *Client) GetRecentlyOpenedChats(req *GetRecentlyOpenedChatsRequest) (*Chats, error) { result, err := client.Send(Request{ meta: meta{ @@ -1840,7 +2061,7 @@ func (client *Client) GetRecentlyOpenedChats(req *GetRecentlyOpenedChatsRequest) } type CheckChatUsernameRequest struct { - // Chat identifier; must be identifier of a supergroup chat, or a channel chat, or a private chat with self, or zero if the chat is being created + // Chat identifier; must be identifier of a supergroup chat, or a channel chat, or a private chat with self, or 0 if the chat is being created ChatId int64 `json:"chat_id"` // Username to be checked Username string `json:"username"` @@ -1979,6 +2200,228 @@ func (client *Client) GetInactiveSupergroupChats() (*Chats, error) { return UnmarshalChats(result.Data) } +// Returns a list of channel chats, which can be used as a personal chat +func (client *Client) GetSuitablePersonalChats() (*Chats, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getSuitablePersonalChats", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChats(result.Data) +} + +type LoadSavedMessagesTopicsRequest struct { + // The maximum number of topics to be loaded. For optimal performance, the number of loaded topics is chosen by TDLib and can be smaller than the specified limit, even if the end of the list is not reached + Limit int32 `json:"limit"` +} + +// Loads more Saved Messages topics. The loaded topics will be sent through updateSavedMessagesTopic. Topics are sorted by their topic.order in descending order. Returns a 404 error if all topics have been loaded +func (client *Client) LoadSavedMessagesTopics(req *LoadSavedMessagesTopicsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "loadSavedMessagesTopics", + }, + Data: map[string]interface{}{ + "limit": req.Limit, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type GetSavedMessagesTopicHistoryRequest struct { + // Identifier of Saved Messages topic which messages will be fetched + SavedMessagesTopicId int64 `json:"saved_messages_topic_id"` + // Identifier of the message starting from which messages must be fetched; use 0 to get results from the last message + FromMessageId int64 `json:"from_message_id"` + // Specify 0 to get results from exactly the message from_message_id or a negative offset up to 99 to get additionally some newer messages + Offset int32 `json:"offset"` + // The maximum number of messages to be returned; must be positive and can't be greater than 100. If the offset is negative, the limit must be greater than or equal to -offset. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit + Limit int32 `json:"limit"` +} + +// Returns messages in a Saved Messages topic. The messages are returned in a reverse chronological order (i.e., in order of decreasing message_id) +func (client *Client) GetSavedMessagesTopicHistory(req *GetSavedMessagesTopicHistoryRequest) (*Messages, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getSavedMessagesTopicHistory", + }, + Data: map[string]interface{}{ + "saved_messages_topic_id": req.SavedMessagesTopicId, + "from_message_id": req.FromMessageId, + "offset": req.Offset, + "limit": req.Limit, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalMessages(result.Data) +} + +type GetSavedMessagesTopicMessageByDateRequest struct { + // Identifier of Saved Messages topic which message will be returned + SavedMessagesTopicId int64 `json:"saved_messages_topic_id"` + // Point in time (Unix timestamp) relative to which to search for messages + Date int32 `json:"date"` +} + +// Returns the last message sent in a Saved Messages topic no later than the specified date +func (client *Client) GetSavedMessagesTopicMessageByDate(req *GetSavedMessagesTopicMessageByDateRequest) (*Message, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getSavedMessagesTopicMessageByDate", + }, + Data: map[string]interface{}{ + "saved_messages_topic_id": req.SavedMessagesTopicId, + "date": req.Date, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalMessage(result.Data) +} + +type DeleteSavedMessagesTopicHistoryRequest struct { + // Identifier of Saved Messages topic which messages will be deleted + SavedMessagesTopicId int64 `json:"saved_messages_topic_id"` +} + +// Deletes all messages in a Saved Messages topic +func (client *Client) DeleteSavedMessagesTopicHistory(req *DeleteSavedMessagesTopicHistoryRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "deleteSavedMessagesTopicHistory", + }, + Data: map[string]interface{}{ + "saved_messages_topic_id": req.SavedMessagesTopicId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type DeleteSavedMessagesTopicMessagesByDateRequest struct { + // Identifier of Saved Messages topic which messages will be deleted + SavedMessagesTopicId int64 `json:"saved_messages_topic_id"` + // The minimum date of the messages to delete + MinDate int32 `json:"min_date"` + // The maximum date of the messages to delete + MaxDate int32 `json:"max_date"` +} + +// Deletes all messages between the specified dates in a Saved Messages topic. Messages sent in the last 30 seconds will not be deleted +func (client *Client) DeleteSavedMessagesTopicMessagesByDate(req *DeleteSavedMessagesTopicMessagesByDateRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "deleteSavedMessagesTopicMessagesByDate", + }, + Data: map[string]interface{}{ + "saved_messages_topic_id": req.SavedMessagesTopicId, + "min_date": req.MinDate, + "max_date": req.MaxDate, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type ToggleSavedMessagesTopicIsPinnedRequest struct { + // Identifier of Saved Messages topic to pin or unpin + SavedMessagesTopicId int64 `json:"saved_messages_topic_id"` + // Pass true to pin the topic; pass false to unpin it + IsPinned bool `json:"is_pinned"` +} + +// Changes the pinned state of a Saved Messages topic. There can be up to getOption("pinned_saved_messages_topic_count_max") pinned topics. The limit can be increased with Telegram Premium +func (client *Client) ToggleSavedMessagesTopicIsPinned(req *ToggleSavedMessagesTopicIsPinnedRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "toggleSavedMessagesTopicIsPinned", + }, + Data: map[string]interface{}{ + "saved_messages_topic_id": req.SavedMessagesTopicId, + "is_pinned": req.IsPinned, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type SetPinnedSavedMessagesTopicsRequest struct { + // Identifiers of the new pinned Saved Messages topics + SavedMessagesTopicIds []int64 `json:"saved_messages_topic_ids"` +} + +// Changes the order of pinned Saved Messages topics +func (client *Client) SetPinnedSavedMessagesTopics(req *SetPinnedSavedMessagesTopicsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setPinnedSavedMessagesTopics", + }, + Data: map[string]interface{}{ + "saved_messages_topic_ids": req.SavedMessagesTopicIds, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type GetGroupsInCommonRequest struct { // User identifier UserId int64 `json:"user_id"` @@ -2016,7 +2459,7 @@ type GetChatHistoryRequest struct { ChatId int64 `json:"chat_id"` // Identifier of the message starting from which history must be fetched; use 0 to get results from the last message FromMessageId int64 `json:"from_message_id"` - // Specify 0 to get results from exactly the from_message_id or a negative offset up to 99 to get additionally some newer messages + // Specify 0 to get results from exactly the message from_message_id or a negative offset up to 99 to get additionally some newer messages Offset int32 `json:"offset"` // The maximum number of messages to be returned; must be positive and can't be greater than 100. If the offset is negative, the limit must be greater than or equal to -offset. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit Limit int32 `json:"limit"` @@ -2056,7 +2499,7 @@ type GetMessageThreadHistoryRequest struct { MessageId int64 `json:"message_id"` // Identifier of the message starting from which history must be fetched; use 0 to get results from the last message FromMessageId int64 `json:"from_message_id"` - // Specify 0 to get results from exactly the from_message_id or a negative offset up to 99 to get additionally some newer messages + // Specify 0 to get results from exactly the message from_message_id or a negative offset up to 99 to get additionally some newer messages Offset int32 `json:"offset"` // The maximum number of messages to be returned; must be positive and can't be greater than 100. If the offset is negative, the limit must be greater than or equal to -offset. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit Limit int32 `json:"limit"` @@ -2154,7 +2597,7 @@ type SearchChatMessagesRequest struct { SenderId MessageSender `json:"sender_id"` // Identifier of the message starting from which history must be fetched; use 0 to get results from the last message FromMessageId int64 `json:"from_message_id"` - // Specify 0 to get results from exactly the from_message_id or a negative offset to get the specified message and some newer messages + // Specify 0 to get results from exactly the message from_message_id or a negative offset to get the specified message and some newer messages Offset int32 `json:"offset"` // The maximum number of messages to be returned; must be positive and can't be greater than 100. If the offset is negative, the limit must be greater than -offset. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit Limit int32 `json:"limit"` @@ -2162,6 +2605,8 @@ type SearchChatMessagesRequest struct { Filter SearchMessagesFilter `json:"filter"` // If not 0, only messages in the specified thread will be returned; supergroups only MessageThreadId int64 `json:"message_thread_id"` + // If not 0, only messages in the specified Saved Messages topic will be returned; pass 0 to return all messages, or for chats other than Saved Messages + SavedMessagesTopicId int64 `json:"saved_messages_topic_id"` } // Searches for messages with given words in the chat. Returns the results in reverse chronological order, i.e. in order of decreasing message_id. Cannot be used in secret chats with a non-empty query (searchSecretMessages must be used instead), or without an enabled message database. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit. A combination of query, sender_id, filter and message_thread_id search criteria is expected to be supported, only if it is required for Telegram official application implementation @@ -2171,14 +2616,15 @@ func (client *Client) SearchChatMessages(req *SearchChatMessagesRequest) (*Found Type: "searchChatMessages", }, Data: map[string]interface{}{ - "chat_id": req.ChatId, - "query": req.Query, - "sender_id": req.SenderId, - "from_message_id": req.FromMessageId, - "offset": req.Offset, - "limit": req.Limit, - "filter": req.Filter, - "message_thread_id": req.MessageThreadId, + "chat_id": req.ChatId, + "query": req.Query, + "sender_id": req.SenderId, + "from_message_id": req.FromMessageId, + "offset": req.Offset, + "limit": req.Limit, + "filter": req.Filter, + "message_thread_id": req.MessageThreadId, + "saved_messages_topic_id": req.SavedMessagesTopicId, }, }) if err != nil { @@ -2274,6 +2720,47 @@ func (client *Client) SearchSecretMessages(req *SearchSecretMessagesRequest) (*F return UnmarshalFoundMessages(result.Data) } +type SearchSavedMessagesRequest struct { + // If not 0, only messages in the specified Saved Messages topic will be considered; pass 0 to consider all messages + SavedMessagesTopicId int64 `json:"saved_messages_topic_id"` + // Tag to search for; pass null to return all suitable messages + Tag ReactionType `json:"tag"` + // Query to search for + Query string `json:"query"` + // Identifier of the message starting from which messages must be fetched; use 0 to get results from the last message + FromMessageId int64 `json:"from_message_id"` + // Specify 0 to get results from exactly the message from_message_id or a negative offset to get the specified message and some newer messages + Offset int32 `json:"offset"` + // The maximum number of messages to be returned; must be positive and can't be greater than 100. If the offset is negative, the limit must be greater than -offset. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit + Limit int32 `json:"limit"` +} + +// Searches for messages tagged by the given reaction and with the given words in the Saved Messages chat; for Telegram Premium users only. Returns the results in reverse chronological order, i.e. in order of decreasing message_id For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit +func (client *Client) SearchSavedMessages(req *SearchSavedMessagesRequest) (*FoundChatMessages, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "searchSavedMessages", + }, + Data: map[string]interface{}{ + "saved_messages_topic_id": req.SavedMessagesTopicId, + "tag": req.Tag, + "query": req.Query, + "from_message_id": req.FromMessageId, + "offset": req.Offset, + "limit": req.Limit, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalFoundChatMessages(result.Data) +} + type SearchCallMessagesRequest struct { // Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results Offset string `json:"offset"` @@ -2447,6 +2934,8 @@ type GetChatSparseMessagePositionsRequest struct { FromMessageId int64 `json:"from_message_id"` // The expected number of message positions to be returned; 50-2000. A smaller number of positions can be returned, if there are not enough appropriate messages Limit int32 `json:"limit"` + // If not 0, only messages in the specified Saved Messages topic will be considered; pass 0 to consider all messages, or for chats other than Saved Messages + SavedMessagesTopicId int64 `json:"saved_messages_topic_id"` } // Returns sparse positions of messages of the specified type in the chat to be used for shared media scroll implementation. Returns the results in reverse chronological order (i.e., in order of decreasing message_id). Cannot be used in secret chats or with searchMessagesFilterFailedToSend filter without an enabled message database @@ -2456,10 +2945,11 @@ func (client *Client) GetChatSparseMessagePositions(req *GetChatSparseMessagePos Type: "getChatSparseMessagePositions", }, Data: map[string]interface{}{ - "chat_id": req.ChatId, - "filter": req.Filter, - "from_message_id": req.FromMessageId, - "limit": req.Limit, + "chat_id": req.ChatId, + "filter": req.Filter, + "from_message_id": req.FromMessageId, + "limit": req.Limit, + "saved_messages_topic_id": req.SavedMessagesTopicId, }, }) if err != nil { @@ -2480,6 +2970,8 @@ type GetChatMessageCalendarRequest struct { Filter SearchMessagesFilter `json:"filter"` // The message identifier from which to return information about messages; use 0 to get results from the last message FromMessageId int64 `json:"from_message_id"` + // If not0, only messages in the specified Saved Messages topic will be considered; pass 0 to consider all messages, or for chats other than Saved Messages + SavedMessagesTopicId int64 `json:"saved_messages_topic_id"` } // Returns information about the next messages of the specified type in the chat split by days. Returns the results in reverse chronological order. Can return partial result for the last returned day. Behavior of this method depends on the value of the option "utc_time_offset" @@ -2489,9 +2981,10 @@ func (client *Client) GetChatMessageCalendar(req *GetChatMessageCalendarRequest) Type: "getChatMessageCalendar", }, Data: map[string]interface{}{ - "chat_id": req.ChatId, - "filter": req.Filter, - "from_message_id": req.FromMessageId, + "chat_id": req.ChatId, + "filter": req.Filter, + "from_message_id": req.FromMessageId, + "saved_messages_topic_id": req.SavedMessagesTopicId, }, }) if err != nil { @@ -2510,6 +3003,8 @@ type GetChatMessageCountRequest struct { ChatId int64 `json:"chat_id"` // Filter for message content; searchMessagesFilterEmpty is unsupported in this function Filter SearchMessagesFilter `json:"filter"` + // If not 0, only messages in the specified Saved Messages topic will be counted; pass 0 to count all messages, or for chats other than Saved Messages + SavedMessagesTopicId int64 `json:"saved_messages_topic_id"` // Pass true to get the number of messages without sending network requests, or -1 if the number of messages is unknown locally ReturnLocal bool `json:"return_local"` } @@ -2521,9 +3016,10 @@ func (client *Client) GetChatMessageCount(req *GetChatMessageCountRequest) (*Cou Type: "getChatMessageCount", }, Data: map[string]interface{}{ - "chat_id": req.ChatId, - "filter": req.Filter, - "return_local": req.ReturnLocal, + "chat_id": req.ChatId, + "filter": req.Filter, + "saved_messages_topic_id": req.SavedMessagesTopicId, + "return_local": req.ReturnLocal, }, }) if err != nil { @@ -2546,6 +3042,8 @@ type GetChatMessagePositionRequest struct { Filter SearchMessagesFilter `json:"filter"` // If not 0, only messages in the specified thread will be considered; supergroups only MessageThreadId int64 `json:"message_thread_id"` + // If not 0, only messages in the specified Saved Messages topic will be considered; pass 0 to consider all relevant messages, or for chats other than Saved Messages + SavedMessagesTopicId int64 `json:"saved_messages_topic_id"` } // Returns approximate 1-based position of a message among messages, which can be found by the specified filter in the chat. Cannot be used in secret chats @@ -2555,10 +3053,11 @@ func (client *Client) GetChatMessagePosition(req *GetChatMessagePositionRequest) Type: "getChatMessagePosition", }, Data: map[string]interface{}{ - "chat_id": req.ChatId, - "message_id": req.MessageId, - "filter": req.Filter, - "message_thread_id": req.MessageThreadId, + "chat_id": req.ChatId, + "message_id": req.MessageId, + "filter": req.Filter, + "message_thread_id": req.MessageThreadId, + "saved_messages_topic_id": req.SavedMessagesTopicId, }, }) if err != nil { @@ -2598,41 +3097,6 @@ func (client *Client) GetChatScheduledMessages(req *GetChatScheduledMessagesRequ return UnmarshalMessages(result.Data) } -type GetMessagePublicForwardsRequest struct { - // Chat identifier of the message - ChatId int64 `json:"chat_id"` - // Message identifier - MessageId int64 `json:"message_id"` - // Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results - Offset string `json:"offset"` - // The maximum number of messages to be returned; must be positive and can't be greater than 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit - Limit int32 `json:"limit"` -} - -// Returns forwarded copies of a channel message to different public channels. For optimal performance, the number of returned messages is chosen by TDLib -func (client *Client) GetMessagePublicForwards(req *GetMessagePublicForwardsRequest) (*FoundMessages, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "getMessagePublicForwards", - }, - Data: map[string]interface{}{ - "chat_id": req.ChatId, - "message_id": req.MessageId, - "offset": req.Offset, - "limit": req.Limit, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalFoundMessages(result.Data) -} - type GetChatSponsoredMessagesRequest struct { // Identifier of the chat ChatId int64 `json:"chat_id"` @@ -2659,6 +3123,85 @@ func (client *Client) GetChatSponsoredMessages(req *GetChatSponsoredMessagesRequ return UnmarshalSponsoredMessages(result.Data) } +type ClickChatSponsoredMessageRequest struct { + // Chat identifier of the sponsored message + ChatId int64 `json:"chat_id"` + // Identifier of the sponsored message + MessageId int64 `json:"message_id"` +} + +// Informs TDLib that the user opened the sponsored chat via the button, the name, the photo, or a mention in the sponsored message +func (client *Client) ClickChatSponsoredMessage(req *ClickChatSponsoredMessageRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "clickChatSponsoredMessage", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_id": req.MessageId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type ReportChatSponsoredMessageRequest struct { + // Chat identifier of the sponsored message + ChatId int64 `json:"chat_id"` + // Identifier of the sponsored message + MessageId int64 `json:"message_id"` + // Option identifier chosen by the user; leave empty for the initial request + OptionId []byte `json:"option_id"` +} + +// Reports a sponsored message to Telegram moderators +func (client *Client) ReportChatSponsoredMessage(req *ReportChatSponsoredMessageRequest) (ReportChatSponsoredMessageResult, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "reportChatSponsoredMessage", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_id": req.MessageId, + "option_id": req.OptionId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + switch result.Type { + case TypeReportChatSponsoredMessageResultOk: + return UnmarshalReportChatSponsoredMessageResultOk(result.Data) + + case TypeReportChatSponsoredMessageResultFailed: + return UnmarshalReportChatSponsoredMessageResultFailed(result.Data) + + case TypeReportChatSponsoredMessageResultOptionRequired: + return UnmarshalReportChatSponsoredMessageResultOptionRequired(result.Data) + + case TypeReportChatSponsoredMessageResultAdsHidden: + return UnmarshalReportChatSponsoredMessageResultAdsHidden(result.Data) + + case TypeReportChatSponsoredMessageResultPremiumRequired: + return UnmarshalReportChatSponsoredMessageResultPremiumRequired(result.Data) + + default: + return nil, errors.New("invalid type") + } +} + type RemoveNotificationRequest struct { // Identifier of notification group to which the notification belongs NotificationGroupId int32 `json:"notification_group_id"` @@ -2722,7 +3265,7 @@ type GetMessageLinkRequest struct { ChatId int64 `json:"chat_id"` // Identifier of the message MessageId int64 `json:"message_id"` - // If not 0, timestamp from which the video/audio/video note/voice note playing must start, in seconds. The media can be in the message content or in its web page preview + // If not 0, timestamp from which the video/audio/video note/voice note/story playing must start, in seconds. The media can be in the message content or in its web page preview MediaTimestamp int32 `json:"media_timestamp"` // Pass true to create a link for the whole media album ForAlbum bool `json:"for_album"` @@ -2815,23 +3358,20 @@ func (client *Client) GetMessageLinkInfo(req *GetMessageLinkInfoRequest) (*Messa type TranslateTextRequest struct { // Text to translate - Text string `json:"text"` - // A two-letter ISO 639-1 language code of the language from which the message is translated. If empty, the language will be detected automatically - FromLanguageCode string `json:"from_language_code"` - // A two-letter ISO 639-1 language code of the language to which the message is translated + Text *FormattedText `json:"text"` + // Language code of the language to which the message is translated. Must be one of "af", "sq", "am", "ar", "hy", "az", "eu", "be", "bn", "bs", "bg", "ca", "ceb", "zh-CN", "zh", "zh-Hans", "zh-TW", "zh-Hant", "co", "hr", "cs", "da", "nl", "en", "eo", "et", "fi", "fr", "fy", "gl", "ka", "de", "el", "gu", "ht", "ha", "haw", "he", "iw", "hi", "hmn", "hu", "is", "ig", "id", "in", "ga", "it", "ja", "jv", "kn", "kk", "km", "rw", "ko", "ku", "ky", "lo", "la", "lv", "lt", "lb", "mk", "mg", "ms", "ml", "mt", "mi", "mr", "mn", "my", "ne", "no", "ny", "or", "ps", "fa", "pl", "pt", "pa", "ro", "ru", "sm", "gd", "sr", "st", "sn", "sd", "si", "sk", "sl", "so", "es", "su", "sw", "sv", "tl", "tg", "ta", "tt", "te", "th", "tr", "tk", "uk", "ur", "ug", "uz", "vi", "cy", "xh", "yi", "ji", "yo", "zu" ToLanguageCode string `json:"to_language_code"` } -// Translates a text to the given language. Returns a 404 error if the translation can't be performed -func (client *Client) TranslateText(req *TranslateTextRequest) (*Text, error) { +// Translates a text to the given language. If the current user is a Telegram Premium user, then text formatting is preserved +func (client *Client) TranslateText(req *TranslateTextRequest) (*FormattedText, error) { result, err := client.Send(Request{ meta: meta{ Type: "translateText", }, Data: map[string]interface{}{ - "text": req.Text, - "from_language_code": req.FromLanguageCode, - "to_language_code": req.ToLanguageCode, + "text": req.Text, + "to_language_code": req.ToLanguageCode, }, }) if err != nil { @@ -2842,7 +3382,39 @@ func (client *Client) TranslateText(req *TranslateTextRequest) (*Text, error) { return nil, buildResponseError(result.Data) } - return UnmarshalText(result.Data) + return UnmarshalFormattedText(result.Data) +} + +type TranslateMessageTextRequest struct { + // Identifier of the chat to which the message belongs + ChatId int64 `json:"chat_id"` + // Identifier of the message + MessageId int64 `json:"message_id"` + // Language code of the language to which the message is translated. Must be one of "af", "sq", "am", "ar", "hy", "az", "eu", "be", "bn", "bs", "bg", "ca", "ceb", "zh-CN", "zh", "zh-Hans", "zh-TW", "zh-Hant", "co", "hr", "cs", "da", "nl", "en", "eo", "et", "fi", "fr", "fy", "gl", "ka", "de", "el", "gu", "ht", "ha", "haw", "he", "iw", "hi", "hmn", "hu", "is", "ig", "id", "in", "ga", "it", "ja", "jv", "kn", "kk", "km", "rw", "ko", "ku", "ky", "lo", "la", "lv", "lt", "lb", "mk", "mg", "ms", "ml", "mt", "mi", "mr", "mn", "my", "ne", "no", "ny", "or", "ps", "fa", "pl", "pt", "pa", "ro", "ru", "sm", "gd", "sr", "st", "sn", "sd", "si", "sk", "sl", "so", "es", "su", "sw", "sv", "tl", "tg", "ta", "tt", "te", "th", "tr", "tk", "uk", "ur", "ug", "uz", "vi", "cy", "xh", "yi", "ji", "yo", "zu" + ToLanguageCode string `json:"to_language_code"` +} + +// Extracts text or caption of the given message and translates it to the given language. If the current user is a Telegram Premium user, then text formatting is preserved +func (client *Client) TranslateMessageText(req *TranslateMessageTextRequest) (*FormattedText, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "translateMessageText", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_id": req.MessageId, + "to_language_code": req.ToLanguageCode, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalFormattedText(result.Data) } type RecognizeSpeechRequest struct { @@ -2852,7 +3424,7 @@ type RecognizeSpeechRequest struct { MessageId int64 `json:"message_id"` } -// Recognizes speech in a video note or a voice note message. The message must be successfully sent and must not be scheduled. May return an error with a message "MSG_VOICE_TOO_LONG" if media duration is too big to be recognized +// Recognizes speech in a video note or a voice note message. The message must be successfully sent, must not be scheduled, and must be from a non-secret chat func (client *Client) RecognizeSpeech(req *RecognizeSpeechRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -2964,10 +3536,10 @@ func (client *Client) SetChatMessageSender(req *SetChatMessageSenderRequest) (*O type SendMessageRequest struct { // Target chat ChatId int64 `json:"chat_id"` - // If not 0, a message thread identifier in which the message will be sent + // If not 0, the message thread identifier in which the message will be sent MessageThreadId int64 `json:"message_thread_id"` - // Identifier of the replied message; 0 if none - ReplyToMessageId int64 `json:"reply_to_message_id"` + // Information about the message or story to be replied; pass null if none + ReplyTo InputMessageReplyTo `json:"reply_to"` // Options to be used to send the message; pass null to use default options Options *MessageSendOptions `json:"options"` // Markup for replying to the message; pass null if none; for bots only @@ -2985,7 +3557,7 @@ func (client *Client) SendMessage(req *SendMessageRequest) (*Message, error) { Data: map[string]interface{}{ "chat_id": req.ChatId, "message_thread_id": req.MessageThreadId, - "reply_to_message_id": req.ReplyToMessageId, + "reply_to": req.ReplyTo, "options": req.Options, "reply_markup": req.ReplyMarkup, "input_message_content": req.InputMessageContent, @@ -3005,16 +3577,14 @@ func (client *Client) SendMessage(req *SendMessageRequest) (*Message, error) { type SendMessageAlbumRequest struct { // Target chat ChatId int64 `json:"chat_id"` - // If not 0, a message thread identifier in which the messages will be sent + // If not 0, the message thread identifier in which the messages will be sent MessageThreadId int64 `json:"message_thread_id"` - // Identifier of a replied message; 0 if none - ReplyToMessageId int64 `json:"reply_to_message_id"` + // Information about the message or story to be replied; pass null if none + ReplyTo InputMessageReplyTo `json:"reply_to"` // Options to be used to send the messages; pass null to use default options Options *MessageSendOptions `json:"options"` // Contents of messages to be sent. At most 10 messages can be added to an album InputMessageContents []InputMessageContent `json:"input_message_contents"` - // Pass true to get fake messages instead of actually sending them - OnlyPreview bool `json:"only_preview"` } // Sends 2-10 messages grouped together into an album. Currently, only audio, document, photo and video messages can be grouped into an album. Documents and audio files can be only grouped in an album with messages of the same type. Returns sent messages @@ -3026,10 +3596,9 @@ func (client *Client) SendMessageAlbum(req *SendMessageAlbumRequest) (*Messages, Data: map[string]interface{}{ "chat_id": req.ChatId, "message_thread_id": req.MessageThreadId, - "reply_to_message_id": req.ReplyToMessageId, + "reply_to": req.ReplyTo, "options": req.Options, "input_message_contents": req.InputMessageContents, - "only_preview": req.OnlyPreview, }, }) if err != nil { @@ -3052,7 +3621,7 @@ type SendBotStartMessageRequest struct { Parameter string `json:"parameter"` } -// Invites a bot to a chat (if it is not yet a member) and sends it the /start command. Bots can't be invited to a private chat other than the chat with the bot. Bots can't be invited to channels (although they can be added as admins) and secret chats. Returns the sent message +// Invites a bot to a chat (if it is not yet a member) and sends it the /start command; requires can_invite_users member right. Bots can't be invited to a private chat other than the chat with the bot. Bots can't be invited to channels (although they can be added as admins) and secret chats. Returns the sent message func (client *Client) SendBotStartMessage(req *SendBotStartMessageRequest) (*Message, error) { result, err := client.Send(Request{ meta: meta{ @@ -3078,15 +3647,15 @@ func (client *Client) SendBotStartMessage(req *SendBotStartMessageRequest) (*Mes type SendInlineQueryResultMessageRequest struct { // Target chat ChatId int64 `json:"chat_id"` - // If not 0, a message thread identifier in which the message will be sent + // If not 0, the message thread identifier in which the message will be sent MessageThreadId int64 `json:"message_thread_id"` - // Identifier of a replied message; 0 if none - ReplyToMessageId int64 `json:"reply_to_message_id"` + // Information about the message or story to be replied; pass null if none + ReplyTo InputMessageReplyTo `json:"reply_to"` // Options to be used to send the message; pass null to use default options Options *MessageSendOptions `json:"options"` // Identifier of the inline query QueryId JsonInt64 `json:"query_id"` - // Identifier of the inline result + // Identifier of the inline query result ResultId string `json:"result_id"` // Pass true to hide the bot, via which the message is sent. Can be used only for bots getOption("animation_search_bot_username"), getOption("photo_search_bot_username"), and getOption("venue_search_bot_username") HideViaBot bool `json:"hide_via_bot"` @@ -3099,13 +3668,13 @@ func (client *Client) SendInlineQueryResultMessage(req *SendInlineQueryResultMes Type: "sendInlineQueryResultMessage", }, Data: map[string]interface{}{ - "chat_id": req.ChatId, - "message_thread_id": req.MessageThreadId, - "reply_to_message_id": req.ReplyToMessageId, - "options": req.Options, - "query_id": req.QueryId, - "result_id": req.ResultId, - "hide_via_bot": req.HideViaBot, + "chat_id": req.ChatId, + "message_thread_id": req.MessageThreadId, + "reply_to": req.ReplyTo, + "options": req.Options, + "query_id": req.QueryId, + "result_id": req.ResultId, + "hide_via_bot": req.HideViaBot, }, }) if err != nil { @@ -3122,11 +3691,11 @@ func (client *Client) SendInlineQueryResultMessage(req *SendInlineQueryResultMes type ForwardMessagesRequest struct { // Identifier of the chat to which to forward messages ChatId int64 `json:"chat_id"` - // If not 0, a message thread identifier in which the message will be sent; for forum threads only + // If not 0, the message thread identifier in which the message will be sent; for forum threads only MessageThreadId int64 `json:"message_thread_id"` // Identifier of the chat from which to forward messages FromChatId int64 `json:"from_chat_id"` - // Identifiers of the messages to forward. Message identifiers must be in a strictly increasing order. At most 100 messages can be forwarded simultaneously + // Identifiers of the messages to forward. Message identifiers must be in a strictly increasing order. At most 100 messages can be forwarded simultaneously. A message can be forwarded only if message.can_be_forwarded MessageIds []int64 `json:"message_ids"` // Options to be used to send the messages; pass null to use default options Options *MessageSendOptions `json:"options"` @@ -3134,8 +3703,6 @@ type ForwardMessagesRequest struct { SendCopy bool `json:"send_copy"` // Pass true to remove media captions of message copies. Ignored if send_copy is false RemoveCaption bool `json:"remove_caption"` - // Pass true to get fake messages instead of actually forwarding them - OnlyPreview bool `json:"only_preview"` } // Forwards previously sent messages. Returns the forwarded messages in the same order as the message identifiers passed in message_ids. If a message can't be forwarded, null will be returned instead of the message @@ -3152,7 +3719,38 @@ func (client *Client) ForwardMessages(req *ForwardMessagesRequest) (*Messages, e "options": req.Options, "send_copy": req.SendCopy, "remove_caption": req.RemoveCaption, - "only_preview": req.OnlyPreview, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalMessages(result.Data) +} + +type SendQuickReplyShortcutMessagesRequest struct { + // Identifier of the chat to which to send messages. The chat must be a private chat with a regular user + ChatId int64 `json:"chat_id"` + // Unique identifier of the quick reply shortcut + ShortcutId int32 `json:"shortcut_id"` + // Non-persistent identifier, which will be returned back in messageSendingStatePending object and can be used to match sent messages and corresponding updateNewMessage updates + SendingId int32 `json:"sending_id"` +} + +// Sends messages from a quick reply shortcut. Requires Telegram Business subscription +func (client *Client) SendQuickReplyShortcutMessages(req *SendQuickReplyShortcutMessagesRequest) (*Messages, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "sendQuickReplyShortcutMessages", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "shortcut_id": req.ShortcutId, + "sending_id": req.SendingId, }, }) if err != nil { @@ -3171,6 +3769,8 @@ type ResendMessagesRequest struct { ChatId int64 `json:"chat_id"` // Identifiers of the messages to resend. Message identifiers must be in a strictly increasing order MessageIds []int64 `json:"message_ids"` + // New manually chosen quote from the message to be replied; pass null if none. Ignored if more than one message is re-sent, or if messageSendingStateFailed.need_another_reply_quote == false + Quote *InputTextQuote `json:"quote"` } // Resends messages which failed to send. Can be called only for messages for which messageSendingStateFailed.can_retry is true and after specified in messageSendingStateFailed.retry_after time passed. If a message is re-sent, the corresponding failed to send message is deleted. Returns the sent messages in the same order as the message identifiers passed in message_ids. If a message can't be re-sent, null will be returned instead of the message @@ -3182,6 +3782,7 @@ func (client *Client) ResendMessages(req *ResendMessagesRequest) (*Messages, err Data: map[string]interface{}{ "chat_id": req.ChatId, "message_ids": req.MessageIds, + "quote": req.Quote, }, }) if err != nil { @@ -3195,39 +3796,13 @@ func (client *Client) ResendMessages(req *ResendMessagesRequest) (*Messages, err return UnmarshalMessages(result.Data) } -type SendChatScreenshotTakenNotificationRequest struct { - // Chat identifier - ChatId int64 `json:"chat_id"` -} - -// Sends a notification about a screenshot taken in a chat. Supported only in private and secret chats -func (client *Client) SendChatScreenshotTakenNotification(req *SendChatScreenshotTakenNotificationRequest) (*Ok, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "sendChatScreenshotTakenNotification", - }, - Data: map[string]interface{}{ - "chat_id": req.ChatId, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalOk(result.Data) -} - type AddLocalMessageRequest struct { // Target chat ChatId int64 `json:"chat_id"` // Identifier of the sender of the message SenderId MessageSender `json:"sender_id"` - // Identifier of the replied message; 0 if none - ReplyToMessageId int64 `json:"reply_to_message_id"` + // Information about the message or story to be replied; pass null if none + ReplyTo InputMessageReplyTo `json:"reply_to"` // Pass true to disable notification for the message DisableNotification bool `json:"disable_notification"` // The content of the message to be added @@ -3243,7 +3818,7 @@ func (client *Client) AddLocalMessage(req *AddLocalMessageRequest) (*Message, er Data: map[string]interface{}{ "chat_id": req.ChatId, "sender_id": req.SenderId, - "reply_to_message_id": req.ReplyToMessageId, + "reply_to": req.ReplyTo, "disable_notification": req.DisableNotification, "input_message_content": req.InputMessageContent, }, @@ -3728,6 +4303,272 @@ func (client *Client) EditMessageSchedulingState(req *EditMessageSchedulingState return UnmarshalOk(result.Data) } +type SendBusinessMessageRequest struct { + // Unique identifier of business connection on behalf of which to send the request + BusinessConnectionId string `json:"business_connection_id"` + // Target chat + ChatId int64 `json:"chat_id"` + // Information about the message to be replied; pass null if none + ReplyTo InputMessageReplyTo `json:"reply_to"` + // Pass true to disable notification for the message + DisableNotification bool `json:"disable_notification"` + // Pass true if the content of the message must be protected from forwarding and saving + ProtectContent bool `json:"protect_content"` + // Markup for replying to the message; pass null if none + ReplyMarkup ReplyMarkup `json:"reply_markup"` + // The content of the message to be sent + InputMessageContent InputMessageContent `json:"input_message_content"` +} + +// Sends a message on behalf of a business account; for bots only. Returns the message after it was sent +func (client *Client) SendBusinessMessage(req *SendBusinessMessageRequest) (*BusinessMessage, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "sendBusinessMessage", + }, + Data: map[string]interface{}{ + "business_connection_id": req.BusinessConnectionId, + "chat_id": req.ChatId, + "reply_to": req.ReplyTo, + "disable_notification": req.DisableNotification, + "protect_content": req.ProtectContent, + "reply_markup": req.ReplyMarkup, + "input_message_content": req.InputMessageContent, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalBusinessMessage(result.Data) +} + +type SendBusinessMessageAlbumRequest struct { + // Unique identifier of business connection on behalf of which to send the request + BusinessConnectionId string `json:"business_connection_id"` + // Target chat + ChatId int64 `json:"chat_id"` + // Information about the message to be replied; pass null if none + ReplyTo InputMessageReplyTo `json:"reply_to"` + // Pass true to disable notification for the message + DisableNotification bool `json:"disable_notification"` + // Pass true if the content of the message must be protected from forwarding and saving + ProtectContent bool `json:"protect_content"` + // Contents of messages to be sent. At most 10 messages can be added to an album + InputMessageContents []InputMessageContent `json:"input_message_contents"` +} + +// Sends 2-10 messages grouped together into an album on behalf of a business account; for bots only. Currently, only audio, document, photo and video messages can be grouped into an album. Documents and audio files can be only grouped in an album with messages of the same type. Returns sent messages +func (client *Client) SendBusinessMessageAlbum(req *SendBusinessMessageAlbumRequest) (*BusinessMessages, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "sendBusinessMessageAlbum", + }, + Data: map[string]interface{}{ + "business_connection_id": req.BusinessConnectionId, + "chat_id": req.ChatId, + "reply_to": req.ReplyTo, + "disable_notification": req.DisableNotification, + "protect_content": req.ProtectContent, + "input_message_contents": req.InputMessageContents, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalBusinessMessages(result.Data) +} + +type CheckQuickReplyShortcutNameRequest struct { + // The name of the shortcut; 1-32 characters + Name string `json:"name"` +} + +// Checks validness of a name for a quick reply shortcut. Can be called synchronously +func (client *Client) CheckQuickReplyShortcutName(req *CheckQuickReplyShortcutNameRequest) (*Ok, error) { + result, err := client.jsonClient.Execute(Request{ + meta: meta{ + Type: "checkQuickReplyShortcutName", + }, + Data: map[string]interface{}{ + "name": req.Name, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +// Loads quick reply shortcuts created by the current user. The loaded topics will be sent through updateQuickReplyShortcuts +func (client *Client) LoadQuickReplyShortcuts() (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "loadQuickReplyShortcuts", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type SetQuickReplyShortcutNameRequest struct { + // Unique identifier of the quick reply shortcut + ShortcutId int32 `json:"shortcut_id"` + // New name for the shortcut. Use checkQuickReplyShortcutName to check its validness + Name string `json:"name"` +} + +// Changes name of a quick reply shortcut +func (client *Client) SetQuickReplyShortcutName(req *SetQuickReplyShortcutNameRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setQuickReplyShortcutName", + }, + Data: map[string]interface{}{ + "shortcut_id": req.ShortcutId, + "name": req.Name, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type DeleteQuickReplyShortcutRequest struct { + // Unique identifier of the quick reply shortcut + ShortcutId int32 `json:"shortcut_id"` +} + +// Deletes a quick reply shortcut +func (client *Client) DeleteQuickReplyShortcut(req *DeleteQuickReplyShortcutRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "deleteQuickReplyShortcut", + }, + Data: map[string]interface{}{ + "shortcut_id": req.ShortcutId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type ReorderQuickReplyShortcutsRequest struct { + // The new order of quick reply shortcuts + ShortcutIds []int32 `json:"shortcut_ids"` +} + +// Changes the order of quick reply shortcuts +func (client *Client) ReorderQuickReplyShortcuts(req *ReorderQuickReplyShortcutsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "reorderQuickReplyShortcuts", + }, + Data: map[string]interface{}{ + "shortcut_ids": req.ShortcutIds, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type LoadQuickReplyShortcutMessagesRequest struct { + // Unique identifier of the quick reply shortcut + ShortcutId int32 `json:"shortcut_id"` +} + +// Loads quick reply messages that can be sent by a given quick reply shortcut. The loaded messages will be sent through updateQuickReplyShortcutMessages +func (client *Client) LoadQuickReplyShortcutMessages(req *LoadQuickReplyShortcutMessagesRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "loadQuickReplyShortcutMessages", + }, + Data: map[string]interface{}{ + "shortcut_id": req.ShortcutId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type DeleteQuickReplyShortcutMessagesRequest struct { + // Unique identifier of the quick reply shortcut to which the messages belong + ShortcutId int32 `json:"shortcut_id"` + // Unique identifiers of the messages + MessageIds []int64 `json:"message_ids"` +} + +// Deletes specified quick reply messages +func (client *Client) DeleteQuickReplyShortcutMessages(req *DeleteQuickReplyShortcutMessagesRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "deleteQuickReplyShortcutMessages", + }, + Data: map[string]interface{}{ + "shortcut_id": req.ShortcutId, + "message_ids": req.MessageIds, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + // Returns list of custom emojis, which can be used as forum topic icon by all users func (client *Client) GetForumTopicDefaultIcons() (*Stickers, error) { result, err := client.Send(Request{ @@ -3756,7 +4597,7 @@ type CreateForumTopicRequest struct { Icon *ForumTopicIcon `json:"icon"` } -// Creates a topic in a forum supergroup chat; requires can_manage_topics rights in the supergroup +// Creates a topic in a forum supergroup chat; requires can_manage_topics administrator or can_create_topics member right in the supergroup func (client *Client) CreateForumTopic(req *CreateForumTopicRequest) (*ForumTopicInfo, error) { result, err := client.Send(Request{ meta: meta{ @@ -3792,7 +4633,7 @@ type EditForumTopicRequest struct { IconCustomEmojiId JsonInt64 `json:"icon_custom_emoji_id"` } -// Edits title and icon of a topic in a forum supergroup chat; requires can_manage_topics administrator right in the supergroup unless the user is creator of the topic +// Edits title and icon of a topic in a forum supergroup chat; requires can_manage_topics right in the supergroup unless the user is creator of the topic func (client *Client) EditForumTopic(req *EditForumTopicRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -3957,7 +4798,7 @@ type ToggleForumTopicIsClosedRequest struct { IsClosed bool `json:"is_closed"` } -// Toggles whether a topic is closed in a forum supergroup chat; requires can_manage_topics administrator right in the supergroup unless the user is creator of the topic +// Toggles whether a topic is closed in a forum supergroup chat; requires can_manage_topics right in the supergroup unless the user is creator of the topic func (client *Client) ToggleForumTopicIsClosed(req *ToggleForumTopicIsClosedRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -3987,7 +4828,7 @@ type ToggleGeneralForumTopicIsHiddenRequest struct { IsHidden bool `json:"is_hidden"` } -// Toggles whether a General topic is hidden in a forum supergroup chat; requires can_manage_topics administrator right in the supergroup +// Toggles whether a General topic is hidden in a forum supergroup chat; requires can_manage_topics right in the supergroup func (client *Client) ToggleGeneralForumTopicIsHidden(req *ToggleGeneralForumTopicIsHiddenRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -4018,7 +4859,7 @@ type ToggleForumTopicIsPinnedRequest struct { IsPinned bool `json:"is_pinned"` } -// Changes the pinned state of a forum topic; requires can_manage_topics administrator right in the supergroup. There can be up to getOption("pinned_forum_topic_count_max") pinned forum topics +// Changes the pinned state of a forum topic; requires can_manage_topics right in the supergroup. There can be up to getOption("pinned_forum_topic_count_max") pinned forum topics func (client *Client) ToggleForumTopicIsPinned(req *ToggleForumTopicIsPinnedRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -4048,7 +4889,7 @@ type SetPinnedForumTopicsRequest struct { MessageThreadIds []int64 `json:"message_thread_ids"` } -// Changes the order of pinned forum topics +// Changes the order of pinned forum topics; requires can_manage_topics right in the supergroup func (client *Client) SetPinnedForumTopics(req *SetPinnedForumTopicsRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -4104,7 +4945,7 @@ type GetEmojiReactionRequest struct { Emoji string `json:"emoji"` } -// Returns information about a emoji reaction. Returns a 404 error if the reaction is not found +// Returns information about an emoji reaction. Returns a 404 error if the reaction is not found func (client *Client) GetEmojiReaction(req *GetEmojiReactionRequest) (*EmojiReaction, error) { result, err := client.Send(Request{ meta: meta{ @@ -4204,11 +5045,11 @@ type AddMessageReactionRequest struct { ReactionType ReactionType `json:"reaction_type"` // Pass true if the reaction is added with a big animation IsBig bool `json:"is_big"` - // Pass true if the reaction needs to be added to recent reactions + // Pass true if the reaction needs to be added to recent reactions; tags are never added to the list of recent reactions UpdateRecentReactions bool `json:"update_recent_reactions"` } -// Adds a reaction to a message. Use getMessageAvailableReactions to receive the list of available reactions for the message +// Adds a reaction or a tag to a message. Use getMessageAvailableReactions to receive the list of available reactions for the message func (client *Client) AddMessageReaction(req *AddMessageReactionRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -4265,6 +5106,41 @@ func (client *Client) RemoveMessageReaction(req *RemoveMessageReactionRequest) ( return UnmarshalOk(result.Data) } +type SetMessageReactionsRequest struct { + // Identifier of the chat to which the message belongs + ChatId int64 `json:"chat_id"` + // Identifier of the message + MessageId int64 `json:"message_id"` + // Types of the reaction to set + ReactionTypes []ReactionType `json:"reaction_types"` + // Pass true if the reactions are added with a big animation + IsBig bool `json:"is_big"` +} + +// Sets reactions on a message; for bots only +func (client *Client) SetMessageReactions(req *SetMessageReactionsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setMessageReactions", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_id": req.MessageId, + "reaction_types": req.ReactionTypes, + "is_big": req.IsBig, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type GetMessageAddedReactionsRequest struct { // Identifier of the chat to which the message belongs ChatId int64 `json:"chat_id"` @@ -4329,8 +5205,95 @@ func (client *Client) SetDefaultReactionType(req *SetDefaultReactionTypeRequest) return UnmarshalOk(result.Data) } +type GetSavedMessagesTagsRequest struct { + // Identifier of Saved Messages topic which tags will be returned; pass 0 to get all Saved Messages tags + SavedMessagesTopicId int64 `json:"saved_messages_topic_id"` +} + +// Returns tags used in Saved Messages or a Saved Messages topic +func (client *Client) GetSavedMessagesTags(req *GetSavedMessagesTagsRequest) (*SavedMessagesTags, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getSavedMessagesTags", + }, + Data: map[string]interface{}{ + "saved_messages_topic_id": req.SavedMessagesTopicId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalSavedMessagesTags(result.Data) +} + +type SetSavedMessagesTagLabelRequest struct { + // The tag which label will be changed + Tag ReactionType `json:"tag"` + // New label for the tag; 0-12 characters + Label string `json:"label"` +} + +// Changes label of a Saved Messages tag; for Telegram Premium users only +func (client *Client) SetSavedMessagesTagLabel(req *SetSavedMessagesTagLabelRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setSavedMessagesTagLabel", + }, + Data: map[string]interface{}{ + "tag": req.Tag, + "label": req.Label, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type SearchQuoteRequest struct { + // Text in which to search for the quote + Text *FormattedText `json:"text"` + // Quote to search for + Quote *FormattedText `json:"quote"` + // Approximate quote position in UTF-16 code units + QuotePosition int32 `json:"quote_position"` +} + +// Searches for a given quote in a text. Returns found quote start position in UTF-16 code units. Returns a 404 error if the quote is not found. Can be called synchronously +func (client *Client) SearchQuote(req *SearchQuoteRequest) (*FoundPosition, error) { + result, err := client.jsonClient.Execute(Request{ + meta: meta{ + Type: "searchQuote", + }, + Data: map[string]interface{}{ + "text": req.Text, + "quote": req.Quote, + "quote_position": req.QuotePosition, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalFoundPosition(result.Data) +} + type GetTextEntitiesRequest struct { - // The text in which to look for entites + // The text in which to look for entities Text string `json:"text"` } @@ -4362,7 +5325,7 @@ type ParseTextEntitiesRequest struct { ParseMode TextParseMode `json:"parse_mode"` } -// Parses Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, Code, Pre, PreCode, TextUrl and MentionName entities from a marked-up text. Can be called synchronously +// Parses Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, BlockQuote, Code, Pre, PreCode, TextUrl and MentionName entities from a marked-up text. Can be called synchronously func (client *Client) ParseTextEntities(req *ParseTextEntitiesRequest) (*FormattedText, error) { result, err := client.jsonClient.Execute(Request{ meta: meta{ @@ -4436,6 +5399,32 @@ func (client *Client) GetMarkdownText(req *GetMarkdownTextRequest) (*FormattedTe return UnmarshalFormattedText(result.Data) } +type GetCountryFlagEmojiRequest struct { + // A two-letter ISO 3166-1 alpha-2 country code as received from getCountries + CountryCode string `json:"country_code"` +} + +// Returns an emoji for the given country. Returns an empty string on failure. Can be called synchronously +func (client *Client) GetCountryFlagEmoji(req *GetCountryFlagEmojiRequest) (*Text, error) { + result, err := client.jsonClient.Execute(Request{ + meta: meta{ + Type: "getCountryFlagEmoji", + }, + Data: map[string]interface{}{ + "country_code": req.CountryCode, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalText(result.Data) +} + type GetFileMimeTypeRequest struct { // The name of the file or path to the file FileName string `json:"file_name"` @@ -4699,14 +5688,14 @@ type GetPollVotersRequest struct { MessageId int64 `json:"message_id"` // 0-based identifier of the answer option OptionId int32 `json:"option_id"` - // Number of users to skip in the result; must be non-negative + // Number of voters to skip in the result; must be non-negative Offset int32 `json:"offset"` - // The maximum number of users to be returned; must be positive and can't be greater than 50. For optimal performance, the number of returned users is chosen by TDLib and can be smaller than the specified limit, even if the end of the voter list has not been reached + // The maximum number of voters to be returned; must be positive and can't be greater than 50. For optimal performance, the number of returned voters is chosen by TDLib and can be smaller than the specified limit, even if the end of the voter list has not been reached Limit int32 `json:"limit"` } -// Returns users voted for the specified option in a non-anonymous polls. For optimal performance, the number of returned users is chosen by TDLib -func (client *Client) GetPollVoters(req *GetPollVotersRequest) (*Users, error) { +// Returns message senders voted for the specified option in a non-anonymous polls. For optimal performance, the number of returned users is chosen by TDLib +func (client *Client) GetPollVoters(req *GetPollVotersRequest) (*MessageSenders, error) { result, err := client.Send(Request{ meta: meta{ Type: "getPollVoters", @@ -4727,7 +5716,7 @@ func (client *Client) GetPollVoters(req *GetPollVotersRequest) (*Users, error) { return nil, buildResponseError(result.Data) } - return UnmarshalUsers(result.Data) + return UnmarshalMessageSenders(result.Data) } type StopPollRequest struct { @@ -4739,7 +5728,7 @@ type StopPollRequest struct { ReplyMarkup ReplyMarkup `json:"reply_markup"` } -// Stops a poll. A poll in a message can be stopped when the message has can_be_edited flag set +// Stops a poll. A poll in a message can be stopped when the message has can_be_edited flag is set func (client *Client) StopPoll(req *StopPollRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -4788,6 +5777,32 @@ func (client *Client) HideSuggestedAction(req *HideSuggestedActionRequest) (*Ok, return UnmarshalOk(result.Data) } +type GetBusinessConnectionRequest struct { + // Identifier of the business connection to return + ConnectionId string `json:"connection_id"` +} + +// Returns information about a business connection by its identifier; for bots only +func (client *Client) GetBusinessConnection(req *GetBusinessConnectionRequest) (*BusinessConnection, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getBusinessConnection", + }, + Data: map[string]interface{}{ + "connection_id": req.ConnectionId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalBusinessConnection(result.Data) +} + type GetLoginUrlInfoRequest struct { // Chat identifier of the message with the button ChatId int64 `json:"chat_id"` @@ -4864,8 +5879,84 @@ func (client *Client) GetLoginUrl(req *GetLoginUrlRequest) (*HttpUrl, error) { return UnmarshalHttpUrl(result.Data) } +type ShareUsersWithBotRequest struct { + // Identifier of the chat with the bot + ChatId int64 `json:"chat_id"` + // Identifier of the message with the button + MessageId int64 `json:"message_id"` + // Identifier of the button + ButtonId int32 `json:"button_id"` + // Identifiers of the shared users + SharedUserIds []int64 `json:"shared_user_ids"` + // Pass true to check that the users can be shared by the button instead of actually sharing them + OnlyCheck bool `json:"only_check"` +} + +// Shares users after pressing a keyboardButtonTypeRequestUsers button with the bot +func (client *Client) ShareUsersWithBot(req *ShareUsersWithBotRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "shareUsersWithBot", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_id": req.MessageId, + "button_id": req.ButtonId, + "shared_user_ids": req.SharedUserIds, + "only_check": req.OnlyCheck, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type ShareChatWithBotRequest struct { + // Identifier of the chat with the bot + ChatId int64 `json:"chat_id"` + // Identifier of the message with the button + MessageId int64 `json:"message_id"` + // Identifier of the button + ButtonId int32 `json:"button_id"` + // Identifier of the shared chat + SharedChatId int64 `json:"shared_chat_id"` + // Pass true to check that the chat can be shared by the button instead of actually sharing it. Doesn't check bot_is_member and bot_administrator_rights restrictions. If the bot must be a member, then all chats from getGroupsInCommon and all chats, where the user can add the bot, are suitable. In the latter case the bot will be automatically added to the chat. If the bot must be an administrator, then all chats, where the bot already has requested rights or can be added to administrators by the user, are suitable. In the latter case the bot will be automatically granted requested rights + OnlyCheck bool `json:"only_check"` +} + +// Shares a chat after pressing a keyboardButtonTypeRequestChat button with the bot +func (client *Client) ShareChatWithBot(req *ShareChatWithBotRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "shareChatWithBot", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_id": req.MessageId, + "button_id": req.ButtonId, + "shared_chat_id": req.SharedChatId, + "only_check": req.OnlyCheck, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type GetInlineQueryResultsRequest struct { - // The identifier of the target bot + // Identifier of the target bot BotUserId int64 `json:"bot_user_id"` // Identifier of the chat where the query was sent ChatId int64 `json:"chat_id"` @@ -4873,7 +5964,7 @@ type GetInlineQueryResultsRequest struct { UserLocation *Location `json:"user_location"` // Text of the query Query string `json:"query"` - // Offset of the first entry to return + // Offset of the first entry to return; use empty string to get the first chunk of results Offset string `json:"offset"` } @@ -4907,16 +5998,14 @@ type AnswerInlineQueryRequest struct { InlineQueryId JsonInt64 `json:"inline_query_id"` // Pass true if results may be cached and returned only for the user that sent the query. By default, results may be returned to any user who sends the same query IsPersonal bool `json:"is_personal"` + // Button to be shown above inline query results; pass null if none + Button *InlineQueryResultsButton `json:"button"` // The results of the query Results []InputInlineQueryResult `json:"results"` // Allowed time to cache the results of the query, in seconds CacheTime int32 `json:"cache_time"` // Offset for the next inline query; pass an empty string if there are no more results NextOffset string `json:"next_offset"` - // If non-empty, this text must be shown on the button that opens a private chat with the bot and sends a start message to the bot with the parameter switch_pm_parameter - SwitchPmText string `json:"switch_pm_text"` - // The parameter for the bot start message - SwitchPmParameter string `json:"switch_pm_parameter"` } // Sets the result of an inline query; for bots only @@ -4926,13 +6015,12 @@ func (client *Client) AnswerInlineQuery(req *AnswerInlineQueryRequest) (*Ok, err Type: "answerInlineQuery", }, Data: map[string]interface{}{ - "inline_query_id": req.InlineQueryId, - "is_personal": req.IsPersonal, - "results": req.Results, - "cache_time": req.CacheTime, - "next_offset": req.NextOffset, - "switch_pm_text": req.SwitchPmText, - "switch_pm_parameter": req.SwitchPmParameter, + "inline_query_id": req.InlineQueryId, + "is_personal": req.IsPersonal, + "button": req.Button, + "results": req.Results, + "cache_time": req.CacheTime, + "next_offset": req.NextOffset, }, }) if err != nil { @@ -4946,10 +6034,83 @@ func (client *Client) AnswerInlineQuery(req *AnswerInlineQueryRequest) (*Ok, err return UnmarshalOk(result.Data) } +type SearchWebAppRequest struct { + // Identifier of the target bot + BotUserId int64 `json:"bot_user_id"` + // Short name of the Web App + WebAppShortName string `json:"web_app_short_name"` +} + +// Returns information about a Web App by its short name. Returns a 404 error if the Web App is not found +func (client *Client) SearchWebApp(req *SearchWebAppRequest) (*FoundWebApp, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "searchWebApp", + }, + Data: map[string]interface{}{ + "bot_user_id": req.BotUserId, + "web_app_short_name": req.WebAppShortName, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalFoundWebApp(result.Data) +} + +type GetWebAppLinkUrlRequest struct { + // Identifier of the chat in which the link was clicked; pass 0 if none + ChatId int64 `json:"chat_id"` + // Identifier of the target bot + BotUserId int64 `json:"bot_user_id"` + // Short name of the Web App + WebAppShortName string `json:"web_app_short_name"` + // Start parameter from internalLinkTypeWebApp + StartParameter string `json:"start_parameter"` + // Preferred Web App theme; pass null to use the default theme + Theme *ThemeParameters `json:"theme"` + // Short name of the application; 0-64 English letters, digits, and underscores + ApplicationName string `json:"application_name"` + // Pass true if the current user allowed the bot to send them messages + AllowWriteAccess bool `json:"allow_write_access"` +} + +// Returns an HTTPS URL of a Web App to open after a link of the type internalLinkTypeWebApp is clicked +func (client *Client) GetWebAppLinkUrl(req *GetWebAppLinkUrlRequest) (*HttpUrl, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getWebAppLinkUrl", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "bot_user_id": req.BotUserId, + "web_app_short_name": req.WebAppShortName, + "start_parameter": req.StartParameter, + "theme": req.Theme, + "application_name": req.ApplicationName, + "allow_write_access": req.AllowWriteAccess, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalHttpUrl(result.Data) +} + type GetWebAppUrlRequest struct { // Identifier of the target bot BotUserId int64 `json:"bot_user_id"` - // The URL from the keyboardButtonTypeWebApp button + // The URL from a keyboardButtonTypeWebApp button, inlineQueryResultsButtonTypeWebApp button, an internalLinkTypeSideMenuBot link, or an empty when the bot is opened from the side menu Url string `json:"url"` // Preferred Web App theme; pass null to use the default theme Theme *ThemeParameters `json:"theme"` @@ -4957,7 +6118,7 @@ type GetWebAppUrlRequest struct { ApplicationName string `json:"application_name"` } -// Returns an HTTPS URL of a Web App to open after keyboardButtonTypeWebApp button is pressed +// Returns an HTTPS URL of a Web App to open from the side menu, a keyboardButtonTypeWebApp button, an inlineQueryResultsButtonTypeWebApp button, or an internalLinkTypeSideMenuBot link func (client *Client) GetWebAppUrl(req *GetWebAppUrlRequest) (*HttpUrl, error) { result, err := client.Send(Request{ meta: meta{ @@ -4986,7 +6147,7 @@ type SendWebAppDataRequest struct { BotUserId int64 `json:"bot_user_id"` // Text of the keyboardButtonTypeWebApp button, which opened the Web App ButtonText string `json:"button_text"` - // Received data + // The data Data string `json:"data"` } @@ -5014,36 +6175,36 @@ func (client *Client) SendWebAppData(req *SendWebAppDataRequest) (*Ok, error) { } type OpenWebAppRequest struct { - // Identifier of the chat in which the Web App is opened + // Identifier of the chat in which the Web App is opened. The Web App can't be opened in secret chats ChatId int64 `json:"chat_id"` // Identifier of the bot, providing the Web App BotUserId int64 `json:"bot_user_id"` - // The URL from an inlineKeyboardButtonTypeWebApp button, a botMenuButton button, or an internalLinkTypeAttachmentMenuBot link, or an empty string otherwise + // The URL from an inlineKeyboardButtonTypeWebApp button, a botMenuButton button, an internalLinkTypeAttachmentMenuBot link, or an empty string otherwise Url string `json:"url"` // Preferred Web App theme; pass null to use the default theme Theme *ThemeParameters `json:"theme"` // Short name of the application; 0-64 English letters, digits, and underscores ApplicationName string `json:"application_name"` - // If not 0, a message thread identifier in which the message will be sent + // If not 0, the message thread identifier in which the message will be sent MessageThreadId int64 `json:"message_thread_id"` - // Identifier of the replied message for the message sent by the Web App; 0 if none - ReplyToMessageId int64 `json:"reply_to_message_id"` + // Information about the message or story to be replied in the message sent by the Web App; pass null if none + ReplyTo InputMessageReplyTo `json:"reply_to"` } -// Informs TDLib that a Web App is being opened from attachment menu, a botMenuButton button, an internalLinkTypeAttachmentMenuBot link, or an inlineKeyboardButtonTypeWebApp button. For each bot, a confirmation alert about data sent to the bot must be shown once +// Informs TDLib that a Web App is being opened from the attachment menu, a botMenuButton button, an internalLinkTypeAttachmentMenuBot link, or an inlineKeyboardButtonTypeWebApp button. For each bot, a confirmation alert about data sent to the bot must be shown once func (client *Client) OpenWebApp(req *OpenWebAppRequest) (*WebAppInfo, error) { result, err := client.Send(Request{ meta: meta{ Type: "openWebApp", }, Data: map[string]interface{}{ - "chat_id": req.ChatId, - "bot_user_id": req.BotUserId, - "url": req.Url, - "theme": req.Theme, - "application_name": req.ApplicationName, - "message_thread_id": req.MessageThreadId, - "reply_to_message_id": req.ReplyToMessageId, + "chat_id": req.ChatId, + "bot_user_id": req.BotUserId, + "url": req.Url, + "theme": req.Theme, + "application_name": req.ApplicationName, + "message_thread_id": req.MessageThreadId, + "reply_to": req.ReplyTo, }, }) if err != nil { @@ -5415,8 +6576,10 @@ func (client *Client) DeleteChatReplyMarkup(req *DeleteChatReplyMarkupRequest) ( type SendChatActionRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` - // If not 0, a message thread identifier in which the action was performed + // If not 0, the message thread identifier in which the action was performed MessageThreadId int64 `json:"message_thread_id"` + // Unique identifier of business connection on behalf of which to send the request; for bots only + BusinessConnectionId string `json:"business_connection_id"` // The action description; pass null to cancel the currently active action Action ChatAction `json:"action"` } @@ -5428,9 +6591,10 @@ func (client *Client) SendChatAction(req *SendChatActionRequest) (*Ok, error) { Type: "sendChatAction", }, Data: map[string]interface{}{ - "chat_id": req.ChatId, - "message_thread_id": req.MessageThreadId, - "action": req.Action, + "chat_id": req.ChatId, + "message_thread_id": req.MessageThreadId, + "business_connection_id": req.BusinessConnectionId, + "action": req.Action, }, }) if err != nil { @@ -5499,10 +6663,10 @@ func (client *Client) CloseChat(req *CloseChatRequest) (*Ok, error) { type ViewMessagesRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` - // If not 0, a message thread identifier in which the messages are being viewed - MessageThreadId int64 `json:"message_thread_id"` // The identifiers of the messages being viewed MessageIds []int64 `json:"message_ids"` + // Source of the message view; pass null to guess the source based on chat open state + Source MessageSource `json:"source"` // Pass true to mark as read the specified messages even the chat is closed ForceRead bool `json:"force_read"` } @@ -5514,10 +6678,10 @@ func (client *Client) ViewMessages(req *ViewMessagesRequest) (*Ok, error) { Type: "viewMessages", }, Data: map[string]interface{}{ - "chat_id": req.ChatId, - "message_thread_id": req.MessageThreadId, - "message_ids": req.MessageIds, - "force_read": req.ForceRead, + "chat_id": req.ChatId, + "message_ids": req.MessageIds, + "source": req.Source, + "force_read": req.ForceRead, }, }) if err != nil { @@ -5589,6 +6753,35 @@ func (client *Client) ClickAnimatedEmojiMessage(req *ClickAnimatedEmojiMessageRe return UnmarshalSticker(result.Data) } +type GetInternalLinkRequest struct { + // Expected type of the link + Type InternalLinkType `json:"type"` + // Pass true to create an HTTPS link (only available for some link types); pass false to create a tg: link + IsHttp bool `json:"is_http"` +} + +// Returns an HTTPS or a tg: link with the given type. Can be called before authorization +func (client *Client) GetInternalLink(req *GetInternalLinkRequest) (*HttpUrl, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getInternalLink", + }, + Data: map[string]interface{}{ + "type": req.Type, + "is_http": req.IsHttp, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalHttpUrl(result.Data) +} + type GetInternalLinkTypeRequest struct { // The link Link string `json:"link"` @@ -5625,18 +6818,27 @@ func (client *Client) GetInternalLinkType(req *GetInternalLinkTypeRequest) (Inte case TypeInternalLinkTypeBackground: return UnmarshalInternalLinkTypeBackground(result.Data) + case TypeInternalLinkTypeBotAddToChannel: + return UnmarshalInternalLinkTypeBotAddToChannel(result.Data) + case TypeInternalLinkTypeBotStart: return UnmarshalInternalLinkTypeBotStart(result.Data) case TypeInternalLinkTypeBotStartInGroup: return UnmarshalInternalLinkTypeBotStartInGroup(result.Data) - case TypeInternalLinkTypeBotAddToChannel: - return UnmarshalInternalLinkTypeBotAddToChannel(result.Data) - case TypeInternalLinkTypeChangePhoneNumber: return UnmarshalInternalLinkTypeChangePhoneNumber(result.Data) + case TypeInternalLinkTypeChatBoost: + return UnmarshalInternalLinkTypeChatBoost(result.Data) + + case TypeInternalLinkTypeChatFolderInvite: + return UnmarshalInternalLinkTypeChatFolderInvite(result.Data) + + case TypeInternalLinkTypeChatFolderSettings: + return UnmarshalInternalLinkTypeChatFolderSettings(result.Data) + case TypeInternalLinkTypeChatInvite: return UnmarshalInternalLinkTypeChatInvite(result.Data) @@ -5646,9 +6848,6 @@ func (client *Client) GetInternalLinkType(req *GetInternalLinkTypeRequest) (Inte case TypeInternalLinkTypeEditProfileSettings: return UnmarshalInternalLinkTypeEditProfileSettings(result.Data) - case TypeInternalLinkTypeFilterSettings: - return UnmarshalInternalLinkTypeFilterSettings(result.Data) - case TypeInternalLinkTypeGame: return UnmarshalInternalLinkTypeGame(result.Data) @@ -5679,6 +6878,12 @@ func (client *Client) GetInternalLinkType(req *GetInternalLinkTypeRequest) (Inte case TypeInternalLinkTypePremiumFeatures: return UnmarshalInternalLinkTypePremiumFeatures(result.Data) + case TypeInternalLinkTypePremiumGift: + return UnmarshalInternalLinkTypePremiumGift(result.Data) + + case TypeInternalLinkTypePremiumGiftCode: + return UnmarshalInternalLinkTypePremiumGiftCode(result.Data) + case TypeInternalLinkTypePrivacyAndSecuritySettings: return UnmarshalInternalLinkTypePrivacyAndSecuritySettings(result.Data) @@ -5697,9 +6902,15 @@ func (client *Client) GetInternalLinkType(req *GetInternalLinkTypeRequest) (Inte case TypeInternalLinkTypeSettings: return UnmarshalInternalLinkTypeSettings(result.Data) + case TypeInternalLinkTypeSideMenuBot: + return UnmarshalInternalLinkTypeSideMenuBot(result.Data) + case TypeInternalLinkTypeStickerSet: return UnmarshalInternalLinkTypeStickerSet(result.Data) + case TypeInternalLinkTypeStory: + return UnmarshalInternalLinkTypeStory(result.Data) + case TypeInternalLinkTypeTheme: return UnmarshalInternalLinkTypeTheme(result.Data) @@ -5721,6 +6932,9 @@ func (client *Client) GetInternalLinkType(req *GetInternalLinkTypeRequest) (Inte case TypeInternalLinkTypeVideoChat: return UnmarshalInternalLinkTypeVideoChat(result.Data) + case TypeInternalLinkTypeWebApp: + return UnmarshalInternalLinkTypeWebApp(result.Data) + default: return nil, errors.New("invalid type") } @@ -6014,7 +7228,7 @@ func (client *Client) CreateSecretChat(req *CreateSecretChatRequest) (*Chat, err } type CreateNewBasicGroupChatRequest struct { - // Identifiers of users to be added to the basic group + // Identifiers of users to be added to the basic group; may be empty to create a basic group without other members UserIds []int64 `json:"user_ids"` // Title of the new basic group; 1-128 characters Title string `json:"title"` @@ -6048,7 +7262,9 @@ func (client *Client) CreateNewBasicGroupChat(req *CreateNewBasicGroupChatReques type CreateNewSupergroupChatRequest struct { // Title of the new chat; 1-128 characters Title string `json:"title"` - // Pass true to create a channel chat + // Pass true to create a forum supergroup chat + IsForum bool `json:"is_forum"` + // Pass true to create a channel chat; ignored if a forum is created IsChannel bool `json:"is_channel"` // Chat description; 0-255 characters Description string `json:"description"` @@ -6056,7 +7272,7 @@ type CreateNewSupergroupChatRequest struct { Location *ChatLocation `json:"location"` // Message auto-delete time value, in seconds; must be from 0 up to 365 * 86400 and be divisible by 86400. If 0, then messages aren't deleted automatically MessageAutoDeleteTime int32 `json:"message_auto_delete_time"` - // Pass true to create a supergroup for importing messages using importMessage + // Pass true to create a supergroup for importing messages using importMessages ForImport bool `json:"for_import"` } @@ -6068,6 +7284,7 @@ func (client *Client) CreateNewSupergroupChat(req *CreateNewSupergroupChatReques }, Data: map[string]interface{}{ "title": req.Title, + "is_forum": req.IsForum, "is_channel": req.IsChannel, "description": req.Description, "location": req.Location, @@ -6117,7 +7334,7 @@ type UpgradeBasicGroupChatToSupergroupChatRequest struct { ChatId int64 `json:"chat_id"` } -// Creates a new supergroup from an existing basic group and sends a corresponding messageChatUpgradeTo and messageChatUpgradeFrom; requires creator privileges. Deactivates the original basic group +// Creates a new supergroup from an existing basic group and sends a corresponding messageChatUpgradeTo and messageChatUpgradeFrom; requires owner privileges. Deactivates the original basic group func (client *Client) UpgradeBasicGroupChatToSupergroupChat(req *UpgradeBasicGroupChatToSupergroupChatRequest) (*Chat, error) { result, err := client.Send(Request{ meta: meta{ @@ -6193,19 +7410,19 @@ func (client *Client) AddChatToList(req *AddChatToListRequest) (*Ok, error) { return UnmarshalOk(result.Data) } -type GetChatFilterRequest struct { - // Chat filter identifier - ChatFilterId int32 `json:"chat_filter_id"` +type GetChatFolderRequest struct { + // Chat folder identifier + ChatFolderId int32 `json:"chat_folder_id"` } -// Returns information about a chat filter by its identifier -func (client *Client) GetChatFilter(req *GetChatFilterRequest) (*ChatFilter, error) { +// Returns information about a chat folder by its identifier +func (client *Client) GetChatFolder(req *GetChatFolderRequest) (*ChatFolder, error) { result, err := client.Send(Request{ meta: meta{ - Type: "getChatFilter", + Type: "getChatFolder", }, Data: map[string]interface{}{ - "chat_filter_id": req.ChatFilterId, + "chat_folder_id": req.ChatFolderId, }, }) if err != nil { @@ -6216,22 +7433,22 @@ func (client *Client) GetChatFilter(req *GetChatFilterRequest) (*ChatFilter, err return nil, buildResponseError(result.Data) } - return UnmarshalChatFilter(result.Data) + return UnmarshalChatFolder(result.Data) } -type CreateChatFilterRequest struct { - // Chat filter - Filter *ChatFilter `json:"filter"` +type CreateChatFolderRequest struct { + // The new chat folder + Folder *ChatFolder `json:"folder"` } -// Creates new chat filter. Returns information about the created chat filter. There can be up to getOption("chat_filter_count_max") chat filters, but the limit can be increased with Telegram Premium -func (client *Client) CreateChatFilter(req *CreateChatFilterRequest) (*ChatFilterInfo, error) { +// Creates new chat folder. Returns information about the created chat folder. There can be up to getOption("chat_folder_count_max") chat folders, but the limit can be increased with Telegram Premium +func (client *Client) CreateChatFolder(req *CreateChatFolderRequest) (*ChatFolderInfo, error) { result, err := client.Send(Request{ meta: meta{ - Type: "createChatFilter", + Type: "createChatFolder", }, Data: map[string]interface{}{ - "filter": req.Filter, + "folder": req.Folder, }, }) if err != nil { @@ -6242,25 +7459,25 @@ func (client *Client) CreateChatFilter(req *CreateChatFilterRequest) (*ChatFilte return nil, buildResponseError(result.Data) } - return UnmarshalChatFilterInfo(result.Data) + return UnmarshalChatFolderInfo(result.Data) } -type EditChatFilterRequest struct { - // Chat filter identifier - ChatFilterId int32 `json:"chat_filter_id"` - // The edited chat filter - Filter *ChatFilter `json:"filter"` +type EditChatFolderRequest struct { + // Chat folder identifier + ChatFolderId int32 `json:"chat_folder_id"` + // The edited chat folder + Folder *ChatFolder `json:"folder"` } -// Edits existing chat filter. Returns information about the edited chat filter -func (client *Client) EditChatFilter(req *EditChatFilterRequest) (*ChatFilterInfo, error) { +// Edits existing chat folder. Returns information about the edited chat folder +func (client *Client) EditChatFolder(req *EditChatFolderRequest) (*ChatFolderInfo, error) { result, err := client.Send(Request{ meta: meta{ - Type: "editChatFilter", + Type: "editChatFolder", }, Data: map[string]interface{}{ - "chat_filter_id": req.ChatFilterId, - "filter": req.Filter, + "chat_folder_id": req.ChatFolderId, + "folder": req.Folder, }, }) if err != nil { @@ -6271,22 +7488,25 @@ func (client *Client) EditChatFilter(req *EditChatFilterRequest) (*ChatFilterInf return nil, buildResponseError(result.Data) } - return UnmarshalChatFilterInfo(result.Data) + return UnmarshalChatFolderInfo(result.Data) } -type DeleteChatFilterRequest struct { - // Chat filter identifier - ChatFilterId int32 `json:"chat_filter_id"` +type DeleteChatFolderRequest struct { + // Chat folder identifier + ChatFolderId int32 `json:"chat_folder_id"` + // Identifiers of the chats to leave. The chats must be pinned or always included in the folder + LeaveChatIds []int64 `json:"leave_chat_ids"` } -// Deletes existing chat filter -func (client *Client) DeleteChatFilter(req *DeleteChatFilterRequest) (*Ok, error) { +// Deletes existing chat folder +func (client *Client) DeleteChatFolder(req *DeleteChatFolderRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ - Type: "deleteChatFilter", + Type: "deleteChatFolder", }, Data: map[string]interface{}{ - "chat_filter_id": req.ChatFilterId, + "chat_folder_id": req.ChatFolderId, + "leave_chat_ids": req.LeaveChatIds, }, }) if err != nil { @@ -6300,21 +7520,73 @@ func (client *Client) DeleteChatFilter(req *DeleteChatFilterRequest) (*Ok, error return UnmarshalOk(result.Data) } -type ReorderChatFiltersRequest struct { - // Identifiers of chat filters in the new correct order - ChatFilterIds []int32 `json:"chat_filter_ids"` - // Position of the main chat list among chat filters, 0-based. Can be non-zero only for Premium users +type GetChatFolderChatsToLeaveRequest struct { + // Chat folder identifier + ChatFolderId int32 `json:"chat_folder_id"` +} + +// Returns identifiers of pinned or always included chats from a chat folder, which are suggested to be left when the chat folder is deleted +func (client *Client) GetChatFolderChatsToLeave(req *GetChatFolderChatsToLeaveRequest) (*Chats, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getChatFolderChatsToLeave", + }, + Data: map[string]interface{}{ + "chat_folder_id": req.ChatFolderId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChats(result.Data) +} + +type GetChatFolderChatCountRequest struct { + // The new chat folder + Folder *ChatFolder `json:"folder"` +} + +// Returns approximate number of chats in a being created chat folder. Main and archive chat lists must be fully preloaded for this function to work correctly +func (client *Client) GetChatFolderChatCount(req *GetChatFolderChatCountRequest) (*Count, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getChatFolderChatCount", + }, + Data: map[string]interface{}{ + "folder": req.Folder, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalCount(result.Data) +} + +type ReorderChatFoldersRequest struct { + // Identifiers of chat folders in the new correct order + ChatFolderIds []int32 `json:"chat_folder_ids"` + // Position of the main chat list among chat folders, 0-based. Can be non-zero only for Premium users MainChatListPosition int32 `json:"main_chat_list_position"` } -// Changes the order of chat filters -func (client *Client) ReorderChatFilters(req *ReorderChatFiltersRequest) (*Ok, error) { +// Changes the order of chat folders +func (client *Client) ReorderChatFolders(req *ReorderChatFoldersRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ - Type: "reorderChatFilters", + Type: "reorderChatFolders", }, Data: map[string]interface{}{ - "chat_filter_ids": req.ChatFilterIds, + "chat_folder_ids": req.ChatFolderIds, "main_chat_list_position": req.MainChatListPosition, }, }) @@ -6329,11 +7601,37 @@ func (client *Client) ReorderChatFilters(req *ReorderChatFiltersRequest) (*Ok, e return UnmarshalOk(result.Data) } -// Returns recommended chat filters for the current user -func (client *Client) GetRecommendedChatFilters() (*RecommendedChatFilters, error) { +type ToggleChatFolderTagsRequest struct { + // Pass true to enable folder tags; pass false to disable them + AreTagsEnabled bool `json:"are_tags_enabled"` +} + +// Toggles whether chat folder tags are enabled +func (client *Client) ToggleChatFolderTags(req *ToggleChatFolderTagsRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ - Type: "getRecommendedChatFilters", + Type: "toggleChatFolderTags", + }, + Data: map[string]interface{}{ + "are_tags_enabled": req.AreTagsEnabled, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +// Returns recommended chat folders for the current user +func (client *Client) GetRecommendedChatFolders() (*RecommendedChatFolders, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getRecommendedChatFolders", }, Data: map[string]interface{}{}, }) @@ -6345,22 +7643,22 @@ func (client *Client) GetRecommendedChatFilters() (*RecommendedChatFilters, erro return nil, buildResponseError(result.Data) } - return UnmarshalRecommendedChatFilters(result.Data) + return UnmarshalRecommendedChatFolders(result.Data) } -type GetChatFilterDefaultIconNameRequest struct { - // Chat filter - Filter *ChatFilter `json:"filter"` +type GetChatFolderDefaultIconNameRequest struct { + // Chat folder + Folder *ChatFolder `json:"folder"` } -// Returns default icon name for a filter. Can be called synchronously -func (client *Client) GetChatFilterDefaultIconName(req *GetChatFilterDefaultIconNameRequest) (*Text, error) { +// Returns default icon name for a folder. Can be called synchronously +func (client *Client) GetChatFolderDefaultIconName(req *GetChatFolderDefaultIconNameRequest) (*ChatFolderIcon, error) { result, err := client.jsonClient.Execute(Request{ meta: meta{ - Type: "getChatFilterDefaultIconName", + Type: "getChatFolderDefaultIconName", }, Data: map[string]interface{}{ - "filter": req.Filter, + "folder": req.Folder, }, }) if err != nil { @@ -6371,7 +7669,310 @@ func (client *Client) GetChatFilterDefaultIconName(req *GetChatFilterDefaultIcon return nil, buildResponseError(result.Data) } - return UnmarshalText(result.Data) + return UnmarshalChatFolderIcon(result.Data) +} + +type GetChatsForChatFolderInviteLinkRequest struct { + // Chat folder identifier + ChatFolderId int32 `json:"chat_folder_id"` +} + +// Returns identifiers of chats from a chat folder, suitable for adding to a chat folder invite link +func (client *Client) GetChatsForChatFolderInviteLink(req *GetChatsForChatFolderInviteLinkRequest) (*Chats, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getChatsForChatFolderInviteLink", + }, + Data: map[string]interface{}{ + "chat_folder_id": req.ChatFolderId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChats(result.Data) +} + +type CreateChatFolderInviteLinkRequest struct { + // Chat folder identifier + ChatFolderId int32 `json:"chat_folder_id"` + // Name of the link; 0-32 characters + Name string `json:"name"` + // Identifiers of chats to be accessible by the invite link. Use getChatsForChatFolderInviteLink to get suitable chats. Basic groups will be automatically converted to supergroups before link creation + ChatIds []int64 `json:"chat_ids"` +} + +// Creates a new invite link for a chat folder. A link can be created for a chat folder if it has only pinned and included chats +func (client *Client) CreateChatFolderInviteLink(req *CreateChatFolderInviteLinkRequest) (*ChatFolderInviteLink, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "createChatFolderInviteLink", + }, + Data: map[string]interface{}{ + "chat_folder_id": req.ChatFolderId, + "name": req.Name, + "chat_ids": req.ChatIds, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChatFolderInviteLink(result.Data) +} + +type GetChatFolderInviteLinksRequest struct { + // Chat folder identifier + ChatFolderId int32 `json:"chat_folder_id"` +} + +// Returns invite links created by the current user for a shareable chat folder +func (client *Client) GetChatFolderInviteLinks(req *GetChatFolderInviteLinksRequest) (*ChatFolderInviteLinks, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getChatFolderInviteLinks", + }, + Data: map[string]interface{}{ + "chat_folder_id": req.ChatFolderId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChatFolderInviteLinks(result.Data) +} + +type EditChatFolderInviteLinkRequest struct { + // Chat folder identifier + ChatFolderId int32 `json:"chat_folder_id"` + // Invite link to be edited + InviteLink string `json:"invite_link"` + // New name of the link; 0-32 characters + Name string `json:"name"` + // New identifiers of chats to be accessible by the invite link. Use getChatsForChatFolderInviteLink to get suitable chats. Basic groups will be automatically converted to supergroups before link editing + ChatIds []int64 `json:"chat_ids"` +} + +// Edits an invite link for a chat folder +func (client *Client) EditChatFolderInviteLink(req *EditChatFolderInviteLinkRequest) (*ChatFolderInviteLink, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "editChatFolderInviteLink", + }, + Data: map[string]interface{}{ + "chat_folder_id": req.ChatFolderId, + "invite_link": req.InviteLink, + "name": req.Name, + "chat_ids": req.ChatIds, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChatFolderInviteLink(result.Data) +} + +type DeleteChatFolderInviteLinkRequest struct { + // Chat folder identifier + ChatFolderId int32 `json:"chat_folder_id"` + // Invite link to be deleted + InviteLink string `json:"invite_link"` +} + +// Deletes an invite link for a chat folder +func (client *Client) DeleteChatFolderInviteLink(req *DeleteChatFolderInviteLinkRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "deleteChatFolderInviteLink", + }, + Data: map[string]interface{}{ + "chat_folder_id": req.ChatFolderId, + "invite_link": req.InviteLink, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type CheckChatFolderInviteLinkRequest struct { + // Invite link to be checked + InviteLink string `json:"invite_link"` +} + +// Checks the validity of an invite link for a chat folder and returns information about the corresponding chat folder +func (client *Client) CheckChatFolderInviteLink(req *CheckChatFolderInviteLinkRequest) (*ChatFolderInviteLinkInfo, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "checkChatFolderInviteLink", + }, + Data: map[string]interface{}{ + "invite_link": req.InviteLink, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChatFolderInviteLinkInfo(result.Data) +} + +type AddChatFolderByInviteLinkRequest struct { + // Invite link for the chat folder + InviteLink string `json:"invite_link"` + // Identifiers of the chats added to the chat folder. The chats are automatically joined if they aren't joined yet + ChatIds []int64 `json:"chat_ids"` +} + +// Adds a chat folder by an invite link +func (client *Client) AddChatFolderByInviteLink(req *AddChatFolderByInviteLinkRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "addChatFolderByInviteLink", + }, + Data: map[string]interface{}{ + "invite_link": req.InviteLink, + "chat_ids": req.ChatIds, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type GetChatFolderNewChatsRequest struct { + // Chat folder identifier + ChatFolderId int32 `json:"chat_folder_id"` +} + +// Returns new chats added to a shareable chat folder by its owner. The method must be called at most once in getOption("chat_folder_new_chats_update_period") for the given chat folder +func (client *Client) GetChatFolderNewChats(req *GetChatFolderNewChatsRequest) (*Chats, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getChatFolderNewChats", + }, + Data: map[string]interface{}{ + "chat_folder_id": req.ChatFolderId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChats(result.Data) +} + +type ProcessChatFolderNewChatsRequest struct { + // Chat folder identifier + ChatFolderId int32 `json:"chat_folder_id"` + // Identifiers of the new chats, which are added to the chat folder. The chats are automatically joined if they aren't joined yet + AddedChatIds []int64 `json:"added_chat_ids"` +} + +// Process new chats added to a shareable chat folder by its owner +func (client *Client) ProcessChatFolderNewChats(req *ProcessChatFolderNewChatsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "processChatFolderNewChats", + }, + Data: map[string]interface{}{ + "chat_folder_id": req.ChatFolderId, + "added_chat_ids": req.AddedChatIds, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +// Returns settings for automatic moving of chats to and from the Archive chat lists +func (client *Client) GetArchiveChatListSettings() (*ArchiveChatListSettings, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getArchiveChatListSettings", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalArchiveChatListSettings(result.Data) +} + +type SetArchiveChatListSettingsRequest struct { + // New settings + Settings *ArchiveChatListSettings `json:"settings"` +} + +// Changes settings for automatic moving of chats to and from the Archive chat lists +func (client *Client) SetArchiveChatListSettings(req *SetArchiveChatListSettingsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setArchiveChatListSettings", + }, + Data: map[string]interface{}{ + "settings": req.Settings, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) } type SetChatTitleRequest struct { @@ -6381,7 +7982,7 @@ type SetChatTitleRequest struct { Title string `json:"title"` } -// Changes the chat title. Supported only for basic groups, supergroups and channels. Requires can_change_info administrator right +// Changes the chat title. Supported only for basic groups, supergroups and channels. Requires can_change_info member right func (client *Client) SetChatTitle(req *SetChatTitleRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -6410,7 +8011,7 @@ type SetChatPhotoRequest struct { Photo InputChatPhoto `json:"photo"` } -// Changes the photo of a chat. Supported only for basic groups, supergroups and channels. Requires can_change_info administrator right +// Changes the photo of a chat. Supported only for basic groups, supergroups and channels. Requires can_change_info member right func (client *Client) SetChatPhoto(req *SetChatPhotoRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -6432,6 +8033,70 @@ func (client *Client) SetChatPhoto(req *SetChatPhotoRequest) (*Ok, error) { return UnmarshalOk(result.Data) } +type SetChatAccentColorRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // Identifier of the accent color to use. The chat must have at least accentColor.min_channel_chat_boost_level boost level to pass the corresponding color + AccentColorId int32 `json:"accent_color_id"` + // Identifier of a custom emoji to be shown on the reply header and link preview background; 0 if none. Use chatBoostLevelFeatures.can_set_background_custom_emoji to check whether a custom emoji can be set + BackgroundCustomEmojiId JsonInt64 `json:"background_custom_emoji_id"` +} + +// Changes accent color and background custom emoji of a channel chat. Requires can_change_info administrator right +func (client *Client) SetChatAccentColor(req *SetChatAccentColorRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setChatAccentColor", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "accent_color_id": req.AccentColorId, + "background_custom_emoji_id": req.BackgroundCustomEmojiId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type SetChatProfileAccentColorRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // Identifier of the accent color to use for profile; pass -1 if none. The chat must have at least profileAccentColor.min_supergroup_chat_boost_level for supergroups or profileAccentColor.min_channel_chat_boost_level for channels boost level to pass the corresponding color + ProfileAccentColorId int32 `json:"profile_accent_color_id"` + // Identifier of a custom emoji to be shown on the chat's profile photo background; 0 if none. Use chatBoostLevelFeatures.can_set_profile_background_custom_emoji to check whether a custom emoji can be set + ProfileBackgroundCustomEmojiId JsonInt64 `json:"profile_background_custom_emoji_id"` +} + +// Changes accent color and background custom emoji for profile of a supergroup or channel chat. Requires can_change_info administrator right +func (client *Client) SetChatProfileAccentColor(req *SetChatProfileAccentColorRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setChatProfileAccentColor", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "profile_accent_color_id": req.ProfileAccentColorId, + "profile_background_custom_emoji_id": req.ProfileBackgroundCustomEmojiId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type SetChatMessageAutoDeleteTimeRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` @@ -6461,6 +8126,35 @@ func (client *Client) SetChatMessageAutoDeleteTime(req *SetChatMessageAutoDelete return UnmarshalOk(result.Data) } +type SetChatEmojiStatusRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // New emoji status; pass null to remove emoji status + EmojiStatus *EmojiStatus `json:"emoji_status"` +} + +// Changes the emoji status of a chat. Use chatBoostLevelFeatures.can_set_emoji_status to check whether an emoji status can be set. Requires can_change_info administrator right +func (client *Client) SetChatEmojiStatus(req *SetChatEmojiStatusRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setChatEmojiStatus", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "emoji_status": req.EmojiStatus, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type SetChatPermissionsRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` @@ -6490,6 +8184,73 @@ func (client *Client) SetChatPermissions(req *SetChatPermissionsRequest) (*Ok, e return UnmarshalOk(result.Data) } +type SetChatBackgroundRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // The input background to use; pass null to create a new filled or chat theme background + Background InputBackground `json:"background"` + // Background type; pass null to use default background type for the chosen background; backgroundTypeChatTheme isn't supported for private and secret chats. Use chatBoostLevelFeatures.chat_theme_background_count and chatBoostLevelFeatures.can_set_custom_background to check whether the background type can be set in the boosted chat + Type BackgroundType `json:"type"` + // Dimming of the background in dark themes, as a percentage; 0-100. Applied only to Wallpaper and Fill types of background + DarkThemeDimming int32 `json:"dark_theme_dimming"` + // Pass true to set background only for self; pass false to set background for all chat users. Always false for backgrounds set in boosted chats. Background can be set for both users only by Telegram Premium users and if set background isn't of the type inputBackgroundPrevious + OnlyForSelf bool `json:"only_for_self"` +} + +// Sets the background in a specific chat. Supported only in private and secret chats with non-deleted users, and in chats with sufficient boost level and can_change_info administrator right +func (client *Client) SetChatBackground(req *SetChatBackgroundRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setChatBackground", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "background": req.Background, + "type": req.Type, + "dark_theme_dimming": req.DarkThemeDimming, + "only_for_self": req.OnlyForSelf, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type DeleteChatBackgroundRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // Pass true to restore previously set background. Can be used only in private and secret chats with non-deleted users if userFullInfo.set_chat_background == true. Supposed to be used from messageChatSetBackground messages with the currently set background that was set for both sides by the other user + RestorePrevious bool `json:"restore_previous"` +} + +// Deletes background in a specific chat +func (client *Client) DeleteChatBackground(req *DeleteChatBackgroundRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "deleteChatBackground", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "restore_previous": req.RestorePrevious, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type SetChatThemeRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` @@ -6522,9 +8283,9 @@ func (client *Client) SetChatTheme(req *SetChatThemeRequest) (*Ok, error) { type SetChatDraftMessageRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` - // If not 0, a message thread identifier in which the draft was changed + // If not 0, the message thread identifier in which the draft was changed MessageThreadId int64 `json:"message_thread_id"` - // New draft message; pass null to remove the draft + // New draft message; pass null to remove the draft. All files in draft message content must be of the type inputFileLocal. Media thumbnails and captions are ignored DraftMessage *DraftMessage `json:"draft_message"` } @@ -6609,6 +8370,64 @@ func (client *Client) ToggleChatHasProtectedContent(req *ToggleChatHasProtectedC return UnmarshalOk(result.Data) } +type ToggleChatViewAsTopicsRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // New value of view_as_topics + ViewAsTopics bool `json:"view_as_topics"` +} + +// Changes the view_as_topics setting of a forum chat or Saved Messages +func (client *Client) ToggleChatViewAsTopics(req *ToggleChatViewAsTopicsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "toggleChatViewAsTopics", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "view_as_topics": req.ViewAsTopics, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type ToggleChatIsTranslatableRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // New value of is_translatable + IsTranslatable bool `json:"is_translatable"` +} + +// Changes the translatable state of a chat +func (client *Client) ToggleChatIsTranslatable(req *ToggleChatIsTranslatableRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "toggleChatIsTranslatable", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "is_translatable": req.IsTranslatable, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type ToggleChatIsMarkedAsUnreadRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` @@ -6670,11 +8489,11 @@ func (client *Client) ToggleChatDefaultDisableNotification(req *ToggleChatDefaul type SetChatAvailableReactionsRequest struct { // Identifier of the chat ChatId int64 `json:"chat_id"` - // Reactions available in the chat. All emoji reactions must be active + // Reactions available in the chat. All explicitly specified emoji reactions must be active. In channel chats up to the chat's boost level custom emoji reactions can be explicitly specified AvailableReactions ChatAvailableReactions `json:"available_reactions"` } -// Changes reactions, available in a chat. Available for basic groups, supergroups, and channels. Requires can_change_info administrator right +// Changes reactions, available in a chat. Available for basic groups, supergroups, and channels. Requires can_change_info member right func (client *Client) SetChatAvailableReactions(req *SetChatAvailableReactionsRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -6732,7 +8551,7 @@ type SetChatDescriptionRequest struct { Description string `json:"description"` } -// Changes information about a chat. Available for basic groups, supergroups, and channels. Requires can_change_info administrator right +// Changes information about a chat. Available for basic groups, supergroups, and channels. Requires can_change_info member right func (client *Client) SetChatDescription(req *SetChatDescriptionRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -6755,7 +8574,7 @@ func (client *Client) SetChatDescription(req *SetChatDescriptionRequest) (*Ok, e } type SetChatDiscussionGroupRequest struct { - // Identifier of the channel chat. Pass 0 to remove a link from the supergroup passed in the second argument to a linked channel chat (requires can_pin_messages rights in the supergroup) + // Identifier of the channel chat. Pass 0 to remove a link from the supergroup passed in the second argument to a linked channel chat (requires can_pin_messages member right in the supergroup) ChatId int64 `json:"chat_id"` // Identifier of a new channel's discussion group. Use 0 to remove the discussion group. Use the method getSuitableDiscussionChats to find all suitable groups. Basic group chats must be first upgraded to supergroup chats. If new chat members don't have access to old messages in the supergroup, then toggleSupergroupIsAllHistoryAvailable must be used first to change that DiscussionChatId int64 `json:"discussion_chat_id"` @@ -6819,7 +8638,7 @@ type SetChatSlowModeDelayRequest struct { SlowModeDelay int32 `json:"slow_mode_delay"` } -// Changes the slow mode delay of a chat. Available only for supergroups; requires can_restrict_members rights +// Changes the slow mode delay of a chat. Available only for supergroups; requires can_restrict_members right func (client *Client) SetChatSlowModeDelay(req *SetChatSlowModeDelayRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -6852,7 +8671,7 @@ type PinChatMessageRequest struct { OnlyForSelf bool `json:"only_for_self"` } -// Pins a message in a chat; requires can_pin_messages rights or can_edit_messages rights in the channel +// Pins a message in a chat; requires can_pin_messages member right if the chat is a basic group or supergroup, or can_edit_messages administrator right if the chat is a channel func (client *Client) PinChatMessage(req *PinChatMessageRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -6883,7 +8702,7 @@ type UnpinChatMessageRequest struct { MessageId int64 `json:"message_id"` } -// Removes a pinned message from a chat; requires can_pin_messages rights in the group or can_edit_messages rights in the channel +// Removes a pinned message from a chat; requires can_pin_messages member right if the chat is a basic group or supergroup, or can_edit_messages administrator right if the chat is a channel func (client *Client) UnpinChatMessage(req *UnpinChatMessageRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -6910,7 +8729,7 @@ type UnpinAllChatMessagesRequest struct { ChatId int64 `json:"chat_id"` } -// Removes all pinned messages from a chat; requires can_pin_messages rights in the group or can_edit_messages rights in the channel +// Removes all pinned messages from a chat; requires can_pin_messages member right if the chat is a basic group or supergroup, or can_edit_messages administrator right if the chat is a channel func (client *Client) UnpinAllChatMessages(req *UnpinAllChatMessagesRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -6938,7 +8757,7 @@ type UnpinAllMessageThreadMessagesRequest struct { MessageThreadId int64 `json:"message_thread_id"` } -// Removes all pinned messages from a forum topic; requires can_pin_messages rights in the supergroup +// Removes all pinned messages from a forum topic; requires can_pin_messages member right in the supergroup func (client *Client) UnpinAllMessageThreadMessages(req *UnpinAllMessageThreadMessagesRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -7021,7 +8840,7 @@ type AddChatMemberRequest struct { ForwardLimit int32 `json:"forward_limit"` } -// Adds a new member to a chat. Members can't be added to private or secret chats +// Adds a new member to a chat; requires can_invite_users member right. Members can't be added to private or secret chats func (client *Client) AddChatMember(req *AddChatMemberRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -7051,7 +8870,7 @@ type AddChatMembersRequest struct { UserIds []int64 `json:"user_ids"` } -// Adds multiple new members to a chat. Currently, this method is only available for supergroups and channels. This method can't be used to join a chat. Members can't be added to a channel if it has more than 200 members +// Adds multiple new members to a chat; requires can_invite_users member right. Currently, this method is only available for supergroups and channels. This method can't be used to join a chat. Members can't be added to a channel if it has more than 200 members func (client *Client) AddChatMembers(req *AddChatMembersRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -7082,7 +8901,7 @@ type SetChatMemberStatusRequest struct { Status ChatMemberStatus `json:"status"` } -// Changes the status of a chat member, needs appropriate privileges. This function is currently not suitable for transferring chat ownership; use transferChatOwnership instead. Use addChatMember or banChatMember if some additional parameters needs to be passed +// Changes the status of a chat member; requires can_invite_users member right to add a chat member, can_promote_members administrator right to change administrator rights of the member, and can_restrict_members administrator right to change restrictions of a user. This function is currently not suitable for transferring chat ownership; use transferChatOwnership instead. Use addChatMember or banChatMember if some additional parameters needs to be passed func (client *Client) SetChatMemberStatus(req *SetChatMemberStatusRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -7116,7 +8935,7 @@ type BanChatMemberRequest struct { RevokeMessages bool `json:"revoke_messages"` } -// Bans a member in a chat. Members can't be banned in private or secret chats. In supergroups and channels, the user will not be able to return to the group on their own using invite links, etc., unless unbanned first +// Bans a member in a chat; requires can_restrict_members administrator right. Members can't be banned in private or secret chats. In supergroups and channels, the user will not be able to return to the group on their own using invite links, etc., unless unbanned first func (client *Client) BanChatMember(req *BanChatMemberRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -7183,7 +9002,7 @@ type TransferChatOwnershipRequest struct { Password string `json:"password"` } -// Changes the owner of a chat. The current user must be a current owner of the chat. Use the method canTransferOwnership to check whether the ownership can be transferred from the current session. Available only for supergroups and channel chats +// Changes the owner of a chat; requires owner privileges in the chat. Use the method canTransferOwnership to check whether the ownership can be transferred from the current session. Available only for supergroups and channel chats func (client *Client) TransferChatOwnership(req *TransferChatOwnershipRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -7246,7 +9065,7 @@ type SearchChatMembersRequest struct { Filter ChatMembersFilter `json:"filter"` } -// Searches for a specified query in the first name, last name and usernames of the members of a specified chat. Requires administrator rights in channels +// Searches for a specified query in the first name, last name and usernames of the members of a specified chat. Requires administrator rights if the chat is a channel func (client *Client) SearchChatMembers(req *SearchChatMembersRequest) (*ChatMembers, error) { result, err := client.Send(Request{ meta: meta{ @@ -7426,7 +9245,7 @@ type GetChatNotificationSettingsExceptionsRequest struct { CompareSound bool `json:"compare_sound"` } -// Returns list of chats with non-default notification settings +// Returns list of chats with non-default notification settings for new messages func (client *Client) GetChatNotificationSettingsExceptions(req *GetChatNotificationSettingsExceptionsRequest) (*Chats, error) { result, err := client.Send(Request{ meta: meta{ @@ -7583,12 +9402,1016 @@ func (client *Client) SetPinnedChats(req *SetPinnedChatsRequest) (*Ok, error) { return UnmarshalOk(result.Data) } +type ReadChatListRequest struct { + // Chat list in which to mark all chats as read + ChatList ChatList `json:"chat_list"` +} + +// Traverse all chats in a chat list and marks all messages in the chats as read +func (client *Client) ReadChatList(req *ReadChatListRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "readChatList", + }, + Data: map[string]interface{}{ + "chat_list": req.ChatList, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type GetStoryRequest struct { + // Identifier of the chat that posted the story + StorySenderChatId int64 `json:"story_sender_chat_id"` + // Story identifier + StoryId int32 `json:"story_id"` + // Pass true to get only locally available information without sending network requests + OnlyLocal bool `json:"only_local"` +} + +// Returns a story +func (client *Client) GetStory(req *GetStoryRequest) (*Story, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getStory", + }, + Data: map[string]interface{}{ + "story_sender_chat_id": req.StorySenderChatId, + "story_id": req.StoryId, + "only_local": req.OnlyLocal, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalStory(result.Data) +} + +// Returns supergroup and channel chats in which the current user has the right to post stories. The chats must be rechecked with canSendStory before actually trying to post a story there +func (client *Client) GetChatsToSendStories() (*Chats, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getChatsToSendStories", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChats(result.Data) +} + +type CanSendStoryRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` +} + +// Checks whether the current user can send a story on behalf of a chat; requires can_post_stories right for supergroup and channel chats +func (client *Client) CanSendStory(req *CanSendStoryRequest) (CanSendStoryResult, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "canSendStory", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + switch result.Type { + case TypeCanSendStoryResultOk: + return UnmarshalCanSendStoryResultOk(result.Data) + + case TypeCanSendStoryResultPremiumNeeded: + return UnmarshalCanSendStoryResultPremiumNeeded(result.Data) + + case TypeCanSendStoryResultBoostNeeded: + return UnmarshalCanSendStoryResultBoostNeeded(result.Data) + + case TypeCanSendStoryResultActiveStoryLimitExceeded: + return UnmarshalCanSendStoryResultActiveStoryLimitExceeded(result.Data) + + case TypeCanSendStoryResultWeeklyLimitExceeded: + return UnmarshalCanSendStoryResultWeeklyLimitExceeded(result.Data) + + case TypeCanSendStoryResultMonthlyLimitExceeded: + return UnmarshalCanSendStoryResultMonthlyLimitExceeded(result.Data) + + default: + return nil, errors.New("invalid type") + } +} + +type SendStoryRequest struct { + // Identifier of the chat that will post the story + ChatId int64 `json:"chat_id"` + // Content of the story + Content InputStoryContent `json:"content"` + // Clickable rectangle areas to be shown on the story media; pass null if none + Areas *InputStoryAreas `json:"areas"` + // Story caption; pass null to use an empty caption; 0-getOption("story_caption_length_max") characters; can have entities only if getOption("can_use_text_entities_in_story_caption") + Caption *FormattedText `json:"caption"` + // The privacy settings for the story; ignored for stories sent to supergroup and channel chats + PrivacySettings StoryPrivacySettings `json:"privacy_settings"` + // Period after which the story is moved to archive, in seconds; must be one of 6 * 3600, 12 * 3600, 86400, or 2 * 86400 for Telegram Premium users, and 86400 otherwise + ActivePeriod int32 `json:"active_period"` + // Full identifier of the original story, which content was used to create the story + FromStoryFullId *StoryFullId `json:"from_story_full_id"` + // Pass true to keep the story accessible after expiration + IsPinned bool `json:"is_pinned"` + // Pass true if the content of the story must be protected from forwarding and screenshotting + ProtectContent bool `json:"protect_content"` +} + +// Sends a new story to a chat; requires can_post_stories right for supergroup and channel chats. Returns a temporary story +func (client *Client) SendStory(req *SendStoryRequest) (*Story, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "sendStory", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "content": req.Content, + "areas": req.Areas, + "caption": req.Caption, + "privacy_settings": req.PrivacySettings, + "active_period": req.ActivePeriod, + "from_story_full_id": req.FromStoryFullId, + "is_pinned": req.IsPinned, + "protect_content": req.ProtectContent, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalStory(result.Data) +} + +type EditStoryRequest struct { + // Identifier of the chat that posted the story + StorySenderChatId int64 `json:"story_sender_chat_id"` + // Identifier of the story to edit + StoryId int32 `json:"story_id"` + // New content of the story; pass null to keep the current content + Content InputStoryContent `json:"content"` + // New clickable rectangle areas to be shown on the story media; pass null to keep the current areas. Areas can't be edited if story content isn't changed + Areas *InputStoryAreas `json:"areas"` + // New story caption; pass null to keep the current caption + Caption *FormattedText `json:"caption"` +} + +// Changes content and caption of a story. Can be called only if story.can_be_edited == true +func (client *Client) EditStory(req *EditStoryRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "editStory", + }, + Data: map[string]interface{}{ + "story_sender_chat_id": req.StorySenderChatId, + "story_id": req.StoryId, + "content": req.Content, + "areas": req.Areas, + "caption": req.Caption, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type SetStoryPrivacySettingsRequest struct { + // Identifier of the story + StoryId int32 `json:"story_id"` + // The new privacy settigs for the story + PrivacySettings StoryPrivacySettings `json:"privacy_settings"` +} + +// Changes privacy settings of a story. The method can be called only for stories posted on behalf of the current user and if story.can_be_edited == true +func (client *Client) SetStoryPrivacySettings(req *SetStoryPrivacySettingsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setStoryPrivacySettings", + }, + Data: map[string]interface{}{ + "story_id": req.StoryId, + "privacy_settings": req.PrivacySettings, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type ToggleStoryIsPinnedRequest struct { + // Identifier of the chat that posted the story + StorySenderChatId int64 `json:"story_sender_chat_id"` + // Identifier of the story + StoryId int32 `json:"story_id"` + // Pass true to make the story accessible after expiration; pass false to make it private + IsPinned bool `json:"is_pinned"` +} + +// Toggles whether a story is accessible after expiration. Can be called only if story.can_toggle_is_pinned == true +func (client *Client) ToggleStoryIsPinned(req *ToggleStoryIsPinnedRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "toggleStoryIsPinned", + }, + Data: map[string]interface{}{ + "story_sender_chat_id": req.StorySenderChatId, + "story_id": req.StoryId, + "is_pinned": req.IsPinned, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type DeleteStoryRequest struct { + // Identifier of the chat that posted the story + StorySenderChatId int64 `json:"story_sender_chat_id"` + // Identifier of the story to delete + StoryId int32 `json:"story_id"` +} + +// Deletes a previously sent story. Can be called only if story.can_be_deleted == true +func (client *Client) DeleteStory(req *DeleteStoryRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "deleteStory", + }, + Data: map[string]interface{}{ + "story_sender_chat_id": req.StorySenderChatId, + "story_id": req.StoryId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +// Returns list of chats with non-default notification settings for stories +func (client *Client) GetStoryNotificationSettingsExceptions() (*Chats, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getStoryNotificationSettingsExceptions", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChats(result.Data) +} + +type LoadActiveStoriesRequest struct { + // The story list in which to load active stories + StoryList StoryList `json:"story_list"` +} + +// Loads more active stories from a story list. The loaded stories will be sent through updates. Active stories are sorted by the pair (active_stories.order, active_stories.story_sender_chat_id) in descending order. Returns a 404 error if all active stories have been loaded +func (client *Client) LoadActiveStories(req *LoadActiveStoriesRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "loadActiveStories", + }, + Data: map[string]interface{}{ + "story_list": req.StoryList, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type SetChatActiveStoriesListRequest struct { + // Identifier of the chat that posted stories + ChatId int64 `json:"chat_id"` + // New list for active stories posted by the chat + StoryList StoryList `json:"story_list"` +} + +// Changes story list in which stories from the chat are shown +func (client *Client) SetChatActiveStoriesList(req *SetChatActiveStoriesListRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setChatActiveStoriesList", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "story_list": req.StoryList, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type GetChatActiveStoriesRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` +} + +// Returns the list of active stories posted by the given chat +func (client *Client) GetChatActiveStories(req *GetChatActiveStoriesRequest) (*ChatActiveStories, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getChatActiveStories", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChatActiveStories(result.Data) +} + +type GetChatPinnedStoriesRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // Identifier of the story starting from which stories must be returned; use 0 to get results from the last story + FromStoryId int32 `json:"from_story_id"` + // The maximum number of stories to be returned For optimal performance, the number of returned stories is chosen by TDLib and can be smaller than the specified limit + Limit int32 `json:"limit"` +} + +// Returns the list of pinned stories posted by the given chat. The stories are returned in a reverse chronological order (i.e., in order of decreasing story_id). For optimal performance, the number of returned stories is chosen by TDLib +func (client *Client) GetChatPinnedStories(req *GetChatPinnedStoriesRequest) (*Stories, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getChatPinnedStories", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "from_story_id": req.FromStoryId, + "limit": req.Limit, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalStories(result.Data) +} + +type GetChatArchivedStoriesRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // Identifier of the story starting from which stories must be returned; use 0 to get results from the last story + FromStoryId int32 `json:"from_story_id"` + // The maximum number of stories to be returned For optimal performance, the number of returned stories is chosen by TDLib and can be smaller than the specified limit + Limit int32 `json:"limit"` +} + +// Returns the list of all stories posted by the given chat; requires can_edit_stories right in the chat. The stories are returned in a reverse chronological order (i.e., in order of decreasing story_id). For optimal performance, the number of returned stories is chosen by TDLib +func (client *Client) GetChatArchivedStories(req *GetChatArchivedStoriesRequest) (*Stories, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getChatArchivedStories", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "from_story_id": req.FromStoryId, + "limit": req.Limit, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalStories(result.Data) +} + +type OpenStoryRequest struct { + // The identifier of the sender of the opened story + StorySenderChatId int64 `json:"story_sender_chat_id"` + // The identifier of the story + StoryId int32 `json:"story_id"` +} + +// Informs TDLib that a story is opened and is being viewed by the user +func (client *Client) OpenStory(req *OpenStoryRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "openStory", + }, + Data: map[string]interface{}{ + "story_sender_chat_id": req.StorySenderChatId, + "story_id": req.StoryId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type CloseStoryRequest struct { + // The identifier of the sender of the story to close + StorySenderChatId int64 `json:"story_sender_chat_id"` + // The identifier of the story + StoryId int32 `json:"story_id"` +} + +// Informs TDLib that a story is closed by the user +func (client *Client) CloseStory(req *CloseStoryRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "closeStory", + }, + Data: map[string]interface{}{ + "story_sender_chat_id": req.StorySenderChatId, + "story_id": req.StoryId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type GetStoryAvailableReactionsRequest struct { + // Number of reaction per row, 5-25 + RowSize int32 `json:"row_size"` +} + +// Returns reactions, which can be chosen for a story +func (client *Client) GetStoryAvailableReactions(req *GetStoryAvailableReactionsRequest) (*AvailableReactions, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getStoryAvailableReactions", + }, + Data: map[string]interface{}{ + "row_size": req.RowSize, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalAvailableReactions(result.Data) +} + +type SetStoryReactionRequest struct { + // The identifier of the sender of the story + StorySenderChatId int64 `json:"story_sender_chat_id"` + // The identifier of the story + StoryId int32 `json:"story_id"` + // Type of the reaction to set; pass null to remove the reaction. `reactionTypeCustomEmoji` reactions can be used only by Telegram Premium users + ReactionType ReactionType `json:"reaction_type"` + // Pass true if the reaction needs to be added to recent reactions + UpdateRecentReactions bool `json:"update_recent_reactions"` +} + +// Changes chosen reaction on a story that has already been sent +func (client *Client) SetStoryReaction(req *SetStoryReactionRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setStoryReaction", + }, + Data: map[string]interface{}{ + "story_sender_chat_id": req.StorySenderChatId, + "story_id": req.StoryId, + "reaction_type": req.ReactionType, + "update_recent_reactions": req.UpdateRecentReactions, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type GetStoryInteractionsRequest struct { + // Story identifier + StoryId int32 `json:"story_id"` + // Query to search for in names, usernames and titles; may be empty to get all relevant interactions + Query string `json:"query"` + // Pass true to get only interactions by contacts; pass false to get all relevant interactions + OnlyContacts bool `json:"only_contacts"` + // Pass true to get forwards and reposts first, then reactions, then other views; pass false to get interactions sorted just by interaction date + PreferForwards bool `json:"prefer_forwards"` + // Pass true to get interactions with reaction first; pass false to get interactions sorted just by interaction date. Ignored if prefer_forwards == true + PreferWithReaction bool `json:"prefer_with_reaction"` + // Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results + Offset string `json:"offset"` + // The maximum number of story interactions to return + Limit int32 `json:"limit"` +} + +// Returns interactions with a story. The method can be called only for stories posted on behalf of the current user +func (client *Client) GetStoryInteractions(req *GetStoryInteractionsRequest) (*StoryInteractions, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getStoryInteractions", + }, + Data: map[string]interface{}{ + "story_id": req.StoryId, + "query": req.Query, + "only_contacts": req.OnlyContacts, + "prefer_forwards": req.PreferForwards, + "prefer_with_reaction": req.PreferWithReaction, + "offset": req.Offset, + "limit": req.Limit, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalStoryInteractions(result.Data) +} + +type GetChatStoryInteractionsRequest struct { + // The identifier of the sender of the story + StorySenderChatId int64 `json:"story_sender_chat_id"` + // Story identifier + StoryId int32 `json:"story_id"` + // Pass the default heart reaction or a suggested reaction type to receive only interactions with the specified reaction type; pass null to receive all interactions + ReactionType ReactionType `json:"reaction_type"` + // Pass true to get forwards and reposts first, then reactions, then other views; pass false to get interactions sorted just by interaction date + PreferForwards bool `json:"prefer_forwards"` + // Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results + Offset string `json:"offset"` + // The maximum number of story interactions to return + Limit int32 `json:"limit"` +} + +// Returns interactions with a story posted in a chat. Can be used only if story is posted on behalf of a chat and the user is an administrator in the chat +func (client *Client) GetChatStoryInteractions(req *GetChatStoryInteractionsRequest) (*StoryInteractions, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getChatStoryInteractions", + }, + Data: map[string]interface{}{ + "story_sender_chat_id": req.StorySenderChatId, + "story_id": req.StoryId, + "reaction_type": req.ReactionType, + "prefer_forwards": req.PreferForwards, + "offset": req.Offset, + "limit": req.Limit, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalStoryInteractions(result.Data) +} + +type ReportStoryRequest struct { + // The identifier of the sender of the story to report + StorySenderChatId int64 `json:"story_sender_chat_id"` + // The identifier of the story to report + StoryId int32 `json:"story_id"` + // The reason for reporting the story + Reason ReportReason `json:"reason"` + // Additional report details; 0-1024 characters + Text string `json:"text"` +} + +// Reports a story to the Telegram moderators +func (client *Client) ReportStory(req *ReportStoryRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "reportStory", + }, + Data: map[string]interface{}{ + "story_sender_chat_id": req.StorySenderChatId, + "story_id": req.StoryId, + "reason": req.Reason, + "text": req.Text, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +// Activates stealth mode for stories, which hides all views of stories from the current user in the last "story_stealth_mode_past_period" seconds and for the next "story_stealth_mode_future_period" seconds; for Telegram Premium users only +func (client *Client) ActivateStoryStealthMode() (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "activateStoryStealthMode", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type GetStoryPublicForwardsRequest struct { + // The identifier of the sender of the story + StorySenderChatId int64 `json:"story_sender_chat_id"` + // The identifier of the story + StoryId int32 `json:"story_id"` + // Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results + Offset string `json:"offset"` + // The maximum number of messages and stories to be returned; must be positive and can't be greater than 100. For optimal performance, the number of returned objects is chosen by TDLib and can be smaller than the specified limit + Limit int32 `json:"limit"` +} + +// Returns forwards of a story as a message to public chats and reposts by public channels. Can be used only if the story is posted on behalf of the current user or story.can_get_statistics == true. For optimal performance, the number of returned messages and stories is chosen by TDLib +func (client *Client) GetStoryPublicForwards(req *GetStoryPublicForwardsRequest) (*PublicForwards, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getStoryPublicForwards", + }, + Data: map[string]interface{}{ + "story_sender_chat_id": req.StorySenderChatId, + "story_id": req.StoryId, + "offset": req.Offset, + "limit": req.Limit, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalPublicForwards(result.Data) +} + +type GetChatBoostLevelFeaturesRequest struct { + // Pass true to get the list of features for channels; pass false to get the list of features for supergroups + IsChannel bool `json:"is_channel"` + // Chat boost level + Level int32 `json:"level"` +} + +// Returns list of features available on the specific chat boost level; this is an offline request +func (client *Client) GetChatBoostLevelFeatures(req *GetChatBoostLevelFeaturesRequest) (*ChatBoostLevelFeatures, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getChatBoostLevelFeatures", + }, + Data: map[string]interface{}{ + "is_channel": req.IsChannel, + "level": req.Level, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChatBoostLevelFeatures(result.Data) +} + +type GetChatBoostFeaturesRequest struct { + // Pass true to get the list of features for channels; pass false to get the list of features for supergroups + IsChannel bool `json:"is_channel"` +} + +// Returns list of features available on the first 10 chat boost levels; this is an offline request +func (client *Client) GetChatBoostFeatures(req *GetChatBoostFeaturesRequest) (*ChatBoostFeatures, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getChatBoostFeatures", + }, + Data: map[string]interface{}{ + "is_channel": req.IsChannel, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChatBoostFeatures(result.Data) +} + +// Returns the list of available chat boost slots for the current user +func (client *Client) GetAvailableChatBoostSlots() (*ChatBoostSlots, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getAvailableChatBoostSlots", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChatBoostSlots(result.Data) +} + +type GetChatBoostStatusRequest struct { + // Identifier of the chat + ChatId int64 `json:"chat_id"` +} + +// Returns the current boost status for a supergroup or a channel chat +func (client *Client) GetChatBoostStatus(req *GetChatBoostStatusRequest) (*ChatBoostStatus, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getChatBoostStatus", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChatBoostStatus(result.Data) +} + +type BoostChatRequest struct { + // Identifier of the chat + ChatId int64 `json:"chat_id"` + // Identifiers of boost slots of the current user from which to apply boosts to the chat + SlotIds []int32 `json:"slot_ids"` +} + +// Boosts a chat and returns the list of available chat boost slots for the current user after the boost +func (client *Client) BoostChat(req *BoostChatRequest) (*ChatBoostSlots, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "boostChat", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "slot_ids": req.SlotIds, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChatBoostSlots(result.Data) +} + +type GetChatBoostLinkRequest struct { + // Identifier of the chat + ChatId int64 `json:"chat_id"` +} + +// Returns an HTTPS link to boost the specified supergroup or channel chat +func (client *Client) GetChatBoostLink(req *GetChatBoostLinkRequest) (*ChatBoostLink, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getChatBoostLink", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChatBoostLink(result.Data) +} + +type GetChatBoostLinkInfoRequest struct { + // The link to boost a chat + Url string `json:"url"` +} + +// Returns information about a link to boost a chat. Can be called for any internal link of the type internalLinkTypeChatBoost +func (client *Client) GetChatBoostLinkInfo(req *GetChatBoostLinkInfoRequest) (*ChatBoostLinkInfo, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getChatBoostLinkInfo", + }, + Data: map[string]interface{}{ + "url": req.Url, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChatBoostLinkInfo(result.Data) +} + +type GetChatBoostsRequest struct { + // Identifier of the chat + ChatId int64 `json:"chat_id"` + // Pass true to receive only boosts received from gift codes and giveaways created by the chat + OnlyGiftCodes bool `json:"only_gift_codes"` + // Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results + Offset string `json:"offset"` + // The maximum number of boosts to be returned; up to 100. For optimal performance, the number of returned boosts can be smaller than the specified limit + Limit int32 `json:"limit"` +} + +// Returns list of boosts applied to a chat; requires administrator rights in the chat +func (client *Client) GetChatBoosts(req *GetChatBoostsRequest) (*FoundChatBoosts, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getChatBoosts", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "only_gift_codes": req.OnlyGiftCodes, + "offset": req.Offset, + "limit": req.Limit, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalFoundChatBoosts(result.Data) +} + +type GetUserChatBoostsRequest struct { + // Identifier of the chat + ChatId int64 `json:"chat_id"` + // Identifier of the user + UserId int64 `json:"user_id"` +} + +// Returns list of boosts applied to a chat by a given user; requires administrator rights in the chat; for bots only +func (client *Client) GetUserChatBoosts(req *GetUserChatBoostsRequest) (*FoundChatBoosts, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getUserChatBoosts", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "user_id": req.UserId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalFoundChatBoosts(result.Data) +} + type GetAttachmentMenuBotRequest struct { // Bot's user identifier BotUserId int64 `json:"bot_user_id"` } -// Returns information about a bot that can be added to attachment menu +// Returns information about a bot that can be added to attachment or side menu func (client *Client) GetAttachmentMenuBot(req *GetAttachmentMenuBotRequest) (*AttachmentMenuBot, error) { result, err := client.Send(Request{ meta: meta{ @@ -7618,7 +10441,7 @@ type ToggleBotIsAddedToAttachmentMenuRequest struct { AllowWriteAccess bool `json:"allow_write_access"` } -// Adds or removes a bot to attachment menu. Bot can be added to attachment menu, only if userTypeBot.can_be_added_to_attachment_menu == true +// Adds or removes a bot to attachment and side menu. Bot can be added to the menu, only if userTypeBot.can_be_added_to_attachment_menu == true func (client *Client) ToggleBotIsAddedToAttachmentMenu(req *ToggleBotIsAddedToAttachmentMenuRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -7641,7 +10464,7 @@ func (client *Client) ToggleBotIsAddedToAttachmentMenu(req *ToggleBotIsAddedToAt return UnmarshalOk(result.Data) } -// Returns up to 8 emoji statuses, which must be shown right after the default Premium Badge in the emoji status list +// Returns up to 8 emoji statuses, which must be shown right after the default Premium Badge in the emoji status list for self status func (client *Client) GetThemedEmojiStatuses() (*EmojiStatuses, error) { result, err := client.Send(Request{ meta: meta{ @@ -7660,7 +10483,7 @@ func (client *Client) GetThemedEmojiStatuses() (*EmojiStatuses, error) { return UnmarshalEmojiStatuses(result.Data) } -// Returns recent emoji statuses +// Returns recent emoji statuses for self status func (client *Client) GetRecentEmojiStatuses() (*EmojiStatuses, error) { result, err := client.Send(Request{ meta: meta{ @@ -7679,7 +10502,7 @@ func (client *Client) GetRecentEmojiStatuses() (*EmojiStatuses, error) { return UnmarshalEmojiStatuses(result.Data) } -// Returns default emoji statuses +// Returns default emoji statuses for self status func (client *Client) GetDefaultEmojiStatuses() (*EmojiStatuses, error) { result, err := client.Send(Request{ meta: meta{ @@ -7698,7 +10521,7 @@ func (client *Client) GetDefaultEmojiStatuses() (*EmojiStatuses, error) { return UnmarshalEmojiStatuses(result.Data) } -// Clears the list of recently used emoji statuses +// Clears the list of recently used emoji statuses for self status func (client *Client) ClearRecentEmojiStatuses() (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -7717,6 +10540,63 @@ func (client *Client) ClearRecentEmojiStatuses() (*Ok, error) { return UnmarshalOk(result.Data) } +// Returns up to 8 emoji statuses, which must be shown in the emoji status list for chats +func (client *Client) GetThemedChatEmojiStatuses() (*EmojiStatuses, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getThemedChatEmojiStatuses", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalEmojiStatuses(result.Data) +} + +// Returns default emoji statuses for chats +func (client *Client) GetDefaultChatEmojiStatuses() (*EmojiStatuses, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getDefaultChatEmojiStatuses", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalEmojiStatuses(result.Data) +} + +// Returns the list of emoji statuses, which can't be used as chat emoji status, even they are from a sticker set with is_allowed_as_chat_emoji_status == true +func (client *Client) GetDisallowedChatEmojiStatuses() (*EmojiStatuses, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getDisallowedChatEmojiStatuses", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalEmojiStatuses(result.Data) +} + type DownloadFileRequest struct { // Identifier of the file to download FileId int32 `json:"file_id"` @@ -7851,7 +10731,7 @@ type PreliminaryUploadFileRequest struct { Priority int32 `json:"priority"` } -// Preliminary uploads a file to the cloud before sending it in a message, which can be useful for uploading of being recorded voice and video notes. Updates updateFile will be used to notify about upload progress and successful completion of the upload. The file will not have a persistent remote identifier until it will be sent in a message +// Preliminary uploads a file to the cloud before sending it in a message, which can be useful for uploading of being recorded voice and video notes. Updates updateFile will be used to notify about upload progress and successful completion of the upload. The file will not have a persistent remote identifier until it is sent in a message func (client *Client) PreliminaryUploadFile(req *PreliminaryUploadFileRequest) (*File, error) { result, err := client.Send(Request{ meta: meta{ @@ -8279,7 +11159,7 @@ func (client *Client) GetMessageFileType(req *GetMessageFileTypeRequest) (Messag } type GetMessageImportConfirmationTextRequest struct { - // Identifier of a chat to which the messages will be imported. It must be an identifier of a private chat with a mutual contact or an identifier of a supergroup chat with can_change_info administrator right + // Identifier of a chat to which the messages will be imported. It must be an identifier of a private chat with a mutual contact or an identifier of a supergroup chat with can_change_info member right ChatId int64 `json:"chat_id"` } @@ -8305,7 +11185,7 @@ func (client *Client) GetMessageImportConfirmationText(req *GetMessageImportConf } type ImportMessagesRequest struct { - // Identifier of a chat to which the messages will be imported. It must be an identifier of a private chat with a mutual contact or an identifier of a supergroup chat with can_change_info administrator right + // Identifier of a chat to which the messages will be imported. It must be an identifier of a private chat with a mutual contact or an identifier of a supergroup chat with can_change_info member right ChatId int64 `json:"chat_id"` // File with messages to import. Only inputFileLocal and inputFileGenerated are supported. The file must not be previously uploaded MessageFile InputFile `json:"message_file"` @@ -9096,11 +11976,11 @@ type CreateVideoChatRequest struct { Title string `json:"title"` // Point in time (Unix timestamp) when the group call is supposed to be started by an administrator; 0 to start the video chat immediately. The date must be at least 10 seconds and at most 8 days in the future StartDate int32 `json:"start_date"` - // Pass true to create an RTMP stream instead of an ordinary video chat; requires creator privileges + // Pass true to create an RTMP stream instead of an ordinary video chat; requires owner privileges IsRtmpStream bool `json:"is_rtmp_stream"` } -// Creates a video chat (a group call bound to a chat). Available only for basic groups, supergroups and channels; requires can_manage_video_chats rights +// Creates a video chat (a group call bound to a chat). Available only for basic groups, supergroups and channels; requires can_manage_video_chats administrator right func (client *Client) CreateVideoChat(req *CreateVideoChatRequest) (*GroupCallId, error) { result, err := client.Send(Request{ meta: meta{ @@ -9129,7 +12009,7 @@ type GetVideoChatRtmpUrlRequest struct { ChatId int64 `json:"chat_id"` } -// Returns RTMP URL for streaming to the chat; requires creator privileges +// Returns RTMP URL for streaming to the chat; requires owner privileges func (client *Client) GetVideoChatRtmpUrl(req *GetVideoChatRtmpUrlRequest) (*RtmpUrl, error) { result, err := client.Send(Request{ meta: meta{ @@ -9155,7 +12035,7 @@ type ReplaceVideoChatRtmpUrlRequest struct { ChatId int64 `json:"chat_id"` } -// Replaces the current RTMP URL for streaming to the chat; requires creator privileges +// Replaces the current RTMP URL for streaming to the chat; requires owner privileges func (client *Client) ReplaceVideoChatRtmpUrl(req *ReplaceVideoChatRtmpUrlRequest) (*RtmpUrl, error) { result, err := client.Send(Request{ meta: meta{ @@ -9235,7 +12115,7 @@ type ToggleGroupCallEnabledStartNotificationRequest struct { EnabledStartNotification bool `json:"enabled_start_notification"` } -// Toggles whether the current user will receive a notification when the group call will start; scheduled group calls only +// Toggles whether the current user will receive a notification when the group call starts; scheduled group calls only func (client *Client) ToggleGroupCallEnabledStartNotification(req *ToggleGroupCallEnabledStartNotificationRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -9453,7 +12333,7 @@ type InviteGroupCallParticipantsRequest struct { UserIds []int64 `json:"user_ids"` } -// Invites users to an active group call. Sends a service message of type messageInviteToGroupCall for video chats +// Invites users to an active group call. Sends a service message of type messageInviteVideoChatParticipants for video chats func (client *Client) InviteGroupCallParticipants(req *InviteGroupCallParticipantsRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -9686,7 +12566,7 @@ type ToggleGroupCallParticipantIsMutedRequest struct { GroupCallId int32 `json:"group_call_id"` // Participant identifier ParticipantId MessageSender `json:"participant_id"` - // Pass true to mute the user; pass false to unmute the them + // Pass true to mute the user; pass false to unmute them IsMuted bool `json:"is_muted"` } @@ -9922,22 +12802,22 @@ func (client *Client) GetGroupCallStreamSegment(req *GetGroupCallStreamSegmentRe return UnmarshalFilePart(result.Data) } -type ToggleMessageSenderIsBlockedRequest struct { +type SetMessageSenderBlockListRequest struct { // Identifier of a message sender to block/unblock SenderId MessageSender `json:"sender_id"` - // New value of is_blocked - IsBlocked bool `json:"is_blocked"` + // New block list for the message sender; pass null to unblock the message sender + BlockList BlockList `json:"block_list"` } -// Changes the block state of a message sender. Currently, only users and supergroup chats can be blocked -func (client *Client) ToggleMessageSenderIsBlocked(req *ToggleMessageSenderIsBlockedRequest) (*Ok, error) { +// Changes the block list of a message sender. Currently, only users and supergroup chats can be blocked +func (client *Client) SetMessageSenderBlockList(req *SetMessageSenderBlockListRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ - Type: "toggleMessageSenderIsBlocked", + Type: "setMessageSenderBlockList", }, Data: map[string]interface{}{ "sender_id": req.SenderId, - "is_blocked": req.IsBlocked, + "block_list": req.BlockList, }, }) if err != nil { @@ -9987,6 +12867,8 @@ func (client *Client) BlockMessageSenderFromReplies(req *BlockMessageSenderFromR } type GetBlockedMessageSendersRequest struct { + // Block list from which to return users + BlockList BlockList `json:"block_list"` // Number of users and chats to skip in the result; must be non-negative Offset int32 `json:"offset"` // The maximum number of users and chats to return; up to 100 @@ -10000,8 +12882,9 @@ func (client *Client) GetBlockedMessageSenders(req *GetBlockedMessageSendersRequ Type: "getBlockedMessageSenders", }, Data: map[string]interface{}{ - "offset": req.Offset, - "limit": req.Limit, + "block_list": req.BlockList, + "offset": req.Offset, + "limit": req.Limit, }, }) if err != nil { @@ -10070,7 +12953,7 @@ func (client *Client) ImportContacts(req *ImportContactsRequest) (*ImportedConta return UnmarshalImportedContacts(result.Data) } -// Returns all user contacts +// Returns all contacts of the user func (client *Client) GetContacts() (*Users, error) { result, err := client.Send(Request{ meta: meta{ @@ -10208,6 +13091,51 @@ func (client *Client) ClearImportedContacts() (*Ok, error) { return UnmarshalOk(result.Data) } +type SetCloseFriendsRequest struct { + // User identifiers of close friends; the users must be contacts of the current user + UserIds []int64 `json:"user_ids"` +} + +// Changes the list of close friends of the current user +func (client *Client) SetCloseFriends(req *SetCloseFriendsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setCloseFriends", + }, + Data: map[string]interface{}{ + "user_ids": req.UserIds, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +// Returns all close friends of the current user +func (client *Client) GetCloseFriends() (*Users, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getCloseFriends", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalUsers(result.Data) +} + type SetUserPersonalProfilePhotoRequest struct { // User identifier UserId int64 `json:"user_id"` @@ -10353,7 +13281,7 @@ func (client *Client) GetUserProfilePhotos(req *GetUserProfilePhotosRequest) (*C type GetStickersRequest struct { // Type of the stickers to return StickerType StickerType `json:"sticker_type"` - // Search query; an emoji or a keyword prefix. If empty, returns all known installed stickers + // Search query; a space-separated list of emoji or a keyword prefix. If empty, returns all known installed stickers Query string `json:"query"` // The maximum number of stickers to be returned Limit int32 `json:"limit"` @@ -10361,7 +13289,7 @@ type GetStickersRequest struct { ChatId int64 `json:"chat_id"` } -// Returns stickers from the installed sticker sets that correspond to a given emoji or can be found by sticker-specific keywords. If the query is non-empty, then favorite, recently used or trending stickers may also be returned +// Returns stickers from the installed sticker sets that correspond to any of the given emoji or can be found by sticker-specific keywords. If the query is non-empty, then favorite, recently used or trending stickers may also be returned func (client *Client) GetStickers(req *GetStickersRequest) (*Stickers, error) { result, err := client.Send(Request{ meta: meta{ @@ -10385,22 +13313,60 @@ func (client *Client) GetStickers(req *GetStickersRequest) (*Stickers, error) { return UnmarshalStickers(result.Data) } +type GetAllStickerEmojisRequest struct { + // Type of the stickers to search for + StickerType StickerType `json:"sticker_type"` + // Search query + Query string `json:"query"` + // Chat identifier for which to find stickers + ChatId int64 `json:"chat_id"` + // Pass true if only main emoji for each found sticker must be included in the result + ReturnOnlyMainEmoji bool `json:"return_only_main_emoji"` +} + +// Returns unique emoji that correspond to stickers to be found by the getStickers(sticker_type, query, 1000000, chat_id) +func (client *Client) GetAllStickerEmojis(req *GetAllStickerEmojisRequest) (*Emojis, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getAllStickerEmojis", + }, + Data: map[string]interface{}{ + "sticker_type": req.StickerType, + "query": req.Query, + "chat_id": req.ChatId, + "return_only_main_emoji": req.ReturnOnlyMainEmoji, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalEmojis(result.Data) +} + type SearchStickersRequest struct { - // String representation of emoji; must be non-empty - Emoji string `json:"emoji"` + // Type of the stickers to return + StickerType StickerType `json:"sticker_type"` + // Space-separated list of emoji to search for; must be non-empty + Emojis string `json:"emojis"` // The maximum number of stickers to be returned; 0-100 Limit int32 `json:"limit"` } -// Searches for stickers from public sticker sets that correspond to a given emoji +// Searches for stickers from public sticker sets that correspond to any of the given emoji func (client *Client) SearchStickers(req *SearchStickersRequest) (*Stickers, error) { result, err := client.Send(Request{ meta: meta{ Type: "searchStickers", }, Data: map[string]interface{}{ - "emoji": req.Emoji, - "limit": req.Limit, + "sticker_type": req.StickerType, + "emojis": req.Emojis, + "limit": req.Limit, }, }) if err != nil { @@ -10469,7 +13435,7 @@ func (client *Client) GetInstalledStickerSets(req *GetInstalledStickerSetsReques type GetArchivedStickerSetsRequest struct { // Type of the sticker sets to return StickerType StickerType `json:"sticker_type"` - // Identifier of the sticker set from which to return the result + // Identifier of the sticker set from which to return the result; use 0 to get results from the beginning OffsetStickerSetId JsonInt64 `json:"offset_sticker_set_id"` // The maximum number of sticker sets to return; up to 100 Limit int32 `json:"limit"` @@ -10641,18 +13607,21 @@ func (client *Client) SearchInstalledStickerSets(req *SearchInstalledStickerSets } type SearchStickerSetsRequest struct { + // Type of the sticker sets to return + StickerType StickerType `json:"sticker_type"` // Query to search for Query string `json:"query"` } -// Searches for ordinary sticker sets by looking for specified query in their title and name. Excludes installed sticker sets from the results +// Searches for sticker sets by looking for specified query in their title and name. Excludes installed sticker sets from the results func (client *Client) SearchStickerSets(req *SearchStickerSetsRequest) (*StickerSets, error) { result, err := client.Send(Request{ meta: meta{ Type: "searchStickerSets", }, Data: map[string]interface{}{ - "query": req.Query, + "sticker_type": req.StickerType, + "query": req.Query, }, }) if err != nil { @@ -10786,7 +13755,7 @@ type AddRecentStickerRequest struct { Sticker InputFile `json:"sticker"` } -// Manually adds a new sticker to the list of recently used stickers. The new sticker is added to the top of the list. If the sticker was already in the list, it is removed from the list first. Only stickers belonging to a sticker set can be added to this list. Emoji stickers can't be added to recent stickers +// Manually adds a new sticker to the list of recently used stickers. The new sticker is added to the top of the list. If the sticker was already in the list, it is removed from the list first. Only stickers belonging to a sticker set or in WEBP or WEBM format can be added to this list. Emoji stickers can't be added to recent stickers func (client *Client) AddRecentSticker(req *AddRecentStickerRequest) (*Stickers, error) { result, err := client.Send(Request{ meta: meta{ @@ -10887,7 +13856,7 @@ type AddFavoriteStickerRequest struct { Sticker InputFile `json:"sticker"` } -// Adds a new sticker to the list of favorite stickers. The new sticker is added to the top of the list. If the sticker was already in the list, it is removed from the list first. Only stickers belonging to a sticker set can be added to this list. Emoji stickers can't be added to favorite stickers +// Adds a new sticker to the list of favorite stickers. The new sticker is added to the top of the list. If the sticker was already in the list, it is removed from the list first. Only stickers belonging to a sticker set or in WEBP or WEBM format can be added to this list. Emoji stickers can't be added to favorite stickers func (client *Client) AddFavoriteSticker(req *AddFavoriteStickerRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -10963,21 +13932,47 @@ func (client *Client) GetStickerEmojis(req *GetStickerEmojisRequest) (*Emojis, e type SearchEmojisRequest struct { // Text to search for Text string `json:"text"` - // Pass true if only emojis, which exactly match the text, needs to be returned - ExactMatch bool `json:"exact_match"` // List of possible IETF language tags of the user's input language; may be empty if unknown InputLanguageCodes []string `json:"input_language_codes"` } -// Searches for emojis by keywords. Supported only if the file database is enabled -func (client *Client) SearchEmojis(req *SearchEmojisRequest) (*Emojis, error) { +// Searches for emojis by keywords. Supported only if the file database is enabled. Order of results is unspecified +func (client *Client) SearchEmojis(req *SearchEmojisRequest) (*EmojiKeywords, error) { result, err := client.Send(Request{ meta: meta{ Type: "searchEmojis", }, Data: map[string]interface{}{ "text": req.Text, - "exact_match": req.ExactMatch, + "input_language_codes": req.InputLanguageCodes, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalEmojiKeywords(result.Data) +} + +type GetKeywordEmojisRequest struct { + // Text to search for + Text string `json:"text"` + // List of possible IETF language tags of the user's input language; may be empty if unknown + InputLanguageCodes []string `json:"input_language_codes"` +} + +// Return emojis matching the keyword. Supported only if the file database is enabled. Order of results is unspecified +func (client *Client) GetKeywordEmojis(req *GetKeywordEmojisRequest) (*Emojis, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getKeywordEmojis", + }, + Data: map[string]interface{}{ + "text": req.Text, "input_language_codes": req.InputLanguageCodes, }, }) @@ -10992,6 +13987,32 @@ func (client *Client) SearchEmojis(req *SearchEmojisRequest) (*Emojis, error) { return UnmarshalEmojis(result.Data) } +type GetEmojiCategoriesRequest struct { + // Type of emoji categories to return; pass null to get default emoji categories + Type EmojiCategoryType `json:"type"` +} + +// Returns available emojis categories +func (client *Client) GetEmojiCategories(req *GetEmojiCategoriesRequest) (*EmojiCategories, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getEmojiCategories", + }, + Data: map[string]interface{}{ + "type": req.Type, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalEmojiCategories(result.Data) +} + type GetAnimatedEmojiRequest struct { // The emoji Emoji string `json:"emoji"` @@ -11070,6 +14091,63 @@ func (client *Client) GetCustomEmojiStickers(req *GetCustomEmojiStickersRequest) return UnmarshalStickers(result.Data) } +// Returns default list of custom emoji stickers for placing on a chat photo +func (client *Client) GetDefaultChatPhotoCustomEmojiStickers() (*Stickers, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getDefaultChatPhotoCustomEmojiStickers", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalStickers(result.Data) +} + +// Returns default list of custom emoji stickers for placing on a profile photo +func (client *Client) GetDefaultProfilePhotoCustomEmojiStickers() (*Stickers, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getDefaultProfilePhotoCustomEmojiStickers", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalStickers(result.Data) +} + +// Returns default list of custom emoji stickers for reply background +func (client *Client) GetDefaultBackgroundCustomEmojiStickers() (*Stickers, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getDefaultBackgroundCustomEmojiStickers", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalStickers(result.Data) +} + // Returns saved animations func (client *Client) GetSavedAnimations() (*Animations, error) { result, err := client.Send(Request{ @@ -11218,16 +14296,19 @@ func (client *Client) RemoveRecentHashtag(req *RemoveRecentHashtagRequest) (*Ok, type GetWebPagePreviewRequest struct { // Message text with formatting Text *FormattedText `json:"text"` + // Options to be used for generation of the link preview; pass null to use default link preview options + LinkPreviewOptions *LinkPreviewOptions `json:"link_preview_options"` } -// Returns a web page preview by the text of the message. Do not call this function too often. Returns a 404 error if the web page has no preview +// Returns a link preview by the text of a message. Do not call this function too often. Returns a 404 error if the text has no link preview func (client *Client) GetWebPagePreview(req *GetWebPagePreviewRequest) (*WebPage, error) { result, err := client.Send(Request{ meta: meta{ Type: "getWebPagePreview", }, Data: map[string]interface{}{ - "text": req.Text, + "text": req.Text, + "link_preview_options": req.LinkPreviewOptions, }, }) if err != nil { @@ -11325,6 +14406,64 @@ func (client *Client) DeleteProfilePhoto(req *DeleteProfilePhotoRequest) (*Ok, e return UnmarshalOk(result.Data) } +type SetAccentColorRequest struct { + // Identifier of the accent color to use + AccentColorId int32 `json:"accent_color_id"` + // Identifier of a custom emoji to be shown on the reply header and link preview background; 0 if none + BackgroundCustomEmojiId JsonInt64 `json:"background_custom_emoji_id"` +} + +// Changes accent color and background custom emoji for the current user; for Telegram Premium users only +func (client *Client) SetAccentColor(req *SetAccentColorRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setAccentColor", + }, + Data: map[string]interface{}{ + "accent_color_id": req.AccentColorId, + "background_custom_emoji_id": req.BackgroundCustomEmojiId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type SetProfileAccentColorRequest struct { + // Identifier of the accent color to use for profile; pass -1 if none + ProfileAccentColorId int32 `json:"profile_accent_color_id"` + // Identifier of a custom emoji to be shown on the user's profile photo background; 0 if none + ProfileBackgroundCustomEmojiId JsonInt64 `json:"profile_background_custom_emoji_id"` +} + +// Changes accent color and background custom emoji for profile of the current user; for Telegram Premium users only +func (client *Client) SetProfileAccentColor(req *SetProfileAccentColorRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setProfileAccentColor", + }, + Data: map[string]interface{}{ + "profile_accent_color_id": req.ProfileAccentColorId, + "profile_background_custom_emoji_id": req.ProfileBackgroundCustomEmojiId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type SetNameRequest struct { // The new value of the first name for the current user; 1-64 characters FirstName string `json:"first_name"` @@ -11461,11 +14600,61 @@ func (client *Client) ReorderActiveUsernames(req *ReorderActiveUsernamesRequest) return UnmarshalOk(result.Data) } +type SetBirthdateRequest struct { + // The new value of the current user's birthdate; pass null to remove the birthdate + Birthdate *Birthdate `json:"birthdate"` +} + +// Changes the birthdate of the current user +func (client *Client) SetBirthdate(req *SetBirthdateRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setBirthdate", + }, + Data: map[string]interface{}{ + "birthdate": req.Birthdate, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type SetPersonalChatRequest struct { + // Identifier of the new personal chat; pass 0 to remove the chat. Use getSuitablePersonalChats to get suitable chats + ChatId int64 `json:"chat_id"` +} + +// Changes the personal chat of the current user +func (client *Client) SetPersonalChat(req *SetPersonalChatRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setPersonalChat", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type SetEmojiStatusRequest struct { // New emoji status; pass null to switch to the default badge EmojiStatus *EmojiStatus `json:"emoji_status"` - // Duration of the status, in seconds; pass 0 to keep the status active until it will be changed manually - Duration int32 `json:"duration"` } // Changes the emoji status of the current user; for Telegram Premium users only @@ -11476,7 +14665,6 @@ func (client *Client) SetEmojiStatus(req *SetEmojiStatusRequest) (*Ok, error) { }, Data: map[string]interface{}{ "emoji_status": req.EmojiStatus, - "duration": req.Duration, }, }) if err != nil { @@ -11495,7 +14683,7 @@ type SetLocationRequest struct { Location *Location `json:"location"` } -// Changes the location of the current user. Needs to be called if getOption("is_location_visible") is true and location changes for more than 1 kilometer +// Changes the location of the current user. Needs to be called if getOption("is_location_visible") is true and location changes for more than 1 kilometer. Must not be called if the user has a business location func (client *Client) SetLocation(req *SetLocationRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -11516,6 +14704,136 @@ func (client *Client) SetLocation(req *SetLocationRequest) (*Ok, error) { return UnmarshalOk(result.Data) } +type SetBusinessLocationRequest struct { + // The new location of the business; pass null to remove the location + Location *BusinessLocation `json:"location"` +} + +// Changes the business location of the current user. Requires Telegram Business subscription +func (client *Client) SetBusinessLocation(req *SetBusinessLocationRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setBusinessLocation", + }, + Data: map[string]interface{}{ + "location": req.Location, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type SetBusinessOpeningHoursRequest struct { + // The new opening hours of the business; pass null to remove the opening hours; up to 28 time intervals can be specified + OpeningHours *BusinessOpeningHours `json:"opening_hours"` +} + +// Changes the business opening hours of the current user. Requires Telegram Business subscription +func (client *Client) SetBusinessOpeningHours(req *SetBusinessOpeningHoursRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setBusinessOpeningHours", + }, + Data: map[string]interface{}{ + "opening_hours": req.OpeningHours, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type SetBusinessGreetingMessageSettingsRequest struct { + // The new settings for the greeting message of the business; pass null to disable the greeting message + GreetingMessageSettings *BusinessGreetingMessageSettings `json:"greeting_message_settings"` +} + +// Changes the business greeting message settings of the current user. Requires Telegram Business subscription +func (client *Client) SetBusinessGreetingMessageSettings(req *SetBusinessGreetingMessageSettingsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setBusinessGreetingMessageSettings", + }, + Data: map[string]interface{}{ + "greeting_message_settings": req.GreetingMessageSettings, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type SetBusinessAwayMessageSettingsRequest struct { + // The new settings for the away message of the business; pass null to disable the away message + AwayMessageSettings *BusinessAwayMessageSettings `json:"away_message_settings"` +} + +// Changes the business away message settings of the current user. Requires Telegram Business subscription +func (client *Client) SetBusinessAwayMessageSettings(req *SetBusinessAwayMessageSettingsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setBusinessAwayMessageSettings", + }, + Data: map[string]interface{}{ + "away_message_settings": req.AwayMessageSettings, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type SetBusinessIntroRequest struct { + // The new intro of the business; pass null to remove the intro + Intro *InputBusinessIntro `json:"intro"` +} + +// Changes the business intro of the current user. Requires Telegram Business subscription +func (client *Client) SetBusinessIntro(req *SetBusinessIntroRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setBusinessIntro", + }, + Data: map[string]interface{}{ + "intro": req.Intro, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type ChangePhoneNumberRequest struct { // The new phone number of the user in international format PhoneNumber string `json:"phone_number"` @@ -11523,7 +14841,7 @@ type ChangePhoneNumberRequest struct { Settings *PhoneNumberAuthenticationSettings `json:"settings"` } -// Changes the phone number of the user and sends an authentication code to the user's new phone number. On success, returns information about the sent code +// Changes the phone number of the user and sends an authentication code to the user's new phone number; for official Android and iOS applications only. On success, returns information about the sent code func (client *Client) ChangePhoneNumber(req *ChangePhoneNumberRequest) (*AuthenticationCodeInfo, error) { result, err := client.Send(Request{ meta: meta{ @@ -11590,6 +14908,77 @@ func (client *Client) CheckChangePhoneNumberCode(req *CheckChangePhoneNumberCode return UnmarshalOk(result.Data) } +// Returns the business bot that is connected to the current user account. Returns a 404 error if there is no connected bot +func (client *Client) GetBusinessConnectedBot() (*BusinessConnectedBot, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getBusinessConnectedBot", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalBusinessConnectedBot(result.Data) +} + +type SetBusinessConnectedBotRequest struct { + // Connection settings for the bot + Bot *BusinessConnectedBot `json:"bot"` +} + +// Adds or changes business bot that is connected to the current user account +func (client *Client) SetBusinessConnectedBot(req *SetBusinessConnectedBotRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setBusinessConnectedBot", + }, + Data: map[string]interface{}{ + "bot": req.Bot, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type DeleteBusinessConnectedBotRequest struct { + // Unique user identifier for the bot + BotUserId int64 `json:"bot_user_id"` +} + +// Deletes the business bot that is connected to the current user account +func (client *Client) DeleteBusinessConnectedBot(req *DeleteBusinessConnectedBotRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "deleteBusinessConnectedBot", + }, + Data: map[string]interface{}{ + "bot_user_id": req.BotUserId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + // Returns an HTTPS link, which can be used to get information about the current user func (client *Client) GetUserLink() (*UserLink, error) { result, err := client.Send(Request{ @@ -11703,7 +15092,7 @@ type GetCommandsRequest struct { LanguageCode string `json:"language_code"` } -// Returns the list of commands supported by the bot for the given user scope and language; for bots only +// Returns list of commands supported by the bot for the given user scope and language; for bots only func (client *Client) GetCommands(req *GetCommandsRequest) (*BotCommands, error) { result, err := client.Send(Request{ meta: meta{ @@ -11781,7 +15170,7 @@ func (client *Client) GetMenuButton(req *GetMenuButtonRequest) (*BotMenuButton, } type SetDefaultGroupAdministratorRightsRequest struct { - // Default administrator rights for adding the bot to basic group and supergroup chats; may be null + // Default administrator rights for adding the bot to basic group and supergroup chats; pass null to remove default rights DefaultGroupAdministratorRights *ChatAdministratorRights `json:"default_group_administrator_rights"` } @@ -11807,7 +15196,7 @@ func (client *Client) SetDefaultGroupAdministratorRights(req *SetDefaultGroupAdm } type SetDefaultChannelAdministratorRightsRequest struct { - // Default administrator rights for adding the bot to channels; may be null + // Default administrator rights for adding the bot to channels; pass null to remove default rights DefaultChannelAdministratorRights *ChatAdministratorRights `json:"default_channel_administrator_rights"` } @@ -11832,6 +15221,363 @@ func (client *Client) SetDefaultChannelAdministratorRights(req *SetDefaultChanne return UnmarshalOk(result.Data) } +type CanBotSendMessagesRequest struct { + // Identifier of the target bot + BotUserId int64 `json:"bot_user_id"` +} + +// Checks whether the specified bot can send messages to the user. Returns a 404 error if can't and the access can be granted by call to allowBotToSendMessages +func (client *Client) CanBotSendMessages(req *CanBotSendMessagesRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "canBotSendMessages", + }, + Data: map[string]interface{}{ + "bot_user_id": req.BotUserId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type AllowBotToSendMessagesRequest struct { + // Identifier of the target bot + BotUserId int64 `json:"bot_user_id"` +} + +// Allows the specified bot to send messages to the user +func (client *Client) AllowBotToSendMessages(req *AllowBotToSendMessagesRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "allowBotToSendMessages", + }, + Data: map[string]interface{}{ + "bot_user_id": req.BotUserId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type SendWebAppCustomRequestRequest struct { + // Identifier of the bot + BotUserId int64 `json:"bot_user_id"` + // The method name + Method string `json:"method"` + // JSON-serialized method parameters + Parameters string `json:"parameters"` +} + +// Sends a custom request from a Web App +func (client *Client) SendWebAppCustomRequest(req *SendWebAppCustomRequestRequest) (*CustomRequestResult, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "sendWebAppCustomRequest", + }, + Data: map[string]interface{}{ + "bot_user_id": req.BotUserId, + "method": req.Method, + "parameters": req.Parameters, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalCustomRequestResult(result.Data) +} + +type SetBotNameRequest struct { + // Identifier of the target bot + BotUserId int64 `json:"bot_user_id"` + // A two-letter ISO 639-1 language code. If empty, the name will be shown to all users for whose languages there is no dedicated name + LanguageCode string `json:"language_code"` + // New bot's name on the specified language; 0-64 characters; must be non-empty if language code is empty + Name string `json:"name"` +} + +// Sets the name of a bot. Can be called only if userTypeBot.can_be_edited == true +func (client *Client) SetBotName(req *SetBotNameRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setBotName", + }, + Data: map[string]interface{}{ + "bot_user_id": req.BotUserId, + "language_code": req.LanguageCode, + "name": req.Name, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type GetBotNameRequest struct { + // Identifier of the target bot + BotUserId int64 `json:"bot_user_id"` + // A two-letter ISO 639-1 language code or an empty string + LanguageCode string `json:"language_code"` +} + +// Returns the name of a bot in the given language. Can be called only if userTypeBot.can_be_edited == true +func (client *Client) GetBotName(req *GetBotNameRequest) (*Text, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getBotName", + }, + Data: map[string]interface{}{ + "bot_user_id": req.BotUserId, + "language_code": req.LanguageCode, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalText(result.Data) +} + +type SetBotProfilePhotoRequest struct { + // Identifier of the target bot + BotUserId int64 `json:"bot_user_id"` + // Profile photo to set; pass null to delete the chat photo + Photo InputChatPhoto `json:"photo"` +} + +// Changes a profile photo for a bot +func (client *Client) SetBotProfilePhoto(req *SetBotProfilePhotoRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setBotProfilePhoto", + }, + Data: map[string]interface{}{ + "bot_user_id": req.BotUserId, + "photo": req.Photo, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type ToggleBotUsernameIsActiveRequest struct { + // Identifier of the target bot + BotUserId int64 `json:"bot_user_id"` + // The username to change + Username string `json:"username"` + // Pass true to activate the username; pass false to disable it + IsActive bool `json:"is_active"` +} + +// Changes active state for a username of a bot. The editable username can't be disabled. May return an error with a message "USERNAMES_ACTIVE_TOO_MUCH" if the maximum number of active usernames has been reached. Can be called only if userTypeBot.can_be_edited == true +func (client *Client) ToggleBotUsernameIsActive(req *ToggleBotUsernameIsActiveRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "toggleBotUsernameIsActive", + }, + Data: map[string]interface{}{ + "bot_user_id": req.BotUserId, + "username": req.Username, + "is_active": req.IsActive, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type ReorderBotActiveUsernamesRequest struct { + // Identifier of the target bot + BotUserId int64 `json:"bot_user_id"` + // The new order of active usernames. All currently active usernames must be specified + Usernames []string `json:"usernames"` +} + +// Changes order of active usernames of a bot. Can be called only if userTypeBot.can_be_edited == true +func (client *Client) ReorderBotActiveUsernames(req *ReorderBotActiveUsernamesRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "reorderBotActiveUsernames", + }, + Data: map[string]interface{}{ + "bot_user_id": req.BotUserId, + "usernames": req.Usernames, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type SetBotInfoDescriptionRequest struct { + // Identifier of the target bot + BotUserId int64 `json:"bot_user_id"` + // A two-letter ISO 639-1 language code. If empty, the description will be shown to all users for whose languages there is no dedicated description + LanguageCode string `json:"language_code"` + // New bot's description on the specified language + Description string `json:"description"` +} + +// Sets the text shown in the chat with a bot if the chat is empty. Can be called only if userTypeBot.can_be_edited == true +func (client *Client) SetBotInfoDescription(req *SetBotInfoDescriptionRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setBotInfoDescription", + }, + Data: map[string]interface{}{ + "bot_user_id": req.BotUserId, + "language_code": req.LanguageCode, + "description": req.Description, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type GetBotInfoDescriptionRequest struct { + // Identifier of the target bot + BotUserId int64 `json:"bot_user_id"` + // A two-letter ISO 639-1 language code or an empty string + LanguageCode string `json:"language_code"` +} + +// Returns the text shown in the chat with a bot if the chat is empty in the given language. Can be called only if userTypeBot.can_be_edited == true +func (client *Client) GetBotInfoDescription(req *GetBotInfoDescriptionRequest) (*Text, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getBotInfoDescription", + }, + Data: map[string]interface{}{ + "bot_user_id": req.BotUserId, + "language_code": req.LanguageCode, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalText(result.Data) +} + +type SetBotInfoShortDescriptionRequest struct { + // Identifier of the target bot + BotUserId int64 `json:"bot_user_id"` + // A two-letter ISO 639-1 language code. If empty, the short description will be shown to all users for whose languages there is no dedicated description + LanguageCode string `json:"language_code"` + // New bot's short description on the specified language + ShortDescription string `json:"short_description"` +} + +// Sets the text shown on a bot's profile page and sent together with the link when users share the bot. Can be called only if userTypeBot.can_be_edited == true +func (client *Client) SetBotInfoShortDescription(req *SetBotInfoShortDescriptionRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setBotInfoShortDescription", + }, + Data: map[string]interface{}{ + "bot_user_id": req.BotUserId, + "language_code": req.LanguageCode, + "short_description": req.ShortDescription, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type GetBotInfoShortDescriptionRequest struct { + // Identifier of the target bot + BotUserId int64 `json:"bot_user_id"` + // A two-letter ISO 639-1 language code or an empty string + LanguageCode string `json:"language_code"` +} + +// Returns the text shown on a bot's profile page and sent together with the link when users share the bot in the given language. Can be called only if userTypeBot.can_be_edited == true +func (client *Client) GetBotInfoShortDescription(req *GetBotInfoShortDescriptionRequest) (*Text, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getBotInfoShortDescription", + }, + Data: map[string]interface{}{ + "bot_user_id": req.BotUserId, + "language_code": req.LanguageCode, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalText(result.Data) +} + // Returns all active sessions of the current user func (client *Client) GetActiveSessions() (*Sessions, error) { result, err := client.Send(Request{ @@ -11896,6 +15642,32 @@ func (client *Client) TerminateAllOtherSessions() (*Ok, error) { return UnmarshalOk(result.Data) } +type ConfirmSessionRequest struct { + // Session identifier + SessionId JsonInt64 `json:"session_id"` +} + +// Confirms an unconfirmed session of the current user from another device +func (client *Client) ConfirmSession(req *ConfirmSessionRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "confirmSession", + }, + Data: map[string]interface{}{ + "session_id": req.SessionId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type ToggleSessionCanAcceptCallsRequest struct { // Session identifier SessionId JsonInt64 `json:"session_id"` @@ -11928,7 +15700,7 @@ func (client *Client) ToggleSessionCanAcceptCalls(req *ToggleSessionCanAcceptCal type ToggleSessionCanAcceptSecretChatsRequest struct { // Session identifier SessionId JsonInt64 `json:"session_id"` - // Pass true to allow accepring secret chats by the session; pass false otherwise + // Pass true to allow accepting secret chats by the session; pass false otherwise CanAcceptSecretChats bool `json:"can_accept_secret_chats"` } @@ -12189,6 +15961,64 @@ func (client *Client) SetSupergroupStickerSet(req *SetSupergroupStickerSetReques return UnmarshalOk(result.Data) } +type SetSupergroupCustomEmojiStickerSetRequest struct { + // Identifier of the supergroup + SupergroupId int64 `json:"supergroup_id"` + // New value of the custom emoji sticker set identifier for the supergroup. Use 0 to remove the custom emoji sticker set in the supergroup + CustomEmojiStickerSetId JsonInt64 `json:"custom_emoji_sticker_set_id"` +} + +// Changes the custom emoji sticker set of a supergroup; requires can_change_info administrator right. The chat must have at least chatBoostFeatures.min_custom_emoji_sticker_set_boost_level boost level to pass the corresponding color +func (client *Client) SetSupergroupCustomEmojiStickerSet(req *SetSupergroupCustomEmojiStickerSetRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setSupergroupCustomEmojiStickerSet", + }, + Data: map[string]interface{}{ + "supergroup_id": req.SupergroupId, + "custom_emoji_sticker_set_id": req.CustomEmojiStickerSetId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type SetSupergroupUnrestrictBoostCountRequest struct { + // Identifier of the supergroup + SupergroupId int64 `json:"supergroup_id"` + // New value of the unrestrict_boost_count supergroup setting; 0-8. Use 0 to remove the setting + UnrestrictBoostCount int32 `json:"unrestrict_boost_count"` +} + +// Changes the number of times the supergroup must be boosted by a user to ignore slow mode and chat permission restrictions; requires can_restrict_members administrator right +func (client *Client) SetSupergroupUnrestrictBoostCount(req *SetSupergroupUnrestrictBoostCountRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setSupergroupUnrestrictBoostCount", + }, + Data: map[string]interface{}{ + "supergroup_id": req.SupergroupId, + "unrestrict_boost_count": req.UnrestrictBoostCount, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type ToggleSupergroupSignMessagesRequest struct { // Identifier of the channel SupergroupId int64 `json:"supergroup_id"` @@ -12196,7 +16026,7 @@ type ToggleSupergroupSignMessagesRequest struct { SignMessages bool `json:"sign_messages"` } -// Toggles whether sender signature is added to sent messages in a channel; requires can_change_info administrator right +// Toggles whether sender signature is added to sent messages in a channel; requires can_change_info member right func (client *Client) ToggleSupergroupSignMessages(req *ToggleSupergroupSignMessagesRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -12283,7 +16113,7 @@ type ToggleSupergroupIsAllHistoryAvailableRequest struct { IsAllHistoryAvailable bool `json:"is_all_history_available"` } -// Toggles whether the message history of a supergroup is available to new members; requires can_change_info administrator right +// Toggles whether the message history of a supergroup is available to new members; requires can_change_info member right func (client *Client) ToggleSupergroupIsAllHistoryAvailable(req *ToggleSupergroupIsAllHistoryAvailableRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -12366,11 +16196,11 @@ func (client *Client) ToggleSupergroupHasAggressiveAntiSpamEnabled(req *ToggleSu type ToggleSupergroupIsForumRequest struct { // Identifier of the supergroup SupergroupId int64 `json:"supergroup_id"` - // New value of is_forum. A supergroup can be converted to a forum, only if it has at least getOption("forum_member_count_min") members + // New value of is_forum IsForum bool `json:"is_forum"` } -// Toggles whether the supergroup is a forum; requires owner privileges in the supergroup +// Toggles whether the supergroup is a forum; requires owner privileges in the supergroup. Discussion supergroups can't be converted to forums func (client *Client) ToggleSupergroupIsForum(req *ToggleSupergroupIsForumRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -12578,6 +16408,25 @@ func (client *Client) GetChatEventLog(req *GetChatEventLogRequest) (*ChatEvents, return UnmarshalChatEvents(result.Data) } +// Returns the list of supported time zones +func (client *Client) GetTimeZones() (*TimeZones, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getTimeZones", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalTimeZones(result.Data) +} + type GetPaymentFormRequest struct { // The invoice InputInvoice InputInvoice `json:"input_invoice"` @@ -12585,7 +16434,7 @@ type GetPaymentFormRequest struct { Theme *ThemeParameters `json:"theme"` } -// Returns an invoice payment form. This method must be called when the user presses inlineKeyboardButtonBuy +// Returns an invoice payment form. This method must be called when the user presses inline button of the type inlineKeyboardButtonTypeBuy func (client *Client) GetPaymentForm(req *GetPaymentFormRequest) (*PaymentForm, error) { result, err := client.Send(Request{ meta: meta{ @@ -12811,36 +16660,10 @@ func (client *Client) GetSupportUser() (*User, error) { return UnmarshalUser(result.Data) } -type GetBackgroundsRequest struct { - // Pass true to order returned backgrounds for a dark theme - ForDarkTheme bool `json:"for_dark_theme"` -} - -// Returns backgrounds installed by the user -func (client *Client) GetBackgrounds(req *GetBackgroundsRequest) (*Backgrounds, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "getBackgrounds", - }, - Data: map[string]interface{}{ - "for_dark_theme": req.ForDarkTheme, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalBackgrounds(result.Data) -} - type GetBackgroundUrlRequest struct { // Background name Name string `json:"name"` - // Background type + // Background type; backgroundTypeChatTheme isn't supported Type BackgroundType `json:"type"` } @@ -12892,20 +16715,20 @@ func (client *Client) SearchBackground(req *SearchBackgroundRequest) (*Backgroun return UnmarshalBackground(result.Data) } -type SetBackgroundRequest struct { - // The input background to use; pass null to create a new filled backgrounds or to remove the current background +type SetDefaultBackgroundRequest struct { + // The input background to use; pass null to create a new filled background Background InputBackground `json:"background"` - // Background type; pass null to use the default type of the remote background or to remove the current background + // Background type; pass null to use the default type of the remote background; backgroundTypeChatTheme isn't supported Type BackgroundType `json:"type"` - // Pass true if the background is changed for a dark theme + // Pass true if the background is set for a dark theme ForDarkTheme bool `json:"for_dark_theme"` } -// Changes the background selected by the user; adds background to the list of installed backgrounds -func (client *Client) SetBackground(req *SetBackgroundRequest) (*Background, error) { +// Sets default background for chats; adds the background to the list of installed backgrounds +func (client *Client) SetDefaultBackground(req *SetDefaultBackgroundRequest) (*Background, error) { result, err := client.Send(Request{ meta: meta{ - Type: "setBackground", + Type: "setDefaultBackground", }, Data: map[string]interface{}{ "background": req.Background, @@ -12924,16 +16747,68 @@ func (client *Client) SetBackground(req *SetBackgroundRequest) (*Background, err return UnmarshalBackground(result.Data) } -type RemoveBackgroundRequest struct { +type DeleteDefaultBackgroundRequest struct { + // Pass true if the background is deleted for a dark theme + ForDarkTheme bool `json:"for_dark_theme"` +} + +// Deletes default background for chats +func (client *Client) DeleteDefaultBackground(req *DeleteDefaultBackgroundRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "deleteDefaultBackground", + }, + Data: map[string]interface{}{ + "for_dark_theme": req.ForDarkTheme, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type GetInstalledBackgroundsRequest struct { + // Pass true to order returned backgrounds for a dark theme + ForDarkTheme bool `json:"for_dark_theme"` +} + +// Returns backgrounds installed by the user +func (client *Client) GetInstalledBackgrounds(req *GetInstalledBackgroundsRequest) (*Backgrounds, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getInstalledBackgrounds", + }, + Data: map[string]interface{}{ + "for_dark_theme": req.ForDarkTheme, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalBackgrounds(result.Data) +} + +type RemoveInstalledBackgroundRequest struct { // The background identifier BackgroundId JsonInt64 `json:"background_id"` } // Removes background from the list of installed backgrounds -func (client *Client) RemoveBackground(req *RemoveBackgroundRequest) (*Ok, error) { +func (client *Client) RemoveInstalledBackground(req *RemoveInstalledBackgroundRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ - Type: "removeBackground", + Type: "removeInstalledBackground", }, Data: map[string]interface{}{ "background_id": req.BackgroundId, @@ -12951,10 +16826,10 @@ func (client *Client) RemoveBackground(req *RemoveBackgroundRequest) (*Ok, error } // Resets list of installed backgrounds to its default value -func (client *Client) ResetBackgrounds() (*Ok, error) { +func (client *Client) ResetInstalledBackgrounds() (*Ok, error) { result, err := client.Send(Request{ meta: meta{ - Type: "resetBackgrounds", + Type: "resetInstalledBackgrounds", }, Data: map[string]interface{}{}, }) @@ -13077,7 +16952,7 @@ func (client *Client) SynchronizeLanguagePack(req *SynchronizeLanguagePackReques } type AddCustomServerLanguagePackRequest struct { - // Identifier of a language pack to be added; may be different from a name that is used in an "https://t.me/setlanguage/" link + // Identifier of a language pack to be added LanguagePackId string `json:"language_pack_id"` } @@ -13103,7 +16978,7 @@ func (client *Client) AddCustomServerLanguagePack(req *AddCustomServerLanguagePa } type SetCustomLanguagePackRequest struct { - // Information about the language pack. Language pack ID must start with 'X', consist only of English letters, digits and hyphens, and must not exceed 64 characters. Can be called before authorization + // Information about the language pack. Language pack identifier must start with 'X', consist only of English letters, digits and hyphens, and must not exceed 64 characters. Can be called before authorization Info *LanguagePackInfo `json:"info"` // Strings of the new language pack Strings []*LanguagePackString `json:"strings"` @@ -13374,6 +17249,137 @@ func (client *Client) GetUserPrivacySettingRules(req *GetUserPrivacySettingRules return UnmarshalUserPrivacySettingRules(result.Data) } +type SetReadDatePrivacySettingsRequest struct { + // New settings + Settings *ReadDatePrivacySettings `json:"settings"` +} + +// Changes privacy settings for message read date +func (client *Client) SetReadDatePrivacySettings(req *SetReadDatePrivacySettingsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setReadDatePrivacySettings", + }, + Data: map[string]interface{}{ + "settings": req.Settings, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +// Returns privacy settings for message read date +func (client *Client) GetReadDatePrivacySettings() (*ReadDatePrivacySettings, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getReadDatePrivacySettings", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalReadDatePrivacySettings(result.Data) +} + +type SetNewChatPrivacySettingsRequest struct { + // New settings + Settings *NewChatPrivacySettings `json:"settings"` +} + +// Changes privacy settings for new chat creation; can be used only if getOption("can_set_new_chat_privacy_settings") +func (client *Client) SetNewChatPrivacySettings(req *SetNewChatPrivacySettingsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setNewChatPrivacySettings", + }, + Data: map[string]interface{}{ + "settings": req.Settings, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +// Returns privacy settings for new chat creation +func (client *Client) GetNewChatPrivacySettings() (*NewChatPrivacySettings, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getNewChatPrivacySettings", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalNewChatPrivacySettings(result.Data) +} + +type CanSendMessageToUserRequest struct { + // Identifier of the other user + UserId int64 `json:"user_id"` + // Pass true to get only locally available information without sending network requests + OnlyLocal bool `json:"only_local"` +} + +// Check whether the current user can message another user or try to create a chat with them +func (client *Client) CanSendMessageToUser(req *CanSendMessageToUserRequest) (CanSendMessageToUserResult, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "canSendMessageToUser", + }, + Data: map[string]interface{}{ + "user_id": req.UserId, + "only_local": req.OnlyLocal, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + switch result.Type { + case TypeCanSendMessageToUserResultOk: + return UnmarshalCanSendMessageToUserResultOk(result.Data) + + case TypeCanSendMessageToUserResultUserIsDeleted: + return UnmarshalCanSendMessageToUserResultUserIsDeleted(result.Data) + + case TypeCanSendMessageToUserResultUserRestrictsNewChats: + return UnmarshalCanSendMessageToUserResultUserRestrictsNewChats(result.Data) + + default: + return nil, errors.New("invalid type") + } +} + type GetOptionRequest struct { // The name of the option Name string `json:"name"` @@ -13595,7 +17601,7 @@ type ReportChatRequest struct { // Identifiers of reported messages; may be empty to report the whole chat MessageIds []int64 `json:"message_ids"` // The reason for reporting the chat - Reason ChatReportReason `json:"reason"` + Reason ReportReason `json:"reason"` // Additional report details; 0-1024 characters Text string `json:"text"` } @@ -13630,7 +17636,7 @@ type ReportChatPhotoRequest struct { // Identifier of the photo to report. Only full photos from chatPhoto can be reported FileId int32 `json:"file_id"` // The reason for reporting the chat photo - Reason ChatReportReason `json:"reason"` + Reason ReportReason `json:"reason"` // Additional report details; 0-1024 characters Text string `json:"text"` } @@ -13761,6 +17767,73 @@ func (client *Client) GetMessageStatistics(req *GetMessageStatisticsRequest) (*M return UnmarshalMessageStatistics(result.Data) } +type GetMessagePublicForwardsRequest struct { + // Chat identifier of the message + ChatId int64 `json:"chat_id"` + // Message identifier + MessageId int64 `json:"message_id"` + // Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results + Offset string `json:"offset"` + // The maximum number of messages and stories to be returned; must be positive and can't be greater than 100. For optimal performance, the number of returned objects is chosen by TDLib and can be smaller than the specified limit + Limit int32 `json:"limit"` +} + +// Returns forwarded copies of a channel message to different public channels and public reposts as a story. Can be used only if message.can_get_statistics == true. For optimal performance, the number of returned messages and stories is chosen by TDLib +func (client *Client) GetMessagePublicForwards(req *GetMessagePublicForwardsRequest) (*PublicForwards, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getMessagePublicForwards", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_id": req.MessageId, + "offset": req.Offset, + "limit": req.Limit, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalPublicForwards(result.Data) +} + +type GetStoryStatisticsRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // Story identifier + StoryId int32 `json:"story_id"` + // Pass true if a dark theme is used by the application + IsDark bool `json:"is_dark"` +} + +// Returns detailed statistics about a story. Can be used only if story.can_get_statistics == true +func (client *Client) GetStoryStatistics(req *GetStoryStatisticsRequest) (*StoryStatistics, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getStoryStatistics", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "story_id": req.StoryId, + "is_dark": req.IsDark, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalStoryStatistics(result.Data) +} + type GetStatisticalGraphRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` @@ -14064,6 +18137,73 @@ func (client *Client) SetAutoDownloadSettings(req *SetAutoDownloadSettingsReques return UnmarshalOk(result.Data) } +// Returns autosave settings for the current user +func (client *Client) GetAutosaveSettings() (*AutosaveSettings, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getAutosaveSettings", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalAutosaveSettings(result.Data) +} + +type SetAutosaveSettingsRequest struct { + // Autosave settings scope + Scope AutosaveSettingsScope `json:"scope"` + // New autosave settings for the scope; pass null to set autosave settings to default + Settings *ScopeAutosaveSettings `json:"settings"` +} + +// Sets autosave settings for the given scope. The method is guaranteed to work only after at least one call to getAutosaveSettings +func (client *Client) SetAutosaveSettings(req *SetAutosaveSettingsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setAutosaveSettings", + }, + Data: map[string]interface{}{ + "scope": req.Scope, + "settings": req.Settings, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +// Clears the list of all autosave settings exceptions. The method is guaranteed to work only after at least one call to getAutosaveSettings +func (client *Client) ClearAutosaveSettingsExceptions() (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "clearAutosaveSettingsExceptions", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type GetBankCardInfoRequest struct { // The bank card number BankCardNumber string `json:"bank_card_number"` @@ -14686,8 +18826,10 @@ func (client *Client) SetBotUpdatesStatus(req *SetBotUpdatesStatusRequest) (*Ok, type UploadStickerFileRequest struct { // Sticker file owner; ignored for regular users UserId int64 `json:"user_id"` - // Sticker file to upload - Sticker *InputSticker `json:"sticker"` + // Sticker format + StickerFormat StickerFormat `json:"sticker_format"` + // File file to upload; must fit in a 512x512 square. For WEBP stickers the file must be in WEBP or PNG format, which will be converted to WEBP server-side. See https://core.telegram.org/animated_stickers#technical-requirements for technical requirements + Sticker InputFile `json:"sticker"` } // Uploads a file with a sticker; returns the uploaded file @@ -14697,8 +18839,9 @@ func (client *Client) UploadStickerFile(req *UploadStickerFileRequest) (*File, e Type: "uploadStickerFile", }, Data: map[string]interface{}{ - "user_id": req.UserId, - "sticker": req.Sticker, + "user_id": req.UserId, + "sticker_format": req.StickerFormat, + "sticker": req.Sticker, }, }) if err != nil { @@ -14781,11 +18924,13 @@ type CreateNewStickerSetRequest struct { UserId int64 `json:"user_id"` // Sticker set title; 1-64 characters Title string `json:"title"` - // Sticker set name. Can contain only English letters, digits and underscores. Must end with *"_by_"* (** is case insensitive) for bots; 1-64 characters + // Sticker set name. Can contain only English letters, digits and underscores. Must end with *"_by_"* (** is case insensitive) for bots; 0-64 characters. If empty, then the name returned by getSuggestedStickerSetName will be used automatically Name string `json:"name"` // Type of the stickers in the set StickerType StickerType `json:"sticker_type"` - // List of stickers to be added to the set; must be non-empty. All stickers must have the same format. For TGS stickers, uploadStickerFile must be used before the sticker is shown + // Pass true if stickers in the sticker set must be repainted; for custom emoji sticker sets only + NeedsRepainting bool `json:"needs_repainting"` + // List of stickers to be added to the set; 1-200 stickers for custom emoji sticker sets, and 1-120 stickers otherwise. For TGS stickers, uploadStickerFile must be used before the sticker is shown Stickers []*InputSticker `json:"stickers"` // Source of the sticker set; may be empty if unknown Source string `json:"source"` @@ -14798,12 +18943,13 @@ func (client *Client) CreateNewStickerSet(req *CreateNewStickerSetRequest) (*Sti Type: "createNewStickerSet", }, Data: map[string]interface{}{ - "user_id": req.UserId, - "title": req.Title, - "name": req.Name, - "sticker_type": req.StickerType, - "stickers": req.Stickers, - "source": req.Source, + "user_id": req.UserId, + "title": req.Title, + "name": req.Name, + "sticker_type": req.StickerType, + "needs_repainting": req.NeedsRepainting, + "stickers": req.Stickers, + "source": req.Source, }, }) if err != nil { @@ -14818,16 +18964,16 @@ func (client *Client) CreateNewStickerSet(req *CreateNewStickerSetRequest) (*Sti } type AddStickerToSetRequest struct { - // Sticker set owner + // Sticker set owner; ignored for regular users UserId int64 `json:"user_id"` - // Sticker set name + // Sticker set name. The sticker set must be owned by the current user, and contain less than 200 stickers for custom emoji sticker sets and less than 120 otherwise Name string `json:"name"` // Sticker to add to the set Sticker *InputSticker `json:"sticker"` } -// Adds a new sticker to a set; for bots only. Returns the sticker set -func (client *Client) AddStickerToSet(req *AddStickerToSetRequest) (*StickerSet, error) { +// Adds a new sticker to a set +func (client *Client) AddStickerToSet(req *AddStickerToSetRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ Type: "addStickerToSet", @@ -14846,28 +18992,31 @@ func (client *Client) AddStickerToSet(req *AddStickerToSetRequest) (*StickerSet, return nil, buildResponseError(result.Data) } - return UnmarshalStickerSet(result.Data) + return UnmarshalOk(result.Data) } -type SetStickerSetThumbnailRequest struct { - // Sticker set owner +type ReplaceStickerInSetRequest struct { + // Sticker set owner; ignored for regular users UserId int64 `json:"user_id"` - // Sticker set name + // Sticker set name. The sticker set must be owned by the current user Name string `json:"name"` - // Thumbnail to set in PNG, TGS, or WEBM format; pass null to remove the sticker set thumbnail. Thumbnail format must match the format of stickers in the set - Thumbnail InputFile `json:"thumbnail"` + // Sticker to remove from the set + OldSticker InputFile `json:"old_sticker"` + // Sticker to add to the set + NewSticker *InputSticker `json:"new_sticker"` } -// Sets a sticker set thumbnail; for bots only. Returns the sticker set -func (client *Client) SetStickerSetThumbnail(req *SetStickerSetThumbnailRequest) (*StickerSet, error) { +// Replaces existing sticker in a set. The function is equivalent to removeStickerFromSet, then addStickerToSet, then setStickerPositionInSet +func (client *Client) ReplaceStickerInSet(req *ReplaceStickerInSetRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ - Type: "setStickerSetThumbnail", + Type: "replaceStickerInSet", }, Data: map[string]interface{}{ - "user_id": req.UserId, - "name": req.Name, - "thumbnail": req.Thumbnail, + "user_id": req.UserId, + "name": req.Name, + "old_sticker": req.OldSticker, + "new_sticker": req.NewSticker, }, }) if err != nil { @@ -14878,7 +19027,126 @@ func (client *Client) SetStickerSetThumbnail(req *SetStickerSetThumbnailRequest) return nil, buildResponseError(result.Data) } - return UnmarshalStickerSet(result.Data) + return UnmarshalOk(result.Data) +} + +type SetStickerSetThumbnailRequest struct { + // Sticker set owner; ignored for regular users + UserId int64 `json:"user_id"` + // Sticker set name. The sticker set must be owned by the current user + Name string `json:"name"` + // Thumbnail to set; pass null to remove the sticker set thumbnail + Thumbnail InputFile `json:"thumbnail"` + // Format of the thumbnail; pass null if thumbnail is removed + Format StickerFormat `json:"format"` +} + +// Sets a sticker set thumbnail +func (client *Client) SetStickerSetThumbnail(req *SetStickerSetThumbnailRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setStickerSetThumbnail", + }, + Data: map[string]interface{}{ + "user_id": req.UserId, + "name": req.Name, + "thumbnail": req.Thumbnail, + "format": req.Format, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type SetCustomEmojiStickerSetThumbnailRequest struct { + // Sticker set name. The sticker set must be owned by the current user + Name string `json:"name"` + // Identifier of the custom emoji from the sticker set, which will be set as sticker set thumbnail; pass 0 to remove the sticker set thumbnail + CustomEmojiId JsonInt64 `json:"custom_emoji_id"` +} + +// Sets a custom emoji sticker set thumbnail +func (client *Client) SetCustomEmojiStickerSetThumbnail(req *SetCustomEmojiStickerSetThumbnailRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setCustomEmojiStickerSetThumbnail", + }, + Data: map[string]interface{}{ + "name": req.Name, + "custom_emoji_id": req.CustomEmojiId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type SetStickerSetTitleRequest struct { + // Sticker set name. The sticker set must be owned by the current user + Name string `json:"name"` + // New sticker set title + Title string `json:"title"` +} + +// Sets a sticker set title +func (client *Client) SetStickerSetTitle(req *SetStickerSetTitleRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setStickerSetTitle", + }, + Data: map[string]interface{}{ + "name": req.Name, + "title": req.Title, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type DeleteStickerSetRequest struct { + // Sticker set name. The sticker set must be owned by the current user + Name string `json:"name"` +} + +// Completely deletes a sticker set +func (client *Client) DeleteStickerSet(req *DeleteStickerSetRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "deleteStickerSet", + }, + Data: map[string]interface{}{ + "name": req.Name, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) } type SetStickerPositionInSetRequest struct { @@ -14888,7 +19156,7 @@ type SetStickerPositionInSetRequest struct { Position int32 `json:"position"` } -// Changes the position of a sticker in the set to which it belongs; for bots only. The sticker set must have been created by the bot +// Changes the position of a sticker in the set to which it belongs. The sticker set must be owned by the current user func (client *Client) SetStickerPositionInSet(req *SetStickerPositionInSetRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -14911,11 +19179,11 @@ func (client *Client) SetStickerPositionInSet(req *SetStickerPositionInSetReques } type RemoveStickerFromSetRequest struct { - // Sticker + // Sticker to remove from the set Sticker InputFile `json:"sticker"` } -// Removes a sticker from the set to which it belongs; for bots only. The sticker set must have been created by the bot +// Removes a sticker from the set to which it belongs. The sticker set must be owned by the current user func (client *Client) RemoveStickerFromSet(req *RemoveStickerFromSetRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -14936,6 +19204,122 @@ func (client *Client) RemoveStickerFromSet(req *RemoveStickerFromSetRequest) (*O return UnmarshalOk(result.Data) } +type SetStickerEmojisRequest struct { + // Sticker + Sticker InputFile `json:"sticker"` + // New string with 1-20 emoji corresponding to the sticker + Emojis string `json:"emojis"` +} + +// Changes the list of emoji corresponding to a sticker. The sticker must belong to a regular or custom emoji sticker set that is owned by the current user +func (client *Client) SetStickerEmojis(req *SetStickerEmojisRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setStickerEmojis", + }, + Data: map[string]interface{}{ + "sticker": req.Sticker, + "emojis": req.Emojis, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type SetStickerKeywordsRequest struct { + // Sticker + Sticker InputFile `json:"sticker"` + // List of up to 20 keywords with total length up to 64 characters, which can be used to find the sticker + Keywords []string `json:"keywords"` +} + +// Changes the list of keywords of a sticker. The sticker must belong to a regular or custom emoji sticker set that is owned by the current user +func (client *Client) SetStickerKeywords(req *SetStickerKeywordsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setStickerKeywords", + }, + Data: map[string]interface{}{ + "sticker": req.Sticker, + "keywords": req.Keywords, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type SetStickerMaskPositionRequest struct { + // Sticker + Sticker InputFile `json:"sticker"` + // Position where the mask is placed; pass null to remove mask position + MaskPosition *MaskPosition `json:"mask_position"` +} + +// Changes the mask position of a mask sticker. The sticker must belong to a mask sticker set that is owned by the current user +func (client *Client) SetStickerMaskPosition(req *SetStickerMaskPositionRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setStickerMaskPosition", + }, + Data: map[string]interface{}{ + "sticker": req.Sticker, + "mask_position": req.MaskPosition, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type GetOwnedStickerSetsRequest struct { + // Identifier of the sticker set from which to return owned sticker sets; use 0 to get results from the beginning + OffsetStickerSetId JsonInt64 `json:"offset_sticker_set_id"` + // The maximum number of sticker sets to be returned; must be positive and can't be greater than 100. For optimal performance, the number of returned objects is chosen by TDLib and can be smaller than the specified limit + Limit int32 `json:"limit"` +} + +// Returns sticker sets owned by the current user +func (client *Client) GetOwnedStickerSets(req *GetOwnedStickerSetsRequest) (*StickerSets, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getOwnedStickerSets", + }, + Data: map[string]interface{}{ + "offset_sticker_set_id": req.OffsetStickerSetId, + "limit": req.Limit, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalStickerSets(result.Data) +} + type GetMapThumbnailFileRequest struct { // Location of the map center Location *Location `json:"location"` @@ -15112,6 +19496,151 @@ func (client *Client) GetPremiumState() (*PremiumState, error) { return UnmarshalPremiumState(result.Data) } +type GetPremiumGiftCodePaymentOptionsRequest struct { + // Identifier of the supergroup or channel chat, which will be automatically boosted by receivers of the gift codes and which is administered by the user; 0 if none + BoostedChatId int64 `json:"boosted_chat_id"` +} + +// Returns available options for Telegram Premium gift code or giveaway creation +func (client *Client) GetPremiumGiftCodePaymentOptions(req *GetPremiumGiftCodePaymentOptionsRequest) (*PremiumGiftCodePaymentOptions, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getPremiumGiftCodePaymentOptions", + }, + Data: map[string]interface{}{ + "boosted_chat_id": req.BoostedChatId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalPremiumGiftCodePaymentOptions(result.Data) +} + +type CheckPremiumGiftCodeRequest struct { + // The code to check + Code string `json:"code"` +} + +// Return information about a Telegram Premium gift code +func (client *Client) CheckPremiumGiftCode(req *CheckPremiumGiftCodeRequest) (*PremiumGiftCodeInfo, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "checkPremiumGiftCode", + }, + Data: map[string]interface{}{ + "code": req.Code, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalPremiumGiftCodeInfo(result.Data) +} + +type ApplyPremiumGiftCodeRequest struct { + // The code to apply + Code string `json:"code"` +} + +// Applies a Telegram Premium gift code +func (client *Client) ApplyPremiumGiftCode(req *ApplyPremiumGiftCodeRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "applyPremiumGiftCode", + }, + Data: map[string]interface{}{ + "code": req.Code, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type LaunchPrepaidPremiumGiveawayRequest struct { + // Unique identifier of the prepaid giveaway + GiveawayId JsonInt64 `json:"giveaway_id"` + // Giveaway parameters + Parameters *PremiumGiveawayParameters `json:"parameters"` +} + +// Launches a prepaid Telegram Premium giveaway +func (client *Client) LaunchPrepaidPremiumGiveaway(req *LaunchPrepaidPremiumGiveawayRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "launchPrepaidPremiumGiveaway", + }, + Data: map[string]interface{}{ + "giveaway_id": req.GiveawayId, + "parameters": req.Parameters, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type GetPremiumGiveawayInfoRequest struct { + // Identifier of the channel chat which started the giveaway + ChatId int64 `json:"chat_id"` + // Identifier of the giveaway or a giveaway winners message in the chat + MessageId int64 `json:"message_id"` +} + +// Returns information about a Telegram Premium giveaway +func (client *Client) GetPremiumGiveawayInfo(req *GetPremiumGiveawayInfoRequest) (PremiumGiveawayInfo, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getPremiumGiveawayInfo", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_id": req.MessageId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + switch result.Type { + case TypePremiumGiveawayInfoOngoing: + return UnmarshalPremiumGiveawayInfoOngoing(result.Data) + + case TypePremiumGiveawayInfoCompleted: + return UnmarshalPremiumGiveawayInfoCompleted(result.Data) + + default: + return nil, errors.New("invalid type") + } +} + type CanPurchasePremiumRequest struct { // Transaction purpose Purpose StorePaymentPurpose `json:"purpose"` @@ -15202,6 +19731,32 @@ func (client *Client) AssignGooglePlayTransaction(req *AssignGooglePlayTransacti return UnmarshalOk(result.Data) } +type GetBusinessFeaturesRequest struct { + // Source of the request; pass null if the method is called from settings or some non-standard source + Source BusinessFeature `json:"source"` +} + +// Returns information about features, available to Business users +func (client *Client) GetBusinessFeatures(req *GetBusinessFeaturesRequest) (*BusinessFeatures, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getBusinessFeatures", + }, + Data: map[string]interface{}{ + "source": req.Source, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalBusinessFeatures(result.Data) +} + type AcceptTermsOfServiceRequest struct { // Terms of service identifier TermsOfServiceId string `json:"terms_of_service_id"` @@ -15228,6 +19783,41 @@ func (client *Client) AcceptTermsOfService(req *AcceptTermsOfServiceRequest) (*O return UnmarshalOk(result.Data) } +type SearchStringsByPrefixRequest struct { + // The strings to search in for the query + Strings []string `json:"strings"` + // Query to search for + Query string `json:"query"` + // The maximum number of objects to return + Limit int32 `json:"limit"` + // Pass true to receive no results for an empty query + ReturnNoneForEmptyQuery bool `json:"return_none_for_empty_query"` +} + +// Searches specified query by word prefixes in the provided strings. Returns 0-based positions of strings that matched. Can be called synchronously +func (client *Client) SearchStringsByPrefix(req *SearchStringsByPrefixRequest) (*FoundPositions, error) { + result, err := client.jsonClient.Execute(Request{ + meta: meta{ + Type: "searchStringsByPrefix", + }, + Data: map[string]interface{}{ + "strings": req.Strings, + "query": req.Query, + "limit": req.Limit, + "return_none_for_empty_query": req.ReturnNoneForEmptyQuery, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalFoundPositions(result.Data) +} + type SendCustomRequestRequest struct { // The method name Method string `json:"method"` @@ -15405,13 +19995,20 @@ func (client *Client) GetPhoneNumberInfoSync(req *GetPhoneNumberInfoSyncRequest) return UnmarshalPhoneNumberInfo(result.Data) } -// Returns the link for downloading official Telegram application to be used when the current user invites friends to Telegram -func (client *Client) GetApplicationDownloadLink() (*HttpUrl, error) { +type GetCollectibleItemInfoRequest struct { + // Type of the collectible item. The item must be used by a user and must be visible to the current user + Type CollectibleItemType `json:"type"` +} + +// Returns information about a given collectible item that was purchased at https://fragment.com +func (client *Client) GetCollectibleItemInfo(req *GetCollectibleItemInfoRequest) (*CollectibleItemInfo, error) { result, err := client.Send(Request{ meta: meta{ - Type: "getApplicationDownloadLink", + Type: "getCollectibleItemInfo", + }, + Data: map[string]interface{}{ + "type": req.Type, }, - Data: map[string]interface{}{}, }) if err != nil { return nil, err @@ -15421,7 +20018,7 @@ func (client *Client) GetApplicationDownloadLink() (*HttpUrl, error) { return nil, buildResponseError(result.Data) } - return UnmarshalHttpUrl(result.Data) + return UnmarshalCollectibleItemInfo(result.Data) } type GetDeepLinkInfoRequest struct { @@ -15522,8 +20119,27 @@ func (client *Client) SaveApplicationLogEvent(req *SaveApplicationLogEventReques return UnmarshalOk(result.Data) } +// Returns the link for downloading official Telegram application to be used when the current user invites friends to Telegram +func (client *Client) GetApplicationDownloadLink() (*HttpUrl, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getApplicationDownloadLink", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalHttpUrl(result.Data) +} + type AddProxyRequest struct { - // Proxy server IP address + // Proxy server domain or IP address Server string `json:"server"` // Proxy server port Port int32 `json:"port"` @@ -15560,7 +20176,7 @@ func (client *Client) AddProxy(req *AddProxyRequest) (*Proxy, error) { type EditProxyRequest struct { // Proxy identifier ProxyId int32 `json:"proxy_id"` - // Proxy server IP address + // Proxy server domain or IP address Server string `json:"server"` // Proxy server port Port int32 `json:"port"` @@ -15997,6 +20613,25 @@ func (client *Client) SetUserSupportInfo(req *SetUserSupportInfoRequest) (*UserS return UnmarshalUserSupportInfo(result.Data) } +// Returns localized name of the Telegram support user; for Telegram support only +func (client *Client) GetSupportName() (*Text, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getSupportName", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalText(result.Data) +} + // Does nothing; for testing only. This is an offline method. Can be called before authorization func (client *Client) TestCallEmpty() (*Ok, error) { result, err := client.Send(Request{ @@ -16218,7 +20853,7 @@ func (client *Client) TestNetwork() (*Ok, error) { } type TestProxyRequest struct { - // Proxy server IP address + // Proxy server domain or IP address Server string `json:"server"` // Proxy server port Port int32 `json:"port"` @@ -16339,6 +20974,9 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateChatPhoto: return UnmarshalUpdateChatPhoto(result.Data) + case TypeUpdateChatAccentColors: + return UnmarshalUpdateChatAccentColors(result.Data) + case TypeUpdateChatPermissions: return UnmarshalUpdateChatPermissions(result.Data) @@ -16348,6 +20986,12 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateChatPosition: return UnmarshalUpdateChatPosition(result.Data) + case TypeUpdateChatAddedToList: + return UnmarshalUpdateChatAddedToList(result.Data) + + case TypeUpdateChatRemovedFromList: + return UnmarshalUpdateChatRemovedFromList(result.Data) + case TypeUpdateChatReadInbox: return UnmarshalUpdateChatReadInbox(result.Data) @@ -16363,6 +21007,9 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateChatDraftMessage: return UnmarshalUpdateChatDraftMessage(result.Data) + case TypeUpdateChatEmojiStatus: + return UnmarshalUpdateChatEmojiStatus(result.Data) + case TypeUpdateChatMessageSender: return UnmarshalUpdateChatMessageSender(result.Data) @@ -16378,6 +21025,9 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateChatReplyMarkup: return UnmarshalUpdateChatReplyMarkup(result.Data) + case TypeUpdateChatBackground: + return UnmarshalUpdateChatBackground(result.Data) + case TypeUpdateChatTheme: return UnmarshalUpdateChatTheme(result.Data) @@ -16396,21 +21046,45 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateChatHasProtectedContent: return UnmarshalUpdateChatHasProtectedContent(result.Data) - case TypeUpdateChatHasScheduledMessages: - return UnmarshalUpdateChatHasScheduledMessages(result.Data) - - case TypeUpdateChatIsBlocked: - return UnmarshalUpdateChatIsBlocked(result.Data) + case TypeUpdateChatIsTranslatable: + return UnmarshalUpdateChatIsTranslatable(result.Data) case TypeUpdateChatIsMarkedAsUnread: return UnmarshalUpdateChatIsMarkedAsUnread(result.Data) - case TypeUpdateChatFilters: - return UnmarshalUpdateChatFilters(result.Data) + case TypeUpdateChatViewAsTopics: + return UnmarshalUpdateChatViewAsTopics(result.Data) + + case TypeUpdateChatBlockList: + return UnmarshalUpdateChatBlockList(result.Data) + + case TypeUpdateChatHasScheduledMessages: + return UnmarshalUpdateChatHasScheduledMessages(result.Data) + + case TypeUpdateChatFolders: + return UnmarshalUpdateChatFolders(result.Data) case TypeUpdateChatOnlineMemberCount: return UnmarshalUpdateChatOnlineMemberCount(result.Data) + case TypeUpdateSavedMessagesTopic: + return UnmarshalUpdateSavedMessagesTopic(result.Data) + + case TypeUpdateSavedMessagesTopicCount: + return UnmarshalUpdateSavedMessagesTopicCount(result.Data) + + case TypeUpdateQuickReplyShortcut: + return UnmarshalUpdateQuickReplyShortcut(result.Data) + + case TypeUpdateQuickReplyShortcutDeleted: + return UnmarshalUpdateQuickReplyShortcutDeleted(result.Data) + + case TypeUpdateQuickReplyShortcuts: + return UnmarshalUpdateQuickReplyShortcuts(result.Data) + + case TypeUpdateQuickReplyShortcutMessages: + return UnmarshalUpdateQuickReplyShortcutMessages(result.Data) + case TypeUpdateForumTopicInfo: return UnmarshalUpdateForumTopicInfo(result.Data) @@ -16504,6 +21178,27 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateUnreadChatCount: return UnmarshalUpdateUnreadChatCount(result.Data) + case TypeUpdateStory: + return UnmarshalUpdateStory(result.Data) + + case TypeUpdateStoryDeleted: + return UnmarshalUpdateStoryDeleted(result.Data) + + case TypeUpdateStorySendSucceeded: + return UnmarshalUpdateStorySendSucceeded(result.Data) + + case TypeUpdateStorySendFailed: + return UnmarshalUpdateStorySendFailed(result.Data) + + case TypeUpdateChatActiveStories: + return UnmarshalUpdateChatActiveStories(result.Data) + + case TypeUpdateStoryListChatCount: + return UnmarshalUpdateStoryListChatCount(result.Data) + + case TypeUpdateStoryStealthMode: + return UnmarshalUpdateStoryStealthMode(result.Data) + case TypeUpdateOption: return UnmarshalUpdateOption(result.Data) @@ -16528,12 +21223,18 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateSavedNotificationSounds: return UnmarshalUpdateSavedNotificationSounds(result.Data) - case TypeUpdateSelectedBackground: - return UnmarshalUpdateSelectedBackground(result.Data) + case TypeUpdateDefaultBackground: + return UnmarshalUpdateDefaultBackground(result.Data) case TypeUpdateChatThemes: return UnmarshalUpdateChatThemes(result.Data) + case TypeUpdateAccentColors: + return UnmarshalUpdateAccentColors(result.Data) + + case TypeUpdateProfileAccentColors: + return UnmarshalUpdateProfileAccentColors(result.Data) + case TypeUpdateLanguagePackStrings: return UnmarshalUpdateLanguagePackStrings(result.Data) @@ -16546,6 +21247,9 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateUsersNearby: return UnmarshalUpdateUsersNearby(result.Data) + case TypeUpdateUnconfirmedSession: + return UnmarshalUpdateUnconfirmedSession(result.Data) + case TypeUpdateAttachmentMenuBots: return UnmarshalUpdateAttachmentMenuBots(result.Data) @@ -16558,6 +21262,12 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateDefaultReactionType: return UnmarshalUpdateDefaultReactionType(result.Data) + case TypeUpdateSavedMessagesTags: + return UnmarshalUpdateSavedMessagesTags(result.Data) + + case TypeUpdateSpeechRecognitionTrial: + return UnmarshalUpdateSpeechRecognitionTrial(result.Data) + case TypeUpdateDiceEmojis: return UnmarshalUpdateDiceEmojis(result.Data) @@ -16570,6 +21280,27 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateSuggestedActions: return UnmarshalUpdateSuggestedActions(result.Data) + case TypeUpdateContactCloseBirthdays: + return UnmarshalUpdateContactCloseBirthdays(result.Data) + + case TypeUpdateAddChatMembersPrivacyForbidden: + return UnmarshalUpdateAddChatMembersPrivacyForbidden(result.Data) + + case TypeUpdateAutosaveSettings: + return UnmarshalUpdateAutosaveSettings(result.Data) + + case TypeUpdateBusinessConnection: + return UnmarshalUpdateBusinessConnection(result.Data) + + case TypeUpdateNewBusinessMessage: + return UnmarshalUpdateNewBusinessMessage(result.Data) + + case TypeUpdateBusinessMessageEdited: + return UnmarshalUpdateBusinessMessageEdited(result.Data) + + case TypeUpdateBusinessMessagesDeleted: + return UnmarshalUpdateBusinessMessagesDeleted(result.Data) + case TypeUpdateNewInlineQuery: return UnmarshalUpdateNewInlineQuery(result.Data) @@ -16606,6 +21337,15 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateNewChatJoinRequest: return UnmarshalUpdateNewChatJoinRequest(result.Data) + case TypeUpdateChatBoost: + return UnmarshalUpdateChatBoost(result.Data) + + case TypeUpdateMessageReaction: + return UnmarshalUpdateMessageReaction(result.Data) + + case TypeUpdateMessageReactions: + return UnmarshalUpdateMessageReactions(result.Data) + default: return nil, errors.New("invalid type") } diff --git a/client/type.go b/client/type.go index 7e11c16..2a2326e 100755 --- a/client/type.go +++ b/client/type.go @@ -3,38432 +3,49857 @@ package client import ( - "encoding/json" + "encoding/json" ) const ( - ClassAuthenticationCodeType = "AuthenticationCodeType" - ClassEmailAddressAuthentication = "EmailAddressAuthentication" - ClassAuthorizationState = "AuthorizationState" - ClassInputFile = "InputFile" - ClassThumbnailFormat = "ThumbnailFormat" - ClassMaskPoint = "MaskPoint" - ClassStickerFormat = "StickerFormat" - ClassStickerType = "StickerType" - ClassStickerFullType = "StickerFullType" - ClassPollType = "PollType" - ClassUserType = "UserType" - ClassInputChatPhoto = "InputChatPhoto" - ClassChatMemberStatus = "ChatMemberStatus" - ClassChatMembersFilter = "ChatMembersFilter" - ClassSupergroupMembersFilter = "SupergroupMembersFilter" - ClassSecretChatState = "SecretChatState" - ClassMessageSender = "MessageSender" - ClassMessageForwardOrigin = "MessageForwardOrigin" - ClassReactionType = "ReactionType" - ClassMessageSendingState = "MessageSendingState" - ClassNotificationSettingsScope = "NotificationSettingsScope" - ClassChatType = "ChatType" - ClassChatList = "ChatList" - ClassChatSource = "ChatSource" - ClassChatAvailableReactions = "ChatAvailableReactions" - ClassPublicChatType = "PublicChatType" - ClassChatActionBar = "ChatActionBar" - ClassKeyboardButtonType = "KeyboardButtonType" - ClassInlineKeyboardButtonType = "InlineKeyboardButtonType" - ClassReplyMarkup = "ReplyMarkup" - ClassLoginUrlInfo = "LoginUrlInfo" - ClassRichText = "RichText" - ClassPageBlockHorizontalAlignment = "PageBlockHorizontalAlignment" - ClassPageBlockVerticalAlignment = "PageBlockVerticalAlignment" - ClassPageBlock = "PageBlock" - ClassInputCredentials = "InputCredentials" - ClassPaymentProvider = "PaymentProvider" - ClassInputInvoice = "InputInvoice" - ClassMessageExtendedMedia = "MessageExtendedMedia" - 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" - ClassSpeechRecognitionResult = "SpeechRecognitionResult" - ClassInputInlineQueryResult = "InputInlineQueryResult" - ClassInlineQueryResult = "InlineQueryResult" - ClassCallbackQueryPayload = "CallbackQueryPayload" - ClassChatEventAction = "ChatEventAction" - ClassLanguagePackStringValue = "LanguagePackStringValue" - ClassPremiumLimitType = "PremiumLimitType" - ClassPremiumFeature = "PremiumFeature" - ClassPremiumSource = "PremiumSource" - ClassStorePaymentPurpose = "StorePaymentPurpose" - 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" - ClassSessionType = "SessionType" - ClassChatReportReason = "ChatReportReason" - ClassTargetChat = "TargetChat" - 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" - 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" - ClassBotMenuButton = "BotMenuButton" - ClassChatLocation = "ChatLocation" - ClassAnimatedChatPhoto = "AnimatedChatPhoto" - ClassChatPhoto = "ChatPhoto" - ClassChatPhotos = "ChatPhotos" - ClassChatPermissions = "ChatPermissions" - ClassChatAdministratorRights = "ChatAdministratorRights" - ClassPremiumPaymentOption = "PremiumPaymentOption" - ClassEmojiStatus = "EmojiStatus" - ClassEmojiStatuses = "EmojiStatuses" - ClassUsernames = "Usernames" - ClassUser = "User" - ClassBotInfo = "BotInfo" - ClassUserFullInfo = "UserFullInfo" - ClassUsers = "Users" - ClassChatAdministrator = "ChatAdministrator" - ClassChatAdministrators = "ChatAdministrators" - 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" - ClassChatMessageSender = "ChatMessageSender" - ClassChatMessageSenders = "ChatMessageSenders" - ClassMessageForwardInfo = "MessageForwardInfo" - ClassMessageReplyInfo = "MessageReplyInfo" - ClassMessageReaction = "MessageReaction" - ClassMessageInteractionInfo = "MessageInteractionInfo" - ClassUnreadReaction = "UnreadReaction" - ClassMessage = "Message" - ClassMessages = "Messages" - ClassFoundMessages = "FoundMessages" - ClassFoundChatMessages = "FoundChatMessages" - ClassMessagePosition = "MessagePosition" - ClassMessagePositions = "MessagePositions" - ClassMessageCalendarDay = "MessageCalendarDay" - ClassMessageCalendar = "MessageCalendar" - ClassSponsoredMessage = "SponsoredMessage" - ClassSponsoredMessages = "SponsoredMessages" - 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" - ClassWebAppInfo = "WebAppInfo" - ClassMessageThreadInfo = "MessageThreadInfo" - ClassForumTopicIcon = "ForumTopicIcon" - ClassForumTopicInfo = "ForumTopicInfo" - ClassForumTopic = "ForumTopic" - ClassForumTopics = "ForumTopics" - ClassPageBlockCaption = "PageBlockCaption" - ClassPageBlockListItem = "PageBlockListItem" - ClassPageBlockTableCell = "PageBlockTableCell" - ClassPageBlockRelatedArticle = "PageBlockRelatedArticle" - ClassWebPageInstantView = "WebPageInstantView" - ClassWebPage = "WebPage" - ClassCountryInfo = "CountryInfo" - ClassCountries = "Countries" - ClassPhoneNumberInfo = "PhoneNumberInfo" - ClassBankCardActionOpenUrl = "BankCardActionOpenUrl" - ClassBankCardInfo = "BankCardInfo" - ClassAddress = "Address" - ClassThemeParameters = "ThemeParameters" - ClassLabeledPricePart = "LabeledPricePart" - ClassInvoice = "Invoice" - ClassOrderInfo = "OrderInfo" - ClassShippingOption = "ShippingOption" - ClassSavedCredentials = "SavedCredentials" - ClassPaymentOption = "PaymentOption" - 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" - ClassTrendingStickerSets = "TrendingStickerSets" - 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" - ClassAvailableReaction = "AvailableReaction" - ClassAvailableReactions = "AvailableReactions" - ClassEmojiReaction = "EmojiReaction" - ClassAnimations = "Animations" - ClassImportedContacts = "ImportedContacts" - ClassAttachmentMenuBotColor = "AttachmentMenuBotColor" - ClassAttachmentMenuBot = "AttachmentMenuBot" - ClassSentWebAppMessage = "SentWebAppMessage" - ClassHttpUrl = "HttpUrl" - ClassUserLink = "UserLink" - ClassInlineQueryResults = "InlineQueryResults" - ClassCallbackQueryAnswer = "CallbackQueryAnswer" - ClassCustomRequestResult = "CustomRequestResult" - ClassGameHighScore = "GameHighScore" - ClassGameHighScores = "GameHighScores" - ClassChatEvent = "ChatEvent" - ClassChatEvents = "ChatEvents" - ClassChatEventLogFilters = "ChatEventLogFilters" - ClassLanguagePackString = "LanguagePackString" - ClassLanguagePackStrings = "LanguagePackStrings" - ClassLanguagePackInfo = "LanguagePackInfo" - ClassLocalizationTargetInfo = "LocalizationTargetInfo" - ClassPremiumLimit = "PremiumLimit" - ClassPremiumFeatures = "PremiumFeatures" - ClassPremiumFeaturePromotionAnimation = "PremiumFeaturePromotionAnimation" - ClassPremiumState = "PremiumState" - ClassPushReceiverId = "PushReceiverId" - ClassBackground = "Background" - ClassBackgrounds = "Backgrounds" - ClassThemeSettings = "ThemeSettings" - ClassChatTheme = "ChatTheme" - ClassHashtags = "Hashtags" - ClassNotificationSound = "NotificationSound" - ClassNotificationSounds = "NotificationSounds" - ClassNotification = "Notification" - ClassNotificationGroup = "NotificationGroup" - ClassJsonObjectMember = "JsonObjectMember" - ClassUserPrivacySettingRules = "UserPrivacySettingRules" - ClassAccountTtl = "AccountTtl" - ClassMessageAutoDeleteTime = "MessageAutoDeleteTime" - 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" - ClassFileDownloadedPrefixSize = "FileDownloadedPrefixSize" - 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" - ClassUserSupportInfo = "UserSupportInfo" - ClassTestInt = "TestInt" - ClassTestString = "TestString" - ClassTestBytes = "TestBytes" - ClassTestVectorInt = "TestVectorInt" - ClassTestVectorIntObject = "TestVectorIntObject" - ClassTestVectorString = "TestVectorString" - ClassTestVectorStringObject = "TestVectorStringObject" + ClassAuthenticationCodeType = "AuthenticationCodeType" + ClassEmailAddressAuthentication = "EmailAddressAuthentication" + ClassEmailAddressResetState = "EmailAddressResetState" + ClassAuthorizationState = "AuthorizationState" + ClassInputFile = "InputFile" + ClassThumbnailFormat = "ThumbnailFormat" + ClassMaskPoint = "MaskPoint" + ClassStickerFormat = "StickerFormat" + ClassStickerType = "StickerType" + ClassStickerFullType = "StickerFullType" + ClassPollType = "PollType" + ClassUserType = "UserType" + ClassBusinessAwayMessageSchedule = "BusinessAwayMessageSchedule" + ClassChatPhotoStickerType = "ChatPhotoStickerType" + ClassInputChatPhoto = "InputChatPhoto" + ClassPremiumGiveawayParticipantStatus = "PremiumGiveawayParticipantStatus" + ClassPremiumGiveawayInfo = "PremiumGiveawayInfo" + ClassChatMemberStatus = "ChatMemberStatus" + ClassChatMembersFilter = "ChatMembersFilter" + ClassSupergroupMembersFilter = "SupergroupMembersFilter" + ClassInviteLinkChatType = "InviteLinkChatType" + ClassSecretChatState = "SecretChatState" + ClassMessageSender = "MessageSender" + ClassMessageReadDate = "MessageReadDate" + ClassMessageOrigin = "MessageOrigin" + ClassReactionType = "ReactionType" + ClassMessageSendingState = "MessageSendingState" + ClassMessageReplyTo = "MessageReplyTo" + ClassInputMessageReplyTo = "InputMessageReplyTo" + ClassMessageSource = "MessageSource" + ClassMessageSponsorType = "MessageSponsorType" + ClassReportChatSponsoredMessageResult = "ReportChatSponsoredMessageResult" + ClassNotificationSettingsScope = "NotificationSettingsScope" + ClassChatType = "ChatType" + ClassChatList = "ChatList" + ClassChatSource = "ChatSource" + ClassChatAvailableReactions = "ChatAvailableReactions" + ClassPublicChatType = "PublicChatType" + ClassChatActionBar = "ChatActionBar" + ClassKeyboardButtonType = "KeyboardButtonType" + ClassInlineKeyboardButtonType = "InlineKeyboardButtonType" + ClassReplyMarkup = "ReplyMarkup" + ClassLoginUrlInfo = "LoginUrlInfo" + ClassSavedMessagesTopicType = "SavedMessagesTopicType" + ClassRichText = "RichText" + ClassPageBlockHorizontalAlignment = "PageBlockHorizontalAlignment" + ClassPageBlockVerticalAlignment = "PageBlockVerticalAlignment" + ClassPageBlock = "PageBlock" + ClassCollectibleItemType = "CollectibleItemType" + ClassInputCredentials = "InputCredentials" + ClassPaymentProvider = "PaymentProvider" + ClassInputInvoice = "InputInvoice" + ClassMessageExtendedMedia = "MessageExtendedMedia" + ClassPassportElementType = "PassportElementType" + ClassPassportElement = "PassportElement" + ClassInputPassportElement = "InputPassportElement" + ClassPassportElementErrorSource = "PassportElementErrorSource" + ClassInputPassportElementErrorSource = "InputPassportElementErrorSource" + ClassMessageContent = "MessageContent" + ClassTextEntityType = "TextEntityType" + ClassMessageSchedulingState = "MessageSchedulingState" + ClassMessageSelfDestructType = "MessageSelfDestructType" + ClassInputMessageContent = "InputMessageContent" + ClassSearchMessagesFilter = "SearchMessagesFilter" + ClassChatAction = "ChatAction" + ClassUserStatus = "UserStatus" + ClassEmojiCategoryType = "EmojiCategoryType" + ClassStoryAreaType = "StoryAreaType" + ClassInputStoryAreaType = "InputStoryAreaType" + ClassStoryContent = "StoryContent" + ClassInputStoryContent = "InputStoryContent" + ClassStoryList = "StoryList" + ClassStoryOrigin = "StoryOrigin" + ClassStoryInteractionType = "StoryInteractionType" + ClassPublicForward = "PublicForward" + ClassChatBoostSource = "ChatBoostSource" + ClassCallDiscardReason = "CallDiscardReason" + ClassCallServerType = "CallServerType" + ClassCallState = "CallState" + ClassGroupCallVideoQuality = "GroupCallVideoQuality" + ClassCallProblem = "CallProblem" + ClassFirebaseAuthenticationSettings = "FirebaseAuthenticationSettings" + ClassReactionUnavailabilityReason = "ReactionUnavailabilityReason" + ClassDiceStickers = "DiceStickers" + ClassSpeechRecognitionResult = "SpeechRecognitionResult" + ClassBotWriteAccessAllowReason = "BotWriteAccessAllowReason" + ClassInputInlineQueryResult = "InputInlineQueryResult" + ClassInlineQueryResult = "InlineQueryResult" + ClassInlineQueryResultsButtonType = "InlineQueryResultsButtonType" + ClassCallbackQueryPayload = "CallbackQueryPayload" + ClassChatEventAction = "ChatEventAction" + ClassLanguagePackStringValue = "LanguagePackStringValue" + ClassPremiumLimitType = "PremiumLimitType" + ClassPremiumFeature = "PremiumFeature" + ClassBusinessFeature = "BusinessFeature" + ClassPremiumStoryFeature = "PremiumStoryFeature" + ClassPremiumSource = "PremiumSource" + ClassStorePaymentPurpose = "StorePaymentPurpose" + ClassTelegramPaymentPurpose = "TelegramPaymentPurpose" + ClassDeviceToken = "DeviceToken" + ClassBackgroundFill = "BackgroundFill" + ClassBackgroundType = "BackgroundType" + ClassInputBackground = "InputBackground" + ClassCanSendStoryResult = "CanSendStoryResult" + ClassCanTransferOwnershipResult = "CanTransferOwnershipResult" + ClassCheckChatUsernameResult = "CheckChatUsernameResult" + ClassCheckStickerSetNameResult = "CheckStickerSetNameResult" + ClassResetPasswordResult = "ResetPasswordResult" + ClassMessageFileType = "MessageFileType" + ClassPushMessageContent = "PushMessageContent" + ClassNotificationType = "NotificationType" + ClassNotificationGroupType = "NotificationGroupType" + ClassOptionValue = "OptionValue" + ClassJsonValue = "JsonValue" + ClassStoryPrivacySettings = "StoryPrivacySettings" + ClassUserPrivacySettingRule = "UserPrivacySettingRule" + ClassUserPrivacySetting = "UserPrivacySetting" + ClassCanSendMessageToUserResult = "CanSendMessageToUserResult" + ClassSessionType = "SessionType" + ClassReportReason = "ReportReason" + ClassTargetChat = "TargetChat" + ClassInternalLinkType = "InternalLinkType" + ClassBlockList = "BlockList" + ClassFileType = "FileType" + ClassNetworkType = "NetworkType" + ClassNetworkStatisticsEntry = "NetworkStatisticsEntry" + ClassAutosaveSettingsScope = "AutosaveSettingsScope" + ClassConnectionState = "ConnectionState" + ClassTopChatCategory = "TopChatCategory" + ClassTMeUrlType = "TMeUrlType" + ClassSuggestedAction = "SuggestedAction" + ClassTextParseMode = "TextParseMode" + ClassProxyType = "ProxyType" + ClassStatisticalGraph = "StatisticalGraph" + ClassChatStatisticsObjectType = "ChatStatisticsObjectType" + ClassChatStatistics = "ChatStatistics" + ClassVectorPathCommand = "VectorPathCommand" + ClassBotCommandScope = "BotCommandScope" + ClassUpdate = "Update" + ClassLogStream = "LogStream" + ClassError = "Error" + ClassOk = "Ok" + 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" + ClassWebApp = "WebApp" + ClassPoll = "Poll" + ClassBackground = "Background" + ClassBackgrounds = "Backgrounds" + ClassChatBackground = "ChatBackground" + ClassProfilePhoto = "ProfilePhoto" + ClassChatPhotoInfo = "ChatPhotoInfo" + ClassBotCommand = "BotCommand" + ClassBotCommands = "BotCommands" + ClassBotMenuButton = "BotMenuButton" + ClassChatLocation = "ChatLocation" + ClassBirthdate = "Birthdate" + ClassCloseBirthdayUser = "CloseBirthdayUser" + ClassBusinessLocation = "BusinessLocation" + ClassBusinessRecipients = "BusinessRecipients" + ClassBusinessAwayMessageSettings = "BusinessAwayMessageSettings" + ClassBusinessGreetingMessageSettings = "BusinessGreetingMessageSettings" + ClassBusinessConnectedBot = "BusinessConnectedBot" + ClassBusinessIntro = "BusinessIntro" + ClassInputBusinessIntro = "InputBusinessIntro" + ClassBusinessOpeningHoursInterval = "BusinessOpeningHoursInterval" + ClassBusinessOpeningHours = "BusinessOpeningHours" + ClassBusinessInfo = "BusinessInfo" + ClassChatPhotoSticker = "ChatPhotoSticker" + ClassAnimatedChatPhoto = "AnimatedChatPhoto" + ClassChatPhoto = "ChatPhoto" + ClassChatPhotos = "ChatPhotos" + ClassChatPermissions = "ChatPermissions" + ClassChatAdministratorRights = "ChatAdministratorRights" + ClassPremiumPaymentOption = "PremiumPaymentOption" + ClassPremiumStatePaymentOption = "PremiumStatePaymentOption" + ClassPremiumGiftCodePaymentOption = "PremiumGiftCodePaymentOption" + ClassPremiumGiftCodePaymentOptions = "PremiumGiftCodePaymentOptions" + ClassPremiumGiftCodeInfo = "PremiumGiftCodeInfo" + ClassAccentColor = "AccentColor" + ClassProfileAccentColors = "ProfileAccentColors" + ClassProfileAccentColor = "ProfileAccentColor" + ClassEmojiStatus = "EmojiStatus" + ClassEmojiStatuses = "EmojiStatuses" + ClassUsernames = "Usernames" + ClassUser = "User" + ClassBotInfo = "BotInfo" + ClassUserFullInfo = "UserFullInfo" + ClassUsers = "Users" + ClassChatAdministrator = "ChatAdministrator" + ClassChatAdministrators = "ChatAdministrators" + 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" + ClassChatMessageSender = "ChatMessageSender" + ClassChatMessageSenders = "ChatMessageSenders" + ClassMessageViewer = "MessageViewer" + ClassMessageViewers = "MessageViewers" + ClassForwardSource = "ForwardSource" + ClassMessageForwardInfo = "MessageForwardInfo" + ClassMessageImportInfo = "MessageImportInfo" + ClassMessageReplyInfo = "MessageReplyInfo" + ClassMessageReaction = "MessageReaction" + ClassMessageReactions = "MessageReactions" + ClassMessageInteractionInfo = "MessageInteractionInfo" + ClassUnreadReaction = "UnreadReaction" + ClassTextQuote = "TextQuote" + ClassInputTextQuote = "InputTextQuote" + ClassMessage = "Message" + ClassMessages = "Messages" + ClassFoundMessages = "FoundMessages" + ClassFoundChatMessages = "FoundChatMessages" + ClassMessagePosition = "MessagePosition" + ClassMessagePositions = "MessagePositions" + ClassMessageCalendarDay = "MessageCalendarDay" + ClassMessageCalendar = "MessageCalendar" + ClassBusinessMessage = "BusinessMessage" + ClassBusinessMessages = "BusinessMessages" + ClassMessageSponsor = "MessageSponsor" + ClassSponsoredMessage = "SponsoredMessage" + ClassSponsoredMessages = "SponsoredMessages" + ClassReportChatSponsoredMessageOption = "ReportChatSponsoredMessageOption" + ClassFileDownload = "FileDownload" + ClassDownloadedFileCounts = "DownloadedFileCounts" + ClassFoundFileDownloads = "FoundFileDownloads" + ClassChatNotificationSettings = "ChatNotificationSettings" + ClassScopeNotificationSettings = "ScopeNotificationSettings" + ClassDraftMessage = "DraftMessage" + ClassChatFolderIcon = "ChatFolderIcon" + ClassChatFolder = "ChatFolder" + ClassChatFolderInfo = "ChatFolderInfo" + ClassChatFolderInviteLink = "ChatFolderInviteLink" + ClassChatFolderInviteLinks = "ChatFolderInviteLinks" + ClassChatFolderInviteLinkInfo = "ChatFolderInviteLinkInfo" + ClassRecommendedChatFolder = "RecommendedChatFolder" + ClassRecommendedChatFolders = "RecommendedChatFolders" + ClassArchiveChatListSettings = "ArchiveChatListSettings" + ClassChatLists = "ChatLists" + ClassChatPosition = "ChatPosition" + ClassSavedMessagesTag = "SavedMessagesTag" + ClassSavedMessagesTags = "SavedMessagesTags" + ClassVideoChat = "VideoChat" + ClassChat = "Chat" + ClassChats = "Chats" + ClassChatNearby = "ChatNearby" + ClassChatsNearby = "ChatsNearby" + ClassKeyboardButton = "KeyboardButton" + ClassInlineKeyboardButton = "InlineKeyboardButton" + ClassFoundWebApp = "FoundWebApp" + ClassWebAppInfo = "WebAppInfo" + ClassMessageThreadInfo = "MessageThreadInfo" + ClassSavedMessagesTopic = "SavedMessagesTopic" + ClassForumTopicIcon = "ForumTopicIcon" + ClassForumTopicInfo = "ForumTopicInfo" + ClassForumTopic = "ForumTopic" + ClassForumTopics = "ForumTopics" + ClassLinkPreviewOptions = "LinkPreviewOptions" + ClassSharedUser = "SharedUser" + ClassSharedChat = "SharedChat" + ClassPageBlockCaption = "PageBlockCaption" + ClassPageBlockListItem = "PageBlockListItem" + ClassPageBlockTableCell = "PageBlockTableCell" + ClassPageBlockRelatedArticle = "PageBlockRelatedArticle" + ClassWebPageInstantView = "WebPageInstantView" + ClassWebPage = "WebPage" + ClassCountryInfo = "CountryInfo" + ClassCountries = "Countries" + ClassPhoneNumberInfo = "PhoneNumberInfo" + ClassCollectibleItemInfo = "CollectibleItemInfo" + ClassBankCardActionOpenUrl = "BankCardActionOpenUrl" + ClassBankCardInfo = "BankCardInfo" + ClassAddress = "Address" + ClassThemeParameters = "ThemeParameters" + ClassLabeledPricePart = "LabeledPricePart" + ClassInvoice = "Invoice" + ClassOrderInfo = "OrderInfo" + ClassShippingOption = "ShippingOption" + ClassSavedCredentials = "SavedCredentials" + ClassPaymentOption = "PaymentOption" + ClassPaymentForm = "PaymentForm" + ClassValidatedOrderInfo = "ValidatedOrderInfo" + ClassPaymentResult = "PaymentResult" + ClassPaymentReceipt = "PaymentReceipt" + ClassPremiumGiveawayParameters = "PremiumGiveawayParameters" + 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" + ClassEmojiKeyword = "EmojiKeyword" + ClassEmojiKeywords = "EmojiKeywords" + ClassStickers = "Stickers" + ClassEmojis = "Emojis" + ClassStickerSet = "StickerSet" + ClassStickerSetInfo = "StickerSetInfo" + ClassStickerSets = "StickerSets" + ClassTrendingStickerSets = "TrendingStickerSets" + ClassEmojiCategory = "EmojiCategory" + ClassEmojiCategories = "EmojiCategories" + ClassStoryAreaPosition = "StoryAreaPosition" + ClassStoryArea = "StoryArea" + ClassInputStoryArea = "InputStoryArea" + ClassInputStoryAreas = "InputStoryAreas" + ClassStoryVideo = "StoryVideo" + ClassStoryRepostInfo = "StoryRepostInfo" + ClassStoryInteractionInfo = "StoryInteractionInfo" + ClassStory = "Story" + ClassStories = "Stories" + ClassStoryFullId = "StoryFullId" + ClassStoryInfo = "StoryInfo" + ClassChatActiveStories = "ChatActiveStories" + ClassStoryInteraction = "StoryInteraction" + ClassStoryInteractions = "StoryInteractions" + ClassQuickReplyMessage = "QuickReplyMessage" + ClassQuickReplyShortcut = "QuickReplyShortcut" + ClassPublicForwards = "PublicForwards" + ClassChatBoostLevelFeatures = "ChatBoostLevelFeatures" + ClassChatBoostFeatures = "ChatBoostFeatures" + ClassPrepaidPremiumGiveaway = "PrepaidPremiumGiveaway" + ClassChatBoostStatus = "ChatBoostStatus" + ClassChatBoost = "ChatBoost" + ClassFoundChatBoosts = "FoundChatBoosts" + ClassChatBoostSlot = "ChatBoostSlot" + ClassChatBoostSlots = "ChatBoostSlots" + 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" + ClassAvailableReaction = "AvailableReaction" + ClassAvailableReactions = "AvailableReactions" + ClassEmojiReaction = "EmojiReaction" + ClassAnimations = "Animations" + ClassImportedContacts = "ImportedContacts" + ClassBusinessConnection = "BusinessConnection" + ClassAttachmentMenuBotColor = "AttachmentMenuBotColor" + ClassAttachmentMenuBot = "AttachmentMenuBot" + ClassSentWebAppMessage = "SentWebAppMessage" + ClassHttpUrl = "HttpUrl" + ClassUserLink = "UserLink" + ClassInlineQueryResultsButton = "InlineQueryResultsButton" + ClassInlineQueryResults = "InlineQueryResults" + ClassCallbackQueryAnswer = "CallbackQueryAnswer" + ClassCustomRequestResult = "CustomRequestResult" + ClassGameHighScore = "GameHighScore" + ClassGameHighScores = "GameHighScores" + ClassChatEvent = "ChatEvent" + ClassChatEvents = "ChatEvents" + ClassChatEventLogFilters = "ChatEventLogFilters" + ClassLanguagePackString = "LanguagePackString" + ClassLanguagePackStrings = "LanguagePackStrings" + ClassLanguagePackInfo = "LanguagePackInfo" + ClassLocalizationTargetInfo = "LocalizationTargetInfo" + ClassPremiumLimit = "PremiumLimit" + ClassPremiumFeatures = "PremiumFeatures" + ClassBusinessFeatures = "BusinessFeatures" + ClassPremiumFeaturePromotionAnimation = "PremiumFeaturePromotionAnimation" + ClassBusinessFeaturePromotionAnimation = "BusinessFeaturePromotionAnimation" + ClassPremiumState = "PremiumState" + Class//-To = "https://my.telegram.org" + ClassPushReceiverId = "PushReceiverId" + ClassThemeSettings = "ThemeSettings" + ClassChatTheme = "ChatTheme" + ClassTimeZone = "TimeZone" + ClassTimeZones = "TimeZones" + ClassHashtags = "Hashtags" + ClassNotificationSound = "NotificationSound" + ClassNotificationSounds = "NotificationSounds" + ClassNotification = "Notification" + ClassNotificationGroup = "NotificationGroup" + ClassJsonObjectMember = "JsonObjectMember" + ClassUserPrivacySettingRules = "UserPrivacySettingRules" + ClassReadDatePrivacySettings = "ReadDatePrivacySettings" + ClassNewChatPrivacySettings = "NewChatPrivacySettings" + ClassAccountTtl = "AccountTtl" + ClassMessageAutoDeleteTime = "MessageAutoDeleteTime" + ClassSession = "Session" + ClassSessions = "Sessions" + ClassUnconfirmedSession = "UnconfirmedSession" + ClassConnectedWebsite = "ConnectedWebsite" + ClassConnectedWebsites = "ConnectedWebsites" + ClassMessageLink = "MessageLink" + ClassMessageLinkInfo = "MessageLinkInfo" + ClassChatBoostLink = "ChatBoostLink" + ClassChatBoostLinkInfo = "ChatBoostLinkInfo" + ClassFilePart = "FilePart" + ClassStorageStatisticsByFileType = "StorageStatisticsByFileType" + ClassStorageStatisticsByChat = "StorageStatisticsByChat" + ClassStorageStatistics = "StorageStatistics" + ClassStorageStatisticsFast = "StorageStatisticsFast" + ClassDatabaseStatistics = "DatabaseStatistics" + ClassNetworkStatistics = "NetworkStatistics" + ClassAutoDownloadSettings = "AutoDownloadSettings" + ClassAutoDownloadSettingsPresets = "AutoDownloadSettingsPresets" + ClassScopeAutosaveSettings = "ScopeAutosaveSettings" + ClassAutosaveSettingsException = "AutosaveSettingsException" + ClassAutosaveSettings = "AutosaveSettings" + ClassFoundPosition = "FoundPosition" + ClassFoundPositions = "FoundPositions" + ClassTMeUrl = "TMeUrl" + ClassTMeUrls = "TMeUrls" + ClassCount = "Count" + ClassText = "Text" + ClassSeconds = "Seconds" + ClassFileDownloadedPrefixSize = "FileDownloadedPrefixSize" + ClassDeepLinkInfo = "DeepLinkInfo" + ClassProxy = "Proxy" + ClassProxies = "Proxies" + ClassInputSticker = "InputSticker" + ClassDateRange = "DateRange" + ClassStatisticalValue = "StatisticalValue" + ClassChatStatisticsInteractionInfo = "ChatStatisticsInteractionInfo" + ClassChatStatisticsMessageSenderInfo = "ChatStatisticsMessageSenderInfo" + ClassChatStatisticsAdministratorActionsInfo = "ChatStatisticsAdministratorActionsInfo" + ClassChatStatisticsInviterInfo = "ChatStatisticsInviterInfo" + ClassMessageStatistics = "MessageStatistics" + ClassStoryStatistics = "StoryStatistics" + ClassPoint = "Point" + ClassUpdates = "Updates" + ClassLogVerbosityLevel = "LogVerbosityLevel" + ClassLogTags = "LogTags" + ClassUserSupportInfo = "UserSupportInfo" + ClassTestInt = "TestInt" + ClassTestString = "TestString" + ClassTestBytes = "TestBytes" + ClassTestVectorInt = "TestVectorInt" + ClassTestVectorIntObject = "TestVectorIntObject" + ClassTestVectorString = "TestVectorString" + ClassTestVectorStringObject = "TestVectorStringObject" ) const ( - TypeError = "error" - TypeOk = "ok" - TypeAuthenticationCodeTypeTelegramMessage = "authenticationCodeTypeTelegramMessage" - TypeAuthenticationCodeTypeSms = "authenticationCodeTypeSms" - TypeAuthenticationCodeTypeCall = "authenticationCodeTypeCall" - TypeAuthenticationCodeTypeFlashCall = "authenticationCodeTypeFlashCall" - TypeAuthenticationCodeTypeMissedCall = "authenticationCodeTypeMissedCall" - TypeAuthenticationCodeTypeFragment = "authenticationCodeTypeFragment" - TypeAuthenticationCodeInfo = "authenticationCodeInfo" - TypeEmailAddressAuthenticationCodeInfo = "emailAddressAuthenticationCodeInfo" - TypeEmailAddressAuthenticationCode = "emailAddressAuthenticationCode" - TypeEmailAddressAuthenticationAppleId = "emailAddressAuthenticationAppleId" - TypeEmailAddressAuthenticationGoogleId = "emailAddressAuthenticationGoogleId" - TypeTextEntity = "textEntity" - TypeTextEntities = "textEntities" - TypeFormattedText = "formattedText" - TypeTermsOfService = "termsOfService" - TypeAuthorizationStateWaitTdlibParameters = "authorizationStateWaitTdlibParameters" - TypeAuthorizationStateWaitPhoneNumber = "authorizationStateWaitPhoneNumber" - TypeAuthorizationStateWaitEmailAddress = "authorizationStateWaitEmailAddress" - TypeAuthorizationStateWaitEmailCode = "authorizationStateWaitEmailCode" - 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" - TypeStickerFormatWebp = "stickerFormatWebp" - TypeStickerFormatTgs = "stickerFormatTgs" - TypeStickerFormatWebm = "stickerFormatWebm" - TypeStickerTypeRegular = "stickerTypeRegular" - TypeStickerTypeMask = "stickerTypeMask" - TypeStickerTypeCustomEmoji = "stickerTypeCustomEmoji" - TypeStickerFullTypeRegular = "stickerFullTypeRegular" - TypeStickerFullTypeMask = "stickerFullTypeMask" - TypeStickerFullTypeCustomEmoji = "stickerFullTypeCustomEmoji" - 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" - TypeBotMenuButton = "botMenuButton" - TypeChatLocation = "chatLocation" - TypeAnimatedChatPhoto = "animatedChatPhoto" - TypeChatPhoto = "chatPhoto" - TypeChatPhotos = "chatPhotos" - TypeInputChatPhotoPrevious = "inputChatPhotoPrevious" - TypeInputChatPhotoStatic = "inputChatPhotoStatic" - TypeInputChatPhotoAnimation = "inputChatPhotoAnimation" - TypeChatPermissions = "chatPermissions" - TypeChatAdministratorRights = "chatAdministratorRights" - TypePremiumPaymentOption = "premiumPaymentOption" - TypeEmojiStatus = "emojiStatus" - TypeEmojiStatuses = "emojiStatuses" - TypeUsernames = "usernames" - TypeUser = "user" - TypeBotInfo = "botInfo" - TypeUserFullInfo = "userFullInfo" - TypeUsers = "users" - TypeChatAdministrator = "chatAdministrator" - TypeChatAdministrators = "chatAdministrators" - 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" - TypeChatMessageSender = "chatMessageSender" - TypeChatMessageSenders = "chatMessageSenders" - TypeMessageForwardOriginUser = "messageForwardOriginUser" - TypeMessageForwardOriginChat = "messageForwardOriginChat" - TypeMessageForwardOriginHiddenUser = "messageForwardOriginHiddenUser" - TypeMessageForwardOriginChannel = "messageForwardOriginChannel" - TypeMessageForwardOriginMessageImport = "messageForwardOriginMessageImport" - TypeReactionTypeEmoji = "reactionTypeEmoji" - TypeReactionTypeCustomEmoji = "reactionTypeCustomEmoji" - TypeMessageForwardInfo = "messageForwardInfo" - TypeMessageReplyInfo = "messageReplyInfo" - TypeMessageReaction = "messageReaction" - TypeMessageInteractionInfo = "messageInteractionInfo" - TypeUnreadReaction = "unreadReaction" - TypeMessageSendingStatePending = "messageSendingStatePending" - TypeMessageSendingStateFailed = "messageSendingStateFailed" - TypeMessage = "message" - TypeMessages = "messages" - TypeFoundMessages = "foundMessages" - TypeFoundChatMessages = "foundChatMessages" - TypeMessagePosition = "messagePosition" - TypeMessagePositions = "messagePositions" - TypeMessageCalendarDay = "messageCalendarDay" - TypeMessageCalendar = "messageCalendar" - TypeSponsoredMessage = "sponsoredMessage" - TypeSponsoredMessages = "sponsoredMessages" - 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" - TypeChatAvailableReactionsAll = "chatAvailableReactionsAll" - TypeChatAvailableReactionsSome = "chatAvailableReactionsSome" - 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" - TypeKeyboardButtonTypeWebApp = "keyboardButtonTypeWebApp" - TypeKeyboardButton = "keyboardButton" - TypeInlineKeyboardButtonTypeUrl = "inlineKeyboardButtonTypeUrl" - TypeInlineKeyboardButtonTypeLoginUrl = "inlineKeyboardButtonTypeLoginUrl" - TypeInlineKeyboardButtonTypeWebApp = "inlineKeyboardButtonTypeWebApp" - 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" - TypeWebAppInfo = "webAppInfo" - TypeMessageThreadInfo = "messageThreadInfo" - TypeForumTopicIcon = "forumTopicIcon" - TypeForumTopicInfo = "forumTopicInfo" - TypeForumTopic = "forumTopic" - TypeForumTopics = "forumTopics" - 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" - TypeThemeParameters = "themeParameters" - TypeLabeledPricePart = "labeledPricePart" - TypeInvoice = "invoice" - TypeOrderInfo = "orderInfo" - TypeShippingOption = "shippingOption" - TypeSavedCredentials = "savedCredentials" - TypeInputCredentialsSaved = "inputCredentialsSaved" - TypeInputCredentialsNew = "inputCredentialsNew" - TypeInputCredentialsApplePay = "inputCredentialsApplePay" - TypeInputCredentialsGooglePay = "inputCredentialsGooglePay" - TypePaymentProviderSmartGlocal = "paymentProviderSmartGlocal" - TypePaymentProviderStripe = "paymentProviderStripe" - TypePaymentProviderOther = "paymentProviderOther" - TypePaymentOption = "paymentOption" - TypePaymentForm = "paymentForm" - TypeValidatedOrderInfo = "validatedOrderInfo" - TypePaymentResult = "paymentResult" - TypePaymentReceipt = "paymentReceipt" - TypeInputInvoiceMessage = "inputInvoiceMessage" - TypeInputInvoiceName = "inputInvoiceName" - TypeMessageExtendedMediaPreview = "messageExtendedMediaPreview" - TypeMessageExtendedMediaPhoto = "messageExtendedMediaPhoto" - TypeMessageExtendedMediaVideo = "messageExtendedMediaVideo" - TypeMessageExtendedMediaUnsupported = "messageExtendedMediaUnsupported" - 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" - TypeMessageChatSetMessageAutoDeleteTime = "messageChatSetMessageAutoDeleteTime" - TypeMessageForumTopicCreated = "messageForumTopicCreated" - TypeMessageForumTopicEdited = "messageForumTopicEdited" - TypeMessageForumTopicIsClosedToggled = "messageForumTopicIsClosedToggled" - TypeMessageForumTopicIsHiddenToggled = "messageForumTopicIsHiddenToggled" - TypeMessageSuggestProfilePhoto = "messageSuggestProfilePhoto" - TypeMessageCustomServiceAction = "messageCustomServiceAction" - TypeMessageGameScore = "messageGameScore" - TypeMessagePaymentSuccessful = "messagePaymentSuccessful" - TypeMessagePaymentSuccessfulBot = "messagePaymentSuccessfulBot" - TypeMessageGiftedPremium = "messageGiftedPremium" - TypeMessageContactRegistered = "messageContactRegistered" - TypeMessageWebsiteConnected = "messageWebsiteConnected" - TypeMessageBotWriteAccessAllowed = "messageBotWriteAccessAllowed" - TypeMessageWebAppDataSent = "messageWebAppDataSent" - TypeMessageWebAppDataReceived = "messageWebAppDataReceived" - 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" - TypeTextEntityTypeCustomEmoji = "textEntityTypeCustomEmoji" - 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" - TypeTrendingStickerSets = "trendingStickerSets" - 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" - TypeAvailableReaction = "availableReaction" - TypeAvailableReactions = "availableReactions" - TypeEmojiReaction = "emojiReaction" - TypeAnimations = "animations" - TypeDiceStickersRegular = "diceStickersRegular" - TypeDiceStickersSlotMachine = "diceStickersSlotMachine" - TypeImportedContacts = "importedContacts" - TypeSpeechRecognitionResultPending = "speechRecognitionResultPending" - TypeSpeechRecognitionResultText = "speechRecognitionResultText" - TypeSpeechRecognitionResultError = "speechRecognitionResultError" - TypeAttachmentMenuBotColor = "attachmentMenuBotColor" - TypeAttachmentMenuBot = "attachmentMenuBot" - TypeSentWebAppMessage = "sentWebAppMessage" - TypeHttpUrl = "httpUrl" - TypeUserLink = "userLink" - 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" - TypeChatEventMessageAutoDeleteTimeChanged = "chatEventMessageAutoDeleteTimeChanged" - TypeChatEventPermissionsChanged = "chatEventPermissionsChanged" - TypeChatEventPhotoChanged = "chatEventPhotoChanged" - TypeChatEventSlowModeDelayChanged = "chatEventSlowModeDelayChanged" - TypeChatEventStickerSetChanged = "chatEventStickerSetChanged" - TypeChatEventTitleChanged = "chatEventTitleChanged" - TypeChatEventUsernameChanged = "chatEventUsernameChanged" - TypeChatEventActiveUsernamesChanged = "chatEventActiveUsernamesChanged" - TypeChatEventHasProtectedContentToggled = "chatEventHasProtectedContentToggled" - TypeChatEventInvitesToggled = "chatEventInvitesToggled" - TypeChatEventIsAllHistoryAvailableToggled = "chatEventIsAllHistoryAvailableToggled" - TypeChatEventHasAggressiveAntiSpamEnabledToggled = "chatEventHasAggressiveAntiSpamEnabledToggled" - TypeChatEventSignMessagesToggled = "chatEventSignMessagesToggled" - TypeChatEventInviteLinkEdited = "chatEventInviteLinkEdited" - TypeChatEventInviteLinkRevoked = "chatEventInviteLinkRevoked" - TypeChatEventInviteLinkDeleted = "chatEventInviteLinkDeleted" - TypeChatEventVideoChatCreated = "chatEventVideoChatCreated" - TypeChatEventVideoChatEnded = "chatEventVideoChatEnded" - TypeChatEventVideoChatMuteNewParticipantsToggled = "chatEventVideoChatMuteNewParticipantsToggled" - TypeChatEventVideoChatParticipantIsMutedToggled = "chatEventVideoChatParticipantIsMutedToggled" - TypeChatEventVideoChatParticipantVolumeLevelChanged = "chatEventVideoChatParticipantVolumeLevelChanged" - TypeChatEventIsForumToggled = "chatEventIsForumToggled" - TypeChatEventForumTopicCreated = "chatEventForumTopicCreated" - TypeChatEventForumTopicEdited = "chatEventForumTopicEdited" - TypeChatEventForumTopicToggleIsClosed = "chatEventForumTopicToggleIsClosed" - TypeChatEventForumTopicToggleIsHidden = "chatEventForumTopicToggleIsHidden" - TypeChatEventForumTopicDeleted = "chatEventForumTopicDeleted" - TypeChatEventForumTopicPinned = "chatEventForumTopicPinned" - TypeChatEvent = "chatEvent" - TypeChatEvents = "chatEvents" - TypeChatEventLogFilters = "chatEventLogFilters" - TypeLanguagePackStringValueOrdinary = "languagePackStringValueOrdinary" - TypeLanguagePackStringValuePluralized = "languagePackStringValuePluralized" - TypeLanguagePackStringValueDeleted = "languagePackStringValueDeleted" - TypeLanguagePackString = "languagePackString" - TypeLanguagePackStrings = "languagePackStrings" - TypeLanguagePackInfo = "languagePackInfo" - TypeLocalizationTargetInfo = "localizationTargetInfo" - TypePremiumLimitTypeSupergroupCount = "premiumLimitTypeSupergroupCount" - TypePremiumLimitTypePinnedChatCount = "premiumLimitTypePinnedChatCount" - TypePremiumLimitTypeCreatedPublicChatCount = "premiumLimitTypeCreatedPublicChatCount" - TypePremiumLimitTypeSavedAnimationCount = "premiumLimitTypeSavedAnimationCount" - TypePremiumLimitTypeFavoriteStickerCount = "premiumLimitTypeFavoriteStickerCount" - TypePremiumLimitTypeChatFilterCount = "premiumLimitTypeChatFilterCount" - TypePremiumLimitTypeChatFilterChosenChatCount = "premiumLimitTypeChatFilterChosenChatCount" - TypePremiumLimitTypePinnedArchivedChatCount = "premiumLimitTypePinnedArchivedChatCount" - TypePremiumLimitTypeCaptionLength = "premiumLimitTypeCaptionLength" - TypePremiumLimitTypeBioLength = "premiumLimitTypeBioLength" - TypePremiumFeatureIncreasedLimits = "premiumFeatureIncreasedLimits" - TypePremiumFeatureIncreasedUploadFileSize = "premiumFeatureIncreasedUploadFileSize" - TypePremiumFeatureImprovedDownloadSpeed = "premiumFeatureImprovedDownloadSpeed" - TypePremiumFeatureVoiceRecognition = "premiumFeatureVoiceRecognition" - TypePremiumFeatureDisabledAds = "premiumFeatureDisabledAds" - TypePremiumFeatureUniqueReactions = "premiumFeatureUniqueReactions" - TypePremiumFeatureUniqueStickers = "premiumFeatureUniqueStickers" - TypePremiumFeatureCustomEmoji = "premiumFeatureCustomEmoji" - TypePremiumFeatureAdvancedChatManagement = "premiumFeatureAdvancedChatManagement" - TypePremiumFeatureProfileBadge = "premiumFeatureProfileBadge" - TypePremiumFeatureEmojiStatus = "premiumFeatureEmojiStatus" - TypePremiumFeatureAnimatedProfilePhoto = "premiumFeatureAnimatedProfilePhoto" - TypePremiumFeatureForumTopicIcon = "premiumFeatureForumTopicIcon" - TypePremiumFeatureAppIcons = "premiumFeatureAppIcons" - TypePremiumLimit = "premiumLimit" - TypePremiumFeatures = "premiumFeatures" - TypePremiumSourceLimitExceeded = "premiumSourceLimitExceeded" - TypePremiumSourceFeature = "premiumSourceFeature" - TypePremiumSourceLink = "premiumSourceLink" - TypePremiumSourceSettings = "premiumSourceSettings" - TypePremiumFeaturePromotionAnimation = "premiumFeaturePromotionAnimation" - TypePremiumState = "premiumState" - TypeStorePaymentPurposePremiumSubscription = "storePaymentPurposePremiumSubscription" - TypeStorePaymentPurposeGiftedPremium = "storePaymentPurposeGiftedPremium" - 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" - TypeCheckChatUsernameResultUsernamePurchasable = "checkChatUsernameResultUsernamePurchasable" - TypeCheckChatUsernameResultPublicChatsTooMany = "checkChatUsernameResultPublicChatsTooMany" - 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" - TypePushMessageContentRecurringPayment = "pushMessageContentRecurringPayment" - TypePushMessageContentSuggestProfilePhoto = "pushMessageContentSuggestProfilePhoto" - TypePushMessageContentMessageForwards = "pushMessageContentMessageForwards" - TypePushMessageContentMediaAlbum = "pushMessageContentMediaAlbum" - TypeNotificationTypeNewMessage = "notificationTypeNewMessage" - TypeNotificationTypeNewSecretChat = "notificationTypeNewSecretChat" - TypeNotificationTypeNewCall = "notificationTypeNewCall" - TypeNotificationTypeNewPushMessage = "notificationTypeNewPushMessage" - TypeNotificationGroupTypeMessages = "notificationGroupTypeMessages" - TypeNotificationGroupTypeMentions = "notificationGroupTypeMentions" - TypeNotificationGroupTypeSecretChat = "notificationGroupTypeSecretChat" - TypeNotificationGroupTypeCalls = "notificationGroupTypeCalls" - TypeNotificationSound = "notificationSound" - TypeNotificationSounds = "notificationSounds" - 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" - TypeUserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages = "userPrivacySettingAllowPrivateVoiceAndVideoNoteMessages" - TypeAccountTtl = "accountTtl" - TypeMessageAutoDeleteTime = "messageAutoDeleteTime" - TypeSessionTypeAndroid = "sessionTypeAndroid" - TypeSessionTypeApple = "sessionTypeApple" - TypeSessionTypeBrave = "sessionTypeBrave" - TypeSessionTypeChrome = "sessionTypeChrome" - TypeSessionTypeEdge = "sessionTypeEdge" - TypeSessionTypeFirefox = "sessionTypeFirefox" - TypeSessionTypeIpad = "sessionTypeIpad" - TypeSessionTypeIphone = "sessionTypeIphone" - TypeSessionTypeLinux = "sessionTypeLinux" - TypeSessionTypeMac = "sessionTypeMac" - TypeSessionTypeOpera = "sessionTypeOpera" - TypeSessionTypeSafari = "sessionTypeSafari" - TypeSessionTypeUbuntu = "sessionTypeUbuntu" - TypeSessionTypeUnknown = "sessionTypeUnknown" - TypeSessionTypeVivaldi = "sessionTypeVivaldi" - TypeSessionTypeWindows = "sessionTypeWindows" - TypeSessionTypeXbox = "sessionTypeXbox" - 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" - TypeTargetChatCurrent = "targetChatCurrent" - TypeTargetChatChosen = "targetChatChosen" - TypeTargetChatInternalLink = "targetChatInternalLink" - TypeInternalLinkTypeActiveSessions = "internalLinkTypeActiveSessions" - TypeInternalLinkTypeAttachmentMenuBot = "internalLinkTypeAttachmentMenuBot" - TypeInternalLinkTypeAuthenticationCode = "internalLinkTypeAuthenticationCode" - TypeInternalLinkTypeBackground = "internalLinkTypeBackground" - TypeInternalLinkTypeBotStart = "internalLinkTypeBotStart" - TypeInternalLinkTypeBotStartInGroup = "internalLinkTypeBotStartInGroup" - TypeInternalLinkTypeBotAddToChannel = "internalLinkTypeBotAddToChannel" - TypeInternalLinkTypeChangePhoneNumber = "internalLinkTypeChangePhoneNumber" - TypeInternalLinkTypeChatInvite = "internalLinkTypeChatInvite" - TypeInternalLinkTypeDefaultMessageAutoDeleteTimerSettings = "internalLinkTypeDefaultMessageAutoDeleteTimerSettings" - TypeInternalLinkTypeEditProfileSettings = "internalLinkTypeEditProfileSettings" - TypeInternalLinkTypeFilterSettings = "internalLinkTypeFilterSettings" - TypeInternalLinkTypeGame = "internalLinkTypeGame" - TypeInternalLinkTypeInstantView = "internalLinkTypeInstantView" - TypeInternalLinkTypeInvoice = "internalLinkTypeInvoice" - TypeInternalLinkTypeLanguagePack = "internalLinkTypeLanguagePack" - TypeInternalLinkTypeLanguageSettings = "internalLinkTypeLanguageSettings" - TypeInternalLinkTypeMessage = "internalLinkTypeMessage" - TypeInternalLinkTypeMessageDraft = "internalLinkTypeMessageDraft" - TypeInternalLinkTypePassportDataRequest = "internalLinkTypePassportDataRequest" - TypeInternalLinkTypePhoneNumberConfirmation = "internalLinkTypePhoneNumberConfirmation" - TypeInternalLinkTypePremiumFeatures = "internalLinkTypePremiumFeatures" - TypeInternalLinkTypePrivacyAndSecuritySettings = "internalLinkTypePrivacyAndSecuritySettings" - TypeInternalLinkTypeProxy = "internalLinkTypeProxy" - TypeInternalLinkTypePublicChat = "internalLinkTypePublicChat" - TypeInternalLinkTypeQrCodeAuthentication = "internalLinkTypeQrCodeAuthentication" - TypeInternalLinkTypeRestorePurchases = "internalLinkTypeRestorePurchases" - TypeInternalLinkTypeSettings = "internalLinkTypeSettings" - TypeInternalLinkTypeStickerSet = "internalLinkTypeStickerSet" - TypeInternalLinkTypeTheme = "internalLinkTypeTheme" - TypeInternalLinkTypeThemeSettings = "internalLinkTypeThemeSettings" - TypeInternalLinkTypeUnknownDeepLink = "internalLinkTypeUnknownDeepLink" - TypeInternalLinkTypeUnsupportedProxy = "internalLinkTypeUnsupportedProxy" - TypeInternalLinkTypeUserPhoneNumber = "internalLinkTypeUserPhoneNumber" - TypeInternalLinkTypeUserToken = "internalLinkTypeUserToken" - TypeInternalLinkTypeVideoChat = "internalLinkTypeVideoChat" - TypeMessageLink = "messageLink" - TypeMessageLinkInfo = "messageLinkInfo" - TypeFilePart = "filePart" - TypeFileTypeNone = "fileTypeNone" - TypeFileTypeAnimation = "fileTypeAnimation" - TypeFileTypeAudio = "fileTypeAudio" - TypeFileTypeDocument = "fileTypeDocument" - TypeFileTypeNotificationSound = "fileTypeNotificationSound" - 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" - TypeFileDownloadedPrefixSize = "fileDownloadedPrefixSize" - 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" - TypeUpdateChatMessageAutoDeleteTime = "updateChatMessageAutoDeleteTime" - 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" - TypeUpdateForumTopicInfo = "updateForumTopicInfo" - 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" - TypeUpdateSavedNotificationSounds = "updateSavedNotificationSounds" - TypeUpdateSelectedBackground = "updateSelectedBackground" - TypeUpdateChatThemes = "updateChatThemes" - TypeUpdateLanguagePackStrings = "updateLanguagePackStrings" - TypeUpdateConnectionState = "updateConnectionState" - TypeUpdateTermsOfService = "updateTermsOfService" - TypeUpdateUsersNearby = "updateUsersNearby" - TypeUpdateAttachmentMenuBots = "updateAttachmentMenuBots" - TypeUpdateWebAppMessageSent = "updateWebAppMessageSent" - TypeUpdateActiveEmojiReactions = "updateActiveEmojiReactions" - TypeUpdateDefaultReactionType = "updateDefaultReactionType" - 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" - TypeUserSupportInfo = "userSupportInfo" - TypeTestInt = "testInt" - TypeTestString = "testString" - TypeTestBytes = "testBytes" - TypeTestVectorInt = "testVectorInt" - TypeTestVectorIntObject = "testVectorIntObject" - TypeTestVectorString = "testVectorString" - TypeTestVectorStringObject = "testVectorStringObject" + TypeError = "error" + TypeOk = "ok" + TypeAuthenticationCodeTypeTelegramMessage = "authenticationCodeTypeTelegramMessage" + TypeAuthenticationCodeTypeSms = "authenticationCodeTypeSms" + TypeAuthenticationCodeTypeCall = "authenticationCodeTypeCall" + TypeAuthenticationCodeTypeFlashCall = "authenticationCodeTypeFlashCall" + TypeAuthenticationCodeTypeMissedCall = "authenticationCodeTypeMissedCall" + TypeAuthenticationCodeTypeFragment = "authenticationCodeTypeFragment" + TypeAuthenticationCodeTypeFirebaseAndroid = "authenticationCodeTypeFirebaseAndroid" + TypeAuthenticationCodeTypeFirebaseIos = "authenticationCodeTypeFirebaseIos" + TypeAuthenticationCodeInfo = "authenticationCodeInfo" + TypeEmailAddressAuthenticationCodeInfo = "emailAddressAuthenticationCodeInfo" + TypeEmailAddressAuthenticationCode = "emailAddressAuthenticationCode" + TypeEmailAddressAuthenticationAppleId = "emailAddressAuthenticationAppleId" + TypeEmailAddressAuthenticationGoogleId = "emailAddressAuthenticationGoogleId" + TypeEmailAddressResetStateAvailable = "emailAddressResetStateAvailable" + TypeEmailAddressResetStatePending = "emailAddressResetStatePending" + TypeTextEntity = "textEntity" + TypeTextEntities = "textEntities" + TypeFormattedText = "formattedText" + TypeTermsOfService = "termsOfService" + TypeAuthorizationStateWaitTdlibParameters = "authorizationStateWaitTdlibParameters" + TypeAuthorizationStateWaitPhoneNumber = "authorizationStateWaitPhoneNumber" + TypeAuthorizationStateWaitEmailAddress = "authorizationStateWaitEmailAddress" + TypeAuthorizationStateWaitEmailCode = "authorizationStateWaitEmailCode" + 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" + TypeStickerFormatWebp = "stickerFormatWebp" + TypeStickerFormatTgs = "stickerFormatTgs" + TypeStickerFormatWebm = "stickerFormatWebm" + TypeStickerTypeRegular = "stickerTypeRegular" + TypeStickerTypeMask = "stickerTypeMask" + TypeStickerTypeCustomEmoji = "stickerTypeCustomEmoji" + TypeStickerFullTypeRegular = "stickerFullTypeRegular" + TypeStickerFullTypeMask = "stickerFullTypeMask" + TypeStickerFullTypeCustomEmoji = "stickerFullTypeCustomEmoji" + 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" + TypeWebApp = "webApp" + TypePoll = "poll" + TypeBackground = "background" + TypeBackgrounds = "backgrounds" + TypeChatBackground = "chatBackground" + TypeProfilePhoto = "profilePhoto" + TypeChatPhotoInfo = "chatPhotoInfo" + TypeUserTypeRegular = "userTypeRegular" + TypeUserTypeDeleted = "userTypeDeleted" + TypeUserTypeBot = "userTypeBot" + TypeUserTypeUnknown = "userTypeUnknown" + TypeBotCommand = "botCommand" + TypeBotCommands = "botCommands" + TypeBotMenuButton = "botMenuButton" + TypeChatLocation = "chatLocation" + TypeBirthdate = "birthdate" + TypeCloseBirthdayUser = "closeBirthdayUser" + TypeBusinessAwayMessageScheduleAlways = "businessAwayMessageScheduleAlways" + TypeBusinessAwayMessageScheduleOutsideOfOpeningHours = "businessAwayMessageScheduleOutsideOfOpeningHours" + TypeBusinessAwayMessageScheduleCustom = "businessAwayMessageScheduleCustom" + TypeBusinessLocation = "businessLocation" + TypeBusinessRecipients = "businessRecipients" + TypeBusinessAwayMessageSettings = "businessAwayMessageSettings" + TypeBusinessGreetingMessageSettings = "businessGreetingMessageSettings" + TypeBusinessConnectedBot = "businessConnectedBot" + TypeBusinessIntro = "businessIntro" + TypeInputBusinessIntro = "inputBusinessIntro" + TypeBusinessOpeningHoursInterval = "businessOpeningHoursInterval" + TypeBusinessOpeningHours = "businessOpeningHours" + TypeBusinessInfo = "businessInfo" + TypeChatPhotoStickerTypeRegularOrMask = "chatPhotoStickerTypeRegularOrMask" + TypeChatPhotoStickerTypeCustomEmoji = "chatPhotoStickerTypeCustomEmoji" + TypeChatPhotoSticker = "chatPhotoSticker" + TypeAnimatedChatPhoto = "animatedChatPhoto" + TypeChatPhoto = "chatPhoto" + TypeChatPhotos = "chatPhotos" + TypeInputChatPhotoPrevious = "inputChatPhotoPrevious" + TypeInputChatPhotoStatic = "inputChatPhotoStatic" + TypeInputChatPhotoAnimation = "inputChatPhotoAnimation" + TypeInputChatPhotoSticker = "inputChatPhotoSticker" + TypeChatPermissions = "chatPermissions" + TypeChatAdministratorRights = "chatAdministratorRights" + TypePremiumPaymentOption = "premiumPaymentOption" + TypePremiumStatePaymentOption = "premiumStatePaymentOption" + TypePremiumGiftCodePaymentOption = "premiumGiftCodePaymentOption" + TypePremiumGiftCodePaymentOptions = "premiumGiftCodePaymentOptions" + TypePremiumGiftCodeInfo = "premiumGiftCodeInfo" + TypePremiumGiveawayParticipantStatusEligible = "premiumGiveawayParticipantStatusEligible" + TypePremiumGiveawayParticipantStatusParticipating = "premiumGiveawayParticipantStatusParticipating" + TypePremiumGiveawayParticipantStatusAlreadyWasMember = "premiumGiveawayParticipantStatusAlreadyWasMember" + TypePremiumGiveawayParticipantStatusAdministrator = "premiumGiveawayParticipantStatusAdministrator" + TypePremiumGiveawayParticipantStatusDisallowedCountry = "premiumGiveawayParticipantStatusDisallowedCountry" + TypePremiumGiveawayInfoOngoing = "premiumGiveawayInfoOngoing" + TypePremiumGiveawayInfoCompleted = "premiumGiveawayInfoCompleted" + TypeAccentColor = "accentColor" + TypeProfileAccentColors = "profileAccentColors" + TypeProfileAccentColor = "profileAccentColor" + TypeEmojiStatus = "emojiStatus" + TypeEmojiStatuses = "emojiStatuses" + TypeUsernames = "usernames" + TypeUser = "user" + TypeBotInfo = "botInfo" + TypeUserFullInfo = "userFullInfo" + TypeUsers = "users" + TypeChatAdministrator = "chatAdministrator" + TypeChatAdministrators = "chatAdministrators" + 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" + TypeInviteLinkChatTypeBasicGroup = "inviteLinkChatTypeBasicGroup" + TypeInviteLinkChatTypeSupergroup = "inviteLinkChatTypeSupergroup" + TypeInviteLinkChatTypeChannel = "inviteLinkChatTypeChannel" + 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" + TypeChatMessageSender = "chatMessageSender" + TypeChatMessageSenders = "chatMessageSenders" + TypeMessageReadDateRead = "messageReadDateRead" + TypeMessageReadDateUnread = "messageReadDateUnread" + TypeMessageReadDateTooOld = "messageReadDateTooOld" + TypeMessageReadDateUserPrivacyRestricted = "messageReadDateUserPrivacyRestricted" + TypeMessageReadDateMyPrivacyRestricted = "messageReadDateMyPrivacyRestricted" + TypeMessageViewer = "messageViewer" + TypeMessageViewers = "messageViewers" + TypeMessageOriginUser = "messageOriginUser" + TypeMessageOriginHiddenUser = "messageOriginHiddenUser" + TypeMessageOriginChat = "messageOriginChat" + TypeMessageOriginChannel = "messageOriginChannel" + TypeForwardSource = "forwardSource" + TypeReactionTypeEmoji = "reactionTypeEmoji" + TypeReactionTypeCustomEmoji = "reactionTypeCustomEmoji" + TypeMessageForwardInfo = "messageForwardInfo" + TypeMessageImportInfo = "messageImportInfo" + TypeMessageReplyInfo = "messageReplyInfo" + TypeMessageReaction = "messageReaction" + TypeMessageReactions = "messageReactions" + TypeMessageInteractionInfo = "messageInteractionInfo" + TypeUnreadReaction = "unreadReaction" + TypeMessageSendingStatePending = "messageSendingStatePending" + TypeMessageSendingStateFailed = "messageSendingStateFailed" + TypeTextQuote = "textQuote" + TypeInputTextQuote = "inputTextQuote" + TypeMessageReplyToMessage = "messageReplyToMessage" + TypeMessageReplyToStory = "messageReplyToStory" + TypeInputMessageReplyToMessage = "inputMessageReplyToMessage" + TypeInputMessageReplyToStory = "inputMessageReplyToStory" + TypeMessage = "message" + TypeMessages = "messages" + TypeFoundMessages = "foundMessages" + TypeFoundChatMessages = "foundChatMessages" + TypeMessagePosition = "messagePosition" + TypeMessagePositions = "messagePositions" + TypeMessageCalendarDay = "messageCalendarDay" + TypeMessageCalendar = "messageCalendar" + TypeBusinessMessage = "businessMessage" + TypeBusinessMessages = "businessMessages" + TypeMessageSourceChatHistory = "messageSourceChatHistory" + TypeMessageSourceMessageThreadHistory = "messageSourceMessageThreadHistory" + TypeMessageSourceForumTopicHistory = "messageSourceForumTopicHistory" + TypeMessageSourceHistoryPreview = "messageSourceHistoryPreview" + TypeMessageSourceChatList = "messageSourceChatList" + TypeMessageSourceSearch = "messageSourceSearch" + TypeMessageSourceChatEventLog = "messageSourceChatEventLog" + TypeMessageSourceNotification = "messageSourceNotification" + TypeMessageSourceScreenshot = "messageSourceScreenshot" + TypeMessageSourceOther = "messageSourceOther" + TypeMessageSponsorTypeBot = "messageSponsorTypeBot" + TypeMessageSponsorTypeWebApp = "messageSponsorTypeWebApp" + TypeMessageSponsorTypePublicChannel = "messageSponsorTypePublicChannel" + TypeMessageSponsorTypePrivateChannel = "messageSponsorTypePrivateChannel" + TypeMessageSponsorTypeWebsite = "messageSponsorTypeWebsite" + TypeMessageSponsor = "messageSponsor" + TypeSponsoredMessage = "sponsoredMessage" + TypeSponsoredMessages = "sponsoredMessages" + TypeReportChatSponsoredMessageOption = "reportChatSponsoredMessageOption" + TypeReportChatSponsoredMessageResultOk = "reportChatSponsoredMessageResultOk" + TypeReportChatSponsoredMessageResultFailed = "reportChatSponsoredMessageResultFailed" + TypeReportChatSponsoredMessageResultOptionRequired = "reportChatSponsoredMessageResultOptionRequired" + TypeReportChatSponsoredMessageResultAdsHidden = "reportChatSponsoredMessageResultAdsHidden" + TypeReportChatSponsoredMessageResultPremiumRequired = "reportChatSponsoredMessageResultPremiumRequired" + 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" + TypeChatFolderIcon = "chatFolderIcon" + TypeChatFolder = "chatFolder" + TypeChatFolderInfo = "chatFolderInfo" + TypeChatFolderInviteLink = "chatFolderInviteLink" + TypeChatFolderInviteLinks = "chatFolderInviteLinks" + TypeChatFolderInviteLinkInfo = "chatFolderInviteLinkInfo" + TypeRecommendedChatFolder = "recommendedChatFolder" + TypeRecommendedChatFolders = "recommendedChatFolders" + TypeArchiveChatListSettings = "archiveChatListSettings" + TypeChatListMain = "chatListMain" + TypeChatListArchive = "chatListArchive" + TypeChatListFolder = "chatListFolder" + TypeChatLists = "chatLists" + TypeChatSourceMtprotoProxy = "chatSourceMtprotoProxy" + TypeChatSourcePublicServiceAnnouncement = "chatSourcePublicServiceAnnouncement" + TypeChatPosition = "chatPosition" + TypeChatAvailableReactionsAll = "chatAvailableReactionsAll" + TypeChatAvailableReactionsSome = "chatAvailableReactionsSome" + TypeSavedMessagesTag = "savedMessagesTag" + TypeSavedMessagesTags = "savedMessagesTags" + 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" + TypeKeyboardButtonTypeRequestUsers = "keyboardButtonTypeRequestUsers" + TypeKeyboardButtonTypeRequestChat = "keyboardButtonTypeRequestChat" + TypeKeyboardButtonTypeWebApp = "keyboardButtonTypeWebApp" + TypeKeyboardButton = "keyboardButton" + TypeInlineKeyboardButtonTypeUrl = "inlineKeyboardButtonTypeUrl" + TypeInlineKeyboardButtonTypeLoginUrl = "inlineKeyboardButtonTypeLoginUrl" + TypeInlineKeyboardButtonTypeWebApp = "inlineKeyboardButtonTypeWebApp" + 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" + TypeFoundWebApp = "foundWebApp" + TypeWebAppInfo = "webAppInfo" + TypeMessageThreadInfo = "messageThreadInfo" + TypeSavedMessagesTopicTypeMyNotes = "savedMessagesTopicTypeMyNotes" + TypeSavedMessagesTopicTypeAuthorHidden = "savedMessagesTopicTypeAuthorHidden" + TypeSavedMessagesTopicTypeSavedFromChat = "savedMessagesTopicTypeSavedFromChat" + TypeSavedMessagesTopic = "savedMessagesTopic" + TypeForumTopicIcon = "forumTopicIcon" + TypeForumTopicInfo = "forumTopicInfo" + TypeForumTopic = "forumTopic" + TypeForumTopics = "forumTopics" + TypeLinkPreviewOptions = "linkPreviewOptions" + TypeSharedUser = "sharedUser" + TypeSharedChat = "sharedChat" + 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" + TypeCollectibleItemTypeUsername = "collectibleItemTypeUsername" + TypeCollectibleItemTypePhoneNumber = "collectibleItemTypePhoneNumber" + TypeCollectibleItemInfo = "collectibleItemInfo" + TypeBankCardActionOpenUrl = "bankCardActionOpenUrl" + TypeBankCardInfo = "bankCardInfo" + TypeAddress = "address" + TypeThemeParameters = "themeParameters" + TypeLabeledPricePart = "labeledPricePart" + TypeInvoice = "invoice" + TypeOrderInfo = "orderInfo" + TypeShippingOption = "shippingOption" + TypeSavedCredentials = "savedCredentials" + TypeInputCredentialsSaved = "inputCredentialsSaved" + TypeInputCredentialsNew = "inputCredentialsNew" + TypeInputCredentialsApplePay = "inputCredentialsApplePay" + TypeInputCredentialsGooglePay = "inputCredentialsGooglePay" + TypePaymentProviderSmartGlocal = "paymentProviderSmartGlocal" + TypePaymentProviderStripe = "paymentProviderStripe" + TypePaymentProviderOther = "paymentProviderOther" + TypePaymentOption = "paymentOption" + TypePaymentForm = "paymentForm" + TypeValidatedOrderInfo = "validatedOrderInfo" + TypePaymentResult = "paymentResult" + TypePaymentReceipt = "paymentReceipt" + TypeInputInvoiceMessage = "inputInvoiceMessage" + TypeInputInvoiceName = "inputInvoiceName" + TypeInputInvoiceTelegram = "inputInvoiceTelegram" + TypeMessageExtendedMediaPreview = "messageExtendedMediaPreview" + TypeMessageExtendedMediaPhoto = "messageExtendedMediaPhoto" + TypeMessageExtendedMediaVideo = "messageExtendedMediaVideo" + TypeMessageExtendedMediaUnsupported = "messageExtendedMediaUnsupported" + TypePremiumGiveawayParameters = "premiumGiveawayParameters" + 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" + TypeMessageSticker = "messageSticker" + TypeMessageVideo = "messageVideo" + TypeMessageVideoNote = "messageVideoNote" + TypeMessageVoiceNote = "messageVoiceNote" + TypeMessageExpiredPhoto = "messageExpiredPhoto" + TypeMessageExpiredVideo = "messageExpiredVideo" + TypeMessageExpiredVideoNote = "messageExpiredVideoNote" + TypeMessageExpiredVoiceNote = "messageExpiredVoiceNote" + TypeMessageLocation = "messageLocation" + TypeMessageVenue = "messageVenue" + TypeMessageContact = "messageContact" + TypeMessageAnimatedEmoji = "messageAnimatedEmoji" + TypeMessageDice = "messageDice" + TypeMessageGame = "messageGame" + TypeMessagePoll = "messagePoll" + TypeMessageStory = "messageStory" + 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" + TypeMessageChatSetBackground = "messageChatSetBackground" + TypeMessageChatSetTheme = "messageChatSetTheme" + TypeMessageChatSetMessageAutoDeleteTime = "messageChatSetMessageAutoDeleteTime" + TypeMessageChatBoost = "messageChatBoost" + TypeMessageForumTopicCreated = "messageForumTopicCreated" + TypeMessageForumTopicEdited = "messageForumTopicEdited" + TypeMessageForumTopicIsClosedToggled = "messageForumTopicIsClosedToggled" + TypeMessageForumTopicIsHiddenToggled = "messageForumTopicIsHiddenToggled" + TypeMessageSuggestProfilePhoto = "messageSuggestProfilePhoto" + TypeMessageCustomServiceAction = "messageCustomServiceAction" + TypeMessageGameScore = "messageGameScore" + TypeMessagePaymentSuccessful = "messagePaymentSuccessful" + TypeMessagePaymentSuccessfulBot = "messagePaymentSuccessfulBot" + TypeMessageGiftedPremium = "messageGiftedPremium" + TypeMessagePremiumGiftCode = "messagePremiumGiftCode" + TypeMessagePremiumGiveawayCreated = "messagePremiumGiveawayCreated" + TypeMessagePremiumGiveaway = "messagePremiumGiveaway" + TypeMessagePremiumGiveawayCompleted = "messagePremiumGiveawayCompleted" + TypeMessagePremiumGiveawayWinners = "messagePremiumGiveawayWinners" + TypeMessageContactRegistered = "messageContactRegistered" + TypeMessageUsersShared = "messageUsersShared" + TypeMessageChatShared = "messageChatShared" + TypeMessageBotWriteAccessAllowed = "messageBotWriteAccessAllowed" + TypeMessageWebAppDataSent = "messageWebAppDataSent" + TypeMessageWebAppDataReceived = "messageWebAppDataReceived" + 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" + TypeTextEntityTypeBlockQuote = "textEntityTypeBlockQuote" + TypeTextEntityTypeTextUrl = "textEntityTypeTextUrl" + TypeTextEntityTypeMentionName = "textEntityTypeMentionName" + TypeTextEntityTypeCustomEmoji = "textEntityTypeCustomEmoji" + TypeTextEntityTypeMediaTimestamp = "textEntityTypeMediaTimestamp" + TypeInputThumbnail = "inputThumbnail" + TypeMessageSchedulingStateSendAtDate = "messageSchedulingStateSendAtDate" + TypeMessageSchedulingStateSendWhenOnline = "messageSchedulingStateSendWhenOnline" + TypeMessageSelfDestructTypeTimer = "messageSelfDestructTypeTimer" + TypeMessageSelfDestructTypeImmediately = "messageSelfDestructTypeImmediately" + 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" + TypeInputMessageStory = "inputMessageStory" + 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" + TypeEmojiKeyword = "emojiKeyword" + TypeEmojiKeywords = "emojiKeywords" + TypeStickers = "stickers" + TypeEmojis = "emojis" + TypeStickerSet = "stickerSet" + TypeStickerSetInfo = "stickerSetInfo" + TypeStickerSets = "stickerSets" + TypeTrendingStickerSets = "trendingStickerSets" + TypeEmojiCategory = "emojiCategory" + TypeEmojiCategories = "emojiCategories" + TypeEmojiCategoryTypeDefault = "emojiCategoryTypeDefault" + TypeEmojiCategoryTypeEmojiStatus = "emojiCategoryTypeEmojiStatus" + TypeEmojiCategoryTypeChatPhoto = "emojiCategoryTypeChatPhoto" + TypeStoryAreaPosition = "storyAreaPosition" + TypeStoryAreaTypeLocation = "storyAreaTypeLocation" + TypeStoryAreaTypeVenue = "storyAreaTypeVenue" + TypeStoryAreaTypeSuggestedReaction = "storyAreaTypeSuggestedReaction" + TypeStoryAreaTypeMessage = "storyAreaTypeMessage" + TypeStoryArea = "storyArea" + TypeInputStoryAreaTypeLocation = "inputStoryAreaTypeLocation" + TypeInputStoryAreaTypeFoundVenue = "inputStoryAreaTypeFoundVenue" + TypeInputStoryAreaTypePreviousVenue = "inputStoryAreaTypePreviousVenue" + TypeInputStoryAreaTypeSuggestedReaction = "inputStoryAreaTypeSuggestedReaction" + TypeInputStoryAreaTypeMessage = "inputStoryAreaTypeMessage" + TypeInputStoryArea = "inputStoryArea" + TypeInputStoryAreas = "inputStoryAreas" + TypeStoryVideo = "storyVideo" + TypeStoryContentPhoto = "storyContentPhoto" + TypeStoryContentVideo = "storyContentVideo" + TypeStoryContentUnsupported = "storyContentUnsupported" + TypeInputStoryContentPhoto = "inputStoryContentPhoto" + TypeInputStoryContentVideo = "inputStoryContentVideo" + TypeStoryListMain = "storyListMain" + TypeStoryListArchive = "storyListArchive" + TypeStoryOriginPublicStory = "storyOriginPublicStory" + TypeStoryOriginHiddenUser = "storyOriginHiddenUser" + TypeStoryRepostInfo = "storyRepostInfo" + TypeStoryInteractionInfo = "storyInteractionInfo" + TypeStory = "story" + TypeStories = "stories" + TypeStoryFullId = "storyFullId" + TypeStoryInfo = "storyInfo" + TypeChatActiveStories = "chatActiveStories" + TypeStoryInteractionTypeView = "storyInteractionTypeView" + TypeStoryInteractionTypeForward = "storyInteractionTypeForward" + TypeStoryInteractionTypeRepost = "storyInteractionTypeRepost" + TypeStoryInteraction = "storyInteraction" + TypeStoryInteractions = "storyInteractions" + TypeQuickReplyMessage = "quickReplyMessage" + TypeQuickReplyShortcut = "quickReplyShortcut" + TypePublicForwardMessage = "publicForwardMessage" + TypePublicForwardStory = "publicForwardStory" + TypePublicForwards = "publicForwards" + TypeChatBoostLevelFeatures = "chatBoostLevelFeatures" + TypeChatBoostFeatures = "chatBoostFeatures" + TypeChatBoostSourceGiftCode = "chatBoostSourceGiftCode" + TypeChatBoostSourceGiveaway = "chatBoostSourceGiveaway" + TypeChatBoostSourcePremium = "chatBoostSourcePremium" + TypePrepaidPremiumGiveaway = "prepaidPremiumGiveaway" + TypeChatBoostStatus = "chatBoostStatus" + TypeChatBoost = "chatBoost" + TypeFoundChatBoosts = "foundChatBoosts" + TypeChatBoostSlot = "chatBoostSlot" + TypeChatBoostSlots = "chatBoostSlots" + 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" + TypeFirebaseAuthenticationSettingsAndroid = "firebaseAuthenticationSettingsAndroid" + TypeFirebaseAuthenticationSettingsIos = "firebaseAuthenticationSettingsIos" + TypePhoneNumberAuthenticationSettings = "phoneNumberAuthenticationSettings" + TypeAddedReaction = "addedReaction" + TypeAddedReactions = "addedReactions" + TypeAvailableReaction = "availableReaction" + TypeAvailableReactions = "availableReactions" + TypeEmojiReaction = "emojiReaction" + TypeReactionUnavailabilityReasonAnonymousAdministrator = "reactionUnavailabilityReasonAnonymousAdministrator" + TypeReactionUnavailabilityReasonGuest = "reactionUnavailabilityReasonGuest" + TypeAnimations = "animations" + TypeDiceStickersRegular = "diceStickersRegular" + TypeDiceStickersSlotMachine = "diceStickersSlotMachine" + TypeImportedContacts = "importedContacts" + TypeSpeechRecognitionResultPending = "speechRecognitionResultPending" + TypeSpeechRecognitionResultText = "speechRecognitionResultText" + TypeSpeechRecognitionResultError = "speechRecognitionResultError" + TypeBusinessConnection = "businessConnection" + TypeAttachmentMenuBotColor = "attachmentMenuBotColor" + TypeAttachmentMenuBot = "attachmentMenuBot" + TypeSentWebAppMessage = "sentWebAppMessage" + TypeBotWriteAccessAllowReasonConnectedWebsite = "botWriteAccessAllowReasonConnectedWebsite" + TypeBotWriteAccessAllowReasonAddedToAttachmentMenu = "botWriteAccessAllowReasonAddedToAttachmentMenu" + TypeBotWriteAccessAllowReasonLaunchedWebApp = "botWriteAccessAllowReasonLaunchedWebApp" + TypeBotWriteAccessAllowReasonAcceptedRequest = "botWriteAccessAllowReasonAcceptedRequest" + TypeHttpUrl = "httpUrl" + TypeUserLink = "userLink" + 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" + TypeInlineQueryResultsButtonTypeStartBot = "inlineQueryResultsButtonTypeStartBot" + TypeInlineQueryResultsButtonTypeWebApp = "inlineQueryResultsButtonTypeWebApp" + TypeInlineQueryResultsButton = "inlineQueryResultsButton" + 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" + TypeChatEventBackgroundChanged = "chatEventBackgroundChanged" + TypeChatEventDescriptionChanged = "chatEventDescriptionChanged" + TypeChatEventEmojiStatusChanged = "chatEventEmojiStatusChanged" + TypeChatEventLinkedChatChanged = "chatEventLinkedChatChanged" + TypeChatEventLocationChanged = "chatEventLocationChanged" + TypeChatEventMessageAutoDeleteTimeChanged = "chatEventMessageAutoDeleteTimeChanged" + TypeChatEventPermissionsChanged = "chatEventPermissionsChanged" + TypeChatEventPhotoChanged = "chatEventPhotoChanged" + TypeChatEventSlowModeDelayChanged = "chatEventSlowModeDelayChanged" + TypeChatEventStickerSetChanged = "chatEventStickerSetChanged" + TypeChatEventCustomEmojiStickerSetChanged = "chatEventCustomEmojiStickerSetChanged" + TypeChatEventTitleChanged = "chatEventTitleChanged" + TypeChatEventUsernameChanged = "chatEventUsernameChanged" + TypeChatEventActiveUsernamesChanged = "chatEventActiveUsernamesChanged" + TypeChatEventAccentColorChanged = "chatEventAccentColorChanged" + TypeChatEventProfileAccentColorChanged = "chatEventProfileAccentColorChanged" + TypeChatEventHasProtectedContentToggled = "chatEventHasProtectedContentToggled" + TypeChatEventInvitesToggled = "chatEventInvitesToggled" + TypeChatEventIsAllHistoryAvailableToggled = "chatEventIsAllHistoryAvailableToggled" + TypeChatEventHasAggressiveAntiSpamEnabledToggled = "chatEventHasAggressiveAntiSpamEnabledToggled" + TypeChatEventSignMessagesToggled = "chatEventSignMessagesToggled" + TypeChatEventInviteLinkEdited = "chatEventInviteLinkEdited" + TypeChatEventInviteLinkRevoked = "chatEventInviteLinkRevoked" + TypeChatEventInviteLinkDeleted = "chatEventInviteLinkDeleted" + TypeChatEventVideoChatCreated = "chatEventVideoChatCreated" + TypeChatEventVideoChatEnded = "chatEventVideoChatEnded" + TypeChatEventVideoChatMuteNewParticipantsToggled = "chatEventVideoChatMuteNewParticipantsToggled" + TypeChatEventVideoChatParticipantIsMutedToggled = "chatEventVideoChatParticipantIsMutedToggled" + TypeChatEventVideoChatParticipantVolumeLevelChanged = "chatEventVideoChatParticipantVolumeLevelChanged" + TypeChatEventIsForumToggled = "chatEventIsForumToggled" + TypeChatEventForumTopicCreated = "chatEventForumTopicCreated" + TypeChatEventForumTopicEdited = "chatEventForumTopicEdited" + TypeChatEventForumTopicToggleIsClosed = "chatEventForumTopicToggleIsClosed" + TypeChatEventForumTopicToggleIsHidden = "chatEventForumTopicToggleIsHidden" + TypeChatEventForumTopicDeleted = "chatEventForumTopicDeleted" + TypeChatEventForumTopicPinned = "chatEventForumTopicPinned" + TypeChatEvent = "chatEvent" + TypeChatEvents = "chatEvents" + TypeChatEventLogFilters = "chatEventLogFilters" + TypeLanguagePackStringValueOrdinary = "languagePackStringValueOrdinary" + TypeLanguagePackStringValuePluralized = "languagePackStringValuePluralized" + TypeLanguagePackStringValueDeleted = "languagePackStringValueDeleted" + TypeLanguagePackString = "languagePackString" + TypeLanguagePackStrings = "languagePackStrings" + TypeLanguagePackInfo = "languagePackInfo" + TypeLocalizationTargetInfo = "localizationTargetInfo" + TypePremiumLimitTypeSupergroupCount = "premiumLimitTypeSupergroupCount" + TypePremiumLimitTypePinnedChatCount = "premiumLimitTypePinnedChatCount" + TypePremiumLimitTypeCreatedPublicChatCount = "premiumLimitTypeCreatedPublicChatCount" + TypePremiumLimitTypeSavedAnimationCount = "premiumLimitTypeSavedAnimationCount" + TypePremiumLimitTypeFavoriteStickerCount = "premiumLimitTypeFavoriteStickerCount" + TypePremiumLimitTypeChatFolderCount = "premiumLimitTypeChatFolderCount" + TypePremiumLimitTypeChatFolderChosenChatCount = "premiumLimitTypeChatFolderChosenChatCount" + TypePremiumLimitTypePinnedArchivedChatCount = "premiumLimitTypePinnedArchivedChatCount" + TypePremiumLimitTypePinnedSavedMessagesTopicCount = "premiumLimitTypePinnedSavedMessagesTopicCount" + TypePremiumLimitTypeCaptionLength = "premiumLimitTypeCaptionLength" + TypePremiumLimitTypeBioLength = "premiumLimitTypeBioLength" + TypePremiumLimitTypeChatFolderInviteLinkCount = "premiumLimitTypeChatFolderInviteLinkCount" + TypePremiumLimitTypeShareableChatFolderCount = "premiumLimitTypeShareableChatFolderCount" + TypePremiumLimitTypeActiveStoryCount = "premiumLimitTypeActiveStoryCount" + TypePremiumLimitTypeWeeklySentStoryCount = "premiumLimitTypeWeeklySentStoryCount" + TypePremiumLimitTypeMonthlySentStoryCount = "premiumLimitTypeMonthlySentStoryCount" + TypePremiumLimitTypeStoryCaptionLength = "premiumLimitTypeStoryCaptionLength" + TypePremiumLimitTypeStorySuggestedReactionAreaCount = "premiumLimitTypeStorySuggestedReactionAreaCount" + TypePremiumLimitTypeSimilarChatCount = "premiumLimitTypeSimilarChatCount" + TypePremiumFeatureIncreasedLimits = "premiumFeatureIncreasedLimits" + TypePremiumFeatureIncreasedUploadFileSize = "premiumFeatureIncreasedUploadFileSize" + TypePremiumFeatureImprovedDownloadSpeed = "premiumFeatureImprovedDownloadSpeed" + TypePremiumFeatureVoiceRecognition = "premiumFeatureVoiceRecognition" + TypePremiumFeatureDisabledAds = "premiumFeatureDisabledAds" + TypePremiumFeatureUniqueReactions = "premiumFeatureUniqueReactions" + TypePremiumFeatureUniqueStickers = "premiumFeatureUniqueStickers" + TypePremiumFeatureCustomEmoji = "premiumFeatureCustomEmoji" + TypePremiumFeatureAdvancedChatManagement = "premiumFeatureAdvancedChatManagement" + TypePremiumFeatureProfileBadge = "premiumFeatureProfileBadge" + TypePremiumFeatureEmojiStatus = "premiumFeatureEmojiStatus" + TypePremiumFeatureAnimatedProfilePhoto = "premiumFeatureAnimatedProfilePhoto" + TypePremiumFeatureForumTopicIcon = "premiumFeatureForumTopicIcon" + TypePremiumFeatureAppIcons = "premiumFeatureAppIcons" + TypePremiumFeatureRealTimeChatTranslation = "premiumFeatureRealTimeChatTranslation" + TypePremiumFeatureUpgradedStories = "premiumFeatureUpgradedStories" + TypePremiumFeatureChatBoost = "premiumFeatureChatBoost" + TypePremiumFeatureAccentColor = "premiumFeatureAccentColor" + TypePremiumFeatureBackgroundForBoth = "premiumFeatureBackgroundForBoth" + TypePremiumFeatureSavedMessagesTags = "premiumFeatureSavedMessagesTags" + TypePremiumFeatureMessagePrivacy = "premiumFeatureMessagePrivacy" + TypePremiumFeatureLastSeenTimes = "premiumFeatureLastSeenTimes" + TypePremiumFeatureBusiness = "premiumFeatureBusiness" + TypeBusinessFeatureLocation = "businessFeatureLocation" + TypeBusinessFeatureOpeningHours = "businessFeatureOpeningHours" + TypeBusinessFeatureQuickReplies = "businessFeatureQuickReplies" + TypeBusinessFeatureGreetingMessage = "businessFeatureGreetingMessage" + TypeBusinessFeatureAwayMessage = "businessFeatureAwayMessage" + TypeBusinessFeatureAccountLinks = "businessFeatureAccountLinks" + TypeBusinessFeatureIntro = "businessFeatureIntro" + TypeBusinessFeatureBots = "businessFeatureBots" + TypeBusinessFeatureEmojiStatus = "businessFeatureEmojiStatus" + TypeBusinessFeatureChatFolderTags = "businessFeatureChatFolderTags" + TypeBusinessFeatureUpgradedStories = "businessFeatureUpgradedStories" + TypePremiumStoryFeaturePriorityOrder = "premiumStoryFeaturePriorityOrder" + TypePremiumStoryFeatureStealthMode = "premiumStoryFeatureStealthMode" + TypePremiumStoryFeaturePermanentViewsHistory = "premiumStoryFeaturePermanentViewsHistory" + TypePremiumStoryFeatureCustomExpirationDuration = "premiumStoryFeatureCustomExpirationDuration" + TypePremiumStoryFeatureSaveStories = "premiumStoryFeatureSaveStories" + TypePremiumStoryFeatureLinksAndFormatting = "premiumStoryFeatureLinksAndFormatting" + TypePremiumStoryFeatureVideoQuality = "premiumStoryFeatureVideoQuality" + TypePremiumLimit = "premiumLimit" + TypePremiumFeatures = "premiumFeatures" + TypeBusinessFeatures = "businessFeatures" + TypePremiumSourceLimitExceeded = "premiumSourceLimitExceeded" + TypePremiumSourceFeature = "premiumSourceFeature" + TypePremiumSourceBusinessFeature = "premiumSourceBusinessFeature" + TypePremiumSourceStoryFeature = "premiumSourceStoryFeature" + TypePremiumSourceLink = "premiumSourceLink" + TypePremiumSourceSettings = "premiumSourceSettings" + TypePremiumFeaturePromotionAnimation = "premiumFeaturePromotionAnimation" + TypeBusinessFeaturePromotionAnimation = "businessFeaturePromotionAnimation" + TypePremiumState = "premiumState" + TypeStorePaymentPurposePremiumSubscription = "storePaymentPurposePremiumSubscription" + TypeStorePaymentPurposeGiftedPremium = "storePaymentPurposeGiftedPremium" + TypeStorePaymentPurposePremiumGiftCodes = "storePaymentPurposePremiumGiftCodes" + TypeStorePaymentPurposePremiumGiveaway = "storePaymentPurposePremiumGiveaway" + TypeTelegramPaymentPurposePremiumGiftCodes = "telegramPaymentPurposePremiumGiftCodes" + TypeTelegramPaymentPurposePremiumGiveaway = "telegramPaymentPurposePremiumGiveaway" + Type//-To = "//-To" + TypeDeviceTokenFirebaseCloudMessaging = "deviceTokenFirebaseCloudMessaging" + TypeDeviceTokenApplePush = "deviceTokenApplePush" + TypeDeviceTokenApplePushVoIP = "deviceTokenApplePushVoIP" + TypeDeviceTokenWindowsPush = "deviceTokenWindowsPush" + TypeDeviceTokenMicrosoftPush = "deviceTokenMicrosoftPush" + TypeDeviceTokenMicrosoftPushVoIP = "deviceTokenMicrosoftPushVoIP" + TypeDeviceTokenWebPush = "deviceTokenWebPush" + TypeDeviceTokenSimplePush = "deviceTokenSimplePush" + TypeDeviceTokenUbuntuPush = "deviceTokenUbuntuPush" + TypeDeviceTokenBlackBerryPush = "deviceTokenBlackBerryPush" + TypeDeviceTokenTizenPush = "deviceTokenTizenPush" + TypeDeviceTokenHuaweiPush = "deviceTokenHuaweiPush" + TypePushReceiverId = "pushReceiverId" + TypeBackgroundFillSolid = "backgroundFillSolid" + TypeBackgroundFillGradient = "backgroundFillGradient" + TypeBackgroundFillFreeformGradient = "backgroundFillFreeformGradient" + TypeBackgroundTypeWallpaper = "backgroundTypeWallpaper" + TypeBackgroundTypePattern = "backgroundTypePattern" + TypeBackgroundTypeFill = "backgroundTypeFill" + TypeBackgroundTypeChatTheme = "backgroundTypeChatTheme" + TypeInputBackgroundLocal = "inputBackgroundLocal" + TypeInputBackgroundRemote = "inputBackgroundRemote" + TypeInputBackgroundPrevious = "inputBackgroundPrevious" + TypeThemeSettings = "themeSettings" + TypeChatTheme = "chatTheme" + TypeTimeZone = "timeZone" + TypeTimeZones = "timeZones" + TypeHashtags = "hashtags" + TypeCanSendStoryResultOk = "canSendStoryResultOk" + TypeCanSendStoryResultPremiumNeeded = "canSendStoryResultPremiumNeeded" + TypeCanSendStoryResultBoostNeeded = "canSendStoryResultBoostNeeded" + TypeCanSendStoryResultActiveStoryLimitExceeded = "canSendStoryResultActiveStoryLimitExceeded" + TypeCanSendStoryResultWeeklyLimitExceeded = "canSendStoryResultWeeklyLimitExceeded" + TypeCanSendStoryResultMonthlyLimitExceeded = "canSendStoryResultMonthlyLimitExceeded" + TypeCanTransferOwnershipResultOk = "canTransferOwnershipResultOk" + TypeCanTransferOwnershipResultPasswordNeeded = "canTransferOwnershipResultPasswordNeeded" + TypeCanTransferOwnershipResultPasswordTooFresh = "canTransferOwnershipResultPasswordTooFresh" + TypeCanTransferOwnershipResultSessionTooFresh = "canTransferOwnershipResultSessionTooFresh" + TypeCheckChatUsernameResultOk = "checkChatUsernameResultOk" + TypeCheckChatUsernameResultUsernameInvalid = "checkChatUsernameResultUsernameInvalid" + TypeCheckChatUsernameResultUsernameOccupied = "checkChatUsernameResultUsernameOccupied" + TypeCheckChatUsernameResultUsernamePurchasable = "checkChatUsernameResultUsernamePurchasable" + TypeCheckChatUsernameResultPublicChatsTooMany = "checkChatUsernameResultPublicChatsTooMany" + 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" + TypePushMessageContentPremiumGiftCode = "pushMessageContentPremiumGiftCode" + TypePushMessageContentPremiumGiveaway = "pushMessageContentPremiumGiveaway" + TypePushMessageContentScreenshotTaken = "pushMessageContentScreenshotTaken" + TypePushMessageContentSticker = "pushMessageContentSticker" + TypePushMessageContentStory = "pushMessageContentStory" + TypePushMessageContentText = "pushMessageContentText" + TypePushMessageContentVideo = "pushMessageContentVideo" + TypePushMessageContentVideoNote = "pushMessageContentVideoNote" + TypePushMessageContentVoiceNote = "pushMessageContentVoiceNote" + TypePushMessageContentBasicGroupChatCreate = "pushMessageContentBasicGroupChatCreate" + TypePushMessageContentChatAddMembers = "pushMessageContentChatAddMembers" + TypePushMessageContentChatChangePhoto = "pushMessageContentChatChangePhoto" + TypePushMessageContentChatChangeTitle = "pushMessageContentChatChangeTitle" + TypePushMessageContentChatSetBackground = "pushMessageContentChatSetBackground" + TypePushMessageContentChatSetTheme = "pushMessageContentChatSetTheme" + TypePushMessageContentChatDeleteMember = "pushMessageContentChatDeleteMember" + TypePushMessageContentChatJoinByLink = "pushMessageContentChatJoinByLink" + TypePushMessageContentChatJoinByRequest = "pushMessageContentChatJoinByRequest" + TypePushMessageContentRecurringPayment = "pushMessageContentRecurringPayment" + TypePushMessageContentSuggestProfilePhoto = "pushMessageContentSuggestProfilePhoto" + TypePushMessageContentMessageForwards = "pushMessageContentMessageForwards" + TypePushMessageContentMediaAlbum = "pushMessageContentMediaAlbum" + TypeNotificationTypeNewMessage = "notificationTypeNewMessage" + TypeNotificationTypeNewSecretChat = "notificationTypeNewSecretChat" + TypeNotificationTypeNewCall = "notificationTypeNewCall" + TypeNotificationTypeNewPushMessage = "notificationTypeNewPushMessage" + TypeNotificationGroupTypeMessages = "notificationGroupTypeMessages" + TypeNotificationGroupTypeMentions = "notificationGroupTypeMentions" + TypeNotificationGroupTypeSecretChat = "notificationGroupTypeSecretChat" + TypeNotificationGroupTypeCalls = "notificationGroupTypeCalls" + TypeNotificationSound = "notificationSound" + TypeNotificationSounds = "notificationSounds" + 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" + TypeStoryPrivacySettingsEveryone = "storyPrivacySettingsEveryone" + TypeStoryPrivacySettingsContacts = "storyPrivacySettingsContacts" + TypeStoryPrivacySettingsCloseFriends = "storyPrivacySettingsCloseFriends" + TypeStoryPrivacySettingsSelectedUsers = "storyPrivacySettingsSelectedUsers" + TypeUserPrivacySettingRuleAllowAll = "userPrivacySettingRuleAllowAll" + TypeUserPrivacySettingRuleAllowContacts = "userPrivacySettingRuleAllowContacts" + TypeUserPrivacySettingRuleAllowPremiumUsers = "userPrivacySettingRuleAllowPremiumUsers" + TypeUserPrivacySettingRuleAllowUsers = "userPrivacySettingRuleAllowUsers" + TypeUserPrivacySettingRuleAllowChatMembers = "userPrivacySettingRuleAllowChatMembers" + TypeUserPrivacySettingRuleRestrictAll = "userPrivacySettingRuleRestrictAll" + TypeUserPrivacySettingRuleRestrictContacts = "userPrivacySettingRuleRestrictContacts" + TypeUserPrivacySettingRuleRestrictUsers = "userPrivacySettingRuleRestrictUsers" + TypeUserPrivacySettingRuleRestrictChatMembers = "userPrivacySettingRuleRestrictChatMembers" + TypeUserPrivacySettingRules = "userPrivacySettingRules" + TypeUserPrivacySettingShowStatus = "userPrivacySettingShowStatus" + TypeUserPrivacySettingShowProfilePhoto = "userPrivacySettingShowProfilePhoto" + TypeUserPrivacySettingShowLinkInForwardedMessages = "userPrivacySettingShowLinkInForwardedMessages" + TypeUserPrivacySettingShowPhoneNumber = "userPrivacySettingShowPhoneNumber" + TypeUserPrivacySettingShowBio = "userPrivacySettingShowBio" + TypeUserPrivacySettingShowBirthdate = "userPrivacySettingShowBirthdate" + TypeUserPrivacySettingAllowChatInvites = "userPrivacySettingAllowChatInvites" + TypeUserPrivacySettingAllowCalls = "userPrivacySettingAllowCalls" + TypeUserPrivacySettingAllowPeerToPeerCalls = "userPrivacySettingAllowPeerToPeerCalls" + TypeUserPrivacySettingAllowFindingByPhoneNumber = "userPrivacySettingAllowFindingByPhoneNumber" + TypeUserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages = "userPrivacySettingAllowPrivateVoiceAndVideoNoteMessages" + TypeReadDatePrivacySettings = "readDatePrivacySettings" + TypeNewChatPrivacySettings = "newChatPrivacySettings" + TypeCanSendMessageToUserResultOk = "canSendMessageToUserResultOk" + TypeCanSendMessageToUserResultUserIsDeleted = "canSendMessageToUserResultUserIsDeleted" + TypeCanSendMessageToUserResultUserRestrictsNewChats = "canSendMessageToUserResultUserRestrictsNewChats" + TypeAccountTtl = "accountTtl" + TypeMessageAutoDeleteTime = "messageAutoDeleteTime" + TypeSessionTypeAndroid = "sessionTypeAndroid" + TypeSessionTypeApple = "sessionTypeApple" + TypeSessionTypeBrave = "sessionTypeBrave" + TypeSessionTypeChrome = "sessionTypeChrome" + TypeSessionTypeEdge = "sessionTypeEdge" + TypeSessionTypeFirefox = "sessionTypeFirefox" + TypeSessionTypeIpad = "sessionTypeIpad" + TypeSessionTypeIphone = "sessionTypeIphone" + TypeSessionTypeLinux = "sessionTypeLinux" + TypeSessionTypeMac = "sessionTypeMac" + TypeSessionTypeOpera = "sessionTypeOpera" + TypeSessionTypeSafari = "sessionTypeSafari" + TypeSessionTypeUbuntu = "sessionTypeUbuntu" + TypeSessionTypeUnknown = "sessionTypeUnknown" + TypeSessionTypeVivaldi = "sessionTypeVivaldi" + TypeSessionTypeWindows = "sessionTypeWindows" + TypeSessionTypeXbox = "sessionTypeXbox" + TypeSession = "session" + TypeSessions = "sessions" + TypeUnconfirmedSession = "unconfirmedSession" + TypeConnectedWebsite = "connectedWebsite" + TypeConnectedWebsites = "connectedWebsites" + TypeReportReasonSpam = "reportReasonSpam" + TypeReportReasonViolence = "reportReasonViolence" + TypeReportReasonPornography = "reportReasonPornography" + TypeReportReasonChildAbuse = "reportReasonChildAbuse" + TypeReportReasonCopyright = "reportReasonCopyright" + TypeReportReasonUnrelatedLocation = "reportReasonUnrelatedLocation" + TypeReportReasonFake = "reportReasonFake" + TypeReportReasonIllegalDrugs = "reportReasonIllegalDrugs" + TypeReportReasonPersonalDetails = "reportReasonPersonalDetails" + TypeReportReasonCustom = "reportReasonCustom" + TypeTargetChatCurrent = "targetChatCurrent" + TypeTargetChatChosen = "targetChatChosen" + TypeTargetChatInternalLink = "targetChatInternalLink" + TypeInternalLinkTypeActiveSessions = "internalLinkTypeActiveSessions" + TypeInternalLinkTypeAttachmentMenuBot = "internalLinkTypeAttachmentMenuBot" + TypeInternalLinkTypeAuthenticationCode = "internalLinkTypeAuthenticationCode" + TypeInternalLinkTypeBackground = "internalLinkTypeBackground" + TypeInternalLinkTypeBotAddToChannel = "internalLinkTypeBotAddToChannel" + TypeInternalLinkTypeBotStart = "internalLinkTypeBotStart" + TypeInternalLinkTypeBotStartInGroup = "internalLinkTypeBotStartInGroup" + TypeInternalLinkTypeChangePhoneNumber = "internalLinkTypeChangePhoneNumber" + TypeInternalLinkTypeChatBoost = "internalLinkTypeChatBoost" + TypeInternalLinkTypeChatFolderInvite = "internalLinkTypeChatFolderInvite" + TypeInternalLinkTypeChatFolderSettings = "internalLinkTypeChatFolderSettings" + TypeInternalLinkTypeChatInvite = "internalLinkTypeChatInvite" + TypeInternalLinkTypeDefaultMessageAutoDeleteTimerSettings = "internalLinkTypeDefaultMessageAutoDeleteTimerSettings" + TypeInternalLinkTypeEditProfileSettings = "internalLinkTypeEditProfileSettings" + TypeInternalLinkTypeGame = "internalLinkTypeGame" + TypeInternalLinkTypeInstantView = "internalLinkTypeInstantView" + TypeInternalLinkTypeInvoice = "internalLinkTypeInvoice" + TypeInternalLinkTypeLanguagePack = "internalLinkTypeLanguagePack" + TypeInternalLinkTypeLanguageSettings = "internalLinkTypeLanguageSettings" + TypeInternalLinkTypeMessage = "internalLinkTypeMessage" + TypeInternalLinkTypeMessageDraft = "internalLinkTypeMessageDraft" + TypeInternalLinkTypePassportDataRequest = "internalLinkTypePassportDataRequest" + TypeInternalLinkTypePhoneNumberConfirmation = "internalLinkTypePhoneNumberConfirmation" + TypeInternalLinkTypePremiumFeatures = "internalLinkTypePremiumFeatures" + TypeInternalLinkTypePremiumGift = "internalLinkTypePremiumGift" + TypeInternalLinkTypePremiumGiftCode = "internalLinkTypePremiumGiftCode" + TypeInternalLinkTypePrivacyAndSecuritySettings = "internalLinkTypePrivacyAndSecuritySettings" + TypeInternalLinkTypeProxy = "internalLinkTypeProxy" + TypeInternalLinkTypePublicChat = "internalLinkTypePublicChat" + TypeInternalLinkTypeQrCodeAuthentication = "internalLinkTypeQrCodeAuthentication" + TypeInternalLinkTypeRestorePurchases = "internalLinkTypeRestorePurchases" + TypeInternalLinkTypeSettings = "internalLinkTypeSettings" + TypeInternalLinkTypeSideMenuBot = "internalLinkTypeSideMenuBot" + TypeInternalLinkTypeStickerSet = "internalLinkTypeStickerSet" + TypeInternalLinkTypeStory = "internalLinkTypeStory" + TypeInternalLinkTypeTheme = "internalLinkTypeTheme" + TypeInternalLinkTypeThemeSettings = "internalLinkTypeThemeSettings" + TypeInternalLinkTypeUnknownDeepLink = "internalLinkTypeUnknownDeepLink" + TypeInternalLinkTypeUnsupportedProxy = "internalLinkTypeUnsupportedProxy" + TypeInternalLinkTypeUserPhoneNumber = "internalLinkTypeUserPhoneNumber" + TypeInternalLinkTypeUserToken = "internalLinkTypeUserToken" + TypeInternalLinkTypeVideoChat = "internalLinkTypeVideoChat" + TypeInternalLinkTypeWebApp = "internalLinkTypeWebApp" + TypeMessageLink = "messageLink" + TypeMessageLinkInfo = "messageLinkInfo" + TypeChatBoostLink = "chatBoostLink" + TypeChatBoostLinkInfo = "chatBoostLinkInfo" + TypeBlockListMain = "blockListMain" + TypeBlockListStories = "blockListStories" + TypeFilePart = "filePart" + TypeFileTypeNone = "fileTypeNone" + TypeFileTypeAnimation = "fileTypeAnimation" + TypeFileTypeAudio = "fileTypeAudio" + TypeFileTypeDocument = "fileTypeDocument" + TypeFileTypeNotificationSound = "fileTypeNotificationSound" + TypeFileTypePhoto = "fileTypePhoto" + TypeFileTypePhotoStory = "fileTypePhotoStory" + TypeFileTypeProfilePhoto = "fileTypeProfilePhoto" + TypeFileTypeSecret = "fileTypeSecret" + TypeFileTypeSecretThumbnail = "fileTypeSecretThumbnail" + TypeFileTypeSecure = "fileTypeSecure" + TypeFileTypeSticker = "fileTypeSticker" + TypeFileTypeThumbnail = "fileTypeThumbnail" + TypeFileTypeUnknown = "fileTypeUnknown" + TypeFileTypeVideo = "fileTypeVideo" + TypeFileTypeVideoNote = "fileTypeVideoNote" + TypeFileTypeVideoStory = "fileTypeVideoStory" + 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" + TypeAutosaveSettingsScopePrivateChats = "autosaveSettingsScopePrivateChats" + TypeAutosaveSettingsScopeGroupChats = "autosaveSettingsScopeGroupChats" + TypeAutosaveSettingsScopeChannelChats = "autosaveSettingsScopeChannelChats" + TypeAutosaveSettingsScopeChat = "autosaveSettingsScopeChat" + TypeScopeAutosaveSettings = "scopeAutosaveSettings" + TypeAutosaveSettingsException = "autosaveSettingsException" + TypeAutosaveSettings = "autosaveSettings" + TypeConnectionStateWaitingForNetwork = "connectionStateWaitingForNetwork" + TypeConnectionStateConnectingToProxy = "connectionStateConnectingToProxy" + TypeConnectionStateConnecting = "connectionStateConnecting" + TypeConnectionStateUpdating = "connectionStateUpdating" + TypeConnectionStateReady = "connectionStateReady" + TypeTopChatCategoryUsers = "topChatCategoryUsers" + TypeTopChatCategoryBots = "topChatCategoryBots" + TypeTopChatCategoryGroups = "topChatCategoryGroups" + TypeTopChatCategoryChannels = "topChatCategoryChannels" + TypeTopChatCategoryInlineBots = "topChatCategoryInlineBots" + TypeTopChatCategoryCalls = "topChatCategoryCalls" + TypeTopChatCategoryForwardChats = "topChatCategoryForwardChats" + TypeFoundPosition = "foundPosition" + TypeFoundPositions = "foundPositions" + TypeTMeUrlTypeUser = "tMeUrlTypeUser" + TypeTMeUrlTypeSupergroup = "tMeUrlTypeSupergroup" + TypeTMeUrlTypeChatInvite = "tMeUrlTypeChatInvite" + TypeTMeUrlTypeStickerSet = "tMeUrlTypeStickerSet" + TypeTMeUrl = "tMeUrl" + TypeTMeUrls = "tMeUrls" + TypeSuggestedActionEnableArchiveAndMuteNewChats = "suggestedActionEnableArchiveAndMuteNewChats" + TypeSuggestedActionCheckPassword = "suggestedActionCheckPassword" + TypeSuggestedActionCheckPhoneNumber = "suggestedActionCheckPhoneNumber" + TypeSuggestedActionViewChecksHint = "suggestedActionViewChecksHint" + TypeSuggestedActionConvertToBroadcastGroup = "suggestedActionConvertToBroadcastGroup" + TypeSuggestedActionSetPassword = "suggestedActionSetPassword" + TypeSuggestedActionUpgradePremium = "suggestedActionUpgradePremium" + TypeSuggestedActionRestorePremium = "suggestedActionRestorePremium" + TypeSuggestedActionSubscribeToAnnualPremium = "suggestedActionSubscribeToAnnualPremium" + TypeSuggestedActionGiftPremiumForChristmas = "suggestedActionGiftPremiumForChristmas" + TypeSuggestedActionSetBirthdate = "suggestedActionSetBirthdate" + TypeCount = "count" + TypeText = "text" + TypeSeconds = "seconds" + TypeFileDownloadedPrefixSize = "fileDownloadedPrefixSize" + 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" + TypeChatStatisticsObjectTypeMessage = "chatStatisticsObjectTypeMessage" + TypeChatStatisticsObjectTypeStory = "chatStatisticsObjectTypeStory" + TypeChatStatisticsInteractionInfo = "chatStatisticsInteractionInfo" + TypeChatStatisticsMessageSenderInfo = "chatStatisticsMessageSenderInfo" + TypeChatStatisticsAdministratorActionsInfo = "chatStatisticsAdministratorActionsInfo" + TypeChatStatisticsInviterInfo = "chatStatisticsInviterInfo" + TypeChatStatisticsSupergroup = "chatStatisticsSupergroup" + TypeChatStatisticsChannel = "chatStatisticsChannel" + TypeMessageStatistics = "messageStatistics" + TypeStoryStatistics = "storyStatistics" + 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" + TypeUpdateChatAccentColors = "updateChatAccentColors" + TypeUpdateChatPermissions = "updateChatPermissions" + TypeUpdateChatLastMessage = "updateChatLastMessage" + TypeUpdateChatPosition = "updateChatPosition" + TypeUpdateChatAddedToList = "updateChatAddedToList" + TypeUpdateChatRemovedFromList = "updateChatRemovedFromList" + TypeUpdateChatReadInbox = "updateChatReadInbox" + TypeUpdateChatReadOutbox = "updateChatReadOutbox" + TypeUpdateChatActionBar = "updateChatActionBar" + TypeUpdateChatAvailableReactions = "updateChatAvailableReactions" + TypeUpdateChatDraftMessage = "updateChatDraftMessage" + TypeUpdateChatEmojiStatus = "updateChatEmojiStatus" + TypeUpdateChatMessageSender = "updateChatMessageSender" + TypeUpdateChatMessageAutoDeleteTime = "updateChatMessageAutoDeleteTime" + TypeUpdateChatNotificationSettings = "updateChatNotificationSettings" + TypeUpdateChatPendingJoinRequests = "updateChatPendingJoinRequests" + TypeUpdateChatReplyMarkup = "updateChatReplyMarkup" + TypeUpdateChatBackground = "updateChatBackground" + TypeUpdateChatTheme = "updateChatTheme" + TypeUpdateChatUnreadMentionCount = "updateChatUnreadMentionCount" + TypeUpdateChatUnreadReactionCount = "updateChatUnreadReactionCount" + TypeUpdateChatVideoChat = "updateChatVideoChat" + TypeUpdateChatDefaultDisableNotification = "updateChatDefaultDisableNotification" + TypeUpdateChatHasProtectedContent = "updateChatHasProtectedContent" + TypeUpdateChatIsTranslatable = "updateChatIsTranslatable" + TypeUpdateChatIsMarkedAsUnread = "updateChatIsMarkedAsUnread" + TypeUpdateChatViewAsTopics = "updateChatViewAsTopics" + TypeUpdateChatBlockList = "updateChatBlockList" + TypeUpdateChatHasScheduledMessages = "updateChatHasScheduledMessages" + TypeUpdateChatFolders = "updateChatFolders" + TypeUpdateChatOnlineMemberCount = "updateChatOnlineMemberCount" + TypeUpdateSavedMessagesTopic = "updateSavedMessagesTopic" + TypeUpdateSavedMessagesTopicCount = "updateSavedMessagesTopicCount" + TypeUpdateQuickReplyShortcut = "updateQuickReplyShortcut" + TypeUpdateQuickReplyShortcutDeleted = "updateQuickReplyShortcutDeleted" + TypeUpdateQuickReplyShortcuts = "updateQuickReplyShortcuts" + TypeUpdateQuickReplyShortcutMessages = "updateQuickReplyShortcutMessages" + TypeUpdateForumTopicInfo = "updateForumTopicInfo" + 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" + TypeUpdateStory = "updateStory" + TypeUpdateStoryDeleted = "updateStoryDeleted" + TypeUpdateStorySendSucceeded = "updateStorySendSucceeded" + TypeUpdateStorySendFailed = "updateStorySendFailed" + TypeUpdateChatActiveStories = "updateChatActiveStories" + TypeUpdateStoryListChatCount = "updateStoryListChatCount" + TypeUpdateStoryStealthMode = "updateStoryStealthMode" + TypeUpdateOption = "updateOption" + TypeUpdateStickerSet = "updateStickerSet" + TypeUpdateInstalledStickerSets = "updateInstalledStickerSets" + TypeUpdateTrendingStickerSets = "updateTrendingStickerSets" + TypeUpdateRecentStickers = "updateRecentStickers" + TypeUpdateFavoriteStickers = "updateFavoriteStickers" + TypeUpdateSavedAnimations = "updateSavedAnimations" + TypeUpdateSavedNotificationSounds = "updateSavedNotificationSounds" + TypeUpdateDefaultBackground = "updateDefaultBackground" + TypeUpdateChatThemes = "updateChatThemes" + TypeUpdateAccentColors = "updateAccentColors" + TypeUpdateProfileAccentColors = "updateProfileAccentColors" + TypeUpdateLanguagePackStrings = "updateLanguagePackStrings" + TypeUpdateConnectionState = "updateConnectionState" + TypeUpdateTermsOfService = "updateTermsOfService" + TypeUpdateUsersNearby = "updateUsersNearby" + TypeUpdateUnconfirmedSession = "updateUnconfirmedSession" + TypeUpdateAttachmentMenuBots = "updateAttachmentMenuBots" + TypeUpdateWebAppMessageSent = "updateWebAppMessageSent" + TypeUpdateActiveEmojiReactions = "updateActiveEmojiReactions" + TypeUpdateDefaultReactionType = "updateDefaultReactionType" + TypeUpdateSavedMessagesTags = "updateSavedMessagesTags" + TypeUpdateSpeechRecognitionTrial = "updateSpeechRecognitionTrial" + TypeUpdateDiceEmojis = "updateDiceEmojis" + TypeUpdateAnimatedEmojiMessageClicked = "updateAnimatedEmojiMessageClicked" + TypeUpdateAnimationSearchParameters = "updateAnimationSearchParameters" + TypeUpdateSuggestedActions = "updateSuggestedActions" + TypeUpdateContactCloseBirthdays = "updateContactCloseBirthdays" + TypeUpdateAddChatMembersPrivacyForbidden = "updateAddChatMembersPrivacyForbidden" + TypeUpdateAutosaveSettings = "updateAutosaveSettings" + TypeUpdateBusinessConnection = "updateBusinessConnection" + TypeUpdateNewBusinessMessage = "updateNewBusinessMessage" + TypeUpdateBusinessMessageEdited = "updateBusinessMessageEdited" + TypeUpdateBusinessMessagesDeleted = "updateBusinessMessagesDeleted" + TypeUpdateNewInlineQuery = "updateNewInlineQuery" + TypeUpdateNewChosenInlineResult = "updateNewChosenInlineResult" + TypeUpdateNewCallbackQuery = "updateNewCallbackQuery" + TypeUpdateNewInlineCallbackQuery = "updateNewInlineCallbackQuery" + TypeUpdateNewShippingQuery = "updateNewShippingQuery" + TypeUpdateNewPreCheckoutQuery = "updateNewPreCheckoutQuery" + TypeUpdateNewCustomEvent = "updateNewCustomEvent" + TypeUpdateNewCustomQuery = "updateNewCustomQuery" + TypeUpdatePoll = "updatePoll" + TypeUpdatePollAnswer = "updatePollAnswer" + TypeUpdateChatMember = "updateChatMember" + TypeUpdateNewChatJoinRequest = "updateNewChatJoinRequest" + TypeUpdateChatBoost = "updateChatBoost" + TypeUpdateMessageReaction = "updateMessageReaction" + TypeUpdateMessageReactions = "updateMessageReactions" + TypeUpdates = "updates" + TypeLogStreamDefault = "logStreamDefault" + TypeLogStreamFile = "logStreamFile" + TypeLogStreamEmpty = "logStreamEmpty" + TypeLogVerbosityLevel = "logVerbosityLevel" + TypeLogTags = "logTags" + TypeUserSupportInfo = "userSupportInfo" + TypeTestInt = "testInt" + TypeTestString = "testString" + TypeTestBytes = "testBytes" + TypeTestVectorInt = "testVectorInt" + TypeTestVectorIntObject = "testVectorIntObject" + TypeTestVectorString = "testVectorString" + TypeTestVectorStringObject = "testVectorStringObject" ) // Provides information about the method by which an authentication code is delivered to the user type AuthenticationCodeType interface { - AuthenticationCodeTypeType() string + AuthenticationCodeTypeType() string } // Contains authentication data for a email address type EmailAddressAuthentication interface { - EmailAddressAuthenticationType() string + EmailAddressAuthenticationType() string +} + +// Describes reset state of a email address +type EmailAddressResetState interface { + EmailAddressResetStateType() string } // Represents the current authorization state of the TDLib client type AuthorizationState interface { - AuthorizationStateType() string + AuthorizationStateType() string } // Points to a file type InputFile interface { - InputFileType() string + InputFileType() string } // Describes format of a thumbnail type ThumbnailFormat interface { - ThumbnailFormatType() string + ThumbnailFormatType() string } // Part of the face, relative to which a mask is placed type MaskPoint interface { - MaskPointType() string + MaskPointType() string } // Describes format of a sticker type StickerFormat interface { - StickerFormatType() string + StickerFormatType() string } // Describes type of a sticker type StickerType interface { - StickerTypeType() string + StickerTypeType() string } // Contains full information about sticker type type StickerFullType interface { - StickerFullTypeType() string + StickerFullTypeType() string } // Describes the type of a poll type PollType interface { - PollTypeType() string + PollTypeType() string } // Represents the type of a user. The following types are possible: regular users, deleted users and bots type UserType interface { - UserTypeType() string + UserTypeType() string +} + +// Describes conditions for sending of away messages by a Telegram Business account +type BusinessAwayMessageSchedule interface { + BusinessAwayMessageScheduleType() string +} + +// Describes type of a sticker, which was used to create a chat photo +type ChatPhotoStickerType interface { + ChatPhotoStickerTypeType() string } // Describes a photo to be set as a user profile or chat photo type InputChatPhoto interface { - InputChatPhotoType() string + InputChatPhotoType() string +} + +// Contains information about status of a user in a Telegram Premium giveaway +type PremiumGiveawayParticipantStatus interface { + PremiumGiveawayParticipantStatusType() string +} + +// Contains information about Telegram Premium giveaway +type PremiumGiveawayInfo interface { + PremiumGiveawayInfoType() string } // Provides information about the status of a member in a chat type ChatMemberStatus interface { - ChatMemberStatusType() string + ChatMemberStatusType() string } // Specifies the kind of chat members to return in searchChatMembers type ChatMembersFilter interface { - ChatMembersFilterType() string + ChatMembersFilterType() string } // Specifies the kind of chat members to return in getSupergroupMembers type SupergroupMembersFilter interface { - SupergroupMembersFilterType() string + SupergroupMembersFilterType() string +} + +// Describes the type of a chat to which points an invite link +type InviteLinkChatType interface { + InviteLinkChatTypeType() string } // Describes the current secret chat state type SecretChatState interface { - SecretChatStateType() string + SecretChatStateType() string } // Contains information about the sender of a message type MessageSender interface { - MessageSenderType() string + MessageSenderType() string } -// Contains information about the origin of a forwarded message -type MessageForwardOrigin interface { - MessageForwardOriginType() string +// Describes read date of a recent outgoing message in a private chat +type MessageReadDate interface { + MessageReadDateType() string +} + +// Contains information about the origin of a message +type MessageOrigin interface { + MessageOriginType() string } // Describes type of message reaction type ReactionType interface { - ReactionTypeType() string + ReactionTypeType() string } // Contains information about the sending state of the message type MessageSendingState interface { - MessageSendingStateType() string + MessageSendingStateType() string +} + +// Contains information about the message or the story a message is replying to +type MessageReplyTo interface { + MessageReplyToType() string +} + +// Contains information about the message or the story to be replied +type InputMessageReplyTo interface { + InputMessageReplyToType() string +} + +// Describes source of a message +type MessageSource interface { + MessageSourceType() string +} + +// Describes type of a message sponsor +type MessageSponsorType interface { + MessageSponsorTypeType() string +} + +// Describes result of sponsored message report +type ReportChatSponsoredMessageResult interface { + ReportChatSponsoredMessageResultType() string } // Describes the types of chats to which notification settings are relevant type NotificationSettingsScope interface { - NotificationSettingsScopeType() string + NotificationSettingsScopeType() string } // Describes the type of a chat type ChatType interface { - ChatTypeType() string + ChatTypeType() string } // Describes a list of chats type ChatList interface { - ChatListType() string + ChatListType() string } // Describes a reason why an external chat is shown in a chat list type ChatSource interface { - ChatSourceType() string + ChatSourceType() string } // Describes reactions available in the chat type ChatAvailableReactions interface { - ChatAvailableReactionsType() string + ChatAvailableReactionsType() string } // Describes a type of public chats type PublicChatType interface { - PublicChatTypeType() string + PublicChatTypeType() string } // Describes actions which must be possible to do through a chat action bar type ChatActionBar interface { - ChatActionBarType() string + ChatActionBarType() string } // Describes a keyboard button type type KeyboardButtonType interface { - KeyboardButtonTypeType() string + KeyboardButtonTypeType() string } // Describes the type of an inline keyboard button type InlineKeyboardButtonType interface { - InlineKeyboardButtonTypeType() string + InlineKeyboardButtonTypeType() string } // Contains a description of a custom keyboard and actions that can be done with it to quickly reply to bots type ReplyMarkup interface { - ReplyMarkupType() string + ReplyMarkupType() string } // Contains information about an inline button of type inlineKeyboardButtonTypeLoginUrl type LoginUrlInfo interface { - LoginUrlInfoType() string + LoginUrlInfoType() string +} + +// Describes type of a Saved Messages topic +type SavedMessagesTopicType interface { + SavedMessagesTopicTypeType() string } // Describes a text object inside an instant-view web page type RichText interface { - RichTextType() string + RichTextType() string } // Describes a horizontal alignment of a table cell content type PageBlockHorizontalAlignment interface { - PageBlockHorizontalAlignmentType() string + PageBlockHorizontalAlignmentType() string } // Describes a Vertical alignment of a table cell content type PageBlockVerticalAlignment interface { - PageBlockVerticalAlignmentType() string + PageBlockVerticalAlignmentType() string } // Describes a block of an instant view web page type PageBlock interface { - PageBlockType() string + PageBlockType() string +} + +// Describes a collectible item that can be purchased at https://fragment.com +type CollectibleItemType interface { + CollectibleItemTypeType() string } // Contains information about the payment method chosen by the user type InputCredentials interface { - InputCredentialsType() string + InputCredentialsType() string } // Contains information about a payment provider type PaymentProvider interface { - PaymentProviderType() string + PaymentProviderType() string } // Describes an invoice to process type InputInvoice interface { - InputInvoiceType() string + InputInvoiceType() string } // Describes a media, which is attached to an invoice type MessageExtendedMedia interface { - MessageExtendedMediaType() string + MessageExtendedMediaType() string } // Contains the type of a Telegram Passport element type PassportElementType interface { - PassportElementTypeType() string + PassportElementTypeType() string } // Contains information about a Telegram Passport element type PassportElement interface { - PassportElementType() string + PassportElementType() string } // Contains information about a Telegram Passport element to be saved type InputPassportElement interface { - InputPassportElementType() string + InputPassportElementType() string } // Contains the description of an error in a Telegram Passport element type PassportElementErrorSource interface { - PassportElementErrorSourceType() string + PassportElementErrorSourceType() string } // Contains the description of an error in a Telegram Passport element; for bots only type InputPassportElementErrorSource interface { - InputPassportElementErrorSourceType() string + InputPassportElementErrorSourceType() string } // Contains the content of a message type MessageContent interface { - MessageContentType() string + MessageContentType() string } // Represents a part of the text which must be formatted differently type TextEntityType interface { - TextEntityTypeType() string + TextEntityTypeType() string } // Contains information about the time when a scheduled message will be sent type MessageSchedulingState interface { - MessageSchedulingStateType() string + MessageSchedulingStateType() string +} + +// Describes when a message will be self-destructed +type MessageSelfDestructType interface { + MessageSelfDestructTypeType() string } // The content of a message to send type InputMessageContent interface { - InputMessageContentType() string + InputMessageContentType() string } // Represents a filter for message search results type SearchMessagesFilter interface { - SearchMessagesFilterType() string + SearchMessagesFilterType() string } // Describes the different types of activity in a chat type ChatAction interface { - ChatActionType() string + ChatActionType() string } // Describes the last time the user was online type UserStatus interface { - UserStatusType() string + UserStatusType() string +} + +// Describes type of an emoji category +type EmojiCategoryType interface { + EmojiCategoryTypeType() string +} + +// Describes type of a clickable rectangle area on a story media +type StoryAreaType interface { + StoryAreaTypeType() string +} + +// Describes type of a clickable rectangle area on a story media to be added +type InputStoryAreaType interface { + InputStoryAreaTypeType() string +} + +// Contains the content of a story +type StoryContent interface { + StoryContentType() string +} + +// The content of a story to send +type InputStoryContent interface { + InputStoryContentType() string +} + +// Describes a list of stories +type StoryList interface { + StoryListType() string +} + +// Contains information about the origin of a story that was reposted +type StoryOrigin interface { + StoryOriginType() string +} + +// Describes type of interaction with a story +type StoryInteractionType interface { + StoryInteractionTypeType() string +} + +// Describes a public forward or repost of a story +type PublicForward interface { + PublicForwardType() string +} + +// Describes source of a chat boost +type ChatBoostSource interface { + ChatBoostSourceType() string } // Describes the reason why a call was discarded type CallDiscardReason interface { - CallDiscardReasonType() string + CallDiscardReasonType() string } // Describes the type of a call server type CallServerType interface { - CallServerTypeType() string + CallServerTypeType() string } // Describes the current call state type CallState interface { - CallStateType() string + CallStateType() string } // Describes the quality of a group call video type GroupCallVideoQuality interface { - GroupCallVideoQualityType() string + GroupCallVideoQualityType() string } // Describes the exact type of a problem with a call type CallProblem interface { - CallProblemType() string + CallProblemType() string +} + +// Contains settings for Firebase Authentication in the official applications +type FirebaseAuthenticationSettings interface { + FirebaseAuthenticationSettingsType() string +} + +// Describes why the current user can't add reactions to the message, despite some other users can +type ReactionUnavailabilityReason interface { + ReactionUnavailabilityReasonType() string } // Contains animated stickers which must be used for dice animation rendering type DiceStickers interface { - DiceStickersType() string + DiceStickersType() string } // Describes result of speech recognition in a voice note type SpeechRecognitionResult interface { - SpeechRecognitionResultType() string + SpeechRecognitionResultType() string +} + +// Describes a reason why a bot was allowed to write messages to the current user +type BotWriteAccessAllowReason interface { + BotWriteAccessAllowReasonType() string } // Represents a single result of an inline query; for bots only type InputInlineQueryResult interface { - InputInlineQueryResultType() string + InputInlineQueryResultType() string } // Represents a single result of an inline query type InlineQueryResult interface { - InlineQueryResultType() string + InlineQueryResultType() string +} + +// Represents a type of a button in results of inline query +type InlineQueryResultsButtonType interface { + InlineQueryResultsButtonTypeType() string } // Represents a payload of a callback query type CallbackQueryPayload interface { - CallbackQueryPayloadType() string + CallbackQueryPayloadType() string } // Represents a chat event type ChatEventAction interface { - ChatEventActionType() string + ChatEventActionType() string } // Represents the value of a string in a language pack type LanguagePackStringValue interface { - LanguagePackStringValueType() string + LanguagePackStringValueType() string } // Describes type of a limit, increased for Premium users type PremiumLimitType interface { - PremiumLimitTypeType() string + PremiumLimitTypeType() string } // Describes a feature available to Premium users type PremiumFeature interface { - PremiumFeatureType() string + PremiumFeatureType() string +} + +// Describes a feature available to Business user accounts +type BusinessFeature interface { + BusinessFeatureType() string +} + +// Describes a story feature available to Premium users +type PremiumStoryFeature interface { + PremiumStoryFeatureType() string } // Describes a source from which the Premium features screen is opened type PremiumSource interface { - PremiumSourceType() string + PremiumSourceType() string } // Describes a purpose of an in-store payment type StorePaymentPurpose interface { - StorePaymentPurposeType() string + StorePaymentPurposeType() string } -// 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 +// Describes a purpose of a payment toward Telegram +type TelegramPaymentPurpose interface { + TelegramPaymentPurposeType() string +} + +// Represents a data needed to subscribe for push notifications through registerDevice method. type DeviceToken interface { - DeviceTokenType() string + DeviceTokenType() string } // Describes a fill of a background type BackgroundFill interface { - BackgroundFillType() string + BackgroundFillType() string } // Describes the type of a background type BackgroundType interface { - BackgroundTypeType() string + BackgroundTypeType() string } // Contains information about background to set type InputBackground interface { - InputBackgroundType() string + InputBackgroundType() string +} + +// Represents result of checking whether the current user can send a story in the specific chat +type CanSendStoryResult interface { + CanSendStoryResultType() string } // Represents result of checking whether the current session can be used to transfer a chat ownership to another user type CanTransferOwnershipResult interface { - CanTransferOwnershipResultType() string + CanTransferOwnershipResultType() string } // Represents result of checking whether a username can be set for a chat type CheckChatUsernameResult interface { - CheckChatUsernameResultType() string + CheckChatUsernameResultType() string } // Represents result of checking whether a name can be used for a new sticker set type CheckStickerSetNameResult interface { - CheckStickerSetNameResultType() string + CheckStickerSetNameResultType() string } // Represents result of 2-step verification password reset type ResetPasswordResult interface { - ResetPasswordResultType() string + ResetPasswordResultType() string } // Contains information about a file with messages exported from another app type MessageFileType interface { - MessageFileTypeType() string + MessageFileTypeType() string } // Contains content of a push message notification type PushMessageContent interface { - PushMessageContentType() string + PushMessageContentType() string } // Contains detailed information about a notification type NotificationType interface { - NotificationTypeType() string + NotificationTypeType() string } // Describes the type of notifications in a notification group type NotificationGroupType interface { - NotificationGroupTypeType() string + NotificationGroupTypeType() string } // Represents the value of an option type OptionValue interface { - OptionValueType() string + OptionValueType() string } // Represents a JSON value type JsonValue interface { - JsonValueType() string + JsonValueType() string } -// Represents a single rule for managing privacy settings +// Describes privacy settings of a story +type StoryPrivacySettings interface { + StoryPrivacySettingsType() string +} + +// Represents a single rule for managing user privacy settings type UserPrivacySettingRule interface { - UserPrivacySettingRuleType() string + UserPrivacySettingRuleType() string } // Describes available user privacy settings type UserPrivacySetting interface { - UserPrivacySettingType() string + UserPrivacySettingType() string +} + +// Describes result of canSendMessageToUser +type CanSendMessageToUserResult interface { + CanSendMessageToUserResultType() string } // Represents the type of a session type SessionType interface { - SessionTypeType() string + SessionTypeType() string } // Describes the reason why a chat is reported -type ChatReportReason interface { - ChatReportReasonType() string +type ReportReason interface { + ReportReasonType() string } // Describes the target chat to be opened type TargetChat interface { - TargetChatType() string + TargetChatType() string } // Describes an internal https://t.me or tg: link, which must be processed by the application in a special way type InternalLinkType interface { - InternalLinkTypeType() string + InternalLinkTypeType() string +} + +// Describes a type of a block list +type BlockList interface { + BlockListType() string } // Represents the type of a file type FileType interface { - FileTypeType() string + FileTypeType() string } // Represents the type of a network type NetworkType interface { - NetworkTypeType() string + NetworkTypeType() string } // Contains statistics about network usage type NetworkStatisticsEntry interface { - NetworkStatisticsEntryType() string + NetworkStatisticsEntryType() string +} + +// Describes scope of autosave settings +type AutosaveSettingsScope interface { + AutosaveSettingsScopeType() string } // Describes the current state of the connection to Telegram servers type ConnectionState interface { - ConnectionStateType() string + ConnectionStateType() string } // Represents the categories of chats for which a list of frequently used chats can be retrieved type TopChatCategory interface { - TopChatCategoryType() string + TopChatCategoryType() string } // Describes the type of a URL linking to an internal Telegram entity type TMeUrlType interface { - TMeUrlTypeType() string + TMeUrlTypeType() string } // Describes an action suggested to the current user type SuggestedAction interface { - SuggestedActionType() string + SuggestedActionType() string } // Describes the way the text needs to be parsed for text entities type TextParseMode interface { - TextParseModeType() string + TextParseModeType() string } // Describes the type of a proxy server type ProxyType interface { - ProxyTypeType() string + ProxyTypeType() string } // Describes a statistical graph type StatisticalGraph interface { - StatisticalGraphType() string + StatisticalGraphType() string +} + +// Describes type of an object, for which statistics are provided +type ChatStatisticsObjectType interface { + ChatStatisticsObjectTypeType() string } // Contains a detailed statistics about a chat type ChatStatistics interface { - ChatStatisticsType() string + ChatStatisticsType() string } // Represents a vector path command type VectorPathCommand interface { - VectorPathCommandType() string + VectorPathCommandType() string } // Represents the scope to which bot commands are relevant type BotCommandScope interface { - BotCommandScopeType() string + BotCommandScopeType() string } // Contains notifications about data changes type Update interface { - UpdateType() string + UpdateType() string } // Describes a stream to which TDLib internal log is written type LogStream interface { - LogStreamType() string + LogStreamType() string } // An object of this type can be returned on every function call, in case of an error type Error struct { - 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"` + 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"` } func (entity *Error) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub Error + type stub Error - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*Error) GetClass() string { - return ClassError + return ClassError } func (*Error) GetType() string { - return TypeError + return TypeError } // An object of this type is returned on a successful function call for certain functions -type Ok struct { - meta +type Ok struct{ + meta } func (entity *Ok) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub Ok + type stub Ok - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*Ok) GetClass() string { - return ClassOk + return ClassOk } func (*Ok) GetType() string { - return TypeOk + return TypeOk } // An authentication code is delivered via a private Telegram message, which can be viewed from another active session type AuthenticationCodeTypeTelegramMessage struct { - meta - // Length of the code - Length int32 `json:"length"` + meta + // Length of the code + Length int32 `json:"length"` } func (entity *AuthenticationCodeTypeTelegramMessage) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub AuthenticationCodeTypeTelegramMessage + type stub AuthenticationCodeTypeTelegramMessage - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*AuthenticationCodeTypeTelegramMessage) GetClass() string { - return ClassAuthenticationCodeType + return ClassAuthenticationCodeType } func (*AuthenticationCodeTypeTelegramMessage) GetType() string { - return TypeAuthenticationCodeTypeTelegramMessage + return TypeAuthenticationCodeTypeTelegramMessage } func (*AuthenticationCodeTypeTelegramMessage) AuthenticationCodeTypeType() string { - return TypeAuthenticationCodeTypeTelegramMessage + return TypeAuthenticationCodeTypeTelegramMessage } -// An authentication code is delivered via an SMS message to the specified phone number +// An authentication code is delivered via an SMS message to the specified phone number; applications may not receive this type of code type AuthenticationCodeTypeSms struct { - meta - // Length of the code - Length int32 `json:"length"` + meta + // Length of the code + Length int32 `json:"length"` } func (entity *AuthenticationCodeTypeSms) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub AuthenticationCodeTypeSms + type stub AuthenticationCodeTypeSms - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*AuthenticationCodeTypeSms) GetClass() string { - return ClassAuthenticationCodeType + return ClassAuthenticationCodeType } func (*AuthenticationCodeTypeSms) GetType() string { - return TypeAuthenticationCodeTypeSms + return TypeAuthenticationCodeTypeSms } func (*AuthenticationCodeTypeSms) AuthenticationCodeTypeType() string { - return TypeAuthenticationCodeTypeSms + return TypeAuthenticationCodeTypeSms } // An authentication code is delivered via a phone call to the specified phone number type AuthenticationCodeTypeCall struct { - meta - // Length of the code - Length int32 `json:"length"` + meta + // Length of the code + Length int32 `json:"length"` } func (entity *AuthenticationCodeTypeCall) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub AuthenticationCodeTypeCall + type stub AuthenticationCodeTypeCall - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*AuthenticationCodeTypeCall) GetClass() string { - return ClassAuthenticationCodeType + return ClassAuthenticationCodeType } func (*AuthenticationCodeTypeCall) GetType() string { - return TypeAuthenticationCodeTypeCall + return TypeAuthenticationCodeTypeCall } func (*AuthenticationCodeTypeCall) AuthenticationCodeTypeType() string { - return TypeAuthenticationCodeTypeCall + return TypeAuthenticationCodeTypeCall } // 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 type AuthenticationCodeTypeFlashCall struct { - meta - // Pattern of the phone number from which the call will be made - Pattern string `json:"pattern"` + meta + // Pattern of the phone number from which the call will be made + Pattern string `json:"pattern"` } func (entity *AuthenticationCodeTypeFlashCall) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub AuthenticationCodeTypeFlashCall + type stub AuthenticationCodeTypeFlashCall - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*AuthenticationCodeTypeFlashCall) GetClass() string { - return ClassAuthenticationCodeType + return ClassAuthenticationCodeType } func (*AuthenticationCodeTypeFlashCall) GetType() string { - return TypeAuthenticationCodeTypeFlashCall + return TypeAuthenticationCodeTypeFlashCall } func (*AuthenticationCodeTypeFlashCall) AuthenticationCodeTypeType() string { - return TypeAuthenticationCodeTypeFlashCall + return TypeAuthenticationCodeTypeFlashCall } // 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 { - 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"` + 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"` } func (entity *AuthenticationCodeTypeMissedCall) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub AuthenticationCodeTypeMissedCall + type stub AuthenticationCodeTypeMissedCall - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*AuthenticationCodeTypeMissedCall) GetClass() string { - return ClassAuthenticationCodeType + return ClassAuthenticationCodeType } func (*AuthenticationCodeTypeMissedCall) GetType() string { - return TypeAuthenticationCodeTypeMissedCall + return TypeAuthenticationCodeTypeMissedCall } func (*AuthenticationCodeTypeMissedCall) AuthenticationCodeTypeType() string { - return TypeAuthenticationCodeTypeMissedCall + return TypeAuthenticationCodeTypeMissedCall } // An authentication code is delivered to https://fragment.com. The user must be logged in there via a wallet owning the phone number's NFT type AuthenticationCodeTypeFragment struct { - meta - // URL to open to receive the code - Url string `json:"url"` - // Length of the code - Length int32 `json:"length"` + meta + // URL to open to receive the code + Url string `json:"url"` + // Length of the code + Length int32 `json:"length"` } func (entity *AuthenticationCodeTypeFragment) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub AuthenticationCodeTypeFragment + type stub AuthenticationCodeTypeFragment - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*AuthenticationCodeTypeFragment) GetClass() string { - return ClassAuthenticationCodeType + return ClassAuthenticationCodeType } func (*AuthenticationCodeTypeFragment) GetType() string { - return TypeAuthenticationCodeTypeFragment + return TypeAuthenticationCodeTypeFragment } func (*AuthenticationCodeTypeFragment) AuthenticationCodeTypeType() string { - return TypeAuthenticationCodeTypeFragment + return TypeAuthenticationCodeTypeFragment +} + +// An authentication code is delivered via Firebase Authentication to the official Android application +type AuthenticationCodeTypeFirebaseAndroid struct { + meta + // Nonce to pass to the SafetyNet Attestation API + Nonce []byte `json:"nonce"` + // Length of the code + Length int32 `json:"length"` +} + +func (entity *AuthenticationCodeTypeFirebaseAndroid) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub AuthenticationCodeTypeFirebaseAndroid + + return json.Marshal((*stub)(entity)) +} + +func (*AuthenticationCodeTypeFirebaseAndroid) GetClass() string { + return ClassAuthenticationCodeType +} + +func (*AuthenticationCodeTypeFirebaseAndroid) GetType() string { + return TypeAuthenticationCodeTypeFirebaseAndroid +} + +func (*AuthenticationCodeTypeFirebaseAndroid) AuthenticationCodeTypeType() string { + return TypeAuthenticationCodeTypeFirebaseAndroid +} + +// An authentication code is delivered via Firebase Authentication to the official iOS application +type AuthenticationCodeTypeFirebaseIos struct { + meta + // Receipt of successful application token validation to compare with receipt from push notification + Receipt string `json:"receipt"` + // Time after the next authentication method is supposed to be used if verification push notification isn't received, in seconds + PushTimeout int32 `json:"push_timeout"` + // Length of the code + Length int32 `json:"length"` +} + +func (entity *AuthenticationCodeTypeFirebaseIos) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub AuthenticationCodeTypeFirebaseIos + + return json.Marshal((*stub)(entity)) +} + +func (*AuthenticationCodeTypeFirebaseIos) GetClass() string { + return ClassAuthenticationCodeType +} + +func (*AuthenticationCodeTypeFirebaseIos) GetType() string { + return TypeAuthenticationCodeTypeFirebaseIos +} + +func (*AuthenticationCodeTypeFirebaseIos) AuthenticationCodeTypeType() string { + return TypeAuthenticationCodeTypeFirebaseIos } // Information about the authentication code that was sent type AuthenticationCodeInfo struct { - 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"` + 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"` } func (entity *AuthenticationCodeInfo) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub AuthenticationCodeInfo + type stub AuthenticationCodeInfo - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*AuthenticationCodeInfo) GetClass() string { - return ClassAuthenticationCodeInfo + return ClassAuthenticationCodeInfo } func (*AuthenticationCodeInfo) GetType() string { - return TypeAuthenticationCodeInfo + return TypeAuthenticationCodeInfo } func (authenticationCodeInfo *AuthenticationCodeInfo) UnmarshalJSON(data []byte) error { - var tmp struct { - PhoneNumber string `json:"phone_number"` - Type json.RawMessage `json:"type"` - NextType json.RawMessage `json:"next_type"` - Timeout int32 `json:"timeout"` - } + var tmp struct { + PhoneNumber string `json:"phone_number"` + Type json.RawMessage `json:"type"` + NextType json.RawMessage `json:"next_type"` + Timeout int32 `json:"timeout"` + } - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } - authenticationCodeInfo.PhoneNumber = tmp.PhoneNumber - authenticationCodeInfo.Timeout = tmp.Timeout + authenticationCodeInfo.PhoneNumber = tmp.PhoneNumber + authenticationCodeInfo.Timeout = tmp.Timeout - fieldType, _ := UnmarshalAuthenticationCodeType(tmp.Type) - authenticationCodeInfo.Type = fieldType + fieldType, _ := UnmarshalAuthenticationCodeType(tmp.Type) + authenticationCodeInfo.Type = fieldType - fieldNextType, _ := UnmarshalAuthenticationCodeType(tmp.NextType) - authenticationCodeInfo.NextType = fieldNextType + fieldNextType, _ := UnmarshalAuthenticationCodeType(tmp.NextType) + authenticationCodeInfo.NextType = fieldNextType - return nil + return nil } // Information about the email address authentication code that was sent type EmailAddressAuthenticationCodeInfo struct { - 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"` + 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"` } func (entity *EmailAddressAuthenticationCodeInfo) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub EmailAddressAuthenticationCodeInfo + type stub EmailAddressAuthenticationCodeInfo - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*EmailAddressAuthenticationCodeInfo) GetClass() string { - return ClassEmailAddressAuthenticationCodeInfo + return ClassEmailAddressAuthenticationCodeInfo } func (*EmailAddressAuthenticationCodeInfo) GetType() string { - return TypeEmailAddressAuthenticationCodeInfo + return TypeEmailAddressAuthenticationCodeInfo } // An authentication code delivered to a user's email address type EmailAddressAuthenticationCode struct { - meta - // The code - Code string `json:"code"` + meta + // The code + Code string `json:"code"` } func (entity *EmailAddressAuthenticationCode) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub EmailAddressAuthenticationCode + type stub EmailAddressAuthenticationCode - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*EmailAddressAuthenticationCode) GetClass() string { - return ClassEmailAddressAuthentication + return ClassEmailAddressAuthentication } func (*EmailAddressAuthenticationCode) GetType() string { - return TypeEmailAddressAuthenticationCode + return TypeEmailAddressAuthenticationCode } func (*EmailAddressAuthenticationCode) EmailAddressAuthenticationType() string { - return TypeEmailAddressAuthenticationCode + return TypeEmailAddressAuthenticationCode } // An authentication token received through Apple ID type EmailAddressAuthenticationAppleId struct { - meta - // The token - Token string `json:"token"` + meta + // The token + Token string `json:"token"` } func (entity *EmailAddressAuthenticationAppleId) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub EmailAddressAuthenticationAppleId + type stub EmailAddressAuthenticationAppleId - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*EmailAddressAuthenticationAppleId) GetClass() string { - return ClassEmailAddressAuthentication + return ClassEmailAddressAuthentication } func (*EmailAddressAuthenticationAppleId) GetType() string { - return TypeEmailAddressAuthenticationAppleId + return TypeEmailAddressAuthenticationAppleId } func (*EmailAddressAuthenticationAppleId) EmailAddressAuthenticationType() string { - return TypeEmailAddressAuthenticationAppleId + return TypeEmailAddressAuthenticationAppleId } // An authentication token received through Google ID type EmailAddressAuthenticationGoogleId struct { - meta - // The token - Token string `json:"token"` + meta + // The token + Token string `json:"token"` } func (entity *EmailAddressAuthenticationGoogleId) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub EmailAddressAuthenticationGoogleId + type stub EmailAddressAuthenticationGoogleId - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*EmailAddressAuthenticationGoogleId) GetClass() string { - return ClassEmailAddressAuthentication + return ClassEmailAddressAuthentication } func (*EmailAddressAuthenticationGoogleId) GetType() string { - return TypeEmailAddressAuthenticationGoogleId + return TypeEmailAddressAuthenticationGoogleId } func (*EmailAddressAuthenticationGoogleId) EmailAddressAuthenticationType() string { - return TypeEmailAddressAuthenticationGoogleId + return TypeEmailAddressAuthenticationGoogleId +} + +// Email address can be reset after the given period. Call resetAuthenticationEmailAddress to reset it and allow the user to authorize with a code sent to the user's phone number +type EmailAddressResetStateAvailable struct { + meta + // Time required to wait before the email address can be reset; 0 if the user is subscribed to Telegram Premium + WaitPeriod int32 `json:"wait_period"` +} + +func (entity *EmailAddressResetStateAvailable) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub EmailAddressResetStateAvailable + + return json.Marshal((*stub)(entity)) +} + +func (*EmailAddressResetStateAvailable) GetClass() string { + return ClassEmailAddressResetState +} + +func (*EmailAddressResetStateAvailable) GetType() string { + return TypeEmailAddressResetStateAvailable +} + +func (*EmailAddressResetStateAvailable) EmailAddressResetStateType() string { + return TypeEmailAddressResetStateAvailable +} + +// Email address reset has already been requested. Call resetAuthenticationEmailAddress to check whether immediate reset is possible +type EmailAddressResetStatePending struct { + meta + // Left time before the email address will be reset, in seconds. updateAuthorizationState is not sent when this field changes + ResetIn int32 `json:"reset_in"` +} + +func (entity *EmailAddressResetStatePending) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub EmailAddressResetStatePending + + return json.Marshal((*stub)(entity)) +} + +func (*EmailAddressResetStatePending) GetClass() string { + return ClassEmailAddressResetState +} + +func (*EmailAddressResetStatePending) GetType() string { + return TypeEmailAddressResetStatePending +} + +func (*EmailAddressResetStatePending) EmailAddressResetStateType() string { + return TypeEmailAddressResetStatePending } // Represents a part of the text that needs to be formatted in some unusual way type TextEntity struct { - 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"` + 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"` } func (entity *TextEntity) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub TextEntity + type stub TextEntity - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*TextEntity) GetClass() string { - return ClassTextEntity + return ClassTextEntity } func (*TextEntity) GetType() string { - return TypeTextEntity + return TypeTextEntity } func (textEntity *TextEntity) UnmarshalJSON(data []byte) error { - var tmp struct { - Offset int32 `json:"offset"` - Length int32 `json:"length"` - Type json.RawMessage `json:"type"` - } + var tmp struct { + Offset int32 `json:"offset"` + Length int32 `json:"length"` + Type json.RawMessage `json:"type"` + } - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } - textEntity.Offset = tmp.Offset - textEntity.Length = tmp.Length + textEntity.Offset = tmp.Offset + textEntity.Length = tmp.Length - fieldType, _ := UnmarshalTextEntityType(tmp.Type) - textEntity.Type = fieldType + fieldType, _ := UnmarshalTextEntityType(tmp.Type) + textEntity.Type = fieldType - return nil + return nil } // Contains a list of text entities type TextEntities struct { - meta - // List of text entities - Entities []*TextEntity `json:"entities"` + meta + // List of text entities + Entities []*TextEntity `json:"entities"` } func (entity *TextEntities) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub TextEntities + type stub TextEntities - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*TextEntities) GetClass() string { - return ClassTextEntities + return ClassTextEntities } func (*TextEntities) GetType() string { - return TypeTextEntities + return TypeTextEntities } // A text with some entities type FormattedText struct { - 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 can be part of any other entities. All other entities can't contain each other - Entities []*TextEntity `json:"entities"` + 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. BlockQuote entities can't contain other BlockQuote entities. Bold, Italic, Underline, Strikethrough, and Spoiler entities can contain and can be part of any other entities. All other entities can't contain each other + Entities []*TextEntity `json:"entities"` } func (entity *FormattedText) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub FormattedText + type stub FormattedText - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*FormattedText) GetClass() string { - return ClassFormattedText + return ClassFormattedText } func (*FormattedText) GetType() string { - return TypeFormattedText + return TypeFormattedText } // Contains Telegram terms of service type TermsOfService struct { - 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"` + 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"` } func (entity *TermsOfService) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub TermsOfService + type stub TermsOfService - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*TermsOfService) GetClass() string { - return ClassTermsOfService + return ClassTermsOfService } func (*TermsOfService) GetType() string { - return TypeTermsOfService + return TypeTermsOfService } -// Initializetion parameters are needed. Call setTdlibParameters to provide them -type AuthorizationStateWaitTdlibParameters struct { - meta +// Initialization parameters are needed. Call setTdlibParameters to provide them +type AuthorizationStateWaitTdlibParameters struct{ + meta } func (entity *AuthorizationStateWaitTdlibParameters) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub AuthorizationStateWaitTdlibParameters + type stub AuthorizationStateWaitTdlibParameters - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*AuthorizationStateWaitTdlibParameters) GetClass() string { - return ClassAuthorizationState + return ClassAuthorizationState } func (*AuthorizationStateWaitTdlibParameters) GetType() string { - return TypeAuthorizationStateWaitTdlibParameters + return TypeAuthorizationStateWaitTdlibParameters } func (*AuthorizationStateWaitTdlibParameters) AuthorizationStateType() string { - return TypeAuthorizationStateWaitTdlibParameters + return TypeAuthorizationStateWaitTdlibParameters } // 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 -type AuthorizationStateWaitPhoneNumber struct { - meta +type AuthorizationStateWaitPhoneNumber struct{ + meta } func (entity *AuthorizationStateWaitPhoneNumber) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub AuthorizationStateWaitPhoneNumber + type stub AuthorizationStateWaitPhoneNumber - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*AuthorizationStateWaitPhoneNumber) GetClass() string { - return ClassAuthorizationState + return ClassAuthorizationState } func (*AuthorizationStateWaitPhoneNumber) GetType() string { - return TypeAuthorizationStateWaitPhoneNumber + return TypeAuthorizationStateWaitPhoneNumber } func (*AuthorizationStateWaitPhoneNumber) AuthorizationStateType() string { - return TypeAuthorizationStateWaitPhoneNumber + return TypeAuthorizationStateWaitPhoneNumber } // TDLib needs the user's email address to authorize. Call setAuthenticationEmailAddress to provide the email address, or directly call checkAuthenticationEmailCode with Apple ID/Google ID token if allowed type AuthorizationStateWaitEmailAddress struct { - meta - // True, if authorization through Apple ID is allowed - AllowAppleId bool `json:"allow_apple_id"` - // True, if authorization through Google ID is allowed - AllowGoogleId bool `json:"allow_google_id"` + meta + // True, if authorization through Apple ID is allowed + AllowAppleId bool `json:"allow_apple_id"` + // True, if authorization through Google ID is allowed + AllowGoogleId bool `json:"allow_google_id"` } func (entity *AuthorizationStateWaitEmailAddress) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub AuthorizationStateWaitEmailAddress + type stub AuthorizationStateWaitEmailAddress - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*AuthorizationStateWaitEmailAddress) GetClass() string { - return ClassAuthorizationState + return ClassAuthorizationState } func (*AuthorizationStateWaitEmailAddress) GetType() string { - return TypeAuthorizationStateWaitEmailAddress + return TypeAuthorizationStateWaitEmailAddress } func (*AuthorizationStateWaitEmailAddress) AuthorizationStateType() string { - return TypeAuthorizationStateWaitEmailAddress + return TypeAuthorizationStateWaitEmailAddress } // TDLib needs the user's authentication code sent to an email address to authorize. Call checkAuthenticationEmailCode to provide the code type AuthorizationStateWaitEmailCode struct { - meta - // True, if authorization through Apple ID is allowed - AllowAppleId bool `json:"allow_apple_id"` - // True, if authorization through Google ID is allowed - AllowGoogleId bool `json:"allow_google_id"` - // Information about the sent authentication code - CodeInfo *EmailAddressAuthenticationCodeInfo `json:"code_info"` - // Point in time (Unix timestamp) when the user will be able to authorize with a code sent to the user's phone number; 0 if unknown - NextPhoneNumberAuthorizationDate int32 `json:"next_phone_number_authorization_date"` + meta + // True, if authorization through Apple ID is allowed + AllowAppleId bool `json:"allow_apple_id"` + // True, if authorization through Google ID is allowed + AllowGoogleId bool `json:"allow_google_id"` + // Information about the sent authentication code + CodeInfo *EmailAddressAuthenticationCodeInfo `json:"code_info"` + // Reset state of the email address; may be null if the email address can't be reset + EmailAddressResetState EmailAddressResetState `json:"email_address_reset_state"` } func (entity *AuthorizationStateWaitEmailCode) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub AuthorizationStateWaitEmailCode + type stub AuthorizationStateWaitEmailCode - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*AuthorizationStateWaitEmailCode) GetClass() string { - return ClassAuthorizationState + return ClassAuthorizationState } func (*AuthorizationStateWaitEmailCode) GetType() string { - return TypeAuthorizationStateWaitEmailCode + return TypeAuthorizationStateWaitEmailCode } func (*AuthorizationStateWaitEmailCode) AuthorizationStateType() string { - return TypeAuthorizationStateWaitEmailCode + return TypeAuthorizationStateWaitEmailCode +} + +func (authorizationStateWaitEmailCode *AuthorizationStateWaitEmailCode) UnmarshalJSON(data []byte) error { + var tmp struct { + AllowAppleId bool `json:"allow_apple_id"` + AllowGoogleId bool `json:"allow_google_id"` + CodeInfo *EmailAddressAuthenticationCodeInfo `json:"code_info"` + EmailAddressResetState json.RawMessage `json:"email_address_reset_state"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + authorizationStateWaitEmailCode.AllowAppleId = tmp.AllowAppleId + authorizationStateWaitEmailCode.AllowGoogleId = tmp.AllowGoogleId + authorizationStateWaitEmailCode.CodeInfo = tmp.CodeInfo + + fieldEmailAddressResetState, _ := UnmarshalEmailAddressResetState(tmp.EmailAddressResetState) + authorizationStateWaitEmailCode.EmailAddressResetState = fieldEmailAddressResetState + + return nil } // TDLib needs the user's authentication code to authorize. Call checkAuthenticationCode to check the code type AuthorizationStateWaitCode struct { - meta - // Information about the authorization code that was sent - CodeInfo *AuthenticationCodeInfo `json:"code_info"` + meta + // Information about the authorization code that was sent + CodeInfo *AuthenticationCodeInfo `json:"code_info"` } func (entity *AuthorizationStateWaitCode) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub AuthorizationStateWaitCode + type stub AuthorizationStateWaitCode - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*AuthorizationStateWaitCode) GetClass() string { - return ClassAuthorizationState + return ClassAuthorizationState } func (*AuthorizationStateWaitCode) GetType() string { - return TypeAuthorizationStateWaitCode + return TypeAuthorizationStateWaitCode } func (*AuthorizationStateWaitCode) AuthorizationStateType() string { - return TypeAuthorizationStateWaitCode + return TypeAuthorizationStateWaitCode } // The user needs to confirm authorization on another logged in device by scanning a QR code with the provided link type AuthorizationStateWaitOtherDeviceConfirmation struct { - meta - // A tg:// URL for the QR code. The link will be updated frequently - Link string `json:"link"` + meta + // A tg:// URL for the QR code. The link will be updated frequently + Link string `json:"link"` } func (entity *AuthorizationStateWaitOtherDeviceConfirmation) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub AuthorizationStateWaitOtherDeviceConfirmation + type stub AuthorizationStateWaitOtherDeviceConfirmation - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*AuthorizationStateWaitOtherDeviceConfirmation) GetClass() string { - return ClassAuthorizationState + return ClassAuthorizationState } func (*AuthorizationStateWaitOtherDeviceConfirmation) GetType() string { - return TypeAuthorizationStateWaitOtherDeviceConfirmation + return TypeAuthorizationStateWaitOtherDeviceConfirmation } func (*AuthorizationStateWaitOtherDeviceConfirmation) AuthorizationStateType() string { - return TypeAuthorizationStateWaitOtherDeviceConfirmation + return TypeAuthorizationStateWaitOtherDeviceConfirmation } // The user is unregistered and need to accept terms of service and enter their first name and last name to finish registration. Call registerUser to accept the terms of service and provide the data type AuthorizationStateWaitRegistration struct { - meta - // Telegram terms of service - TermsOfService *TermsOfService `json:"terms_of_service"` + meta + // Telegram terms of service + TermsOfService *TermsOfService `json:"terms_of_service"` } func (entity *AuthorizationStateWaitRegistration) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub AuthorizationStateWaitRegistration + type stub AuthorizationStateWaitRegistration - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*AuthorizationStateWaitRegistration) GetClass() string { - return ClassAuthorizationState + return ClassAuthorizationState } func (*AuthorizationStateWaitRegistration) GetType() string { - return TypeAuthorizationStateWaitRegistration + return TypeAuthorizationStateWaitRegistration } func (*AuthorizationStateWaitRegistration) AuthorizationStateType() string { - return TypeAuthorizationStateWaitRegistration + return TypeAuthorizationStateWaitRegistration } // The user has been authorized, but needs to enter a 2-step verification password to start using the application. Call checkAuthenticationPassword to provide the password, or requestAuthenticationPasswordRecovery to recover the password, or deleteAccount to delete the account after a week type AuthorizationStateWaitPassword struct { - 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"` + 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"` + // True, if some Telegram Passport elements were saved + HasPassportData bool `json:"has_passport_data"` + // 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"` } func (entity *AuthorizationStateWaitPassword) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub AuthorizationStateWaitPassword + type stub AuthorizationStateWaitPassword - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*AuthorizationStateWaitPassword) GetClass() string { - return ClassAuthorizationState + return ClassAuthorizationState } func (*AuthorizationStateWaitPassword) GetType() string { - return TypeAuthorizationStateWaitPassword + return TypeAuthorizationStateWaitPassword } func (*AuthorizationStateWaitPassword) AuthorizationStateType() string { - return TypeAuthorizationStateWaitPassword + return TypeAuthorizationStateWaitPassword } // The user has been successfully authorized. TDLib is now ready to answer general requests -type AuthorizationStateReady struct { - meta +type AuthorizationStateReady struct{ + meta } func (entity *AuthorizationStateReady) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub AuthorizationStateReady + type stub AuthorizationStateReady - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*AuthorizationStateReady) GetClass() string { - return ClassAuthorizationState + return ClassAuthorizationState } func (*AuthorizationStateReady) GetType() string { - return TypeAuthorizationStateReady + return TypeAuthorizationStateReady } func (*AuthorizationStateReady) AuthorizationStateType() string { - return TypeAuthorizationStateReady + return TypeAuthorizationStateReady } // The user is currently logging out -type AuthorizationStateLoggingOut struct { - meta +type AuthorizationStateLoggingOut struct{ + meta } func (entity *AuthorizationStateLoggingOut) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub AuthorizationStateLoggingOut + type stub AuthorizationStateLoggingOut - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*AuthorizationStateLoggingOut) GetClass() string { - return ClassAuthorizationState + return ClassAuthorizationState } func (*AuthorizationStateLoggingOut) GetType() string { - return TypeAuthorizationStateLoggingOut + return TypeAuthorizationStateLoggingOut } func (*AuthorizationStateLoggingOut) AuthorizationStateType() string { - return TypeAuthorizationStateLoggingOut + return TypeAuthorizationStateLoggingOut } // 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 -type AuthorizationStateClosing struct { - meta +type AuthorizationStateClosing struct{ + meta } func (entity *AuthorizationStateClosing) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub AuthorizationStateClosing + type stub AuthorizationStateClosing - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*AuthorizationStateClosing) GetClass() string { - return ClassAuthorizationState + return ClassAuthorizationState } func (*AuthorizationStateClosing) GetType() string { - return TypeAuthorizationStateClosing + return TypeAuthorizationStateClosing } func (*AuthorizationStateClosing) AuthorizationStateType() string { - return TypeAuthorizationStateClosing + return TypeAuthorizationStateClosing } // 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 -type AuthorizationStateClosed struct { - meta +type AuthorizationStateClosed struct{ + meta } func (entity *AuthorizationStateClosed) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub AuthorizationStateClosed + type stub AuthorizationStateClosed - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*AuthorizationStateClosed) GetClass() string { - return ClassAuthorizationState + return ClassAuthorizationState } func (*AuthorizationStateClosed) GetType() string { - return TypeAuthorizationStateClosed + return TypeAuthorizationStateClosed } func (*AuthorizationStateClosed) AuthorizationStateType() string { - return TypeAuthorizationStateClosed + return TypeAuthorizationStateClosed } // Represents the current state of 2-step verification type PasswordState struct { - 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"` - // Pattern of the email address set up for logging in - LoginEmailAddressPattern string `json:"login_email_address_pattern"` - // If not 0, point in time (Unix timestamp) after which the 2-step verification password can be reset immediately using resetPassword - PendingResetDate int32 `json:"pending_reset_date"` + 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"` + // Pattern of the email address set up for logging in + LoginEmailAddressPattern string `json:"login_email_address_pattern"` + // If not 0, point in time (Unix timestamp) after which the 2-step verification password can be reset immediately using resetPassword + PendingResetDate int32 `json:"pending_reset_date"` } func (entity *PasswordState) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub PasswordState + type stub PasswordState - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*PasswordState) GetClass() string { - return ClassPasswordState + return ClassPasswordState } func (*PasswordState) GetType() string { - return TypePasswordState + return TypePasswordState } // Contains information about the current recovery email address type RecoveryEmailAddress struct { - meta - // Recovery email address - RecoveryEmailAddress string `json:"recovery_email_address"` + meta + // Recovery email address + RecoveryEmailAddress string `json:"recovery_email_address"` } func (entity *RecoveryEmailAddress) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub RecoveryEmailAddress + type stub RecoveryEmailAddress - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*RecoveryEmailAddress) GetClass() string { - return ClassRecoveryEmailAddress + return ClassRecoveryEmailAddress } func (*RecoveryEmailAddress) GetType() string { - return TypeRecoveryEmailAddress + return TypeRecoveryEmailAddress } // Returns information about the availability of a temporary password, which can be used for payments type TemporaryPasswordState struct { - 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"` + 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"` } func (entity *TemporaryPasswordState) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub TemporaryPasswordState + type stub TemporaryPasswordState - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*TemporaryPasswordState) GetClass() string { - return ClassTemporaryPasswordState + return ClassTemporaryPasswordState } func (*TemporaryPasswordState) GetType() string { - return TypeTemporaryPasswordState + return TypeTemporaryPasswordState } // Represents a local file type LocalFile struct { - 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 int64 `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 int64 `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 int64 `json:"downloaded_size"` + 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 int64 `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 int64 `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 int64 `json:"downloaded_size"` } func (entity *LocalFile) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub LocalFile + type stub LocalFile - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*LocalFile) GetClass() string { - return ClassLocalFile + return ClassLocalFile } func (*LocalFile) GetType() string { - return TypeLocalFile + return TypeLocalFile } // Represents a remote file type RemoteFile struct { - 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 int64 `json:"uploaded_size"` + 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 identifier 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 int64 `json:"uploaded_size"` } func (entity *RemoteFile) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub RemoteFile + type stub RemoteFile - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*RemoteFile) GetClass() string { - return ClassRemoteFile + return ClassRemoteFile } func (*RemoteFile) GetType() string { - return TypeRemoteFile + return TypeRemoteFile } // Represents a file type File struct { - meta - // Unique file identifier - Id int32 `json:"id"` - // File size, in bytes; 0 if unknown - Size int64 `json:"size"` - // Approximate file size in bytes in case the exact file size is unknown. Can be used to show download/upload progress - ExpectedSize int64 `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"` + meta + // Unique file identifier + Id int32 `json:"id"` + // File size, in bytes; 0 if unknown + Size int64 `json:"size"` + // Approximate file size in bytes in case the exact file size is unknown. Can be used to show download/upload progress + ExpectedSize int64 `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"` } func (entity *File) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub File + type stub File - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*File) GetClass() string { - return ClassFile + return ClassFile } func (*File) GetType() string { - return TypeFile + return TypeFile } -// A file defined by its unique ID +// A file defined by its unique identifier type InputFileId struct { - meta - // Unique file identifier - Id int32 `json:"id"` + meta + // Unique file identifier + Id int32 `json:"id"` } func (entity *InputFileId) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub InputFileId + type stub InputFileId - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*InputFileId) GetClass() string { - return ClassInputFile + return ClassInputFile } func (*InputFileId) GetType() string { - return TypeInputFileId + return TypeInputFileId } func (*InputFileId) InputFileType() string { - return TypeInputFileId + return TypeInputFileId } -// 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 +// A file defined by its remote identifier. The remote identifier 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 type InputFileRemote struct { - meta - // Remote file identifier - Id string `json:"id"` + meta + // Remote file identifier + Id string `json:"id"` } func (entity *InputFileRemote) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub InputFileRemote + type stub InputFileRemote - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*InputFileRemote) GetClass() string { - return ClassInputFile + return ClassInputFile } func (*InputFileRemote) GetType() string { - return TypeInputFileRemote + return TypeInputFileRemote } func (*InputFileRemote) InputFileType() string { - return TypeInputFileRemote + return TypeInputFileRemote } // A file defined by a local path type InputFileLocal struct { - meta - // Local path to the file - Path string `json:"path"` + meta + // Local path to the file + Path string `json:"path"` } func (entity *InputFileLocal) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub InputFileLocal + type stub InputFileLocal - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*InputFileLocal) GetClass() string { - return ClassInputFile + return ClassInputFile } func (*InputFileLocal) GetType() string { - return TypeInputFileLocal + return TypeInputFileLocal } func (*InputFileLocal) InputFileType() string { - return TypeInputFileLocal + return TypeInputFileLocal } // A file generated by the application type InputFileGenerated struct { - 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 int64 `json:"expected_size"` + 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 int64 `json:"expected_size"` } func (entity *InputFileGenerated) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub InputFileGenerated + type stub InputFileGenerated - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*InputFileGenerated) GetClass() string { - return ClassInputFile + return ClassInputFile } func (*InputFileGenerated) GetType() string { - return TypeInputFileGenerated + return TypeInputFileGenerated } func (*InputFileGenerated) InputFileType() string { - return TypeInputFileGenerated + return TypeInputFileGenerated } // Describes an image in JPEG format type PhotoSize struct { - 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"` + 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"` } func (entity *PhotoSize) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub PhotoSize + type stub PhotoSize - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*PhotoSize) GetClass() string { - return ClassPhotoSize + return ClassPhotoSize } func (*PhotoSize) GetType() string { - return TypePhotoSize + return TypePhotoSize } // Thumbnail image of a very poor quality and low resolution type Minithumbnail struct { - 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"` + 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"` } func (entity *Minithumbnail) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub Minithumbnail + type stub Minithumbnail - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*Minithumbnail) GetClass() string { - return ClassMinithumbnail + return ClassMinithumbnail } func (*Minithumbnail) GetType() string { - return TypeMinithumbnail + return TypeMinithumbnail } // The thumbnail is in JPEG format -type ThumbnailFormatJpeg struct { - meta +type ThumbnailFormatJpeg struct{ + meta } func (entity *ThumbnailFormatJpeg) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub ThumbnailFormatJpeg + type stub ThumbnailFormatJpeg - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*ThumbnailFormatJpeg) GetClass() string { - return ClassThumbnailFormat + return ClassThumbnailFormat } func (*ThumbnailFormatJpeg) GetType() string { - return TypeThumbnailFormatJpeg + return TypeThumbnailFormatJpeg } func (*ThumbnailFormatJpeg) ThumbnailFormatType() string { - return TypeThumbnailFormatJpeg + return TypeThumbnailFormatJpeg } -// The thumbnail is in static GIF format. It will be used only for some bot inline results -type ThumbnailFormatGif struct { - meta +// The thumbnail is in static GIF format. It will be used only for some bot inline query results +type ThumbnailFormatGif struct{ + meta } func (entity *ThumbnailFormatGif) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub ThumbnailFormatGif + type stub ThumbnailFormatGif - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*ThumbnailFormatGif) GetClass() string { - return ClassThumbnailFormat + return ClassThumbnailFormat } func (*ThumbnailFormatGif) GetType() string { - return TypeThumbnailFormatGif + return TypeThumbnailFormatGif } func (*ThumbnailFormatGif) ThumbnailFormatType() string { - return TypeThumbnailFormatGif + return TypeThumbnailFormatGif } // The thumbnail is in MPEG4 format. It will be used only for some animations and videos -type ThumbnailFormatMpeg4 struct { - meta +type ThumbnailFormatMpeg4 struct{ + meta } func (entity *ThumbnailFormatMpeg4) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub ThumbnailFormatMpeg4 + type stub ThumbnailFormatMpeg4 - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*ThumbnailFormatMpeg4) GetClass() string { - return ClassThumbnailFormat + return ClassThumbnailFormat } func (*ThumbnailFormatMpeg4) GetType() string { - return TypeThumbnailFormatMpeg4 + return TypeThumbnailFormatMpeg4 } func (*ThumbnailFormatMpeg4) ThumbnailFormatType() string { - return TypeThumbnailFormatMpeg4 + return TypeThumbnailFormatMpeg4 } // The thumbnail is in PNG format. It will be used only for background patterns -type ThumbnailFormatPng struct { - meta +type ThumbnailFormatPng struct{ + meta } func (entity *ThumbnailFormatPng) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub ThumbnailFormatPng + type stub ThumbnailFormatPng - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*ThumbnailFormatPng) GetClass() string { - return ClassThumbnailFormat + return ClassThumbnailFormat } func (*ThumbnailFormatPng) GetType() string { - return TypeThumbnailFormatPng + return TypeThumbnailFormatPng } func (*ThumbnailFormatPng) ThumbnailFormatType() string { - return TypeThumbnailFormatPng + return TypeThumbnailFormatPng } -// The thumbnail is in TGS format. It will be used only for TGS sticker sets -type ThumbnailFormatTgs struct { - meta +// The thumbnail is in TGS format. It will be used only for sticker sets +type ThumbnailFormatTgs struct{ + meta } func (entity *ThumbnailFormatTgs) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub ThumbnailFormatTgs + type stub ThumbnailFormatTgs - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*ThumbnailFormatTgs) GetClass() string { - return ClassThumbnailFormat + return ClassThumbnailFormat } func (*ThumbnailFormatTgs) GetType() string { - return TypeThumbnailFormatTgs + return TypeThumbnailFormatTgs } func (*ThumbnailFormatTgs) ThumbnailFormatType() string { - return TypeThumbnailFormatTgs + return TypeThumbnailFormatTgs } -// The thumbnail is in WEBM format. It will be used only for WEBM sticker sets -type ThumbnailFormatWebm struct { - meta +// The thumbnail is in WEBM format. It will be used only for sticker sets +type ThumbnailFormatWebm struct{ + meta } func (entity *ThumbnailFormatWebm) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub ThumbnailFormatWebm + type stub ThumbnailFormatWebm - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*ThumbnailFormatWebm) GetClass() string { - return ClassThumbnailFormat + return ClassThumbnailFormat } func (*ThumbnailFormatWebm) GetType() string { - return TypeThumbnailFormatWebm + return TypeThumbnailFormatWebm } func (*ThumbnailFormatWebm) ThumbnailFormatType() string { - return TypeThumbnailFormatWebm + return TypeThumbnailFormatWebm } -// The thumbnail is in WEBP format. It will be used only for some stickers -type ThumbnailFormatWebp struct { - meta +// The thumbnail is in WEBP format. It will be used only for some stickers and sticker sets +type ThumbnailFormatWebp struct{ + meta } func (entity *ThumbnailFormatWebp) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub ThumbnailFormatWebp + type stub ThumbnailFormatWebp - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*ThumbnailFormatWebp) GetClass() string { - return ClassThumbnailFormat + return ClassThumbnailFormat } func (*ThumbnailFormatWebp) GetType() string { - return TypeThumbnailFormatWebp + return TypeThumbnailFormatWebp } func (*ThumbnailFormatWebp) ThumbnailFormatType() string { - return TypeThumbnailFormatWebp + return TypeThumbnailFormatWebp } // Represents a thumbnail type Thumbnail struct { - 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"` + 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"` } func (entity *Thumbnail) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub Thumbnail + type stub Thumbnail - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*Thumbnail) GetClass() string { - return ClassThumbnail + return ClassThumbnail } func (*Thumbnail) GetType() string { - return TypeThumbnail + return TypeThumbnail } func (thumbnail *Thumbnail) UnmarshalJSON(data []byte) error { - var tmp struct { - Format json.RawMessage `json:"format"` - Width int32 `json:"width"` - Height int32 `json:"height"` - File *File `json:"file"` - } + var tmp struct { + Format json.RawMessage `json:"format"` + Width int32 `json:"width"` + Height int32 `json:"height"` + File *File `json:"file"` + } - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } - thumbnail.Width = tmp.Width - thumbnail.Height = tmp.Height - thumbnail.File = tmp.File + thumbnail.Width = tmp.Width + thumbnail.Height = tmp.Height + thumbnail.File = tmp.File - fieldFormat, _ := UnmarshalThumbnailFormat(tmp.Format) - thumbnail.Format = fieldFormat + fieldFormat, _ := UnmarshalThumbnailFormat(tmp.Format) + thumbnail.Format = fieldFormat - return nil + return nil } // The mask is placed relatively to the forehead -type MaskPointForehead struct { - meta +type MaskPointForehead struct{ + meta } func (entity *MaskPointForehead) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub MaskPointForehead + type stub MaskPointForehead - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*MaskPointForehead) GetClass() string { - return ClassMaskPoint + return ClassMaskPoint } func (*MaskPointForehead) GetType() string { - return TypeMaskPointForehead + return TypeMaskPointForehead } func (*MaskPointForehead) MaskPointType() string { - return TypeMaskPointForehead + return TypeMaskPointForehead } // The mask is placed relatively to the eyes -type MaskPointEyes struct { - meta +type MaskPointEyes struct{ + meta } func (entity *MaskPointEyes) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub MaskPointEyes + type stub MaskPointEyes - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*MaskPointEyes) GetClass() string { - return ClassMaskPoint + return ClassMaskPoint } func (*MaskPointEyes) GetType() string { - return TypeMaskPointEyes + return TypeMaskPointEyes } func (*MaskPointEyes) MaskPointType() string { - return TypeMaskPointEyes + return TypeMaskPointEyes } // The mask is placed relatively to the mouth -type MaskPointMouth struct { - meta +type MaskPointMouth struct{ + meta } func (entity *MaskPointMouth) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub MaskPointMouth + type stub MaskPointMouth - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*MaskPointMouth) GetClass() string { - return ClassMaskPoint + return ClassMaskPoint } func (*MaskPointMouth) GetType() string { - return TypeMaskPointMouth + return TypeMaskPointMouth } func (*MaskPointMouth) MaskPointType() string { - return TypeMaskPointMouth + return TypeMaskPointMouth } // The mask is placed relatively to the chin -type MaskPointChin struct { - meta +type MaskPointChin struct{ + meta } func (entity *MaskPointChin) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub MaskPointChin + type stub MaskPointChin - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*MaskPointChin) GetClass() string { - return ClassMaskPoint + return ClassMaskPoint } func (*MaskPointChin) GetType() string { - return TypeMaskPointChin + return TypeMaskPointChin } func (*MaskPointChin) MaskPointType() string { - return TypeMaskPointChin + return TypeMaskPointChin } // Position on a photo where a mask is placed type MaskPosition struct { - 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"` + 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"` } func (entity *MaskPosition) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub MaskPosition + type stub MaskPosition - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*MaskPosition) GetClass() string { - return ClassMaskPosition + return ClassMaskPosition } func (*MaskPosition) GetType() string { - return TypeMaskPosition + return TypeMaskPosition } func (maskPosition *MaskPosition) UnmarshalJSON(data []byte) error { - var tmp struct { - Point json.RawMessage `json:"point"` - XShift float64 `json:"x_shift"` - YShift float64 `json:"y_shift"` - Scale float64 `json:"scale"` - } + var tmp struct { + Point json.RawMessage `json:"point"` + XShift float64 `json:"x_shift"` + YShift float64 `json:"y_shift"` + Scale float64 `json:"scale"` + } - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } - maskPosition.XShift = tmp.XShift - maskPosition.YShift = tmp.YShift - maskPosition.Scale = tmp.Scale + maskPosition.XShift = tmp.XShift + maskPosition.YShift = tmp.YShift + maskPosition.Scale = tmp.Scale - fieldPoint, _ := UnmarshalMaskPoint(tmp.Point) - maskPosition.Point = fieldPoint + fieldPoint, _ := UnmarshalMaskPoint(tmp.Point) + maskPosition.Point = fieldPoint - return nil + return nil } // The sticker is an image in WEBP format -type StickerFormatWebp struct { - meta +type StickerFormatWebp struct{ + meta } func (entity *StickerFormatWebp) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub StickerFormatWebp + type stub StickerFormatWebp - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*StickerFormatWebp) GetClass() string { - return ClassStickerFormat + return ClassStickerFormat } func (*StickerFormatWebp) GetType() string { - return TypeStickerFormatWebp + return TypeStickerFormatWebp } func (*StickerFormatWebp) StickerFormatType() string { - return TypeStickerFormatWebp + return TypeStickerFormatWebp } // The sticker is an animation in TGS format -type StickerFormatTgs struct { - meta +type StickerFormatTgs struct{ + meta } func (entity *StickerFormatTgs) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub StickerFormatTgs + type stub StickerFormatTgs - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*StickerFormatTgs) GetClass() string { - return ClassStickerFormat + return ClassStickerFormat } func (*StickerFormatTgs) GetType() string { - return TypeStickerFormatTgs + return TypeStickerFormatTgs } func (*StickerFormatTgs) StickerFormatType() string { - return TypeStickerFormatTgs + return TypeStickerFormatTgs } // The sticker is a video in WEBM format -type StickerFormatWebm struct { - meta +type StickerFormatWebm struct{ + meta } func (entity *StickerFormatWebm) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub StickerFormatWebm + type stub StickerFormatWebm - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*StickerFormatWebm) GetClass() string { - return ClassStickerFormat + return ClassStickerFormat } func (*StickerFormatWebm) GetType() string { - return TypeStickerFormatWebm + return TypeStickerFormatWebm } func (*StickerFormatWebm) StickerFormatType() string { - return TypeStickerFormatWebm + return TypeStickerFormatWebm } // The sticker is a regular sticker -type StickerTypeRegular struct { - meta +type StickerTypeRegular struct{ + meta } func (entity *StickerTypeRegular) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub StickerTypeRegular + type stub StickerTypeRegular - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*StickerTypeRegular) GetClass() string { - return ClassStickerType + return ClassStickerType } func (*StickerTypeRegular) GetType() string { - return TypeStickerTypeRegular + return TypeStickerTypeRegular } func (*StickerTypeRegular) StickerTypeType() string { - return TypeStickerTypeRegular + return TypeStickerTypeRegular } // The sticker is a mask in WEBP format to be placed on photos or videos -type StickerTypeMask struct { - meta +type StickerTypeMask struct{ + meta } func (entity *StickerTypeMask) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub StickerTypeMask + type stub StickerTypeMask - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*StickerTypeMask) GetClass() string { - return ClassStickerType + return ClassStickerType } func (*StickerTypeMask) GetType() string { - return TypeStickerTypeMask + return TypeStickerTypeMask } func (*StickerTypeMask) StickerTypeType() string { - return TypeStickerTypeMask + return TypeStickerTypeMask } // The sticker is a custom emoji to be used inside message text and caption -type StickerTypeCustomEmoji struct { - meta +type StickerTypeCustomEmoji struct{ + meta } func (entity *StickerTypeCustomEmoji) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub StickerTypeCustomEmoji + type stub StickerTypeCustomEmoji - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*StickerTypeCustomEmoji) GetClass() string { - return ClassStickerType + return ClassStickerType } func (*StickerTypeCustomEmoji) GetType() string { - return TypeStickerTypeCustomEmoji + return TypeStickerTypeCustomEmoji } func (*StickerTypeCustomEmoji) StickerTypeType() string { - return TypeStickerTypeCustomEmoji + return TypeStickerTypeCustomEmoji } // The sticker is a regular sticker type StickerFullTypeRegular struct { - meta - // Premium animation of the sticker; may be null. If present, only Telegram Premium users can use the sticker - PremiumAnimation *File `json:"premium_animation"` + meta + // Premium animation of the sticker; may be null. If present, only Telegram Premium users can use the sticker + PremiumAnimation *File `json:"premium_animation"` } func (entity *StickerFullTypeRegular) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub StickerFullTypeRegular + type stub StickerFullTypeRegular - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*StickerFullTypeRegular) GetClass() string { - return ClassStickerFullType + return ClassStickerFullType } func (*StickerFullTypeRegular) GetType() string { - return TypeStickerFullTypeRegular + return TypeStickerFullTypeRegular } func (*StickerFullTypeRegular) StickerFullTypeType() string { - return TypeStickerFullTypeRegular + return TypeStickerFullTypeRegular } // The sticker is a mask in WEBP format to be placed on photos or videos type StickerFullTypeMask struct { - meta - // Position where the mask is placed; may be null - MaskPosition *MaskPosition `json:"mask_position"` + meta + // Position where the mask is placed; may be null + MaskPosition *MaskPosition `json:"mask_position"` } func (entity *StickerFullTypeMask) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub StickerFullTypeMask + type stub StickerFullTypeMask - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*StickerFullTypeMask) GetClass() string { - return ClassStickerFullType + return ClassStickerFullType } func (*StickerFullTypeMask) GetType() string { - return TypeStickerFullTypeMask + return TypeStickerFullTypeMask } func (*StickerFullTypeMask) StickerFullTypeType() string { - return TypeStickerFullTypeMask + return TypeStickerFullTypeMask } // The sticker is a custom emoji to be used inside message text and caption. Currently, only Telegram Premium users can use custom emoji type StickerFullTypeCustomEmoji struct { - meta - // Identifier of the custom emoji - CustomEmojiId JsonInt64 `json:"custom_emoji_id"` - // True, if the sticker must be repainted to a text color in messages, the color of the Telegram Premium badge in emoji status, or another appropriate color in other places - NeedsRepainting bool `json:"needs_repainting"` + meta + // Identifier of the custom emoji + CustomEmojiId JsonInt64 `json:"custom_emoji_id"` + // True, if the sticker must be repainted to a text color in messages, the color of the Telegram Premium badge in emoji status, white color on chat photos, or another appropriate color in other places + NeedsRepainting bool `json:"needs_repainting"` } func (entity *StickerFullTypeCustomEmoji) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub StickerFullTypeCustomEmoji + type stub StickerFullTypeCustomEmoji - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*StickerFullTypeCustomEmoji) GetClass() string { - return ClassStickerFullType + return ClassStickerFullType } func (*StickerFullTypeCustomEmoji) GetType() string { - return TypeStickerFullTypeCustomEmoji + return TypeStickerFullTypeCustomEmoji } func (*StickerFullTypeCustomEmoji) StickerFullTypeType() string { - return TypeStickerFullTypeCustomEmoji + return TypeStickerFullTypeCustomEmoji } // Represents a closed vector path. The path begins at the end point of the last command type ClosedVectorPath struct { - meta - // List of vector path commands - Commands []VectorPathCommand `json:"commands"` + meta + // List of vector path commands + Commands []VectorPathCommand `json:"commands"` } func (entity *ClosedVectorPath) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub ClosedVectorPath + type stub ClosedVectorPath - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*ClosedVectorPath) GetClass() string { - return ClassClosedVectorPath + return ClassClosedVectorPath } func (*ClosedVectorPath) GetType() string { - return TypeClosedVectorPath + return TypeClosedVectorPath } func (closedVectorPath *ClosedVectorPath) UnmarshalJSON(data []byte) error { - var tmp struct { - Commands []json.RawMessage `json:"commands"` - } + var tmp struct { + Commands []json.RawMessage `json:"commands"` + } - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } - fieldCommands, _ := UnmarshalListOfVectorPathCommand(tmp.Commands) - closedVectorPath.Commands = fieldCommands + fieldCommands, _ := UnmarshalListOfVectorPathCommand(tmp.Commands) + closedVectorPath.Commands = fieldCommands - return nil + return nil } // Describes one answer option of a poll type PollOption struct { - 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"` + 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"` } func (entity *PollOption) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub PollOption + type stub PollOption - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*PollOption) GetClass() string { - return ClassPollOption + return ClassPollOption } func (*PollOption) GetType() string { - return TypePollOption + return TypePollOption } // A regular poll type PollTypeRegular struct { - meta - // True, if multiple answer options can be chosen simultaneously - AllowMultipleAnswers bool `json:"allow_multiple_answers"` + meta + // True, if multiple answer options can be chosen simultaneously + AllowMultipleAnswers bool `json:"allow_multiple_answers"` } func (entity *PollTypeRegular) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub PollTypeRegular + type stub PollTypeRegular - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*PollTypeRegular) GetClass() string { - return ClassPollType + return ClassPollType } func (*PollTypeRegular) GetType() string { - return TypePollTypeRegular + return TypePollTypeRegular } func (*PollTypeRegular) PollTypeType() string { - return TypePollTypeRegular + return TypePollTypeRegular } // A poll in quiz mode, which has exactly one correct answer option and can be answered only once type PollTypeQuiz struct { - 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"` + 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"` } func (entity *PollTypeQuiz) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub PollTypeQuiz + type stub PollTypeQuiz - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*PollTypeQuiz) GetClass() string { - return ClassPollType + return ClassPollType } func (*PollTypeQuiz) GetType() string { - return TypePollTypeQuiz + return TypePollTypeQuiz } func (*PollTypeQuiz) PollTypeType() string { - return TypePollTypeQuiz + return TypePollTypeQuiz } // Describes an animation file. The animation must be encoded in GIF or MPEG4 format type Animation struct { - 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"` + 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"` } func (entity *Animation) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub Animation + type stub Animation - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*Animation) GetClass() string { - return ClassAnimation + return ClassAnimation } func (*Animation) GetType() string { - return TypeAnimation + return TypeAnimation } // Describes an audio file. Audio is usually in MP3 or M4A format type Audio struct { - 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 audio file; may be null - AlbumCoverThumbnail *Thumbnail `json:"album_cover_thumbnail"` - // Album cover variants to use if the downloaded audio file contains no album cover. Provided thumbnail dimensions are approximate - ExternalAlbumCovers []*Thumbnail `json:"external_album_covers"` - // File containing the audio - Audio *File `json:"audio"` + 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 audio file; may be null + AlbumCoverThumbnail *Thumbnail `json:"album_cover_thumbnail"` + // Album cover variants to use if the downloaded audio file contains no album cover. Provided thumbnail dimensions are approximate + ExternalAlbumCovers []*Thumbnail `json:"external_album_covers"` + // File containing the audio + Audio *File `json:"audio"` } func (entity *Audio) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub Audio + type stub Audio - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*Audio) GetClass() string { - return ClassAudio + return ClassAudio } func (*Audio) GetType() string { - return TypeAudio + return TypeAudio } // Describes a document of any type type Document struct { - 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"` + 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"` } func (entity *Document) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub Document + type stub Document - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*Document) GetClass() string { - return ClassDocument + return ClassDocument } func (*Document) GetType() string { - return TypeDocument + return TypeDocument } // Describes a photo type Photo struct { - 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"` + 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"` } func (entity *Photo) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub Photo + type stub Photo - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*Photo) GetClass() string { - return ClassPhoto + return ClassPhoto } func (*Photo) GetType() string { - return TypePhoto + return TypePhoto } // Describes a sticker type Sticker struct { - 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 format - Format StickerFormat `json:"format"` - // Sticker's full type - FullType StickerFullType `json:"full_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"` + meta + // Unique sticker identifier within the set; 0 if none + Id JsonInt64 `json:"id"` + // 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 format + Format StickerFormat `json:"format"` + // Sticker's full type + FullType StickerFullType `json:"full_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"` } func (entity *Sticker) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub Sticker + type stub Sticker - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*Sticker) GetClass() string { - return ClassSticker + return ClassSticker } func (*Sticker) GetType() string { - return TypeSticker + return TypeSticker } func (sticker *Sticker) UnmarshalJSON(data []byte) error { - var tmp struct { - SetId JsonInt64 `json:"set_id"` - Width int32 `json:"width"` - Height int32 `json:"height"` - Emoji string `json:"emoji"` - Format json.RawMessage `json:"format"` - FullType json.RawMessage `json:"full_type"` - Outline []*ClosedVectorPath `json:"outline"` - Thumbnail *Thumbnail `json:"thumbnail"` - Sticker *File `json:"sticker"` - } + var tmp struct { + Id JsonInt64 `json:"id"` + SetId JsonInt64 `json:"set_id"` + Width int32 `json:"width"` + Height int32 `json:"height"` + Emoji string `json:"emoji"` + Format json.RawMessage `json:"format"` + FullType json.RawMessage `json:"full_type"` + Outline []*ClosedVectorPath `json:"outline"` + Thumbnail *Thumbnail `json:"thumbnail"` + Sticker *File `json:"sticker"` + } - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } + 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 + sticker.Id = tmp.Id + 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 - fieldFormat, _ := UnmarshalStickerFormat(tmp.Format) - sticker.Format = fieldFormat + fieldFormat, _ := UnmarshalStickerFormat(tmp.Format) + sticker.Format = fieldFormat - fieldFullType, _ := UnmarshalStickerFullType(tmp.FullType) - sticker.FullType = fieldFullType + fieldFullType, _ := UnmarshalStickerFullType(tmp.FullType) + sticker.FullType = fieldFullType - return nil + return nil } // Describes a video file type Video struct { - 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"` + 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"` } func (entity *Video) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub Video + type stub Video - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*Video) GetClass() string { - return ClassVideo + return ClassVideo } func (*Video) GetType() string { - return TypeVideo + return TypeVideo } // 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 { - meta - // Duration of the video, in seconds; as defined by the sender - Duration int32 `json:"duration"` - // A waveform representation of the video note's audio in 5-bit format; may be empty if unknown - Waveform []byte `json:"waveform"` - // 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"` - // Result of speech recognition in the video note; may be null - SpeechRecognitionResult SpeechRecognitionResult `json:"speech_recognition_result"` - // File containing the video - Video *File `json:"video"` + meta + // Duration of the video, in seconds; as defined by the sender + Duration int32 `json:"duration"` + // A waveform representation of the video note's audio in 5-bit format; may be empty if unknown + Waveform []byte `json:"waveform"` + // 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"` + // Result of speech recognition in the video note; may be null + SpeechRecognitionResult SpeechRecognitionResult `json:"speech_recognition_result"` + // File containing the video + Video *File `json:"video"` } func (entity *VideoNote) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub VideoNote + type stub VideoNote - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*VideoNote) GetClass() string { - return ClassVideoNote + return ClassVideoNote } func (*VideoNote) GetType() string { - return TypeVideoNote + return TypeVideoNote } func (videoNote *VideoNote) UnmarshalJSON(data []byte) error { - var tmp struct { - Duration int32 `json:"duration"` - Waveform []byte `json:"waveform"` - Length int32 `json:"length"` - Minithumbnail *Minithumbnail `json:"minithumbnail"` - Thumbnail *Thumbnail `json:"thumbnail"` - SpeechRecognitionResult json.RawMessage `json:"speech_recognition_result"` - Video *File `json:"video"` - } + var tmp struct { + Duration int32 `json:"duration"` + Waveform []byte `json:"waveform"` + Length int32 `json:"length"` + Minithumbnail *Minithumbnail `json:"minithumbnail"` + Thumbnail *Thumbnail `json:"thumbnail"` + SpeechRecognitionResult json.RawMessage `json:"speech_recognition_result"` + Video *File `json:"video"` + } - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } - videoNote.Duration = tmp.Duration - videoNote.Waveform = tmp.Waveform - videoNote.Length = tmp.Length - videoNote.Minithumbnail = tmp.Minithumbnail - videoNote.Thumbnail = tmp.Thumbnail - videoNote.Video = tmp.Video + videoNote.Duration = tmp.Duration + videoNote.Waveform = tmp.Waveform + videoNote.Length = tmp.Length + videoNote.Minithumbnail = tmp.Minithumbnail + videoNote.Thumbnail = tmp.Thumbnail + videoNote.Video = tmp.Video - fieldSpeechRecognitionResult, _ := UnmarshalSpeechRecognitionResult(tmp.SpeechRecognitionResult) - videoNote.SpeechRecognitionResult = fieldSpeechRecognitionResult + fieldSpeechRecognitionResult, _ := UnmarshalSpeechRecognitionResult(tmp.SpeechRecognitionResult) + videoNote.SpeechRecognitionResult = fieldSpeechRecognitionResult - return nil + return nil } // 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 { - 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"` - // Result of speech recognition in the voice note; may be null - SpeechRecognitionResult SpeechRecognitionResult `json:"speech_recognition_result"` - // File containing the voice note - Voice *File `json:"voice"` + 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"` + // Result of speech recognition in the voice note; may be null + SpeechRecognitionResult SpeechRecognitionResult `json:"speech_recognition_result"` + // File containing the voice note + Voice *File `json:"voice"` } func (entity *VoiceNote) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub VoiceNote + type stub VoiceNote - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*VoiceNote) GetClass() string { - return ClassVoiceNote + return ClassVoiceNote } func (*VoiceNote) GetType() string { - return TypeVoiceNote + return TypeVoiceNote } func (voiceNote *VoiceNote) UnmarshalJSON(data []byte) error { - var tmp struct { - Duration int32 `json:"duration"` - Waveform []byte `json:"waveform"` - MimeType string `json:"mime_type"` - SpeechRecognitionResult json.RawMessage `json:"speech_recognition_result"` - Voice *File `json:"voice"` - } + var tmp struct { + Duration int32 `json:"duration"` + Waveform []byte `json:"waveform"` + MimeType string `json:"mime_type"` + SpeechRecognitionResult json.RawMessage `json:"speech_recognition_result"` + Voice *File `json:"voice"` + } - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } - voiceNote.Duration = tmp.Duration - voiceNote.Waveform = tmp.Waveform - voiceNote.MimeType = tmp.MimeType - voiceNote.Voice = tmp.Voice + voiceNote.Duration = tmp.Duration + voiceNote.Waveform = tmp.Waveform + voiceNote.MimeType = tmp.MimeType + voiceNote.Voice = tmp.Voice - fieldSpeechRecognitionResult, _ := UnmarshalSpeechRecognitionResult(tmp.SpeechRecognitionResult) - voiceNote.SpeechRecognitionResult = fieldSpeechRecognitionResult + fieldSpeechRecognitionResult, _ := UnmarshalSpeechRecognitionResult(tmp.SpeechRecognitionResult) + voiceNote.SpeechRecognitionResult = fieldSpeechRecognitionResult - return nil + return nil } // Describes an animated or custom representation of an emoji type AnimatedEmoji struct { - meta - // Sticker for the emoji; may be null if yet unknown for a custom emoji. If the sticker is a custom emoji, it can have arbitrary format different from stickerFormatTgs - Sticker *Sticker `json:"sticker"` - // Expected width of the sticker, which can be used if the sticker is null - StickerWidth int32 `json:"sticker_width"` - // Expected height of the sticker, which can be used if the sticker is null - StickerHeight int32 `json:"sticker_height"` - // Emoji modifier fitzpatrick type; 0-6; 0 if none - FitzpatrickType int32 `json:"fitzpatrick_type"` - // File containing the sound to be played when the sticker is clicked; may be null. The sound is encoded with the Opus codec, and stored inside an OGG container - Sound *File `json:"sound"` + meta + // Sticker for the emoji; may be null if yet unknown for a custom emoji. If the sticker is a custom emoji, then it can have arbitrary format + Sticker *Sticker `json:"sticker"` + // Expected width of the sticker, which can be used if the sticker is null + StickerWidth int32 `json:"sticker_width"` + // Expected height of the sticker, which can be used if the sticker is null + StickerHeight int32 `json:"sticker_height"` + // Emoji modifier fitzpatrick type; 0-6; 0 if none + FitzpatrickType int32 `json:"fitzpatrick_type"` + // File containing the sound to be played when the sticker is clicked; may be null. The sound is encoded with the Opus codec, and stored inside an OGG container + Sound *File `json:"sound"` } func (entity *AnimatedEmoji) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub AnimatedEmoji + type stub AnimatedEmoji - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*AnimatedEmoji) GetClass() string { - return ClassAnimatedEmoji + return ClassAnimatedEmoji } func (*AnimatedEmoji) GetType() string { - return TypeAnimatedEmoji + return TypeAnimatedEmoji } // Describes a user contact type Contact struct { - 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"` + 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; 0 otherwise + UserId int64 `json:"user_id"` } func (entity *Contact) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub Contact + type stub Contact - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*Contact) GetClass() string { - return ClassContact + return ClassContact } func (*Contact) GetType() string { - return TypeContact + return TypeContact } // Describes a location on planet Earth type Location struct { - 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"` + 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"` } func (entity *Location) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub Location + type stub Location - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*Location) GetClass() string { - return ClassLocation + return ClassLocation } func (*Location) GetType() string { - return TypeLocation + return TypeLocation } // Describes a venue type Venue struct { - 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"` + 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"` } func (entity *Venue) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub Venue + type stub Venue - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*Venue) GetClass() string { - return ClassVenue + return ClassVenue } func (*Venue) GetType() string { - return TypeVenue + return TypeVenue } -// Describes a game +// Describes a game. Use getInternalLink with internalLinkTypeGame to share the game type Game struct { - meta - // Unique game identifier - 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"` + meta + // Unique game identifier + Id JsonInt64 `json:"id"` + // 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"` } func (entity *Game) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub Game + type stub Game - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*Game) GetClass() string { - return ClassGame + return ClassGame } func (*Game) GetType() string { - return TypeGame + return TypeGame +} + +// Describes a Web App. Use getInternalLink with internalLinkTypeWebApp to share the Web App +type WebApp struct { + meta + // Web App short name + ShortName string `json:"short_name"` + // Web App title + Title string `json:"title"` + // Web App description + Description string `json:"description"` + // Web App photo + Photo *Photo `json:"photo"` + // Web App animation; may be null + Animation *Animation `json:"animation"` +} + +func (entity *WebApp) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub WebApp + + return json.Marshal((*stub)(entity)) +} + +func (*WebApp) GetClass() string { + return ClassWebApp +} + +func (*WebApp) GetType() string { + return TypeWebApp } // Describes a poll type Poll struct { - 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"` + 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"` + // Identifiers of recent voters, if the poll is non-anonymous + RecentVoterIds []MessageSender `json:"recent_voter_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"` } func (entity *Poll) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub Poll + type stub Poll - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*Poll) GetClass() string { - return ClassPoll + return ClassPoll } func (*Poll) GetType() string { - return TypePoll + return TypePoll } func (poll *Poll) UnmarshalJSON(data []byte) error { - 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 -} - -// Describes a user profile photo -type ProfilePhoto struct { - 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"` - // True, if the photo is visible only for the current user - IsPersonal bool `json:"is_personal"` -} - -func (entity *ProfilePhoto) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ProfilePhoto - - return json.Marshal((*stub)(entity)) -} - -func (*ProfilePhoto) GetClass() string { - return ClassProfilePhoto -} - -func (*ProfilePhoto) GetType() string { - return TypeProfilePhoto -} - -// Contains basic information about the photo of a chat -type ChatPhotoInfo struct { - 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"` - // True, if the photo is visible only for the current user - IsPersonal bool `json:"is_personal"` -} - -func (entity *ChatPhotoInfo) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatPhotoInfo - - return json.Marshal((*stub)(entity)) -} - -func (*ChatPhotoInfo) GetClass() string { - return ClassChatPhotoInfo -} - -func (*ChatPhotoInfo) GetType() string { - return TypeChatPhotoInfo -} - -// A regular user -type UserTypeRegular struct { - meta -} - -func (entity *UserTypeRegular) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UserTypeRegular - - return json.Marshal((*stub)(entity)) -} - -func (*UserTypeRegular) GetClass() string { - return ClassUserType -} - -func (*UserTypeRegular) GetType() string { - return TypeUserTypeRegular -} - -func (*UserTypeRegular) UserTypeType() string { - return TypeUserTypeRegular -} - -// 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 -type UserTypeDeleted struct { - meta -} - -func (entity *UserTypeDeleted) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UserTypeDeleted - - return json.Marshal((*stub)(entity)) -} - -func (*UserTypeDeleted) GetClass() string { - return ClassUserType -} - -func (*UserTypeDeleted) GetType() string { - return TypeUserTypeDeleted -} - -func (*UserTypeDeleted) UserTypeType() string { - return TypeUserTypeDeleted -} - -// A bot (see https://core.telegram.org/bots) -type UserTypeBot struct { - 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"` - // True, if the bot can be added to attachment menu - CanBeAddedToAttachmentMenu bool `json:"can_be_added_to_attachment_menu"` -} - -func (entity *UserTypeBot) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UserTypeBot - - return json.Marshal((*stub)(entity)) -} - -func (*UserTypeBot) GetClass() string { - return ClassUserType -} - -func (*UserTypeBot) GetType() string { - return TypeUserTypeBot -} - -func (*UserTypeBot) UserTypeType() string { - return TypeUserTypeBot -} - -// 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 -type UserTypeUnknown struct { - meta -} - -func (entity *UserTypeUnknown) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UserTypeUnknown - - return json.Marshal((*stub)(entity)) -} - -func (*UserTypeUnknown) GetClass() string { - return ClassUserType -} - -func (*UserTypeUnknown) GetType() string { - return TypeUserTypeUnknown -} - -func (*UserTypeUnknown) UserTypeType() string { - return TypeUserTypeUnknown -} - -// Represents a command supported by a bot -type BotCommand struct { - meta - // Text of the bot command - Command string `json:"command"` - // Description of the bot command - Description string `json:"description"` -} - -func (entity *BotCommand) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub BotCommand - - return json.Marshal((*stub)(entity)) -} - -func (*BotCommand) GetClass() string { - return ClassBotCommand -} - -func (*BotCommand) GetType() string { - return TypeBotCommand -} - -// Contains a list of bot commands -type BotCommands struct { - meta - // Bot's user identifier - BotUserId int64 `json:"bot_user_id"` - // List of bot commands - Commands []*BotCommand `json:"commands"` -} - -func (entity *BotCommands) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub BotCommands - - return json.Marshal((*stub)(entity)) -} - -func (*BotCommands) GetClass() string { - return ClassBotCommands -} - -func (*BotCommands) GetType() string { - return TypeBotCommands -} - -// Describes a button to be shown instead of bot commands menu button -type BotMenuButton struct { - meta - // Text of the button - Text string `json:"text"` - // URL to be passed to openWebApp - Url string `json:"url"` -} - -func (entity *BotMenuButton) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub BotMenuButton - - return json.Marshal((*stub)(entity)) -} - -func (*BotMenuButton) GetClass() string { - return ClassBotMenuButton -} - -func (*BotMenuButton) GetType() string { - return TypeBotMenuButton -} - -// Represents a location to which a chat is connected -type ChatLocation struct { - meta - // The location - Location *Location `json:"location"` - // Location address; 1-64 characters, as defined by the chat owner - Address string `json:"address"` -} - -func (entity *ChatLocation) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatLocation - - return json.Marshal((*stub)(entity)) -} - -func (*ChatLocation) GetClass() string { - return ClassChatLocation -} - -func (*ChatLocation) GetType() string { - return TypeChatLocation -} - -// Animated variant of a chat photo in MPEG4 format -type AnimatedChatPhoto struct { - 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"` -} - -func (entity *AnimatedChatPhoto) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub AnimatedChatPhoto - - return json.Marshal((*stub)(entity)) -} - -func (*AnimatedChatPhoto) GetClass() string { - return ClassAnimatedChatPhoto -} - -func (*AnimatedChatPhoto) GetType() string { - return TypeAnimatedChatPhoto -} - -// Describes a chat or user profile photo -type ChatPhoto struct { - 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"` - // A big (640x640) animated variant of the photo in MPEG4 format; may be null - Animation *AnimatedChatPhoto `json:"animation"` - // A small (160x160) animated variant of the photo in MPEG4 format; may be null even the big animation is available - SmallAnimation *AnimatedChatPhoto `json:"small_animation"` -} - -func (entity *ChatPhoto) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatPhoto - - return json.Marshal((*stub)(entity)) -} - -func (*ChatPhoto) GetClass() string { - return ClassChatPhoto -} - -func (*ChatPhoto) GetType() string { - return TypeChatPhoto -} - -// Contains a list of chat or user profile photos -type ChatPhotos struct { - meta - // Total number of photos - TotalCount int32 `json:"total_count"` - // List of photos - Photos []*ChatPhoto `json:"photos"` -} - -func (entity *ChatPhotos) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatPhotos - - return json.Marshal((*stub)(entity)) -} - -func (*ChatPhotos) GetClass() string { - return ClassChatPhotos -} - -func (*ChatPhotos) GetType() string { - return TypeChatPhotos -} - -// A previously used profile photo of the current user -type InputChatPhotoPrevious struct { - meta - // Identifier of the current user's profile photo to reuse - ChatPhotoId JsonInt64 `json:"chat_photo_id"` -} - -func (entity *InputChatPhotoPrevious) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputChatPhotoPrevious - - return json.Marshal((*stub)(entity)) -} - -func (*InputChatPhotoPrevious) GetClass() string { - return ClassInputChatPhoto -} - -func (*InputChatPhotoPrevious) GetType() string { - return TypeInputChatPhotoPrevious -} - -func (*InputChatPhotoPrevious) InputChatPhotoType() string { - return TypeInputChatPhotoPrevious -} - -// A static photo in JPEG format -type InputChatPhotoStatic struct { - meta - // Photo to be set as profile photo. Only inputFileLocal and inputFileGenerated are allowed - Photo InputFile `json:"photo"` -} - -func (entity *InputChatPhotoStatic) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputChatPhotoStatic - - return json.Marshal((*stub)(entity)) -} - -func (*InputChatPhotoStatic) GetClass() string { - return ClassInputChatPhoto -} - -func (*InputChatPhotoStatic) GetType() string { - return TypeInputChatPhotoStatic -} - -func (*InputChatPhotoStatic) InputChatPhotoType() string { - return TypeInputChatPhotoStatic -} - -func (inputChatPhotoStatic *InputChatPhotoStatic) UnmarshalJSON(data []byte) error { - var tmp struct { - Photo json.RawMessage `json:"photo"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - fieldPhoto, _ := UnmarshalInputFile(tmp.Photo) - inputChatPhotoStatic.Photo = fieldPhoto - - return nil -} - -// 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 { - 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"` -} - -func (entity *InputChatPhotoAnimation) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputChatPhotoAnimation - - return json.Marshal((*stub)(entity)) -} - -func (*InputChatPhotoAnimation) GetClass() string { - return ClassInputChatPhoto -} - -func (*InputChatPhotoAnimation) GetType() string { - return TypeInputChatPhotoAnimation -} - -func (*InputChatPhotoAnimation) InputChatPhotoType() string { - return TypeInputChatPhotoAnimation -} - -func (inputChatPhotoAnimation *InputChatPhotoAnimation) UnmarshalJSON(data []byte) error { - var tmp struct { - Animation json.RawMessage `json:"animation"` - MainFrameTimestamp float64 `json:"main_frame_timestamp"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - inputChatPhotoAnimation.MainFrameTimestamp = tmp.MainFrameTimestamp - - fieldAnimation, _ := UnmarshalInputFile(tmp.Animation) - inputChatPhotoAnimation.Animation = fieldAnimation - - return nil -} - -// Describes actions that a user is allowed to take in a chat -type ChatPermissions struct { - 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 animations, games, stickers, and dice and use inline bots. Implies can_send_messages permissions - CanSendOtherMessages bool `json:"can_send_other_messages"` - // 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"` - // True, if the user can manage topics - CanManageTopics bool `json:"can_manage_topics"` -} - -func (entity *ChatPermissions) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatPermissions - - return json.Marshal((*stub)(entity)) -} - -func (*ChatPermissions) GetClass() string { - return ClassChatPermissions -} - -func (*ChatPermissions) GetType() string { - return TypeChatPermissions -} - -// Describes rights of the administrator -type ChatAdministratorRights struct { - meta - // 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 manage topics; applicable to forum supergroups only - CanManageTopics bool `json:"can_manage_topics"` - // 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"` -} - -func (entity *ChatAdministratorRights) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatAdministratorRights - - return json.Marshal((*stub)(entity)) -} - -func (*ChatAdministratorRights) GetClass() string { - return ClassChatAdministratorRights -} - -func (*ChatAdministratorRights) GetType() string { - return TypeChatAdministratorRights -} - -// Describes an option for buying Telegram Premium to a user -type PremiumPaymentOption struct { - meta - // ISO 4217 currency code for Telegram Premium subscription payment - Currency string `json:"currency"` - // The amount to pay, in the smallest units of the currency - Amount int64 `json:"amount"` - // The discount associated with this option, as a percentage - DiscountPercentage int32 `json:"discount_percentage"` - // Number of month the Telegram Premium subscription will be active - MonthCount int32 `json:"month_count"` - // Identifier of the store product associated with the option - StoreProductId string `json:"store_product_id"` - // An internal link to be opened for buying Telegram Premium to the user if store payment isn't possible; may be null if direct payment isn't available - PaymentLink InternalLinkType `json:"payment_link"` -} - -func (entity *PremiumPaymentOption) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PremiumPaymentOption - - return json.Marshal((*stub)(entity)) -} - -func (*PremiumPaymentOption) GetClass() string { - return ClassPremiumPaymentOption -} - -func (*PremiumPaymentOption) GetType() string { - return TypePremiumPaymentOption -} - -func (premiumPaymentOption *PremiumPaymentOption) UnmarshalJSON(data []byte) error { - var tmp struct { - Currency string `json:"currency"` - Amount int64 `json:"amount"` - DiscountPercentage int32 `json:"discount_percentage"` - MonthCount int32 `json:"month_count"` - StoreProductId string `json:"store_product_id"` - PaymentLink json.RawMessage `json:"payment_link"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - premiumPaymentOption.Currency = tmp.Currency - premiumPaymentOption.Amount = tmp.Amount - premiumPaymentOption.DiscountPercentage = tmp.DiscountPercentage - premiumPaymentOption.MonthCount = tmp.MonthCount - premiumPaymentOption.StoreProductId = tmp.StoreProductId - - fieldPaymentLink, _ := UnmarshalInternalLinkType(tmp.PaymentLink) - premiumPaymentOption.PaymentLink = fieldPaymentLink - - return nil -} - -// Describes a custom emoji to be shown instead of the Telegram Premium badge -type EmojiStatus struct { - meta - // Identifier of the custom emoji in stickerFormatTgs format - CustomEmojiId JsonInt64 `json:"custom_emoji_id"` -} - -func (entity *EmojiStatus) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub EmojiStatus - - return json.Marshal((*stub)(entity)) -} - -func (*EmojiStatus) GetClass() string { - return ClassEmojiStatus -} - -func (*EmojiStatus) GetType() string { - return TypeEmojiStatus -} - -// Contains a list of emoji statuses -type EmojiStatuses struct { - meta - // The list of emoji statuses - EmojiStatuses []*EmojiStatus `json:"emoji_statuses"` -} - -func (entity *EmojiStatuses) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub EmojiStatuses - - return json.Marshal((*stub)(entity)) -} - -func (*EmojiStatuses) GetClass() string { - return ClassEmojiStatuses -} - -func (*EmojiStatuses) GetType() string { - return TypeEmojiStatuses -} - -// Describes usernames assigned to a user, a supergroup, or a channel -type Usernames struct { - meta - // List of active usernames; the first one must be shown as the primary username. The order of active usernames can be changed with reorderActiveUsernames or reorderSupergroupActiveUsernames - ActiveUsernames []string `json:"active_usernames"` - // List of currently disabled usernames; the username can be activated with toggleUsernameIsActive/toggleSupergroupUsernameIsActive - DisabledUsernames []string `json:"disabled_usernames"` - // The active username, which can be changed with setUsername/setSupergroupUsername - EditableUsername string `json:"editable_username"` -} - -func (entity *Usernames) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub Usernames - - return json.Marshal((*stub)(entity)) -} - -func (*Usernames) GetClass() string { - return ClassUsernames -} - -func (*Usernames) GetType() string { - return TypeUsernames -} - -// Represents a user -type User struct { - meta - // User identifier - Id int64 `json:"id"` - // First name of the user - FirstName string `json:"first_name"` - // Last name of the user - LastName string `json:"last_name"` - // Usernames of the user; may be null - Usernames *Usernames `json:"usernames"` - // 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"` - // Emoji status to be shown instead of the default Telegram Premium badge; may be null. For Telegram Premium users only - EmojiStatus *EmojiStatus `json:"emoji_status"` - // 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 a Telegram Premium user - IsPremium bool `json:"is_premium"` - // 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 - 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"` - // True, if the user added the current bot to attachment menu; only available to bots - AddedToAttachmentMenu bool `json:"added_to_attachment_menu"` -} - -func (entity *User) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub User - - return json.Marshal((*stub)(entity)) -} - -func (*User) GetClass() string { - return ClassUser -} - -func (*User) GetType() string { - return TypeUser -} - -func (user *User) UnmarshalJSON(data []byte) error { - var tmp struct { - Id int64 `json:"id"` - FirstName string `json:"first_name"` - LastName string `json:"last_name"` - Usernames *Usernames `json:"usernames"` - PhoneNumber string `json:"phone_number"` - Status json.RawMessage `json:"status"` - ProfilePhoto *ProfilePhoto `json:"profile_photo"` - EmojiStatus *EmojiStatus `json:"emoji_status"` - IsContact bool `json:"is_contact"` - IsMutualContact bool `json:"is_mutual_contact"` - IsVerified bool `json:"is_verified"` - IsPremium bool `json:"is_premium"` - 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"` - AddedToAttachmentMenu bool `json:"added_to_attachment_menu"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - user.Id = tmp.Id - user.FirstName = tmp.FirstName - user.LastName = tmp.LastName - user.Usernames = tmp.Usernames - user.PhoneNumber = tmp.PhoneNumber - user.ProfilePhoto = tmp.ProfilePhoto - user.EmojiStatus = tmp.EmojiStatus - user.IsContact = tmp.IsContact - user.IsMutualContact = tmp.IsMutualContact - user.IsVerified = tmp.IsVerified - user.IsPremium = tmp.IsPremium - user.IsSupport = tmp.IsSupport - user.RestrictionReason = tmp.RestrictionReason - user.IsScam = tmp.IsScam - user.IsFake = tmp.IsFake - user.HaveAccess = tmp.HaveAccess - user.LanguageCode = tmp.LanguageCode - user.AddedToAttachmentMenu = tmp.AddedToAttachmentMenu - - fieldStatus, _ := UnmarshalUserStatus(tmp.Status) - user.Status = fieldStatus - - fieldType, _ := UnmarshalUserType(tmp.Type) - user.Type = fieldType - - return nil -} - -// Contains information about a bot -type BotInfo struct { - meta - // 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"` - // The text shown in the chat with the bot if the chat is empty - Description string `json:"description"` - // Photo shown in the chat with the bot if the chat is empty; may be null - Photo *Photo `json:"photo"` - // Animation shown in the chat with the bot if the chat is empty; may be null - Animation *Animation `json:"animation"` - // Information about a button to show instead of the bot commands menu button; may be null if ordinary bot commands menu must be shown - MenuButton *BotMenuButton `json:"menu_button"` - // List of the bot commands - Commands []*BotCommand `json:"commands"` - // Default administrator rights for adding the bot to basic group and supergroup chats; may be null - DefaultGroupAdministratorRights *ChatAdministratorRights `json:"default_group_administrator_rights"` - // Default administrator rights for adding the bot to channels; may be null - DefaultChannelAdministratorRights *ChatAdministratorRights `json:"default_channel_administrator_rights"` -} - -func (entity *BotInfo) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub BotInfo - - return json.Marshal((*stub)(entity)) -} - -func (*BotInfo) GetClass() string { - return ClassBotInfo -} - -func (*BotInfo) GetType() string { - return TypeBotInfo -} - -// Contains full information about a user -type UserFullInfo struct { - meta - // User profile photo set by the current user for the contact; may be null. If null and user.profile_photo is null, then the photo is empty, otherwise unknown. If non-null, then it is the same photo as in user.profile_photo and chat.photo. This photo isn't returned in the list of user photos - PersonalPhoto *ChatPhoto `json:"personal_photo"` - // User profile photo; may be null. If null and user.profile_photo is null, then the photo is empty, otherwise unknown. If non-null and personal_photo is null, then it is the same photo as in user.profile_photo and chat.photo - Photo *ChatPhoto `json:"photo"` - // User profile photo visible if the main photo is hidden by privacy settings; may be null. If null and user.profile_photo is null, then the photo is empty, otherwise unknown. If non-null and both photo and personal_photo are null, then it is the same photo as in user.profile_photo and chat.photo. This photo isn't returned in the list of user photos - PublicPhoto *ChatPhoto `json:"public_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 voice and video notes can't be sent or forwarded to the user - HasRestrictedVoiceAndVideoNoteMessages bool `json:"has_restricted_voice_and_video_note_messages"` - // 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; may be null for bots - Bio *FormattedText `json:"bio"` - // The list of available options for gifting Telegram Premium to the user - PremiumGiftOptions []*PremiumPaymentOption `json:"premium_gift_options"` - // 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, information about the bot; may be null - BotInfo *BotInfo `json:"bot_info"` -} - -func (entity *UserFullInfo) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UserFullInfo - - return json.Marshal((*stub)(entity)) -} - -func (*UserFullInfo) GetClass() string { - return ClassUserFullInfo -} - -func (*UserFullInfo) GetType() string { - return TypeUserFullInfo -} - -// Represents a list of users -type Users struct { - meta - // Approximate total number of users found - TotalCount int32 `json:"total_count"` - // A list of user identifiers - UserIds []int64 `json:"user_ids"` -} - -func (entity *Users) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub Users - - return json.Marshal((*stub)(entity)) -} - -func (*Users) GetClass() string { - return ClassUsers -} - -func (*Users) GetType() string { - return TypeUsers -} - -// Contains information about a chat administrator -type ChatAdministrator struct { - 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"` -} - -func (entity *ChatAdministrator) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatAdministrator - - return json.Marshal((*stub)(entity)) -} - -func (*ChatAdministrator) GetClass() string { - return ClassChatAdministrator -} - -func (*ChatAdministrator) GetType() string { - return TypeChatAdministrator -} - -// Represents a list of chat administrators -type ChatAdministrators struct { - meta - // A list of chat administrators - Administrators []*ChatAdministrator `json:"administrators"` -} - -func (entity *ChatAdministrators) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatAdministrators - - return json.Marshal((*stub)(entity)) -} - -func (*ChatAdministrators) GetClass() string { - return ClassChatAdministrators -} - -func (*ChatAdministrators) GetType() string { - return TypeChatAdministrators -} - -// The user is the owner of the chat and has all the administrator privileges -type ChatMemberStatusCreator struct { - 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"` -} - -func (entity *ChatMemberStatusCreator) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatMemberStatusCreator - - return json.Marshal((*stub)(entity)) -} - -func (*ChatMemberStatusCreator) GetClass() string { - return ClassChatMemberStatus -} - -func (*ChatMemberStatusCreator) GetType() string { - return TypeChatMemberStatusCreator -} - -func (*ChatMemberStatusCreator) ChatMemberStatusType() string { - return TypeChatMemberStatusCreator -} - -// 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 -type ChatMemberStatusAdministrator struct { - 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"` - // Rights of the administrator - Rights *ChatAdministratorRights `json:"rights"` -} - -func (entity *ChatMemberStatusAdministrator) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatMemberStatusAdministrator - - return json.Marshal((*stub)(entity)) -} - -func (*ChatMemberStatusAdministrator) GetClass() string { - return ClassChatMemberStatus -} - -func (*ChatMemberStatusAdministrator) GetType() string { - return TypeChatMemberStatusAdministrator -} - -func (*ChatMemberStatusAdministrator) ChatMemberStatusType() string { - return TypeChatMemberStatusAdministrator -} - -// The user is a member of the chat, without any additional privileges or restrictions -type ChatMemberStatusMember struct { - meta -} - -func (entity *ChatMemberStatusMember) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatMemberStatusMember - - return json.Marshal((*stub)(entity)) -} - -func (*ChatMemberStatusMember) GetClass() string { - return ClassChatMemberStatus -} - -func (*ChatMemberStatusMember) GetType() string { - return TypeChatMemberStatusMember -} - -func (*ChatMemberStatusMember) ChatMemberStatusType() string { - return TypeChatMemberStatusMember -} - -// The user is under certain restrictions in the chat. Not supported in basic groups and channels -type ChatMemberStatusRestricted struct { - 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"` -} - -func (entity *ChatMemberStatusRestricted) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatMemberStatusRestricted - - return json.Marshal((*stub)(entity)) -} - -func (*ChatMemberStatusRestricted) GetClass() string { - return ClassChatMemberStatus -} - -func (*ChatMemberStatusRestricted) GetType() string { - return TypeChatMemberStatusRestricted -} - -func (*ChatMemberStatusRestricted) ChatMemberStatusType() string { - return TypeChatMemberStatusRestricted -} - -// The user or the chat is not a chat member -type ChatMemberStatusLeft struct { - meta -} - -func (entity *ChatMemberStatusLeft) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatMemberStatusLeft - - return json.Marshal((*stub)(entity)) -} - -func (*ChatMemberStatusLeft) GetClass() string { - return ClassChatMemberStatus -} - -func (*ChatMemberStatusLeft) GetType() string { - return TypeChatMemberStatusLeft -} - -func (*ChatMemberStatusLeft) ChatMemberStatusType() string { - return TypeChatMemberStatusLeft -} - -// 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 -type ChatMemberStatusBanned struct { - 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"` -} - -func (entity *ChatMemberStatusBanned) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatMemberStatusBanned - - return json.Marshal((*stub)(entity)) -} - -func (*ChatMemberStatusBanned) GetClass() string { - return ClassChatMemberStatus -} - -func (*ChatMemberStatusBanned) GetType() string { - return TypeChatMemberStatusBanned -} - -func (*ChatMemberStatusBanned) ChatMemberStatusType() string { - return TypeChatMemberStatusBanned -} - -// Describes a user or a chat as a member of another chat -type ChatMember struct { - 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/was promoted/was banned in the chat - JoinedChatDate int32 `json:"joined_chat_date"` - // Status of the member in the chat - Status ChatMemberStatus `json:"status"` -} - -func (entity *ChatMember) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatMember - - return json.Marshal((*stub)(entity)) -} - -func (*ChatMember) GetClass() string { - return ClassChatMember -} - -func (*ChatMember) GetType() string { - return TypeChatMember -} - -func (chatMember *ChatMember) UnmarshalJSON(data []byte) error { - 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"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - chatMember.InviterUserId = tmp.InviterUserId - chatMember.JoinedChatDate = tmp.JoinedChatDate - - fieldMemberId, _ := UnmarshalMessageSender(tmp.MemberId) - chatMember.MemberId = fieldMemberId - - fieldStatus, _ := UnmarshalChatMemberStatus(tmp.Status) - chatMember.Status = fieldStatus - - return nil -} - -// Contains a list of chat members -type ChatMembers struct { - meta - // Approximate total number of chat members found - TotalCount int32 `json:"total_count"` - // A list of chat members - Members []*ChatMember `json:"members"` -} - -func (entity *ChatMembers) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatMembers - - return json.Marshal((*stub)(entity)) -} - -func (*ChatMembers) GetClass() string { - return ClassChatMembers -} - -func (*ChatMembers) GetType() string { - return TypeChatMembers -} - -// Returns contacts of the user -type ChatMembersFilterContacts struct { - meta -} - -func (entity *ChatMembersFilterContacts) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatMembersFilterContacts - - return json.Marshal((*stub)(entity)) -} - -func (*ChatMembersFilterContacts) GetClass() string { - return ClassChatMembersFilter -} - -func (*ChatMembersFilterContacts) GetType() string { - return TypeChatMembersFilterContacts -} - -func (*ChatMembersFilterContacts) ChatMembersFilterType() string { - return TypeChatMembersFilterContacts -} - -// Returns the owner and administrators -type ChatMembersFilterAdministrators struct { - meta -} - -func (entity *ChatMembersFilterAdministrators) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatMembersFilterAdministrators - - return json.Marshal((*stub)(entity)) -} - -func (*ChatMembersFilterAdministrators) GetClass() string { - return ClassChatMembersFilter -} - -func (*ChatMembersFilterAdministrators) GetType() string { - return TypeChatMembersFilterAdministrators -} - -func (*ChatMembersFilterAdministrators) ChatMembersFilterType() string { - return TypeChatMembersFilterAdministrators -} - -// Returns all chat members, including restricted chat members -type ChatMembersFilterMembers struct { - meta -} - -func (entity *ChatMembersFilterMembers) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatMembersFilterMembers - - return json.Marshal((*stub)(entity)) -} - -func (*ChatMembersFilterMembers) GetClass() string { - return ClassChatMembersFilter -} - -func (*ChatMembersFilterMembers) GetType() string { - return TypeChatMembersFilterMembers -} - -func (*ChatMembersFilterMembers) ChatMembersFilterType() string { - return TypeChatMembersFilterMembers -} - -// Returns users which can be mentioned in the chat -type ChatMembersFilterMention struct { - meta - // If non-zero, the identifier of the current message thread - MessageThreadId int64 `json:"message_thread_id"` -} - -func (entity *ChatMembersFilterMention) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatMembersFilterMention - - return json.Marshal((*stub)(entity)) -} - -func (*ChatMembersFilterMention) GetClass() string { - return ClassChatMembersFilter -} - -func (*ChatMembersFilterMention) GetType() string { - return TypeChatMembersFilterMention -} - -func (*ChatMembersFilterMention) ChatMembersFilterType() string { - return TypeChatMembersFilterMention -} - -// Returns users under certain restrictions in the chat; can be used only by administrators in a supergroup -type ChatMembersFilterRestricted struct { - meta -} - -func (entity *ChatMembersFilterRestricted) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatMembersFilterRestricted - - return json.Marshal((*stub)(entity)) -} - -func (*ChatMembersFilterRestricted) GetClass() string { - return ClassChatMembersFilter -} - -func (*ChatMembersFilterRestricted) GetType() string { - return TypeChatMembersFilterRestricted -} - -func (*ChatMembersFilterRestricted) ChatMembersFilterType() string { - return TypeChatMembersFilterRestricted -} - -// Returns users banned from the chat; can be used only by administrators in a supergroup or in a channel -type ChatMembersFilterBanned struct { - meta -} - -func (entity *ChatMembersFilterBanned) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatMembersFilterBanned - - return json.Marshal((*stub)(entity)) -} - -func (*ChatMembersFilterBanned) GetClass() string { - return ClassChatMembersFilter -} - -func (*ChatMembersFilterBanned) GetType() string { - return TypeChatMembersFilterBanned -} - -func (*ChatMembersFilterBanned) ChatMembersFilterType() string { - return TypeChatMembersFilterBanned -} - -// Returns bot members of the chat -type ChatMembersFilterBots struct { - meta -} - -func (entity *ChatMembersFilterBots) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatMembersFilterBots - - return json.Marshal((*stub)(entity)) -} - -func (*ChatMembersFilterBots) GetClass() string { - return ClassChatMembersFilter -} - -func (*ChatMembersFilterBots) GetType() string { - return TypeChatMembersFilterBots -} - -func (*ChatMembersFilterBots) ChatMembersFilterType() string { - return TypeChatMembersFilterBots -} - -// Returns recently active users in reverse chronological order -type SupergroupMembersFilterRecent struct { - meta -} - -func (entity *SupergroupMembersFilterRecent) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub SupergroupMembersFilterRecent - - return json.Marshal((*stub)(entity)) -} - -func (*SupergroupMembersFilterRecent) GetClass() string { - return ClassSupergroupMembersFilter -} - -func (*SupergroupMembersFilterRecent) GetType() string { - return TypeSupergroupMembersFilterRecent -} - -func (*SupergroupMembersFilterRecent) SupergroupMembersFilterType() string { - return TypeSupergroupMembersFilterRecent -} - -// Returns contacts of the user, which are members of the supergroup or channel -type SupergroupMembersFilterContacts struct { - meta - // Query to search for - Query string `json:"query"` -} - -func (entity *SupergroupMembersFilterContacts) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub SupergroupMembersFilterContacts - - return json.Marshal((*stub)(entity)) -} - -func (*SupergroupMembersFilterContacts) GetClass() string { - return ClassSupergroupMembersFilter -} - -func (*SupergroupMembersFilterContacts) GetType() string { - return TypeSupergroupMembersFilterContacts -} - -func (*SupergroupMembersFilterContacts) SupergroupMembersFilterType() string { - return TypeSupergroupMembersFilterContacts -} - -// Returns the owner and administrators -type SupergroupMembersFilterAdministrators struct { - meta -} - -func (entity *SupergroupMembersFilterAdministrators) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub SupergroupMembersFilterAdministrators - - return json.Marshal((*stub)(entity)) -} - -func (*SupergroupMembersFilterAdministrators) GetClass() string { - return ClassSupergroupMembersFilter -} - -func (*SupergroupMembersFilterAdministrators) GetType() string { - return TypeSupergroupMembersFilterAdministrators -} - -func (*SupergroupMembersFilterAdministrators) SupergroupMembersFilterType() string { - return TypeSupergroupMembersFilterAdministrators -} - -// Used to search for supergroup or channel members via a (string) query -type SupergroupMembersFilterSearch struct { - meta - // Query to search for - Query string `json:"query"` -} - -func (entity *SupergroupMembersFilterSearch) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub SupergroupMembersFilterSearch - - return json.Marshal((*stub)(entity)) -} - -func (*SupergroupMembersFilterSearch) GetClass() string { - return ClassSupergroupMembersFilter -} - -func (*SupergroupMembersFilterSearch) GetType() string { - return TypeSupergroupMembersFilterSearch -} - -func (*SupergroupMembersFilterSearch) SupergroupMembersFilterType() string { - return TypeSupergroupMembersFilterSearch -} - -// Returns restricted supergroup members; can be used only by administrators -type SupergroupMembersFilterRestricted struct { - meta - // Query to search for - Query string `json:"query"` -} - -func (entity *SupergroupMembersFilterRestricted) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub SupergroupMembersFilterRestricted - - return json.Marshal((*stub)(entity)) -} - -func (*SupergroupMembersFilterRestricted) GetClass() string { - return ClassSupergroupMembersFilter -} - -func (*SupergroupMembersFilterRestricted) GetType() string { - return TypeSupergroupMembersFilterRestricted -} - -func (*SupergroupMembersFilterRestricted) SupergroupMembersFilterType() string { - return TypeSupergroupMembersFilterRestricted -} - -// Returns users banned from the supergroup or channel; can be used only by administrators -type SupergroupMembersFilterBanned struct { - meta - // Query to search for - Query string `json:"query"` -} - -func (entity *SupergroupMembersFilterBanned) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub SupergroupMembersFilterBanned - - return json.Marshal((*stub)(entity)) -} - -func (*SupergroupMembersFilterBanned) GetClass() string { - return ClassSupergroupMembersFilter -} - -func (*SupergroupMembersFilterBanned) GetType() string { - return TypeSupergroupMembersFilterBanned -} - -func (*SupergroupMembersFilterBanned) SupergroupMembersFilterType() string { - return TypeSupergroupMembersFilterBanned -} - -// Returns users which can be mentioned in the supergroup -type SupergroupMembersFilterMention struct { - 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"` -} - -func (entity *SupergroupMembersFilterMention) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub SupergroupMembersFilterMention - - return json.Marshal((*stub)(entity)) -} - -func (*SupergroupMembersFilterMention) GetClass() string { - return ClassSupergroupMembersFilter -} - -func (*SupergroupMembersFilterMention) GetType() string { - return TypeSupergroupMembersFilterMention -} - -func (*SupergroupMembersFilterMention) SupergroupMembersFilterType() string { - return TypeSupergroupMembersFilterMention -} - -// Returns bot members of the supergroup or channel -type SupergroupMembersFilterBots struct { - meta -} - -func (entity *SupergroupMembersFilterBots) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub SupergroupMembersFilterBots - - return json.Marshal((*stub)(entity)) -} - -func (*SupergroupMembersFilterBots) GetClass() string { - return ClassSupergroupMembersFilter -} - -func (*SupergroupMembersFilterBots) GetType() string { - return TypeSupergroupMembersFilterBots -} - -func (*SupergroupMembersFilterBots) SupergroupMembersFilterType() string { - return TypeSupergroupMembersFilterBots -} - -// Contains a chat invite link -type ChatInviteLink struct { - 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"` -} - -func (entity *ChatInviteLink) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatInviteLink - - return json.Marshal((*stub)(entity)) -} - -func (*ChatInviteLink) GetClass() string { - return ClassChatInviteLink -} - -func (*ChatInviteLink) GetType() string { - return TypeChatInviteLink -} - -// Contains a list of chat invite links -type ChatInviteLinks struct { - meta - // Approximate total number of chat invite links found - TotalCount int32 `json:"total_count"` - // List of invite links - InviteLinks []*ChatInviteLink `json:"invite_links"` -} - -func (entity *ChatInviteLinks) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatInviteLinks - - return json.Marshal((*stub)(entity)) -} - -func (*ChatInviteLinks) GetClass() string { - return ClassChatInviteLinks -} - -func (*ChatInviteLinks) GetType() string { - return TypeChatInviteLinks -} - -// Describes a chat administrator with a number of active and revoked chat invite links -type ChatInviteLinkCount struct { - 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"` -} - -func (entity *ChatInviteLinkCount) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatInviteLinkCount - - return json.Marshal((*stub)(entity)) -} - -func (*ChatInviteLinkCount) GetClass() string { - return ClassChatInviteLinkCount -} - -func (*ChatInviteLinkCount) GetType() string { - return TypeChatInviteLinkCount -} - -// Contains a list of chat invite link counts -type ChatInviteLinkCounts struct { - meta - // List of invite link counts - InviteLinkCounts []*ChatInviteLinkCount `json:"invite_link_counts"` -} - -func (entity *ChatInviteLinkCounts) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatInviteLinkCounts - - return json.Marshal((*stub)(entity)) -} - -func (*ChatInviteLinkCounts) GetClass() string { - return ClassChatInviteLinkCounts -} - -func (*ChatInviteLinkCounts) GetType() string { - return TypeChatInviteLinkCounts -} - -// Describes a chat member joined a chat via an invite link -type ChatInviteLinkMember struct { - 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"` -} - -func (entity *ChatInviteLinkMember) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatInviteLinkMember - - return json.Marshal((*stub)(entity)) -} - -func (*ChatInviteLinkMember) GetClass() string { - return ClassChatInviteLinkMember -} - -func (*ChatInviteLinkMember) GetType() string { - return TypeChatInviteLinkMember -} - -// Contains a list of chat members joined a chat via an invite link -type ChatInviteLinkMembers struct { - 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"` -} - -func (entity *ChatInviteLinkMembers) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatInviteLinkMembers - - return json.Marshal((*stub)(entity)) -} - -func (*ChatInviteLinkMembers) GetClass() string { - return ClassChatInviteLinkMembers -} - -func (*ChatInviteLinkMembers) GetType() string { - return TypeChatInviteLinkMembers -} - -// Contains information about a chat invite link -type ChatInviteLinkInfo struct { - 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"` -} - -func (entity *ChatInviteLinkInfo) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatInviteLinkInfo - - return json.Marshal((*stub)(entity)) -} - -func (*ChatInviteLinkInfo) GetClass() string { - return ClassChatInviteLinkInfo -} - -func (*ChatInviteLinkInfo) GetType() string { - return TypeChatInviteLinkInfo -} - -func (chatInviteLinkInfo *ChatInviteLinkInfo) UnmarshalJSON(data []byte) error { - 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 -} - -// Describes a user that sent a join request and waits for administrator approval -type ChatJoinRequest struct { - 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"` -} - -func (entity *ChatJoinRequest) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatJoinRequest - - return json.Marshal((*stub)(entity)) -} - -func (*ChatJoinRequest) GetClass() string { - return ClassChatJoinRequest -} - -func (*ChatJoinRequest) GetType() string { - return TypeChatJoinRequest -} - -// Contains a list of requests to join a chat -type ChatJoinRequests struct { - meta - // Approximate total number of requests found - TotalCount int32 `json:"total_count"` - // List of the requests - Requests []*ChatJoinRequest `json:"requests"` -} - -func (entity *ChatJoinRequests) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatJoinRequests - - return json.Marshal((*stub)(entity)) -} - -func (*ChatJoinRequests) GetClass() string { - return ClassChatJoinRequests -} - -func (*ChatJoinRequests) GetType() string { - return TypeChatJoinRequests -} - -// Contains information about pending join requests for a chat -type ChatJoinRequestsInfo struct { - 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"` -} - -func (entity *ChatJoinRequestsInfo) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatJoinRequestsInfo - - return json.Marshal((*stub)(entity)) -} - -func (*ChatJoinRequestsInfo) GetClass() string { - return ClassChatJoinRequestsInfo -} - -func (*ChatJoinRequestsInfo) GetType() string { - return TypeChatJoinRequestsInfo -} - -// Represents a basic group of 0-200 users (must be upgraded to a supergroup to accommodate more than 200 users) -type BasicGroup struct { - meta - // Group identifier - Id int64 `json:"id"` - // 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"` -} - -func (entity *BasicGroup) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub BasicGroup - - return json.Marshal((*stub)(entity)) -} - -func (*BasicGroup) GetClass() string { - return ClassBasicGroup -} - -func (*BasicGroup) GetType() string { - return TypeBasicGroup -} - -func (basicGroup *BasicGroup) UnmarshalJSON(data []byte) error { - var tmp struct { - Id int64 `json:"id"` - MemberCount int32 `json:"member_count"` - Status json.RawMessage `json:"status"` - IsActive bool `json:"is_active"` - UpgradedToSupergroupId int64 `json:"upgraded_to_supergroup_id"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - basicGroup.Id = tmp.Id - basicGroup.MemberCount = tmp.MemberCount - basicGroup.IsActive = tmp.IsActive - basicGroup.UpgradedToSupergroupId = tmp.UpgradedToSupergroupId - - fieldStatus, _ := UnmarshalChatMemberStatus(tmp.Status) - basicGroup.Status = fieldStatus - - return nil -} - -// Contains full information about a basic group -type BasicGroupFullInfo struct { - meta - // Chat photo; may be null if empty or unknown. If non-null, then it is the same photo as in chat.photo - 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"` - // True, if non-administrators and non-bots can be hidden in responses to getSupergroupMembers and searchChatMembers for non-administrators after upgrading the basic group to a supergroup - CanHideMembers bool `json:"can_hide_members"` - // True, if aggressive anti-spam checks can be enabled or disabled in the supergroup after upgrading the basic group to a supergroup - CanToggleAggressiveAntiSpam bool `json:"can_toggle_aggressive_anti_spam"` - // 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"` -} - -func (entity *BasicGroupFullInfo) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub BasicGroupFullInfo - - return json.Marshal((*stub)(entity)) -} - -func (*BasicGroupFullInfo) GetClass() string { - return ClassBasicGroupFullInfo -} - -func (*BasicGroupFullInfo) GetType() string { - return TypeBasicGroupFullInfo -} - -// 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 { - meta - // Supergroup or channel identifier - Id int64 `json:"id"` - // Usernames of the supergroup or channel; may be null - Usernames *Usernames `json:"usernames"` - // 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 always be 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 users need to join the supergroup before they can send messages. Always true for channels and non-discussion supergroups - JoinToSendMessages bool `json:"join_to_send_messages"` - // True, if all users directly joining the supergroup need to be approved by supergroup administrators. Always false for channels and supergroups without username, location, or a linked chat - JoinByRequest bool `json:"join_by_request"` - // 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 must be shown as a forum by default - IsForum bool `json:"is_forum"` - // 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"` -} - -func (entity *Supergroup) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub Supergroup - - return json.Marshal((*stub)(entity)) -} - -func (*Supergroup) GetClass() string { - return ClassSupergroup -} - -func (*Supergroup) GetType() string { - return TypeSupergroup -} - -func (supergroup *Supergroup) UnmarshalJSON(data []byte) error { - var tmp struct { - Id int64 `json:"id"` - Usernames *Usernames `json:"usernames"` - 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"` - JoinToSendMessages bool `json:"join_to_send_messages"` - JoinByRequest bool `json:"join_by_request"` - IsSlowModeEnabled bool `json:"is_slow_mode_enabled"` - IsChannel bool `json:"is_channel"` - IsBroadcastGroup bool `json:"is_broadcast_group"` - IsForum bool `json:"is_forum"` - 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.Usernames = tmp.Usernames - supergroup.Date = tmp.Date - supergroup.MemberCount = tmp.MemberCount - supergroup.HasLinkedChat = tmp.HasLinkedChat - supergroup.HasLocation = tmp.HasLocation - supergroup.SignMessages = tmp.SignMessages - supergroup.JoinToSendMessages = tmp.JoinToSendMessages - supergroup.JoinByRequest = tmp.JoinByRequest - supergroup.IsSlowModeEnabled = tmp.IsSlowModeEnabled - supergroup.IsChannel = tmp.IsChannel - supergroup.IsBroadcastGroup = tmp.IsBroadcastGroup - supergroup.IsForum = tmp.IsForum - 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 -} - -// Contains full information about a supergroup or channel -type SupergroupFullInfo struct { - meta - // Chat photo; may be null if empty or unknown. If non-null, then it is the same photo as in chat.photo - 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 via getSupergroupMembers or searchChatMembers - CanGetMembers bool `json:"can_get_members"` - // True, if non-administrators can receive only administrators and bots using getSupergroupMembers or searchChatMembers - HasHiddenMembers bool `json:"has_hidden_members"` - // True, if non-administrators and non-bots can be hidden in responses to getSupergroupMembers and searchChatMembers for non-administrators - CanHideMembers bool `json:"can_hide_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 aggressive anti-spam checks can be enabled or disabled in the supergroup - CanToggleAggressiveAntiSpam bool `json:"can_toggle_aggressive_anti_spam"` - // True, if new chat members will have access to old messages. In public, discussion, of forum groups and all channels, old messages are always available, so this option affects only private non-forum supergroups without a linked chat. The value of this field is only available to chat administrators - IsAllHistoryAvailable bool `json:"is_all_history_available"` - // True, if aggressive anti-spam checks are enabled in the supergroup. The value of this field is only available to chat administrators - HasAggressiveAntiSpamEnabled bool `json:"has_aggressive_anti_spam_enabled"` - // 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"` -} - -func (entity *SupergroupFullInfo) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub SupergroupFullInfo - - return json.Marshal((*stub)(entity)) -} - -func (*SupergroupFullInfo) GetClass() string { - return ClassSupergroupFullInfo -} - -func (*SupergroupFullInfo) GetType() string { - return TypeSupergroupFullInfo -} - -// The secret chat is not yet created; waiting for the other user to get online -type SecretChatStatePending struct { - meta -} - -func (entity *SecretChatStatePending) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub SecretChatStatePending - - return json.Marshal((*stub)(entity)) -} - -func (*SecretChatStatePending) GetClass() string { - return ClassSecretChatState -} - -func (*SecretChatStatePending) GetType() string { - return TypeSecretChatStatePending -} - -func (*SecretChatStatePending) SecretChatStateType() string { - return TypeSecretChatStatePending -} - -// The secret chat is ready to use -type SecretChatStateReady struct { - meta -} - -func (entity *SecretChatStateReady) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub SecretChatStateReady - - return json.Marshal((*stub)(entity)) -} - -func (*SecretChatStateReady) GetClass() string { - return ClassSecretChatState -} - -func (*SecretChatStateReady) GetType() string { - return TypeSecretChatStateReady -} - -func (*SecretChatStateReady) SecretChatStateType() string { - return TypeSecretChatStateReady -} - -// The secret chat is closed -type SecretChatStateClosed struct { - meta -} - -func (entity *SecretChatStateClosed) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub SecretChatStateClosed - - return json.Marshal((*stub)(entity)) -} - -func (*SecretChatStateClosed) GetClass() string { - return ClassSecretChatState -} - -func (*SecretChatStateClosed) GetType() string { - return TypeSecretChatStateClosed -} - -func (*SecretChatStateClosed) SecretChatStateType() string { - return TypeSecretChatStateClosed -} - -// Represents a secret chat -type SecretChat struct { - 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, files bigger than 2000MB are supported if the layer >= 143, spoiler and custom emoji text entities are supported if the layer >= 144 - Layer int32 `json:"layer"` -} - -func (entity *SecretChat) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub SecretChat - - return json.Marshal((*stub)(entity)) -} - -func (*SecretChat) GetClass() string { - return ClassSecretChat -} - -func (*SecretChat) GetType() string { - return TypeSecretChat -} - -func (secretChat *SecretChat) UnmarshalJSON(data []byte) error { - 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"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - secretChat.Id = tmp.Id - secretChat.UserId = tmp.UserId - secretChat.IsOutbound = tmp.IsOutbound - secretChat.KeyHash = tmp.KeyHash - secretChat.Layer = tmp.Layer - - fieldState, _ := UnmarshalSecretChatState(tmp.State) - secretChat.State = fieldState - - return nil -} - -// The message was sent by a known user -type MessageSenderUser struct { - meta - // Identifier of the user that sent the message - UserId int64 `json:"user_id"` -} - -func (entity *MessageSenderUser) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageSenderUser - - return json.Marshal((*stub)(entity)) -} - -func (*MessageSenderUser) GetClass() string { - return ClassMessageSender -} - -func (*MessageSenderUser) GetType() string { - return TypeMessageSenderUser -} - -func (*MessageSenderUser) MessageSenderType() string { - return TypeMessageSenderUser -} - -// The message was sent on behalf of a chat -type MessageSenderChat struct { - meta - // Identifier of the chat that sent the message - ChatId int64 `json:"chat_id"` -} - -func (entity *MessageSenderChat) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageSenderChat - - return json.Marshal((*stub)(entity)) -} - -func (*MessageSenderChat) GetClass() string { - return ClassMessageSender -} - -func (*MessageSenderChat) GetType() string { - return TypeMessageSenderChat -} - -func (*MessageSenderChat) MessageSenderType() string { - return TypeMessageSenderChat -} - -// Represents a list of message senders -type MessageSenders struct { - meta - // Approximate total number of messages senders found - TotalCount int32 `json:"total_count"` - // List of message senders - Senders []MessageSender `json:"senders"` -} - -func (entity *MessageSenders) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageSenders - - return json.Marshal((*stub)(entity)) -} - -func (*MessageSenders) GetClass() string { - return ClassMessageSenders -} - -func (*MessageSenders) GetType() string { - return TypeMessageSenders -} - -func (messageSenders *MessageSenders) UnmarshalJSON(data []byte) error { - var tmp struct { - TotalCount int32 `json:"total_count"` - Senders []json.RawMessage `json:"senders"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - messageSenders.TotalCount = tmp.TotalCount - - fieldSenders, _ := UnmarshalListOfMessageSender(tmp.Senders) - messageSenders.Senders = fieldSenders - - return nil -} - -// Represents a message sender, which can be used to send messages in a chat -type ChatMessageSender struct { - meta - // Available message senders - Sender MessageSender `json:"sender"` - // True, if Telegram Premium is needed to use the message sender - NeedsPremium bool `json:"needs_premium"` -} - -func (entity *ChatMessageSender) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatMessageSender - - return json.Marshal((*stub)(entity)) -} - -func (*ChatMessageSender) GetClass() string { - return ClassChatMessageSender -} - -func (*ChatMessageSender) GetType() string { - return TypeChatMessageSender -} - -func (chatMessageSender *ChatMessageSender) UnmarshalJSON(data []byte) error { - var tmp struct { - Sender json.RawMessage `json:"sender"` - NeedsPremium bool `json:"needs_premium"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - chatMessageSender.NeedsPremium = tmp.NeedsPremium - - fieldSender, _ := UnmarshalMessageSender(tmp.Sender) - chatMessageSender.Sender = fieldSender - - return nil -} - -// Represents a list of message senders, which can be used to send messages in a chat -type ChatMessageSenders struct { - meta - // List of available message senders - Senders []*ChatMessageSender `json:"senders"` -} - -func (entity *ChatMessageSenders) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatMessageSenders - - return json.Marshal((*stub)(entity)) -} - -func (*ChatMessageSenders) GetClass() string { - return ClassChatMessageSenders -} - -func (*ChatMessageSenders) GetType() string { - return TypeChatMessageSenders -} - -// The message was originally sent by a known user -type MessageForwardOriginUser struct { - meta - // Identifier of the user that originally sent the message - SenderUserId int64 `json:"sender_user_id"` -} - -func (entity *MessageForwardOriginUser) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageForwardOriginUser - - return json.Marshal((*stub)(entity)) -} - -func (*MessageForwardOriginUser) GetClass() string { - return ClassMessageForwardOrigin -} - -func (*MessageForwardOriginUser) GetType() string { - return TypeMessageForwardOriginUser -} - -func (*MessageForwardOriginUser) MessageForwardOriginType() string { - return TypeMessageForwardOriginUser -} - -// The message was originally sent on behalf of a chat -type MessageForwardOriginChat struct { - 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"` -} - -func (entity *MessageForwardOriginChat) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageForwardOriginChat - - return json.Marshal((*stub)(entity)) -} - -func (*MessageForwardOriginChat) GetClass() string { - return ClassMessageForwardOrigin -} - -func (*MessageForwardOriginChat) GetType() string { - return TypeMessageForwardOriginChat -} - -func (*MessageForwardOriginChat) MessageForwardOriginType() string { - return TypeMessageForwardOriginChat -} - -// The message was originally sent by a user, which is hidden by their privacy settings -type MessageForwardOriginHiddenUser struct { - meta - // Name of the sender - SenderName string `json:"sender_name"` -} - -func (entity *MessageForwardOriginHiddenUser) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageForwardOriginHiddenUser - - return json.Marshal((*stub)(entity)) -} - -func (*MessageForwardOriginHiddenUser) GetClass() string { - return ClassMessageForwardOrigin -} - -func (*MessageForwardOriginHiddenUser) GetType() string { - return TypeMessageForwardOriginHiddenUser -} - -func (*MessageForwardOriginHiddenUser) MessageForwardOriginType() string { - return TypeMessageForwardOriginHiddenUser -} - -// The message was originally a post in a channel -type MessageForwardOriginChannel struct { - 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"` -} - -func (entity *MessageForwardOriginChannel) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageForwardOriginChannel - - return json.Marshal((*stub)(entity)) -} - -func (*MessageForwardOriginChannel) GetClass() string { - return ClassMessageForwardOrigin -} - -func (*MessageForwardOriginChannel) GetType() string { - return TypeMessageForwardOriginChannel -} - -func (*MessageForwardOriginChannel) MessageForwardOriginType() string { - return TypeMessageForwardOriginChannel -} - -// The message was imported from an exported message history -type MessageForwardOriginMessageImport struct { - meta - // Name of the sender - SenderName string `json:"sender_name"` -} - -func (entity *MessageForwardOriginMessageImport) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageForwardOriginMessageImport - - return json.Marshal((*stub)(entity)) -} - -func (*MessageForwardOriginMessageImport) GetClass() string { - return ClassMessageForwardOrigin -} - -func (*MessageForwardOriginMessageImport) GetType() string { - return TypeMessageForwardOriginMessageImport -} - -func (*MessageForwardOriginMessageImport) MessageForwardOriginType() string { - return TypeMessageForwardOriginMessageImport -} - -// A reaction with an emoji -type ReactionTypeEmoji struct { - meta - // Text representation of the reaction - Emoji string `json:"emoji"` -} - -func (entity *ReactionTypeEmoji) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ReactionTypeEmoji - - return json.Marshal((*stub)(entity)) -} - -func (*ReactionTypeEmoji) GetClass() string { - return ClassReactionType -} - -func (*ReactionTypeEmoji) GetType() string { - return TypeReactionTypeEmoji -} - -func (*ReactionTypeEmoji) ReactionTypeType() string { - return TypeReactionTypeEmoji -} - -// A reaction with a custom emoji -type ReactionTypeCustomEmoji struct { - meta - // Unique identifier of the custom emoji - CustomEmojiId JsonInt64 `json:"custom_emoji_id"` -} - -func (entity *ReactionTypeCustomEmoji) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ReactionTypeCustomEmoji - - return json.Marshal((*stub)(entity)) -} - -func (*ReactionTypeCustomEmoji) GetClass() string { - return ClassReactionType -} - -func (*ReactionTypeCustomEmoji) GetType() string { - return TypeReactionTypeCustomEmoji -} - -func (*ReactionTypeCustomEmoji) ReactionTypeType() string { - return TypeReactionTypeCustomEmoji -} - -// Contains information about a forwarded message -type MessageForwardInfo struct { - 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"` -} - -func (entity *MessageForwardInfo) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageForwardInfo - - return json.Marshal((*stub)(entity)) -} - -func (*MessageForwardInfo) GetClass() string { - return ClassMessageForwardInfo -} - -func (*MessageForwardInfo) GetType() string { - return TypeMessageForwardInfo -} - -func (messageForwardInfo *MessageForwardInfo) UnmarshalJSON(data []byte) error { - 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"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - messageForwardInfo.Date = tmp.Date - messageForwardInfo.PublicServiceAnnouncementType = tmp.PublicServiceAnnouncementType - messageForwardInfo.FromChatId = tmp.FromChatId - messageForwardInfo.FromMessageId = tmp.FromMessageId - - fieldOrigin, _ := UnmarshalMessageForwardOrigin(tmp.Origin) - messageForwardInfo.Origin = fieldOrigin - - return nil -} - -// Contains information about replies to a message -type MessageReplyInfo struct { - 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"` -} - -func (entity *MessageReplyInfo) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageReplyInfo - - return json.Marshal((*stub)(entity)) -} - -func (*MessageReplyInfo) GetClass() string { - return ClassMessageReplyInfo -} - -func (*MessageReplyInfo) GetType() string { - return TypeMessageReplyInfo -} - -func (messageReplyInfo *MessageReplyInfo) UnmarshalJSON(data []byte) error { - 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"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - messageReplyInfo.ReplyCount = tmp.ReplyCount - messageReplyInfo.LastReadInboxMessageId = tmp.LastReadInboxMessageId - messageReplyInfo.LastReadOutboxMessageId = tmp.LastReadOutboxMessageId - messageReplyInfo.LastMessageId = tmp.LastMessageId - - fieldRecentReplierIds, _ := UnmarshalListOfMessageSender(tmp.RecentReplierIds) - messageReplyInfo.RecentReplierIds = fieldRecentReplierIds - - return nil -} - -// Contains information about a reaction to a message -type MessageReaction struct { - meta - // Type of the reaction - Type ReactionType `json:"type"` - // 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, basic group and supergroup chats - RecentSenderIds []MessageSender `json:"recent_sender_ids"` -} - -func (entity *MessageReaction) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageReaction - - return json.Marshal((*stub)(entity)) -} - -func (*MessageReaction) GetClass() string { - return ClassMessageReaction -} - -func (*MessageReaction) GetType() string { - return TypeMessageReaction -} - -func (messageReaction *MessageReaction) UnmarshalJSON(data []byte) error { - var tmp struct { - Type json.RawMessage `json:"type"` - TotalCount int32 `json:"total_count"` - IsChosen bool `json:"is_chosen"` - RecentSenderIds []json.RawMessage `json:"recent_sender_ids"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - messageReaction.TotalCount = tmp.TotalCount - messageReaction.IsChosen = tmp.IsChosen - - fieldType, _ := UnmarshalReactionType(tmp.Type) - messageReaction.Type = fieldType - - fieldRecentSenderIds, _ := UnmarshalListOfMessageSender(tmp.RecentSenderIds) - messageReaction.RecentSenderIds = fieldRecentSenderIds - - return nil -} - -// Contains information about interactions with a message -type MessageInteractionInfo struct { - 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"` -} - -func (entity *MessageInteractionInfo) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageInteractionInfo - - return json.Marshal((*stub)(entity)) -} - -func (*MessageInteractionInfo) GetClass() string { - return ClassMessageInteractionInfo -} - -func (*MessageInteractionInfo) GetType() string { - return TypeMessageInteractionInfo -} - -// Contains information about an unread reaction to a message -type UnreadReaction struct { - meta - // Type of the reaction - Type ReactionType `json:"type"` - // 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"` -} - -func (entity *UnreadReaction) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UnreadReaction - - return json.Marshal((*stub)(entity)) -} - -func (*UnreadReaction) GetClass() string { - return ClassUnreadReaction -} - -func (*UnreadReaction) GetType() string { - return TypeUnreadReaction -} - -func (unreadReaction *UnreadReaction) UnmarshalJSON(data []byte) error { - var tmp struct { - Type json.RawMessage `json:"type"` - SenderId json.RawMessage `json:"sender_id"` - IsBig bool `json:"is_big"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - unreadReaction.IsBig = tmp.IsBig - - fieldType, _ := UnmarshalReactionType(tmp.Type) - unreadReaction.Type = fieldType - - fieldSenderId, _ := UnmarshalMessageSender(tmp.SenderId) - unreadReaction.SenderId = fieldSenderId - - return nil -} - -// The message is being sent now, but has not yet been delivered to the server -type MessageSendingStatePending struct { - meta -} - -func (entity *MessageSendingStatePending) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageSendingStatePending - - return json.Marshal((*stub)(entity)) -} - -func (*MessageSendingStatePending) GetClass() string { - return ClassMessageSendingState -} - -func (*MessageSendingStatePending) GetType() string { - return TypeMessageSendingStatePending -} - -func (*MessageSendingStatePending) MessageSendingStateType() string { - return TypeMessageSendingStatePending -} - -// The message failed to be sent -type MessageSendingStateFailed struct { - 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"` -} - -func (entity *MessageSendingStateFailed) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageSendingStateFailed - - return json.Marshal((*stub)(entity)) -} - -func (*MessageSendingStateFailed) GetClass() string { - return ClassMessageSendingState -} - -func (*MessageSendingStateFailed) GetType() string { - return TypeMessageSendingStateFailed -} - -func (*MessageSendingStateFailed) MessageSendingStateType() string { - return TypeMessageSendingStateFailed -} - -// Describes a message -type Message struct { - 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 and getMessageThreadHistory - 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 reactions on the message can be reported through reportMessageReactions - CanReportReactions bool `json:"can_report_reactions"` - // 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 is a forum topic message - IsTopicMessage bool `json:"is_topic_message"` - // 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"` - // The message's self-destruct time, in seconds; 0 if none. TDLib will send updateDeleteMessages or updateMessageContent once the time expires - SelfDestructTime int32 `json:"self_destruct_time"` - // Time left before the message self-destruct timer expires, in seconds. If the self-destruct timer isn't started yet, equals to the value of the self_destruct_time field - SelfDestructIn float64 `json:"self_destruct_in"` - // Time left before the message will be automatically deleted by message_auto_delete_time setting of the chat, in seconds; 0 if never. TDLib will send updateDeleteMessages or updateMessageContent once the time expires - AutoDeleteIn float64 `json:"auto_delete_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"` -} - -func (entity *Message) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub Message - - return json.Marshal((*stub)(entity)) -} - -func (*Message) GetClass() string { - return ClassMessage -} - -func (*Message) GetType() string { - return TypeMessage -} - -func (message *Message) UnmarshalJSON(data []byte) error { - 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"` - CanReportReactions bool `json:"can_report_reactions"` - HasTimestampedMedia bool `json:"has_timestamped_media"` - IsChannelPost bool `json:"is_channel_post"` - IsTopicMessage bool `json:"is_topic_message"` - 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"` - SelfDestructTime int32 `json:"self_destruct_time"` - SelfDestructIn float64 `json:"self_destruct_in"` - AutoDeleteIn float64 `json:"auto_delete_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.CanReportReactions = tmp.CanReportReactions - message.HasTimestampedMedia = tmp.HasTimestampedMedia - message.IsChannelPost = tmp.IsChannelPost - message.IsTopicMessage = tmp.IsTopicMessage - 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.SelfDestructTime = tmp.SelfDestructTime - message.SelfDestructIn = tmp.SelfDestructIn - message.AutoDeleteIn = tmp.AutoDeleteIn - 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 -} - -// Contains a list of messages -type Messages struct { - meta - // Approximate total number of messages found - TotalCount int32 `json:"total_count"` - // List of messages; messages may be null - Messages []*Message `json:"messages"` -} - -func (entity *Messages) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub Messages - - return json.Marshal((*stub)(entity)) -} - -func (*Messages) GetClass() string { - return ClassMessages -} - -func (*Messages) GetType() string { - return TypeMessages -} - -// Contains a list of messages found by a search -type FoundMessages struct { - 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"` -} - -func (entity *FoundMessages) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub FoundMessages - - return json.Marshal((*stub)(entity)) -} - -func (*FoundMessages) GetClass() string { - return ClassFoundMessages -} - -func (*FoundMessages) GetType() string { - return TypeFoundMessages -} - -// Contains a list of messages found by a search in a given chat -type FoundChatMessages struct { - 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 0, there are no more results - NextFromMessageId int64 `json:"next_from_message_id"` -} - -func (entity *FoundChatMessages) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub FoundChatMessages - - return json.Marshal((*stub)(entity)) -} - -func (*FoundChatMessages) GetClass() string { - return ClassFoundChatMessages -} - -func (*FoundChatMessages) GetType() string { - return TypeFoundChatMessages -} - -// Contains information about a message in a specific position -type MessagePosition struct { - 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"` -} - -func (entity *MessagePosition) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessagePosition - - return json.Marshal((*stub)(entity)) -} - -func (*MessagePosition) GetClass() string { - return ClassMessagePosition -} - -func (*MessagePosition) GetType() string { - return TypeMessagePosition -} - -// Contains a list of message positions -type MessagePositions struct { - meta - // Total number of messages found - TotalCount int32 `json:"total_count"` - // List of message positions - Positions []*MessagePosition `json:"positions"` -} - -func (entity *MessagePositions) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessagePositions - - return json.Marshal((*stub)(entity)) -} - -func (*MessagePositions) GetClass() string { - return ClassMessagePositions -} - -func (*MessagePositions) GetType() string { - return TypeMessagePositions -} - -// Contains information about found messages sent on a specific day -type MessageCalendarDay struct { - 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"` -} - -func (entity *MessageCalendarDay) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageCalendarDay - - return json.Marshal((*stub)(entity)) -} - -func (*MessageCalendarDay) GetClass() string { - return ClassMessageCalendarDay -} - -func (*MessageCalendarDay) GetType() string { - return TypeMessageCalendarDay -} - -// Contains information about found messages, split by days according to the option "utc_time_offset" -type MessageCalendar struct { - meta - // Total number of found messages - TotalCount int32 `json:"total_count"` - // Information about messages sent - Days []*MessageCalendarDay `json:"days"` -} - -func (entity *MessageCalendar) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageCalendar - - return json.Marshal((*stub)(entity)) -} - -func (*MessageCalendar) GetClass() string { - return ClassMessageCalendar -} - -func (*MessageCalendar) GetType() string { - return TypeMessageCalendar -} - -// Describes a sponsored message -type SponsoredMessage struct { - meta - // Message identifier; unique for the chat to which the sponsored message belongs among both ordinary and sponsored messages - MessageId int64 `json:"message_id"` - // True, if the message needs to be labeled as "recommended" instead of "sponsored" - IsRecommended bool `json:"is_recommended"` - // 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"` - // True, if the sponsor's chat photo must be shown - ShowChatPhoto bool `json:"show_chat_photo"` - // An internal link to be opened when the sponsored message is clicked; may be null if 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"` -} - -func (entity *SponsoredMessage) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub SponsoredMessage - - return json.Marshal((*stub)(entity)) -} - -func (*SponsoredMessage) GetClass() string { - return ClassSponsoredMessage -} - -func (*SponsoredMessage) GetType() string { - return TypeSponsoredMessage -} - -func (sponsoredMessage *SponsoredMessage) UnmarshalJSON(data []byte) error { - var tmp struct { - MessageId int64 `json:"message_id"` - IsRecommended bool `json:"is_recommended"` - SponsorChatId int64 `json:"sponsor_chat_id"` - SponsorChatInfo *ChatInviteLinkInfo `json:"sponsor_chat_info"` - ShowChatPhoto bool `json:"show_chat_photo"` - Link json.RawMessage `json:"link"` - Content json.RawMessage `json:"content"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - sponsoredMessage.MessageId = tmp.MessageId - sponsoredMessage.IsRecommended = tmp.IsRecommended - sponsoredMessage.SponsorChatId = tmp.SponsorChatId - sponsoredMessage.SponsorChatInfo = tmp.SponsorChatInfo - sponsoredMessage.ShowChatPhoto = tmp.ShowChatPhoto - - fieldLink, _ := UnmarshalInternalLinkType(tmp.Link) - sponsoredMessage.Link = fieldLink - - fieldContent, _ := UnmarshalMessageContent(tmp.Content) - sponsoredMessage.Content = fieldContent - - return nil -} - -// Contains a list of sponsored messages -type SponsoredMessages struct { - meta - // List of sponsored messages - Messages []*SponsoredMessage `json:"messages"` - // The minimum number of messages between shown sponsored messages, or 0 if only one sponsored message must be shown after all ordinary messages - MessagesBetween int32 `json:"messages_between"` -} - -func (entity *SponsoredMessages) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub SponsoredMessages - - return json.Marshal((*stub)(entity)) -} - -func (*SponsoredMessages) GetClass() string { - return ClassSponsoredMessages -} - -func (*SponsoredMessages) GetType() string { - return TypeSponsoredMessages -} - -// 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 -} - -// Notification settings applied to all private and secret chats when the corresponding chat setting has a default value -type NotificationSettingsScopePrivateChats struct { - meta -} - -func (entity *NotificationSettingsScopePrivateChats) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub NotificationSettingsScopePrivateChats - - return json.Marshal((*stub)(entity)) -} - -func (*NotificationSettingsScopePrivateChats) GetClass() string { - return ClassNotificationSettingsScope -} - -func (*NotificationSettingsScopePrivateChats) GetType() string { - return TypeNotificationSettingsScopePrivateChats -} - -func (*NotificationSettingsScopePrivateChats) NotificationSettingsScopeType() string { - return TypeNotificationSettingsScopePrivateChats -} - -// Notification settings applied to all basic group and supergroup chats when the corresponding chat setting has a default value -type NotificationSettingsScopeGroupChats struct { - meta -} - -func (entity *NotificationSettingsScopeGroupChats) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub NotificationSettingsScopeGroupChats - - return json.Marshal((*stub)(entity)) -} - -func (*NotificationSettingsScopeGroupChats) GetClass() string { - return ClassNotificationSettingsScope -} - -func (*NotificationSettingsScopeGroupChats) GetType() string { - return TypeNotificationSettingsScopeGroupChats -} - -func (*NotificationSettingsScopeGroupChats) NotificationSettingsScopeType() string { - return TypeNotificationSettingsScopeGroupChats -} - -// Notification settings applied to all channel chats when the corresponding chat setting has a default value -type NotificationSettingsScopeChannelChats struct { - meta -} - -func (entity *NotificationSettingsScopeChannelChats) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub NotificationSettingsScopeChannelChats - - return json.Marshal((*stub)(entity)) -} - -func (*NotificationSettingsScopeChannelChats) GetClass() string { - return ClassNotificationSettingsScope -} - -func (*NotificationSettingsScopeChannelChats) GetType() string { - return TypeNotificationSettingsScopeChannelChats -} - -func (*NotificationSettingsScopeChannelChats) NotificationSettingsScopeType() string { - return TypeNotificationSettingsScopeChannelChats -} - -// Contains information about notification settings for a chat or a froum topic -type ChatNotificationSettings struct { - meta - // If true, mute_for is ignored and the value for the relevant type of chat or the forum 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, the value for the relevant type of chat or the forum chat is used instead of sound_id - UseDefaultSound bool `json:"use_default_sound"` - // Identifier of the notification sound to be played; 0 if sound is disabled - SoundId JsonInt64 `json:"sound_id"` - // If true, show_preview is ignored and the value for the relevant type of chat or the forum 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 or the forum 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 or the forum 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"` -} - -func (entity *ChatNotificationSettings) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatNotificationSettings - - return json.Marshal((*stub)(entity)) -} - -func (*ChatNotificationSettings) GetClass() string { - return ClassChatNotificationSettings -} - -func (*ChatNotificationSettings) GetType() string { - return TypeChatNotificationSettings -} - -// Contains information about notification settings for several chats -type ScopeNotificationSettings struct { - meta - // Time left before notifications will be unmuted, in seconds - MuteFor int32 `json:"mute_for"` - // Identifier of the notification sound to be played; 0 if sound is disabled - SoundId JsonInt64 `json:"sound_id"` - // 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"` -} - -func (entity *ScopeNotificationSettings) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ScopeNotificationSettings - - return json.Marshal((*stub)(entity)) -} - -func (*ScopeNotificationSettings) GetClass() string { - return ClassScopeNotificationSettings -} - -func (*ScopeNotificationSettings) GetType() string { - return TypeScopeNotificationSettings -} - -// Contains information about a message draft -type DraftMessage struct { - meta - // Identifier of the replied message; 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"` -} - -func (entity *DraftMessage) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub DraftMessage - - return json.Marshal((*stub)(entity)) -} - -func (*DraftMessage) GetClass() string { - return ClassDraftMessage -} - -func (*DraftMessage) GetType() string { - return TypeDraftMessage -} - -func (draftMessage *DraftMessage) UnmarshalJSON(data []byte) error { - var tmp struct { - ReplyToMessageId int64 `json:"reply_to_message_id"` - Date int32 `json:"date"` - InputMessageText json.RawMessage `json:"input_message_text"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - draftMessage.ReplyToMessageId = tmp.ReplyToMessageId - draftMessage.Date = tmp.Date - - fieldInputMessageText, _ := UnmarshalInputMessageContent(tmp.InputMessageText) - draftMessage.InputMessageText = fieldInputMessageText - - return nil -} - -// An ordinary chat with a user -type ChatTypePrivate struct { - meta - // User identifier - UserId int64 `json:"user_id"` -} - -func (entity *ChatTypePrivate) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatTypePrivate - - return json.Marshal((*stub)(entity)) -} - -func (*ChatTypePrivate) GetClass() string { - return ClassChatType -} - -func (*ChatTypePrivate) GetType() string { - return TypeChatTypePrivate -} - -func (*ChatTypePrivate) ChatTypeType() string { - return TypeChatTypePrivate -} - -// A basic group (a chat with 0-200 other users) -type ChatTypeBasicGroup struct { - meta - // Basic group identifier - BasicGroupId int64 `json:"basic_group_id"` -} - -func (entity *ChatTypeBasicGroup) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatTypeBasicGroup - - return json.Marshal((*stub)(entity)) -} - -func (*ChatTypeBasicGroup) GetClass() string { - return ClassChatType -} - -func (*ChatTypeBasicGroup) GetType() string { - return TypeChatTypeBasicGroup -} - -func (*ChatTypeBasicGroup) ChatTypeType() string { - return TypeChatTypeBasicGroup -} - -// A supergroup or channel (with unlimited members) -type ChatTypeSupergroup struct { - meta - // Supergroup or channel identifier - SupergroupId int64 `json:"supergroup_id"` - // True, if the supergroup is a channel - IsChannel bool `json:"is_channel"` -} - -func (entity *ChatTypeSupergroup) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatTypeSupergroup - - return json.Marshal((*stub)(entity)) -} - -func (*ChatTypeSupergroup) GetClass() string { - return ClassChatType -} - -func (*ChatTypeSupergroup) GetType() string { - return TypeChatTypeSupergroup -} - -func (*ChatTypeSupergroup) ChatTypeType() string { - return TypeChatTypeSupergroup -} - -// A secret chat with a user -type ChatTypeSecret struct { - meta - // Secret chat identifier - SecretChatId int32 `json:"secret_chat_id"` - // User identifier of the secret chat peer - UserId int64 `json:"user_id"` -} - -func (entity *ChatTypeSecret) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatTypeSecret - - return json.Marshal((*stub)(entity)) -} - -func (*ChatTypeSecret) GetClass() string { - return ClassChatType -} - -func (*ChatTypeSecret) GetType() string { - return TypeChatTypeSecret -} - -func (*ChatTypeSecret) ChatTypeType() string { - return TypeChatTypeSecret -} - -// Represents a filter of user chats -type ChatFilter struct { - 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", "Airplane", "Book", "Light", "Like", "Money", "Note", "Palette". 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. There can be up to getOption("chat_filter_chosen_chat_count_max") pinned and always included non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium - PinnedChatIds []int64 `json:"pinned_chat_ids"` - // The chat identifiers of always included chats in the filtered chat list. There can be up to getOption("chat_filter_chosen_chat_count_max") pinned and always included non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium - IncludedChatIds []int64 `json:"included_chat_ids"` - // The chat identifiers of always excluded chats in the filtered chat list. There can be up to getOption("chat_filter_chosen_chat_count_max") always excluded non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium - 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"` -} - -func (entity *ChatFilter) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatFilter - - return json.Marshal((*stub)(entity)) -} - -func (*ChatFilter) GetClass() string { - return ClassChatFilter -} - -func (*ChatFilter) GetType() string { - return TypeChatFilter -} - -// Contains basic information about a chat filter -type ChatFilterInfo struct { - 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", "Airplane", "Book", "Light", "Like", "Money", "Note", "Palette" - IconName string `json:"icon_name"` -} - -func (entity *ChatFilterInfo) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatFilterInfo - - return json.Marshal((*stub)(entity)) -} - -func (*ChatFilterInfo) GetClass() string { - return ClassChatFilterInfo -} - -func (*ChatFilterInfo) GetType() string { - return TypeChatFilterInfo -} - -// Describes a recommended chat filter -type RecommendedChatFilter struct { - meta - // The chat filter - Filter *ChatFilter `json:"filter"` - // Chat filter description - Description string `json:"description"` -} - -func (entity *RecommendedChatFilter) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub RecommendedChatFilter - - return json.Marshal((*stub)(entity)) -} - -func (*RecommendedChatFilter) GetClass() string { - return ClassRecommendedChatFilter -} - -func (*RecommendedChatFilter) GetType() string { - return TypeRecommendedChatFilter -} - -// Contains a list of recommended chat filters -type RecommendedChatFilters struct { - meta - // List of recommended chat filters - ChatFilters []*RecommendedChatFilter `json:"chat_filters"` -} - -func (entity *RecommendedChatFilters) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub RecommendedChatFilters - - return json.Marshal((*stub)(entity)) -} - -func (*RecommendedChatFilters) GetClass() string { - return ClassRecommendedChatFilters -} - -func (*RecommendedChatFilters) GetType() string { - return TypeRecommendedChatFilters -} - -// A main list of chats -type ChatListMain struct { - meta -} - -func (entity *ChatListMain) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatListMain - - return json.Marshal((*stub)(entity)) -} - -func (*ChatListMain) GetClass() string { - return ClassChatList -} - -func (*ChatListMain) GetType() string { - return TypeChatListMain -} - -func (*ChatListMain) ChatListType() string { - return TypeChatListMain -} - -// 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 -type ChatListArchive struct { - meta -} - -func (entity *ChatListArchive) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatListArchive - - return json.Marshal((*stub)(entity)) -} - -func (*ChatListArchive) GetClass() string { - return ClassChatList -} - -func (*ChatListArchive) GetType() string { - return TypeChatListArchive -} - -func (*ChatListArchive) ChatListType() string { - return TypeChatListArchive -} - -// A list of chats belonging to a chat filter -type ChatListFilter struct { - meta - // Chat filter identifier - ChatFilterId int32 `json:"chat_filter_id"` -} - -func (entity *ChatListFilter) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatListFilter - - return json.Marshal((*stub)(entity)) -} - -func (*ChatListFilter) GetClass() string { - return ClassChatList -} - -func (*ChatListFilter) GetType() string { - return TypeChatListFilter -} - -func (*ChatListFilter) ChatListType() string { - return TypeChatListFilter -} - -// Contains a list of chat lists -type ChatLists struct { - meta - // List of chat lists - ChatLists []ChatList `json:"chat_lists"` -} - -func (entity *ChatLists) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatLists - - return json.Marshal((*stub)(entity)) -} - -func (*ChatLists) GetClass() string { - return ClassChatLists -} - -func (*ChatLists) GetType() string { - return TypeChatLists -} - -func (chatLists *ChatLists) UnmarshalJSON(data []byte) error { - var tmp struct { - ChatLists []json.RawMessage `json:"chat_lists"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - fieldChatLists, _ := UnmarshalListOfChatList(tmp.ChatLists) - chatLists.ChatLists = fieldChatLists - - return nil -} - -// The chat is sponsored by the user's MTProxy server -type ChatSourceMtprotoProxy struct { - meta -} - -func (entity *ChatSourceMtprotoProxy) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatSourceMtprotoProxy - - return json.Marshal((*stub)(entity)) -} - -func (*ChatSourceMtprotoProxy) GetClass() string { - return ClassChatSource -} - -func (*ChatSourceMtprotoProxy) GetType() string { - return TypeChatSourceMtprotoProxy -} - -func (*ChatSourceMtprotoProxy) ChatSourceType() string { - return TypeChatSourceMtprotoProxy -} - -// The chat contains a public service announcement -type ChatSourcePublicServiceAnnouncement struct { - meta - // The type of the announcement - Type string `json:"type"` - // The text of the announcement - Text string `json:"text"` -} - -func (entity *ChatSourcePublicServiceAnnouncement) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatSourcePublicServiceAnnouncement - - return json.Marshal((*stub)(entity)) -} - -func (*ChatSourcePublicServiceAnnouncement) GetClass() string { - return ClassChatSource -} - -func (*ChatSourcePublicServiceAnnouncement) GetType() string { - return TypeChatSourcePublicServiceAnnouncement -} - -func (*ChatSourcePublicServiceAnnouncement) ChatSourceType() string { - return TypeChatSourcePublicServiceAnnouncement -} - -// Describes a position of a chat in a chat list -type ChatPosition struct { - 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"` -} - -func (entity *ChatPosition) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatPosition - - return json.Marshal((*stub)(entity)) -} - -func (*ChatPosition) GetClass() string { - return ClassChatPosition -} - -func (*ChatPosition) GetType() string { - return TypeChatPosition -} - -func (chatPosition *ChatPosition) UnmarshalJSON(data []byte) error { - var tmp struct { - List json.RawMessage `json:"list"` - Order JsonInt64 `json:"order"` - IsPinned bool `json:"is_pinned"` - Source json.RawMessage `json:"source"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - chatPosition.Order = tmp.Order - chatPosition.IsPinned = tmp.IsPinned - - fieldList, _ := UnmarshalChatList(tmp.List) - chatPosition.List = fieldList - - fieldSource, _ := UnmarshalChatSource(tmp.Source) - chatPosition.Source = fieldSource - - return nil -} - -// All reactions are available in the chat -type ChatAvailableReactionsAll struct { - meta -} - -func (entity *ChatAvailableReactionsAll) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatAvailableReactionsAll - - return json.Marshal((*stub)(entity)) -} - -func (*ChatAvailableReactionsAll) GetClass() string { - return ClassChatAvailableReactions -} - -func (*ChatAvailableReactionsAll) GetType() string { - return TypeChatAvailableReactionsAll -} - -func (*ChatAvailableReactionsAll) ChatAvailableReactionsType() string { - return TypeChatAvailableReactionsAll -} - -// Only specific reactions are available in the chat -type ChatAvailableReactionsSome struct { - meta - // The list of reactions - Reactions []ReactionType `json:"reactions"` -} - -func (entity *ChatAvailableReactionsSome) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatAvailableReactionsSome - - return json.Marshal((*stub)(entity)) -} - -func (*ChatAvailableReactionsSome) GetClass() string { - return ClassChatAvailableReactions -} - -func (*ChatAvailableReactionsSome) GetType() string { - return TypeChatAvailableReactionsSome -} - -func (*ChatAvailableReactionsSome) ChatAvailableReactionsType() string { - return TypeChatAvailableReactionsSome -} - -func (chatAvailableReactionsSome *ChatAvailableReactionsSome) UnmarshalJSON(data []byte) error { - var tmp struct { - Reactions []json.RawMessage `json:"reactions"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - fieldReactions, _ := UnmarshalListOfReactionType(tmp.Reactions) - chatAvailableReactionsSome.Reactions = fieldReactions - - return nil -} - -// Describes a video chat -type VideoChat struct { - 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"` -} - -func (entity *VideoChat) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub VideoChat - - return json.Marshal((*stub)(entity)) -} - -func (*VideoChat) GetClass() string { - return ClassVideoChat -} - -func (*VideoChat) GetType() string { - return TypeVideoChat -} - -func (videoChat *VideoChat) UnmarshalJSON(data []byte) error { - var tmp struct { - GroupCallId int32 `json:"group_call_id"` - HasParticipants bool `json:"has_participants"` - DefaultParticipantId json.RawMessage `json:"default_participant_id"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - videoChat.GroupCallId = tmp.GroupCallId - videoChat.HasParticipants = tmp.HasParticipants - - fieldDefaultParticipantId, _ := UnmarshalMessageSender(tmp.DefaultParticipantId) - videoChat.DefaultParticipantId = fieldDefaultParticipantId - - return nil -} - -// A chat. (Can be a private chat, basic group, supergroup, or secret chat) -type Chat struct { - 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"` - // Types of reaction, available in the chat - AvailableReactions ChatAvailableReactions `json:"available_reactions"` - // Current message auto-delete or self-destruct timer setting for the chat, in seconds; 0 if disabled. Self-destruct timer in secret chats starts after the message or its content is viewed. Auto-delete timer in other chats starts from the send date - MessageAutoDeleteTime int32 `json:"message_auto_delete_time"` - // 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"` -} - -func (entity *Chat) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub Chat - - return json.Marshal((*stub)(entity)) -} - -func (*Chat) GetClass() string { - return ClassChat -} - -func (*Chat) GetType() string { - return TypeChat -} - -func (chat *Chat) UnmarshalJSON(data []byte) error { - 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 json.RawMessage `json:"available_reactions"` - MessageAutoDeleteTime int32 `json:"message_auto_delete_time"` - 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.MessageAutoDeleteTime = tmp.MessageAutoDeleteTime - 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 - - fieldAvailableReactions, _ := UnmarshalChatAvailableReactions(tmp.AvailableReactions) - chat.AvailableReactions = fieldAvailableReactions - - fieldActionBar, _ := UnmarshalChatActionBar(tmp.ActionBar) - chat.ActionBar = fieldActionBar - - return nil -} - -// Represents a list of chats -type Chats struct { - meta - // Approximate total number of chats found - TotalCount int32 `json:"total_count"` - // List of chat identifiers - ChatIds []int64 `json:"chat_ids"` -} - -func (entity *Chats) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub Chats - - return json.Marshal((*stub)(entity)) -} - -func (*Chats) GetClass() string { - return ClassChats -} - -func (*Chats) GetType() string { - return TypeChats -} - -// Describes a chat located nearby -type ChatNearby struct { - meta - // Chat identifier - ChatId int64 `json:"chat_id"` - // Distance to the chat location, in meters - Distance int32 `json:"distance"` -} - -func (entity *ChatNearby) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatNearby - - return json.Marshal((*stub)(entity)) -} - -func (*ChatNearby) GetClass() string { - return ClassChatNearby -} - -func (*ChatNearby) GetType() string { - return TypeChatNearby -} - -// Represents a list of chats located nearby -type ChatsNearby struct { - meta - // List of users nearby - UsersNearby []*ChatNearby `json:"users_nearby"` - // List of location-based supergroups nearby - SupergroupsNearby []*ChatNearby `json:"supergroups_nearby"` -} - -func (entity *ChatsNearby) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatsNearby - - return json.Marshal((*stub)(entity)) -} - -func (*ChatsNearby) GetClass() string { - return ClassChatsNearby -} - -func (*ChatsNearby) GetType() string { - return TypeChatsNearby -} - -// The chat is public, because it has an active username -type PublicChatTypeHasUsername struct { - meta -} - -func (entity *PublicChatTypeHasUsername) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PublicChatTypeHasUsername - - return json.Marshal((*stub)(entity)) -} - -func (*PublicChatTypeHasUsername) GetClass() string { - return ClassPublicChatType -} - -func (*PublicChatTypeHasUsername) GetType() string { - return TypePublicChatTypeHasUsername -} - -func (*PublicChatTypeHasUsername) PublicChatTypeType() string { - return TypePublicChatTypeHasUsername -} - -// The chat is public, because it is a location-based supergroup -type PublicChatTypeIsLocationBased struct { - meta -} - -func (entity *PublicChatTypeIsLocationBased) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PublicChatTypeIsLocationBased - - return json.Marshal((*stub)(entity)) -} - -func (*PublicChatTypeIsLocationBased) GetClass() string { - return ClassPublicChatType -} - -func (*PublicChatTypeIsLocationBased) GetType() string { - return TypePublicChatTypeIsLocationBased -} - -func (*PublicChatTypeIsLocationBased) PublicChatTypeType() string { - return TypePublicChatTypeIsLocationBased -} - -// The chat can be reported as spam using the method reportChat with the reason chatReportReasonSpam. If the chat is a private chat with a user with an emoji status, then a notice about emoji status usage must be shown -type ChatActionBarReportSpam struct { - 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"` -} - -func (entity *ChatActionBarReportSpam) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatActionBarReportSpam - - return json.Marshal((*stub)(entity)) -} - -func (*ChatActionBarReportSpam) GetClass() string { - return ClassChatActionBar -} - -func (*ChatActionBarReportSpam) GetType() string { - return TypeChatActionBarReportSpam -} - -func (*ChatActionBarReportSpam) ChatActionBarType() string { - return TypeChatActionBarReportSpam -} - -// The chat is a location-based supergroup, which can be reported as having unrelated location using the method reportChat with the reason chatReportReasonUnrelatedLocation -type ChatActionBarReportUnrelatedLocation struct { - meta -} - -func (entity *ChatActionBarReportUnrelatedLocation) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatActionBarReportUnrelatedLocation - - return json.Marshal((*stub)(entity)) -} - -func (*ChatActionBarReportUnrelatedLocation) GetClass() string { - return ClassChatActionBar -} - -func (*ChatActionBarReportUnrelatedLocation) GetType() string { - return TypeChatActionBarReportUnrelatedLocation -} - -func (*ChatActionBarReportUnrelatedLocation) ChatActionBarType() string { - return TypeChatActionBarReportUnrelatedLocation -} - -// The chat is a recently created group chat to which new members can be invited -type ChatActionBarInviteMembers struct { - meta -} - -func (entity *ChatActionBarInviteMembers) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatActionBarInviteMembers - - return json.Marshal((*stub)(entity)) -} - -func (*ChatActionBarInviteMembers) GetClass() string { - return ClassChatActionBar -} - -func (*ChatActionBarInviteMembers) GetType() string { - return TypeChatActionBarInviteMembers -} - -func (*ChatActionBarInviteMembers) ChatActionBarType() string { - return TypeChatActionBarInviteMembers -} - -// 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. If the chat is a private chat with a user with an emoji status, then a notice about emoji status usage must be shown -type ChatActionBarReportAddBlock struct { - 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"` -} - -func (entity *ChatActionBarReportAddBlock) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatActionBarReportAddBlock - - return json.Marshal((*stub)(entity)) -} - -func (*ChatActionBarReportAddBlock) GetClass() string { - return ClassChatActionBar -} - -func (*ChatActionBarReportAddBlock) GetType() string { - return TypeChatActionBarReportAddBlock -} - -func (*ChatActionBarReportAddBlock) ChatActionBarType() string { - return TypeChatActionBarReportAddBlock -} - -// The chat is a private or secret chat and the other user can be added to the contact list using the method addContact -type ChatActionBarAddContact struct { - meta -} - -func (entity *ChatActionBarAddContact) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatActionBarAddContact - - return json.Marshal((*stub)(entity)) -} - -func (*ChatActionBarAddContact) GetClass() string { - return ClassChatActionBar -} - -func (*ChatActionBarAddContact) GetType() string { - return TypeChatActionBarAddContact -} - -func (*ChatActionBarAddContact) ChatActionBarType() string { - return TypeChatActionBarAddContact -} - -// 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 -type ChatActionBarSharePhoneNumber struct { - meta -} - -func (entity *ChatActionBarSharePhoneNumber) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatActionBarSharePhoneNumber - - return json.Marshal((*stub)(entity)) -} - -func (*ChatActionBarSharePhoneNumber) GetClass() string { - return ClassChatActionBar -} - -func (*ChatActionBarSharePhoneNumber) GetType() string { - return TypeChatActionBarSharePhoneNumber -} - -func (*ChatActionBarSharePhoneNumber) ChatActionBarType() string { - return TypeChatActionBarSharePhoneNumber -} - -// The chat is a private chat with an administrator of a chat to which the user sent join request -type ChatActionBarJoinRequest struct { - 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"` -} - -func (entity *ChatActionBarJoinRequest) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatActionBarJoinRequest - - return json.Marshal((*stub)(entity)) -} - -func (*ChatActionBarJoinRequest) GetClass() string { - return ClassChatActionBar -} - -func (*ChatActionBarJoinRequest) GetType() string { - return TypeChatActionBarJoinRequest -} - -func (*ChatActionBarJoinRequest) ChatActionBarType() string { - return TypeChatActionBarJoinRequest -} - -// A simple button, with text that must be sent when the button is pressed -type KeyboardButtonTypeText struct { - meta -} - -func (entity *KeyboardButtonTypeText) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub KeyboardButtonTypeText - - return json.Marshal((*stub)(entity)) -} - -func (*KeyboardButtonTypeText) GetClass() string { - return ClassKeyboardButtonType -} - -func (*KeyboardButtonTypeText) GetType() string { - return TypeKeyboardButtonTypeText -} - -func (*KeyboardButtonTypeText) KeyboardButtonTypeType() string { - return TypeKeyboardButtonTypeText -} - -// A button that sends the user's phone number when pressed; available only in private chats -type KeyboardButtonTypeRequestPhoneNumber struct { - meta -} - -func (entity *KeyboardButtonTypeRequestPhoneNumber) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub KeyboardButtonTypeRequestPhoneNumber - - return json.Marshal((*stub)(entity)) -} - -func (*KeyboardButtonTypeRequestPhoneNumber) GetClass() string { - return ClassKeyboardButtonType -} - -func (*KeyboardButtonTypeRequestPhoneNumber) GetType() string { - return TypeKeyboardButtonTypeRequestPhoneNumber -} - -func (*KeyboardButtonTypeRequestPhoneNumber) KeyboardButtonTypeType() string { - return TypeKeyboardButtonTypeRequestPhoneNumber -} - -// A button that sends the user's location when pressed; available only in private chats -type KeyboardButtonTypeRequestLocation struct { - meta -} - -func (entity *KeyboardButtonTypeRequestLocation) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub KeyboardButtonTypeRequestLocation - - return json.Marshal((*stub)(entity)) -} - -func (*KeyboardButtonTypeRequestLocation) GetClass() string { - return ClassKeyboardButtonType -} - -func (*KeyboardButtonTypeRequestLocation) GetType() string { - return TypeKeyboardButtonTypeRequestLocation -} - -func (*KeyboardButtonTypeRequestLocation) KeyboardButtonTypeType() string { - return TypeKeyboardButtonTypeRequestLocation -} - -// A button that allows the user to create and send a poll when pressed; available only in private chats -type KeyboardButtonTypeRequestPoll struct { - 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"` -} - -func (entity *KeyboardButtonTypeRequestPoll) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub KeyboardButtonTypeRequestPoll - - return json.Marshal((*stub)(entity)) -} - -func (*KeyboardButtonTypeRequestPoll) GetClass() string { - return ClassKeyboardButtonType -} - -func (*KeyboardButtonTypeRequestPoll) GetType() string { - return TypeKeyboardButtonTypeRequestPoll -} - -func (*KeyboardButtonTypeRequestPoll) KeyboardButtonTypeType() string { - return TypeKeyboardButtonTypeRequestPoll -} - -// A button that opens a Web App by calling getWebAppUrl -type KeyboardButtonTypeWebApp struct { - meta - // An HTTP URL to pass to getWebAppUrl - Url string `json:"url"` -} - -func (entity *KeyboardButtonTypeWebApp) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub KeyboardButtonTypeWebApp - - return json.Marshal((*stub)(entity)) -} - -func (*KeyboardButtonTypeWebApp) GetClass() string { - return ClassKeyboardButtonType -} - -func (*KeyboardButtonTypeWebApp) GetType() string { - return TypeKeyboardButtonTypeWebApp -} - -func (*KeyboardButtonTypeWebApp) KeyboardButtonTypeType() string { - return TypeKeyboardButtonTypeWebApp -} - -// Represents a single button in a bot keyboard -type KeyboardButton struct { - meta - // Text of the button - Text string `json:"text"` - // Type of the button - Type KeyboardButtonType `json:"type"` -} - -func (entity *KeyboardButton) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub KeyboardButton - - return json.Marshal((*stub)(entity)) -} - -func (*KeyboardButton) GetClass() string { - return ClassKeyboardButton -} - -func (*KeyboardButton) GetType() string { - return TypeKeyboardButton -} - -func (keyboardButton *KeyboardButton) UnmarshalJSON(data []byte) error { - var tmp struct { - Text string `json:"text"` - Type json.RawMessage `json:"type"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - keyboardButton.Text = tmp.Text - - fieldType, _ := UnmarshalKeyboardButtonType(tmp.Type) - keyboardButton.Type = fieldType - - return nil -} - -// A button that opens a specified URL -type InlineKeyboardButtonTypeUrl struct { - meta - // HTTP or tg:// URL to open - Url string `json:"url"` -} - -func (entity *InlineKeyboardButtonTypeUrl) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InlineKeyboardButtonTypeUrl - - return json.Marshal((*stub)(entity)) -} - -func (*InlineKeyboardButtonTypeUrl) GetClass() string { - return ClassInlineKeyboardButtonType -} - -func (*InlineKeyboardButtonTypeUrl) GetType() string { - return TypeInlineKeyboardButtonTypeUrl -} - -func (*InlineKeyboardButtonTypeUrl) InlineKeyboardButtonTypeType() string { - return TypeInlineKeyboardButtonTypeUrl -} - -// A button that opens a specified URL and automatically authorize the current user by calling getLoginUrlInfo -type InlineKeyboardButtonTypeLoginUrl struct { - meta - // An HTTP URL to pass to getLoginUrlInfo - 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"` -} - -func (entity *InlineKeyboardButtonTypeLoginUrl) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InlineKeyboardButtonTypeLoginUrl - - return json.Marshal((*stub)(entity)) -} - -func (*InlineKeyboardButtonTypeLoginUrl) GetClass() string { - return ClassInlineKeyboardButtonType -} - -func (*InlineKeyboardButtonTypeLoginUrl) GetType() string { - return TypeInlineKeyboardButtonTypeLoginUrl -} - -func (*InlineKeyboardButtonTypeLoginUrl) InlineKeyboardButtonTypeType() string { - return TypeInlineKeyboardButtonTypeLoginUrl -} - -// A button that opens a Web App by calling openWebApp -type InlineKeyboardButtonTypeWebApp struct { - meta - // An HTTP URL to pass to openWebApp - Url string `json:"url"` -} - -func (entity *InlineKeyboardButtonTypeWebApp) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InlineKeyboardButtonTypeWebApp - - return json.Marshal((*stub)(entity)) -} - -func (*InlineKeyboardButtonTypeWebApp) GetClass() string { - return ClassInlineKeyboardButtonType -} - -func (*InlineKeyboardButtonTypeWebApp) GetType() string { - return TypeInlineKeyboardButtonTypeWebApp -} - -func (*InlineKeyboardButtonTypeWebApp) InlineKeyboardButtonTypeType() string { - return TypeInlineKeyboardButtonTypeWebApp -} - -// A button that sends a callback query to a bot -type InlineKeyboardButtonTypeCallback struct { - meta - // Data to be sent to the bot via a callback query - Data []byte `json:"data"` -} - -func (entity *InlineKeyboardButtonTypeCallback) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InlineKeyboardButtonTypeCallback - - return json.Marshal((*stub)(entity)) -} - -func (*InlineKeyboardButtonTypeCallback) GetClass() string { - return ClassInlineKeyboardButtonType -} - -func (*InlineKeyboardButtonTypeCallback) GetType() string { - return TypeInlineKeyboardButtonTypeCallback -} - -func (*InlineKeyboardButtonTypeCallback) InlineKeyboardButtonTypeType() string { - return TypeInlineKeyboardButtonTypeCallback -} - -// A button that asks for the 2-step verification password of the current user and then sends a callback query to a bot -type InlineKeyboardButtonTypeCallbackWithPassword struct { - meta - // Data to be sent to the bot via a callback query - Data []byte `json:"data"` -} - -func (entity *InlineKeyboardButtonTypeCallbackWithPassword) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InlineKeyboardButtonTypeCallbackWithPassword - - return json.Marshal((*stub)(entity)) -} - -func (*InlineKeyboardButtonTypeCallbackWithPassword) GetClass() string { - return ClassInlineKeyboardButtonType -} - -func (*InlineKeyboardButtonTypeCallbackWithPassword) GetType() string { - return TypeInlineKeyboardButtonTypeCallbackWithPassword -} - -func (*InlineKeyboardButtonTypeCallbackWithPassword) InlineKeyboardButtonTypeType() string { - return TypeInlineKeyboardButtonTypeCallbackWithPassword -} - -// 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 -type InlineKeyboardButtonTypeCallbackGame struct { - meta -} - -func (entity *InlineKeyboardButtonTypeCallbackGame) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InlineKeyboardButtonTypeCallbackGame - - return json.Marshal((*stub)(entity)) -} - -func (*InlineKeyboardButtonTypeCallbackGame) GetClass() string { - return ClassInlineKeyboardButtonType -} - -func (*InlineKeyboardButtonTypeCallbackGame) GetType() string { - return TypeInlineKeyboardButtonTypeCallbackGame -} - -func (*InlineKeyboardButtonTypeCallbackGame) InlineKeyboardButtonTypeType() string { - return TypeInlineKeyboardButtonTypeCallbackGame -} - -// A button that forces an inline query to the bot to be inserted in the input field -type InlineKeyboardButtonTypeSwitchInline struct { - 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"` -} - -func (entity *InlineKeyboardButtonTypeSwitchInline) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InlineKeyboardButtonTypeSwitchInline - - return json.Marshal((*stub)(entity)) -} - -func (*InlineKeyboardButtonTypeSwitchInline) GetClass() string { - return ClassInlineKeyboardButtonType -} - -func (*InlineKeyboardButtonTypeSwitchInline) GetType() string { - return TypeInlineKeyboardButtonTypeSwitchInline -} - -func (*InlineKeyboardButtonTypeSwitchInline) InlineKeyboardButtonTypeType() string { - return TypeInlineKeyboardButtonTypeSwitchInline -} - -// 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 -type InlineKeyboardButtonTypeBuy struct { - meta -} - -func (entity *InlineKeyboardButtonTypeBuy) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InlineKeyboardButtonTypeBuy - - return json.Marshal((*stub)(entity)) -} - -func (*InlineKeyboardButtonTypeBuy) GetClass() string { - return ClassInlineKeyboardButtonType -} - -func (*InlineKeyboardButtonTypeBuy) GetType() string { - return TypeInlineKeyboardButtonTypeBuy -} - -func (*InlineKeyboardButtonTypeBuy) InlineKeyboardButtonTypeType() string { - return TypeInlineKeyboardButtonTypeBuy -} - -// A button with a user reference to be handled in the same way as textEntityTypeMentionName entities -type InlineKeyboardButtonTypeUser struct { - meta - // User identifier - UserId int64 `json:"user_id"` -} - -func (entity *InlineKeyboardButtonTypeUser) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InlineKeyboardButtonTypeUser - - return json.Marshal((*stub)(entity)) -} - -func (*InlineKeyboardButtonTypeUser) GetClass() string { - return ClassInlineKeyboardButtonType -} - -func (*InlineKeyboardButtonTypeUser) GetType() string { - return TypeInlineKeyboardButtonTypeUser -} - -func (*InlineKeyboardButtonTypeUser) InlineKeyboardButtonTypeType() string { - return TypeInlineKeyboardButtonTypeUser -} - -// Represents a single button in an inline keyboard -type InlineKeyboardButton struct { - meta - // Text of the button - Text string `json:"text"` - // Type of the button - Type InlineKeyboardButtonType `json:"type"` -} - -func (entity *InlineKeyboardButton) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InlineKeyboardButton - - return json.Marshal((*stub)(entity)) -} - -func (*InlineKeyboardButton) GetClass() string { - return ClassInlineKeyboardButton -} - -func (*InlineKeyboardButton) GetType() string { - return TypeInlineKeyboardButton -} - -func (inlineKeyboardButton *InlineKeyboardButton) UnmarshalJSON(data []byte) error { - var tmp struct { - Text string `json:"text"` - Type json.RawMessage `json:"type"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - inlineKeyboardButton.Text = tmp.Text - - fieldType, _ := UnmarshalInlineKeyboardButtonType(tmp.Type) - inlineKeyboardButton.Type = fieldType - - return nil -} - -// 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 { - meta - // True, if the keyboard is removed only for the mentioned users or the target user of a reply - IsPersonal bool `json:"is_personal"` -} - -func (entity *ReplyMarkupRemoveKeyboard) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ReplyMarkupRemoveKeyboard - - return json.Marshal((*stub)(entity)) -} - -func (*ReplyMarkupRemoveKeyboard) GetClass() string { - return ClassReplyMarkup -} - -func (*ReplyMarkupRemoveKeyboard) GetType() string { - return TypeReplyMarkupRemoveKeyboard -} - -func (*ReplyMarkupRemoveKeyboard) ReplyMarkupType() string { - return TypeReplyMarkupRemoveKeyboard -} - -// Instructs application to force a reply to this message -type ReplyMarkupForceReply struct { - 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"` -} - -func (entity *ReplyMarkupForceReply) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ReplyMarkupForceReply - - return json.Marshal((*stub)(entity)) -} - -func (*ReplyMarkupForceReply) GetClass() string { - return ClassReplyMarkup -} - -func (*ReplyMarkupForceReply) GetType() string { - return TypeReplyMarkupForceReply -} - -func (*ReplyMarkupForceReply) ReplyMarkupType() string { - return TypeReplyMarkupForceReply -} - -// Contains a custom keyboard layout to quickly reply to bots -type ReplyMarkupShowKeyboard struct { - meta - // A list of rows of bot keyboard buttons - Rows [][]*KeyboardButton `json:"rows"` - // True, if the keyboard is supposed to be always shown when the ordinary keyboard is hidden - IsPersistent bool `json:"is_persistent"` - // 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"` -} - -func (entity *ReplyMarkupShowKeyboard) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ReplyMarkupShowKeyboard - - return json.Marshal((*stub)(entity)) -} - -func (*ReplyMarkupShowKeyboard) GetClass() string { - return ClassReplyMarkup -} - -func (*ReplyMarkupShowKeyboard) GetType() string { - return TypeReplyMarkupShowKeyboard -} - -func (*ReplyMarkupShowKeyboard) ReplyMarkupType() string { - return TypeReplyMarkupShowKeyboard -} - -// Contains an inline keyboard layout -type ReplyMarkupInlineKeyboard struct { - meta - // A list of rows of inline keyboard buttons - Rows [][]*InlineKeyboardButton `json:"rows"` -} - -func (entity *ReplyMarkupInlineKeyboard) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ReplyMarkupInlineKeyboard - - return json.Marshal((*stub)(entity)) -} - -func (*ReplyMarkupInlineKeyboard) GetClass() string { - return ClassReplyMarkup -} - -func (*ReplyMarkupInlineKeyboard) GetType() string { - return TypeReplyMarkupInlineKeyboard -} - -func (*ReplyMarkupInlineKeyboard) ReplyMarkupType() string { - return TypeReplyMarkupInlineKeyboard -} - -// An HTTP url needs to be open -type LoginUrlInfoOpen struct { - 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"` -} - -func (entity *LoginUrlInfoOpen) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub LoginUrlInfoOpen - - return json.Marshal((*stub)(entity)) -} - -func (*LoginUrlInfoOpen) GetClass() string { - return ClassLoginUrlInfo -} - -func (*LoginUrlInfoOpen) GetType() string { - return TypeLoginUrlInfoOpen -} - -func (*LoginUrlInfoOpen) LoginUrlInfoType() string { - return TypeLoginUrlInfoOpen -} - -// An authorization confirmation dialog needs to be shown to the user -type LoginUrlInfoRequestConfirmation struct { - 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"` -} - -func (entity *LoginUrlInfoRequestConfirmation) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub LoginUrlInfoRequestConfirmation - - return json.Marshal((*stub)(entity)) -} - -func (*LoginUrlInfoRequestConfirmation) GetClass() string { - return ClassLoginUrlInfo -} - -func (*LoginUrlInfoRequestConfirmation) GetType() string { - return TypeLoginUrlInfoRequestConfirmation -} - -func (*LoginUrlInfoRequestConfirmation) LoginUrlInfoType() string { - return TypeLoginUrlInfoRequestConfirmation -} - -// Contains information about a Web App -type WebAppInfo struct { - meta - // Unique identifier for the Web App launch - LaunchId JsonInt64 `json:"launch_id"` - // A Web App URL to open in a web view - Url string `json:"url"` -} - -func (entity *WebAppInfo) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub WebAppInfo - - return json.Marshal((*stub)(entity)) -} - -func (*WebAppInfo) GetClass() string { - return ClassWebAppInfo -} - -func (*WebAppInfo) GetType() string { - return TypeWebAppInfo -} - -// Contains information about a message thread -type MessageThreadInfo struct { - 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; may be null for forum topic threads - 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"` -} - -func (entity *MessageThreadInfo) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageThreadInfo - - return json.Marshal((*stub)(entity)) -} - -func (*MessageThreadInfo) GetClass() string { - return ClassMessageThreadInfo -} - -func (*MessageThreadInfo) GetType() string { - return TypeMessageThreadInfo -} - -// Describes a forum topic icon -type ForumTopicIcon struct { - meta - // Color of the topic icon in RGB format - Color int32 `json:"color"` - // Unique identifier of the custom emoji shown on the topic icon; 0 if none - CustomEmojiId JsonInt64 `json:"custom_emoji_id"` -} - -func (entity *ForumTopicIcon) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ForumTopicIcon - - return json.Marshal((*stub)(entity)) -} - -func (*ForumTopicIcon) GetClass() string { - return ClassForumTopicIcon -} - -func (*ForumTopicIcon) GetType() string { - return TypeForumTopicIcon -} - -// Contains basic information about a forum topic -type ForumTopicInfo struct { - meta - // Message thread identifier of the topic - MessageThreadId int64 `json:"message_thread_id"` - // Name of the topic - Name string `json:"name"` - // Icon of the topic - Icon *ForumTopicIcon `json:"icon"` - // Date the topic was created - CreationDate int32 `json:"creation_date"` - // Identifier of the creator of the topic - CreatorId MessageSender `json:"creator_id"` - // True, if the topic is the General topic list - IsGeneral bool `json:"is_general"` - // True, if the topic was created by the current user - IsOutgoing bool `json:"is_outgoing"` - // True, if the topic is closed - IsClosed bool `json:"is_closed"` - // True, if the topic is hidden above the topic list and closed; for General topic only - IsHidden bool `json:"is_hidden"` -} - -func (entity *ForumTopicInfo) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ForumTopicInfo - - return json.Marshal((*stub)(entity)) -} - -func (*ForumTopicInfo) GetClass() string { - return ClassForumTopicInfo -} - -func (*ForumTopicInfo) GetType() string { - return TypeForumTopicInfo -} - -func (forumTopicInfo *ForumTopicInfo) UnmarshalJSON(data []byte) error { - var tmp struct { - MessageThreadId int64 `json:"message_thread_id"` - Name string `json:"name"` - Icon *ForumTopicIcon `json:"icon"` - CreationDate int32 `json:"creation_date"` - CreatorId json.RawMessage `json:"creator_id"` - IsGeneral bool `json:"is_general"` - IsOutgoing bool `json:"is_outgoing"` - IsClosed bool `json:"is_closed"` - IsHidden bool `json:"is_hidden"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - forumTopicInfo.MessageThreadId = tmp.MessageThreadId - forumTopicInfo.Name = tmp.Name - forumTopicInfo.Icon = tmp.Icon - forumTopicInfo.CreationDate = tmp.CreationDate - forumTopicInfo.IsGeneral = tmp.IsGeneral - forumTopicInfo.IsOutgoing = tmp.IsOutgoing - forumTopicInfo.IsClosed = tmp.IsClosed - forumTopicInfo.IsHidden = tmp.IsHidden - - fieldCreatorId, _ := UnmarshalMessageSender(tmp.CreatorId) - forumTopicInfo.CreatorId = fieldCreatorId - - return nil -} - -// Describes a forum topic -type ForumTopic struct { - meta - // Basic information about the topic - Info *ForumTopicInfo `json:"info"` - // Last message in the topic; may be null if unknown - LastMessage *Message `json:"last_message"` - // True, if the topic is pinned in the topic list - IsPinned bool `json:"is_pinned"` - // Number of unread messages in the topic - 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 topic - UnreadMentionCount int32 `json:"unread_mention_count"` - // Number of messages with unread reactions in the topic - UnreadReactionCount int32 `json:"unread_reaction_count"` - // Notification settings for the topic - NotificationSettings *ChatNotificationSettings `json:"notification_settings"` - // A draft of a message in the topic; may be null - DraftMessage *DraftMessage `json:"draft_message"` -} - -func (entity *ForumTopic) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ForumTopic - - return json.Marshal((*stub)(entity)) -} - -func (*ForumTopic) GetClass() string { - return ClassForumTopic -} - -func (*ForumTopic) GetType() string { - return TypeForumTopic -} - -// Describes a list of forum topics -type ForumTopics struct { - meta - // Approximate total number of forum topics found - TotalCount int32 `json:"total_count"` - // List of forum topics - Topics []*ForumTopic `json:"topics"` - // Offset date for the next getForumTopics request - NextOffsetDate int32 `json:"next_offset_date"` - // Offset message identifier for the next getForumTopics request - NextOffsetMessageId int64 `json:"next_offset_message_id"` - // Offset message thread identifier for the next getForumTopics request - NextOffsetMessageThreadId int64 `json:"next_offset_message_thread_id"` -} - -func (entity *ForumTopics) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ForumTopics - - return json.Marshal((*stub)(entity)) -} - -func (*ForumTopics) GetClass() string { - return ClassForumTopics -} - -func (*ForumTopics) GetType() string { - return TypeForumTopics -} - -// A plain text -type RichTextPlain struct { - meta - // Text - Text string `json:"text"` -} - -func (entity *RichTextPlain) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub RichTextPlain - - return json.Marshal((*stub)(entity)) -} - -func (*RichTextPlain) GetClass() string { - return ClassRichText -} - -func (*RichTextPlain) GetType() string { - return TypeRichTextPlain -} - -func (*RichTextPlain) RichTextType() string { - return TypeRichTextPlain -} - -// A bold rich text -type RichTextBold struct { - meta - // Text - Text RichText `json:"text"` -} - -func (entity *RichTextBold) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub RichTextBold - - return json.Marshal((*stub)(entity)) -} - -func (*RichTextBold) GetClass() string { - return ClassRichText -} - -func (*RichTextBold) GetType() string { - return TypeRichTextBold -} - -func (*RichTextBold) RichTextType() string { - return TypeRichTextBold -} - -func (richTextBold *RichTextBold) UnmarshalJSON(data []byte) error { - var tmp struct { - Text json.RawMessage `json:"text"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - fieldText, _ := UnmarshalRichText(tmp.Text) - richTextBold.Text = fieldText - - return nil -} - -// An italicized rich text -type RichTextItalic struct { - meta - // Text - Text RichText `json:"text"` -} - -func (entity *RichTextItalic) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub RichTextItalic - - return json.Marshal((*stub)(entity)) -} - -func (*RichTextItalic) GetClass() string { - return ClassRichText -} - -func (*RichTextItalic) GetType() string { - return TypeRichTextItalic -} - -func (*RichTextItalic) RichTextType() string { - return TypeRichTextItalic -} - -func (richTextItalic *RichTextItalic) UnmarshalJSON(data []byte) error { - var tmp struct { - Text json.RawMessage `json:"text"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - fieldText, _ := UnmarshalRichText(tmp.Text) - richTextItalic.Text = fieldText - - return nil -} - -// An underlined rich text -type RichTextUnderline struct { - meta - // Text - Text RichText `json:"text"` -} - -func (entity *RichTextUnderline) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub RichTextUnderline - - return json.Marshal((*stub)(entity)) -} - -func (*RichTextUnderline) GetClass() string { - return ClassRichText -} - -func (*RichTextUnderline) GetType() string { - return TypeRichTextUnderline -} - -func (*RichTextUnderline) RichTextType() string { - return TypeRichTextUnderline -} - -func (richTextUnderline *RichTextUnderline) UnmarshalJSON(data []byte) error { - var tmp struct { - Text json.RawMessage `json:"text"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - fieldText, _ := UnmarshalRichText(tmp.Text) - richTextUnderline.Text = fieldText - - return nil -} - -// A strikethrough rich text -type RichTextStrikethrough struct { - meta - // Text - Text RichText `json:"text"` -} - -func (entity *RichTextStrikethrough) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub RichTextStrikethrough - - return json.Marshal((*stub)(entity)) -} - -func (*RichTextStrikethrough) GetClass() string { - return ClassRichText -} - -func (*RichTextStrikethrough) GetType() string { - return TypeRichTextStrikethrough -} - -func (*RichTextStrikethrough) RichTextType() string { - return TypeRichTextStrikethrough -} - -func (richTextStrikethrough *RichTextStrikethrough) UnmarshalJSON(data []byte) error { - var tmp struct { - Text json.RawMessage `json:"text"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - fieldText, _ := UnmarshalRichText(tmp.Text) - richTextStrikethrough.Text = fieldText - - return nil -} - -// A fixed-width rich text -type RichTextFixed struct { - meta - // Text - Text RichText `json:"text"` -} - -func (entity *RichTextFixed) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub RichTextFixed - - return json.Marshal((*stub)(entity)) -} - -func (*RichTextFixed) GetClass() string { - return ClassRichText -} - -func (*RichTextFixed) GetType() string { - return TypeRichTextFixed -} - -func (*RichTextFixed) RichTextType() string { - return TypeRichTextFixed -} - -func (richTextFixed *RichTextFixed) UnmarshalJSON(data []byte) error { - var tmp struct { - Text json.RawMessage `json:"text"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - fieldText, _ := UnmarshalRichText(tmp.Text) - richTextFixed.Text = fieldText - - return nil -} - -// A rich text URL link -type RichTextUrl struct { - 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"` -} - -func (entity *RichTextUrl) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub RichTextUrl - - return json.Marshal((*stub)(entity)) -} - -func (*RichTextUrl) GetClass() string { - return ClassRichText -} - -func (*RichTextUrl) GetType() string { - return TypeRichTextUrl -} - -func (*RichTextUrl) RichTextType() string { - return TypeRichTextUrl -} - -func (richTextUrl *RichTextUrl) UnmarshalJSON(data []byte) error { - var tmp struct { - Text json.RawMessage `json:"text"` - Url string `json:"url"` - IsCached bool `json:"is_cached"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - richTextUrl.Url = tmp.Url - richTextUrl.IsCached = tmp.IsCached - - fieldText, _ := UnmarshalRichText(tmp.Text) - richTextUrl.Text = fieldText - - return nil -} - -// A rich text email link -type RichTextEmailAddress struct { - meta - // Text - Text RichText `json:"text"` - // Email address - EmailAddress string `json:"email_address"` -} - -func (entity *RichTextEmailAddress) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub RichTextEmailAddress - - return json.Marshal((*stub)(entity)) -} - -func (*RichTextEmailAddress) GetClass() string { - return ClassRichText -} - -func (*RichTextEmailAddress) GetType() string { - return TypeRichTextEmailAddress -} - -func (*RichTextEmailAddress) RichTextType() string { - return TypeRichTextEmailAddress -} - -func (richTextEmailAddress *RichTextEmailAddress) UnmarshalJSON(data []byte) error { - var tmp struct { - Text json.RawMessage `json:"text"` - EmailAddress string `json:"email_address"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - richTextEmailAddress.EmailAddress = tmp.EmailAddress - - fieldText, _ := UnmarshalRichText(tmp.Text) - richTextEmailAddress.Text = fieldText - - return nil -} - -// A subscript rich text -type RichTextSubscript struct { - meta - // Text - Text RichText `json:"text"` -} - -func (entity *RichTextSubscript) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub RichTextSubscript - - return json.Marshal((*stub)(entity)) -} - -func (*RichTextSubscript) GetClass() string { - return ClassRichText -} - -func (*RichTextSubscript) GetType() string { - return TypeRichTextSubscript -} - -func (*RichTextSubscript) RichTextType() string { - return TypeRichTextSubscript -} - -func (richTextSubscript *RichTextSubscript) UnmarshalJSON(data []byte) error { - var tmp struct { - Text json.RawMessage `json:"text"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - fieldText, _ := UnmarshalRichText(tmp.Text) - richTextSubscript.Text = fieldText - - return nil -} - -// A superscript rich text -type RichTextSuperscript struct { - meta - // Text - Text RichText `json:"text"` -} - -func (entity *RichTextSuperscript) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub RichTextSuperscript - - return json.Marshal((*stub)(entity)) -} - -func (*RichTextSuperscript) GetClass() string { - return ClassRichText -} - -func (*RichTextSuperscript) GetType() string { - return TypeRichTextSuperscript -} - -func (*RichTextSuperscript) RichTextType() string { - return TypeRichTextSuperscript -} - -func (richTextSuperscript *RichTextSuperscript) UnmarshalJSON(data []byte) error { - var tmp struct { - Text json.RawMessage `json:"text"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - fieldText, _ := UnmarshalRichText(tmp.Text) - richTextSuperscript.Text = fieldText - - return nil -} - -// A marked rich text -type RichTextMarked struct { - meta - // Text - Text RichText `json:"text"` -} - -func (entity *RichTextMarked) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub RichTextMarked - - return json.Marshal((*stub)(entity)) -} - -func (*RichTextMarked) GetClass() string { - return ClassRichText -} - -func (*RichTextMarked) GetType() string { - return TypeRichTextMarked -} - -func (*RichTextMarked) RichTextType() string { - return TypeRichTextMarked -} - -func (richTextMarked *RichTextMarked) UnmarshalJSON(data []byte) error { - var tmp struct { - Text json.RawMessage `json:"text"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - fieldText, _ := UnmarshalRichText(tmp.Text) - richTextMarked.Text = fieldText - - return nil -} - -// A rich text phone number -type RichTextPhoneNumber struct { - meta - // Text - Text RichText `json:"text"` - // Phone number - PhoneNumber string `json:"phone_number"` -} - -func (entity *RichTextPhoneNumber) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub RichTextPhoneNumber - - return json.Marshal((*stub)(entity)) -} - -func (*RichTextPhoneNumber) GetClass() string { - return ClassRichText -} - -func (*RichTextPhoneNumber) GetType() string { - return TypeRichTextPhoneNumber -} - -func (*RichTextPhoneNumber) RichTextType() string { - return TypeRichTextPhoneNumber -} - -func (richTextPhoneNumber *RichTextPhoneNumber) UnmarshalJSON(data []byte) error { - var tmp struct { - Text json.RawMessage `json:"text"` - PhoneNumber string `json:"phone_number"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - richTextPhoneNumber.PhoneNumber = tmp.PhoneNumber - - fieldText, _ := UnmarshalRichText(tmp.Text) - richTextPhoneNumber.Text = fieldText - - return nil -} - -// A small image inside the text -type RichTextIcon struct { - 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"` -} - -func (entity *RichTextIcon) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub RichTextIcon - - return json.Marshal((*stub)(entity)) -} - -func (*RichTextIcon) GetClass() string { - return ClassRichText -} - -func (*RichTextIcon) GetType() string { - return TypeRichTextIcon -} - -func (*RichTextIcon) RichTextType() string { - return TypeRichTextIcon -} - -// A reference to a richTexts object on the same web page -type RichTextReference struct { - 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"` -} - -func (entity *RichTextReference) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub RichTextReference - - return json.Marshal((*stub)(entity)) -} - -func (*RichTextReference) GetClass() string { - return ClassRichText -} - -func (*RichTextReference) GetType() string { - return TypeRichTextReference -} - -func (*RichTextReference) RichTextType() string { - return TypeRichTextReference -} - -func (richTextReference *RichTextReference) UnmarshalJSON(data []byte) error { - var tmp struct { - Text json.RawMessage `json:"text"` - AnchorName string `json:"anchor_name"` - Url string `json:"url"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - richTextReference.AnchorName = tmp.AnchorName - richTextReference.Url = tmp.Url - - fieldText, _ := UnmarshalRichText(tmp.Text) - richTextReference.Text = fieldText - - return nil -} - -// An anchor -type RichTextAnchor struct { - meta - // Anchor name - Name string `json:"name"` -} - -func (entity *RichTextAnchor) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub RichTextAnchor - - return json.Marshal((*stub)(entity)) -} - -func (*RichTextAnchor) GetClass() string { - return ClassRichText -} - -func (*RichTextAnchor) GetType() string { - return TypeRichTextAnchor -} - -func (*RichTextAnchor) RichTextType() string { - return TypeRichTextAnchor -} - -// A link to an anchor on the same web page -type RichTextAnchorLink struct { - 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"` -} - -func (entity *RichTextAnchorLink) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub RichTextAnchorLink - - return json.Marshal((*stub)(entity)) -} - -func (*RichTextAnchorLink) GetClass() string { - return ClassRichText -} - -func (*RichTextAnchorLink) GetType() string { - return TypeRichTextAnchorLink -} - -func (*RichTextAnchorLink) RichTextType() string { - return TypeRichTextAnchorLink -} - -func (richTextAnchorLink *RichTextAnchorLink) UnmarshalJSON(data []byte) error { - var tmp struct { - Text json.RawMessage `json:"text"` - AnchorName string `json:"anchor_name"` - Url string `json:"url"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - richTextAnchorLink.AnchorName = tmp.AnchorName - richTextAnchorLink.Url = tmp.Url - - fieldText, _ := UnmarshalRichText(tmp.Text) - richTextAnchorLink.Text = fieldText - - return nil -} - -// A concatenation of rich texts -type RichTexts struct { - meta - // Texts - Texts []RichText `json:"texts"` -} - -func (entity *RichTexts) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub RichTexts - - return json.Marshal((*stub)(entity)) -} - -func (*RichTexts) GetClass() string { - return ClassRichText -} - -func (*RichTexts) GetType() string { - return TypeRichTexts -} - -func (*RichTexts) RichTextType() string { - return TypeRichTexts -} - -func (richTexts *RichTexts) UnmarshalJSON(data []byte) error { - var tmp struct { - Texts []json.RawMessage `json:"texts"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - fieldTexts, _ := UnmarshalListOfRichText(tmp.Texts) - richTexts.Texts = fieldTexts - - return nil -} - -// Contains a caption of an instant view web page block, consisting of a text and a trailing credit -type PageBlockCaption struct { - meta - // Content of the caption - Text RichText `json:"text"` - // Block credit (like HTML tag ) - Credit RichText `json:"credit"` -} - -func (entity *PageBlockCaption) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PageBlockCaption - - return json.Marshal((*stub)(entity)) -} - -func (*PageBlockCaption) GetClass() string { - return ClassPageBlockCaption -} - -func (*PageBlockCaption) GetType() string { - return TypePageBlockCaption -} - -func (pageBlockCaption *PageBlockCaption) UnmarshalJSON(data []byte) error { - var tmp struct { - Text json.RawMessage `json:"text"` - Credit json.RawMessage `json:"credit"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - fieldText, _ := UnmarshalRichText(tmp.Text) - pageBlockCaption.Text = fieldText - - fieldCredit, _ := UnmarshalRichText(tmp.Credit) - pageBlockCaption.Credit = fieldCredit - - return nil -} - -// Describes an item of a list page block -type PageBlockListItem struct { - meta - // Item label - Label string `json:"label"` - // Item blocks - PageBlocks []PageBlock `json:"page_blocks"` -} - -func (entity *PageBlockListItem) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PageBlockListItem - - return json.Marshal((*stub)(entity)) -} - -func (*PageBlockListItem) GetClass() string { - return ClassPageBlockListItem -} - -func (*PageBlockListItem) GetType() string { - return TypePageBlockListItem -} - -func (pageBlockListItem *PageBlockListItem) UnmarshalJSON(data []byte) error { - var tmp struct { - Label string `json:"label"` - PageBlocks []json.RawMessage `json:"page_blocks"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - pageBlockListItem.Label = tmp.Label - - fieldPageBlocks, _ := UnmarshalListOfPageBlock(tmp.PageBlocks) - pageBlockListItem.PageBlocks = fieldPageBlocks - - return nil -} - -// The content must be left-aligned -type PageBlockHorizontalAlignmentLeft struct { - meta -} - -func (entity *PageBlockHorizontalAlignmentLeft) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PageBlockHorizontalAlignmentLeft - - return json.Marshal((*stub)(entity)) -} - -func (*PageBlockHorizontalAlignmentLeft) GetClass() string { - return ClassPageBlockHorizontalAlignment -} - -func (*PageBlockHorizontalAlignmentLeft) GetType() string { - return TypePageBlockHorizontalAlignmentLeft -} - -func (*PageBlockHorizontalAlignmentLeft) PageBlockHorizontalAlignmentType() string { - return TypePageBlockHorizontalAlignmentLeft -} - -// The content must be center-aligned -type PageBlockHorizontalAlignmentCenter struct { - meta -} - -func (entity *PageBlockHorizontalAlignmentCenter) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PageBlockHorizontalAlignmentCenter - - return json.Marshal((*stub)(entity)) -} - -func (*PageBlockHorizontalAlignmentCenter) GetClass() string { - return ClassPageBlockHorizontalAlignment -} - -func (*PageBlockHorizontalAlignmentCenter) GetType() string { - return TypePageBlockHorizontalAlignmentCenter -} - -func (*PageBlockHorizontalAlignmentCenter) PageBlockHorizontalAlignmentType() string { - return TypePageBlockHorizontalAlignmentCenter -} - -// The content must be right-aligned -type PageBlockHorizontalAlignmentRight struct { - meta -} - -func (entity *PageBlockHorizontalAlignmentRight) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PageBlockHorizontalAlignmentRight - - return json.Marshal((*stub)(entity)) -} - -func (*PageBlockHorizontalAlignmentRight) GetClass() string { - return ClassPageBlockHorizontalAlignment -} - -func (*PageBlockHorizontalAlignmentRight) GetType() string { - return TypePageBlockHorizontalAlignmentRight -} - -func (*PageBlockHorizontalAlignmentRight) PageBlockHorizontalAlignmentType() string { - return TypePageBlockHorizontalAlignmentRight -} - -// The content must be top-aligned -type PageBlockVerticalAlignmentTop struct { - meta -} - -func (entity *PageBlockVerticalAlignmentTop) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PageBlockVerticalAlignmentTop - - return json.Marshal((*stub)(entity)) -} - -func (*PageBlockVerticalAlignmentTop) GetClass() string { - return ClassPageBlockVerticalAlignment -} - -func (*PageBlockVerticalAlignmentTop) GetType() string { - return TypePageBlockVerticalAlignmentTop -} - -func (*PageBlockVerticalAlignmentTop) PageBlockVerticalAlignmentType() string { - return TypePageBlockVerticalAlignmentTop -} - -// The content must be middle-aligned -type PageBlockVerticalAlignmentMiddle struct { - meta -} - -func (entity *PageBlockVerticalAlignmentMiddle) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PageBlockVerticalAlignmentMiddle - - return json.Marshal((*stub)(entity)) -} - -func (*PageBlockVerticalAlignmentMiddle) GetClass() string { - return ClassPageBlockVerticalAlignment -} - -func (*PageBlockVerticalAlignmentMiddle) GetType() string { - return TypePageBlockVerticalAlignmentMiddle -} - -func (*PageBlockVerticalAlignmentMiddle) PageBlockVerticalAlignmentType() string { - return TypePageBlockVerticalAlignmentMiddle -} - -// The content must be bottom-aligned -type PageBlockVerticalAlignmentBottom struct { - meta -} - -func (entity *PageBlockVerticalAlignmentBottom) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PageBlockVerticalAlignmentBottom - - return json.Marshal((*stub)(entity)) -} - -func (*PageBlockVerticalAlignmentBottom) GetClass() string { - return ClassPageBlockVerticalAlignment -} - -func (*PageBlockVerticalAlignmentBottom) GetType() string { - return TypePageBlockVerticalAlignmentBottom -} - -func (*PageBlockVerticalAlignmentBottom) PageBlockVerticalAlignmentType() string { - return TypePageBlockVerticalAlignmentBottom -} - -// Represents a cell of a table -type PageBlockTableCell struct { - 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"` -} - -func (entity *PageBlockTableCell) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PageBlockTableCell - - return json.Marshal((*stub)(entity)) -} - -func (*PageBlockTableCell) GetClass() string { - return ClassPageBlockTableCell -} - -func (*PageBlockTableCell) GetType() string { - return TypePageBlockTableCell -} - -func (pageBlockTableCell *PageBlockTableCell) UnmarshalJSON(data []byte) error { - 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"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - pageBlockTableCell.IsHeader = tmp.IsHeader - pageBlockTableCell.Colspan = tmp.Colspan - pageBlockTableCell.Rowspan = tmp.Rowspan - - fieldText, _ := UnmarshalRichText(tmp.Text) - pageBlockTableCell.Text = fieldText - - fieldAlign, _ := UnmarshalPageBlockHorizontalAlignment(tmp.Align) - pageBlockTableCell.Align = fieldAlign - - fieldValign, _ := UnmarshalPageBlockVerticalAlignment(tmp.Valign) - pageBlockTableCell.Valign = fieldValign - - return nil -} - -// Contains information about a related article -type PageBlockRelatedArticle struct { - 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"` -} - -func (entity *PageBlockRelatedArticle) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PageBlockRelatedArticle - - return json.Marshal((*stub)(entity)) -} - -func (*PageBlockRelatedArticle) GetClass() string { - return ClassPageBlockRelatedArticle -} - -func (*PageBlockRelatedArticle) GetType() string { - return TypePageBlockRelatedArticle -} - -// The title of a page -type PageBlockTitle struct { - meta - // Title - Title RichText `json:"title"` -} - -func (entity *PageBlockTitle) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PageBlockTitle - - return json.Marshal((*stub)(entity)) -} - -func (*PageBlockTitle) GetClass() string { - return ClassPageBlock -} - -func (*PageBlockTitle) GetType() string { - return TypePageBlockTitle -} - -func (*PageBlockTitle) PageBlockType() string { - return TypePageBlockTitle -} - -func (pageBlockTitle *PageBlockTitle) UnmarshalJSON(data []byte) error { - var tmp struct { - Title json.RawMessage `json:"title"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - fieldTitle, _ := UnmarshalRichText(tmp.Title) - pageBlockTitle.Title = fieldTitle - - return nil -} - -// The subtitle of a page -type PageBlockSubtitle struct { - meta - // Subtitle - Subtitle RichText `json:"subtitle"` -} - -func (entity *PageBlockSubtitle) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PageBlockSubtitle - - return json.Marshal((*stub)(entity)) -} - -func (*PageBlockSubtitle) GetClass() string { - return ClassPageBlock -} - -func (*PageBlockSubtitle) GetType() string { - return TypePageBlockSubtitle -} - -func (*PageBlockSubtitle) PageBlockType() string { - return TypePageBlockSubtitle -} - -func (pageBlockSubtitle *PageBlockSubtitle) UnmarshalJSON(data []byte) error { - var tmp struct { - Subtitle json.RawMessage `json:"subtitle"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - fieldSubtitle, _ := UnmarshalRichText(tmp.Subtitle) - pageBlockSubtitle.Subtitle = fieldSubtitle - - return nil -} - -// The author and publishing date of a page -type PageBlockAuthorDate struct { - meta - // Author - Author RichText `json:"author"` - // Point in time (Unix timestamp) when the article was published; 0 if unknown - PublishDate int32 `json:"publish_date"` -} - -func (entity *PageBlockAuthorDate) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PageBlockAuthorDate - - return json.Marshal((*stub)(entity)) -} - -func (*PageBlockAuthorDate) GetClass() string { - return ClassPageBlock -} - -func (*PageBlockAuthorDate) GetType() string { - return TypePageBlockAuthorDate -} - -func (*PageBlockAuthorDate) PageBlockType() string { - return TypePageBlockAuthorDate -} - -func (pageBlockAuthorDate *PageBlockAuthorDate) UnmarshalJSON(data []byte) error { - var tmp struct { - Author json.RawMessage `json:"author"` - PublishDate int32 `json:"publish_date"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - pageBlockAuthorDate.PublishDate = tmp.PublishDate - - fieldAuthor, _ := UnmarshalRichText(tmp.Author) - pageBlockAuthorDate.Author = fieldAuthor - - return nil -} - -// A header -type PageBlockHeader struct { - meta - // Header - Header RichText `json:"header"` -} - -func (entity *PageBlockHeader) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PageBlockHeader - - return json.Marshal((*stub)(entity)) -} - -func (*PageBlockHeader) GetClass() string { - return ClassPageBlock -} - -func (*PageBlockHeader) GetType() string { - return TypePageBlockHeader -} - -func (*PageBlockHeader) PageBlockType() string { - return TypePageBlockHeader -} - -func (pageBlockHeader *PageBlockHeader) UnmarshalJSON(data []byte) error { - var tmp struct { - Header json.RawMessage `json:"header"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - fieldHeader, _ := UnmarshalRichText(tmp.Header) - pageBlockHeader.Header = fieldHeader - - return nil -} - -// A subheader -type PageBlockSubheader struct { - meta - // Subheader - Subheader RichText `json:"subheader"` -} - -func (entity *PageBlockSubheader) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PageBlockSubheader - - return json.Marshal((*stub)(entity)) -} - -func (*PageBlockSubheader) GetClass() string { - return ClassPageBlock -} - -func (*PageBlockSubheader) GetType() string { - return TypePageBlockSubheader -} - -func (*PageBlockSubheader) PageBlockType() string { - return TypePageBlockSubheader -} - -func (pageBlockSubheader *PageBlockSubheader) UnmarshalJSON(data []byte) error { - var tmp struct { - Subheader json.RawMessage `json:"subheader"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - fieldSubheader, _ := UnmarshalRichText(tmp.Subheader) - pageBlockSubheader.Subheader = fieldSubheader - - return nil -} - -// A kicker -type PageBlockKicker struct { - meta - // Kicker - Kicker RichText `json:"kicker"` -} - -func (entity *PageBlockKicker) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PageBlockKicker - - return json.Marshal((*stub)(entity)) -} - -func (*PageBlockKicker) GetClass() string { - return ClassPageBlock -} - -func (*PageBlockKicker) GetType() string { - return TypePageBlockKicker -} - -func (*PageBlockKicker) PageBlockType() string { - return TypePageBlockKicker -} - -func (pageBlockKicker *PageBlockKicker) UnmarshalJSON(data []byte) error { - var tmp struct { - Kicker json.RawMessage `json:"kicker"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - fieldKicker, _ := UnmarshalRichText(tmp.Kicker) - pageBlockKicker.Kicker = fieldKicker - - return nil -} - -// A text paragraph -type PageBlockParagraph struct { - meta - // Paragraph text - Text RichText `json:"text"` -} - -func (entity *PageBlockParagraph) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PageBlockParagraph - - return json.Marshal((*stub)(entity)) -} - -func (*PageBlockParagraph) GetClass() string { - return ClassPageBlock -} - -func (*PageBlockParagraph) GetType() string { - return TypePageBlockParagraph -} - -func (*PageBlockParagraph) PageBlockType() string { - return TypePageBlockParagraph -} - -func (pageBlockParagraph *PageBlockParagraph) UnmarshalJSON(data []byte) error { - var tmp struct { - Text json.RawMessage `json:"text"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - fieldText, _ := UnmarshalRichText(tmp.Text) - pageBlockParagraph.Text = fieldText - - return nil -} - -// A preformatted text paragraph -type PageBlockPreformatted struct { - meta - // Paragraph text - Text RichText `json:"text"` - // Programming language for which the text needs to be formatted - Language string `json:"language"` -} - -func (entity *PageBlockPreformatted) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PageBlockPreformatted - - return json.Marshal((*stub)(entity)) -} - -func (*PageBlockPreformatted) GetClass() string { - return ClassPageBlock -} - -func (*PageBlockPreformatted) GetType() string { - return TypePageBlockPreformatted -} - -func (*PageBlockPreformatted) PageBlockType() string { - return TypePageBlockPreformatted -} - -func (pageBlockPreformatted *PageBlockPreformatted) UnmarshalJSON(data []byte) error { - var tmp struct { - Text json.RawMessage `json:"text"` - Language string `json:"language"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - pageBlockPreformatted.Language = tmp.Language - - fieldText, _ := UnmarshalRichText(tmp.Text) - pageBlockPreformatted.Text = fieldText - - return nil -} - -// The footer of a page -type PageBlockFooter struct { - meta - // Footer - Footer RichText `json:"footer"` -} - -func (entity *PageBlockFooter) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PageBlockFooter - - return json.Marshal((*stub)(entity)) -} - -func (*PageBlockFooter) GetClass() string { - return ClassPageBlock -} - -func (*PageBlockFooter) GetType() string { - return TypePageBlockFooter -} - -func (*PageBlockFooter) PageBlockType() string { - return TypePageBlockFooter -} - -func (pageBlockFooter *PageBlockFooter) UnmarshalJSON(data []byte) error { - var tmp struct { - Footer json.RawMessage `json:"footer"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - fieldFooter, _ := UnmarshalRichText(tmp.Footer) - pageBlockFooter.Footer = fieldFooter - - return nil -} - -// An empty block separating a page -type PageBlockDivider struct { - meta -} - -func (entity *PageBlockDivider) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PageBlockDivider - - return json.Marshal((*stub)(entity)) -} - -func (*PageBlockDivider) GetClass() string { - return ClassPageBlock -} - -func (*PageBlockDivider) GetType() string { - return TypePageBlockDivider -} - -func (*PageBlockDivider) PageBlockType() string { - return TypePageBlockDivider -} - -// An invisible anchor on a page, which can be used in a URL to open the page from the specified anchor -type PageBlockAnchor struct { - meta - // Name of the anchor - Name string `json:"name"` -} - -func (entity *PageBlockAnchor) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PageBlockAnchor - - return json.Marshal((*stub)(entity)) -} - -func (*PageBlockAnchor) GetClass() string { - return ClassPageBlock -} - -func (*PageBlockAnchor) GetType() string { - return TypePageBlockAnchor -} - -func (*PageBlockAnchor) PageBlockType() string { - return TypePageBlockAnchor -} - -// A list of data blocks -type PageBlockList struct { - meta - // The items of the list - Items []*PageBlockListItem `json:"items"` -} - -func (entity *PageBlockList) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PageBlockList - - return json.Marshal((*stub)(entity)) -} - -func (*PageBlockList) GetClass() string { - return ClassPageBlock -} - -func (*PageBlockList) GetType() string { - return TypePageBlockList -} - -func (*PageBlockList) PageBlockType() string { - return TypePageBlockList -} - -// A block quote -type PageBlockBlockQuote struct { - meta - // Quote text - Text RichText `json:"text"` - // Quote credit - Credit RichText `json:"credit"` -} - -func (entity *PageBlockBlockQuote) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PageBlockBlockQuote - - return json.Marshal((*stub)(entity)) -} - -func (*PageBlockBlockQuote) GetClass() string { - return ClassPageBlock -} - -func (*PageBlockBlockQuote) GetType() string { - return TypePageBlockBlockQuote -} - -func (*PageBlockBlockQuote) PageBlockType() string { - return TypePageBlockBlockQuote -} - -func (pageBlockBlockQuote *PageBlockBlockQuote) UnmarshalJSON(data []byte) error { - var tmp struct { - Text json.RawMessage `json:"text"` - Credit json.RawMessage `json:"credit"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - fieldText, _ := UnmarshalRichText(tmp.Text) - pageBlockBlockQuote.Text = fieldText - - fieldCredit, _ := UnmarshalRichText(tmp.Credit) - pageBlockBlockQuote.Credit = fieldCredit - - return nil -} - -// A pull quote -type PageBlockPullQuote struct { - meta - // Quote text - Text RichText `json:"text"` - // Quote credit - Credit RichText `json:"credit"` -} - -func (entity *PageBlockPullQuote) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PageBlockPullQuote - - return json.Marshal((*stub)(entity)) -} - -func (*PageBlockPullQuote) GetClass() string { - return ClassPageBlock -} - -func (*PageBlockPullQuote) GetType() string { - return TypePageBlockPullQuote -} - -func (*PageBlockPullQuote) PageBlockType() string { - return TypePageBlockPullQuote -} - -func (pageBlockPullQuote *PageBlockPullQuote) UnmarshalJSON(data []byte) error { - var tmp struct { - Text json.RawMessage `json:"text"` - Credit json.RawMessage `json:"credit"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - fieldText, _ := UnmarshalRichText(tmp.Text) - pageBlockPullQuote.Text = fieldText - - fieldCredit, _ := UnmarshalRichText(tmp.Credit) - pageBlockPullQuote.Credit = fieldCredit - - return nil -} - -// An animation -type PageBlockAnimation struct { - 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"` -} - -func (entity *PageBlockAnimation) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PageBlockAnimation - - return json.Marshal((*stub)(entity)) -} - -func (*PageBlockAnimation) GetClass() string { - return ClassPageBlock -} - -func (*PageBlockAnimation) GetType() string { - return TypePageBlockAnimation -} - -func (*PageBlockAnimation) PageBlockType() string { - return TypePageBlockAnimation -} - -// An audio file -type PageBlockAudio struct { - meta - // Audio file; may be null - Audio *Audio `json:"audio"` - // Audio file caption - Caption *PageBlockCaption `json:"caption"` -} - -func (entity *PageBlockAudio) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PageBlockAudio - - return json.Marshal((*stub)(entity)) -} - -func (*PageBlockAudio) GetClass() string { - return ClassPageBlock -} - -func (*PageBlockAudio) GetType() string { - return TypePageBlockAudio -} - -func (*PageBlockAudio) PageBlockType() string { - return TypePageBlockAudio -} - -// A photo -type PageBlockPhoto struct { - 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"` -} - -func (entity *PageBlockPhoto) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PageBlockPhoto - - return json.Marshal((*stub)(entity)) -} - -func (*PageBlockPhoto) GetClass() string { - return ClassPageBlock -} - -func (*PageBlockPhoto) GetType() string { - return TypePageBlockPhoto -} - -func (*PageBlockPhoto) PageBlockType() string { - return TypePageBlockPhoto -} - -// A video -type PageBlockVideo struct { - 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"` -} - -func (entity *PageBlockVideo) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PageBlockVideo - - return json.Marshal((*stub)(entity)) -} - -func (*PageBlockVideo) GetClass() string { - return ClassPageBlock -} - -func (*PageBlockVideo) GetType() string { - return TypePageBlockVideo -} - -func (*PageBlockVideo) PageBlockType() string { - return TypePageBlockVideo -} - -// A voice note -type PageBlockVoiceNote struct { - meta - // Voice note; may be null - VoiceNote *VoiceNote `json:"voice_note"` - // Voice note caption - Caption *PageBlockCaption `json:"caption"` -} - -func (entity *PageBlockVoiceNote) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PageBlockVoiceNote - - return json.Marshal((*stub)(entity)) -} - -func (*PageBlockVoiceNote) GetClass() string { - return ClassPageBlock -} - -func (*PageBlockVoiceNote) GetType() string { - return TypePageBlockVoiceNote -} - -func (*PageBlockVoiceNote) PageBlockType() string { - return TypePageBlockVoiceNote -} - -// A page cover -type PageBlockCover struct { - meta - // Cover - Cover PageBlock `json:"cover"` -} - -func (entity *PageBlockCover) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PageBlockCover - - return json.Marshal((*stub)(entity)) -} - -func (*PageBlockCover) GetClass() string { - return ClassPageBlock -} - -func (*PageBlockCover) GetType() string { - return TypePageBlockCover -} - -func (*PageBlockCover) PageBlockType() string { - return TypePageBlockCover -} - -func (pageBlockCover *PageBlockCover) UnmarshalJSON(data []byte) error { - var tmp struct { - Cover json.RawMessage `json:"cover"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - fieldCover, _ := UnmarshalPageBlock(tmp.Cover) - pageBlockCover.Cover = fieldCover - - return nil -} - -// An embedded web page -type PageBlockEmbedded struct { - 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"` -} - -func (entity *PageBlockEmbedded) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PageBlockEmbedded - - return json.Marshal((*stub)(entity)) -} - -func (*PageBlockEmbedded) GetClass() string { - return ClassPageBlock -} - -func (*PageBlockEmbedded) GetType() string { - return TypePageBlockEmbedded -} - -func (*PageBlockEmbedded) PageBlockType() string { - return TypePageBlockEmbedded -} - -// An embedded post -type PageBlockEmbeddedPost struct { - 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"` -} - -func (entity *PageBlockEmbeddedPost) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PageBlockEmbeddedPost - - return json.Marshal((*stub)(entity)) -} - -func (*PageBlockEmbeddedPost) GetClass() string { - return ClassPageBlock -} - -func (*PageBlockEmbeddedPost) GetType() string { - return TypePageBlockEmbeddedPost -} - -func (*PageBlockEmbeddedPost) PageBlockType() string { - return TypePageBlockEmbeddedPost -} - -func (pageBlockEmbeddedPost *PageBlockEmbeddedPost) UnmarshalJSON(data []byte) error { - 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"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - pageBlockEmbeddedPost.Url = tmp.Url - pageBlockEmbeddedPost.Author = tmp.Author - pageBlockEmbeddedPost.AuthorPhoto = tmp.AuthorPhoto - pageBlockEmbeddedPost.Date = tmp.Date - pageBlockEmbeddedPost.Caption = tmp.Caption - - fieldPageBlocks, _ := UnmarshalListOfPageBlock(tmp.PageBlocks) - pageBlockEmbeddedPost.PageBlocks = fieldPageBlocks - - return nil -} - -// A collage -type PageBlockCollage struct { - meta - // Collage item contents - PageBlocks []PageBlock `json:"page_blocks"` - // Block caption - Caption *PageBlockCaption `json:"caption"` -} - -func (entity *PageBlockCollage) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PageBlockCollage - - return json.Marshal((*stub)(entity)) -} - -func (*PageBlockCollage) GetClass() string { - return ClassPageBlock -} - -func (*PageBlockCollage) GetType() string { - return TypePageBlockCollage -} - -func (*PageBlockCollage) PageBlockType() string { - return TypePageBlockCollage -} - -func (pageBlockCollage *PageBlockCollage) UnmarshalJSON(data []byte) error { - var tmp struct { - PageBlocks []json.RawMessage `json:"page_blocks"` - Caption *PageBlockCaption `json:"caption"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - pageBlockCollage.Caption = tmp.Caption - - fieldPageBlocks, _ := UnmarshalListOfPageBlock(tmp.PageBlocks) - pageBlockCollage.PageBlocks = fieldPageBlocks - - return nil -} - -// A slideshow -type PageBlockSlideshow struct { - meta - // Slideshow item contents - PageBlocks []PageBlock `json:"page_blocks"` - // Block caption - Caption *PageBlockCaption `json:"caption"` -} - -func (entity *PageBlockSlideshow) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PageBlockSlideshow - - return json.Marshal((*stub)(entity)) -} - -func (*PageBlockSlideshow) GetClass() string { - return ClassPageBlock -} - -func (*PageBlockSlideshow) GetType() string { - return TypePageBlockSlideshow -} - -func (*PageBlockSlideshow) PageBlockType() string { - return TypePageBlockSlideshow -} - -func (pageBlockSlideshow *PageBlockSlideshow) UnmarshalJSON(data []byte) error { - var tmp struct { - PageBlocks []json.RawMessage `json:"page_blocks"` - Caption *PageBlockCaption `json:"caption"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - pageBlockSlideshow.Caption = tmp.Caption - - fieldPageBlocks, _ := UnmarshalListOfPageBlock(tmp.PageBlocks) - pageBlockSlideshow.PageBlocks = fieldPageBlocks - - return nil -} - -// A link to a chat -type PageBlockChatLink struct { - 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"` -} - -func (entity *PageBlockChatLink) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PageBlockChatLink - - return json.Marshal((*stub)(entity)) -} - -func (*PageBlockChatLink) GetClass() string { - return ClassPageBlock -} - -func (*PageBlockChatLink) GetType() string { - return TypePageBlockChatLink -} - -func (*PageBlockChatLink) PageBlockType() string { - return TypePageBlockChatLink -} - -// A table -type PageBlockTable struct { - 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"` -} - -func (entity *PageBlockTable) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PageBlockTable - - return json.Marshal((*stub)(entity)) -} - -func (*PageBlockTable) GetClass() string { - return ClassPageBlock -} - -func (*PageBlockTable) GetType() string { - return TypePageBlockTable -} - -func (*PageBlockTable) PageBlockType() string { - return TypePageBlockTable -} - -func (pageBlockTable *PageBlockTable) UnmarshalJSON(data []byte) error { - var tmp struct { - Caption json.RawMessage `json:"caption"` - Cells [][]*PageBlockTableCell `json:"cells"` - IsBordered bool `json:"is_bordered"` - IsStriped bool `json:"is_striped"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - pageBlockTable.Cells = tmp.Cells - pageBlockTable.IsBordered = tmp.IsBordered - pageBlockTable.IsStriped = tmp.IsStriped - - fieldCaption, _ := UnmarshalRichText(tmp.Caption) - pageBlockTable.Caption = fieldCaption - - return nil -} - -// A collapsible block -type PageBlockDetails struct { - 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"` -} - -func (entity *PageBlockDetails) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PageBlockDetails - - return json.Marshal((*stub)(entity)) -} - -func (*PageBlockDetails) GetClass() string { - return ClassPageBlock -} - -func (*PageBlockDetails) GetType() string { - return TypePageBlockDetails -} - -func (*PageBlockDetails) PageBlockType() string { - return TypePageBlockDetails -} - -func (pageBlockDetails *PageBlockDetails) UnmarshalJSON(data []byte) error { - var tmp struct { - Header json.RawMessage `json:"header"` - PageBlocks []json.RawMessage `json:"page_blocks"` - IsOpen bool `json:"is_open"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - pageBlockDetails.IsOpen = tmp.IsOpen - - fieldHeader, _ := UnmarshalRichText(tmp.Header) - pageBlockDetails.Header = fieldHeader - - fieldPageBlocks, _ := UnmarshalListOfPageBlock(tmp.PageBlocks) - pageBlockDetails.PageBlocks = fieldPageBlocks - - return nil -} - -// Related articles -type PageBlockRelatedArticles struct { - meta - // Block header - Header RichText `json:"header"` - // List of related articles - Articles []*PageBlockRelatedArticle `json:"articles"` -} - -func (entity *PageBlockRelatedArticles) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PageBlockRelatedArticles - - return json.Marshal((*stub)(entity)) -} - -func (*PageBlockRelatedArticles) GetClass() string { - return ClassPageBlock -} - -func (*PageBlockRelatedArticles) GetType() string { - return TypePageBlockRelatedArticles -} - -func (*PageBlockRelatedArticles) PageBlockType() string { - return TypePageBlockRelatedArticles -} - -func (pageBlockRelatedArticles *PageBlockRelatedArticles) UnmarshalJSON(data []byte) error { - var tmp struct { - Header json.RawMessage `json:"header"` - Articles []*PageBlockRelatedArticle `json:"articles"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - pageBlockRelatedArticles.Articles = tmp.Articles - - fieldHeader, _ := UnmarshalRichText(tmp.Header) - pageBlockRelatedArticles.Header = fieldHeader - - return nil -} - -// A map -type PageBlockMap struct { - 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"` -} - -func (entity *PageBlockMap) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PageBlockMap - - return json.Marshal((*stub)(entity)) -} - -func (*PageBlockMap) GetClass() string { - return ClassPageBlock -} - -func (*PageBlockMap) GetType() string { - return TypePageBlockMap -} - -func (*PageBlockMap) PageBlockType() string { - return TypePageBlockMap -} - -// Describes an instant view page for a web page -type WebPageInstantView struct { - 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"` -} - -func (entity *WebPageInstantView) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub WebPageInstantView - - return json.Marshal((*stub)(entity)) -} - -func (*WebPageInstantView) GetClass() string { - return ClassWebPageInstantView -} - -func (*WebPageInstantView) GetType() string { - return TypeWebPageInstantView -} - -func (webPageInstantView *WebPageInstantView) UnmarshalJSON(data []byte) error { - 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"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - webPageInstantView.ViewCount = tmp.ViewCount - webPageInstantView.Version = tmp.Version - webPageInstantView.IsRtl = tmp.IsRtl - webPageInstantView.IsFull = tmp.IsFull - - fieldPageBlocks, _ := UnmarshalListOfPageBlock(tmp.PageBlocks) - webPageInstantView.PageBlocks = fieldPageBlocks - - fieldFeedbackLink, _ := UnmarshalInternalLinkType(tmp.FeedbackLink) - webPageInstantView.FeedbackLink = fieldFeedbackLink - - return nil -} - -// Describes a web page preview -type WebPage struct { - 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 web page instant view (currently, can be 1 or 2); 0 if none - InstantViewVersion int32 `json:"instant_view_version"` -} - -func (entity *WebPage) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub WebPage - - return json.Marshal((*stub)(entity)) -} - -func (*WebPage) GetClass() string { - return ClassWebPage -} - -func (*WebPage) GetType() string { - return TypeWebPage -} - -// Contains information about a country -type CountryInfo struct { - 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"` -} - -func (entity *CountryInfo) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub CountryInfo - - return json.Marshal((*stub)(entity)) -} - -func (*CountryInfo) GetClass() string { - return ClassCountryInfo -} - -func (*CountryInfo) GetType() string { - return TypeCountryInfo -} - -// Contains information about countries -type Countries struct { - meta - // The list of countries - Countries []*CountryInfo `json:"countries"` -} - -func (entity *Countries) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub Countries - - return json.Marshal((*stub)(entity)) -} - -func (*Countries) GetClass() string { - return ClassCountries -} - -func (*Countries) GetType() string { - return TypeCountries -} - -// Contains information about a phone number -type PhoneNumberInfo struct { - 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"` - // True, if the phone number was bought on Fragment and isn't tied to a SIM card - IsAnonymous bool `json:"is_anonymous"` -} - -func (entity *PhoneNumberInfo) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PhoneNumberInfo - - return json.Marshal((*stub)(entity)) -} - -func (*PhoneNumberInfo) GetClass() string { - return ClassPhoneNumberInfo -} - -func (*PhoneNumberInfo) GetType() string { - return TypePhoneNumberInfo -} - -// Describes an action associated with a bank card number -type BankCardActionOpenUrl struct { - meta - // Action text - Text string `json:"text"` - // The URL to be opened - Url string `json:"url"` -} - -func (entity *BankCardActionOpenUrl) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub BankCardActionOpenUrl - - return json.Marshal((*stub)(entity)) -} - -func (*BankCardActionOpenUrl) GetClass() string { - return ClassBankCardActionOpenUrl -} - -func (*BankCardActionOpenUrl) GetType() string { - return TypeBankCardActionOpenUrl -} - -// Information about a bank card -type BankCardInfo struct { - 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"` -} - -func (entity *BankCardInfo) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub BankCardInfo - - return json.Marshal((*stub)(entity)) -} - -func (*BankCardInfo) GetClass() string { - return ClassBankCardInfo -} - -func (*BankCardInfo) GetType() string { - return TypeBankCardInfo -} - -// Describes an address -type Address struct { - 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"` -} - -func (entity *Address) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub Address - - return json.Marshal((*stub)(entity)) -} - -func (*Address) GetClass() string { - return ClassAddress -} - -func (*Address) GetType() string { - return TypeAddress -} - -// Contains parameters of the application theme -type ThemeParameters struct { - meta - // A color of the background in the RGB24 format - BackgroundColor int32 `json:"background_color"` - // A secondary color for the background in the RGB24 format - SecondaryBackgroundColor int32 `json:"secondary_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"` -} - -func (entity *ThemeParameters) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ThemeParameters - - return json.Marshal((*stub)(entity)) -} - -func (*ThemeParameters) GetClass() string { - return ClassThemeParameters -} - -func (*ThemeParameters) GetType() string { - return TypeThemeParameters -} - -// Portion of the price of a product (e.g., "delivery cost", "tax amount") -type LabeledPricePart struct { - 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"` -} - -func (entity *LabeledPricePart) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub LabeledPricePart - - return json.Marshal((*stub)(entity)) -} - -func (*LabeledPricePart) GetClass() string { - return ClassLabeledPricePart -} - -func (*LabeledPricePart) GetType() string { - return TypeLabeledPricePart -} - -// Product invoice -type Invoice struct { - 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"` - // An HTTP URL with terms of service for recurring payments. If non-empty, the invoice payment will result in recurring payments and the user must accept the terms of service before allowed to pay - RecurringPaymentTermsOfServiceUrl string `json:"recurring_payment_terms_of_service_url"` - // 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"` -} - -func (entity *Invoice) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub Invoice - - return json.Marshal((*stub)(entity)) -} - -func (*Invoice) GetClass() string { - return ClassInvoice -} - -func (*Invoice) GetType() string { - return TypeInvoice -} - -// Order information -type OrderInfo struct { - 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"` -} - -func (entity *OrderInfo) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub OrderInfo - - return json.Marshal((*stub)(entity)) -} - -func (*OrderInfo) GetClass() string { - return ClassOrderInfo -} - -func (*OrderInfo) GetType() string { - return TypeOrderInfo -} - -// One shipping option -type ShippingOption struct { - 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"` -} - -func (entity *ShippingOption) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ShippingOption - - return json.Marshal((*stub)(entity)) -} - -func (*ShippingOption) GetClass() string { - return ClassShippingOption -} - -func (*ShippingOption) GetType() string { - return TypeShippingOption -} - -// Contains information about saved payment credentials -type SavedCredentials struct { - meta - // Unique identifier of the saved credentials - Id string `json:"id"` - // Title of the saved credentials - Title string `json:"title"` -} - -func (entity *SavedCredentials) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub SavedCredentials - - return json.Marshal((*stub)(entity)) -} - -func (*SavedCredentials) GetClass() string { - return ClassSavedCredentials -} - -func (*SavedCredentials) GetType() string { - return TypeSavedCredentials -} - -// 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 { - meta - // Identifier of the saved credentials - SavedCredentialsId string `json:"saved_credentials_id"` -} - -func (entity *InputCredentialsSaved) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputCredentialsSaved - - return json.Marshal((*stub)(entity)) -} - -func (*InputCredentialsSaved) GetClass() string { - return ClassInputCredentials -} - -func (*InputCredentialsSaved) GetType() string { - return TypeInputCredentialsSaved -} - -func (*InputCredentialsSaved) InputCredentialsType() string { - return TypeInputCredentialsSaved -} - -// Applies if a user enters new credentials on a payment provider website -type InputCredentialsNew struct { - 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"` -} - -func (entity *InputCredentialsNew) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputCredentialsNew - - return json.Marshal((*stub)(entity)) -} - -func (*InputCredentialsNew) GetClass() string { - return ClassInputCredentials -} - -func (*InputCredentialsNew) GetType() string { - return TypeInputCredentialsNew -} - -func (*InputCredentialsNew) InputCredentialsType() string { - return TypeInputCredentialsNew -} - -// Applies if a user enters new credentials using Apple Pay -type InputCredentialsApplePay struct { - meta - // JSON-encoded data with the credential identifier - Data string `json:"data"` -} - -func (entity *InputCredentialsApplePay) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputCredentialsApplePay - - return json.Marshal((*stub)(entity)) -} - -func (*InputCredentialsApplePay) GetClass() string { - return ClassInputCredentials -} - -func (*InputCredentialsApplePay) GetType() string { - return TypeInputCredentialsApplePay -} - -func (*InputCredentialsApplePay) InputCredentialsType() string { - return TypeInputCredentialsApplePay -} - -// Applies if a user enters new credentials using Google Pay -type InputCredentialsGooglePay struct { - meta - // JSON-encoded data with the credential identifier - Data string `json:"data"` -} - -func (entity *InputCredentialsGooglePay) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputCredentialsGooglePay - - return json.Marshal((*stub)(entity)) -} - -func (*InputCredentialsGooglePay) GetClass() string { - return ClassInputCredentials -} - -func (*InputCredentialsGooglePay) GetType() string { - return TypeInputCredentialsGooglePay -} - -func (*InputCredentialsGooglePay) InputCredentialsType() string { - return TypeInputCredentialsGooglePay -} - -// Smart Glocal payment provider -type PaymentProviderSmartGlocal struct { - meta - // Public payment token - PublicToken string `json:"public_token"` -} - -func (entity *PaymentProviderSmartGlocal) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PaymentProviderSmartGlocal - - return json.Marshal((*stub)(entity)) -} - -func (*PaymentProviderSmartGlocal) GetClass() string { - return ClassPaymentProvider -} - -func (*PaymentProviderSmartGlocal) GetType() string { - return TypePaymentProviderSmartGlocal -} - -func (*PaymentProviderSmartGlocal) PaymentProviderType() string { - return TypePaymentProviderSmartGlocal -} - -// Stripe payment provider -type PaymentProviderStripe struct { - 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"` -} - -func (entity *PaymentProviderStripe) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PaymentProviderStripe - - return json.Marshal((*stub)(entity)) -} - -func (*PaymentProviderStripe) GetClass() string { - return ClassPaymentProvider -} - -func (*PaymentProviderStripe) GetType() string { - return TypePaymentProviderStripe -} - -func (*PaymentProviderStripe) PaymentProviderType() string { - return TypePaymentProviderStripe -} - -// Some other payment provider, for which a web payment form must be shown -type PaymentProviderOther struct { - meta - // Payment form URL - Url string `json:"url"` -} - -func (entity *PaymentProviderOther) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PaymentProviderOther - - return json.Marshal((*stub)(entity)) -} - -func (*PaymentProviderOther) GetClass() string { - return ClassPaymentProvider -} - -func (*PaymentProviderOther) GetType() string { - return TypePaymentProviderOther -} - -func (*PaymentProviderOther) PaymentProviderType() string { - return TypePaymentProviderOther -} - -// Describes an additional payment option -type PaymentOption struct { - meta - // Title for the payment option - Title string `json:"title"` - // Payment form URL to be opened in a web view - Url string `json:"url"` -} - -func (entity *PaymentOption) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PaymentOption - - return json.Marshal((*stub)(entity)) -} - -func (*PaymentOption) GetClass() string { - return ClassPaymentOption -} - -func (*PaymentOption) GetType() string { - return TypePaymentOption -} - -// Contains information about an invoice payment form -type PaymentForm struct { - meta - // The payment form identifier - Id JsonInt64 `json:"id"` - // Full information about the invoice - Invoice *Invoice `json:"invoice"` - // User identifier of the seller bot - SellerBotUserId int64 `json:"seller_bot_user_id"` - // User identifier of the payment provider bot - PaymentProviderUserId int64 `json:"payment_provider_user_id"` - // Information about the payment provider - PaymentProvider PaymentProvider `json:"payment_provider"` - // The list of additional payment options - AdditionalPaymentOptions []*PaymentOption `json:"additional_payment_options"` - // Saved server-side order information; may be null - SavedOrderInfo *OrderInfo `json:"saved_order_info"` - // The list of saved payment credentials - 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, if sets up a 2-step verification password - NeedPassword bool `json:"need_password"` - // Product title - ProductTitle string `json:"product_title"` - // Product description - ProductDescription *FormattedText `json:"product_description"` - // Product photo; may be null - ProductPhoto *Photo `json:"product_photo"` -} - -func (entity *PaymentForm) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PaymentForm - - return json.Marshal((*stub)(entity)) -} - -func (*PaymentForm) GetClass() string { - return ClassPaymentForm -} - -func (*PaymentForm) GetType() string { - return TypePaymentForm -} - -func (paymentForm *PaymentForm) UnmarshalJSON(data []byte) error { - var tmp struct { - Id JsonInt64 `json:"id"` - Invoice *Invoice `json:"invoice"` - SellerBotUserId int64 `json:"seller_bot_user_id"` - PaymentProviderUserId int64 `json:"payment_provider_user_id"` - PaymentProvider json.RawMessage `json:"payment_provider"` - AdditionalPaymentOptions []*PaymentOption `json:"additional_payment_options"` - SavedOrderInfo *OrderInfo `json:"saved_order_info"` - SavedCredentials []*SavedCredentials `json:"saved_credentials"` - CanSaveCredentials bool `json:"can_save_credentials"` - NeedPassword bool `json:"need_password"` - ProductTitle string `json:"product_title"` - ProductDescription *FormattedText `json:"product_description"` - ProductPhoto *Photo `json:"product_photo"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - paymentForm.Id = tmp.Id - paymentForm.Invoice = tmp.Invoice - paymentForm.SellerBotUserId = tmp.SellerBotUserId - paymentForm.PaymentProviderUserId = tmp.PaymentProviderUserId - paymentForm.AdditionalPaymentOptions = tmp.AdditionalPaymentOptions - paymentForm.SavedOrderInfo = tmp.SavedOrderInfo - paymentForm.SavedCredentials = tmp.SavedCredentials - paymentForm.CanSaveCredentials = tmp.CanSaveCredentials - paymentForm.NeedPassword = tmp.NeedPassword - paymentForm.ProductTitle = tmp.ProductTitle - paymentForm.ProductDescription = tmp.ProductDescription - paymentForm.ProductPhoto = tmp.ProductPhoto - - fieldPaymentProvider, _ := UnmarshalPaymentProvider(tmp.PaymentProvider) - paymentForm.PaymentProvider = fieldPaymentProvider - - return nil -} - -// Contains a temporary identifier of validated order information, which is stored for one hour. Also contains the available shipping options -type ValidatedOrderInfo struct { - meta - // Temporary identifier of the order information - OrderInfoId string `json:"order_info_id"` - // Available shipping options - ShippingOptions []*ShippingOption `json:"shipping_options"` -} - -func (entity *ValidatedOrderInfo) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ValidatedOrderInfo - - return json.Marshal((*stub)(entity)) -} - -func (*ValidatedOrderInfo) GetClass() string { - return ClassValidatedOrderInfo -} - -func (*ValidatedOrderInfo) GetType() string { - return TypeValidatedOrderInfo -} - -// Contains the result of a payment request -type PaymentResult struct { - 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"` -} - -func (entity *PaymentResult) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PaymentResult - - return json.Marshal((*stub)(entity)) -} - -func (*PaymentResult) GetClass() string { - return ClassPaymentResult -} - -func (*PaymentResult) GetType() string { - return TypePaymentResult -} - -// Contains information about a successful payment -type PaymentReceipt struct { - meta - // Product title - Title string `json:"title"` - // Product description - Description *FormattedText `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 - PaymentProviderUserId int64 `json:"payment_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"` -} - -func (entity *PaymentReceipt) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PaymentReceipt - - return json.Marshal((*stub)(entity)) -} - -func (*PaymentReceipt) GetClass() string { - return ClassPaymentReceipt -} - -func (*PaymentReceipt) GetType() string { - return TypePaymentReceipt -} - -// An invoice from a message of the type messageInvoice -type InputInvoiceMessage struct { - meta - // Chat identifier of the message - ChatId int64 `json:"chat_id"` - // Message identifier - MessageId int64 `json:"message_id"` -} - -func (entity *InputInvoiceMessage) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputInvoiceMessage - - return json.Marshal((*stub)(entity)) -} - -func (*InputInvoiceMessage) GetClass() string { - return ClassInputInvoice -} - -func (*InputInvoiceMessage) GetType() string { - return TypeInputInvoiceMessage -} - -func (*InputInvoiceMessage) InputInvoiceType() string { - return TypeInputInvoiceMessage -} - -// An invoice from a link of the type internalLinkTypeInvoice -type InputInvoiceName struct { - meta - // Name of the invoice - Name string `json:"name"` -} - -func (entity *InputInvoiceName) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputInvoiceName - - return json.Marshal((*stub)(entity)) -} - -func (*InputInvoiceName) GetClass() string { - return ClassInputInvoice -} - -func (*InputInvoiceName) GetType() string { - return TypeInputInvoiceName -} - -func (*InputInvoiceName) InputInvoiceType() string { - return TypeInputInvoiceName -} - -// The media is hidden until the invoice is paid -type MessageExtendedMediaPreview struct { - meta - // Media width; 0 if unknown - Width int32 `json:"width"` - // Media height; 0 if unknown - Height int32 `json:"height"` - // Media duration; 0 if unknown - Duration int32 `json:"duration"` - // Media minithumbnail; may be null - Minithumbnail *Minithumbnail `json:"minithumbnail"` - // Media caption - Caption *FormattedText `json:"caption"` -} - -func (entity *MessageExtendedMediaPreview) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageExtendedMediaPreview - - return json.Marshal((*stub)(entity)) -} - -func (*MessageExtendedMediaPreview) GetClass() string { - return ClassMessageExtendedMedia -} - -func (*MessageExtendedMediaPreview) GetType() string { - return TypeMessageExtendedMediaPreview -} - -func (*MessageExtendedMediaPreview) MessageExtendedMediaType() string { - return TypeMessageExtendedMediaPreview -} - -// The media is a photo -type MessageExtendedMediaPhoto struct { - meta - // The photo - Photo *Photo `json:"photo"` - // Photo caption - Caption *FormattedText `json:"caption"` -} - -func (entity *MessageExtendedMediaPhoto) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageExtendedMediaPhoto - - return json.Marshal((*stub)(entity)) -} - -func (*MessageExtendedMediaPhoto) GetClass() string { - return ClassMessageExtendedMedia -} - -func (*MessageExtendedMediaPhoto) GetType() string { - return TypeMessageExtendedMediaPhoto -} - -func (*MessageExtendedMediaPhoto) MessageExtendedMediaType() string { - return TypeMessageExtendedMediaPhoto -} - -// The media is a video -type MessageExtendedMediaVideo struct { - meta - // The video - Video *Video `json:"video"` - // Photo caption - Caption *FormattedText `json:"caption"` -} - -func (entity *MessageExtendedMediaVideo) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageExtendedMediaVideo - - return json.Marshal((*stub)(entity)) -} - -func (*MessageExtendedMediaVideo) GetClass() string { - return ClassMessageExtendedMedia -} - -func (*MessageExtendedMediaVideo) GetType() string { - return TypeMessageExtendedMediaVideo -} - -func (*MessageExtendedMediaVideo) MessageExtendedMediaType() string { - return TypeMessageExtendedMediaVideo -} - -// The media is unuspported -type MessageExtendedMediaUnsupported struct { - meta - // Media caption - Caption *FormattedText `json:"caption"` -} - -func (entity *MessageExtendedMediaUnsupported) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageExtendedMediaUnsupported - - return json.Marshal((*stub)(entity)) -} - -func (*MessageExtendedMediaUnsupported) GetClass() string { - return ClassMessageExtendedMedia -} - -func (*MessageExtendedMediaUnsupported) GetType() string { - return TypeMessageExtendedMediaUnsupported -} - -func (*MessageExtendedMediaUnsupported) MessageExtendedMediaType() string { - return TypeMessageExtendedMediaUnsupported -} - -// File with the date it was uploaded -type DatedFile struct { - meta - // The file - File *File `json:"file"` - // Point in time (Unix timestamp) when the file was uploaded - Date int32 `json:"date"` -} - -func (entity *DatedFile) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub DatedFile - - return json.Marshal((*stub)(entity)) -} - -func (*DatedFile) GetClass() string { - return ClassDatedFile -} - -func (*DatedFile) GetType() string { - return TypeDatedFile -} - -// A Telegram Passport element containing the user's personal details -type PassportElementTypePersonalDetails struct { - meta -} - -func (entity *PassportElementTypePersonalDetails) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PassportElementTypePersonalDetails - - return json.Marshal((*stub)(entity)) -} - -func (*PassportElementTypePersonalDetails) GetClass() string { - return ClassPassportElementType -} - -func (*PassportElementTypePersonalDetails) GetType() string { - return TypePassportElementTypePersonalDetails -} - -func (*PassportElementTypePersonalDetails) PassportElementTypeType() string { - return TypePassportElementTypePersonalDetails -} - -// A Telegram Passport element containing the user's passport -type PassportElementTypePassport struct { - meta -} - -func (entity *PassportElementTypePassport) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PassportElementTypePassport - - return json.Marshal((*stub)(entity)) -} - -func (*PassportElementTypePassport) GetClass() string { - return ClassPassportElementType -} - -func (*PassportElementTypePassport) GetType() string { - return TypePassportElementTypePassport -} - -func (*PassportElementTypePassport) PassportElementTypeType() string { - return TypePassportElementTypePassport -} - -// A Telegram Passport element containing the user's driver license -type PassportElementTypeDriverLicense struct { - meta -} - -func (entity *PassportElementTypeDriverLicense) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PassportElementTypeDriverLicense - - return json.Marshal((*stub)(entity)) -} - -func (*PassportElementTypeDriverLicense) GetClass() string { - return ClassPassportElementType -} - -func (*PassportElementTypeDriverLicense) GetType() string { - return TypePassportElementTypeDriverLicense -} - -func (*PassportElementTypeDriverLicense) PassportElementTypeType() string { - return TypePassportElementTypeDriverLicense -} - -// A Telegram Passport element containing the user's identity card -type PassportElementTypeIdentityCard struct { - meta -} - -func (entity *PassportElementTypeIdentityCard) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PassportElementTypeIdentityCard - - return json.Marshal((*stub)(entity)) -} - -func (*PassportElementTypeIdentityCard) GetClass() string { - return ClassPassportElementType -} - -func (*PassportElementTypeIdentityCard) GetType() string { - return TypePassportElementTypeIdentityCard -} - -func (*PassportElementTypeIdentityCard) PassportElementTypeType() string { - return TypePassportElementTypeIdentityCard -} - -// A Telegram Passport element containing the user's internal passport -type PassportElementTypeInternalPassport struct { - meta -} - -func (entity *PassportElementTypeInternalPassport) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PassportElementTypeInternalPassport - - return json.Marshal((*stub)(entity)) -} - -func (*PassportElementTypeInternalPassport) GetClass() string { - return ClassPassportElementType -} - -func (*PassportElementTypeInternalPassport) GetType() string { - return TypePassportElementTypeInternalPassport -} - -func (*PassportElementTypeInternalPassport) PassportElementTypeType() string { - return TypePassportElementTypeInternalPassport -} - -// A Telegram Passport element containing the user's address -type PassportElementTypeAddress struct { - meta -} - -func (entity *PassportElementTypeAddress) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PassportElementTypeAddress - - return json.Marshal((*stub)(entity)) -} - -func (*PassportElementTypeAddress) GetClass() string { - return ClassPassportElementType -} - -func (*PassportElementTypeAddress) GetType() string { - return TypePassportElementTypeAddress -} - -func (*PassportElementTypeAddress) PassportElementTypeType() string { - return TypePassportElementTypeAddress -} - -// A Telegram Passport element containing the user's utility bill -type PassportElementTypeUtilityBill struct { - meta -} - -func (entity *PassportElementTypeUtilityBill) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PassportElementTypeUtilityBill - - return json.Marshal((*stub)(entity)) -} - -func (*PassportElementTypeUtilityBill) GetClass() string { - return ClassPassportElementType -} - -func (*PassportElementTypeUtilityBill) GetType() string { - return TypePassportElementTypeUtilityBill -} - -func (*PassportElementTypeUtilityBill) PassportElementTypeType() string { - return TypePassportElementTypeUtilityBill -} - -// A Telegram Passport element containing the user's bank statement -type PassportElementTypeBankStatement struct { - meta -} - -func (entity *PassportElementTypeBankStatement) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PassportElementTypeBankStatement - - return json.Marshal((*stub)(entity)) -} - -func (*PassportElementTypeBankStatement) GetClass() string { - return ClassPassportElementType -} - -func (*PassportElementTypeBankStatement) GetType() string { - return TypePassportElementTypeBankStatement -} - -func (*PassportElementTypeBankStatement) PassportElementTypeType() string { - return TypePassportElementTypeBankStatement -} - -// A Telegram Passport element containing the user's rental agreement -type PassportElementTypeRentalAgreement struct { - meta -} - -func (entity *PassportElementTypeRentalAgreement) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PassportElementTypeRentalAgreement - - return json.Marshal((*stub)(entity)) -} - -func (*PassportElementTypeRentalAgreement) GetClass() string { - return ClassPassportElementType -} - -func (*PassportElementTypeRentalAgreement) GetType() string { - return TypePassportElementTypeRentalAgreement -} - -func (*PassportElementTypeRentalAgreement) PassportElementTypeType() string { - return TypePassportElementTypeRentalAgreement -} - -// A Telegram Passport element containing the registration page of the user's passport -type PassportElementTypePassportRegistration struct { - meta -} - -func (entity *PassportElementTypePassportRegistration) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PassportElementTypePassportRegistration - - return json.Marshal((*stub)(entity)) -} - -func (*PassportElementTypePassportRegistration) GetClass() string { - return ClassPassportElementType -} - -func (*PassportElementTypePassportRegistration) GetType() string { - return TypePassportElementTypePassportRegistration -} - -func (*PassportElementTypePassportRegistration) PassportElementTypeType() string { - return TypePassportElementTypePassportRegistration -} - -// A Telegram Passport element containing the user's temporary registration -type PassportElementTypeTemporaryRegistration struct { - meta -} - -func (entity *PassportElementTypeTemporaryRegistration) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PassportElementTypeTemporaryRegistration - - return json.Marshal((*stub)(entity)) -} - -func (*PassportElementTypeTemporaryRegistration) GetClass() string { - return ClassPassportElementType -} - -func (*PassportElementTypeTemporaryRegistration) GetType() string { - return TypePassportElementTypeTemporaryRegistration -} - -func (*PassportElementTypeTemporaryRegistration) PassportElementTypeType() string { - return TypePassportElementTypeTemporaryRegistration -} - -// A Telegram Passport element containing the user's phone number -type PassportElementTypePhoneNumber struct { - meta -} - -func (entity *PassportElementTypePhoneNumber) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PassportElementTypePhoneNumber - - return json.Marshal((*stub)(entity)) -} - -func (*PassportElementTypePhoneNumber) GetClass() string { - return ClassPassportElementType -} - -func (*PassportElementTypePhoneNumber) GetType() string { - return TypePassportElementTypePhoneNumber -} - -func (*PassportElementTypePhoneNumber) PassportElementTypeType() string { - return TypePassportElementTypePhoneNumber -} - -// A Telegram Passport element containing the user's email address -type PassportElementTypeEmailAddress struct { - meta -} - -func (entity *PassportElementTypeEmailAddress) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PassportElementTypeEmailAddress - - return json.Marshal((*stub)(entity)) -} - -func (*PassportElementTypeEmailAddress) GetClass() string { - return ClassPassportElementType -} - -func (*PassportElementTypeEmailAddress) GetType() string { - return TypePassportElementTypeEmailAddress -} - -func (*PassportElementTypeEmailAddress) PassportElementTypeType() string { - return TypePassportElementTypeEmailAddress -} - -// Represents a date according to the Gregorian calendar -type Date struct { - 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"` -} - -func (entity *Date) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub Date - - return json.Marshal((*stub)(entity)) -} - -func (*Date) GetClass() string { - return ClassDate -} - -func (*Date) GetType() string { - return TypeDate -} - -// Contains the user's personal details -type PersonalDetails struct { - 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"` -} - -func (entity *PersonalDetails) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PersonalDetails - - return json.Marshal((*stub)(entity)) -} - -func (*PersonalDetails) GetClass() string { - return ClassPersonalDetails -} - -func (*PersonalDetails) GetType() string { - return TypePersonalDetails -} - -// An identity document -type IdentityDocument struct { - 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"` -} - -func (entity *IdentityDocument) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub IdentityDocument - - return json.Marshal((*stub)(entity)) -} - -func (*IdentityDocument) GetClass() string { - return ClassIdentityDocument -} - -func (*IdentityDocument) GetType() string { - return TypeIdentityDocument -} - -// An identity document to be saved to Telegram Passport -type InputIdentityDocument struct { - 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"` -} - -func (entity *InputIdentityDocument) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputIdentityDocument - - return json.Marshal((*stub)(entity)) -} - -func (*InputIdentityDocument) GetClass() string { - return ClassInputIdentityDocument -} - -func (*InputIdentityDocument) GetType() string { - return TypeInputIdentityDocument -} - -func (inputIdentityDocument *InputIdentityDocument) UnmarshalJSON(data []byte) error { - 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"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - inputIdentityDocument.Number = tmp.Number - inputIdentityDocument.ExpiryDate = tmp.ExpiryDate - - fieldFrontSide, _ := UnmarshalInputFile(tmp.FrontSide) - inputIdentityDocument.FrontSide = fieldFrontSide - - fieldReverseSide, _ := UnmarshalInputFile(tmp.ReverseSide) - inputIdentityDocument.ReverseSide = fieldReverseSide - - fieldSelfie, _ := UnmarshalInputFile(tmp.Selfie) - inputIdentityDocument.Selfie = fieldSelfie - - fieldTranslation, _ := UnmarshalListOfInputFile(tmp.Translation) - inputIdentityDocument.Translation = fieldTranslation - - return nil -} - -// A personal document, containing some information about a user -type PersonalDocument struct { - 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"` -} - -func (entity *PersonalDocument) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PersonalDocument - - return json.Marshal((*stub)(entity)) -} - -func (*PersonalDocument) GetClass() string { - return ClassPersonalDocument -} - -func (*PersonalDocument) GetType() string { - return TypePersonalDocument -} - -// A personal document to be saved to Telegram Passport -type InputPersonalDocument struct { - 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"` -} - -func (entity *InputPersonalDocument) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputPersonalDocument - - return json.Marshal((*stub)(entity)) -} - -func (*InputPersonalDocument) GetClass() string { - return ClassInputPersonalDocument -} - -func (*InputPersonalDocument) GetType() string { - return TypeInputPersonalDocument -} - -func (inputPersonalDocument *InputPersonalDocument) UnmarshalJSON(data []byte) error { - var tmp struct { - Files []json.RawMessage `json:"files"` - Translation []json.RawMessage `json:"translation"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - fieldFiles, _ := UnmarshalListOfInputFile(tmp.Files) - inputPersonalDocument.Files = fieldFiles - - fieldTranslation, _ := UnmarshalListOfInputFile(tmp.Translation) - inputPersonalDocument.Translation = fieldTranslation - - return nil -} - -// A Telegram Passport element containing the user's personal details -type PassportElementPersonalDetails struct { - meta - // Personal details of the user - PersonalDetails *PersonalDetails `json:"personal_details"` -} - -func (entity *PassportElementPersonalDetails) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PassportElementPersonalDetails - - return json.Marshal((*stub)(entity)) -} - -func (*PassportElementPersonalDetails) GetClass() string { - return ClassPassportElement -} - -func (*PassportElementPersonalDetails) GetType() string { - return TypePassportElementPersonalDetails -} - -func (*PassportElementPersonalDetails) PassportElementType() string { - return TypePassportElementPersonalDetails -} - -// A Telegram Passport element containing the user's passport -type PassportElementPassport struct { - meta - // Passport - Passport *IdentityDocument `json:"passport"` -} - -func (entity *PassportElementPassport) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PassportElementPassport - - return json.Marshal((*stub)(entity)) -} - -func (*PassportElementPassport) GetClass() string { - return ClassPassportElement -} - -func (*PassportElementPassport) GetType() string { - return TypePassportElementPassport -} - -func (*PassportElementPassport) PassportElementType() string { - return TypePassportElementPassport -} - -// A Telegram Passport element containing the user's driver license -type PassportElementDriverLicense struct { - meta - // Driver license - DriverLicense *IdentityDocument `json:"driver_license"` -} - -func (entity *PassportElementDriverLicense) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PassportElementDriverLicense - - return json.Marshal((*stub)(entity)) -} - -func (*PassportElementDriverLicense) GetClass() string { - return ClassPassportElement -} - -func (*PassportElementDriverLicense) GetType() string { - return TypePassportElementDriverLicense -} - -func (*PassportElementDriverLicense) PassportElementType() string { - return TypePassportElementDriverLicense -} - -// A Telegram Passport element containing the user's identity card -type PassportElementIdentityCard struct { - meta - // Identity card - IdentityCard *IdentityDocument `json:"identity_card"` -} - -func (entity *PassportElementIdentityCard) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PassportElementIdentityCard - - return json.Marshal((*stub)(entity)) -} - -func (*PassportElementIdentityCard) GetClass() string { - return ClassPassportElement -} - -func (*PassportElementIdentityCard) GetType() string { - return TypePassportElementIdentityCard -} - -func (*PassportElementIdentityCard) PassportElementType() string { - return TypePassportElementIdentityCard -} - -// A Telegram Passport element containing the user's internal passport -type PassportElementInternalPassport struct { - meta - // Internal passport - InternalPassport *IdentityDocument `json:"internal_passport"` -} - -func (entity *PassportElementInternalPassport) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PassportElementInternalPassport - - return json.Marshal((*stub)(entity)) -} - -func (*PassportElementInternalPassport) GetClass() string { - return ClassPassportElement -} - -func (*PassportElementInternalPassport) GetType() string { - return TypePassportElementInternalPassport -} - -func (*PassportElementInternalPassport) PassportElementType() string { - return TypePassportElementInternalPassport -} - -// A Telegram Passport element containing the user's address -type PassportElementAddress struct { - meta - // Address - Address *Address `json:"address"` -} - -func (entity *PassportElementAddress) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PassportElementAddress - - return json.Marshal((*stub)(entity)) -} - -func (*PassportElementAddress) GetClass() string { - return ClassPassportElement -} - -func (*PassportElementAddress) GetType() string { - return TypePassportElementAddress -} - -func (*PassportElementAddress) PassportElementType() string { - return TypePassportElementAddress -} - -// A Telegram Passport element containing the user's utility bill -type PassportElementUtilityBill struct { - meta - // Utility bill - UtilityBill *PersonalDocument `json:"utility_bill"` -} - -func (entity *PassportElementUtilityBill) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PassportElementUtilityBill - - return json.Marshal((*stub)(entity)) -} - -func (*PassportElementUtilityBill) GetClass() string { - return ClassPassportElement -} - -func (*PassportElementUtilityBill) GetType() string { - return TypePassportElementUtilityBill -} - -func (*PassportElementUtilityBill) PassportElementType() string { - return TypePassportElementUtilityBill -} - -// A Telegram Passport element containing the user's bank statement -type PassportElementBankStatement struct { - meta - // Bank statement - BankStatement *PersonalDocument `json:"bank_statement"` -} - -func (entity *PassportElementBankStatement) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PassportElementBankStatement - - return json.Marshal((*stub)(entity)) -} - -func (*PassportElementBankStatement) GetClass() string { - return ClassPassportElement -} - -func (*PassportElementBankStatement) GetType() string { - return TypePassportElementBankStatement -} - -func (*PassportElementBankStatement) PassportElementType() string { - return TypePassportElementBankStatement -} - -// A Telegram Passport element containing the user's rental agreement -type PassportElementRentalAgreement struct { - meta - // Rental agreement - RentalAgreement *PersonalDocument `json:"rental_agreement"` -} - -func (entity *PassportElementRentalAgreement) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PassportElementRentalAgreement - - return json.Marshal((*stub)(entity)) -} - -func (*PassportElementRentalAgreement) GetClass() string { - return ClassPassportElement -} - -func (*PassportElementRentalAgreement) GetType() string { - return TypePassportElementRentalAgreement -} - -func (*PassportElementRentalAgreement) PassportElementType() string { - return TypePassportElementRentalAgreement -} - -// A Telegram Passport element containing the user's passport registration pages -type PassportElementPassportRegistration struct { - meta - // Passport registration pages - PassportRegistration *PersonalDocument `json:"passport_registration"` -} - -func (entity *PassportElementPassportRegistration) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PassportElementPassportRegistration - - return json.Marshal((*stub)(entity)) -} - -func (*PassportElementPassportRegistration) GetClass() string { - return ClassPassportElement -} - -func (*PassportElementPassportRegistration) GetType() string { - return TypePassportElementPassportRegistration -} - -func (*PassportElementPassportRegistration) PassportElementType() string { - return TypePassportElementPassportRegistration -} - -// A Telegram Passport element containing the user's temporary registration -type PassportElementTemporaryRegistration struct { - meta - // Temporary registration - TemporaryRegistration *PersonalDocument `json:"temporary_registration"` -} - -func (entity *PassportElementTemporaryRegistration) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PassportElementTemporaryRegistration - - return json.Marshal((*stub)(entity)) -} - -func (*PassportElementTemporaryRegistration) GetClass() string { - return ClassPassportElement -} - -func (*PassportElementTemporaryRegistration) GetType() string { - return TypePassportElementTemporaryRegistration -} - -func (*PassportElementTemporaryRegistration) PassportElementType() string { - return TypePassportElementTemporaryRegistration -} - -// A Telegram Passport element containing the user's phone number -type PassportElementPhoneNumber struct { - meta - // Phone number - PhoneNumber string `json:"phone_number"` -} - -func (entity *PassportElementPhoneNumber) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PassportElementPhoneNumber - - return json.Marshal((*stub)(entity)) -} - -func (*PassportElementPhoneNumber) GetClass() string { - return ClassPassportElement -} - -func (*PassportElementPhoneNumber) GetType() string { - return TypePassportElementPhoneNumber -} - -func (*PassportElementPhoneNumber) PassportElementType() string { - return TypePassportElementPhoneNumber -} - -// A Telegram Passport element containing the user's email address -type PassportElementEmailAddress struct { - meta - // Email address - EmailAddress string `json:"email_address"` -} - -func (entity *PassportElementEmailAddress) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PassportElementEmailAddress - - return json.Marshal((*stub)(entity)) -} - -func (*PassportElementEmailAddress) GetClass() string { - return ClassPassportElement -} - -func (*PassportElementEmailAddress) GetType() string { - return TypePassportElementEmailAddress -} - -func (*PassportElementEmailAddress) PassportElementType() string { - return TypePassportElementEmailAddress -} - -// A Telegram Passport element to be saved containing the user's personal details -type InputPassportElementPersonalDetails struct { - meta - // Personal details of the user - PersonalDetails *PersonalDetails `json:"personal_details"` -} - -func (entity *InputPassportElementPersonalDetails) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputPassportElementPersonalDetails - - return json.Marshal((*stub)(entity)) -} - -func (*InputPassportElementPersonalDetails) GetClass() string { - return ClassInputPassportElement -} - -func (*InputPassportElementPersonalDetails) GetType() string { - return TypeInputPassportElementPersonalDetails -} - -func (*InputPassportElementPersonalDetails) InputPassportElementType() string { - return TypeInputPassportElementPersonalDetails -} - -// A Telegram Passport element to be saved containing the user's passport -type InputPassportElementPassport struct { - meta - // The passport to be saved - Passport *InputIdentityDocument `json:"passport"` -} - -func (entity *InputPassportElementPassport) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputPassportElementPassport - - return json.Marshal((*stub)(entity)) -} - -func (*InputPassportElementPassport) GetClass() string { - return ClassInputPassportElement -} - -func (*InputPassportElementPassport) GetType() string { - return TypeInputPassportElementPassport -} - -func (*InputPassportElementPassport) InputPassportElementType() string { - return TypeInputPassportElementPassport -} - -// A Telegram Passport element to be saved containing the user's driver license -type InputPassportElementDriverLicense struct { - meta - // The driver license to be saved - DriverLicense *InputIdentityDocument `json:"driver_license"` -} - -func (entity *InputPassportElementDriverLicense) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputPassportElementDriverLicense - - return json.Marshal((*stub)(entity)) -} - -func (*InputPassportElementDriverLicense) GetClass() string { - return ClassInputPassportElement -} - -func (*InputPassportElementDriverLicense) GetType() string { - return TypeInputPassportElementDriverLicense -} - -func (*InputPassportElementDriverLicense) InputPassportElementType() string { - return TypeInputPassportElementDriverLicense -} - -// A Telegram Passport element to be saved containing the user's identity card -type InputPassportElementIdentityCard struct { - meta - // The identity card to be saved - IdentityCard *InputIdentityDocument `json:"identity_card"` -} - -func (entity *InputPassportElementIdentityCard) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputPassportElementIdentityCard - - return json.Marshal((*stub)(entity)) -} - -func (*InputPassportElementIdentityCard) GetClass() string { - return ClassInputPassportElement -} - -func (*InputPassportElementIdentityCard) GetType() string { - return TypeInputPassportElementIdentityCard -} - -func (*InputPassportElementIdentityCard) InputPassportElementType() string { - return TypeInputPassportElementIdentityCard -} - -// A Telegram Passport element to be saved containing the user's internal passport -type InputPassportElementInternalPassport struct { - meta - // The internal passport to be saved - InternalPassport *InputIdentityDocument `json:"internal_passport"` -} - -func (entity *InputPassportElementInternalPassport) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputPassportElementInternalPassport - - return json.Marshal((*stub)(entity)) -} - -func (*InputPassportElementInternalPassport) GetClass() string { - return ClassInputPassportElement -} - -func (*InputPassportElementInternalPassport) GetType() string { - return TypeInputPassportElementInternalPassport -} - -func (*InputPassportElementInternalPassport) InputPassportElementType() string { - return TypeInputPassportElementInternalPassport -} - -// A Telegram Passport element to be saved containing the user's address -type InputPassportElementAddress struct { - meta - // The address to be saved - Address *Address `json:"address"` -} - -func (entity *InputPassportElementAddress) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputPassportElementAddress - - return json.Marshal((*stub)(entity)) -} - -func (*InputPassportElementAddress) GetClass() string { - return ClassInputPassportElement -} - -func (*InputPassportElementAddress) GetType() string { - return TypeInputPassportElementAddress -} - -func (*InputPassportElementAddress) InputPassportElementType() string { - return TypeInputPassportElementAddress -} - -// A Telegram Passport element to be saved containing the user's utility bill -type InputPassportElementUtilityBill struct { - meta - // The utility bill to be saved - UtilityBill *InputPersonalDocument `json:"utility_bill"` -} - -func (entity *InputPassportElementUtilityBill) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputPassportElementUtilityBill - - return json.Marshal((*stub)(entity)) -} - -func (*InputPassportElementUtilityBill) GetClass() string { - return ClassInputPassportElement -} - -func (*InputPassportElementUtilityBill) GetType() string { - return TypeInputPassportElementUtilityBill -} - -func (*InputPassportElementUtilityBill) InputPassportElementType() string { - return TypeInputPassportElementUtilityBill -} - -// A Telegram Passport element to be saved containing the user's bank statement -type InputPassportElementBankStatement struct { - meta - // The bank statement to be saved - BankStatement *InputPersonalDocument `json:"bank_statement"` -} - -func (entity *InputPassportElementBankStatement) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputPassportElementBankStatement - - return json.Marshal((*stub)(entity)) -} - -func (*InputPassportElementBankStatement) GetClass() string { - return ClassInputPassportElement -} - -func (*InputPassportElementBankStatement) GetType() string { - return TypeInputPassportElementBankStatement -} - -func (*InputPassportElementBankStatement) InputPassportElementType() string { - return TypeInputPassportElementBankStatement -} - -// A Telegram Passport element to be saved containing the user's rental agreement -type InputPassportElementRentalAgreement struct { - meta - // The rental agreement to be saved - RentalAgreement *InputPersonalDocument `json:"rental_agreement"` -} - -func (entity *InputPassportElementRentalAgreement) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputPassportElementRentalAgreement - - return json.Marshal((*stub)(entity)) -} - -func (*InputPassportElementRentalAgreement) GetClass() string { - return ClassInputPassportElement -} - -func (*InputPassportElementRentalAgreement) GetType() string { - return TypeInputPassportElementRentalAgreement -} - -func (*InputPassportElementRentalAgreement) InputPassportElementType() string { - return TypeInputPassportElementRentalAgreement -} - -// A Telegram Passport element to be saved containing the user's passport registration -type InputPassportElementPassportRegistration struct { - meta - // The passport registration page to be saved - PassportRegistration *InputPersonalDocument `json:"passport_registration"` -} - -func (entity *InputPassportElementPassportRegistration) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputPassportElementPassportRegistration - - return json.Marshal((*stub)(entity)) -} - -func (*InputPassportElementPassportRegistration) GetClass() string { - return ClassInputPassportElement -} - -func (*InputPassportElementPassportRegistration) GetType() string { - return TypeInputPassportElementPassportRegistration -} - -func (*InputPassportElementPassportRegistration) InputPassportElementType() string { - return TypeInputPassportElementPassportRegistration -} - -// A Telegram Passport element to be saved containing the user's temporary registration -type InputPassportElementTemporaryRegistration struct { - meta - // The temporary registration document to be saved - TemporaryRegistration *InputPersonalDocument `json:"temporary_registration"` -} - -func (entity *InputPassportElementTemporaryRegistration) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputPassportElementTemporaryRegistration - - return json.Marshal((*stub)(entity)) -} - -func (*InputPassportElementTemporaryRegistration) GetClass() string { - return ClassInputPassportElement -} - -func (*InputPassportElementTemporaryRegistration) GetType() string { - return TypeInputPassportElementTemporaryRegistration -} - -func (*InputPassportElementTemporaryRegistration) InputPassportElementType() string { - return TypeInputPassportElementTemporaryRegistration -} - -// A Telegram Passport element to be saved containing the user's phone number -type InputPassportElementPhoneNumber struct { - meta - // The phone number to be saved - PhoneNumber string `json:"phone_number"` -} - -func (entity *InputPassportElementPhoneNumber) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputPassportElementPhoneNumber - - return json.Marshal((*stub)(entity)) -} - -func (*InputPassportElementPhoneNumber) GetClass() string { - return ClassInputPassportElement -} - -func (*InputPassportElementPhoneNumber) GetType() string { - return TypeInputPassportElementPhoneNumber -} - -func (*InputPassportElementPhoneNumber) InputPassportElementType() string { - return TypeInputPassportElementPhoneNumber -} - -// A Telegram Passport element to be saved containing the user's email address -type InputPassportElementEmailAddress struct { - meta - // The email address to be saved - EmailAddress string `json:"email_address"` -} - -func (entity *InputPassportElementEmailAddress) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputPassportElementEmailAddress - - return json.Marshal((*stub)(entity)) -} - -func (*InputPassportElementEmailAddress) GetClass() string { - return ClassInputPassportElement -} - -func (*InputPassportElementEmailAddress) GetType() string { - return TypeInputPassportElementEmailAddress -} - -func (*InputPassportElementEmailAddress) InputPassportElementType() string { - return TypeInputPassportElementEmailAddress -} - -// Contains information about saved Telegram Passport elements -type PassportElements struct { - meta - // Telegram Passport elements - Elements []PassportElement `json:"elements"` -} - -func (entity *PassportElements) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PassportElements - - return json.Marshal((*stub)(entity)) -} - -func (*PassportElements) GetClass() string { - return ClassPassportElements -} - -func (*PassportElements) GetType() string { - return TypePassportElements -} - -func (passportElements *PassportElements) UnmarshalJSON(data []byte) error { - var tmp struct { - Elements []json.RawMessage `json:"elements"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - fieldElements, _ := UnmarshalListOfPassportElement(tmp.Elements) - passportElements.Elements = fieldElements - - return nil -} - -// The element contains an error in an unspecified place. The error will be considered resolved when new data is added -type PassportElementErrorSourceUnspecified struct { - meta -} - -func (entity *PassportElementErrorSourceUnspecified) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PassportElementErrorSourceUnspecified - - return json.Marshal((*stub)(entity)) -} - -func (*PassportElementErrorSourceUnspecified) GetClass() string { - return ClassPassportElementErrorSource -} - -func (*PassportElementErrorSourceUnspecified) GetType() string { - return TypePassportElementErrorSourceUnspecified -} - -func (*PassportElementErrorSourceUnspecified) PassportElementErrorSourceType() string { - return TypePassportElementErrorSourceUnspecified -} - -// One of the data fields contains an error. The error will be considered resolved when the value of the field changes -type PassportElementErrorSourceDataField struct { - meta - // Field name - FieldName string `json:"field_name"` -} - -func (entity *PassportElementErrorSourceDataField) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PassportElementErrorSourceDataField - - return json.Marshal((*stub)(entity)) -} - -func (*PassportElementErrorSourceDataField) GetClass() string { - return ClassPassportElementErrorSource -} - -func (*PassportElementErrorSourceDataField) GetType() string { - return TypePassportElementErrorSourceDataField -} - -func (*PassportElementErrorSourceDataField) PassportElementErrorSourceType() string { - return TypePassportElementErrorSourceDataField -} - -// The front side of the document contains an error. The error will be considered resolved when the file with the front side changes -type PassportElementErrorSourceFrontSide struct { - meta -} - -func (entity *PassportElementErrorSourceFrontSide) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PassportElementErrorSourceFrontSide - - return json.Marshal((*stub)(entity)) -} - -func (*PassportElementErrorSourceFrontSide) GetClass() string { - return ClassPassportElementErrorSource -} - -func (*PassportElementErrorSourceFrontSide) GetType() string { - return TypePassportElementErrorSourceFrontSide -} - -func (*PassportElementErrorSourceFrontSide) PassportElementErrorSourceType() string { - return TypePassportElementErrorSourceFrontSide -} - -// The reverse side of the document contains an error. The error will be considered resolved when the file with the reverse side changes -type PassportElementErrorSourceReverseSide struct { - meta -} - -func (entity *PassportElementErrorSourceReverseSide) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PassportElementErrorSourceReverseSide - - return json.Marshal((*stub)(entity)) -} - -func (*PassportElementErrorSourceReverseSide) GetClass() string { - return ClassPassportElementErrorSource -} - -func (*PassportElementErrorSourceReverseSide) GetType() string { - return TypePassportElementErrorSourceReverseSide -} - -func (*PassportElementErrorSourceReverseSide) PassportElementErrorSourceType() string { - return TypePassportElementErrorSourceReverseSide -} - -// The selfie with the document contains an error. The error will be considered resolved when the file with the selfie changes -type PassportElementErrorSourceSelfie struct { - meta -} - -func (entity *PassportElementErrorSourceSelfie) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PassportElementErrorSourceSelfie - - return json.Marshal((*stub)(entity)) -} - -func (*PassportElementErrorSourceSelfie) GetClass() string { - return ClassPassportElementErrorSource -} - -func (*PassportElementErrorSourceSelfie) GetType() string { - return TypePassportElementErrorSourceSelfie -} - -func (*PassportElementErrorSourceSelfie) PassportElementErrorSourceType() string { - return TypePassportElementErrorSourceSelfie -} - -// 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 { - meta - // Index of a file with the error - FileIndex int32 `json:"file_index"` -} - -func (entity *PassportElementErrorSourceTranslationFile) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PassportElementErrorSourceTranslationFile - - return json.Marshal((*stub)(entity)) -} - -func (*PassportElementErrorSourceTranslationFile) GetClass() string { - return ClassPassportElementErrorSource -} - -func (*PassportElementErrorSourceTranslationFile) GetType() string { - return TypePassportElementErrorSourceTranslationFile -} - -func (*PassportElementErrorSourceTranslationFile) PassportElementErrorSourceType() string { - return TypePassportElementErrorSourceTranslationFile -} - -// The translation of the document contains an error. The error will be considered resolved when the list of translation files changes -type PassportElementErrorSourceTranslationFiles struct { - meta -} - -func (entity *PassportElementErrorSourceTranslationFiles) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PassportElementErrorSourceTranslationFiles - - return json.Marshal((*stub)(entity)) -} - -func (*PassportElementErrorSourceTranslationFiles) GetClass() string { - return ClassPassportElementErrorSource -} - -func (*PassportElementErrorSourceTranslationFiles) GetType() string { - return TypePassportElementErrorSourceTranslationFiles -} - -func (*PassportElementErrorSourceTranslationFiles) PassportElementErrorSourceType() string { - return TypePassportElementErrorSourceTranslationFiles -} - -// The file contains an error. The error will be considered resolved when the file changes -type PassportElementErrorSourceFile struct { - meta - // Index of a file with the error - FileIndex int32 `json:"file_index"` -} - -func (entity *PassportElementErrorSourceFile) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PassportElementErrorSourceFile - - return json.Marshal((*stub)(entity)) -} - -func (*PassportElementErrorSourceFile) GetClass() string { - return ClassPassportElementErrorSource -} - -func (*PassportElementErrorSourceFile) GetType() string { - return TypePassportElementErrorSourceFile -} - -func (*PassportElementErrorSourceFile) PassportElementErrorSourceType() string { - return TypePassportElementErrorSourceFile -} - -// The list of attached files contains an error. The error will be considered resolved when the list of files changes -type PassportElementErrorSourceFiles struct { - meta -} - -func (entity *PassportElementErrorSourceFiles) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PassportElementErrorSourceFiles - - return json.Marshal((*stub)(entity)) -} - -func (*PassportElementErrorSourceFiles) GetClass() string { - return ClassPassportElementErrorSource -} - -func (*PassportElementErrorSourceFiles) GetType() string { - return TypePassportElementErrorSourceFiles -} - -func (*PassportElementErrorSourceFiles) PassportElementErrorSourceType() string { - return TypePassportElementErrorSourceFiles -} - -// Contains the description of an error in a Telegram Passport element -type PassportElementError struct { - 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"` -} - -func (entity *PassportElementError) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PassportElementError - - return json.Marshal((*stub)(entity)) -} - -func (*PassportElementError) GetClass() string { - return ClassPassportElementError -} - -func (*PassportElementError) GetType() string { - return TypePassportElementError -} - -func (passportElementError *PassportElementError) UnmarshalJSON(data []byte) error { - var tmp struct { - Type json.RawMessage `json:"type"` - Message string `json:"message"` - Source json.RawMessage `json:"source"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - passportElementError.Message = tmp.Message - - fieldType, _ := UnmarshalPassportElementType(tmp.Type) - passportElementError.Type = fieldType - - fieldSource, _ := UnmarshalPassportElementErrorSource(tmp.Source) - passportElementError.Source = fieldSource - - return nil -} - -// Contains information about a Telegram Passport element that was requested by a service -type PassportSuitableElement struct { - 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"` -} - -func (entity *PassportSuitableElement) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PassportSuitableElement - - return json.Marshal((*stub)(entity)) -} - -func (*PassportSuitableElement) GetClass() string { - return ClassPassportSuitableElement -} - -func (*PassportSuitableElement) GetType() string { - return TypePassportSuitableElement -} - -func (passportSuitableElement *PassportSuitableElement) UnmarshalJSON(data []byte) error { - 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"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - passportSuitableElement.IsSelfieRequired = tmp.IsSelfieRequired - passportSuitableElement.IsTranslationRequired = tmp.IsTranslationRequired - passportSuitableElement.IsNativeNameRequired = tmp.IsNativeNameRequired - - fieldType, _ := UnmarshalPassportElementType(tmp.Type) - passportSuitableElement.Type = fieldType - - return nil -} - -// Contains a description of the required Telegram Passport element that was requested by a service -type PassportRequiredElement struct { - meta - // List of Telegram Passport elements any of which is enough to provide - SuitableElements []*PassportSuitableElement `json:"suitable_elements"` -} - -func (entity *PassportRequiredElement) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PassportRequiredElement - - return json.Marshal((*stub)(entity)) -} - -func (*PassportRequiredElement) GetClass() string { - return ClassPassportRequiredElement -} - -func (*PassportRequiredElement) GetType() string { - return TypePassportRequiredElement -} - -// Contains information about a Telegram Passport authorization form that was requested -type PassportAuthorizationForm struct { - 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"` -} - -func (entity *PassportAuthorizationForm) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PassportAuthorizationForm - - return json.Marshal((*stub)(entity)) -} - -func (*PassportAuthorizationForm) GetClass() string { - return ClassPassportAuthorizationForm -} - -func (*PassportAuthorizationForm) GetType() string { - return TypePassportAuthorizationForm -} - -// Contains information about a Telegram Passport elements and corresponding errors -type PassportElementsWithErrors struct { - meta - // Telegram Passport elements - Elements []PassportElement `json:"elements"` - // Errors in the elements that are already available - Errors []*PassportElementError `json:"errors"` -} - -func (entity *PassportElementsWithErrors) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PassportElementsWithErrors - - return json.Marshal((*stub)(entity)) -} - -func (*PassportElementsWithErrors) GetClass() string { - return ClassPassportElementsWithErrors -} - -func (*PassportElementsWithErrors) GetType() string { - return TypePassportElementsWithErrors -} - -func (passportElementsWithErrors *PassportElementsWithErrors) UnmarshalJSON(data []byte) error { - var tmp struct { - Elements []json.RawMessage `json:"elements"` - Errors []*PassportElementError `json:"errors"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - passportElementsWithErrors.Errors = tmp.Errors - - fieldElements, _ := UnmarshalListOfPassportElement(tmp.Elements) - passportElementsWithErrors.Elements = fieldElements - - return nil -} - -// Contains encrypted Telegram Passport data credentials -type EncryptedCredentials struct { - 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"` -} - -func (entity *EncryptedCredentials) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub EncryptedCredentials - - return json.Marshal((*stub)(entity)) -} - -func (*EncryptedCredentials) GetClass() string { - return ClassEncryptedCredentials -} - -func (*EncryptedCredentials) GetType() string { - return TypeEncryptedCredentials -} - -// Contains information about an encrypted Telegram Passport element; for bots only -type EncryptedPassportElement struct { - 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"` -} - -func (entity *EncryptedPassportElement) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub EncryptedPassportElement - - return json.Marshal((*stub)(entity)) -} - -func (*EncryptedPassportElement) GetClass() string { - return ClassEncryptedPassportElement -} - -func (*EncryptedPassportElement) GetType() string { - return TypeEncryptedPassportElement -} - -func (encryptedPassportElement *EncryptedPassportElement) UnmarshalJSON(data []byte) error { - 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 -} - -// The element contains an error in an unspecified place. The error will be considered resolved when new data is added -type InputPassportElementErrorSourceUnspecified struct { - meta - // Current hash of the entire element - ElementHash []byte `json:"element_hash"` -} - -func (entity *InputPassportElementErrorSourceUnspecified) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputPassportElementErrorSourceUnspecified - - return json.Marshal((*stub)(entity)) -} - -func (*InputPassportElementErrorSourceUnspecified) GetClass() string { - return ClassInputPassportElementErrorSource -} - -func (*InputPassportElementErrorSourceUnspecified) GetType() string { - return TypeInputPassportElementErrorSourceUnspecified -} - -func (*InputPassportElementErrorSourceUnspecified) InputPassportElementErrorSourceType() string { - return TypeInputPassportElementErrorSourceUnspecified -} - -// A data field contains an error. The error is considered resolved when the field's value changes -type InputPassportElementErrorSourceDataField struct { - meta - // Field name - FieldName string `json:"field_name"` - // Current data hash - DataHash []byte `json:"data_hash"` -} - -func (entity *InputPassportElementErrorSourceDataField) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputPassportElementErrorSourceDataField - - return json.Marshal((*stub)(entity)) -} - -func (*InputPassportElementErrorSourceDataField) GetClass() string { - return ClassInputPassportElementErrorSource -} - -func (*InputPassportElementErrorSourceDataField) GetType() string { - return TypeInputPassportElementErrorSourceDataField -} - -func (*InputPassportElementErrorSourceDataField) InputPassportElementErrorSourceType() string { - return TypeInputPassportElementErrorSourceDataField -} - -// 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 { - meta - // Current hash of the file containing the front side - FileHash []byte `json:"file_hash"` -} - -func (entity *InputPassportElementErrorSourceFrontSide) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputPassportElementErrorSourceFrontSide - - return json.Marshal((*stub)(entity)) -} - -func (*InputPassportElementErrorSourceFrontSide) GetClass() string { - return ClassInputPassportElementErrorSource -} - -func (*InputPassportElementErrorSourceFrontSide) GetType() string { - return TypeInputPassportElementErrorSourceFrontSide -} - -func (*InputPassportElementErrorSourceFrontSide) InputPassportElementErrorSourceType() string { - return TypeInputPassportElementErrorSourceFrontSide -} - -// 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 { - meta - // Current hash of the file containing the reverse side - FileHash []byte `json:"file_hash"` -} - -func (entity *InputPassportElementErrorSourceReverseSide) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputPassportElementErrorSourceReverseSide - - return json.Marshal((*stub)(entity)) -} - -func (*InputPassportElementErrorSourceReverseSide) GetClass() string { - return ClassInputPassportElementErrorSource -} - -func (*InputPassportElementErrorSourceReverseSide) GetType() string { - return TypeInputPassportElementErrorSourceReverseSide -} - -func (*InputPassportElementErrorSourceReverseSide) InputPassportElementErrorSourceType() string { - return TypeInputPassportElementErrorSourceReverseSide -} - -// The selfie contains an error. The error is considered resolved when the file with the selfie changes -type InputPassportElementErrorSourceSelfie struct { - meta - // Current hash of the file containing the selfie - FileHash []byte `json:"file_hash"` -} - -func (entity *InputPassportElementErrorSourceSelfie) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputPassportElementErrorSourceSelfie - - return json.Marshal((*stub)(entity)) -} - -func (*InputPassportElementErrorSourceSelfie) GetClass() string { - return ClassInputPassportElementErrorSource -} - -func (*InputPassportElementErrorSourceSelfie) GetType() string { - return TypeInputPassportElementErrorSourceSelfie -} - -func (*InputPassportElementErrorSourceSelfie) InputPassportElementErrorSourceType() string { - return TypeInputPassportElementErrorSourceSelfie -} - -// 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 { - meta - // Current hash of the file containing the translation - FileHash []byte `json:"file_hash"` -} - -func (entity *InputPassportElementErrorSourceTranslationFile) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputPassportElementErrorSourceTranslationFile - - return json.Marshal((*stub)(entity)) -} - -func (*InputPassportElementErrorSourceTranslationFile) GetClass() string { - return ClassInputPassportElementErrorSource -} - -func (*InputPassportElementErrorSourceTranslationFile) GetType() string { - return TypeInputPassportElementErrorSourceTranslationFile -} - -func (*InputPassportElementErrorSourceTranslationFile) InputPassportElementErrorSourceType() string { - return TypeInputPassportElementErrorSourceTranslationFile -} - -// The translation of the document contains an error. The error is considered resolved when the list of files changes -type InputPassportElementErrorSourceTranslationFiles struct { - meta - // Current hashes of all files with the translation - FileHashes [][]byte `json:"file_hashes"` -} - -func (entity *InputPassportElementErrorSourceTranslationFiles) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputPassportElementErrorSourceTranslationFiles - - return json.Marshal((*stub)(entity)) -} - -func (*InputPassportElementErrorSourceTranslationFiles) GetClass() string { - return ClassInputPassportElementErrorSource -} - -func (*InputPassportElementErrorSourceTranslationFiles) GetType() string { - return TypeInputPassportElementErrorSourceTranslationFiles -} - -func (*InputPassportElementErrorSourceTranslationFiles) InputPassportElementErrorSourceType() string { - return TypeInputPassportElementErrorSourceTranslationFiles -} - -// The file contains an error. The error is considered resolved when the file changes -type InputPassportElementErrorSourceFile struct { - meta - // Current hash of the file which has the error - FileHash []byte `json:"file_hash"` -} - -func (entity *InputPassportElementErrorSourceFile) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputPassportElementErrorSourceFile - - return json.Marshal((*stub)(entity)) -} - -func (*InputPassportElementErrorSourceFile) GetClass() string { - return ClassInputPassportElementErrorSource -} - -func (*InputPassportElementErrorSourceFile) GetType() string { - return TypeInputPassportElementErrorSourceFile -} - -func (*InputPassportElementErrorSourceFile) InputPassportElementErrorSourceType() string { - return TypeInputPassportElementErrorSourceFile -} - -// The list of attached files contains an error. The error is considered resolved when the file list changes -type InputPassportElementErrorSourceFiles struct { - meta - // Current hashes of all attached files - FileHashes [][]byte `json:"file_hashes"` -} - -func (entity *InputPassportElementErrorSourceFiles) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputPassportElementErrorSourceFiles - - return json.Marshal((*stub)(entity)) -} - -func (*InputPassportElementErrorSourceFiles) GetClass() string { - return ClassInputPassportElementErrorSource -} - -func (*InputPassportElementErrorSourceFiles) GetType() string { - return TypeInputPassportElementErrorSourceFiles -} - -func (*InputPassportElementErrorSourceFiles) InputPassportElementErrorSourceType() string { - return TypeInputPassportElementErrorSourceFiles -} - -// Contains the description of an error in a Telegram Passport element; for bots only -type InputPassportElementError struct { - 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"` -} - -func (entity *InputPassportElementError) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputPassportElementError - - return json.Marshal((*stub)(entity)) -} - -func (*InputPassportElementError) GetClass() string { - return ClassInputPassportElementError -} - -func (*InputPassportElementError) GetType() string { - return TypeInputPassportElementError -} - -func (inputPassportElementError *InputPassportElementError) UnmarshalJSON(data []byte) error { - var tmp struct { - Type json.RawMessage `json:"type"` - Message string `json:"message"` - Source json.RawMessage `json:"source"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - inputPassportElementError.Message = tmp.Message - - fieldType, _ := UnmarshalPassportElementType(tmp.Type) - inputPassportElementError.Type = fieldType - - fieldSource, _ := UnmarshalInputPassportElementErrorSource(tmp.Source) - inputPassportElementError.Source = fieldSource - - return nil -} - -// A text message -type MessageText struct { - 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"` -} - -func (entity *MessageText) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageText - - return json.Marshal((*stub)(entity)) -} - -func (*MessageText) GetClass() string { - return ClassMessageContent -} - -func (*MessageText) GetType() string { - return TypeMessageText -} - -func (*MessageText) MessageContentType() string { - return TypeMessageText -} - -// An animation message (GIF-style). -type MessageAnimation struct { - meta - // The animation description - Animation *Animation `json:"animation"` - // Animation caption - Caption *FormattedText `json:"caption"` - // True, if the animation preview must be covered by a spoiler animation - HasSpoiler bool `json:"has_spoiler"` - // True, if the animation thumbnail must be blurred and the animation must be shown only while tapped - IsSecret bool `json:"is_secret"` -} - -func (entity *MessageAnimation) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageAnimation - - return json.Marshal((*stub)(entity)) -} - -func (*MessageAnimation) GetClass() string { - return ClassMessageContent -} - -func (*MessageAnimation) GetType() string { - return TypeMessageAnimation -} - -func (*MessageAnimation) MessageContentType() string { - return TypeMessageAnimation -} - -// An audio message -type MessageAudio struct { - meta - // The audio description - Audio *Audio `json:"audio"` - // Audio caption - Caption *FormattedText `json:"caption"` -} - -func (entity *MessageAudio) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageAudio - - return json.Marshal((*stub)(entity)) -} - -func (*MessageAudio) GetClass() string { - return ClassMessageContent -} - -func (*MessageAudio) GetType() string { - return TypeMessageAudio -} - -func (*MessageAudio) MessageContentType() string { - return TypeMessageAudio -} - -// A document message (general file) -type MessageDocument struct { - meta - // The document description - Document *Document `json:"document"` - // Document caption - Caption *FormattedText `json:"caption"` -} - -func (entity *MessageDocument) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageDocument - - return json.Marshal((*stub)(entity)) -} - -func (*MessageDocument) GetClass() string { - return ClassMessageContent -} - -func (*MessageDocument) GetType() string { - return TypeMessageDocument -} - -func (*MessageDocument) MessageContentType() string { - return TypeMessageDocument -} - -// A photo message -type MessagePhoto struct { - meta - // The photo - Photo *Photo `json:"photo"` - // Photo caption - Caption *FormattedText `json:"caption"` - // True, if the photo preview must be covered by a spoiler animation - HasSpoiler bool `json:"has_spoiler"` - // True, if the photo must be blurred and must be shown only while tapped - IsSecret bool `json:"is_secret"` -} - -func (entity *MessagePhoto) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessagePhoto - - return json.Marshal((*stub)(entity)) -} - -func (*MessagePhoto) GetClass() string { - return ClassMessageContent -} - -func (*MessagePhoto) GetType() string { - return TypeMessagePhoto -} - -func (*MessagePhoto) MessageContentType() string { - return TypeMessagePhoto -} - -// A self-destructed photo message -type MessageExpiredPhoto struct { - meta -} - -func (entity *MessageExpiredPhoto) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageExpiredPhoto - - return json.Marshal((*stub)(entity)) -} - -func (*MessageExpiredPhoto) GetClass() string { - return ClassMessageContent -} - -func (*MessageExpiredPhoto) GetType() string { - return TypeMessageExpiredPhoto -} - -func (*MessageExpiredPhoto) MessageContentType() string { - return TypeMessageExpiredPhoto -} - -// A sticker message -type MessageSticker struct { - meta - // The sticker description - Sticker *Sticker `json:"sticker"` - // True, if premium animation of the sticker must be played - IsPremium bool `json:"is_premium"` -} - -func (entity *MessageSticker) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageSticker - - return json.Marshal((*stub)(entity)) -} - -func (*MessageSticker) GetClass() string { - return ClassMessageContent -} - -func (*MessageSticker) GetType() string { - return TypeMessageSticker -} - -func (*MessageSticker) MessageContentType() string { - return TypeMessageSticker -} - -// A video message -type MessageVideo struct { - meta - // The video description - Video *Video `json:"video"` - // Video caption - Caption *FormattedText `json:"caption"` - // True, if the video preview must be covered by a spoiler animation - HasSpoiler bool `json:"has_spoiler"` - // True, if the video thumbnail must be blurred and the video must be shown only while tapped - IsSecret bool `json:"is_secret"` -} - -func (entity *MessageVideo) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageVideo - - return json.Marshal((*stub)(entity)) -} - -func (*MessageVideo) GetClass() string { - return ClassMessageContent -} - -func (*MessageVideo) GetType() string { - return TypeMessageVideo -} - -func (*MessageVideo) MessageContentType() string { - return TypeMessageVideo -} - -// A self-destructed video message -type MessageExpiredVideo struct { - meta -} - -func (entity *MessageExpiredVideo) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageExpiredVideo - - return json.Marshal((*stub)(entity)) -} - -func (*MessageExpiredVideo) GetClass() string { - return ClassMessageContent -} - -func (*MessageExpiredVideo) GetType() string { - return TypeMessageExpiredVideo -} - -func (*MessageExpiredVideo) MessageContentType() string { - return TypeMessageExpiredVideo -} - -// A video note message -type MessageVideoNote struct { - 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"` -} - -func (entity *MessageVideoNote) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageVideoNote - - return json.Marshal((*stub)(entity)) -} - -func (*MessageVideoNote) GetClass() string { - return ClassMessageContent -} - -func (*MessageVideoNote) GetType() string { - return TypeMessageVideoNote -} - -func (*MessageVideoNote) MessageContentType() string { - return TypeMessageVideoNote -} - -// A voice note message -type MessageVoiceNote struct { - 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"` -} - -func (entity *MessageVoiceNote) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageVoiceNote - - return json.Marshal((*stub)(entity)) -} - -func (*MessageVoiceNote) GetClass() string { - return ClassMessageContent -} - -func (*MessageVoiceNote) GetType() string { - return TypeMessageVoiceNote -} - -func (*MessageVoiceNote) MessageContentType() string { - return TypeMessageVoiceNote -} - -// A message with a location -type MessageLocation struct { - 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 to the message sender - ProximityAlertRadius int32 `json:"proximity_alert_radius"` -} - -func (entity *MessageLocation) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageLocation - - return json.Marshal((*stub)(entity)) -} - -func (*MessageLocation) GetClass() string { - return ClassMessageContent -} - -func (*MessageLocation) GetType() string { - return TypeMessageLocation -} - -func (*MessageLocation) MessageContentType() string { - return TypeMessageLocation -} - -// A message with information about a venue -type MessageVenue struct { - meta - // The venue description - Venue *Venue `json:"venue"` -} - -func (entity *MessageVenue) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageVenue - - return json.Marshal((*stub)(entity)) -} - -func (*MessageVenue) GetClass() string { - return ClassMessageContent -} - -func (*MessageVenue) GetType() string { - return TypeMessageVenue -} - -func (*MessageVenue) MessageContentType() string { - return TypeMessageVenue -} - -// A message with a user contact -type MessageContact struct { - meta - // The contact description - Contact *Contact `json:"contact"` -} - -func (entity *MessageContact) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageContact - - return json.Marshal((*stub)(entity)) -} - -func (*MessageContact) GetClass() string { - return ClassMessageContent -} - -func (*MessageContact) GetType() string { - return TypeMessageContact -} - -func (*MessageContact) MessageContentType() string { - return TypeMessageContact -} - -// A message with an animated emoji -type MessageAnimatedEmoji struct { - meta - // The animated emoji - AnimatedEmoji *AnimatedEmoji `json:"animated_emoji"` - // The corresponding emoji - Emoji string `json:"emoji"` -} - -func (entity *MessageAnimatedEmoji) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageAnimatedEmoji - - return json.Marshal((*stub)(entity)) -} - -func (*MessageAnimatedEmoji) GetClass() string { - return ClassMessageContent -} - -func (*MessageAnimatedEmoji) GetType() string { - return TypeMessageAnimatedEmoji -} - -func (*MessageAnimatedEmoji) MessageContentType() string { - return TypeMessageAnimatedEmoji -} - -// A dice message. The dice value is randomly generated by the server -type MessageDice struct { - 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"` -} - -func (entity *MessageDice) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageDice - - return json.Marshal((*stub)(entity)) -} - -func (*MessageDice) GetClass() string { - return ClassMessageContent -} - -func (*MessageDice) GetType() string { - return TypeMessageDice -} - -func (*MessageDice) MessageContentType() string { - return TypeMessageDice -} - -func (messageDice *MessageDice) UnmarshalJSON(data []byte) error { - 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"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - messageDice.Emoji = tmp.Emoji - messageDice.Value = tmp.Value - messageDice.SuccessAnimationFrameNumber = tmp.SuccessAnimationFrameNumber - - fieldInitialState, _ := UnmarshalDiceStickers(tmp.InitialState) - messageDice.InitialState = fieldInitialState - - fieldFinalState, _ := UnmarshalDiceStickers(tmp.FinalState) - messageDice.FinalState = fieldFinalState - - return nil -} - -// A message with a game -type MessageGame struct { - meta - // The game description - Game *Game `json:"game"` -} - -func (entity *MessageGame) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageGame - - return json.Marshal((*stub)(entity)) -} - -func (*MessageGame) GetClass() string { - return ClassMessageContent -} - -func (*MessageGame) GetType() string { - return TypeMessageGame -} - -func (*MessageGame) MessageContentType() string { - return TypeMessageGame -} - -// A message with a poll -type MessagePoll struct { - meta - // The poll description - Poll *Poll `json:"poll"` -} - -func (entity *MessagePoll) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessagePoll - - return json.Marshal((*stub)(entity)) -} - -func (*MessagePoll) GetClass() string { - return ClassMessageContent -} - -func (*MessagePoll) GetType() string { - return TypeMessagePoll -} - -func (*MessagePoll) MessageContentType() string { - return TypeMessagePoll -} - -// A message with an invoice from a bot -type MessageInvoice struct { - meta - // Product title - Title string `json:"title"` - // Product description - Description *FormattedText `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"` - // Extended media attached to the invoice; may be null - ExtendedMedia MessageExtendedMedia `json:"extended_media"` -} - -func (entity *MessageInvoice) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageInvoice - - return json.Marshal((*stub)(entity)) -} - -func (*MessageInvoice) GetClass() string { - return ClassMessageContent -} - -func (*MessageInvoice) GetType() string { - return TypeMessageInvoice -} - -func (*MessageInvoice) MessageContentType() string { - return TypeMessageInvoice -} - -func (messageInvoice *MessageInvoice) UnmarshalJSON(data []byte) error { - var tmp struct { - Title string `json:"title"` - Description *FormattedText `json:"description"` - Photo *Photo `json:"photo"` - Currency string `json:"currency"` - TotalAmount int64 `json:"total_amount"` - StartParameter string `json:"start_parameter"` - IsTest bool `json:"is_test"` - NeedShippingAddress bool `json:"need_shipping_address"` - ReceiptMessageId int64 `json:"receipt_message_id"` - ExtendedMedia json.RawMessage `json:"extended_media"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - messageInvoice.Title = tmp.Title - messageInvoice.Description = tmp.Description - messageInvoice.Photo = tmp.Photo - messageInvoice.Currency = tmp.Currency - messageInvoice.TotalAmount = tmp.TotalAmount - messageInvoice.StartParameter = tmp.StartParameter - messageInvoice.IsTest = tmp.IsTest - messageInvoice.NeedShippingAddress = tmp.NeedShippingAddress - messageInvoice.ReceiptMessageId = tmp.ReceiptMessageId - - fieldExtendedMedia, _ := UnmarshalMessageExtendedMedia(tmp.ExtendedMedia) - messageInvoice.ExtendedMedia = fieldExtendedMedia - - return nil -} - -// A message with information about an ended call -type MessageCall struct { - 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"` -} - -func (entity *MessageCall) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageCall - - return json.Marshal((*stub)(entity)) -} - -func (*MessageCall) GetClass() string { - return ClassMessageContent -} - -func (*MessageCall) GetType() string { - return TypeMessageCall -} - -func (*MessageCall) MessageContentType() string { - return TypeMessageCall -} - -func (messageCall *MessageCall) UnmarshalJSON(data []byte) error { - var tmp struct { - IsVideo bool `json:"is_video"` - DiscardReason json.RawMessage `json:"discard_reason"` - Duration int32 `json:"duration"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - messageCall.IsVideo = tmp.IsVideo - messageCall.Duration = tmp.Duration - - fieldDiscardReason, _ := UnmarshalCallDiscardReason(tmp.DiscardReason) - messageCall.DiscardReason = fieldDiscardReason - - return nil -} - -// A new video chat was scheduled -type MessageVideoChatScheduled struct { - 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"` -} - -func (entity *MessageVideoChatScheduled) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageVideoChatScheduled - - return json.Marshal((*stub)(entity)) -} - -func (*MessageVideoChatScheduled) GetClass() string { - return ClassMessageContent -} - -func (*MessageVideoChatScheduled) GetType() string { - return TypeMessageVideoChatScheduled -} - -func (*MessageVideoChatScheduled) MessageContentType() string { - return TypeMessageVideoChatScheduled -} - -// A newly created video chat -type MessageVideoChatStarted struct { - meta - // Identifier of the video chat. The video chat can be received through the method getGroupCall - GroupCallId int32 `json:"group_call_id"` -} - -func (entity *MessageVideoChatStarted) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageVideoChatStarted - - return json.Marshal((*stub)(entity)) -} - -func (*MessageVideoChatStarted) GetClass() string { - return ClassMessageContent -} - -func (*MessageVideoChatStarted) GetType() string { - return TypeMessageVideoChatStarted -} - -func (*MessageVideoChatStarted) MessageContentType() string { - return TypeMessageVideoChatStarted -} - -// A message with information about an ended video chat -type MessageVideoChatEnded struct { - meta - // Call duration, in seconds - Duration int32 `json:"duration"` -} - -func (entity *MessageVideoChatEnded) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageVideoChatEnded - - return json.Marshal((*stub)(entity)) -} - -func (*MessageVideoChatEnded) GetClass() string { - return ClassMessageContent -} - -func (*MessageVideoChatEnded) GetType() string { - return TypeMessageVideoChatEnded -} - -func (*MessageVideoChatEnded) MessageContentType() string { - return TypeMessageVideoChatEnded -} - -// A message with information about an invite to a video chat -type MessageInviteVideoChatParticipants struct { - 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"` -} - -func (entity *MessageInviteVideoChatParticipants) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageInviteVideoChatParticipants - - return json.Marshal((*stub)(entity)) -} - -func (*MessageInviteVideoChatParticipants) GetClass() string { - return ClassMessageContent -} - -func (*MessageInviteVideoChatParticipants) GetType() string { - return TypeMessageInviteVideoChatParticipants -} - -func (*MessageInviteVideoChatParticipants) MessageContentType() string { - return TypeMessageInviteVideoChatParticipants -} - -// A newly created basic group -type MessageBasicGroupChatCreate struct { - meta - // Title of the basic group - Title string `json:"title"` - // User identifiers of members in the basic group - MemberUserIds []int64 `json:"member_user_ids"` -} - -func (entity *MessageBasicGroupChatCreate) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageBasicGroupChatCreate - - return json.Marshal((*stub)(entity)) -} - -func (*MessageBasicGroupChatCreate) GetClass() string { - return ClassMessageContent -} - -func (*MessageBasicGroupChatCreate) GetType() string { - return TypeMessageBasicGroupChatCreate -} - -func (*MessageBasicGroupChatCreate) MessageContentType() string { - return TypeMessageBasicGroupChatCreate -} - -// A newly created supergroup or channel -type MessageSupergroupChatCreate struct { - meta - // Title of the supergroup or channel - Title string `json:"title"` -} - -func (entity *MessageSupergroupChatCreate) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageSupergroupChatCreate - - return json.Marshal((*stub)(entity)) -} - -func (*MessageSupergroupChatCreate) GetClass() string { - return ClassMessageContent -} - -func (*MessageSupergroupChatCreate) GetType() string { - return TypeMessageSupergroupChatCreate -} - -func (*MessageSupergroupChatCreate) MessageContentType() string { - return TypeMessageSupergroupChatCreate -} - -// An updated chat title -type MessageChatChangeTitle struct { - meta - // New chat title - Title string `json:"title"` -} - -func (entity *MessageChatChangeTitle) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageChatChangeTitle - - return json.Marshal((*stub)(entity)) -} - -func (*MessageChatChangeTitle) GetClass() string { - return ClassMessageContent -} - -func (*MessageChatChangeTitle) GetType() string { - return TypeMessageChatChangeTitle -} - -func (*MessageChatChangeTitle) MessageContentType() string { - return TypeMessageChatChangeTitle -} - -// An updated chat photo -type MessageChatChangePhoto struct { - meta - // New chat photo - Photo *ChatPhoto `json:"photo"` -} - -func (entity *MessageChatChangePhoto) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageChatChangePhoto - - return json.Marshal((*stub)(entity)) -} - -func (*MessageChatChangePhoto) GetClass() string { - return ClassMessageContent -} - -func (*MessageChatChangePhoto) GetType() string { - return TypeMessageChatChangePhoto -} - -func (*MessageChatChangePhoto) MessageContentType() string { - return TypeMessageChatChangePhoto -} - -// A deleted chat photo -type MessageChatDeletePhoto struct { - meta -} - -func (entity *MessageChatDeletePhoto) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageChatDeletePhoto - - return json.Marshal((*stub)(entity)) -} - -func (*MessageChatDeletePhoto) GetClass() string { - return ClassMessageContent -} - -func (*MessageChatDeletePhoto) GetType() string { - return TypeMessageChatDeletePhoto -} - -func (*MessageChatDeletePhoto) MessageContentType() string { - return TypeMessageChatDeletePhoto -} - -// New chat members were added -type MessageChatAddMembers struct { - meta - // User identifiers of the new members - MemberUserIds []int64 `json:"member_user_ids"` -} - -func (entity *MessageChatAddMembers) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageChatAddMembers - - return json.Marshal((*stub)(entity)) -} - -func (*MessageChatAddMembers) GetClass() string { - return ClassMessageContent -} - -func (*MessageChatAddMembers) GetType() string { - return TypeMessageChatAddMembers -} - -func (*MessageChatAddMembers) MessageContentType() string { - return TypeMessageChatAddMembers -} - -// A new member joined the chat via an invite link -type MessageChatJoinByLink struct { - meta -} - -func (entity *MessageChatJoinByLink) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageChatJoinByLink - - return json.Marshal((*stub)(entity)) -} - -func (*MessageChatJoinByLink) GetClass() string { - return ClassMessageContent -} - -func (*MessageChatJoinByLink) GetType() string { - return TypeMessageChatJoinByLink -} - -func (*MessageChatJoinByLink) MessageContentType() string { - return TypeMessageChatJoinByLink -} - -// A new member was accepted to the chat by an administrator -type MessageChatJoinByRequest struct { - meta -} - -func (entity *MessageChatJoinByRequest) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageChatJoinByRequest - - return json.Marshal((*stub)(entity)) -} - -func (*MessageChatJoinByRequest) GetClass() string { - return ClassMessageContent -} - -func (*MessageChatJoinByRequest) GetType() string { - return TypeMessageChatJoinByRequest -} - -func (*MessageChatJoinByRequest) MessageContentType() string { - return TypeMessageChatJoinByRequest -} - -// A chat member was deleted -type MessageChatDeleteMember struct { - meta - // User identifier of the deleted chat member - UserId int64 `json:"user_id"` -} - -func (entity *MessageChatDeleteMember) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageChatDeleteMember - - return json.Marshal((*stub)(entity)) -} - -func (*MessageChatDeleteMember) GetClass() string { - return ClassMessageContent -} - -func (*MessageChatDeleteMember) GetType() string { - return TypeMessageChatDeleteMember -} - -func (*MessageChatDeleteMember) MessageContentType() string { - return TypeMessageChatDeleteMember -} - -// A basic group was upgraded to a supergroup and was deactivated as the result -type MessageChatUpgradeTo struct { - meta - // Identifier of the supergroup to which the basic group was upgraded - SupergroupId int64 `json:"supergroup_id"` -} - -func (entity *MessageChatUpgradeTo) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageChatUpgradeTo - - return json.Marshal((*stub)(entity)) -} - -func (*MessageChatUpgradeTo) GetClass() string { - return ClassMessageContent -} - -func (*MessageChatUpgradeTo) GetType() string { - return TypeMessageChatUpgradeTo -} - -func (*MessageChatUpgradeTo) MessageContentType() string { - return TypeMessageChatUpgradeTo -} - -// A supergroup has been created from a basic group -type MessageChatUpgradeFrom struct { - meta - // Title of the newly created supergroup - Title string `json:"title"` - // The identifier of the original basic group - BasicGroupId int64 `json:"basic_group_id"` -} - -func (entity *MessageChatUpgradeFrom) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageChatUpgradeFrom - - return json.Marshal((*stub)(entity)) -} - -func (*MessageChatUpgradeFrom) GetClass() string { - return ClassMessageContent -} - -func (*MessageChatUpgradeFrom) GetType() string { - return TypeMessageChatUpgradeFrom -} - -func (*MessageChatUpgradeFrom) MessageContentType() string { - return TypeMessageChatUpgradeFrom -} - -// A message has been pinned -type MessagePinMessage struct { - meta - // Identifier of the pinned message, can be an identifier of a deleted message or 0 - MessageId int64 `json:"message_id"` -} - -func (entity *MessagePinMessage) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessagePinMessage - - return json.Marshal((*stub)(entity)) -} - -func (*MessagePinMessage) GetClass() string { - return ClassMessageContent -} - -func (*MessagePinMessage) GetType() string { - return TypeMessagePinMessage -} - -func (*MessagePinMessage) MessageContentType() string { - return TypeMessagePinMessage -} - -// A screenshot of a message in the chat has been taken -type MessageScreenshotTaken struct { - meta -} - -func (entity *MessageScreenshotTaken) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageScreenshotTaken - - return json.Marshal((*stub)(entity)) -} - -func (*MessageScreenshotTaken) GetClass() string { - return ClassMessageContent -} - -func (*MessageScreenshotTaken) GetType() string { - return TypeMessageScreenshotTaken -} - -func (*MessageScreenshotTaken) MessageContentType() string { - return TypeMessageScreenshotTaken -} - -// A theme in the chat has been changed -type MessageChatSetTheme struct { - 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"` -} - -func (entity *MessageChatSetTheme) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageChatSetTheme - - return json.Marshal((*stub)(entity)) -} - -func (*MessageChatSetTheme) GetClass() string { - return ClassMessageContent -} - -func (*MessageChatSetTheme) GetType() string { - return TypeMessageChatSetTheme -} - -func (*MessageChatSetTheme) MessageContentType() string { - return TypeMessageChatSetTheme -} - -// The auto-delete or self-destruct timer for messages in the chat has been changed -type MessageChatSetMessageAutoDeleteTime struct { - meta - // New value auto-delete or self-destruct time, in seconds; 0 if disabled - MessageAutoDeleteTime int32 `json:"message_auto_delete_time"` - // If not 0, a user identifier, which default setting was automatically applied - FromUserId int64 `json:"from_user_id"` -} - -func (entity *MessageChatSetMessageAutoDeleteTime) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageChatSetMessageAutoDeleteTime - - return json.Marshal((*stub)(entity)) -} - -func (*MessageChatSetMessageAutoDeleteTime) GetClass() string { - return ClassMessageContent -} - -func (*MessageChatSetMessageAutoDeleteTime) GetType() string { - return TypeMessageChatSetMessageAutoDeleteTime -} - -func (*MessageChatSetMessageAutoDeleteTime) MessageContentType() string { - return TypeMessageChatSetMessageAutoDeleteTime -} - -// A forum topic has been created -type MessageForumTopicCreated struct { - meta - // Name of the topic - Name string `json:"name"` - // Icon of the topic - Icon *ForumTopicIcon `json:"icon"` -} - -func (entity *MessageForumTopicCreated) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageForumTopicCreated - - return json.Marshal((*stub)(entity)) -} - -func (*MessageForumTopicCreated) GetClass() string { - return ClassMessageContent -} - -func (*MessageForumTopicCreated) GetType() string { - return TypeMessageForumTopicCreated -} - -func (*MessageForumTopicCreated) MessageContentType() string { - return TypeMessageForumTopicCreated -} - -// A forum topic has been edited -type MessageForumTopicEdited struct { - meta - // If non-empty, the new name of the topic - Name string `json:"name"` - // True, if icon's custom_emoji_id is changed - EditIconCustomEmojiId bool `json:"edit_icon_custom_emoji_id"` - // New unique identifier of the custom emoji shown on the topic icon; 0 if none. Must be ignored if edit_icon_custom_emoji_id is false - IconCustomEmojiId JsonInt64 `json:"icon_custom_emoji_id"` -} - -func (entity *MessageForumTopicEdited) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageForumTopicEdited - - return json.Marshal((*stub)(entity)) -} - -func (*MessageForumTopicEdited) GetClass() string { - return ClassMessageContent -} - -func (*MessageForumTopicEdited) GetType() string { - return TypeMessageForumTopicEdited -} - -func (*MessageForumTopicEdited) MessageContentType() string { - return TypeMessageForumTopicEdited -} - -// A forum topic has been closed or opened -type MessageForumTopicIsClosedToggled struct { - meta - // True, if the topic was closed, otherwise the topic was reopened - IsClosed bool `json:"is_closed"` -} - -func (entity *MessageForumTopicIsClosedToggled) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageForumTopicIsClosedToggled - - return json.Marshal((*stub)(entity)) -} - -func (*MessageForumTopicIsClosedToggled) GetClass() string { - return ClassMessageContent -} - -func (*MessageForumTopicIsClosedToggled) GetType() string { - return TypeMessageForumTopicIsClosedToggled -} - -func (*MessageForumTopicIsClosedToggled) MessageContentType() string { - return TypeMessageForumTopicIsClosedToggled -} - -// A General forum topic has been hidden or unhidden -type MessageForumTopicIsHiddenToggled struct { - meta - // True, if the topic was hidden, otherwise the topic was unhidden - IsHidden bool `json:"is_hidden"` -} - -func (entity *MessageForumTopicIsHiddenToggled) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageForumTopicIsHiddenToggled - - return json.Marshal((*stub)(entity)) -} - -func (*MessageForumTopicIsHiddenToggled) GetClass() string { - return ClassMessageContent -} - -func (*MessageForumTopicIsHiddenToggled) GetType() string { - return TypeMessageForumTopicIsHiddenToggled -} - -func (*MessageForumTopicIsHiddenToggled) MessageContentType() string { - return TypeMessageForumTopicIsHiddenToggled -} - -// A profile photo was suggested to a user in a private chat -type MessageSuggestProfilePhoto struct { - meta - // The suggested chat photo. Use the method setProfilePhoto with inputChatPhotoPrevious to apply the photo - Photo *ChatPhoto `json:"photo"` -} - -func (entity *MessageSuggestProfilePhoto) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageSuggestProfilePhoto - - return json.Marshal((*stub)(entity)) -} - -func (*MessageSuggestProfilePhoto) GetClass() string { - return ClassMessageContent -} - -func (*MessageSuggestProfilePhoto) GetType() string { - return TypeMessageSuggestProfilePhoto -} - -func (*MessageSuggestProfilePhoto) MessageContentType() string { - return TypeMessageSuggestProfilePhoto -} - -// A non-standard action has happened in the chat -type MessageCustomServiceAction struct { - meta - // Message text to be shown in the chat - Text string `json:"text"` -} - -func (entity *MessageCustomServiceAction) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageCustomServiceAction - - return json.Marshal((*stub)(entity)) -} - -func (*MessageCustomServiceAction) GetClass() string { - return ClassMessageContent -} - -func (*MessageCustomServiceAction) GetType() string { - return TypeMessageCustomServiceAction -} - -func (*MessageCustomServiceAction) MessageContentType() string { - return TypeMessageCustomServiceAction -} - -// A new high score was achieved in a game -type MessageGameScore struct { - 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"` -} - -func (entity *MessageGameScore) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageGameScore - - return json.Marshal((*stub)(entity)) -} - -func (*MessageGameScore) GetClass() string { - return ClassMessageContent -} - -func (*MessageGameScore) GetType() string { - return TypeMessageGameScore -} - -func (*MessageGameScore) MessageContentType() string { - return TypeMessageGameScore -} - -// A payment has been completed -type MessagePaymentSuccessful struct { - meta - // Identifier of the chat, containing the corresponding invoice message - InvoiceChatId int64 `json:"invoice_chat_id"` - // Identifier of the message with the corresponding invoice; can be 0 or 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"` - // True, if this is a recurring payment - IsRecurring bool `json:"is_recurring"` - // True, if this is the first recurring payment - IsFirstRecurring bool `json:"is_first_recurring"` - // Name of the invoice; may be empty if unknown - InvoiceName string `json:"invoice_name"` -} - -func (entity *MessagePaymentSuccessful) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessagePaymentSuccessful - - return json.Marshal((*stub)(entity)) -} - -func (*MessagePaymentSuccessful) GetClass() string { - return ClassMessageContent -} - -func (*MessagePaymentSuccessful) GetType() string { - return TypeMessagePaymentSuccessful -} - -func (*MessagePaymentSuccessful) MessageContentType() string { - return TypeMessagePaymentSuccessful -} - -// A payment has been completed; for bots only -type MessagePaymentSuccessfulBot struct { - 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"` - // True, if this is a recurring payment - IsRecurring bool `json:"is_recurring"` - // True, if this is the first recurring payment - IsFirstRecurring bool `json:"is_first_recurring"` - // 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"` -} - -func (entity *MessagePaymentSuccessfulBot) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessagePaymentSuccessfulBot - - return json.Marshal((*stub)(entity)) -} - -func (*MessagePaymentSuccessfulBot) GetClass() string { - return ClassMessageContent -} - -func (*MessagePaymentSuccessfulBot) GetType() string { - return TypeMessagePaymentSuccessfulBot -} - -func (*MessagePaymentSuccessfulBot) MessageContentType() string { - return TypeMessagePaymentSuccessfulBot -} - -// Telegram Premium was gifted to the user -type MessageGiftedPremium struct { - meta - // Currency for the paid amount - Currency string `json:"currency"` - // The paid amount, in the smallest units of the currency - Amount int64 `json:"amount"` - // Number of month the Telegram Premium subscription will be active - MonthCount int32 `json:"month_count"` - // A sticker to be shown in the message; may be null if unknown - Sticker *Sticker `json:"sticker"` -} - -func (entity *MessageGiftedPremium) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageGiftedPremium - - return json.Marshal((*stub)(entity)) -} - -func (*MessageGiftedPremium) GetClass() string { - return ClassMessageContent -} - -func (*MessageGiftedPremium) GetType() string { - return TypeMessageGiftedPremium -} - -func (*MessageGiftedPremium) MessageContentType() string { - return TypeMessageGiftedPremium -} - -// A contact has registered with Telegram -type MessageContactRegistered struct { - meta -} - -func (entity *MessageContactRegistered) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageContactRegistered - - return json.Marshal((*stub)(entity)) -} - -func (*MessageContactRegistered) GetClass() string { - return ClassMessageContent -} - -func (*MessageContactRegistered) GetType() string { - return TypeMessageContactRegistered -} - -func (*MessageContactRegistered) MessageContentType() string { - return TypeMessageContactRegistered -} - -// The current user has connected a website by logging in using Telegram Login Widget on it -type MessageWebsiteConnected struct { - meta - // Domain name of the connected website - DomainName string `json:"domain_name"` -} - -func (entity *MessageWebsiteConnected) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageWebsiteConnected - - return json.Marshal((*stub)(entity)) -} - -func (*MessageWebsiteConnected) GetClass() string { - return ClassMessageContent -} - -func (*MessageWebsiteConnected) GetType() string { - return TypeMessageWebsiteConnected -} - -func (*MessageWebsiteConnected) MessageContentType() string { - return TypeMessageWebsiteConnected -} - -// The user allowed the bot to send messages -type MessageBotWriteAccessAllowed struct { - meta -} - -func (entity *MessageBotWriteAccessAllowed) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageBotWriteAccessAllowed - - return json.Marshal((*stub)(entity)) -} - -func (*MessageBotWriteAccessAllowed) GetClass() string { - return ClassMessageContent -} - -func (*MessageBotWriteAccessAllowed) GetType() string { - return TypeMessageBotWriteAccessAllowed -} - -func (*MessageBotWriteAccessAllowed) MessageContentType() string { - return TypeMessageBotWriteAccessAllowed -} - -// Data from a Web App has been sent to a bot -type MessageWebAppDataSent struct { - meta - // Text of the keyboardButtonTypeWebApp button, which opened the Web App - ButtonText string `json:"button_text"` -} - -func (entity *MessageWebAppDataSent) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageWebAppDataSent - - return json.Marshal((*stub)(entity)) -} - -func (*MessageWebAppDataSent) GetClass() string { - return ClassMessageContent -} - -func (*MessageWebAppDataSent) GetType() string { - return TypeMessageWebAppDataSent -} - -func (*MessageWebAppDataSent) MessageContentType() string { - return TypeMessageWebAppDataSent -} - -// Data from a Web App has been received; for bots only -type MessageWebAppDataReceived struct { - meta - // Text of the keyboardButtonTypeWebApp button, which opened the Web App - ButtonText string `json:"button_text"` - // Received data - Data string `json:"data"` -} - -func (entity *MessageWebAppDataReceived) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageWebAppDataReceived - - return json.Marshal((*stub)(entity)) -} - -func (*MessageWebAppDataReceived) GetClass() string { - return ClassMessageContent -} - -func (*MessageWebAppDataReceived) GetType() string { - return TypeMessageWebAppDataReceived -} - -func (*MessageWebAppDataReceived) MessageContentType() string { - return TypeMessageWebAppDataReceived -} - -// Telegram Passport data has been sent to a bot -type MessagePassportDataSent struct { - meta - // List of Telegram Passport element types sent - Types []PassportElementType `json:"types"` -} - -func (entity *MessagePassportDataSent) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessagePassportDataSent - - return json.Marshal((*stub)(entity)) -} - -func (*MessagePassportDataSent) GetClass() string { - return ClassMessageContent -} - -func (*MessagePassportDataSent) GetType() string { - return TypeMessagePassportDataSent -} - -func (*MessagePassportDataSent) MessageContentType() string { - return TypeMessagePassportDataSent -} - -func (messagePassportDataSent *MessagePassportDataSent) UnmarshalJSON(data []byte) error { - var tmp struct { - Types []json.RawMessage `json:"types"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - fieldTypes, _ := UnmarshalListOfPassportElementType(tmp.Types) - messagePassportDataSent.Types = fieldTypes - - return nil -} - -// Telegram Passport data has been received; for bots only -type MessagePassportDataReceived struct { - meta - // List of received Telegram Passport elements - Elements []*EncryptedPassportElement `json:"elements"` - // Encrypted data credentials - Credentials *EncryptedCredentials `json:"credentials"` -} - -func (entity *MessagePassportDataReceived) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessagePassportDataReceived - - return json.Marshal((*stub)(entity)) -} - -func (*MessagePassportDataReceived) GetClass() string { - return ClassMessageContent -} - -func (*MessagePassportDataReceived) GetType() string { - return TypeMessagePassportDataReceived -} - -func (*MessagePassportDataReceived) MessageContentType() string { - return TypeMessagePassportDataReceived -} - -// A user in the chat came within proximity alert range -type MessageProximityAlertTriggered struct { - 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"` -} - -func (entity *MessageProximityAlertTriggered) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageProximityAlertTriggered - - return json.Marshal((*stub)(entity)) -} - -func (*MessageProximityAlertTriggered) GetClass() string { - return ClassMessageContent -} - -func (*MessageProximityAlertTriggered) GetType() string { - return TypeMessageProximityAlertTriggered -} - -func (*MessageProximityAlertTriggered) MessageContentType() string { - return TypeMessageProximityAlertTriggered -} - -func (messageProximityAlertTriggered *MessageProximityAlertTriggered) UnmarshalJSON(data []byte) error { - var tmp struct { - TravelerId json.RawMessage `json:"traveler_id"` - WatcherId json.RawMessage `json:"watcher_id"` - Distance int32 `json:"distance"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - messageProximityAlertTriggered.Distance = tmp.Distance - - fieldTravelerId, _ := UnmarshalMessageSender(tmp.TravelerId) - messageProximityAlertTriggered.TravelerId = fieldTravelerId - - fieldWatcherId, _ := UnmarshalMessageSender(tmp.WatcherId) - messageProximityAlertTriggered.WatcherId = fieldWatcherId - - return nil -} - -// Message content that is not supported in the current TDLib version -type MessageUnsupported struct { - meta -} - -func (entity *MessageUnsupported) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageUnsupported - - return json.Marshal((*stub)(entity)) -} - -func (*MessageUnsupported) GetClass() string { - return ClassMessageContent -} - -func (*MessageUnsupported) GetType() string { - return TypeMessageUnsupported -} - -func (*MessageUnsupported) MessageContentType() string { - return TypeMessageUnsupported -} - -// A mention of a user, a supergroup, or a channel by their username -type TextEntityTypeMention struct { - meta -} - -func (entity *TextEntityTypeMention) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub TextEntityTypeMention - - return json.Marshal((*stub)(entity)) -} - -func (*TextEntityTypeMention) GetClass() string { - return ClassTextEntityType -} - -func (*TextEntityTypeMention) GetType() string { - return TypeTextEntityTypeMention -} - -func (*TextEntityTypeMention) TextEntityTypeType() string { - return TypeTextEntityTypeMention -} - -// A hashtag text, beginning with "#" -type TextEntityTypeHashtag struct { - meta -} - -func (entity *TextEntityTypeHashtag) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub TextEntityTypeHashtag - - return json.Marshal((*stub)(entity)) -} - -func (*TextEntityTypeHashtag) GetClass() string { - return ClassTextEntityType -} - -func (*TextEntityTypeHashtag) GetType() string { - return TypeTextEntityTypeHashtag -} - -func (*TextEntityTypeHashtag) TextEntityTypeType() string { - return TypeTextEntityTypeHashtag -} - -// A cashtag text, beginning with "$" and consisting of capital English letters (e.g., "$USD") -type TextEntityTypeCashtag struct { - meta -} - -func (entity *TextEntityTypeCashtag) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub TextEntityTypeCashtag - - return json.Marshal((*stub)(entity)) -} - -func (*TextEntityTypeCashtag) GetClass() string { - return ClassTextEntityType -} - -func (*TextEntityTypeCashtag) GetType() string { - return TypeTextEntityTypeCashtag -} - -func (*TextEntityTypeCashtag) TextEntityTypeType() string { - return TypeTextEntityTypeCashtag -} - -// A bot command, beginning with "/" -type TextEntityTypeBotCommand struct { - meta -} - -func (entity *TextEntityTypeBotCommand) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub TextEntityTypeBotCommand - - return json.Marshal((*stub)(entity)) -} - -func (*TextEntityTypeBotCommand) GetClass() string { - return ClassTextEntityType -} - -func (*TextEntityTypeBotCommand) GetType() string { - return TypeTextEntityTypeBotCommand -} - -func (*TextEntityTypeBotCommand) TextEntityTypeType() string { - return TypeTextEntityTypeBotCommand -} - -// An HTTP URL -type TextEntityTypeUrl struct { - meta -} - -func (entity *TextEntityTypeUrl) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub TextEntityTypeUrl - - return json.Marshal((*stub)(entity)) -} - -func (*TextEntityTypeUrl) GetClass() string { - return ClassTextEntityType -} - -func (*TextEntityTypeUrl) GetType() string { - return TypeTextEntityTypeUrl -} - -func (*TextEntityTypeUrl) TextEntityTypeType() string { - return TypeTextEntityTypeUrl -} - -// An email address -type TextEntityTypeEmailAddress struct { - meta -} - -func (entity *TextEntityTypeEmailAddress) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub TextEntityTypeEmailAddress - - return json.Marshal((*stub)(entity)) -} - -func (*TextEntityTypeEmailAddress) GetClass() string { - return ClassTextEntityType -} - -func (*TextEntityTypeEmailAddress) GetType() string { - return TypeTextEntityTypeEmailAddress -} - -func (*TextEntityTypeEmailAddress) TextEntityTypeType() string { - return TypeTextEntityTypeEmailAddress -} - -// A phone number -type TextEntityTypePhoneNumber struct { - meta -} - -func (entity *TextEntityTypePhoneNumber) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub TextEntityTypePhoneNumber - - return json.Marshal((*stub)(entity)) -} - -func (*TextEntityTypePhoneNumber) GetClass() string { - return ClassTextEntityType -} - -func (*TextEntityTypePhoneNumber) GetType() string { - return TypeTextEntityTypePhoneNumber -} - -func (*TextEntityTypePhoneNumber) TextEntityTypeType() string { - return TypeTextEntityTypePhoneNumber -} - -// A bank card number. The getBankCardInfo method can be used to get information about the bank card -type TextEntityTypeBankCardNumber struct { - meta -} - -func (entity *TextEntityTypeBankCardNumber) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub TextEntityTypeBankCardNumber - - return json.Marshal((*stub)(entity)) -} - -func (*TextEntityTypeBankCardNumber) GetClass() string { - return ClassTextEntityType -} - -func (*TextEntityTypeBankCardNumber) GetType() string { - return TypeTextEntityTypeBankCardNumber -} - -func (*TextEntityTypeBankCardNumber) TextEntityTypeType() string { - return TypeTextEntityTypeBankCardNumber -} - -// A bold text -type TextEntityTypeBold struct { - meta -} - -func (entity *TextEntityTypeBold) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub TextEntityTypeBold - - return json.Marshal((*stub)(entity)) -} - -func (*TextEntityTypeBold) GetClass() string { - return ClassTextEntityType -} - -func (*TextEntityTypeBold) GetType() string { - return TypeTextEntityTypeBold -} - -func (*TextEntityTypeBold) TextEntityTypeType() string { - return TypeTextEntityTypeBold -} - -// An italic text -type TextEntityTypeItalic struct { - meta -} - -func (entity *TextEntityTypeItalic) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub TextEntityTypeItalic - - return json.Marshal((*stub)(entity)) -} - -func (*TextEntityTypeItalic) GetClass() string { - return ClassTextEntityType -} - -func (*TextEntityTypeItalic) GetType() string { - return TypeTextEntityTypeItalic -} - -func (*TextEntityTypeItalic) TextEntityTypeType() string { - return TypeTextEntityTypeItalic -} - -// An underlined text -type TextEntityTypeUnderline struct { - meta -} - -func (entity *TextEntityTypeUnderline) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub TextEntityTypeUnderline - - return json.Marshal((*stub)(entity)) -} - -func (*TextEntityTypeUnderline) GetClass() string { - return ClassTextEntityType -} - -func (*TextEntityTypeUnderline) GetType() string { - return TypeTextEntityTypeUnderline -} - -func (*TextEntityTypeUnderline) TextEntityTypeType() string { - return TypeTextEntityTypeUnderline -} - -// A strikethrough text -type TextEntityTypeStrikethrough struct { - meta -} - -func (entity *TextEntityTypeStrikethrough) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub TextEntityTypeStrikethrough - - return json.Marshal((*stub)(entity)) -} - -func (*TextEntityTypeStrikethrough) GetClass() string { - return ClassTextEntityType -} - -func (*TextEntityTypeStrikethrough) GetType() string { - return TypeTextEntityTypeStrikethrough -} - -func (*TextEntityTypeStrikethrough) TextEntityTypeType() string { - return TypeTextEntityTypeStrikethrough -} - -// A spoiler text -type TextEntityTypeSpoiler struct { - meta -} - -func (entity *TextEntityTypeSpoiler) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub TextEntityTypeSpoiler - - return json.Marshal((*stub)(entity)) -} - -func (*TextEntityTypeSpoiler) GetClass() string { - return ClassTextEntityType -} - -func (*TextEntityTypeSpoiler) GetType() string { - return TypeTextEntityTypeSpoiler -} - -func (*TextEntityTypeSpoiler) TextEntityTypeType() string { - return TypeTextEntityTypeSpoiler -} - -// Text that must be formatted as if inside a code HTML tag -type TextEntityTypeCode struct { - meta -} - -func (entity *TextEntityTypeCode) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub TextEntityTypeCode - - return json.Marshal((*stub)(entity)) -} - -func (*TextEntityTypeCode) GetClass() string { - return ClassTextEntityType -} - -func (*TextEntityTypeCode) GetType() string { - return TypeTextEntityTypeCode -} - -func (*TextEntityTypeCode) TextEntityTypeType() string { - return TypeTextEntityTypeCode -} - -// Text that must be formatted as if inside a pre HTML tag -type TextEntityTypePre struct { - meta -} - -func (entity *TextEntityTypePre) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub TextEntityTypePre - - return json.Marshal((*stub)(entity)) -} - -func (*TextEntityTypePre) GetClass() string { - return ClassTextEntityType -} - -func (*TextEntityTypePre) GetType() string { - return TypeTextEntityTypePre -} - -func (*TextEntityTypePre) TextEntityTypeType() string { - return TypeTextEntityTypePre -} - -// Text that must be formatted as if inside pre, and code HTML tags -type TextEntityTypePreCode struct { - meta - // Programming language of the code; as defined by the sender - Language string `json:"language"` -} - -func (entity *TextEntityTypePreCode) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub TextEntityTypePreCode - - return json.Marshal((*stub)(entity)) -} - -func (*TextEntityTypePreCode) GetClass() string { - return ClassTextEntityType -} - -func (*TextEntityTypePreCode) GetType() string { - return TypeTextEntityTypePreCode -} - -func (*TextEntityTypePreCode) TextEntityTypeType() string { - return TypeTextEntityTypePreCode -} - -// A text description shown instead of a raw URL -type TextEntityTypeTextUrl struct { - meta - // HTTP or tg:// URL to be opened when the link is clicked - Url string `json:"url"` -} - -func (entity *TextEntityTypeTextUrl) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub TextEntityTypeTextUrl - - return json.Marshal((*stub)(entity)) -} - -func (*TextEntityTypeTextUrl) GetClass() string { - return ClassTextEntityType -} - -func (*TextEntityTypeTextUrl) GetType() string { - return TypeTextEntityTypeTextUrl -} - -func (*TextEntityTypeTextUrl) TextEntityTypeType() string { - return TypeTextEntityTypeTextUrl -} - -// A text shows instead of a raw mention of the user (e.g., when the user has no username) -type TextEntityTypeMentionName struct { - meta - // Identifier of the mentioned user - UserId int64 `json:"user_id"` -} - -func (entity *TextEntityTypeMentionName) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub TextEntityTypeMentionName - - return json.Marshal((*stub)(entity)) -} - -func (*TextEntityTypeMentionName) GetClass() string { - return ClassTextEntityType -} - -func (*TextEntityTypeMentionName) GetType() string { - return TypeTextEntityTypeMentionName -} - -func (*TextEntityTypeMentionName) TextEntityTypeType() string { - return TypeTextEntityTypeMentionName -} - -// A custom emoji. The text behind a custom emoji must be an emoji. Only premium users can use premium custom emoji -type TextEntityTypeCustomEmoji struct { - meta - // Unique identifier of the custom emoji - CustomEmojiId JsonInt64 `json:"custom_emoji_id"` -} - -func (entity *TextEntityTypeCustomEmoji) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub TextEntityTypeCustomEmoji - - return json.Marshal((*stub)(entity)) -} - -func (*TextEntityTypeCustomEmoji) GetClass() string { - return ClassTextEntityType -} - -func (*TextEntityTypeCustomEmoji) GetType() string { - return TypeTextEntityTypeCustomEmoji -} - -func (*TextEntityTypeCustomEmoji) TextEntityTypeType() string { - return TypeTextEntityTypeCustomEmoji -} - -// A media timestamp -type TextEntityTypeMediaTimestamp struct { - 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"` -} - -func (entity *TextEntityTypeMediaTimestamp) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub TextEntityTypeMediaTimestamp - - return json.Marshal((*stub)(entity)) -} - -func (*TextEntityTypeMediaTimestamp) GetClass() string { - return ClassTextEntityType -} - -func (*TextEntityTypeMediaTimestamp) GetType() string { - return TypeTextEntityTypeMediaTimestamp -} - -func (*TextEntityTypeMediaTimestamp) TextEntityTypeType() string { - return TypeTextEntityTypeMediaTimestamp -} - -// 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 { - 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"` -} - -func (entity *InputThumbnail) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputThumbnail - - return json.Marshal((*stub)(entity)) -} - -func (*InputThumbnail) GetClass() string { - return ClassInputThumbnail -} - -func (*InputThumbnail) GetType() string { - return TypeInputThumbnail -} - -func (inputThumbnail *InputThumbnail) UnmarshalJSON(data []byte) error { - var tmp struct { - Thumbnail json.RawMessage `json:"thumbnail"` - Width int32 `json:"width"` - Height int32 `json:"height"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - inputThumbnail.Width = tmp.Width - inputThumbnail.Height = tmp.Height - - fieldThumbnail, _ := UnmarshalInputFile(tmp.Thumbnail) - inputThumbnail.Thumbnail = fieldThumbnail - - return nil -} - -// The message will be sent at the specified date -type MessageSchedulingStateSendAtDate struct { - meta - // Date the message will be sent. The date must be within 367 days in the future - SendDate int32 `json:"send_date"` -} - -func (entity *MessageSchedulingStateSendAtDate) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageSchedulingStateSendAtDate - - return json.Marshal((*stub)(entity)) -} - -func (*MessageSchedulingStateSendAtDate) GetClass() string { - return ClassMessageSchedulingState -} - -func (*MessageSchedulingStateSendAtDate) GetType() string { - return TypeMessageSchedulingStateSendAtDate -} - -func (*MessageSchedulingStateSendAtDate) MessageSchedulingStateType() string { - return TypeMessageSchedulingStateSendAtDate -} - -// 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 -type MessageSchedulingStateSendWhenOnline struct { - meta -} - -func (entity *MessageSchedulingStateSendWhenOnline) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageSchedulingStateSendWhenOnline - - return json.Marshal((*stub)(entity)) -} - -func (*MessageSchedulingStateSendWhenOnline) GetClass() string { - return ClassMessageSchedulingState -} - -func (*MessageSchedulingStateSendWhenOnline) GetType() string { - return TypeMessageSchedulingStateSendWhenOnline -} - -func (*MessageSchedulingStateSendWhenOnline) MessageSchedulingStateType() string { - return TypeMessageSchedulingStateSendWhenOnline -} - -// Options to be used when a message is sent -type MessageSendOptions struct { - 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"` - // Pass true if the user explicitly chosen a sticker or a custom emoji from an installed sticker set; applicable only to sendMessage and sendMessageAlbum - UpdateOrderOfInstalledStickerSets bool `json:"update_order_of_installed_sticker_sets"` - // 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"` -} - -func (entity *MessageSendOptions) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageSendOptions - - return json.Marshal((*stub)(entity)) -} - -func (*MessageSendOptions) GetClass() string { - return ClassMessageSendOptions -} - -func (*MessageSendOptions) GetType() string { - return TypeMessageSendOptions -} - -func (messageSendOptions *MessageSendOptions) UnmarshalJSON(data []byte) error { - var tmp struct { - DisableNotification bool `json:"disable_notification"` - FromBackground bool `json:"from_background"` - ProtectContent bool `json:"protect_content"` - UpdateOrderOfInstalledStickerSets bool `json:"update_order_of_installed_sticker_sets"` - SchedulingState json.RawMessage `json:"scheduling_state"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - messageSendOptions.DisableNotification = tmp.DisableNotification - messageSendOptions.FromBackground = tmp.FromBackground - messageSendOptions.ProtectContent = tmp.ProtectContent - messageSendOptions.UpdateOrderOfInstalledStickerSets = tmp.UpdateOrderOfInstalledStickerSets - - fieldSchedulingState, _ := UnmarshalMessageSchedulingState(tmp.SchedulingState) - messageSendOptions.SchedulingState = fieldSchedulingState - - return nil -} - -// 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 { - 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"` -} - -func (entity *MessageCopyOptions) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageCopyOptions - - return json.Marshal((*stub)(entity)) -} - -func (*MessageCopyOptions) GetClass() string { - return ClassMessageCopyOptions -} - -func (*MessageCopyOptions) GetType() string { - return TypeMessageCopyOptions -} - -// A text message -type InputMessageText struct { - meta - // Formatted text to be sent; 1-getOption("message_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, 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"` -} - -func (entity *InputMessageText) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputMessageText - - return json.Marshal((*stub)(entity)) -} - -func (*InputMessageText) GetClass() string { - return ClassInputMessageContent -} - -func (*InputMessageText) GetType() string { - return TypeInputMessageText -} - -func (*InputMessageText) InputMessageContentType() string { - return TypeInputMessageText -} - -// An animation message (GIF-style). -type InputMessageAnimation struct { - 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"` - // True, if the animation preview must be covered by a spoiler animation; not supported in secret chats - HasSpoiler bool `json:"has_spoiler"` -} - -func (entity *InputMessageAnimation) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputMessageAnimation - - return json.Marshal((*stub)(entity)) -} - -func (*InputMessageAnimation) GetClass() string { - return ClassInputMessageContent -} - -func (*InputMessageAnimation) GetType() string { - return TypeInputMessageAnimation -} - -func (*InputMessageAnimation) InputMessageContentType() string { - return TypeInputMessageAnimation -} - -func (inputMessageAnimation *InputMessageAnimation) UnmarshalJSON(data []byte) error { - 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"` - HasSpoiler bool `json:"has_spoiler"` - } - - 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 - inputMessageAnimation.HasSpoiler = tmp.HasSpoiler - - fieldAnimation, _ := UnmarshalInputFile(tmp.Animation) - inputMessageAnimation.Animation = fieldAnimation - - return nil -} - -// An audio message -type InputMessageAudio struct { - 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"` -} - -func (entity *InputMessageAudio) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputMessageAudio - - return json.Marshal((*stub)(entity)) -} - -func (*InputMessageAudio) GetClass() string { - return ClassInputMessageContent -} - -func (*InputMessageAudio) GetType() string { - return TypeInputMessageAudio -} - -func (*InputMessageAudio) InputMessageContentType() string { - return TypeInputMessageAudio -} - -func (inputMessageAudio *InputMessageAudio) UnmarshalJSON(data []byte) error { - 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"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - inputMessageAudio.AlbumCoverThumbnail = tmp.AlbumCoverThumbnail - inputMessageAudio.Duration = tmp.Duration - inputMessageAudio.Title = tmp.Title - inputMessageAudio.Performer = tmp.Performer - inputMessageAudio.Caption = tmp.Caption - - fieldAudio, _ := UnmarshalInputFile(tmp.Audio) - inputMessageAudio.Audio = fieldAudio - - return nil -} - -// A document message (general file) -type InputMessageDocument struct { - 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 always be 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"` -} - -func (entity *InputMessageDocument) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputMessageDocument - - return json.Marshal((*stub)(entity)) -} - -func (*InputMessageDocument) GetClass() string { - return ClassInputMessageContent -} - -func (*InputMessageDocument) GetType() string { - return TypeInputMessageDocument -} - -func (*InputMessageDocument) InputMessageContentType() string { - return TypeInputMessageDocument -} - -func (inputMessageDocument *InputMessageDocument) UnmarshalJSON(data []byte) error { - var tmp struct { - Document json.RawMessage `json:"document"` - Thumbnail *InputThumbnail `json:"thumbnail"` - DisableContentTypeDetection bool `json:"disable_content_type_detection"` - Caption *FormattedText `json:"caption"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - inputMessageDocument.Thumbnail = tmp.Thumbnail - inputMessageDocument.DisableContentTypeDetection = tmp.DisableContentTypeDetection - inputMessageDocument.Caption = tmp.Caption - - fieldDocument, _ := UnmarshalInputFile(tmp.Document) - inputMessageDocument.Document = fieldDocument - - return nil -} - -// A photo message -type InputMessagePhoto struct { - meta - // Photo to send. The photo must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total. Width and height ratio must be at most 20 - 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 self-destruct time, in seconds (0-60). A non-zero self-destruct time can be specified only in private chats - SelfDestructTime int32 `json:"self_destruct_time"` - // True, if the photo preview must be covered by a spoiler animation; not supported in secret chats - HasSpoiler bool `json:"has_spoiler"` -} - -func (entity *InputMessagePhoto) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputMessagePhoto - - return json.Marshal((*stub)(entity)) -} - -func (*InputMessagePhoto) GetClass() string { - return ClassInputMessageContent -} - -func (*InputMessagePhoto) GetType() string { - return TypeInputMessagePhoto -} - -func (*InputMessagePhoto) InputMessageContentType() string { - return TypeInputMessagePhoto -} - -func (inputMessagePhoto *InputMessagePhoto) UnmarshalJSON(data []byte) error { - 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"` - SelfDestructTime int32 `json:"self_destruct_time"` - HasSpoiler bool `json:"has_spoiler"` - } - - 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.SelfDestructTime = tmp.SelfDestructTime - inputMessagePhoto.HasSpoiler = tmp.HasSpoiler - - fieldPhoto, _ := UnmarshalInputFile(tmp.Photo) - inputMessagePhoto.Photo = fieldPhoto - - return nil -} - -// A sticker message -type InputMessageSticker struct { - 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"` -} - -func (entity *InputMessageSticker) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputMessageSticker - - return json.Marshal((*stub)(entity)) -} - -func (*InputMessageSticker) GetClass() string { - return ClassInputMessageContent -} - -func (*InputMessageSticker) GetType() string { - return TypeInputMessageSticker -} - -func (*InputMessageSticker) InputMessageContentType() string { - return TypeInputMessageSticker -} - -func (inputMessageSticker *InputMessageSticker) UnmarshalJSON(data []byte) error { - var tmp struct { - Sticker json.RawMessage `json:"sticker"` - Thumbnail *InputThumbnail `json:"thumbnail"` - Width int32 `json:"width"` - Height int32 `json:"height"` - Emoji string `json:"emoji"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - inputMessageSticker.Thumbnail = tmp.Thumbnail - inputMessageSticker.Width = tmp.Width - inputMessageSticker.Height = tmp.Height - inputMessageSticker.Emoji = tmp.Emoji - - fieldSticker, _ := UnmarshalInputFile(tmp.Sticker) - inputMessageSticker.Sticker = fieldSticker - - return nil -} - -// A video message -type InputMessageVideo struct { - 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 self-destruct time, in seconds (0-60). A non-zero self-destruct time can be specified only in private chats - SelfDestructTime int32 `json:"self_destruct_time"` - // True, if the video preview must be covered by a spoiler animation; not supported in secret chats - HasSpoiler bool `json:"has_spoiler"` -} - -func (entity *InputMessageVideo) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputMessageVideo - - return json.Marshal((*stub)(entity)) -} - -func (*InputMessageVideo) GetClass() string { - return ClassInputMessageContent -} - -func (*InputMessageVideo) GetType() string { - return TypeInputMessageVideo -} - -func (*InputMessageVideo) InputMessageContentType() string { - return TypeInputMessageVideo -} - -func (inputMessageVideo *InputMessageVideo) UnmarshalJSON(data []byte) error { - 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"` - SelfDestructTime int32 `json:"self_destruct_time"` - HasSpoiler bool `json:"has_spoiler"` - } - - 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.SelfDestructTime = tmp.SelfDestructTime - inputMessageVideo.HasSpoiler = tmp.HasSpoiler - - fieldVideo, _ := UnmarshalInputFile(tmp.Video) - inputMessageVideo.Video = fieldVideo - - return nil -} - -// A video note message -type InputMessageVideoNote struct { - 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"` -} - -func (entity *InputMessageVideoNote) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputMessageVideoNote - - return json.Marshal((*stub)(entity)) -} - -func (*InputMessageVideoNote) GetClass() string { - return ClassInputMessageContent -} - -func (*InputMessageVideoNote) GetType() string { - return TypeInputMessageVideoNote -} - -func (*InputMessageVideoNote) InputMessageContentType() string { - return TypeInputMessageVideoNote -} - -func (inputMessageVideoNote *InputMessageVideoNote) UnmarshalJSON(data []byte) error { - var tmp struct { - VideoNote json.RawMessage `json:"video_note"` - Thumbnail *InputThumbnail `json:"thumbnail"` - Duration int32 `json:"duration"` - Length int32 `json:"length"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - inputMessageVideoNote.Thumbnail = tmp.Thumbnail - inputMessageVideoNote.Duration = tmp.Duration - inputMessageVideoNote.Length = tmp.Length - - fieldVideoNote, _ := UnmarshalInputFile(tmp.VideoNote) - inputMessageVideoNote.VideoNote = fieldVideoNote - - return nil -} - -// A voice note message -type InputMessageVoiceNote struct { - 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"` -} - -func (entity *InputMessageVoiceNote) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputMessageVoiceNote - - return json.Marshal((*stub)(entity)) -} - -func (*InputMessageVoiceNote) GetClass() string { - return ClassInputMessageContent -} - -func (*InputMessageVoiceNote) GetType() string { - return TypeInputMessageVoiceNote -} - -func (*InputMessageVoiceNote) InputMessageContentType() string { - return TypeInputMessageVoiceNote -} - -func (inputMessageVoiceNote *InputMessageVoiceNote) UnmarshalJSON(data []byte) error { - var tmp struct { - VoiceNote json.RawMessage `json:"voice_note"` - Duration int32 `json:"duration"` - Waveform []byte `json:"waveform"` - Caption *FormattedText `json:"caption"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - inputMessageVoiceNote.Duration = tmp.Duration - inputMessageVoiceNote.Waveform = tmp.Waveform - inputMessageVoiceNote.Caption = tmp.Caption - - fieldVoiceNote, _ := UnmarshalInputFile(tmp.VoiceNote) - inputMessageVoiceNote.VoiceNote = fieldVoiceNote - - return nil -} - -// A message with a location -type InputMessageLocation struct { - 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"` -} - -func (entity *InputMessageLocation) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputMessageLocation - - return json.Marshal((*stub)(entity)) -} - -func (*InputMessageLocation) GetClass() string { - return ClassInputMessageContent -} - -func (*InputMessageLocation) GetType() string { - return TypeInputMessageLocation -} - -func (*InputMessageLocation) InputMessageContentType() string { - return TypeInputMessageLocation -} - -// A message with information about a venue -type InputMessageVenue struct { - meta - // Venue to send - Venue *Venue `json:"venue"` -} - -func (entity *InputMessageVenue) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputMessageVenue - - return json.Marshal((*stub)(entity)) -} - -func (*InputMessageVenue) GetClass() string { - return ClassInputMessageContent -} - -func (*InputMessageVenue) GetType() string { - return TypeInputMessageVenue -} - -func (*InputMessageVenue) InputMessageContentType() string { - return TypeInputMessageVenue -} - -// A message containing a user contact -type InputMessageContact struct { - meta - // Contact to send - Contact *Contact `json:"contact"` -} - -func (entity *InputMessageContact) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputMessageContact - - return json.Marshal((*stub)(entity)) -} - -func (*InputMessageContact) GetClass() string { - return ClassInputMessageContent -} - -func (*InputMessageContact) GetType() string { - return TypeInputMessageContact -} - -func (*InputMessageContact) InputMessageContentType() string { - return TypeInputMessageContact -} - -// A dice message -type InputMessageDice struct { - 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"` -} - -func (entity *InputMessageDice) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputMessageDice - - return json.Marshal((*stub)(entity)) -} - -func (*InputMessageDice) GetClass() string { - return ClassInputMessageContent -} - -func (*InputMessageDice) GetType() string { - return TypeInputMessageDice -} - -func (*InputMessageDice) InputMessageContentType() string { - return TypeInputMessageDice -} - -// A message with a game; not supported for channels or secret chats -type InputMessageGame struct { - 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"` -} - -func (entity *InputMessageGame) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputMessageGame - - return json.Marshal((*stub)(entity)) -} - -func (*InputMessageGame) GetClass() string { - return ClassInputMessageContent -} - -func (*InputMessageGame) GetType() string { - return TypeInputMessageGame -} - -func (*InputMessageGame) InputMessageContentType() string { - return TypeInputMessageGame -} - -// A message with an invoice; can be used only by bots -type InputMessageInvoice struct { - 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"` - // The content of extended media attached to the invoice. The content of the message to be sent. Must be one of the following types: inputMessagePhoto, inputMessageVideo - ExtendedMediaContent InputMessageContent `json:"extended_media_content"` -} - -func (entity *InputMessageInvoice) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputMessageInvoice - - return json.Marshal((*stub)(entity)) -} - -func (*InputMessageInvoice) GetClass() string { - return ClassInputMessageContent -} - -func (*InputMessageInvoice) GetType() string { - return TypeInputMessageInvoice -} - -func (*InputMessageInvoice) InputMessageContentType() string { - return TypeInputMessageInvoice -} - -func (inputMessageInvoice *InputMessageInvoice) UnmarshalJSON(data []byte) error { - var tmp struct { - Invoice *Invoice `json:"invoice"` - Title string `json:"title"` - Description string `json:"description"` - PhotoUrl string `json:"photo_url"` - PhotoSize int32 `json:"photo_size"` - PhotoWidth int32 `json:"photo_width"` - PhotoHeight int32 `json:"photo_height"` - Payload []byte `json:"payload"` - ProviderToken string `json:"provider_token"` - ProviderData string `json:"provider_data"` - StartParameter string `json:"start_parameter"` - ExtendedMediaContent json.RawMessage `json:"extended_media_content"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - inputMessageInvoice.Invoice = tmp.Invoice - inputMessageInvoice.Title = tmp.Title - inputMessageInvoice.Description = tmp.Description - inputMessageInvoice.PhotoUrl = tmp.PhotoUrl - inputMessageInvoice.PhotoSize = tmp.PhotoSize - inputMessageInvoice.PhotoWidth = tmp.PhotoWidth - inputMessageInvoice.PhotoHeight = tmp.PhotoHeight - inputMessageInvoice.Payload = tmp.Payload - inputMessageInvoice.ProviderToken = tmp.ProviderToken - inputMessageInvoice.ProviderData = tmp.ProviderData - inputMessageInvoice.StartParameter = tmp.StartParameter - - fieldExtendedMediaContent, _ := UnmarshalInputMessageContent(tmp.ExtendedMediaContent) - inputMessageInvoice.ExtendedMediaContent = fieldExtendedMediaContent - - return nil -} - -// 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 { - 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"` -} - -func (entity *InputMessagePoll) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputMessagePoll - - return json.Marshal((*stub)(entity)) -} - -func (*InputMessagePoll) GetClass() string { - return ClassInputMessageContent -} - -func (*InputMessagePoll) GetType() string { - return TypeInputMessagePoll -} - -func (*InputMessagePoll) InputMessageContentType() string { - return TypeInputMessagePoll -} - -func (inputMessagePoll *InputMessagePoll) UnmarshalJSON(data []byte) error { - 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 -} - -// A forwarded message -type InputMessageForwarded struct { - 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"` -} - -func (entity *InputMessageForwarded) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputMessageForwarded - - return json.Marshal((*stub)(entity)) -} - -func (*InputMessageForwarded) GetClass() string { - return ClassInputMessageContent -} - -func (*InputMessageForwarded) GetType() string { - return TypeInputMessageForwarded -} - -func (*InputMessageForwarded) InputMessageContentType() string { - return TypeInputMessageForwarded -} - -// Returns all found messages, no filter is applied -type SearchMessagesFilterEmpty struct { - meta -} - -func (entity *SearchMessagesFilterEmpty) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub SearchMessagesFilterEmpty - - return json.Marshal((*stub)(entity)) -} - -func (*SearchMessagesFilterEmpty) GetClass() string { - return ClassSearchMessagesFilter -} - -func (*SearchMessagesFilterEmpty) GetType() string { - return TypeSearchMessagesFilterEmpty -} - -func (*SearchMessagesFilterEmpty) SearchMessagesFilterType() string { - return TypeSearchMessagesFilterEmpty -} - -// Returns only animation messages -type SearchMessagesFilterAnimation struct { - meta -} - -func (entity *SearchMessagesFilterAnimation) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub SearchMessagesFilterAnimation - - return json.Marshal((*stub)(entity)) -} - -func (*SearchMessagesFilterAnimation) GetClass() string { - return ClassSearchMessagesFilter -} - -func (*SearchMessagesFilterAnimation) GetType() string { - return TypeSearchMessagesFilterAnimation -} - -func (*SearchMessagesFilterAnimation) SearchMessagesFilterType() string { - return TypeSearchMessagesFilterAnimation -} - -// Returns only audio messages -type SearchMessagesFilterAudio struct { - meta -} - -func (entity *SearchMessagesFilterAudio) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub SearchMessagesFilterAudio - - return json.Marshal((*stub)(entity)) -} - -func (*SearchMessagesFilterAudio) GetClass() string { - return ClassSearchMessagesFilter -} - -func (*SearchMessagesFilterAudio) GetType() string { - return TypeSearchMessagesFilterAudio -} - -func (*SearchMessagesFilterAudio) SearchMessagesFilterType() string { - return TypeSearchMessagesFilterAudio -} - -// Returns only document messages -type SearchMessagesFilterDocument struct { - meta -} - -func (entity *SearchMessagesFilterDocument) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub SearchMessagesFilterDocument - - return json.Marshal((*stub)(entity)) -} - -func (*SearchMessagesFilterDocument) GetClass() string { - return ClassSearchMessagesFilter -} - -func (*SearchMessagesFilterDocument) GetType() string { - return TypeSearchMessagesFilterDocument -} - -func (*SearchMessagesFilterDocument) SearchMessagesFilterType() string { - return TypeSearchMessagesFilterDocument -} - -// Returns only photo messages -type SearchMessagesFilterPhoto struct { - meta -} - -func (entity *SearchMessagesFilterPhoto) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub SearchMessagesFilterPhoto - - return json.Marshal((*stub)(entity)) -} - -func (*SearchMessagesFilterPhoto) GetClass() string { - return ClassSearchMessagesFilter -} - -func (*SearchMessagesFilterPhoto) GetType() string { - return TypeSearchMessagesFilterPhoto -} - -func (*SearchMessagesFilterPhoto) SearchMessagesFilterType() string { - return TypeSearchMessagesFilterPhoto -} - -// Returns only video messages -type SearchMessagesFilterVideo struct { - meta -} - -func (entity *SearchMessagesFilterVideo) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub SearchMessagesFilterVideo - - return json.Marshal((*stub)(entity)) -} - -func (*SearchMessagesFilterVideo) GetClass() string { - return ClassSearchMessagesFilter -} - -func (*SearchMessagesFilterVideo) GetType() string { - return TypeSearchMessagesFilterVideo -} - -func (*SearchMessagesFilterVideo) SearchMessagesFilterType() string { - return TypeSearchMessagesFilterVideo -} - -// Returns only voice note messages -type SearchMessagesFilterVoiceNote struct { - meta -} - -func (entity *SearchMessagesFilterVoiceNote) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub SearchMessagesFilterVoiceNote - - return json.Marshal((*stub)(entity)) -} - -func (*SearchMessagesFilterVoiceNote) GetClass() string { - return ClassSearchMessagesFilter -} - -func (*SearchMessagesFilterVoiceNote) GetType() string { - return TypeSearchMessagesFilterVoiceNote -} - -func (*SearchMessagesFilterVoiceNote) SearchMessagesFilterType() string { - return TypeSearchMessagesFilterVoiceNote -} - -// Returns only photo and video messages -type SearchMessagesFilterPhotoAndVideo struct { - meta -} - -func (entity *SearchMessagesFilterPhotoAndVideo) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub SearchMessagesFilterPhotoAndVideo - - return json.Marshal((*stub)(entity)) -} - -func (*SearchMessagesFilterPhotoAndVideo) GetClass() string { - return ClassSearchMessagesFilter -} - -func (*SearchMessagesFilterPhotoAndVideo) GetType() string { - return TypeSearchMessagesFilterPhotoAndVideo -} - -func (*SearchMessagesFilterPhotoAndVideo) SearchMessagesFilterType() string { - return TypeSearchMessagesFilterPhotoAndVideo -} - -// Returns only messages containing URLs -type SearchMessagesFilterUrl struct { - meta -} - -func (entity *SearchMessagesFilterUrl) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub SearchMessagesFilterUrl - - return json.Marshal((*stub)(entity)) -} - -func (*SearchMessagesFilterUrl) GetClass() string { - return ClassSearchMessagesFilter -} - -func (*SearchMessagesFilterUrl) GetType() string { - return TypeSearchMessagesFilterUrl -} - -func (*SearchMessagesFilterUrl) SearchMessagesFilterType() string { - return TypeSearchMessagesFilterUrl -} - -// Returns only messages containing chat photos -type SearchMessagesFilterChatPhoto struct { - meta -} - -func (entity *SearchMessagesFilterChatPhoto) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub SearchMessagesFilterChatPhoto - - return json.Marshal((*stub)(entity)) -} - -func (*SearchMessagesFilterChatPhoto) GetClass() string { - return ClassSearchMessagesFilter -} - -func (*SearchMessagesFilterChatPhoto) GetType() string { - return TypeSearchMessagesFilterChatPhoto -} - -func (*SearchMessagesFilterChatPhoto) SearchMessagesFilterType() string { - return TypeSearchMessagesFilterChatPhoto -} - -// Returns only video note messages -type SearchMessagesFilterVideoNote struct { - meta -} - -func (entity *SearchMessagesFilterVideoNote) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub SearchMessagesFilterVideoNote - - return json.Marshal((*stub)(entity)) -} - -func (*SearchMessagesFilterVideoNote) GetClass() string { - return ClassSearchMessagesFilter -} - -func (*SearchMessagesFilterVideoNote) GetType() string { - return TypeSearchMessagesFilterVideoNote -} - -func (*SearchMessagesFilterVideoNote) SearchMessagesFilterType() string { - return TypeSearchMessagesFilterVideoNote -} - -// Returns only voice and video note messages -type SearchMessagesFilterVoiceAndVideoNote struct { - meta -} - -func (entity *SearchMessagesFilterVoiceAndVideoNote) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub SearchMessagesFilterVoiceAndVideoNote - - return json.Marshal((*stub)(entity)) -} - -func (*SearchMessagesFilterVoiceAndVideoNote) GetClass() string { - return ClassSearchMessagesFilter -} - -func (*SearchMessagesFilterVoiceAndVideoNote) GetType() string { - return TypeSearchMessagesFilterVoiceAndVideoNote -} - -func (*SearchMessagesFilterVoiceAndVideoNote) SearchMessagesFilterType() string { - return TypeSearchMessagesFilterVoiceAndVideoNote -} - -// Returns only messages with mentions of the current user, or messages that are replies to their messages -type SearchMessagesFilterMention struct { - meta -} - -func (entity *SearchMessagesFilterMention) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub SearchMessagesFilterMention - - return json.Marshal((*stub)(entity)) -} - -func (*SearchMessagesFilterMention) GetClass() string { - return ClassSearchMessagesFilter -} - -func (*SearchMessagesFilterMention) GetType() string { - return TypeSearchMessagesFilterMention -} - -func (*SearchMessagesFilterMention) SearchMessagesFilterType() string { - return TypeSearchMessagesFilterMention -} - -// 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 -type SearchMessagesFilterUnreadMention struct { - meta -} - -func (entity *SearchMessagesFilterUnreadMention) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub SearchMessagesFilterUnreadMention - - return json.Marshal((*stub)(entity)) -} - -func (*SearchMessagesFilterUnreadMention) GetClass() string { - return ClassSearchMessagesFilter -} - -func (*SearchMessagesFilterUnreadMention) GetType() string { - return TypeSearchMessagesFilterUnreadMention -} - -func (*SearchMessagesFilterUnreadMention) SearchMessagesFilterType() string { - return TypeSearchMessagesFilterUnreadMention -} - -// 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 -type SearchMessagesFilterUnreadReaction struct { - meta -} - -func (entity *SearchMessagesFilterUnreadReaction) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub SearchMessagesFilterUnreadReaction - - return json.Marshal((*stub)(entity)) -} - -func (*SearchMessagesFilterUnreadReaction) GetClass() string { - return ClassSearchMessagesFilter -} - -func (*SearchMessagesFilterUnreadReaction) GetType() string { - return TypeSearchMessagesFilterUnreadReaction -} - -func (*SearchMessagesFilterUnreadReaction) SearchMessagesFilterType() string { - return TypeSearchMessagesFilterUnreadReaction -} - -// Returns only failed to send messages. This filter can be used only if the message database is used -type SearchMessagesFilterFailedToSend struct { - meta -} - -func (entity *SearchMessagesFilterFailedToSend) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub SearchMessagesFilterFailedToSend - - return json.Marshal((*stub)(entity)) -} - -func (*SearchMessagesFilterFailedToSend) GetClass() string { - return ClassSearchMessagesFilter -} - -func (*SearchMessagesFilterFailedToSend) GetType() string { - return TypeSearchMessagesFilterFailedToSend -} - -func (*SearchMessagesFilterFailedToSend) SearchMessagesFilterType() string { - return TypeSearchMessagesFilterFailedToSend -} - -// Returns only pinned messages -type SearchMessagesFilterPinned struct { - meta -} - -func (entity *SearchMessagesFilterPinned) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub SearchMessagesFilterPinned - - return json.Marshal((*stub)(entity)) -} - -func (*SearchMessagesFilterPinned) GetClass() string { - return ClassSearchMessagesFilter -} - -func (*SearchMessagesFilterPinned) GetType() string { - return TypeSearchMessagesFilterPinned -} - -func (*SearchMessagesFilterPinned) SearchMessagesFilterType() string { - return TypeSearchMessagesFilterPinned -} - -// The user is typing a message -type ChatActionTyping struct { - meta -} - -func (entity *ChatActionTyping) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatActionTyping - - return json.Marshal((*stub)(entity)) -} - -func (*ChatActionTyping) GetClass() string { - return ClassChatAction -} - -func (*ChatActionTyping) GetType() string { - return TypeChatActionTyping -} - -func (*ChatActionTyping) ChatActionType() string { - return TypeChatActionTyping -} - -// The user is recording a video -type ChatActionRecordingVideo struct { - meta -} - -func (entity *ChatActionRecordingVideo) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatActionRecordingVideo - - return json.Marshal((*stub)(entity)) -} - -func (*ChatActionRecordingVideo) GetClass() string { - return ClassChatAction -} - -func (*ChatActionRecordingVideo) GetType() string { - return TypeChatActionRecordingVideo -} - -func (*ChatActionRecordingVideo) ChatActionType() string { - return TypeChatActionRecordingVideo -} - -// The user is uploading a video -type ChatActionUploadingVideo struct { - meta - // Upload progress, as a percentage - Progress int32 `json:"progress"` -} - -func (entity *ChatActionUploadingVideo) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatActionUploadingVideo - - return json.Marshal((*stub)(entity)) -} - -func (*ChatActionUploadingVideo) GetClass() string { - return ClassChatAction -} - -func (*ChatActionUploadingVideo) GetType() string { - return TypeChatActionUploadingVideo -} - -func (*ChatActionUploadingVideo) ChatActionType() string { - return TypeChatActionUploadingVideo -} - -// The user is recording a voice note -type ChatActionRecordingVoiceNote struct { - meta -} - -func (entity *ChatActionRecordingVoiceNote) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatActionRecordingVoiceNote - - return json.Marshal((*stub)(entity)) -} - -func (*ChatActionRecordingVoiceNote) GetClass() string { - return ClassChatAction -} - -func (*ChatActionRecordingVoiceNote) GetType() string { - return TypeChatActionRecordingVoiceNote -} - -func (*ChatActionRecordingVoiceNote) ChatActionType() string { - return TypeChatActionRecordingVoiceNote -} - -// The user is uploading a voice note -type ChatActionUploadingVoiceNote struct { - meta - // Upload progress, as a percentage - Progress int32 `json:"progress"` -} - -func (entity *ChatActionUploadingVoiceNote) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatActionUploadingVoiceNote - - return json.Marshal((*stub)(entity)) -} - -func (*ChatActionUploadingVoiceNote) GetClass() string { - return ClassChatAction -} - -func (*ChatActionUploadingVoiceNote) GetType() string { - return TypeChatActionUploadingVoiceNote -} - -func (*ChatActionUploadingVoiceNote) ChatActionType() string { - return TypeChatActionUploadingVoiceNote -} - -// The user is uploading a photo -type ChatActionUploadingPhoto struct { - meta - // Upload progress, as a percentage - Progress int32 `json:"progress"` -} - -func (entity *ChatActionUploadingPhoto) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatActionUploadingPhoto - - return json.Marshal((*stub)(entity)) -} - -func (*ChatActionUploadingPhoto) GetClass() string { - return ClassChatAction -} - -func (*ChatActionUploadingPhoto) GetType() string { - return TypeChatActionUploadingPhoto -} - -func (*ChatActionUploadingPhoto) ChatActionType() string { - return TypeChatActionUploadingPhoto -} - -// The user is uploading a document -type ChatActionUploadingDocument struct { - meta - // Upload progress, as a percentage - Progress int32 `json:"progress"` -} - -func (entity *ChatActionUploadingDocument) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatActionUploadingDocument - - return json.Marshal((*stub)(entity)) -} - -func (*ChatActionUploadingDocument) GetClass() string { - return ClassChatAction -} - -func (*ChatActionUploadingDocument) GetType() string { - return TypeChatActionUploadingDocument -} - -func (*ChatActionUploadingDocument) ChatActionType() string { - return TypeChatActionUploadingDocument -} - -// The user is picking a sticker to send -type ChatActionChoosingSticker struct { - meta -} - -func (entity *ChatActionChoosingSticker) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatActionChoosingSticker - - return json.Marshal((*stub)(entity)) -} - -func (*ChatActionChoosingSticker) GetClass() string { - return ClassChatAction -} - -func (*ChatActionChoosingSticker) GetType() string { - return TypeChatActionChoosingSticker -} - -func (*ChatActionChoosingSticker) ChatActionType() string { - return TypeChatActionChoosingSticker -} - -// The user is picking a location or venue to send -type ChatActionChoosingLocation struct { - meta -} - -func (entity *ChatActionChoosingLocation) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatActionChoosingLocation - - return json.Marshal((*stub)(entity)) -} - -func (*ChatActionChoosingLocation) GetClass() string { - return ClassChatAction -} - -func (*ChatActionChoosingLocation) GetType() string { - return TypeChatActionChoosingLocation -} - -func (*ChatActionChoosingLocation) ChatActionType() string { - return TypeChatActionChoosingLocation -} - -// The user is picking a contact to send -type ChatActionChoosingContact struct { - meta -} - -func (entity *ChatActionChoosingContact) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatActionChoosingContact - - return json.Marshal((*stub)(entity)) -} - -func (*ChatActionChoosingContact) GetClass() string { - return ClassChatAction -} - -func (*ChatActionChoosingContact) GetType() string { - return TypeChatActionChoosingContact -} - -func (*ChatActionChoosingContact) ChatActionType() string { - return TypeChatActionChoosingContact -} - -// The user has started to play a game -type ChatActionStartPlayingGame struct { - meta -} - -func (entity *ChatActionStartPlayingGame) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatActionStartPlayingGame - - return json.Marshal((*stub)(entity)) -} - -func (*ChatActionStartPlayingGame) GetClass() string { - return ClassChatAction -} - -func (*ChatActionStartPlayingGame) GetType() string { - return TypeChatActionStartPlayingGame -} - -func (*ChatActionStartPlayingGame) ChatActionType() string { - return TypeChatActionStartPlayingGame -} - -// The user is recording a video note -type ChatActionRecordingVideoNote struct { - meta -} - -func (entity *ChatActionRecordingVideoNote) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatActionRecordingVideoNote - - return json.Marshal((*stub)(entity)) -} - -func (*ChatActionRecordingVideoNote) GetClass() string { - return ClassChatAction -} - -func (*ChatActionRecordingVideoNote) GetType() string { - return TypeChatActionRecordingVideoNote -} - -func (*ChatActionRecordingVideoNote) ChatActionType() string { - return TypeChatActionRecordingVideoNote -} - -// The user is uploading a video note -type ChatActionUploadingVideoNote struct { - meta - // Upload progress, as a percentage - Progress int32 `json:"progress"` -} - -func (entity *ChatActionUploadingVideoNote) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatActionUploadingVideoNote - - return json.Marshal((*stub)(entity)) -} - -func (*ChatActionUploadingVideoNote) GetClass() string { - return ClassChatAction -} - -func (*ChatActionUploadingVideoNote) GetType() string { - return TypeChatActionUploadingVideoNote -} - -func (*ChatActionUploadingVideoNote) ChatActionType() string { - return TypeChatActionUploadingVideoNote -} - -// The user is watching animations sent by the other party by clicking on an animated emoji -type ChatActionWatchingAnimations struct { - meta - // The animated emoji - Emoji string `json:"emoji"` -} - -func (entity *ChatActionWatchingAnimations) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatActionWatchingAnimations - - return json.Marshal((*stub)(entity)) -} - -func (*ChatActionWatchingAnimations) GetClass() string { - return ClassChatAction -} - -func (*ChatActionWatchingAnimations) GetType() string { - return TypeChatActionWatchingAnimations -} - -func (*ChatActionWatchingAnimations) ChatActionType() string { - return TypeChatActionWatchingAnimations -} - -// The user has canceled the previous action -type ChatActionCancel struct { - meta -} - -func (entity *ChatActionCancel) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatActionCancel - - return json.Marshal((*stub)(entity)) -} - -func (*ChatActionCancel) GetClass() string { - return ClassChatAction -} - -func (*ChatActionCancel) GetType() string { - return TypeChatActionCancel -} - -func (*ChatActionCancel) ChatActionType() string { - return TypeChatActionCancel -} - -// The user status was never changed -type UserStatusEmpty struct { - meta -} - -func (entity *UserStatusEmpty) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UserStatusEmpty - - return json.Marshal((*stub)(entity)) -} - -func (*UserStatusEmpty) GetClass() string { - return ClassUserStatus -} - -func (*UserStatusEmpty) GetType() string { - return TypeUserStatusEmpty -} - -func (*UserStatusEmpty) UserStatusType() string { - return TypeUserStatusEmpty -} - -// The user is online -type UserStatusOnline struct { - meta - // Point in time (Unix timestamp) when the user's online status will expire - Expires int32 `json:"expires"` -} - -func (entity *UserStatusOnline) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UserStatusOnline - - return json.Marshal((*stub)(entity)) -} - -func (*UserStatusOnline) GetClass() string { - return ClassUserStatus -} - -func (*UserStatusOnline) GetType() string { - return TypeUserStatusOnline -} - -func (*UserStatusOnline) UserStatusType() string { - return TypeUserStatusOnline -} - -// The user is offline -type UserStatusOffline struct { - meta - // Point in time (Unix timestamp) when the user was last online - WasOnline int32 `json:"was_online"` -} - -func (entity *UserStatusOffline) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UserStatusOffline - - return json.Marshal((*stub)(entity)) -} - -func (*UserStatusOffline) GetClass() string { - return ClassUserStatus -} - -func (*UserStatusOffline) GetType() string { - return TypeUserStatusOffline -} - -func (*UserStatusOffline) UserStatusType() string { - return TypeUserStatusOffline -} - -// The user was online recently -type UserStatusRecently struct { - meta -} - -func (entity *UserStatusRecently) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UserStatusRecently - - return json.Marshal((*stub)(entity)) -} - -func (*UserStatusRecently) GetClass() string { - return ClassUserStatus -} - -func (*UserStatusRecently) GetType() string { - return TypeUserStatusRecently -} - -func (*UserStatusRecently) UserStatusType() string { - return TypeUserStatusRecently -} - -// The user is offline, but was online last week -type UserStatusLastWeek struct { - meta -} - -func (entity *UserStatusLastWeek) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UserStatusLastWeek - - return json.Marshal((*stub)(entity)) -} - -func (*UserStatusLastWeek) GetClass() string { - return ClassUserStatus -} - -func (*UserStatusLastWeek) GetType() string { - return TypeUserStatusLastWeek -} - -func (*UserStatusLastWeek) UserStatusType() string { - return TypeUserStatusLastWeek -} - -// The user is offline, but was online last month -type UserStatusLastMonth struct { - meta -} - -func (entity *UserStatusLastMonth) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UserStatusLastMonth - - return json.Marshal((*stub)(entity)) -} - -func (*UserStatusLastMonth) GetClass() string { - return ClassUserStatus -} - -func (*UserStatusLastMonth) GetType() string { - return TypeUserStatusLastMonth -} - -func (*UserStatusLastMonth) UserStatusType() string { - return TypeUserStatusLastMonth -} - -// Represents a list of stickers -type Stickers struct { - meta - // List of stickers - Stickers []*Sticker `json:"stickers"` -} - -func (entity *Stickers) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub Stickers - - return json.Marshal((*stub)(entity)) -} - -func (*Stickers) GetClass() string { - return ClassStickers -} - -func (*Stickers) GetType() string { - return TypeStickers -} - -// Represents a list of emoji -type Emojis struct { - meta - // List of emojis - Emojis []string `json:"emojis"` -} - -func (entity *Emojis) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub Emojis - - return json.Marshal((*stub)(entity)) -} - -func (*Emojis) GetClass() string { - return ClassEmojis -} - -func (*Emojis) GetType() string { - return TypeEmojis -} - -// Represents a sticker set -type StickerSet struct { - 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"` - // Format of the stickers in the set - StickerFormat StickerFormat `json:"sticker_format"` - // 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"` -} - -func (entity *StickerSet) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub StickerSet - - return json.Marshal((*stub)(entity)) -} - -func (*StickerSet) GetClass() string { - return ClassStickerSet -} - -func (*StickerSet) GetType() string { - return TypeStickerSet -} - -func (stickerSet *StickerSet) UnmarshalJSON(data []byte) error { - 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"` - StickerFormat json.RawMessage `json:"sticker_format"` - 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 - - fieldStickerFormat, _ := UnmarshalStickerFormat(tmp.StickerFormat) - stickerSet.StickerFormat = fieldStickerFormat - - fieldStickerType, _ := UnmarshalStickerType(tmp.StickerType) - stickerSet.StickerType = fieldStickerType - - return nil -} - -// Represents short information about a sticker set -type StickerSetInfo struct { - 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"` - // Format of the stickers in the set - StickerFormat StickerFormat `json:"sticker_format"` - // 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"` -} - -func (entity *StickerSetInfo) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub StickerSetInfo - - return json.Marshal((*stub)(entity)) -} - -func (*StickerSetInfo) GetClass() string { - return ClassStickerSetInfo -} - -func (*StickerSetInfo) GetType() string { - return TypeStickerSetInfo -} - -func (stickerSetInfo *StickerSetInfo) UnmarshalJSON(data []byte) error { - 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"` - StickerFormat json.RawMessage `json:"sticker_format"` - 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 - - fieldStickerFormat, _ := UnmarshalStickerFormat(tmp.StickerFormat) - stickerSetInfo.StickerFormat = fieldStickerFormat - - fieldStickerType, _ := UnmarshalStickerType(tmp.StickerType) - stickerSetInfo.StickerType = fieldStickerType - - return nil -} - -// Represents a list of sticker sets -type StickerSets struct { - meta - // Approximate total number of sticker sets found - TotalCount int32 `json:"total_count"` - // List of sticker sets - Sets []*StickerSetInfo `json:"sets"` -} - -func (entity *StickerSets) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub StickerSets - - return json.Marshal((*stub)(entity)) -} - -func (*StickerSets) GetClass() string { - return ClassStickerSets -} - -func (*StickerSets) GetType() string { - return TypeStickerSets -} - -// Represents a list of trending sticker sets -type TrendingStickerSets struct { - meta - // Approximate total number of trending sticker sets - TotalCount int32 `json:"total_count"` - // List of trending sticker sets - Sets []*StickerSetInfo `json:"sets"` - // True, if the list contains sticker sets with premium stickers - IsPremium bool `json:"is_premium"` -} - -func (entity *TrendingStickerSets) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub TrendingStickerSets - - return json.Marshal((*stub)(entity)) -} - -func (*TrendingStickerSets) GetClass() string { - return ClassTrendingStickerSets -} - -func (*TrendingStickerSets) GetType() string { - return TypeTrendingStickerSets -} - -// The call wasn't discarded, or the reason is unknown -type CallDiscardReasonEmpty struct { - meta -} - -func (entity *CallDiscardReasonEmpty) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub CallDiscardReasonEmpty - - return json.Marshal((*stub)(entity)) -} - -func (*CallDiscardReasonEmpty) GetClass() string { - return ClassCallDiscardReason -} - -func (*CallDiscardReasonEmpty) GetType() string { - return TypeCallDiscardReasonEmpty -} - -func (*CallDiscardReasonEmpty) CallDiscardReasonType() string { - return TypeCallDiscardReasonEmpty -} - -// The call was ended before the conversation started. It was canceled by the caller or missed by the other party -type CallDiscardReasonMissed struct { - meta -} - -func (entity *CallDiscardReasonMissed) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub CallDiscardReasonMissed - - return json.Marshal((*stub)(entity)) -} - -func (*CallDiscardReasonMissed) GetClass() string { - return ClassCallDiscardReason -} - -func (*CallDiscardReasonMissed) GetType() string { - return TypeCallDiscardReasonMissed -} - -func (*CallDiscardReasonMissed) CallDiscardReasonType() string { - return TypeCallDiscardReasonMissed -} - -// The call was ended before the conversation started. It was declined by the other party -type CallDiscardReasonDeclined struct { - meta -} - -func (entity *CallDiscardReasonDeclined) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub CallDiscardReasonDeclined - - return json.Marshal((*stub)(entity)) -} - -func (*CallDiscardReasonDeclined) GetClass() string { - return ClassCallDiscardReason -} - -func (*CallDiscardReasonDeclined) GetType() string { - return TypeCallDiscardReasonDeclined -} - -func (*CallDiscardReasonDeclined) CallDiscardReasonType() string { - return TypeCallDiscardReasonDeclined -} - -// The call was ended during the conversation because the users were disconnected -type CallDiscardReasonDisconnected struct { - meta -} - -func (entity *CallDiscardReasonDisconnected) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub CallDiscardReasonDisconnected - - return json.Marshal((*stub)(entity)) -} - -func (*CallDiscardReasonDisconnected) GetClass() string { - return ClassCallDiscardReason -} - -func (*CallDiscardReasonDisconnected) GetType() string { - return TypeCallDiscardReasonDisconnected -} - -func (*CallDiscardReasonDisconnected) CallDiscardReasonType() string { - return TypeCallDiscardReasonDisconnected -} - -// The call was ended because one of the parties hung up -type CallDiscardReasonHungUp struct { - meta -} - -func (entity *CallDiscardReasonHungUp) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub CallDiscardReasonHungUp - - return json.Marshal((*stub)(entity)) -} - -func (*CallDiscardReasonHungUp) GetClass() string { - return ClassCallDiscardReason -} - -func (*CallDiscardReasonHungUp) GetType() string { - return TypeCallDiscardReasonHungUp -} - -func (*CallDiscardReasonHungUp) CallDiscardReasonType() string { - return TypeCallDiscardReasonHungUp -} - -// Specifies the supported call protocols -type CallProtocol struct { - 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"` -} - -func (entity *CallProtocol) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub CallProtocol - - return json.Marshal((*stub)(entity)) -} - -func (*CallProtocol) GetClass() string { - return ClassCallProtocol -} - -func (*CallProtocol) GetType() string { - return TypeCallProtocol -} - -// A Telegram call reflector -type CallServerTypeTelegramReflector struct { - meta - // A peer tag to be used with the reflector - PeerTag []byte `json:"peer_tag"` - // True, if the server uses TCP instead of UDP - IsTcp bool `json:"is_tcp"` -} - -func (entity *CallServerTypeTelegramReflector) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub CallServerTypeTelegramReflector - - return json.Marshal((*stub)(entity)) -} - -func (*CallServerTypeTelegramReflector) GetClass() string { - return ClassCallServerType -} - -func (*CallServerTypeTelegramReflector) GetType() string { - return TypeCallServerTypeTelegramReflector -} - -func (*CallServerTypeTelegramReflector) CallServerTypeType() string { - return TypeCallServerTypeTelegramReflector -} - -// A WebRTC server -type CallServerTypeWebrtc struct { - 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"` -} - -func (entity *CallServerTypeWebrtc) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub CallServerTypeWebrtc - - return json.Marshal((*stub)(entity)) -} - -func (*CallServerTypeWebrtc) GetClass() string { - return ClassCallServerType -} - -func (*CallServerTypeWebrtc) GetType() string { - return TypeCallServerTypeWebrtc -} - -func (*CallServerTypeWebrtc) CallServerTypeType() string { - return TypeCallServerTypeWebrtc -} - -// Describes a server for relaying call data -type CallServer struct { - 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"` -} - -func (entity *CallServer) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub CallServer - - return json.Marshal((*stub)(entity)) -} - -func (*CallServer) GetClass() string { - return ClassCallServer -} - -func (*CallServer) GetType() string { - return TypeCallServer -} - -func (callServer *CallServer) UnmarshalJSON(data []byte) error { - 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"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - callServer.Id = tmp.Id - callServer.IpAddress = tmp.IpAddress - callServer.Ipv6Address = tmp.Ipv6Address - callServer.Port = tmp.Port - - fieldType, _ := UnmarshalCallServerType(tmp.Type) - callServer.Type = fieldType - - return nil -} - -// Contains the call identifier -type CallId struct { - meta - // Call identifier - Id int32 `json:"id"` -} - -func (entity *CallId) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub CallId - - return json.Marshal((*stub)(entity)) -} - -func (*CallId) GetClass() string { - return ClassCallId -} - -func (*CallId) GetType() string { - return TypeCallId -} - -// Contains the group call identifier -type GroupCallId struct { - meta - // Group call identifier - Id int32 `json:"id"` -} - -func (entity *GroupCallId) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub GroupCallId - - return json.Marshal((*stub)(entity)) -} - -func (*GroupCallId) GetClass() string { - return ClassGroupCallId -} - -func (*GroupCallId) GetType() string { - return TypeGroupCallId -} - -// The call is pending, waiting to be accepted by a user -type CallStatePending struct { - 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"` -} - -func (entity *CallStatePending) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub CallStatePending - - return json.Marshal((*stub)(entity)) -} - -func (*CallStatePending) GetClass() string { - return ClassCallState -} - -func (*CallStatePending) GetType() string { - return TypeCallStatePending -} - -func (*CallStatePending) CallStateType() string { - return TypeCallStatePending -} - -// The call has been answered and encryption keys are being exchanged -type CallStateExchangingKeys struct { - meta -} - -func (entity *CallStateExchangingKeys) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub CallStateExchangingKeys - - return json.Marshal((*stub)(entity)) -} - -func (*CallStateExchangingKeys) GetClass() string { - return ClassCallState -} - -func (*CallStateExchangingKeys) GetType() string { - return TypeCallStateExchangingKeys -} - -func (*CallStateExchangingKeys) CallStateType() string { - return TypeCallStateExchangingKeys -} - -// The call is ready to use -type CallStateReady struct { - 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"` -} - -func (entity *CallStateReady) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub CallStateReady - - return json.Marshal((*stub)(entity)) -} - -func (*CallStateReady) GetClass() string { - return ClassCallState -} - -func (*CallStateReady) GetType() string { - return TypeCallStateReady -} - -func (*CallStateReady) CallStateType() string { - return TypeCallStateReady -} - -// The call is hanging up after discardCall has been called -type CallStateHangingUp struct { - meta -} - -func (entity *CallStateHangingUp) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub CallStateHangingUp - - return json.Marshal((*stub)(entity)) -} - -func (*CallStateHangingUp) GetClass() string { - return ClassCallState -} - -func (*CallStateHangingUp) GetType() string { - return TypeCallStateHangingUp -} - -func (*CallStateHangingUp) CallStateType() string { - return TypeCallStateHangingUp -} - -// The call has ended successfully -type CallStateDiscarded struct { - 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"` - // True, if the call log must be sent to the server - NeedLog bool `json:"need_log"` -} - -func (entity *CallStateDiscarded) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub CallStateDiscarded - - return json.Marshal((*stub)(entity)) -} - -func (*CallStateDiscarded) GetClass() string { - return ClassCallState -} - -func (*CallStateDiscarded) GetType() string { - return TypeCallStateDiscarded -} - -func (*CallStateDiscarded) CallStateType() string { - return TypeCallStateDiscarded -} - -func (callStateDiscarded *CallStateDiscarded) UnmarshalJSON(data []byte) error { - var tmp struct { - Reason json.RawMessage `json:"reason"` - NeedRating bool `json:"need_rating"` - NeedDebugInformation bool `json:"need_debug_information"` - NeedLog bool `json:"need_log"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - callStateDiscarded.NeedRating = tmp.NeedRating - callStateDiscarded.NeedDebugInformation = tmp.NeedDebugInformation - callStateDiscarded.NeedLog = tmp.NeedLog - - fieldReason, _ := UnmarshalCallDiscardReason(tmp.Reason) - callStateDiscarded.Reason = fieldReason - - return nil -} - -// The call has ended with an error -type CallStateError struct { - 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"` -} - -func (entity *CallStateError) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub CallStateError - - return json.Marshal((*stub)(entity)) -} - -func (*CallStateError) GetClass() string { - return ClassCallState -} - -func (*CallStateError) GetType() string { - return TypeCallStateError -} - -func (*CallStateError) CallStateType() string { - return TypeCallStateError -} - -// The worst available video quality -type GroupCallVideoQualityThumbnail struct { - meta -} - -func (entity *GroupCallVideoQualityThumbnail) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub GroupCallVideoQualityThumbnail - - return json.Marshal((*stub)(entity)) -} - -func (*GroupCallVideoQualityThumbnail) GetClass() string { - return ClassGroupCallVideoQuality -} - -func (*GroupCallVideoQualityThumbnail) GetType() string { - return TypeGroupCallVideoQualityThumbnail -} - -func (*GroupCallVideoQualityThumbnail) GroupCallVideoQualityType() string { - return TypeGroupCallVideoQualityThumbnail -} - -// The medium video quality -type GroupCallVideoQualityMedium struct { - meta -} - -func (entity *GroupCallVideoQualityMedium) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub GroupCallVideoQualityMedium - - return json.Marshal((*stub)(entity)) -} - -func (*GroupCallVideoQualityMedium) GetClass() string { - return ClassGroupCallVideoQuality -} - -func (*GroupCallVideoQualityMedium) GetType() string { - return TypeGroupCallVideoQualityMedium -} - -func (*GroupCallVideoQualityMedium) GroupCallVideoQualityType() string { - return TypeGroupCallVideoQualityMedium -} - -// The best available video quality -type GroupCallVideoQualityFull struct { - meta -} - -func (entity *GroupCallVideoQualityFull) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub GroupCallVideoQualityFull - - return json.Marshal((*stub)(entity)) -} - -func (*GroupCallVideoQualityFull) GetClass() string { - return ClassGroupCallVideoQuality -} - -func (*GroupCallVideoQualityFull) GetType() string { - return TypeGroupCallVideoQualityFull -} - -func (*GroupCallVideoQualityFull) GroupCallVideoQualityType() string { - 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 -} - -// Describes a recently speaking participant in a group call -type GroupCallRecentSpeaker struct { - meta - // Group call participant identifier - ParticipantId MessageSender `json:"participant_id"` - // True, is the user has spoken recently - IsSpeaking bool `json:"is_speaking"` -} - -func (entity *GroupCallRecentSpeaker) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub GroupCallRecentSpeaker - - return json.Marshal((*stub)(entity)) -} - -func (*GroupCallRecentSpeaker) GetClass() string { - return ClassGroupCallRecentSpeaker -} - -func (*GroupCallRecentSpeaker) GetType() string { - return TypeGroupCallRecentSpeaker -} - -func (groupCallRecentSpeaker *GroupCallRecentSpeaker) UnmarshalJSON(data []byte) error { - var tmp struct { - ParticipantId json.RawMessage `json:"participant_id"` - IsSpeaking bool `json:"is_speaking"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - groupCallRecentSpeaker.IsSpeaking = tmp.IsSpeaking - - fieldParticipantId, _ := UnmarshalMessageSender(tmp.ParticipantId) - groupCallRecentSpeaker.ParticipantId = fieldParticipantId - - return nil -} - -// Describes a group call -type GroupCall struct { - 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"` -} - -func (entity *GroupCall) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub GroupCall - - return json.Marshal((*stub)(entity)) -} - -func (*GroupCall) GetClass() string { - return ClassGroupCall -} - -func (*GroupCall) GetType() string { - return TypeGroupCall -} - -// Describes a group of video synchronization source identifiers -type GroupCallVideoSourceGroup struct { - 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"` -} - -func (entity *GroupCallVideoSourceGroup) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub GroupCallVideoSourceGroup - - return json.Marshal((*stub)(entity)) -} - -func (*GroupCallVideoSourceGroup) GetClass() string { - return ClassGroupCallVideoSourceGroup -} - -func (*GroupCallVideoSourceGroup) GetType() string { - return TypeGroupCallVideoSourceGroup -} - -// Contains information about a group call participant's video channel -type GroupCallParticipantVideoInfo struct { - 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"` -} - -func (entity *GroupCallParticipantVideoInfo) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub GroupCallParticipantVideoInfo - - return json.Marshal((*stub)(entity)) -} - -func (*GroupCallParticipantVideoInfo) GetClass() string { - return ClassGroupCallParticipantVideoInfo -} - -func (*GroupCallParticipantVideoInfo) GetType() string { - return TypeGroupCallParticipantVideoInfo -} - -// Represents a group call participant -type GroupCallParticipant struct { - 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"` -} - -func (entity *GroupCallParticipant) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub GroupCallParticipant - - return json.Marshal((*stub)(entity)) -} - -func (*GroupCallParticipant) GetClass() string { - return ClassGroupCallParticipant -} - -func (*GroupCallParticipant) GetType() string { - return TypeGroupCallParticipant -} - -func (groupCallParticipant *GroupCallParticipant) UnmarshalJSON(data []byte) error { - 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 -} - -// The user heard their own voice -type CallProblemEcho struct { - meta -} - -func (entity *CallProblemEcho) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub CallProblemEcho - - return json.Marshal((*stub)(entity)) -} - -func (*CallProblemEcho) GetClass() string { - return ClassCallProblem -} - -func (*CallProblemEcho) GetType() string { - return TypeCallProblemEcho -} - -func (*CallProblemEcho) CallProblemType() string { - return TypeCallProblemEcho -} - -// The user heard background noise -type CallProblemNoise struct { - meta -} - -func (entity *CallProblemNoise) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub CallProblemNoise - - return json.Marshal((*stub)(entity)) -} - -func (*CallProblemNoise) GetClass() string { - return ClassCallProblem -} - -func (*CallProblemNoise) GetType() string { - return TypeCallProblemNoise -} - -func (*CallProblemNoise) CallProblemType() string { - return TypeCallProblemNoise -} - -// The other side kept disappearing -type CallProblemInterruptions struct { - meta -} - -func (entity *CallProblemInterruptions) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub CallProblemInterruptions - - return json.Marshal((*stub)(entity)) -} - -func (*CallProblemInterruptions) GetClass() string { - return ClassCallProblem -} - -func (*CallProblemInterruptions) GetType() string { - return TypeCallProblemInterruptions -} - -func (*CallProblemInterruptions) CallProblemType() string { - return TypeCallProblemInterruptions -} - -// The speech was distorted -type CallProblemDistortedSpeech struct { - meta -} - -func (entity *CallProblemDistortedSpeech) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub CallProblemDistortedSpeech - - return json.Marshal((*stub)(entity)) -} - -func (*CallProblemDistortedSpeech) GetClass() string { - return ClassCallProblem -} - -func (*CallProblemDistortedSpeech) GetType() string { - return TypeCallProblemDistortedSpeech -} - -func (*CallProblemDistortedSpeech) CallProblemType() string { - return TypeCallProblemDistortedSpeech -} - -// The user couldn't hear the other side -type CallProblemSilentLocal struct { - meta -} - -func (entity *CallProblemSilentLocal) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub CallProblemSilentLocal - - return json.Marshal((*stub)(entity)) -} - -func (*CallProblemSilentLocal) GetClass() string { - return ClassCallProblem -} - -func (*CallProblemSilentLocal) GetType() string { - return TypeCallProblemSilentLocal -} - -func (*CallProblemSilentLocal) CallProblemType() string { - return TypeCallProblemSilentLocal -} - -// The other side couldn't hear the user -type CallProblemSilentRemote struct { - meta -} - -func (entity *CallProblemSilentRemote) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub CallProblemSilentRemote - - return json.Marshal((*stub)(entity)) -} - -func (*CallProblemSilentRemote) GetClass() string { - return ClassCallProblem -} - -func (*CallProblemSilentRemote) GetType() string { - return TypeCallProblemSilentRemote -} - -func (*CallProblemSilentRemote) CallProblemType() string { - return TypeCallProblemSilentRemote -} - -// The call ended unexpectedly -type CallProblemDropped struct { - meta -} - -func (entity *CallProblemDropped) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub CallProblemDropped - - return json.Marshal((*stub)(entity)) -} - -func (*CallProblemDropped) GetClass() string { - return ClassCallProblem -} - -func (*CallProblemDropped) GetType() string { - return TypeCallProblemDropped -} - -func (*CallProblemDropped) CallProblemType() string { - return TypeCallProblemDropped -} - -// The video was distorted -type CallProblemDistortedVideo struct { - meta -} - -func (entity *CallProblemDistortedVideo) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub CallProblemDistortedVideo - - return json.Marshal((*stub)(entity)) -} - -func (*CallProblemDistortedVideo) GetClass() string { - return ClassCallProblem -} - -func (*CallProblemDistortedVideo) GetType() string { - return TypeCallProblemDistortedVideo -} - -func (*CallProblemDistortedVideo) CallProblemType() string { - return TypeCallProblemDistortedVideo -} - -// The video was pixelated -type CallProblemPixelatedVideo struct { - meta -} - -func (entity *CallProblemPixelatedVideo) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub CallProblemPixelatedVideo - - return json.Marshal((*stub)(entity)) -} - -func (*CallProblemPixelatedVideo) GetClass() string { - return ClassCallProblem -} - -func (*CallProblemPixelatedVideo) GetType() string { - return TypeCallProblemPixelatedVideo -} - -func (*CallProblemPixelatedVideo) CallProblemType() string { - return TypeCallProblemPixelatedVideo -} - -// Describes a call -type Call struct { - 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"` -} - -func (entity *Call) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub Call - - return json.Marshal((*stub)(entity)) -} - -func (*Call) GetClass() string { - return ClassCall -} - -func (*Call) GetType() string { - return TypeCall -} - -func (call *Call) UnmarshalJSON(data []byte) error { - 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"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - call.Id = tmp.Id - call.UserId = tmp.UserId - call.IsOutgoing = tmp.IsOutgoing - call.IsVideo = tmp.IsVideo - - fieldState, _ := UnmarshalCallState(tmp.State) - call.State = fieldState - - return nil -} - -// Contains settings for the authentication of the user's phone number -type PhoneNumberAuthenticationSettings struct { - 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"` -} - -func (entity *PhoneNumberAuthenticationSettings) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PhoneNumberAuthenticationSettings - - return json.Marshal((*stub)(entity)) -} - -func (*PhoneNumberAuthenticationSettings) GetClass() string { - return ClassPhoneNumberAuthenticationSettings -} - -func (*PhoneNumberAuthenticationSettings) GetType() string { - return TypePhoneNumberAuthenticationSettings -} - -// Represents a reaction applied to a message -type AddedReaction struct { - meta - // Type of the reaction - Type ReactionType `json:"type"` - // Identifier of the chat member, applied the reaction - SenderId MessageSender `json:"sender_id"` -} - -func (entity *AddedReaction) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub AddedReaction - - return json.Marshal((*stub)(entity)) -} - -func (*AddedReaction) GetClass() string { - return ClassAddedReaction -} - -func (*AddedReaction) GetType() string { - return TypeAddedReaction -} - -func (addedReaction *AddedReaction) UnmarshalJSON(data []byte) error { - var tmp struct { - Type json.RawMessage `json:"type"` - SenderId json.RawMessage `json:"sender_id"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - fieldType, _ := UnmarshalReactionType(tmp.Type) - addedReaction.Type = fieldType - - fieldSenderId, _ := UnmarshalMessageSender(tmp.SenderId) - addedReaction.SenderId = fieldSenderId - - return nil -} - -// Represents a list of reactions added to a message -type AddedReactions struct { - 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"` -} - -func (entity *AddedReactions) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub AddedReactions - - return json.Marshal((*stub)(entity)) -} - -func (*AddedReactions) GetClass() string { - return ClassAddedReactions -} - -func (*AddedReactions) GetType() string { - return TypeAddedReactions -} - -// Represents an available reaction -type AvailableReaction struct { - meta - // Type of the reaction - Type ReactionType `json:"type"` - // True, if Telegram Premium is needed to send the reaction - NeedsPremium bool `json:"needs_premium"` -} - -func (entity *AvailableReaction) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub AvailableReaction - - return json.Marshal((*stub)(entity)) -} - -func (*AvailableReaction) GetClass() string { - return ClassAvailableReaction -} - -func (*AvailableReaction) GetType() string { - return TypeAvailableReaction -} - -func (availableReaction *AvailableReaction) UnmarshalJSON(data []byte) error { - var tmp struct { - Type json.RawMessage `json:"type"` - NeedsPremium bool `json:"needs_premium"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - availableReaction.NeedsPremium = tmp.NeedsPremium - - fieldType, _ := UnmarshalReactionType(tmp.Type) - availableReaction.Type = fieldType - - return nil -} - -// Represents a list of reactions that can be added to a message -type AvailableReactions struct { - meta - // List of reactions to be shown at the top - TopReactions []*AvailableReaction `json:"top_reactions"` - // List of recently used reactions - RecentReactions []*AvailableReaction `json:"recent_reactions"` - // List of popular reactions - PopularReactions []*AvailableReaction `json:"popular_reactions"` - // True, if custom emoji reactions could be added by Telegram Premium subscribers - AllowCustomEmoji bool `json:"allow_custom_emoji"` -} - -func (entity *AvailableReactions) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub AvailableReactions - - return json.Marshal((*stub)(entity)) -} - -func (*AvailableReactions) GetClass() string { - return ClassAvailableReactions -} - -func (*AvailableReactions) GetType() string { - return TypeAvailableReactions -} - -// Contains information about a emoji reaction -type EmojiReaction struct { - meta - // Text representation of the reaction - Emoji string `json:"emoji"` - // 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"` -} - -func (entity *EmojiReaction) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub EmojiReaction - - return json.Marshal((*stub)(entity)) -} - -func (*EmojiReaction) GetClass() string { - return ClassEmojiReaction -} - -func (*EmojiReaction) GetType() string { - return TypeEmojiReaction -} - -// Represents a list of animations -type Animations struct { - meta - // List of animations - Animations []*Animation `json:"animations"` -} - -func (entity *Animations) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub Animations - - return json.Marshal((*stub)(entity)) -} - -func (*Animations) GetClass() string { - return ClassAnimations -} - -func (*Animations) GetType() string { - return TypeAnimations -} - -// A regular animated sticker -type DiceStickersRegular struct { - meta - // The animated sticker with the dice animation - Sticker *Sticker `json:"sticker"` -} - -func (entity *DiceStickersRegular) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub DiceStickersRegular - - return json.Marshal((*stub)(entity)) -} - -func (*DiceStickersRegular) GetClass() string { - return ClassDiceStickers -} - -func (*DiceStickersRegular) GetType() string { - return TypeDiceStickersRegular -} - -func (*DiceStickersRegular) DiceStickersType() string { - return TypeDiceStickersRegular -} - -// Animated stickers to be combined into a slot machine -type DiceStickersSlotMachine struct { - 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"` -} - -func (entity *DiceStickersSlotMachine) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub DiceStickersSlotMachine - - return json.Marshal((*stub)(entity)) -} - -func (*DiceStickersSlotMachine) GetClass() string { - return ClassDiceStickers -} - -func (*DiceStickersSlotMachine) GetType() string { - return TypeDiceStickersSlotMachine -} - -func (*DiceStickersSlotMachine) DiceStickersType() string { - return TypeDiceStickersSlotMachine -} - -// Represents the result of an importContacts request -type ImportedContacts struct { - 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"` -} - -func (entity *ImportedContacts) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ImportedContacts - - return json.Marshal((*stub)(entity)) -} - -func (*ImportedContacts) GetClass() string { - return ClassImportedContacts -} - -func (*ImportedContacts) GetType() string { - return TypeImportedContacts -} - -// The speech recognition is ongoing -type SpeechRecognitionResultPending struct { - meta - // Partially recognized text - PartialText string `json:"partial_text"` -} - -func (entity *SpeechRecognitionResultPending) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub SpeechRecognitionResultPending - - return json.Marshal((*stub)(entity)) -} - -func (*SpeechRecognitionResultPending) GetClass() string { - return ClassSpeechRecognitionResult -} - -func (*SpeechRecognitionResultPending) GetType() string { - return TypeSpeechRecognitionResultPending -} - -func (*SpeechRecognitionResultPending) SpeechRecognitionResultType() string { - return TypeSpeechRecognitionResultPending -} - -// The speech recognition successfully finished -type SpeechRecognitionResultText struct { - meta - // Recognized text - Text string `json:"text"` -} - -func (entity *SpeechRecognitionResultText) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub SpeechRecognitionResultText - - return json.Marshal((*stub)(entity)) -} - -func (*SpeechRecognitionResultText) GetClass() string { - return ClassSpeechRecognitionResult -} - -func (*SpeechRecognitionResultText) GetType() string { - return TypeSpeechRecognitionResultText -} - -func (*SpeechRecognitionResultText) SpeechRecognitionResultType() string { - return TypeSpeechRecognitionResultText -} - -// The speech recognition failed -type SpeechRecognitionResultError struct { - meta - // Received error - Error *Error `json:"error"` -} - -func (entity *SpeechRecognitionResultError) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub SpeechRecognitionResultError - - return json.Marshal((*stub)(entity)) -} - -func (*SpeechRecognitionResultError) GetClass() string { - return ClassSpeechRecognitionResult -} - -func (*SpeechRecognitionResultError) GetType() string { - return TypeSpeechRecognitionResultError -} - -func (*SpeechRecognitionResultError) SpeechRecognitionResultType() string { - return TypeSpeechRecognitionResultError -} - -// Describes a color to highlight a bot added to attachment menu -type AttachmentMenuBotColor struct { - meta - // Color in the RGB24 format for light themes - LightColor int32 `json:"light_color"` - // Color in the RGB24 format for dark themes - DarkColor int32 `json:"dark_color"` -} - -func (entity *AttachmentMenuBotColor) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub AttachmentMenuBotColor - - return json.Marshal((*stub)(entity)) -} - -func (*AttachmentMenuBotColor) GetClass() string { - return ClassAttachmentMenuBotColor -} - -func (*AttachmentMenuBotColor) GetType() string { - return TypeAttachmentMenuBotColor -} - -// Represents a bot, which can be added to attachment menu -type AttachmentMenuBot struct { - meta - // User identifier of the bot added to attachment menu - BotUserId int64 `json:"bot_user_id"` - // True, if the bot supports opening from attachment menu in the chat with the bot - SupportsSelfChat bool `json:"supports_self_chat"` - // True, if the bot supports opening from attachment menu in private chats with ordinary users - SupportsUserChats bool `json:"supports_user_chats"` - // True, if the bot supports opening from attachment menu in private chats with other bots - SupportsBotChats bool `json:"supports_bot_chats"` - // True, if the bot supports opening from attachment menu in basic group and supergroup chats - SupportsGroupChats bool `json:"supports_group_chats"` - // True, if the bot supports opening from attachment menu in channel chats - SupportsChannelChats bool `json:"supports_channel_chats"` - // True, if the bot supports "settings_button_pressed" event - SupportsSettings bool `json:"supports_settings"` - // 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"` - // Name for the bot in attachment menu - Name string `json:"name"` - // Color to highlight selected name of the bot if appropriate; may be null - NameColor *AttachmentMenuBotColor `json:"name_color"` - // Default attachment menu icon for the bot in SVG format; may be null - DefaultIcon *File `json:"default_icon"` - // Attachment menu icon for the bot in SVG format for the official iOS app; may be null - IosStaticIcon *File `json:"ios_static_icon"` - // Attachment menu icon for the bot in TGS format for the official iOS app; may be null - IosAnimatedIcon *File `json:"ios_animated_icon"` - // Attachment menu icon for the bot in TGS format for the official Android app; may be null - AndroidIcon *File `json:"android_icon"` - // Attachment menu icon for the bot in TGS format for the official native macOS app; may be null - MacosIcon *File `json:"macos_icon"` - // Color to highlight selected icon of the bot if appropriate; may be null - IconColor *AttachmentMenuBotColor `json:"icon_color"` - // Default placeholder for opened Web Apps in SVG format; may be null - WebAppPlaceholder *File `json:"web_app_placeholder"` -} - -func (entity *AttachmentMenuBot) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub AttachmentMenuBot - - return json.Marshal((*stub)(entity)) -} - -func (*AttachmentMenuBot) GetClass() string { - return ClassAttachmentMenuBot -} - -func (*AttachmentMenuBot) GetType() string { - return TypeAttachmentMenuBot -} - -// Information about the message sent by answerWebAppQuery -type SentWebAppMessage struct { - meta - // Identifier of the sent inline message, if known - InlineMessageId string `json:"inline_message_id"` -} - -func (entity *SentWebAppMessage) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub SentWebAppMessage - - return json.Marshal((*stub)(entity)) -} - -func (*SentWebAppMessage) GetClass() string { - return ClassSentWebAppMessage -} - -func (*SentWebAppMessage) GetType() string { - return TypeSentWebAppMessage -} - -// Contains an HTTP URL -type HttpUrl struct { - meta - // The URL - Url string `json:"url"` -} - -func (entity *HttpUrl) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub HttpUrl - - return json.Marshal((*stub)(entity)) -} - -func (*HttpUrl) GetClass() string { - return ClassHttpUrl -} - -func (*HttpUrl) GetType() string { - return TypeHttpUrl -} - -// Contains an HTTPS URL, which can be used to get information about a user -type UserLink struct { - meta - // The URL - Url string `json:"url"` - // Left time for which the link is valid, in seconds; 0 if the link is a public username link - ExpiresIn int32 `json:"expires_in"` -} - -func (entity *UserLink) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UserLink - - return json.Marshal((*stub)(entity)) -} - -func (*UserLink) GetClass() string { - return ClassUserLink -} - -func (*UserLink) GetType() string { - return TypeUserLink -} - -// Represents a link to an animated GIF or an animated (i.e., without sound) H.264/MPEG-4 AVC video -type InputInlineQueryResultAnimation struct { - 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"` -} - -func (entity *InputInlineQueryResultAnimation) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputInlineQueryResultAnimation - - return json.Marshal((*stub)(entity)) -} - -func (*InputInlineQueryResultAnimation) GetClass() string { - return ClassInputInlineQueryResult -} - -func (*InputInlineQueryResultAnimation) GetType() string { - return TypeInputInlineQueryResultAnimation -} - -func (*InputInlineQueryResultAnimation) InputInlineQueryResultType() string { - return TypeInputInlineQueryResultAnimation -} - -func (inputInlineQueryResultAnimation *InputInlineQueryResultAnimation) UnmarshalJSON(data []byte) error { - 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 -} - -// Represents a link to an article or web page -type InputInlineQueryResultArticle struct { - 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"` -} - -func (entity *InputInlineQueryResultArticle) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputInlineQueryResultArticle - - return json.Marshal((*stub)(entity)) -} - -func (*InputInlineQueryResultArticle) GetClass() string { - return ClassInputInlineQueryResult -} - -func (*InputInlineQueryResultArticle) GetType() string { - return TypeInputInlineQueryResultArticle -} - -func (*InputInlineQueryResultArticle) InputInlineQueryResultType() string { - return TypeInputInlineQueryResultArticle -} - -func (inputInlineQueryResultArticle *InputInlineQueryResultArticle) UnmarshalJSON(data []byte) error { - 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 -} - -// Represents a link to an MP3 audio file -type InputInlineQueryResultAudio struct { - 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"` -} - -func (entity *InputInlineQueryResultAudio) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputInlineQueryResultAudio - - return json.Marshal((*stub)(entity)) -} - -func (*InputInlineQueryResultAudio) GetClass() string { - return ClassInputInlineQueryResult -} - -func (*InputInlineQueryResultAudio) GetType() string { - return TypeInputInlineQueryResultAudio -} - -func (*InputInlineQueryResultAudio) InputInlineQueryResultType() string { - return TypeInputInlineQueryResultAudio -} - -func (inputInlineQueryResultAudio *InputInlineQueryResultAudio) UnmarshalJSON(data []byte) error { - 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"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - inputInlineQueryResultAudio.Id = tmp.Id - inputInlineQueryResultAudio.Title = tmp.Title - inputInlineQueryResultAudio.Performer = tmp.Performer - inputInlineQueryResultAudio.AudioUrl = tmp.AudioUrl - inputInlineQueryResultAudio.AudioDuration = tmp.AudioDuration - - fieldReplyMarkup, _ := UnmarshalReplyMarkup(tmp.ReplyMarkup) - inputInlineQueryResultAudio.ReplyMarkup = fieldReplyMarkup - - fieldInputMessageContent, _ := UnmarshalInputMessageContent(tmp.InputMessageContent) - inputInlineQueryResultAudio.InputMessageContent = fieldInputMessageContent - - return nil -} - -// Represents a user contact -type InputInlineQueryResultContact struct { - 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"` -} - -func (entity *InputInlineQueryResultContact) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputInlineQueryResultContact - - return json.Marshal((*stub)(entity)) -} - -func (*InputInlineQueryResultContact) GetClass() string { - return ClassInputInlineQueryResult -} - -func (*InputInlineQueryResultContact) GetType() string { - return TypeInputInlineQueryResultContact -} - -func (*InputInlineQueryResultContact) InputInlineQueryResultType() string { - return TypeInputInlineQueryResultContact -} - -func (inputInlineQueryResultContact *InputInlineQueryResultContact) UnmarshalJSON(data []byte) error { - 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"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - inputInlineQueryResultContact.Id = tmp.Id - inputInlineQueryResultContact.Contact = tmp.Contact - inputInlineQueryResultContact.ThumbnailUrl = tmp.ThumbnailUrl - inputInlineQueryResultContact.ThumbnailWidth = tmp.ThumbnailWidth - inputInlineQueryResultContact.ThumbnailHeight = tmp.ThumbnailHeight - - fieldReplyMarkup, _ := UnmarshalReplyMarkup(tmp.ReplyMarkup) - inputInlineQueryResultContact.ReplyMarkup = fieldReplyMarkup - - fieldInputMessageContent, _ := UnmarshalInputMessageContent(tmp.InputMessageContent) - inputInlineQueryResultContact.InputMessageContent = fieldInputMessageContent - - return nil -} - -// Represents a link to a file -type InputInlineQueryResultDocument struct { - 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"` -} - -func (entity *InputInlineQueryResultDocument) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputInlineQueryResultDocument - - return json.Marshal((*stub)(entity)) -} - -func (*InputInlineQueryResultDocument) GetClass() string { - return ClassInputInlineQueryResult -} - -func (*InputInlineQueryResultDocument) GetType() string { - return TypeInputInlineQueryResultDocument -} - -func (*InputInlineQueryResultDocument) InputInlineQueryResultType() string { - return TypeInputInlineQueryResultDocument -} - -func (inputInlineQueryResultDocument *InputInlineQueryResultDocument) UnmarshalJSON(data []byte) error { - 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 -} - -// Represents a game -type InputInlineQueryResultGame struct { - 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"` -} - -func (entity *InputInlineQueryResultGame) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputInlineQueryResultGame - - return json.Marshal((*stub)(entity)) -} - -func (*InputInlineQueryResultGame) GetClass() string { - return ClassInputInlineQueryResult -} - -func (*InputInlineQueryResultGame) GetType() string { - return TypeInputInlineQueryResultGame -} - -func (*InputInlineQueryResultGame) InputInlineQueryResultType() string { - return TypeInputInlineQueryResultGame -} - -func (inputInlineQueryResultGame *InputInlineQueryResultGame) UnmarshalJSON(data []byte) error { - var tmp struct { - Id string `json:"id"` - GameShortName string `json:"game_short_name"` - ReplyMarkup json.RawMessage `json:"reply_markup"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - inputInlineQueryResultGame.Id = tmp.Id - inputInlineQueryResultGame.GameShortName = tmp.GameShortName - - fieldReplyMarkup, _ := UnmarshalReplyMarkup(tmp.ReplyMarkup) - inputInlineQueryResultGame.ReplyMarkup = fieldReplyMarkup - - return nil -} - -// Represents a point on the map -type InputInlineQueryResultLocation struct { - 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"` -} - -func (entity *InputInlineQueryResultLocation) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputInlineQueryResultLocation - - return json.Marshal((*stub)(entity)) -} - -func (*InputInlineQueryResultLocation) GetClass() string { - return ClassInputInlineQueryResult -} - -func (*InputInlineQueryResultLocation) GetType() string { - return TypeInputInlineQueryResultLocation -} - -func (*InputInlineQueryResultLocation) InputInlineQueryResultType() string { - return TypeInputInlineQueryResultLocation -} - -func (inputInlineQueryResultLocation *InputInlineQueryResultLocation) UnmarshalJSON(data []byte) error { - 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 -} - -// Represents link to a JPEG image -type InputInlineQueryResultPhoto struct { - 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"` -} - -func (entity *InputInlineQueryResultPhoto) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputInlineQueryResultPhoto - - return json.Marshal((*stub)(entity)) -} - -func (*InputInlineQueryResultPhoto) GetClass() string { - return ClassInputInlineQueryResult -} - -func (*InputInlineQueryResultPhoto) GetType() string { - return TypeInputInlineQueryResultPhoto -} - -func (*InputInlineQueryResultPhoto) InputInlineQueryResultType() string { - return TypeInputInlineQueryResultPhoto -} - -func (inputInlineQueryResultPhoto *InputInlineQueryResultPhoto) UnmarshalJSON(data []byte) error { - 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 -} - -// Represents a link to a WEBP, TGS, or WEBM sticker -type InputInlineQueryResultSticker struct { - 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"` -} - -func (entity *InputInlineQueryResultSticker) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputInlineQueryResultSticker - - return json.Marshal((*stub)(entity)) -} - -func (*InputInlineQueryResultSticker) GetClass() string { - return ClassInputInlineQueryResult -} - -func (*InputInlineQueryResultSticker) GetType() string { - return TypeInputInlineQueryResultSticker -} - -func (*InputInlineQueryResultSticker) InputInlineQueryResultType() string { - return TypeInputInlineQueryResultSticker -} - -func (inputInlineQueryResultSticker *InputInlineQueryResultSticker) UnmarshalJSON(data []byte) error { - 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"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - inputInlineQueryResultSticker.Id = tmp.Id - inputInlineQueryResultSticker.ThumbnailUrl = tmp.ThumbnailUrl - inputInlineQueryResultSticker.StickerUrl = tmp.StickerUrl - inputInlineQueryResultSticker.StickerWidth = tmp.StickerWidth - inputInlineQueryResultSticker.StickerHeight = tmp.StickerHeight - - fieldReplyMarkup, _ := UnmarshalReplyMarkup(tmp.ReplyMarkup) - inputInlineQueryResultSticker.ReplyMarkup = fieldReplyMarkup - - fieldInputMessageContent, _ := UnmarshalInputMessageContent(tmp.InputMessageContent) - inputInlineQueryResultSticker.InputMessageContent = fieldInputMessageContent - - return nil -} - -// Represents information about a venue -type InputInlineQueryResultVenue struct { - 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"` -} - -func (entity *InputInlineQueryResultVenue) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputInlineQueryResultVenue - - return json.Marshal((*stub)(entity)) -} - -func (*InputInlineQueryResultVenue) GetClass() string { - return ClassInputInlineQueryResult -} - -func (*InputInlineQueryResultVenue) GetType() string { - return TypeInputInlineQueryResultVenue -} - -func (*InputInlineQueryResultVenue) InputInlineQueryResultType() string { - return TypeInputInlineQueryResultVenue -} - -func (inputInlineQueryResultVenue *InputInlineQueryResultVenue) UnmarshalJSON(data []byte) error { - 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"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - inputInlineQueryResultVenue.Id = tmp.Id - inputInlineQueryResultVenue.Venue = tmp.Venue - inputInlineQueryResultVenue.ThumbnailUrl = tmp.ThumbnailUrl - inputInlineQueryResultVenue.ThumbnailWidth = tmp.ThumbnailWidth - inputInlineQueryResultVenue.ThumbnailHeight = tmp.ThumbnailHeight - - fieldReplyMarkup, _ := UnmarshalReplyMarkup(tmp.ReplyMarkup) - inputInlineQueryResultVenue.ReplyMarkup = fieldReplyMarkup - - fieldInputMessageContent, _ := UnmarshalInputMessageContent(tmp.InputMessageContent) - inputInlineQueryResultVenue.InputMessageContent = fieldInputMessageContent - - return nil -} - -// Represents a link to a page containing an embedded video player or a video file -type InputInlineQueryResultVideo struct { - 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"` -} - -func (entity *InputInlineQueryResultVideo) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputInlineQueryResultVideo - - return json.Marshal((*stub)(entity)) -} - -func (*InputInlineQueryResultVideo) GetClass() string { - return ClassInputInlineQueryResult -} - -func (*InputInlineQueryResultVideo) GetType() string { - return TypeInputInlineQueryResultVideo -} - -func (*InputInlineQueryResultVideo) InputInlineQueryResultType() string { - return TypeInputInlineQueryResultVideo -} - -func (inputInlineQueryResultVideo *InputInlineQueryResultVideo) UnmarshalJSON(data []byte) error { - 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 -} - -// Represents a link to an opus-encoded audio file within an OGG container, single channel audio -type InputInlineQueryResultVoiceNote struct { - 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"` -} - -func (entity *InputInlineQueryResultVoiceNote) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputInlineQueryResultVoiceNote - - return json.Marshal((*stub)(entity)) -} - -func (*InputInlineQueryResultVoiceNote) GetClass() string { - return ClassInputInlineQueryResult -} - -func (*InputInlineQueryResultVoiceNote) GetType() string { - return TypeInputInlineQueryResultVoiceNote -} - -func (*InputInlineQueryResultVoiceNote) InputInlineQueryResultType() string { - return TypeInputInlineQueryResultVoiceNote -} - -func (inputInlineQueryResultVoiceNote *InputInlineQueryResultVoiceNote) UnmarshalJSON(data []byte) error { - 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"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - inputInlineQueryResultVoiceNote.Id = tmp.Id - inputInlineQueryResultVoiceNote.Title = tmp.Title - inputInlineQueryResultVoiceNote.VoiceNoteUrl = tmp.VoiceNoteUrl - inputInlineQueryResultVoiceNote.VoiceNoteDuration = tmp.VoiceNoteDuration - - fieldReplyMarkup, _ := UnmarshalReplyMarkup(tmp.ReplyMarkup) - inputInlineQueryResultVoiceNote.ReplyMarkup = fieldReplyMarkup - - fieldInputMessageContent, _ := UnmarshalInputMessageContent(tmp.InputMessageContent) - inputInlineQueryResultVoiceNote.InputMessageContent = fieldInputMessageContent - - return nil -} - -// Represents a link to an article or web page -type InlineQueryResultArticle struct { - 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"` -} - -func (entity *InlineQueryResultArticle) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InlineQueryResultArticle - - return json.Marshal((*stub)(entity)) -} - -func (*InlineQueryResultArticle) GetClass() string { - return ClassInlineQueryResult -} - -func (*InlineQueryResultArticle) GetType() string { - return TypeInlineQueryResultArticle -} - -func (*InlineQueryResultArticle) InlineQueryResultType() string { - return TypeInlineQueryResultArticle -} - -// Represents a user contact -type InlineQueryResultContact struct { - 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"` -} - -func (entity *InlineQueryResultContact) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InlineQueryResultContact - - return json.Marshal((*stub)(entity)) -} - -func (*InlineQueryResultContact) GetClass() string { - return ClassInlineQueryResult -} - -func (*InlineQueryResultContact) GetType() string { - return TypeInlineQueryResultContact -} - -func (*InlineQueryResultContact) InlineQueryResultType() string { - return TypeInlineQueryResultContact -} - -// Represents a point on the map -type InlineQueryResultLocation struct { - 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"` -} - -func (entity *InlineQueryResultLocation) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InlineQueryResultLocation - - return json.Marshal((*stub)(entity)) -} - -func (*InlineQueryResultLocation) GetClass() string { - return ClassInlineQueryResult -} - -func (*InlineQueryResultLocation) GetType() string { - return TypeInlineQueryResultLocation -} - -func (*InlineQueryResultLocation) InlineQueryResultType() string { - return TypeInlineQueryResultLocation -} - -// Represents information about a venue -type InlineQueryResultVenue struct { - 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"` -} - -func (entity *InlineQueryResultVenue) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InlineQueryResultVenue - - return json.Marshal((*stub)(entity)) -} - -func (*InlineQueryResultVenue) GetClass() string { - return ClassInlineQueryResult -} - -func (*InlineQueryResultVenue) GetType() string { - return TypeInlineQueryResultVenue -} - -func (*InlineQueryResultVenue) InlineQueryResultType() string { - return TypeInlineQueryResultVenue -} - -// Represents information about a game -type InlineQueryResultGame struct { - meta - // Unique identifier of the query result - Id string `json:"id"` - // Game result - Game *Game `json:"game"` -} - -func (entity *InlineQueryResultGame) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InlineQueryResultGame - - return json.Marshal((*stub)(entity)) -} - -func (*InlineQueryResultGame) GetClass() string { - return ClassInlineQueryResult -} - -func (*InlineQueryResultGame) GetType() string { - return TypeInlineQueryResultGame -} - -func (*InlineQueryResultGame) InlineQueryResultType() string { - return TypeInlineQueryResultGame -} - -// Represents an animation file -type InlineQueryResultAnimation struct { - meta - // Unique identifier of the query result - Id string `json:"id"` - // Animation file - Animation *Animation `json:"animation"` - // Animation title - Title string `json:"title"` -} - -func (entity *InlineQueryResultAnimation) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InlineQueryResultAnimation - - return json.Marshal((*stub)(entity)) -} - -func (*InlineQueryResultAnimation) GetClass() string { - return ClassInlineQueryResult -} - -func (*InlineQueryResultAnimation) GetType() string { - return TypeInlineQueryResultAnimation -} - -func (*InlineQueryResultAnimation) InlineQueryResultType() string { - return TypeInlineQueryResultAnimation -} - -// Represents an audio file -type InlineQueryResultAudio struct { - meta - // Unique identifier of the query result - Id string `json:"id"` - // Audio file - Audio *Audio `json:"audio"` -} - -func (entity *InlineQueryResultAudio) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InlineQueryResultAudio - - return json.Marshal((*stub)(entity)) -} - -func (*InlineQueryResultAudio) GetClass() string { - return ClassInlineQueryResult -} - -func (*InlineQueryResultAudio) GetType() string { - return TypeInlineQueryResultAudio -} - -func (*InlineQueryResultAudio) InlineQueryResultType() string { - return TypeInlineQueryResultAudio -} - -// Represents a document -type InlineQueryResultDocument struct { - 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"` -} - -func (entity *InlineQueryResultDocument) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InlineQueryResultDocument - - return json.Marshal((*stub)(entity)) -} - -func (*InlineQueryResultDocument) GetClass() string { - return ClassInlineQueryResult -} - -func (*InlineQueryResultDocument) GetType() string { - return TypeInlineQueryResultDocument -} - -func (*InlineQueryResultDocument) InlineQueryResultType() string { - return TypeInlineQueryResultDocument -} - -// Represents a photo -type InlineQueryResultPhoto struct { - 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"` -} - -func (entity *InlineQueryResultPhoto) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InlineQueryResultPhoto - - return json.Marshal((*stub)(entity)) -} - -func (*InlineQueryResultPhoto) GetClass() string { - return ClassInlineQueryResult -} - -func (*InlineQueryResultPhoto) GetType() string { - return TypeInlineQueryResultPhoto -} - -func (*InlineQueryResultPhoto) InlineQueryResultType() string { - return TypeInlineQueryResultPhoto -} - -// Represents a sticker -type InlineQueryResultSticker struct { - meta - // Unique identifier of the query result - Id string `json:"id"` - // Sticker - Sticker *Sticker `json:"sticker"` -} - -func (entity *InlineQueryResultSticker) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InlineQueryResultSticker - - return json.Marshal((*stub)(entity)) -} - -func (*InlineQueryResultSticker) GetClass() string { - return ClassInlineQueryResult -} - -func (*InlineQueryResultSticker) GetType() string { - return TypeInlineQueryResultSticker -} - -func (*InlineQueryResultSticker) InlineQueryResultType() string { - return TypeInlineQueryResultSticker -} - -// Represents a video -type InlineQueryResultVideo struct { - 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"` -} - -func (entity *InlineQueryResultVideo) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InlineQueryResultVideo - - return json.Marshal((*stub)(entity)) -} - -func (*InlineQueryResultVideo) GetClass() string { - return ClassInlineQueryResult -} - -func (*InlineQueryResultVideo) GetType() string { - return TypeInlineQueryResultVideo -} - -func (*InlineQueryResultVideo) InlineQueryResultType() string { - return TypeInlineQueryResultVideo -} - -// Represents a voice note -type InlineQueryResultVoiceNote struct { - 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"` -} - -func (entity *InlineQueryResultVoiceNote) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InlineQueryResultVoiceNote - - return json.Marshal((*stub)(entity)) -} - -func (*InlineQueryResultVoiceNote) GetClass() string { - return ClassInlineQueryResult -} - -func (*InlineQueryResultVoiceNote) GetType() string { - return TypeInlineQueryResultVoiceNote -} - -func (*InlineQueryResultVoiceNote) InlineQueryResultType() string { - return TypeInlineQueryResultVoiceNote -} - -// Represents the results of the inline query. Use sendInlineQueryResultMessage to send the result of the query -type InlineQueryResults struct { - 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"` -} - -func (entity *InlineQueryResults) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InlineQueryResults - - return json.Marshal((*stub)(entity)) -} - -func (*InlineQueryResults) GetClass() string { - return ClassInlineQueryResults -} - -func (*InlineQueryResults) GetType() string { - return TypeInlineQueryResults -} - -func (inlineQueryResults *InlineQueryResults) UnmarshalJSON(data []byte) error { - 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"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - inlineQueryResults.InlineQueryId = tmp.InlineQueryId - inlineQueryResults.NextOffset = tmp.NextOffset - inlineQueryResults.SwitchPmText = tmp.SwitchPmText - inlineQueryResults.SwitchPmParameter = tmp.SwitchPmParameter - - fieldResults, _ := UnmarshalListOfInlineQueryResult(tmp.Results) - inlineQueryResults.Results = fieldResults - - return nil -} - -// The payload for a general callback button -type CallbackQueryPayloadData struct { - meta - // Data that was attached to the callback button - Data []byte `json:"data"` -} - -func (entity *CallbackQueryPayloadData) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub CallbackQueryPayloadData - - return json.Marshal((*stub)(entity)) -} - -func (*CallbackQueryPayloadData) GetClass() string { - return ClassCallbackQueryPayload -} - -func (*CallbackQueryPayloadData) GetType() string { - return TypeCallbackQueryPayloadData -} - -func (*CallbackQueryPayloadData) CallbackQueryPayloadType() string { - return TypeCallbackQueryPayloadData -} - -// The payload for a callback button requiring password -type CallbackQueryPayloadDataWithPassword struct { - meta - // The 2-step verification password for the current user - Password string `json:"password"` - // Data that was attached to the callback button - Data []byte `json:"data"` -} - -func (entity *CallbackQueryPayloadDataWithPassword) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub CallbackQueryPayloadDataWithPassword - - return json.Marshal((*stub)(entity)) -} - -func (*CallbackQueryPayloadDataWithPassword) GetClass() string { - return ClassCallbackQueryPayload -} - -func (*CallbackQueryPayloadDataWithPassword) GetType() string { - return TypeCallbackQueryPayloadDataWithPassword -} - -func (*CallbackQueryPayloadDataWithPassword) CallbackQueryPayloadType() string { - return TypeCallbackQueryPayloadDataWithPassword -} - -// The payload for a game callback button -type CallbackQueryPayloadGame struct { - meta - // A short name of the game that was attached to the callback button - GameShortName string `json:"game_short_name"` -} - -func (entity *CallbackQueryPayloadGame) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub CallbackQueryPayloadGame - - return json.Marshal((*stub)(entity)) -} - -func (*CallbackQueryPayloadGame) GetClass() string { - return ClassCallbackQueryPayload -} - -func (*CallbackQueryPayloadGame) GetType() string { - return TypeCallbackQueryPayloadGame -} - -func (*CallbackQueryPayloadGame) CallbackQueryPayloadType() string { - return TypeCallbackQueryPayloadGame -} - -// Contains a bot's answer to a callback query -type CallbackQueryAnswer struct { - 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"` -} - -func (entity *CallbackQueryAnswer) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub CallbackQueryAnswer - - return json.Marshal((*stub)(entity)) -} - -func (*CallbackQueryAnswer) GetClass() string { - return ClassCallbackQueryAnswer -} - -func (*CallbackQueryAnswer) GetType() string { - return TypeCallbackQueryAnswer -} - -// Contains the result of a custom request -type CustomRequestResult struct { - meta - // A JSON-serialized result - Result string `json:"result"` -} - -func (entity *CustomRequestResult) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub CustomRequestResult - - return json.Marshal((*stub)(entity)) -} - -func (*CustomRequestResult) GetClass() string { - return ClassCustomRequestResult -} - -func (*CustomRequestResult) GetType() string { - return TypeCustomRequestResult -} - -// Contains one row of the game high score table -type GameHighScore struct { - meta - // Position in the high score table - Position int32 `json:"position"` - // User identifier - UserId int64 `json:"user_id"` - // User score - Score int32 `json:"score"` -} - -func (entity *GameHighScore) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub GameHighScore - - return json.Marshal((*stub)(entity)) -} - -func (*GameHighScore) GetClass() string { - return ClassGameHighScore -} - -func (*GameHighScore) GetType() string { - return TypeGameHighScore -} - -// Contains a list of game high scores -type GameHighScores struct { - meta - // A list of game high scores - Scores []*GameHighScore `json:"scores"` -} - -func (entity *GameHighScores) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub GameHighScores - - return json.Marshal((*stub)(entity)) -} - -func (*GameHighScores) GetClass() string { - return ClassGameHighScores -} - -func (*GameHighScores) GetType() string { - return TypeGameHighScores -} - -// A message was edited -type ChatEventMessageEdited struct { - meta - // The original message before the edit - OldMessage *Message `json:"old_message"` - // The message after it was edited - NewMessage *Message `json:"new_message"` -} - -func (entity *ChatEventMessageEdited) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventMessageEdited - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventMessageEdited) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventMessageEdited) GetType() string { - return TypeChatEventMessageEdited -} - -func (*ChatEventMessageEdited) ChatEventActionType() string { - return TypeChatEventMessageEdited -} - -// A message was deleted -type ChatEventMessageDeleted struct { - meta - // Deleted message - Message *Message `json:"message"` - // True, if the message deletion can be reported via reportSupergroupAntiSpamFalsePositive - CanReportAntiSpamFalsePositive bool `json:"can_report_anti_spam_false_positive"` -} - -func (entity *ChatEventMessageDeleted) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventMessageDeleted - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventMessageDeleted) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventMessageDeleted) GetType() string { - return TypeChatEventMessageDeleted -} - -func (*ChatEventMessageDeleted) ChatEventActionType() string { - return TypeChatEventMessageDeleted -} - -// A message was pinned -type ChatEventMessagePinned struct { - meta - // Pinned message - Message *Message `json:"message"` -} - -func (entity *ChatEventMessagePinned) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventMessagePinned - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventMessagePinned) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventMessagePinned) GetType() string { - return TypeChatEventMessagePinned -} - -func (*ChatEventMessagePinned) ChatEventActionType() string { - return TypeChatEventMessagePinned -} - -// A message was unpinned -type ChatEventMessageUnpinned struct { - meta - // Unpinned message - Message *Message `json:"message"` -} - -func (entity *ChatEventMessageUnpinned) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventMessageUnpinned - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventMessageUnpinned) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventMessageUnpinned) GetType() string { - return TypeChatEventMessageUnpinned -} - -func (*ChatEventMessageUnpinned) ChatEventActionType() string { - return TypeChatEventMessageUnpinned -} - -// A poll in a message was stopped -type ChatEventPollStopped struct { - meta - // The message with the poll - Message *Message `json:"message"` -} - -func (entity *ChatEventPollStopped) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventPollStopped - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventPollStopped) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventPollStopped) GetType() string { - return TypeChatEventPollStopped -} - -func (*ChatEventPollStopped) ChatEventActionType() string { - return TypeChatEventPollStopped -} - -// A new member joined the chat -type ChatEventMemberJoined struct { - meta -} - -func (entity *ChatEventMemberJoined) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventMemberJoined - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventMemberJoined) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventMemberJoined) GetType() string { - return TypeChatEventMemberJoined -} - -func (*ChatEventMemberJoined) ChatEventActionType() string { - return TypeChatEventMemberJoined -} - -// A new member joined the chat via an invite link -type ChatEventMemberJoinedByInviteLink struct { - meta - // Invite link used to join the chat - InviteLink *ChatInviteLink `json:"invite_link"` -} - -func (entity *ChatEventMemberJoinedByInviteLink) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventMemberJoinedByInviteLink - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventMemberJoinedByInviteLink) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventMemberJoinedByInviteLink) GetType() string { - return TypeChatEventMemberJoinedByInviteLink -} - -func (*ChatEventMemberJoinedByInviteLink) ChatEventActionType() string { - return TypeChatEventMemberJoinedByInviteLink -} - -// A new member was accepted to the chat by an administrator -type ChatEventMemberJoinedByRequest struct { - 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"` -} - -func (entity *ChatEventMemberJoinedByRequest) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventMemberJoinedByRequest - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventMemberJoinedByRequest) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventMemberJoinedByRequest) GetType() string { - return TypeChatEventMemberJoinedByRequest -} - -func (*ChatEventMemberJoinedByRequest) ChatEventActionType() string { - return TypeChatEventMemberJoinedByRequest -} - -// A new chat member was invited -type ChatEventMemberInvited struct { - meta - // New member user identifier - UserId int64 `json:"user_id"` - // New member status - Status ChatMemberStatus `json:"status"` -} - -func (entity *ChatEventMemberInvited) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventMemberInvited - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventMemberInvited) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventMemberInvited) GetType() string { - return TypeChatEventMemberInvited -} - -func (*ChatEventMemberInvited) ChatEventActionType() string { - return TypeChatEventMemberInvited -} - -func (chatEventMemberInvited *ChatEventMemberInvited) UnmarshalJSON(data []byte) error { - var tmp struct { - UserId int64 `json:"user_id"` - Status json.RawMessage `json:"status"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - chatEventMemberInvited.UserId = tmp.UserId - - fieldStatus, _ := UnmarshalChatMemberStatus(tmp.Status) - chatEventMemberInvited.Status = fieldStatus - - return nil -} - -// A member left the chat -type ChatEventMemberLeft struct { - meta -} - -func (entity *ChatEventMemberLeft) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventMemberLeft - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventMemberLeft) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventMemberLeft) GetType() string { - return TypeChatEventMemberLeft -} - -func (*ChatEventMemberLeft) ChatEventActionType() string { - return TypeChatEventMemberLeft -} - -// A chat member has gained/lost administrator status, or the list of their administrator privileges has changed -type ChatEventMemberPromoted struct { - 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"` -} - -func (entity *ChatEventMemberPromoted) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventMemberPromoted - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventMemberPromoted) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventMemberPromoted) GetType() string { - return TypeChatEventMemberPromoted -} - -func (*ChatEventMemberPromoted) ChatEventActionType() string { - return TypeChatEventMemberPromoted -} - -func (chatEventMemberPromoted *ChatEventMemberPromoted) UnmarshalJSON(data []byte) error { - var tmp struct { - UserId int64 `json:"user_id"` - OldStatus json.RawMessage `json:"old_status"` - NewStatus json.RawMessage `json:"new_status"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - chatEventMemberPromoted.UserId = tmp.UserId - - fieldOldStatus, _ := UnmarshalChatMemberStatus(tmp.OldStatus) - chatEventMemberPromoted.OldStatus = fieldOldStatus - - fieldNewStatus, _ := UnmarshalChatMemberStatus(tmp.NewStatus) - chatEventMemberPromoted.NewStatus = fieldNewStatus - - return nil -} - -// A chat member was restricted/unrestricted or banned/unbanned, or the list of their restrictions has changed -type ChatEventMemberRestricted struct { - 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"` -} - -func (entity *ChatEventMemberRestricted) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventMemberRestricted - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventMemberRestricted) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventMemberRestricted) GetType() string { - return TypeChatEventMemberRestricted -} - -func (*ChatEventMemberRestricted) ChatEventActionType() string { - return TypeChatEventMemberRestricted -} - -func (chatEventMemberRestricted *ChatEventMemberRestricted) UnmarshalJSON(data []byte) error { - var tmp struct { - MemberId json.RawMessage `json:"member_id"` - OldStatus json.RawMessage `json:"old_status"` - NewStatus json.RawMessage `json:"new_status"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - fieldMemberId, _ := UnmarshalMessageSender(tmp.MemberId) - chatEventMemberRestricted.MemberId = fieldMemberId - - fieldOldStatus, _ := UnmarshalChatMemberStatus(tmp.OldStatus) - chatEventMemberRestricted.OldStatus = fieldOldStatus - - fieldNewStatus, _ := UnmarshalChatMemberStatus(tmp.NewStatus) - chatEventMemberRestricted.NewStatus = fieldNewStatus - - return nil -} - -// The chat available reactions were changed -type ChatEventAvailableReactionsChanged struct { - meta - // Previous chat available reactions - OldAvailableReactions ChatAvailableReactions `json:"old_available_reactions"` - // New chat available reactions - NewAvailableReactions ChatAvailableReactions `json:"new_available_reactions"` -} - -func (entity *ChatEventAvailableReactionsChanged) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventAvailableReactionsChanged - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventAvailableReactionsChanged) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventAvailableReactionsChanged) GetType() string { - return TypeChatEventAvailableReactionsChanged -} - -func (*ChatEventAvailableReactionsChanged) ChatEventActionType() string { - return TypeChatEventAvailableReactionsChanged -} - -func (chatEventAvailableReactionsChanged *ChatEventAvailableReactionsChanged) UnmarshalJSON(data []byte) error { - var tmp struct { - OldAvailableReactions json.RawMessage `json:"old_available_reactions"` - NewAvailableReactions json.RawMessage `json:"new_available_reactions"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - fieldOldAvailableReactions, _ := UnmarshalChatAvailableReactions(tmp.OldAvailableReactions) - chatEventAvailableReactionsChanged.OldAvailableReactions = fieldOldAvailableReactions - - fieldNewAvailableReactions, _ := UnmarshalChatAvailableReactions(tmp.NewAvailableReactions) - chatEventAvailableReactionsChanged.NewAvailableReactions = fieldNewAvailableReactions - - return nil -} - -// The chat description was changed -type ChatEventDescriptionChanged struct { - meta - // Previous chat description - OldDescription string `json:"old_description"` - // New chat description - NewDescription string `json:"new_description"` -} - -func (entity *ChatEventDescriptionChanged) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventDescriptionChanged - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventDescriptionChanged) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventDescriptionChanged) GetType() string { - return TypeChatEventDescriptionChanged -} - -func (*ChatEventDescriptionChanged) ChatEventActionType() string { - return TypeChatEventDescriptionChanged -} - -// The linked chat of a supergroup was changed -type ChatEventLinkedChatChanged struct { - 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"` -} - -func (entity *ChatEventLinkedChatChanged) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventLinkedChatChanged - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventLinkedChatChanged) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventLinkedChatChanged) GetType() string { - return TypeChatEventLinkedChatChanged -} - -func (*ChatEventLinkedChatChanged) ChatEventActionType() string { - return TypeChatEventLinkedChatChanged -} - -// The supergroup location was changed -type ChatEventLocationChanged struct { - meta - // Previous location; may be null - OldLocation *ChatLocation `json:"old_location"` - // New location; may be null - NewLocation *ChatLocation `json:"new_location"` -} - -func (entity *ChatEventLocationChanged) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventLocationChanged - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventLocationChanged) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventLocationChanged) GetType() string { - return TypeChatEventLocationChanged -} - -func (*ChatEventLocationChanged) ChatEventActionType() string { - return TypeChatEventLocationChanged -} - -// The message auto-delete timer was changed -type ChatEventMessageAutoDeleteTimeChanged struct { - meta - // Previous value of message_auto_delete_time - OldMessageAutoDeleteTime int32 `json:"old_message_auto_delete_time"` - // New value of message_auto_delete_time - NewMessageAutoDeleteTime int32 `json:"new_message_auto_delete_time"` -} - -func (entity *ChatEventMessageAutoDeleteTimeChanged) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventMessageAutoDeleteTimeChanged - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventMessageAutoDeleteTimeChanged) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventMessageAutoDeleteTimeChanged) GetType() string { - return TypeChatEventMessageAutoDeleteTimeChanged -} - -func (*ChatEventMessageAutoDeleteTimeChanged) ChatEventActionType() string { - return TypeChatEventMessageAutoDeleteTimeChanged -} - -// The chat permissions was changed -type ChatEventPermissionsChanged struct { - meta - // Previous chat permissions - OldPermissions *ChatPermissions `json:"old_permissions"` - // New chat permissions - NewPermissions *ChatPermissions `json:"new_permissions"` -} - -func (entity *ChatEventPermissionsChanged) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventPermissionsChanged - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventPermissionsChanged) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventPermissionsChanged) GetType() string { - return TypeChatEventPermissionsChanged -} - -func (*ChatEventPermissionsChanged) ChatEventActionType() string { - return TypeChatEventPermissionsChanged -} - -// The chat photo was changed -type ChatEventPhotoChanged struct { - 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"` -} - -func (entity *ChatEventPhotoChanged) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventPhotoChanged - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventPhotoChanged) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventPhotoChanged) GetType() string { - return TypeChatEventPhotoChanged -} - -func (*ChatEventPhotoChanged) ChatEventActionType() string { - return TypeChatEventPhotoChanged -} - -// The slow_mode_delay setting of a supergroup was changed -type ChatEventSlowModeDelayChanged struct { - 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"` -} - -func (entity *ChatEventSlowModeDelayChanged) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventSlowModeDelayChanged - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventSlowModeDelayChanged) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventSlowModeDelayChanged) GetType() string { - return TypeChatEventSlowModeDelayChanged -} - -func (*ChatEventSlowModeDelayChanged) ChatEventActionType() string { - return TypeChatEventSlowModeDelayChanged -} - -// The supergroup sticker set was changed -type ChatEventStickerSetChanged struct { - 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"` -} - -func (entity *ChatEventStickerSetChanged) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventStickerSetChanged - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventStickerSetChanged) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventStickerSetChanged) GetType() string { - return TypeChatEventStickerSetChanged -} - -func (*ChatEventStickerSetChanged) ChatEventActionType() string { - return TypeChatEventStickerSetChanged -} - -// The chat title was changed -type ChatEventTitleChanged struct { - meta - // Previous chat title - OldTitle string `json:"old_title"` - // New chat title - NewTitle string `json:"new_title"` -} - -func (entity *ChatEventTitleChanged) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventTitleChanged - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventTitleChanged) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventTitleChanged) GetType() string { - return TypeChatEventTitleChanged -} - -func (*ChatEventTitleChanged) ChatEventActionType() string { - return TypeChatEventTitleChanged -} - -// The chat editable username was changed -type ChatEventUsernameChanged struct { - meta - // Previous chat username - OldUsername string `json:"old_username"` - // New chat username - NewUsername string `json:"new_username"` -} - -func (entity *ChatEventUsernameChanged) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventUsernameChanged - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventUsernameChanged) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventUsernameChanged) GetType() string { - return TypeChatEventUsernameChanged -} - -func (*ChatEventUsernameChanged) ChatEventActionType() string { - return TypeChatEventUsernameChanged -} - -// The chat active usernames were changed -type ChatEventActiveUsernamesChanged struct { - meta - // Previous list of active usernames - OldUsernames []string `json:"old_usernames"` - // New list of active usernames - NewUsernames []string `json:"new_usernames"` -} - -func (entity *ChatEventActiveUsernamesChanged) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventActiveUsernamesChanged - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventActiveUsernamesChanged) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventActiveUsernamesChanged) GetType() string { - return TypeChatEventActiveUsernamesChanged -} - -func (*ChatEventActiveUsernamesChanged) ChatEventActionType() string { - return TypeChatEventActiveUsernamesChanged -} - -// The has_protected_content setting of a channel was toggled -type ChatEventHasProtectedContentToggled struct { - meta - // New value of has_protected_content - HasProtectedContent bool `json:"has_protected_content"` -} - -func (entity *ChatEventHasProtectedContentToggled) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventHasProtectedContentToggled - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventHasProtectedContentToggled) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventHasProtectedContentToggled) GetType() string { - return TypeChatEventHasProtectedContentToggled -} - -func (*ChatEventHasProtectedContentToggled) ChatEventActionType() string { - return TypeChatEventHasProtectedContentToggled -} - -// The can_invite_users permission of a supergroup chat was toggled -type ChatEventInvitesToggled struct { - meta - // New value of can_invite_users permission - CanInviteUsers bool `json:"can_invite_users"` -} - -func (entity *ChatEventInvitesToggled) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventInvitesToggled - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventInvitesToggled) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventInvitesToggled) GetType() string { - return TypeChatEventInvitesToggled -} - -func (*ChatEventInvitesToggled) ChatEventActionType() string { - return TypeChatEventInvitesToggled -} - -// The is_all_history_available setting of a supergroup was toggled -type ChatEventIsAllHistoryAvailableToggled struct { - meta - // New value of is_all_history_available - IsAllHistoryAvailable bool `json:"is_all_history_available"` -} - -func (entity *ChatEventIsAllHistoryAvailableToggled) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventIsAllHistoryAvailableToggled - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventIsAllHistoryAvailableToggled) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventIsAllHistoryAvailableToggled) GetType() string { - return TypeChatEventIsAllHistoryAvailableToggled -} - -func (*ChatEventIsAllHistoryAvailableToggled) ChatEventActionType() string { - return TypeChatEventIsAllHistoryAvailableToggled -} - -// The has_aggressive_anti_spam_enabled setting of a supergroup was toggled -type ChatEventHasAggressiveAntiSpamEnabledToggled struct { - meta - // New value of has_aggressive_anti_spam_enabled - HasAggressiveAntiSpamEnabled bool `json:"has_aggressive_anti_spam_enabled"` -} - -func (entity *ChatEventHasAggressiveAntiSpamEnabledToggled) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventHasAggressiveAntiSpamEnabledToggled - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventHasAggressiveAntiSpamEnabledToggled) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventHasAggressiveAntiSpamEnabledToggled) GetType() string { - return TypeChatEventHasAggressiveAntiSpamEnabledToggled -} - -func (*ChatEventHasAggressiveAntiSpamEnabledToggled) ChatEventActionType() string { - return TypeChatEventHasAggressiveAntiSpamEnabledToggled -} - -// The sign_messages setting of a channel was toggled -type ChatEventSignMessagesToggled struct { - meta - // New value of sign_messages - SignMessages bool `json:"sign_messages"` -} - -func (entity *ChatEventSignMessagesToggled) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventSignMessagesToggled - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventSignMessagesToggled) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventSignMessagesToggled) GetType() string { - return TypeChatEventSignMessagesToggled -} - -func (*ChatEventSignMessagesToggled) ChatEventActionType() string { - return TypeChatEventSignMessagesToggled -} - -// A chat invite link was edited -type ChatEventInviteLinkEdited struct { - 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"` -} - -func (entity *ChatEventInviteLinkEdited) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventInviteLinkEdited - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventInviteLinkEdited) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventInviteLinkEdited) GetType() string { - return TypeChatEventInviteLinkEdited -} - -func (*ChatEventInviteLinkEdited) ChatEventActionType() string { - return TypeChatEventInviteLinkEdited -} - -// A chat invite link was revoked -type ChatEventInviteLinkRevoked struct { - meta - // The invite link - InviteLink *ChatInviteLink `json:"invite_link"` -} - -func (entity *ChatEventInviteLinkRevoked) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventInviteLinkRevoked - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventInviteLinkRevoked) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventInviteLinkRevoked) GetType() string { - return TypeChatEventInviteLinkRevoked -} - -func (*ChatEventInviteLinkRevoked) ChatEventActionType() string { - return TypeChatEventInviteLinkRevoked -} - -// A revoked chat invite link was deleted -type ChatEventInviteLinkDeleted struct { - meta - // The invite link - InviteLink *ChatInviteLink `json:"invite_link"` -} - -func (entity *ChatEventInviteLinkDeleted) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventInviteLinkDeleted - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventInviteLinkDeleted) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventInviteLinkDeleted) GetType() string { - return TypeChatEventInviteLinkDeleted -} - -func (*ChatEventInviteLinkDeleted) ChatEventActionType() string { - return TypeChatEventInviteLinkDeleted -} - -// A video chat was created -type ChatEventVideoChatCreated struct { - meta - // Identifier of the video chat. The video chat can be received through the method getGroupCall - GroupCallId int32 `json:"group_call_id"` -} - -func (entity *ChatEventVideoChatCreated) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventVideoChatCreated - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventVideoChatCreated) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventVideoChatCreated) GetType() string { - return TypeChatEventVideoChatCreated -} - -func (*ChatEventVideoChatCreated) ChatEventActionType() string { - return TypeChatEventVideoChatCreated -} - -// A video chat was ended -type ChatEventVideoChatEnded struct { - meta - // Identifier of the video chat. The video chat can be received through the method getGroupCall - GroupCallId int32 `json:"group_call_id"` -} - -func (entity *ChatEventVideoChatEnded) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventVideoChatEnded - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventVideoChatEnded) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventVideoChatEnded) GetType() string { - return TypeChatEventVideoChatEnded -} - -func (*ChatEventVideoChatEnded) ChatEventActionType() string { - return TypeChatEventVideoChatEnded -} - -// The mute_new_participants setting of a video chat was toggled -type ChatEventVideoChatMuteNewParticipantsToggled struct { - meta - // New value of the mute_new_participants setting - MuteNewParticipants bool `json:"mute_new_participants"` -} - -func (entity *ChatEventVideoChatMuteNewParticipantsToggled) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventVideoChatMuteNewParticipantsToggled - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventVideoChatMuteNewParticipantsToggled) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventVideoChatMuteNewParticipantsToggled) GetType() string { - return TypeChatEventVideoChatMuteNewParticipantsToggled -} - -func (*ChatEventVideoChatMuteNewParticipantsToggled) ChatEventActionType() string { - return TypeChatEventVideoChatMuteNewParticipantsToggled -} - -// A video chat participant was muted or unmuted -type ChatEventVideoChatParticipantIsMutedToggled struct { - meta - // Identifier of the affected group call participant - ParticipantId MessageSender `json:"participant_id"` - // New value of is_muted - IsMuted bool `json:"is_muted"` -} - -func (entity *ChatEventVideoChatParticipantIsMutedToggled) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventVideoChatParticipantIsMutedToggled - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventVideoChatParticipantIsMutedToggled) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventVideoChatParticipantIsMutedToggled) GetType() string { - return TypeChatEventVideoChatParticipantIsMutedToggled -} - -func (*ChatEventVideoChatParticipantIsMutedToggled) ChatEventActionType() string { - return TypeChatEventVideoChatParticipantIsMutedToggled -} - -func (chatEventVideoChatParticipantIsMutedToggled *ChatEventVideoChatParticipantIsMutedToggled) UnmarshalJSON(data []byte) error { - var tmp struct { - ParticipantId json.RawMessage `json:"participant_id"` - IsMuted bool `json:"is_muted"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - chatEventVideoChatParticipantIsMutedToggled.IsMuted = tmp.IsMuted - - fieldParticipantId, _ := UnmarshalMessageSender(tmp.ParticipantId) - chatEventVideoChatParticipantIsMutedToggled.ParticipantId = fieldParticipantId - - return nil -} - -// A video chat participant volume level was changed -type ChatEventVideoChatParticipantVolumeLevelChanged struct { - 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"` -} - -func (entity *ChatEventVideoChatParticipantVolumeLevelChanged) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventVideoChatParticipantVolumeLevelChanged - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventVideoChatParticipantVolumeLevelChanged) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventVideoChatParticipantVolumeLevelChanged) GetType() string { - return TypeChatEventVideoChatParticipantVolumeLevelChanged -} - -func (*ChatEventVideoChatParticipantVolumeLevelChanged) ChatEventActionType() string { - return TypeChatEventVideoChatParticipantVolumeLevelChanged -} - -func (chatEventVideoChatParticipantVolumeLevelChanged *ChatEventVideoChatParticipantVolumeLevelChanged) UnmarshalJSON(data []byte) error { - var tmp struct { - ParticipantId json.RawMessage `json:"participant_id"` - VolumeLevel int32 `json:"volume_level"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - chatEventVideoChatParticipantVolumeLevelChanged.VolumeLevel = tmp.VolumeLevel - - fieldParticipantId, _ := UnmarshalMessageSender(tmp.ParticipantId) - chatEventVideoChatParticipantVolumeLevelChanged.ParticipantId = fieldParticipantId - - return nil -} - -// The is_forum setting of a channel was toggled -type ChatEventIsForumToggled struct { - meta - // New value of is_forum - IsForum bool `json:"is_forum"` -} - -func (entity *ChatEventIsForumToggled) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventIsForumToggled - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventIsForumToggled) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventIsForumToggled) GetType() string { - return TypeChatEventIsForumToggled -} - -func (*ChatEventIsForumToggled) ChatEventActionType() string { - return TypeChatEventIsForumToggled -} - -// A new forum topic was created -type ChatEventForumTopicCreated struct { - meta - // Information about the topic - TopicInfo *ForumTopicInfo `json:"topic_info"` -} - -func (entity *ChatEventForumTopicCreated) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventForumTopicCreated - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventForumTopicCreated) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventForumTopicCreated) GetType() string { - return TypeChatEventForumTopicCreated -} - -func (*ChatEventForumTopicCreated) ChatEventActionType() string { - return TypeChatEventForumTopicCreated -} - -// A forum topic was edited -type ChatEventForumTopicEdited struct { - meta - // Old information about the topic - OldTopicInfo *ForumTopicInfo `json:"old_topic_info"` - // New information about the topic - NewTopicInfo *ForumTopicInfo `json:"new_topic_info"` -} - -func (entity *ChatEventForumTopicEdited) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventForumTopicEdited - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventForumTopicEdited) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventForumTopicEdited) GetType() string { - return TypeChatEventForumTopicEdited -} - -func (*ChatEventForumTopicEdited) ChatEventActionType() string { - return TypeChatEventForumTopicEdited -} - -// A forum topic was closed or reopened -type ChatEventForumTopicToggleIsClosed struct { - meta - // New information about the topic - TopicInfo *ForumTopicInfo `json:"topic_info"` -} - -func (entity *ChatEventForumTopicToggleIsClosed) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventForumTopicToggleIsClosed - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventForumTopicToggleIsClosed) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventForumTopicToggleIsClosed) GetType() string { - return TypeChatEventForumTopicToggleIsClosed -} - -func (*ChatEventForumTopicToggleIsClosed) ChatEventActionType() string { - return TypeChatEventForumTopicToggleIsClosed -} - -// The General forum topic was hidden or unhidden -type ChatEventForumTopicToggleIsHidden struct { - meta - // New information about the topic - TopicInfo *ForumTopicInfo `json:"topic_info"` -} - -func (entity *ChatEventForumTopicToggleIsHidden) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventForumTopicToggleIsHidden - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventForumTopicToggleIsHidden) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventForumTopicToggleIsHidden) GetType() string { - return TypeChatEventForumTopicToggleIsHidden -} - -func (*ChatEventForumTopicToggleIsHidden) ChatEventActionType() string { - return TypeChatEventForumTopicToggleIsHidden -} - -// A forum topic was deleted -type ChatEventForumTopicDeleted struct { - meta - // Information about the topic - TopicInfo *ForumTopicInfo `json:"topic_info"` -} - -func (entity *ChatEventForumTopicDeleted) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventForumTopicDeleted - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventForumTopicDeleted) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventForumTopicDeleted) GetType() string { - return TypeChatEventForumTopicDeleted -} - -func (*ChatEventForumTopicDeleted) ChatEventActionType() string { - return TypeChatEventForumTopicDeleted -} - -// A pinned forum topic was changed -type ChatEventForumTopicPinned struct { - meta - // Information about the old pinned topic; may be null - OldTopicInfo *ForumTopicInfo `json:"old_topic_info"` - // Information about the new pinned topic; may be null - NewTopicInfo *ForumTopicInfo `json:"new_topic_info"` -} - -func (entity *ChatEventForumTopicPinned) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventForumTopicPinned - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventForumTopicPinned) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventForumTopicPinned) GetType() string { - return TypeChatEventForumTopicPinned -} - -func (*ChatEventForumTopicPinned) ChatEventActionType() string { - return TypeChatEventForumTopicPinned -} - -// Represents a chat event -type ChatEvent struct { - 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"` -} - -func (entity *ChatEvent) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEvent - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEvent) GetClass() string { - return ClassChatEvent -} - -func (*ChatEvent) GetType() string { - return TypeChatEvent -} - -func (chatEvent *ChatEvent) UnmarshalJSON(data []byte) error { - var tmp struct { - Id JsonInt64 `json:"id"` - Date int32 `json:"date"` - MemberId json.RawMessage `json:"member_id"` - Action json.RawMessage `json:"action"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - chatEvent.Id = tmp.Id - chatEvent.Date = tmp.Date - - fieldMemberId, _ := UnmarshalMessageSender(tmp.MemberId) - chatEvent.MemberId = fieldMemberId - - fieldAction, _ := UnmarshalChatEventAction(tmp.Action) - chatEvent.Action = fieldAction - - return nil -} - -// Contains a list of chat events -type ChatEvents struct { - meta - // List of events - Events []*ChatEvent `json:"events"` -} - -func (entity *ChatEvents) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEvents - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEvents) GetClass() string { - return ClassChatEvents -} - -func (*ChatEvents) GetType() string { - return TypeChatEvents -} - -// Represents a set of filters used to obtain a chat event log -type ChatEventLogFilters struct { - 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"` - // True, if forum-related actions need to be returned - ForumChanges bool `json:"forum_changes"` -} - -func (entity *ChatEventLogFilters) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventLogFilters - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventLogFilters) GetClass() string { - return ClassChatEventLogFilters -} - -func (*ChatEventLogFilters) GetType() string { - return TypeChatEventLogFilters -} - -// An ordinary language pack string -type LanguagePackStringValueOrdinary struct { - meta - // String value - Value string `json:"value"` -} - -func (entity *LanguagePackStringValueOrdinary) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub LanguagePackStringValueOrdinary - - return json.Marshal((*stub)(entity)) -} - -func (*LanguagePackStringValueOrdinary) GetClass() string { - return ClassLanguagePackStringValue -} - -func (*LanguagePackStringValueOrdinary) GetType() string { - return TypeLanguagePackStringValueOrdinary -} - -func (*LanguagePackStringValueOrdinary) LanguagePackStringValueType() string { - return TypeLanguagePackStringValueOrdinary -} - -// 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 -type LanguagePackStringValuePluralized struct { - 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"` -} - -func (entity *LanguagePackStringValuePluralized) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub LanguagePackStringValuePluralized - - return json.Marshal((*stub)(entity)) -} - -func (*LanguagePackStringValuePluralized) GetClass() string { - return ClassLanguagePackStringValue -} - -func (*LanguagePackStringValuePluralized) GetType() string { - return TypeLanguagePackStringValuePluralized -} - -func (*LanguagePackStringValuePluralized) LanguagePackStringValueType() string { - return TypeLanguagePackStringValuePluralized -} - -// A deleted language pack string, the value must be taken from the built-in English language pack -type LanguagePackStringValueDeleted struct { - meta -} - -func (entity *LanguagePackStringValueDeleted) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub LanguagePackStringValueDeleted - - return json.Marshal((*stub)(entity)) -} - -func (*LanguagePackStringValueDeleted) GetClass() string { - return ClassLanguagePackStringValue -} - -func (*LanguagePackStringValueDeleted) GetType() string { - return TypeLanguagePackStringValueDeleted -} - -func (*LanguagePackStringValueDeleted) LanguagePackStringValueType() string { - return TypeLanguagePackStringValueDeleted -} - -// Represents one language pack string -type LanguagePackString struct { - 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"` -} - -func (entity *LanguagePackString) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub LanguagePackString - - return json.Marshal((*stub)(entity)) -} - -func (*LanguagePackString) GetClass() string { - return ClassLanguagePackString -} - -func (*LanguagePackString) GetType() string { - return TypeLanguagePackString -} - -func (languagePackString *LanguagePackString) UnmarshalJSON(data []byte) error { - var tmp struct { - Key string `json:"key"` - Value json.RawMessage `json:"value"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - languagePackString.Key = tmp.Key - - fieldValue, _ := UnmarshalLanguagePackStringValue(tmp.Value) - languagePackString.Value = fieldValue - - return nil -} - -// Contains a list of language pack strings -type LanguagePackStrings struct { - meta - // A list of language pack strings - Strings []*LanguagePackString `json:"strings"` -} - -func (entity *LanguagePackStrings) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub LanguagePackStrings - - return json.Marshal((*stub)(entity)) -} - -func (*LanguagePackStrings) GetClass() string { - return ClassLanguagePackStrings -} - -func (*LanguagePackStrings) GetType() string { - return TypeLanguagePackStrings -} - -// Contains information about a language pack -type LanguagePackInfo struct { - 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"` -} - -func (entity *LanguagePackInfo) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub LanguagePackInfo - - return json.Marshal((*stub)(entity)) -} - -func (*LanguagePackInfo) GetClass() string { - return ClassLanguagePackInfo -} - -func (*LanguagePackInfo) GetType() string { - return TypeLanguagePackInfo -} - -// Contains information about the current localization target -type LocalizationTargetInfo struct { - meta - // List of available language packs for this application - LanguagePacks []*LanguagePackInfo `json:"language_packs"` -} - -func (entity *LocalizationTargetInfo) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub LocalizationTargetInfo - - return json.Marshal((*stub)(entity)) -} - -func (*LocalizationTargetInfo) GetClass() string { - return ClassLocalizationTargetInfo -} - -func (*LocalizationTargetInfo) GetType() string { - return TypeLocalizationTargetInfo -} - -// The maximum number of joined supergroups and channels -type PremiumLimitTypeSupergroupCount struct { - meta -} - -func (entity *PremiumLimitTypeSupergroupCount) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PremiumLimitTypeSupergroupCount - - return json.Marshal((*stub)(entity)) -} - -func (*PremiumLimitTypeSupergroupCount) GetClass() string { - return ClassPremiumLimitType -} - -func (*PremiumLimitTypeSupergroupCount) GetType() string { - return TypePremiumLimitTypeSupergroupCount -} - -func (*PremiumLimitTypeSupergroupCount) PremiumLimitTypeType() string { - return TypePremiumLimitTypeSupergroupCount -} - -// The maximum number of pinned chats in the main chat list -type PremiumLimitTypePinnedChatCount struct { - meta -} - -func (entity *PremiumLimitTypePinnedChatCount) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PremiumLimitTypePinnedChatCount - - return json.Marshal((*stub)(entity)) -} - -func (*PremiumLimitTypePinnedChatCount) GetClass() string { - return ClassPremiumLimitType -} - -func (*PremiumLimitTypePinnedChatCount) GetType() string { - return TypePremiumLimitTypePinnedChatCount -} - -func (*PremiumLimitTypePinnedChatCount) PremiumLimitTypeType() string { - return TypePremiumLimitTypePinnedChatCount -} - -// The maximum number of created public chats -type PremiumLimitTypeCreatedPublicChatCount struct { - meta -} - -func (entity *PremiumLimitTypeCreatedPublicChatCount) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PremiumLimitTypeCreatedPublicChatCount - - return json.Marshal((*stub)(entity)) -} - -func (*PremiumLimitTypeCreatedPublicChatCount) GetClass() string { - return ClassPremiumLimitType -} - -func (*PremiumLimitTypeCreatedPublicChatCount) GetType() string { - return TypePremiumLimitTypeCreatedPublicChatCount -} - -func (*PremiumLimitTypeCreatedPublicChatCount) PremiumLimitTypeType() string { - return TypePremiumLimitTypeCreatedPublicChatCount -} - -// The maximum number of saved animations -type PremiumLimitTypeSavedAnimationCount struct { - meta -} - -func (entity *PremiumLimitTypeSavedAnimationCount) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PremiumLimitTypeSavedAnimationCount - - return json.Marshal((*stub)(entity)) -} - -func (*PremiumLimitTypeSavedAnimationCount) GetClass() string { - return ClassPremiumLimitType -} - -func (*PremiumLimitTypeSavedAnimationCount) GetType() string { - return TypePremiumLimitTypeSavedAnimationCount -} - -func (*PremiumLimitTypeSavedAnimationCount) PremiumLimitTypeType() string { - return TypePremiumLimitTypeSavedAnimationCount -} - -// The maximum number of favorite stickers -type PremiumLimitTypeFavoriteStickerCount struct { - meta -} - -func (entity *PremiumLimitTypeFavoriteStickerCount) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PremiumLimitTypeFavoriteStickerCount - - return json.Marshal((*stub)(entity)) -} - -func (*PremiumLimitTypeFavoriteStickerCount) GetClass() string { - return ClassPremiumLimitType -} - -func (*PremiumLimitTypeFavoriteStickerCount) GetType() string { - return TypePremiumLimitTypeFavoriteStickerCount -} - -func (*PremiumLimitTypeFavoriteStickerCount) PremiumLimitTypeType() string { - return TypePremiumLimitTypeFavoriteStickerCount -} - -// The maximum number of chat filters -type PremiumLimitTypeChatFilterCount struct { - meta -} - -func (entity *PremiumLimitTypeChatFilterCount) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PremiumLimitTypeChatFilterCount - - return json.Marshal((*stub)(entity)) -} - -func (*PremiumLimitTypeChatFilterCount) GetClass() string { - return ClassPremiumLimitType -} - -func (*PremiumLimitTypeChatFilterCount) GetType() string { - return TypePremiumLimitTypeChatFilterCount -} - -func (*PremiumLimitTypeChatFilterCount) PremiumLimitTypeType() string { - return TypePremiumLimitTypeChatFilterCount -} - -// The maximum number of pinned and always included, or always excluded chats in a chat filter -type PremiumLimitTypeChatFilterChosenChatCount struct { - meta -} - -func (entity *PremiumLimitTypeChatFilterChosenChatCount) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PremiumLimitTypeChatFilterChosenChatCount - - return json.Marshal((*stub)(entity)) -} - -func (*PremiumLimitTypeChatFilterChosenChatCount) GetClass() string { - return ClassPremiumLimitType -} - -func (*PremiumLimitTypeChatFilterChosenChatCount) GetType() string { - return TypePremiumLimitTypeChatFilterChosenChatCount -} - -func (*PremiumLimitTypeChatFilterChosenChatCount) PremiumLimitTypeType() string { - return TypePremiumLimitTypeChatFilterChosenChatCount -} - -// The maximum number of pinned chats in the archive chat list -type PremiumLimitTypePinnedArchivedChatCount struct { - meta -} - -func (entity *PremiumLimitTypePinnedArchivedChatCount) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PremiumLimitTypePinnedArchivedChatCount - - return json.Marshal((*stub)(entity)) -} - -func (*PremiumLimitTypePinnedArchivedChatCount) GetClass() string { - return ClassPremiumLimitType -} - -func (*PremiumLimitTypePinnedArchivedChatCount) GetType() string { - return TypePremiumLimitTypePinnedArchivedChatCount -} - -func (*PremiumLimitTypePinnedArchivedChatCount) PremiumLimitTypeType() string { - return TypePremiumLimitTypePinnedArchivedChatCount -} - -// The maximum length of sent media caption -type PremiumLimitTypeCaptionLength struct { - meta -} - -func (entity *PremiumLimitTypeCaptionLength) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PremiumLimitTypeCaptionLength - - return json.Marshal((*stub)(entity)) -} - -func (*PremiumLimitTypeCaptionLength) GetClass() string { - return ClassPremiumLimitType -} - -func (*PremiumLimitTypeCaptionLength) GetType() string { - return TypePremiumLimitTypeCaptionLength -} - -func (*PremiumLimitTypeCaptionLength) PremiumLimitTypeType() string { - return TypePremiumLimitTypeCaptionLength -} - -// The maximum length of the user's bio -type PremiumLimitTypeBioLength struct { - meta -} - -func (entity *PremiumLimitTypeBioLength) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PremiumLimitTypeBioLength - - return json.Marshal((*stub)(entity)) -} - -func (*PremiumLimitTypeBioLength) GetClass() string { - return ClassPremiumLimitType -} - -func (*PremiumLimitTypeBioLength) GetType() string { - return TypePremiumLimitTypeBioLength -} - -func (*PremiumLimitTypeBioLength) PremiumLimitTypeType() string { - return TypePremiumLimitTypeBioLength -} - -// Increased limits -type PremiumFeatureIncreasedLimits struct { - meta -} - -func (entity *PremiumFeatureIncreasedLimits) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PremiumFeatureIncreasedLimits - - return json.Marshal((*stub)(entity)) -} - -func (*PremiumFeatureIncreasedLimits) GetClass() string { - return ClassPremiumFeature -} - -func (*PremiumFeatureIncreasedLimits) GetType() string { - return TypePremiumFeatureIncreasedLimits -} - -func (*PremiumFeatureIncreasedLimits) PremiumFeatureType() string { - return TypePremiumFeatureIncreasedLimits -} - -// Increased maximum upload file size -type PremiumFeatureIncreasedUploadFileSize struct { - meta -} - -func (entity *PremiumFeatureIncreasedUploadFileSize) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PremiumFeatureIncreasedUploadFileSize - - return json.Marshal((*stub)(entity)) -} - -func (*PremiumFeatureIncreasedUploadFileSize) GetClass() string { - return ClassPremiumFeature -} - -func (*PremiumFeatureIncreasedUploadFileSize) GetType() string { - return TypePremiumFeatureIncreasedUploadFileSize -} - -func (*PremiumFeatureIncreasedUploadFileSize) PremiumFeatureType() string { - return TypePremiumFeatureIncreasedUploadFileSize -} - -// Improved download speed -type PremiumFeatureImprovedDownloadSpeed struct { - meta -} - -func (entity *PremiumFeatureImprovedDownloadSpeed) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PremiumFeatureImprovedDownloadSpeed - - return json.Marshal((*stub)(entity)) -} - -func (*PremiumFeatureImprovedDownloadSpeed) GetClass() string { - return ClassPremiumFeature -} - -func (*PremiumFeatureImprovedDownloadSpeed) GetType() string { - return TypePremiumFeatureImprovedDownloadSpeed -} - -func (*PremiumFeatureImprovedDownloadSpeed) PremiumFeatureType() string { - return TypePremiumFeatureImprovedDownloadSpeed -} - -// The ability to convert voice notes to text -type PremiumFeatureVoiceRecognition struct { - meta -} - -func (entity *PremiumFeatureVoiceRecognition) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PremiumFeatureVoiceRecognition - - return json.Marshal((*stub)(entity)) -} - -func (*PremiumFeatureVoiceRecognition) GetClass() string { - return ClassPremiumFeature -} - -func (*PremiumFeatureVoiceRecognition) GetType() string { - return TypePremiumFeatureVoiceRecognition -} - -func (*PremiumFeatureVoiceRecognition) PremiumFeatureType() string { - return TypePremiumFeatureVoiceRecognition -} - -// Disabled ads -type PremiumFeatureDisabledAds struct { - meta -} - -func (entity *PremiumFeatureDisabledAds) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PremiumFeatureDisabledAds - - return json.Marshal((*stub)(entity)) -} - -func (*PremiumFeatureDisabledAds) GetClass() string { - return ClassPremiumFeature -} - -func (*PremiumFeatureDisabledAds) GetType() string { - return TypePremiumFeatureDisabledAds -} - -func (*PremiumFeatureDisabledAds) PremiumFeatureType() string { - return TypePremiumFeatureDisabledAds -} - -// Allowed to use more reactions -type PremiumFeatureUniqueReactions struct { - meta -} - -func (entity *PremiumFeatureUniqueReactions) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PremiumFeatureUniqueReactions - - return json.Marshal((*stub)(entity)) -} - -func (*PremiumFeatureUniqueReactions) GetClass() string { - return ClassPremiumFeature -} - -func (*PremiumFeatureUniqueReactions) GetType() string { - return TypePremiumFeatureUniqueReactions -} - -func (*PremiumFeatureUniqueReactions) PremiumFeatureType() string { - return TypePremiumFeatureUniqueReactions -} - -// Allowed to use premium stickers with unique effects -type PremiumFeatureUniqueStickers struct { - meta -} - -func (entity *PremiumFeatureUniqueStickers) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PremiumFeatureUniqueStickers - - return json.Marshal((*stub)(entity)) -} - -func (*PremiumFeatureUniqueStickers) GetClass() string { - return ClassPremiumFeature -} - -func (*PremiumFeatureUniqueStickers) GetType() string { - return TypePremiumFeatureUniqueStickers -} - -func (*PremiumFeatureUniqueStickers) PremiumFeatureType() string { - return TypePremiumFeatureUniqueStickers -} - -// Allowed to use custom emoji stickers in message texts and captions -type PremiumFeatureCustomEmoji struct { - meta -} - -func (entity *PremiumFeatureCustomEmoji) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PremiumFeatureCustomEmoji - - return json.Marshal((*stub)(entity)) -} - -func (*PremiumFeatureCustomEmoji) GetClass() string { - return ClassPremiumFeature -} - -func (*PremiumFeatureCustomEmoji) GetType() string { - return TypePremiumFeatureCustomEmoji -} - -func (*PremiumFeatureCustomEmoji) PremiumFeatureType() string { - return TypePremiumFeatureCustomEmoji -} - -// Ability to change position of the main chat list, archive and mute all new chats from non-contacts, and completely disable notifications about the user's contacts joined Telegram -type PremiumFeatureAdvancedChatManagement struct { - meta -} - -func (entity *PremiumFeatureAdvancedChatManagement) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PremiumFeatureAdvancedChatManagement - - return json.Marshal((*stub)(entity)) -} - -func (*PremiumFeatureAdvancedChatManagement) GetClass() string { - return ClassPremiumFeature -} - -func (*PremiumFeatureAdvancedChatManagement) GetType() string { - return TypePremiumFeatureAdvancedChatManagement -} - -func (*PremiumFeatureAdvancedChatManagement) PremiumFeatureType() string { - return TypePremiumFeatureAdvancedChatManagement -} - -// A badge in the user's profile -type PremiumFeatureProfileBadge struct { - meta -} - -func (entity *PremiumFeatureProfileBadge) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PremiumFeatureProfileBadge - - return json.Marshal((*stub)(entity)) -} - -func (*PremiumFeatureProfileBadge) GetClass() string { - return ClassPremiumFeature -} - -func (*PremiumFeatureProfileBadge) GetType() string { - return TypePremiumFeatureProfileBadge -} - -func (*PremiumFeatureProfileBadge) PremiumFeatureType() string { - return TypePremiumFeatureProfileBadge -} - -// A emoji status shown along with the user's name -type PremiumFeatureEmojiStatus struct { - meta -} - -func (entity *PremiumFeatureEmojiStatus) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PremiumFeatureEmojiStatus - - return json.Marshal((*stub)(entity)) -} - -func (*PremiumFeatureEmojiStatus) GetClass() string { - return ClassPremiumFeature -} - -func (*PremiumFeatureEmojiStatus) GetType() string { - return TypePremiumFeatureEmojiStatus -} - -func (*PremiumFeatureEmojiStatus) PremiumFeatureType() string { - return TypePremiumFeatureEmojiStatus -} - -// Profile photo animation on message and chat screens -type PremiumFeatureAnimatedProfilePhoto struct { - meta -} - -func (entity *PremiumFeatureAnimatedProfilePhoto) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PremiumFeatureAnimatedProfilePhoto - - return json.Marshal((*stub)(entity)) -} - -func (*PremiumFeatureAnimatedProfilePhoto) GetClass() string { - return ClassPremiumFeature -} - -func (*PremiumFeatureAnimatedProfilePhoto) GetType() string { - return TypePremiumFeatureAnimatedProfilePhoto -} - -func (*PremiumFeatureAnimatedProfilePhoto) PremiumFeatureType() string { - return TypePremiumFeatureAnimatedProfilePhoto -} - -// The ability to set a custom emoji as a forum topic icon -type PremiumFeatureForumTopicIcon struct { - meta -} - -func (entity *PremiumFeatureForumTopicIcon) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PremiumFeatureForumTopicIcon - - return json.Marshal((*stub)(entity)) -} - -func (*PremiumFeatureForumTopicIcon) GetClass() string { - return ClassPremiumFeature -} - -func (*PremiumFeatureForumTopicIcon) GetType() string { - return TypePremiumFeatureForumTopicIcon -} - -func (*PremiumFeatureForumTopicIcon) PremiumFeatureType() string { - return TypePremiumFeatureForumTopicIcon -} - -// Allowed to set a premium appllication icons -type PremiumFeatureAppIcons struct { - meta -} - -func (entity *PremiumFeatureAppIcons) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PremiumFeatureAppIcons - - return json.Marshal((*stub)(entity)) -} - -func (*PremiumFeatureAppIcons) GetClass() string { - return ClassPremiumFeature -} - -func (*PremiumFeatureAppIcons) GetType() string { - return TypePremiumFeatureAppIcons -} - -func (*PremiumFeatureAppIcons) PremiumFeatureType() string { - return TypePremiumFeatureAppIcons -} - -// Contains information about a limit, increased for Premium users -type PremiumLimit struct { - meta - // The type of the limit - Type PremiumLimitType `json:"type"` - // Default value of the limit - DefaultValue int32 `json:"default_value"` - // Value of the limit for Premium users - PremiumValue int32 `json:"premium_value"` -} - -func (entity *PremiumLimit) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PremiumLimit - - return json.Marshal((*stub)(entity)) -} - -func (*PremiumLimit) GetClass() string { - return ClassPremiumLimit -} - -func (*PremiumLimit) GetType() string { - return TypePremiumLimit -} - -func (premiumLimit *PremiumLimit) UnmarshalJSON(data []byte) error { - var tmp struct { - Type json.RawMessage `json:"type"` - DefaultValue int32 `json:"default_value"` - PremiumValue int32 `json:"premium_value"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - premiumLimit.DefaultValue = tmp.DefaultValue - premiumLimit.PremiumValue = tmp.PremiumValue - - fieldType, _ := UnmarshalPremiumLimitType(tmp.Type) - premiumLimit.Type = fieldType - - return nil -} - -// Contains information about features, available to Premium users -type PremiumFeatures struct { - meta - // The list of available features - Features []PremiumFeature `json:"features"` - // The list of limits, increased for Premium users - Limits []*PremiumLimit `json:"limits"` - // An internal link to be opened to pay for Telegram Premium if store payment isn't possible; may be null if direct payment isn't available - PaymentLink InternalLinkType `json:"payment_link"` -} - -func (entity *PremiumFeatures) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PremiumFeatures - - return json.Marshal((*stub)(entity)) -} - -func (*PremiumFeatures) GetClass() string { - return ClassPremiumFeatures -} - -func (*PremiumFeatures) GetType() string { - return TypePremiumFeatures -} - -func (premiumFeatures *PremiumFeatures) UnmarshalJSON(data []byte) error { - var tmp struct { - Features []json.RawMessage `json:"features"` - Limits []*PremiumLimit `json:"limits"` - PaymentLink json.RawMessage `json:"payment_link"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - premiumFeatures.Limits = tmp.Limits - - fieldFeatures, _ := UnmarshalListOfPremiumFeature(tmp.Features) - premiumFeatures.Features = fieldFeatures - - fieldPaymentLink, _ := UnmarshalInternalLinkType(tmp.PaymentLink) - premiumFeatures.PaymentLink = fieldPaymentLink - - return nil -} - -// A limit was exceeded -type PremiumSourceLimitExceeded struct { - meta - // Type of the exceeded limit - LimitType PremiumLimitType `json:"limit_type"` -} - -func (entity *PremiumSourceLimitExceeded) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PremiumSourceLimitExceeded - - return json.Marshal((*stub)(entity)) -} - -func (*PremiumSourceLimitExceeded) GetClass() string { - return ClassPremiumSource -} - -func (*PremiumSourceLimitExceeded) GetType() string { - return TypePremiumSourceLimitExceeded -} - -func (*PremiumSourceLimitExceeded) PremiumSourceType() string { - return TypePremiumSourceLimitExceeded -} - -func (premiumSourceLimitExceeded *PremiumSourceLimitExceeded) UnmarshalJSON(data []byte) error { - var tmp struct { - LimitType json.RawMessage `json:"limit_type"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - fieldLimitType, _ := UnmarshalPremiumLimitType(tmp.LimitType) - premiumSourceLimitExceeded.LimitType = fieldLimitType - - return nil -} - -// A user tried to use a Premium feature -type PremiumSourceFeature struct { - meta - // The used feature - Feature PremiumFeature `json:"feature"` -} - -func (entity *PremiumSourceFeature) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PremiumSourceFeature - - return json.Marshal((*stub)(entity)) -} - -func (*PremiumSourceFeature) GetClass() string { - return ClassPremiumSource -} - -func (*PremiumSourceFeature) GetType() string { - return TypePremiumSourceFeature -} - -func (*PremiumSourceFeature) PremiumSourceType() string { - return TypePremiumSourceFeature -} - -func (premiumSourceFeature *PremiumSourceFeature) UnmarshalJSON(data []byte) error { - var tmp struct { - Feature json.RawMessage `json:"feature"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - fieldFeature, _ := UnmarshalPremiumFeature(tmp.Feature) - premiumSourceFeature.Feature = fieldFeature - - return nil -} - -// A user opened an internal link of the type internalLinkTypePremiumFeatures -type PremiumSourceLink struct { - meta - // The referrer from the link - Referrer string `json:"referrer"` -} - -func (entity *PremiumSourceLink) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PremiumSourceLink - - return json.Marshal((*stub)(entity)) -} - -func (*PremiumSourceLink) GetClass() string { - return ClassPremiumSource -} - -func (*PremiumSourceLink) GetType() string { - return TypePremiumSourceLink -} - -func (*PremiumSourceLink) PremiumSourceType() string { - return TypePremiumSourceLink -} - -// A user opened the Premium features screen from settings -type PremiumSourceSettings struct { - meta -} - -func (entity *PremiumSourceSettings) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PremiumSourceSettings - - return json.Marshal((*stub)(entity)) -} - -func (*PremiumSourceSettings) GetClass() string { - return ClassPremiumSource -} - -func (*PremiumSourceSettings) GetType() string { - return TypePremiumSourceSettings -} - -func (*PremiumSourceSettings) PremiumSourceType() string { - return TypePremiumSourceSettings -} - -// Describes a promotion animation for a Premium feature -type PremiumFeaturePromotionAnimation struct { - meta - // Premium feature - Feature PremiumFeature `json:"feature"` - // Promotion animation for the feature - Animation *Animation `json:"animation"` -} - -func (entity *PremiumFeaturePromotionAnimation) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PremiumFeaturePromotionAnimation - - return json.Marshal((*stub)(entity)) -} - -func (*PremiumFeaturePromotionAnimation) GetClass() string { - return ClassPremiumFeaturePromotionAnimation -} - -func (*PremiumFeaturePromotionAnimation) GetType() string { - return TypePremiumFeaturePromotionAnimation -} - -func (premiumFeaturePromotionAnimation *PremiumFeaturePromotionAnimation) UnmarshalJSON(data []byte) error { - var tmp struct { - Feature json.RawMessage `json:"feature"` - Animation *Animation `json:"animation"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - premiumFeaturePromotionAnimation.Animation = tmp.Animation - - fieldFeature, _ := UnmarshalPremiumFeature(tmp.Feature) - premiumFeaturePromotionAnimation.Feature = fieldFeature - - return nil -} - -// Contains state of Telegram Premium subscription and promotion videos for Premium features -type PremiumState struct { - meta - // Text description of the state of the current Premium subscription; may be empty if the current user has no Telegram Premium subscription - State *FormattedText `json:"state"` - // The list of available options for buying Telegram Premium - PaymentOptions []*PremiumPaymentOption `json:"payment_options"` - // The list of available promotion animations for Premium features - Animations []*PremiumFeaturePromotionAnimation `json:"animations"` -} - -func (entity *PremiumState) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PremiumState - - return json.Marshal((*stub)(entity)) -} - -func (*PremiumState) GetClass() string { - return ClassPremiumState -} - -func (*PremiumState) GetType() string { - return TypePremiumState -} - -// The user subscribed to Telegram Premium -type StorePaymentPurposePremiumSubscription struct { - meta - // Pass true if this is a restore of a Telegram Premium purchase; only for App Store - IsRestore bool `json:"is_restore"` -} - -func (entity *StorePaymentPurposePremiumSubscription) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub StorePaymentPurposePremiumSubscription - - return json.Marshal((*stub)(entity)) -} - -func (*StorePaymentPurposePremiumSubscription) GetClass() string { - return ClassStorePaymentPurpose -} - -func (*StorePaymentPurposePremiumSubscription) GetType() string { - return TypeStorePaymentPurposePremiumSubscription -} - -func (*StorePaymentPurposePremiumSubscription) StorePaymentPurposeType() string { - return TypeStorePaymentPurposePremiumSubscription -} - -// The user gifted Telegram Premium to another user -type StorePaymentPurposeGiftedPremium struct { - meta - // Identifier of the user for which Premium was gifted - UserId int64 `json:"user_id"` - // ISO 4217 currency code of the payment currency - Currency string `json:"currency"` - // Paid amount, in the smallest units of the currency - Amount int64 `json:"amount"` -} - -func (entity *StorePaymentPurposeGiftedPremium) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub StorePaymentPurposeGiftedPremium - - return json.Marshal((*stub)(entity)) -} - -func (*StorePaymentPurposeGiftedPremium) GetClass() string { - return ClassStorePaymentPurpose -} - -func (*StorePaymentPurposeGiftedPremium) GetType() string { - return TypeStorePaymentPurposeGiftedPremium -} - -func (*StorePaymentPurposeGiftedPremium) StorePaymentPurposeType() string { - return TypeStorePaymentPurposeGiftedPremium -} - -// A token for Firebase Cloud Messaging -type DeviceTokenFirebaseCloudMessaging struct { - 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"` -} - -func (entity *DeviceTokenFirebaseCloudMessaging) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub DeviceTokenFirebaseCloudMessaging - - return json.Marshal((*stub)(entity)) -} - -func (*DeviceTokenFirebaseCloudMessaging) GetClass() string { - return ClassDeviceToken -} - -func (*DeviceTokenFirebaseCloudMessaging) GetType() string { - return TypeDeviceTokenFirebaseCloudMessaging -} - -func (*DeviceTokenFirebaseCloudMessaging) DeviceTokenType() string { - return TypeDeviceTokenFirebaseCloudMessaging -} - -// A token for Apple Push Notification service -type DeviceTokenApplePush struct { - 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"` -} - -func (entity *DeviceTokenApplePush) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub DeviceTokenApplePush - - return json.Marshal((*stub)(entity)) -} - -func (*DeviceTokenApplePush) GetClass() string { - return ClassDeviceToken -} - -func (*DeviceTokenApplePush) GetType() string { - return TypeDeviceTokenApplePush -} - -func (*DeviceTokenApplePush) DeviceTokenType() string { - return TypeDeviceTokenApplePush -} - -// A token for Apple Push Notification service VoIP notifications -type DeviceTokenApplePushVoIP struct { - 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"` -} - -func (entity *DeviceTokenApplePushVoIP) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub DeviceTokenApplePushVoIP - - return json.Marshal((*stub)(entity)) -} - -func (*DeviceTokenApplePushVoIP) GetClass() string { - return ClassDeviceToken -} - -func (*DeviceTokenApplePushVoIP) GetType() string { - return TypeDeviceTokenApplePushVoIP -} - -func (*DeviceTokenApplePushVoIP) DeviceTokenType() string { - return TypeDeviceTokenApplePushVoIP -} - -// A token for Windows Push Notification Services -type DeviceTokenWindowsPush struct { - meta - // The access token that will be used to send notifications; may be empty to deregister a device - AccessToken string `json:"access_token"` -} - -func (entity *DeviceTokenWindowsPush) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub DeviceTokenWindowsPush - - return json.Marshal((*stub)(entity)) -} - -func (*DeviceTokenWindowsPush) GetClass() string { - return ClassDeviceToken -} - -func (*DeviceTokenWindowsPush) GetType() string { - return TypeDeviceTokenWindowsPush -} - -func (*DeviceTokenWindowsPush) DeviceTokenType() string { - return TypeDeviceTokenWindowsPush -} - -// A token for Microsoft Push Notification Service -type DeviceTokenMicrosoftPush struct { - meta - // Push notification channel URI; may be empty to deregister a device - ChannelUri string `json:"channel_uri"` -} - -func (entity *DeviceTokenMicrosoftPush) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub DeviceTokenMicrosoftPush - - return json.Marshal((*stub)(entity)) -} - -func (*DeviceTokenMicrosoftPush) GetClass() string { - return ClassDeviceToken -} - -func (*DeviceTokenMicrosoftPush) GetType() string { - return TypeDeviceTokenMicrosoftPush -} - -func (*DeviceTokenMicrosoftPush) DeviceTokenType() string { - return TypeDeviceTokenMicrosoftPush -} - -// A token for Microsoft Push Notification Service VoIP channel -type DeviceTokenMicrosoftPushVoIP struct { - meta - // Push notification channel URI; may be empty to deregister a device - ChannelUri string `json:"channel_uri"` -} - -func (entity *DeviceTokenMicrosoftPushVoIP) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub DeviceTokenMicrosoftPushVoIP - - return json.Marshal((*stub)(entity)) -} - -func (*DeviceTokenMicrosoftPushVoIP) GetClass() string { - return ClassDeviceToken -} - -func (*DeviceTokenMicrosoftPushVoIP) GetType() string { - return TypeDeviceTokenMicrosoftPushVoIP -} - -func (*DeviceTokenMicrosoftPushVoIP) DeviceTokenType() string { - return TypeDeviceTokenMicrosoftPushVoIP -} - -// A token for web Push API -type DeviceTokenWebPush struct { - 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"` -} - -func (entity *DeviceTokenWebPush) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub DeviceTokenWebPush - - return json.Marshal((*stub)(entity)) -} - -func (*DeviceTokenWebPush) GetClass() string { - return ClassDeviceToken -} - -func (*DeviceTokenWebPush) GetType() string { - return TypeDeviceTokenWebPush -} - -func (*DeviceTokenWebPush) DeviceTokenType() string { - return TypeDeviceTokenWebPush -} - -// A token for Simple Push API for Firefox OS -type DeviceTokenSimplePush struct { - 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"` -} - -func (entity *DeviceTokenSimplePush) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub DeviceTokenSimplePush - - return json.Marshal((*stub)(entity)) -} - -func (*DeviceTokenSimplePush) GetClass() string { - return ClassDeviceToken -} - -func (*DeviceTokenSimplePush) GetType() string { - return TypeDeviceTokenSimplePush -} - -func (*DeviceTokenSimplePush) DeviceTokenType() string { - return TypeDeviceTokenSimplePush -} - -// A token for Ubuntu Push Client service -type DeviceTokenUbuntuPush struct { - meta - // Token; may be empty to deregister a device - Token string `json:"token"` -} - -func (entity *DeviceTokenUbuntuPush) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub DeviceTokenUbuntuPush - - return json.Marshal((*stub)(entity)) -} - -func (*DeviceTokenUbuntuPush) GetClass() string { - return ClassDeviceToken -} - -func (*DeviceTokenUbuntuPush) GetType() string { - return TypeDeviceTokenUbuntuPush -} - -func (*DeviceTokenUbuntuPush) DeviceTokenType() string { - return TypeDeviceTokenUbuntuPush -} - -// A token for BlackBerry Push Service -type DeviceTokenBlackBerryPush struct { - meta - // Token; may be empty to deregister a device - Token string `json:"token"` -} - -func (entity *DeviceTokenBlackBerryPush) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub DeviceTokenBlackBerryPush - - return json.Marshal((*stub)(entity)) -} - -func (*DeviceTokenBlackBerryPush) GetClass() string { - return ClassDeviceToken -} - -func (*DeviceTokenBlackBerryPush) GetType() string { - return TypeDeviceTokenBlackBerryPush -} - -func (*DeviceTokenBlackBerryPush) DeviceTokenType() string { - return TypeDeviceTokenBlackBerryPush -} - -// A token for Tizen Push Service -type DeviceTokenTizenPush struct { - meta - // Push service registration identifier; may be empty to deregister a device - RegId string `json:"reg_id"` -} - -func (entity *DeviceTokenTizenPush) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub DeviceTokenTizenPush - - return json.Marshal((*stub)(entity)) -} - -func (*DeviceTokenTizenPush) GetClass() string { - return ClassDeviceToken -} - -func (*DeviceTokenTizenPush) GetType() string { - return TypeDeviceTokenTizenPush -} - -func (*DeviceTokenTizenPush) DeviceTokenType() string { - return TypeDeviceTokenTizenPush -} - -// Contains a globally unique push receiver identifier, which can be used to identify which account has received a push notification -type PushReceiverId struct { - meta - // The globally unique identifier of push notification subscription - Id JsonInt64 `json:"id"` -} - -func (entity *PushReceiverId) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PushReceiverId - - return json.Marshal((*stub)(entity)) -} - -func (*PushReceiverId) GetClass() string { - return ClassPushReceiverId -} - -func (*PushReceiverId) GetType() string { - return TypePushReceiverId -} - -// Describes a solid fill of a background -type BackgroundFillSolid struct { - meta - // A color of the background in the RGB24 format - Color int32 `json:"color"` -} - -func (entity *BackgroundFillSolid) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub BackgroundFillSolid - - return json.Marshal((*stub)(entity)) -} - -func (*BackgroundFillSolid) GetClass() string { - return ClassBackgroundFill -} - -func (*BackgroundFillSolid) GetType() string { - return TypeBackgroundFillSolid -} - -func (*BackgroundFillSolid) BackgroundFillType() string { - return TypeBackgroundFillSolid -} - -// Describes a gradient fill of a background -type BackgroundFillGradient struct { - 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 always be divisible by 45 - RotationAngle int32 `json:"rotation_angle"` -} - -func (entity *BackgroundFillGradient) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub BackgroundFillGradient - - return json.Marshal((*stub)(entity)) -} - -func (*BackgroundFillGradient) GetClass() string { - return ClassBackgroundFill -} - -func (*BackgroundFillGradient) GetType() string { - return TypeBackgroundFillGradient -} - -func (*BackgroundFillGradient) BackgroundFillType() string { - return TypeBackgroundFillGradient -} - -// Describes a freeform gradient fill of a background -type BackgroundFillFreeformGradient struct { - meta - // A list of 3 or 4 colors of the freeform gradients in the RGB24 format - Colors []int32 `json:"colors"` -} - -func (entity *BackgroundFillFreeformGradient) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub BackgroundFillFreeformGradient - - return json.Marshal((*stub)(entity)) -} - -func (*BackgroundFillFreeformGradient) GetClass() string { - return ClassBackgroundFill -} - -func (*BackgroundFillFreeformGradient) GetType() string { - return TypeBackgroundFillFreeformGradient -} - -func (*BackgroundFillFreeformGradient) BackgroundFillType() string { - return TypeBackgroundFillFreeformGradient -} - -// A wallpaper in JPEG format -type BackgroundTypeWallpaper struct { - 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"` -} - -func (entity *BackgroundTypeWallpaper) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub BackgroundTypeWallpaper - - return json.Marshal((*stub)(entity)) -} - -func (*BackgroundTypeWallpaper) GetClass() string { - return ClassBackgroundType -} - -func (*BackgroundTypeWallpaper) GetType() string { - return TypeBackgroundTypeWallpaper -} - -func (*BackgroundTypeWallpaper) BackgroundTypeType() string { - return TypeBackgroundTypeWallpaper -} - -// 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 { - 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"` -} - -func (entity *BackgroundTypePattern) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub BackgroundTypePattern - - return json.Marshal((*stub)(entity)) -} - -func (*BackgroundTypePattern) GetClass() string { - return ClassBackgroundType -} - -func (*BackgroundTypePattern) GetType() string { - return TypeBackgroundTypePattern -} - -func (*BackgroundTypePattern) BackgroundTypeType() string { - return TypeBackgroundTypePattern -} - -func (backgroundTypePattern *BackgroundTypePattern) UnmarshalJSON(data []byte) error { - var tmp struct { - Fill json.RawMessage `json:"fill"` - Intensity int32 `json:"intensity"` - IsInverted bool `json:"is_inverted"` - IsMoving bool `json:"is_moving"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - backgroundTypePattern.Intensity = tmp.Intensity - backgroundTypePattern.IsInverted = tmp.IsInverted - backgroundTypePattern.IsMoving = tmp.IsMoving - - fieldFill, _ := UnmarshalBackgroundFill(tmp.Fill) - backgroundTypePattern.Fill = fieldFill - - return nil -} - -// A filled background -type BackgroundTypeFill struct { - meta - // The background fill - Fill BackgroundFill `json:"fill"` -} - -func (entity *BackgroundTypeFill) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub BackgroundTypeFill - - return json.Marshal((*stub)(entity)) -} - -func (*BackgroundTypeFill) GetClass() string { - return ClassBackgroundType -} - -func (*BackgroundTypeFill) GetType() string { - return TypeBackgroundTypeFill -} - -func (*BackgroundTypeFill) BackgroundTypeType() string { - return TypeBackgroundTypeFill -} - -func (backgroundTypeFill *BackgroundTypeFill) UnmarshalJSON(data []byte) error { - var tmp struct { - Fill json.RawMessage `json:"fill"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - fieldFill, _ := UnmarshalBackgroundFill(tmp.Fill) - backgroundTypeFill.Fill = fieldFill - - return nil + var tmp struct { + Id JsonInt64 `json:"id"` + Question string `json:"question"` + Options []*PollOption `json:"options"` + TotalVoterCount int32 `json:"total_voter_count"` + RecentVoterIds []json.RawMessage `json:"recent_voter_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.IsAnonymous = tmp.IsAnonymous + poll.OpenPeriod = tmp.OpenPeriod + poll.CloseDate = tmp.CloseDate + poll.IsClosed = tmp.IsClosed + + fieldRecentVoterIds, _ := UnmarshalListOfMessageSender(tmp.RecentVoterIds) + poll.RecentVoterIds = fieldRecentVoterIds + + fieldType, _ := UnmarshalPollType(tmp.Type) + poll.Type = fieldType + + return nil } // Describes a chat background type Background struct { - 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"` + 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 and chat theme backgrounds + Document *Document `json:"document"` + // Type of the background + Type BackgroundType `json:"type"` } func (entity *Background) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub Background + type stub Background - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*Background) GetClass() string { - return ClassBackground + return ClassBackground } func (*Background) GetType() string { - return TypeBackground + return TypeBackground } func (background *Background) UnmarshalJSON(data []byte) error { - 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"` - } + 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"` + } - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } - background.Id = tmp.Id - background.IsDefault = tmp.IsDefault - background.IsDark = tmp.IsDark - background.Name = tmp.Name - background.Document = tmp.Document + background.Id = tmp.Id + background.IsDefault = tmp.IsDefault + background.IsDark = tmp.IsDark + background.Name = tmp.Name + background.Document = tmp.Document - fieldType, _ := UnmarshalBackgroundType(tmp.Type) - background.Type = fieldType + fieldType, _ := UnmarshalBackgroundType(tmp.Type) + background.Type = fieldType - return nil + return nil } // Contains a list of backgrounds type Backgrounds struct { - meta - // A list of backgrounds - Backgrounds []*Background `json:"backgrounds"` + meta + // A list of backgrounds + Backgrounds []*Background `json:"backgrounds"` } func (entity *Backgrounds) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub Backgrounds + type stub Backgrounds - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*Backgrounds) GetClass() string { - return ClassBackgrounds + return ClassBackgrounds } func (*Backgrounds) GetType() string { - return TypeBackgrounds + return TypeBackgrounds +} + +// Describes a background set for a specific chat +type ChatBackground struct { + meta + // The background + Background *Background `json:"background"` + // Dimming of the background in dark themes, as a percentage; 0-100. Applied only to Wallpaper and Fill types of background + DarkThemeDimming int32 `json:"dark_theme_dimming"` +} + +func (entity *ChatBackground) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatBackground + + return json.Marshal((*stub)(entity)) +} + +func (*ChatBackground) GetClass() string { + return ClassChatBackground +} + +func (*ChatBackground) GetType() string { + return TypeChatBackground +} + +// Describes a user profile photo +type ProfilePhoto struct { + 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"` + // True, if the photo is visible only for the current user + IsPersonal bool `json:"is_personal"` +} + +func (entity *ProfilePhoto) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ProfilePhoto + + return json.Marshal((*stub)(entity)) +} + +func (*ProfilePhoto) GetClass() string { + return ClassProfilePhoto +} + +func (*ProfilePhoto) GetType() string { + return TypeProfilePhoto +} + +// Contains basic information about the photo of a chat +type ChatPhotoInfo struct { + 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"` + // True, if the photo is visible only for the current user + IsPersonal bool `json:"is_personal"` +} + +func (entity *ChatPhotoInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatPhotoInfo + + return json.Marshal((*stub)(entity)) +} + +func (*ChatPhotoInfo) GetClass() string { + return ClassChatPhotoInfo +} + +func (*ChatPhotoInfo) GetType() string { + return TypeChatPhotoInfo +} + +// A regular user +type UserTypeRegular struct{ + meta +} + +func (entity *UserTypeRegular) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UserTypeRegular + + return json.Marshal((*stub)(entity)) +} + +func (*UserTypeRegular) GetClass() string { + return ClassUserType +} + +func (*UserTypeRegular) GetType() string { + return TypeUserTypeRegular +} + +func (*UserTypeRegular) UserTypeType() string { + return TypeUserTypeRegular +} + +// 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 +type UserTypeDeleted struct{ + meta +} + +func (entity *UserTypeDeleted) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UserTypeDeleted + + return json.Marshal((*stub)(entity)) +} + +func (*UserTypeDeleted) GetClass() string { + return ClassUserType +} + +func (*UserTypeDeleted) GetType() string { + return TypeUserTypeDeleted +} + +func (*UserTypeDeleted) UserTypeType() string { + return TypeUserTypeDeleted +} + +// A bot (see https://core.telegram.org/bots) +type UserTypeBot struct { + meta + // True, if the bot is owned by the current user and can be edited using the methods toggleBotUsernameIsActive, reorderBotActiveUsernames, setBotProfilePhoto, setBotName, setBotInfoDescription, and setBotInfoShortDescription + CanBeEdited bool `json:"can_be_edited"` + // 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"` + // True, if the bot supports connection to Telegram Business accounts + CanConnectToBusiness bool `json:"can_connect_to_business"` + // True, if the bot can be added to attachment or side menu + CanBeAddedToAttachmentMenu bool `json:"can_be_added_to_attachment_menu"` +} + +func (entity *UserTypeBot) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UserTypeBot + + return json.Marshal((*stub)(entity)) +} + +func (*UserTypeBot) GetClass() string { + return ClassUserType +} + +func (*UserTypeBot) GetType() string { + return TypeUserTypeBot +} + +func (*UserTypeBot) UserTypeType() string { + return TypeUserTypeBot +} + +// 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 +type UserTypeUnknown struct{ + meta +} + +func (entity *UserTypeUnknown) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UserTypeUnknown + + return json.Marshal((*stub)(entity)) +} + +func (*UserTypeUnknown) GetClass() string { + return ClassUserType +} + +func (*UserTypeUnknown) GetType() string { + return TypeUserTypeUnknown +} + +func (*UserTypeUnknown) UserTypeType() string { + return TypeUserTypeUnknown +} + +// Represents a command supported by a bot +type BotCommand struct { + meta + // Text of the bot command + Command string `json:"command"` + // Description of the bot command + Description string `json:"description"` +} + +func (entity *BotCommand) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BotCommand + + return json.Marshal((*stub)(entity)) +} + +func (*BotCommand) GetClass() string { + return ClassBotCommand +} + +func (*BotCommand) GetType() string { + return TypeBotCommand +} + +// Contains a list of bot commands +type BotCommands struct { + meta + // Bot's user identifier + BotUserId int64 `json:"bot_user_id"` + // List of bot commands + Commands []*BotCommand `json:"commands"` +} + +func (entity *BotCommands) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BotCommands + + return json.Marshal((*stub)(entity)) +} + +func (*BotCommands) GetClass() string { + return ClassBotCommands +} + +func (*BotCommands) GetType() string { + return TypeBotCommands +} + +// Describes a button to be shown instead of bot commands menu button +type BotMenuButton struct { + meta + // Text of the button + Text string `json:"text"` + // URL to be passed to openWebApp + Url string `json:"url"` +} + +func (entity *BotMenuButton) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BotMenuButton + + return json.Marshal((*stub)(entity)) +} + +func (*BotMenuButton) GetClass() string { + return ClassBotMenuButton +} + +func (*BotMenuButton) GetType() string { + return TypeBotMenuButton +} + +// Represents a location to which a chat is connected +type ChatLocation struct { + meta + // The location + Location *Location `json:"location"` + // Location address; 1-64 characters, as defined by the chat owner + Address string `json:"address"` +} + +func (entity *ChatLocation) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatLocation + + return json.Marshal((*stub)(entity)) +} + +func (*ChatLocation) GetClass() string { + return ClassChatLocation +} + +func (*ChatLocation) GetType() string { + return TypeChatLocation +} + +// Represents a birthdate of a user +type Birthdate struct { + meta + // Day of the month; 1-31 + Day int32 `json:"day"` + // Month of the year; 1-12 + Month int32 `json:"month"` + // Birth year; 0 if unknown + Year int32 `json:"year"` +} + +func (entity *Birthdate) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub Birthdate + + return json.Marshal((*stub)(entity)) +} + +func (*Birthdate) GetClass() string { + return ClassBirthdate +} + +func (*Birthdate) GetType() string { + return TypeBirthdate +} + +// Describes a user that had or will have a birthday soon +type CloseBirthdayUser struct { + meta + // User identifier + UserId int64 `json:"user_id"` + // Birthdate of the user + Birthdate *Birthdate `json:"birthdate"` +} + +func (entity *CloseBirthdayUser) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CloseBirthdayUser + + return json.Marshal((*stub)(entity)) +} + +func (*CloseBirthdayUser) GetClass() string { + return ClassCloseBirthdayUser +} + +func (*CloseBirthdayUser) GetType() string { + return TypeCloseBirthdayUser +} + +// Send away messages always +type BusinessAwayMessageScheduleAlways struct{ + meta +} + +func (entity *BusinessAwayMessageScheduleAlways) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BusinessAwayMessageScheduleAlways + + return json.Marshal((*stub)(entity)) +} + +func (*BusinessAwayMessageScheduleAlways) GetClass() string { + return ClassBusinessAwayMessageSchedule +} + +func (*BusinessAwayMessageScheduleAlways) GetType() string { + return TypeBusinessAwayMessageScheduleAlways +} + +func (*BusinessAwayMessageScheduleAlways) BusinessAwayMessageScheduleType() string { + return TypeBusinessAwayMessageScheduleAlways +} + +// Send away messages outside of the business opening hours +type BusinessAwayMessageScheduleOutsideOfOpeningHours struct{ + meta +} + +func (entity *BusinessAwayMessageScheduleOutsideOfOpeningHours) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BusinessAwayMessageScheduleOutsideOfOpeningHours + + return json.Marshal((*stub)(entity)) +} + +func (*BusinessAwayMessageScheduleOutsideOfOpeningHours) GetClass() string { + return ClassBusinessAwayMessageSchedule +} + +func (*BusinessAwayMessageScheduleOutsideOfOpeningHours) GetType() string { + return TypeBusinessAwayMessageScheduleOutsideOfOpeningHours +} + +func (*BusinessAwayMessageScheduleOutsideOfOpeningHours) BusinessAwayMessageScheduleType() string { + return TypeBusinessAwayMessageScheduleOutsideOfOpeningHours +} + +// Send away messages only in the specified time span +type BusinessAwayMessageScheduleCustom struct { + meta + // Point in time (Unix timestamp) when the away messages will start to be sent + StartDate int32 `json:"start_date"` + // Point in time (Unix timestamp) when the away messages will stop to be sent + EndDate int32 `json:"end_date"` +} + +func (entity *BusinessAwayMessageScheduleCustom) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BusinessAwayMessageScheduleCustom + + return json.Marshal((*stub)(entity)) +} + +func (*BusinessAwayMessageScheduleCustom) GetClass() string { + return ClassBusinessAwayMessageSchedule +} + +func (*BusinessAwayMessageScheduleCustom) GetType() string { + return TypeBusinessAwayMessageScheduleCustom +} + +func (*BusinessAwayMessageScheduleCustom) BusinessAwayMessageScheduleType() string { + return TypeBusinessAwayMessageScheduleCustom +} + +// Represents a location of a business +type BusinessLocation struct { + meta + // The location; may be null if not specified + Location *Location `json:"location"` + // Location address; 1-96 characters + Address string `json:"address"` +} + +func (entity *BusinessLocation) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BusinessLocation + + return json.Marshal((*stub)(entity)) +} + +func (*BusinessLocation) GetClass() string { + return ClassBusinessLocation +} + +func (*BusinessLocation) GetType() string { + return TypeBusinessLocation +} + +// Describes private chats chosen for automatic interaction with a business +type BusinessRecipients struct { + meta + // Identifiers of selected private chats + ChatIds []int64 `json:"chat_ids"` + // Identifiers of private chats that are always excluded; for businessConnectedBot only + ExcludedChatIds []int64 `json:"excluded_chat_ids"` + // True, if all existing private chats are selected + SelectExistingChats bool `json:"select_existing_chats"` + // True, if all new private chats are selected + SelectNewChats bool `json:"select_new_chats"` + // True, if all private chats with contacts are selected + SelectContacts bool `json:"select_contacts"` + // True, if all private chats with non-contacts are selected + SelectNonContacts bool `json:"select_non_contacts"` + // If true, then all private chats except the selected are chosen. Otherwise, only the selected chats are chosen + ExcludeSelected bool `json:"exclude_selected"` +} + +func (entity *BusinessRecipients) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BusinessRecipients + + return json.Marshal((*stub)(entity)) +} + +func (*BusinessRecipients) GetClass() string { + return ClassBusinessRecipients +} + +func (*BusinessRecipients) GetType() string { + return TypeBusinessRecipients +} + +// Describes settings for messages that are automatically sent by a Telegram Business account when it is away +type BusinessAwayMessageSettings struct { + meta + // Unique quick reply shortcut identifier for the away messages + ShortcutId int32 `json:"shortcut_id"` + // Chosen recipients of the away messages + Recipients *BusinessRecipients `json:"recipients"` + // Settings used to check whether the current user is away + Schedule BusinessAwayMessageSchedule `json:"schedule"` + // True, if the messages must not be sent if the account was online in the last 10 minutes + OfflineOnly bool `json:"offline_only"` +} + +func (entity *BusinessAwayMessageSettings) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BusinessAwayMessageSettings + + return json.Marshal((*stub)(entity)) +} + +func (*BusinessAwayMessageSettings) GetClass() string { + return ClassBusinessAwayMessageSettings +} + +func (*BusinessAwayMessageSettings) GetType() string { + return TypeBusinessAwayMessageSettings +} + +func (businessAwayMessageSettings *BusinessAwayMessageSettings) UnmarshalJSON(data []byte) error { + var tmp struct { + ShortcutId int32 `json:"shortcut_id"` + Recipients *BusinessRecipients `json:"recipients"` + Schedule json.RawMessage `json:"schedule"` + OfflineOnly bool `json:"offline_only"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + businessAwayMessageSettings.ShortcutId = tmp.ShortcutId + businessAwayMessageSettings.Recipients = tmp.Recipients + businessAwayMessageSettings.OfflineOnly = tmp.OfflineOnly + + fieldSchedule, _ := UnmarshalBusinessAwayMessageSchedule(tmp.Schedule) + businessAwayMessageSettings.Schedule = fieldSchedule + + return nil +} + +// Describes settings for greeting messages that are automatically sent by a Telegram Business account as response to incoming messages in an inactive private chat +type BusinessGreetingMessageSettings struct { + meta + // Unique quick reply shortcut identifier for the greeting messages + ShortcutId int32 `json:"shortcut_id"` + // Chosen recipients of the greeting messages + Recipients *BusinessRecipients `json:"recipients"` + // The number of days after which a chat will be considered as inactive; currently, must be on of 7, 14, 21, or 28 + InactivityDays int32 `json:"inactivity_days"` +} + +func (entity *BusinessGreetingMessageSettings) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BusinessGreetingMessageSettings + + return json.Marshal((*stub)(entity)) +} + +func (*BusinessGreetingMessageSettings) GetClass() string { + return ClassBusinessGreetingMessageSettings +} + +func (*BusinessGreetingMessageSettings) GetType() string { + return TypeBusinessGreetingMessageSettings +} + +// Describes a bot connected to a business account +type BusinessConnectedBot struct { + meta + // User identifier of the bot + BotUserId int64 `json:"bot_user_id"` + // Private chats that will be accessible to the bot + Recipients *BusinessRecipients `json:"recipients"` + // True, if the bot can send messages to the private chats; false otherwise + CanReply bool `json:"can_reply"` +} + +func (entity *BusinessConnectedBot) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BusinessConnectedBot + + return json.Marshal((*stub)(entity)) +} + +func (*BusinessConnectedBot) GetClass() string { + return ClassBusinessConnectedBot +} + +func (*BusinessConnectedBot) GetType() string { + return TypeBusinessConnectedBot +} + +// Describes settings for a business account intro +type BusinessIntro struct { + meta + // Title text of the intro + Title string `json:"title"` + // Message text of the intro + Message string `json:"message"` + // Greeting sticker of the intro; may be null if none + Sticker *Sticker `json:"sticker"` +} + +func (entity *BusinessIntro) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BusinessIntro + + return json.Marshal((*stub)(entity)) +} + +func (*BusinessIntro) GetClass() string { + return ClassBusinessIntro +} + +func (*BusinessIntro) GetType() string { + return TypeBusinessIntro +} + +// Describes settings for a business account intro to set +type InputBusinessIntro struct { + meta + // Title text of the intro; 0-getOption("business_intro_title_length_max") characters + Title string `json:"title"` + // Message text of the intro; 0-getOption("business_intro_message_length_max") characters + Message string `json:"message"` + // Greeting sticker of the intro; pass null if none. The sticker must belong to a sticker set and must not be a custom emoji + Sticker InputFile `json:"sticker"` +} + +func (entity *InputBusinessIntro) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputBusinessIntro + + return json.Marshal((*stub)(entity)) +} + +func (*InputBusinessIntro) GetClass() string { + return ClassInputBusinessIntro +} + +func (*InputBusinessIntro) GetType() string { + return TypeInputBusinessIntro +} + +func (inputBusinessIntro *InputBusinessIntro) UnmarshalJSON(data []byte) error { + var tmp struct { + Title string `json:"title"` + Message string `json:"message"` + Sticker json.RawMessage `json:"sticker"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + inputBusinessIntro.Title = tmp.Title + inputBusinessIntro.Message = tmp.Message + + fieldSticker, _ := UnmarshalInputFile(tmp.Sticker) + inputBusinessIntro.Sticker = fieldSticker + + return nil +} + +// Describes an interval of time when the business is open +type BusinessOpeningHoursInterval struct { + meta + // The first minute of the interval since start of the week; 0-7*24*60 + StartMinute int32 `json:"start_minute"` + // The first minute after the end of the interval since start of the week; 1-8*24*60 + EndMinute int32 `json:"end_minute"` +} + +func (entity *BusinessOpeningHoursInterval) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BusinessOpeningHoursInterval + + return json.Marshal((*stub)(entity)) +} + +func (*BusinessOpeningHoursInterval) GetClass() string { + return ClassBusinessOpeningHoursInterval +} + +func (*BusinessOpeningHoursInterval) GetType() string { + return TypeBusinessOpeningHoursInterval +} + +// Describes opening hours of a business +type BusinessOpeningHours struct { + meta + // Unique time zone identifier + TimeZoneId string `json:"time_zone_id"` + // Intervals of the time when the business is open + OpeningHours []*BusinessOpeningHoursInterval `json:"opening_hours"` +} + +func (entity *BusinessOpeningHours) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BusinessOpeningHours + + return json.Marshal((*stub)(entity)) +} + +func (*BusinessOpeningHours) GetClass() string { + return ClassBusinessOpeningHours +} + +func (*BusinessOpeningHours) GetType() string { + return TypeBusinessOpeningHours +} + +// Contains information about a Telegram Business account +type BusinessInfo struct { + meta + // Location of the business; may be null if none + Location *BusinessLocation `json:"location"` + // Opening hours of the business; may be null if none. The hours are guaranteed to be valid and has already been split by week days + OpeningHours *BusinessOpeningHours `json:"opening_hours"` + // The greeting message; may be null if none or the Business account is not of the current user + GreetingMessageSettings *BusinessGreetingMessageSettings `json:"greeting_message_settings"` + // The away message; may be null if none or the Business account is not of the current user + AwayMessageSettings *BusinessAwayMessageSettings `json:"away_message_settings"` + // Information about intro of the business; may be null if none + Intro *BusinessIntro `json:"intro"` +} + +func (entity *BusinessInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BusinessInfo + + return json.Marshal((*stub)(entity)) +} + +func (*BusinessInfo) GetClass() string { + return ClassBusinessInfo +} + +func (*BusinessInfo) GetType() string { + return TypeBusinessInfo +} + +// Information about the sticker, which was used to create the chat photo +type ChatPhotoStickerTypeRegularOrMask struct { + meta + // Sticker set identifier + StickerSetId JsonInt64 `json:"sticker_set_id"` + // Identifier of the sticker in the set + StickerId JsonInt64 `json:"sticker_id"` +} + +func (entity *ChatPhotoStickerTypeRegularOrMask) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatPhotoStickerTypeRegularOrMask + + return json.Marshal((*stub)(entity)) +} + +func (*ChatPhotoStickerTypeRegularOrMask) GetClass() string { + return ClassChatPhotoStickerType +} + +func (*ChatPhotoStickerTypeRegularOrMask) GetType() string { + return TypeChatPhotoStickerTypeRegularOrMask +} + +func (*ChatPhotoStickerTypeRegularOrMask) ChatPhotoStickerTypeType() string { + return TypeChatPhotoStickerTypeRegularOrMask +} + +// Information about the custom emoji, which was used to create the chat photo +type ChatPhotoStickerTypeCustomEmoji struct { + meta + // Identifier of the custom emoji + CustomEmojiId JsonInt64 `json:"custom_emoji_id"` +} + +func (entity *ChatPhotoStickerTypeCustomEmoji) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatPhotoStickerTypeCustomEmoji + + return json.Marshal((*stub)(entity)) +} + +func (*ChatPhotoStickerTypeCustomEmoji) GetClass() string { + return ClassChatPhotoStickerType +} + +func (*ChatPhotoStickerTypeCustomEmoji) GetType() string { + return TypeChatPhotoStickerTypeCustomEmoji +} + +func (*ChatPhotoStickerTypeCustomEmoji) ChatPhotoStickerTypeType() string { + return TypeChatPhotoStickerTypeCustomEmoji +} + +// Information about the sticker, which was used to create the chat photo. The sticker is shown at the center of the photo and occupies at most 67% of it +type ChatPhotoSticker struct { + meta + // Type of the sticker + Type ChatPhotoStickerType `json:"type"` + // The fill to be used as background for the sticker; rotation angle in backgroundFillGradient isn't supported + BackgroundFill BackgroundFill `json:"background_fill"` +} + +func (entity *ChatPhotoSticker) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatPhotoSticker + + return json.Marshal((*stub)(entity)) +} + +func (*ChatPhotoSticker) GetClass() string { + return ClassChatPhotoSticker +} + +func (*ChatPhotoSticker) GetType() string { + return TypeChatPhotoSticker +} + +func (chatPhotoSticker *ChatPhotoSticker) UnmarshalJSON(data []byte) error { + var tmp struct { + Type json.RawMessage `json:"type"` + BackgroundFill json.RawMessage `json:"background_fill"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldType, _ := UnmarshalChatPhotoStickerType(tmp.Type) + chatPhotoSticker.Type = fieldType + + fieldBackgroundFill, _ := UnmarshalBackgroundFill(tmp.BackgroundFill) + chatPhotoSticker.BackgroundFill = fieldBackgroundFill + + return nil +} + +// Animated variant of a chat photo in MPEG4 format +type AnimatedChatPhoto struct { + 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"` +} + +func (entity *AnimatedChatPhoto) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub AnimatedChatPhoto + + return json.Marshal((*stub)(entity)) +} + +func (*AnimatedChatPhoto) GetClass() string { + return ClassAnimatedChatPhoto +} + +func (*AnimatedChatPhoto) GetType() string { + return TypeAnimatedChatPhoto +} + +// Describes a chat or user profile photo +type ChatPhoto struct { + 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"` + // A big (up to 1280x1280) animated variant of the photo in MPEG4 format; may be null + Animation *AnimatedChatPhoto `json:"animation"` + // A small (160x160) animated variant of the photo in MPEG4 format; may be null even the big animation is available + SmallAnimation *AnimatedChatPhoto `json:"small_animation"` + // Sticker-based version of the chat photo; may be null + Sticker *ChatPhotoSticker `json:"sticker"` +} + +func (entity *ChatPhoto) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatPhoto + + return json.Marshal((*stub)(entity)) +} + +func (*ChatPhoto) GetClass() string { + return ClassChatPhoto +} + +func (*ChatPhoto) GetType() string { + return TypeChatPhoto +} + +// Contains a list of chat or user profile photos +type ChatPhotos struct { + meta + // Total number of photos + TotalCount int32 `json:"total_count"` + // List of photos + Photos []*ChatPhoto `json:"photos"` +} + +func (entity *ChatPhotos) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatPhotos + + return json.Marshal((*stub)(entity)) +} + +func (*ChatPhotos) GetClass() string { + return ClassChatPhotos +} + +func (*ChatPhotos) GetType() string { + return TypeChatPhotos +} + +// A previously used profile photo of the current user +type InputChatPhotoPrevious struct { + meta + // Identifier of the current user's profile photo to reuse + ChatPhotoId JsonInt64 `json:"chat_photo_id"` +} + +func (entity *InputChatPhotoPrevious) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputChatPhotoPrevious + + return json.Marshal((*stub)(entity)) +} + +func (*InputChatPhotoPrevious) GetClass() string { + return ClassInputChatPhoto +} + +func (*InputChatPhotoPrevious) GetType() string { + return TypeInputChatPhotoPrevious +} + +func (*InputChatPhotoPrevious) InputChatPhotoType() string { + return TypeInputChatPhotoPrevious +} + +// A static photo in JPEG format +type InputChatPhotoStatic struct { + meta + // Photo to be set as profile photo. Only inputFileLocal and inputFileGenerated are allowed + Photo InputFile `json:"photo"` +} + +func (entity *InputChatPhotoStatic) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputChatPhotoStatic + + return json.Marshal((*stub)(entity)) +} + +func (*InputChatPhotoStatic) GetClass() string { + return ClassInputChatPhoto +} + +func (*InputChatPhotoStatic) GetType() string { + return TypeInputChatPhotoStatic +} + +func (*InputChatPhotoStatic) InputChatPhotoType() string { + return TypeInputChatPhotoStatic +} + +func (inputChatPhotoStatic *InputChatPhotoStatic) UnmarshalJSON(data []byte) error { + var tmp struct { + Photo json.RawMessage `json:"photo"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldPhoto, _ := UnmarshalInputFile(tmp.Photo) + inputChatPhotoStatic.Photo = fieldPhoto + + return nil +} + +// An animation in MPEG4 format; must be square, at most 10 seconds long, have width between 160 and 1280 and be at most 2MB in size +type InputChatPhotoAnimation struct { + 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"` +} + +func (entity *InputChatPhotoAnimation) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputChatPhotoAnimation + + return json.Marshal((*stub)(entity)) +} + +func (*InputChatPhotoAnimation) GetClass() string { + return ClassInputChatPhoto +} + +func (*InputChatPhotoAnimation) GetType() string { + return TypeInputChatPhotoAnimation +} + +func (*InputChatPhotoAnimation) InputChatPhotoType() string { + return TypeInputChatPhotoAnimation +} + +func (inputChatPhotoAnimation *InputChatPhotoAnimation) UnmarshalJSON(data []byte) error { + var tmp struct { + Animation json.RawMessage `json:"animation"` + MainFrameTimestamp float64 `json:"main_frame_timestamp"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + inputChatPhotoAnimation.MainFrameTimestamp = tmp.MainFrameTimestamp + + fieldAnimation, _ := UnmarshalInputFile(tmp.Animation) + inputChatPhotoAnimation.Animation = fieldAnimation + + return nil +} + +// A sticker on a custom background +type InputChatPhotoSticker struct { + meta + // Information about the sticker + Sticker *ChatPhotoSticker `json:"sticker"` +} + +func (entity *InputChatPhotoSticker) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputChatPhotoSticker + + return json.Marshal((*stub)(entity)) +} + +func (*InputChatPhotoSticker) GetClass() string { + return ClassInputChatPhoto +} + +func (*InputChatPhotoSticker) GetType() string { + return TypeInputChatPhotoSticker +} + +func (*InputChatPhotoSticker) InputChatPhotoType() string { + return TypeInputChatPhotoSticker +} + +// Describes actions that a user is allowed to take in a chat +type ChatPermissions struct { + meta + // True, if the user can send text messages, contacts, giveaways, giveaway winners, invoices, locations, and venues + CanSendBasicMessages bool `json:"can_send_basic_messages"` + // True, if the user can send music files + CanSendAudios bool `json:"can_send_audios"` + // True, if the user can send documents + CanSendDocuments bool `json:"can_send_documents"` + // True, if the user can send photos + CanSendPhotos bool `json:"can_send_photos"` + // True, if the user can send videos + CanSendVideos bool `json:"can_send_videos"` + // True, if the user can send video notes + CanSendVideoNotes bool `json:"can_send_video_notes"` + // True, if the user can send voice notes + CanSendVoiceNotes bool `json:"can_send_voice_notes"` + // True, if the user can send polls + CanSendPolls bool `json:"can_send_polls"` + // True, if the user can send animations, games, stickers, and dice and use inline bots + CanSendOtherMessages bool `json:"can_send_other_messages"` + // True, if the user may add a web page preview to their messages + 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"` + // True, if the user can create topics + CanCreateTopics bool `json:"can_create_topics"` +} + +func (entity *ChatPermissions) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatPermissions + + return json.Marshal((*stub)(entity)) +} + +func (*ChatPermissions) GetClass() string { + return ClassChatPermissions +} + +func (*ChatPermissions) GetType() string { + return TypeChatPermissions +} + +// Describes rights of the administrator +type ChatAdministratorRights struct { + meta + // True, if the administrator can access the chat event log, get boost list, see hidden supergroup and channel members, report supergroup spam messages 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 or view channel statistics; 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 or view supergroup statistics; 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 create, rename, close, reopen, hide, and unhide forum topics; applicable to forum supergroups only + CanManageTopics bool `json:"can_manage_topics"` + // 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 can create new chat stories, or edit and delete posted stories; applicable to supergroups and channels only + CanPostStories bool `json:"can_post_stories"` + // True, if the administrator can edit stories posted by other users, pin stories and access story archive; applicable to supergroups and channels only + CanEditStories bool `json:"can_edit_stories"` + // True, if the administrator can delete stories posted by other users; applicable to supergroups and channels only + CanDeleteStories bool `json:"can_delete_stories"` + // 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"` +} + +func (entity *ChatAdministratorRights) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatAdministratorRights + + return json.Marshal((*stub)(entity)) +} + +func (*ChatAdministratorRights) GetClass() string { + return ClassChatAdministratorRights +} + +func (*ChatAdministratorRights) GetType() string { + return TypeChatAdministratorRights +} + +// Describes an option for buying Telegram Premium to a user +type PremiumPaymentOption struct { + meta + // ISO 4217 currency code for Telegram Premium subscription payment + Currency string `json:"currency"` + // The amount to pay, in the smallest units of the currency + Amount int64 `json:"amount"` + // The discount associated with this option, as a percentage + DiscountPercentage int32 `json:"discount_percentage"` + // Number of months the Telegram Premium subscription will be active + MonthCount int32 `json:"month_count"` + // Identifier of the store product associated with the option + StoreProductId string `json:"store_product_id"` + // An internal link to be opened for buying Telegram Premium to the user if store payment isn't possible; may be null if direct payment isn't available + PaymentLink InternalLinkType `json:"payment_link"` +} + +func (entity *PremiumPaymentOption) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumPaymentOption + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumPaymentOption) GetClass() string { + return ClassPremiumPaymentOption +} + +func (*PremiumPaymentOption) GetType() string { + return TypePremiumPaymentOption +} + +func (premiumPaymentOption *PremiumPaymentOption) UnmarshalJSON(data []byte) error { + var tmp struct { + Currency string `json:"currency"` + Amount int64 `json:"amount"` + DiscountPercentage int32 `json:"discount_percentage"` + MonthCount int32 `json:"month_count"` + StoreProductId string `json:"store_product_id"` + PaymentLink json.RawMessage `json:"payment_link"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + premiumPaymentOption.Currency = tmp.Currency + premiumPaymentOption.Amount = tmp.Amount + premiumPaymentOption.DiscountPercentage = tmp.DiscountPercentage + premiumPaymentOption.MonthCount = tmp.MonthCount + premiumPaymentOption.StoreProductId = tmp.StoreProductId + + fieldPaymentLink, _ := UnmarshalInternalLinkType(tmp.PaymentLink) + premiumPaymentOption.PaymentLink = fieldPaymentLink + + return nil +} + +// Describes an option for buying or upgrading Telegram Premium for self +type PremiumStatePaymentOption struct { + meta + // Information about the payment option + PaymentOption *PremiumPaymentOption `json:"payment_option"` + // True, if this is the currently used Telegram Premium subscription option + IsCurrent bool `json:"is_current"` + // True, if the payment option can be used to upgrade the existing Telegram Premium subscription + IsUpgrade bool `json:"is_upgrade"` + // Identifier of the last in-store transaction for the currently used option + LastTransactionId string `json:"last_transaction_id"` +} + +func (entity *PremiumStatePaymentOption) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumStatePaymentOption + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumStatePaymentOption) GetClass() string { + return ClassPremiumStatePaymentOption +} + +func (*PremiumStatePaymentOption) GetType() string { + return TypePremiumStatePaymentOption +} + +// Describes an option for creating Telegram Premium gift codes +type PremiumGiftCodePaymentOption struct { + meta + // ISO 4217 currency code for Telegram Premium gift code payment + Currency string `json:"currency"` + // The amount to pay, in the smallest units of the currency + Amount int64 `json:"amount"` + // Number of users which will be able to activate the gift codes + UserCount int32 `json:"user_count"` + // Number of months the Telegram Premium subscription will be active + MonthCount int32 `json:"month_count"` + // Identifier of the store product associated with the option; may be empty if none + StoreProductId string `json:"store_product_id"` + // Number of times the store product must be paid + StoreProductQuantity int32 `json:"store_product_quantity"` +} + +func (entity *PremiumGiftCodePaymentOption) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumGiftCodePaymentOption + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumGiftCodePaymentOption) GetClass() string { + return ClassPremiumGiftCodePaymentOption +} + +func (*PremiumGiftCodePaymentOption) GetType() string { + return TypePremiumGiftCodePaymentOption +} + +// Contains a list of options for creating Telegram Premium gift codes +type PremiumGiftCodePaymentOptions struct { + meta + // The list of options + Options []*PremiumGiftCodePaymentOption `json:"options"` +} + +func (entity *PremiumGiftCodePaymentOptions) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumGiftCodePaymentOptions + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumGiftCodePaymentOptions) GetClass() string { + return ClassPremiumGiftCodePaymentOptions +} + +func (*PremiumGiftCodePaymentOptions) GetType() string { + return TypePremiumGiftCodePaymentOptions +} + +// Contains information about a Telegram Premium gift code +type PremiumGiftCodeInfo struct { + meta + // Identifier of a chat or a user that created the gift code; may be null if unknown. If null and the code is from messagePremiumGiftCode message, then creator_id from the message can be used + CreatorId MessageSender `json:"creator_id"` + // Point in time (Unix timestamp) when the code was created + CreationDate int32 `json:"creation_date"` + // True, if the gift code was created for a giveaway + IsFromGiveaway bool `json:"is_from_giveaway"` + // Identifier of the corresponding giveaway message in the creator_id chat; can be 0 or an identifier of a deleted message + GiveawayMessageId int64 `json:"giveaway_message_id"` + // Number of months the Telegram Premium subscription will be active after code activation + MonthCount int32 `json:"month_count"` + // Identifier of a user for which the code was created; 0 if none + UserId int64 `json:"user_id"` + // Point in time (Unix timestamp) when the code was activated; 0 if none + UseDate int32 `json:"use_date"` +} + +func (entity *PremiumGiftCodeInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumGiftCodeInfo + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumGiftCodeInfo) GetClass() string { + return ClassPremiumGiftCodeInfo +} + +func (*PremiumGiftCodeInfo) GetType() string { + return TypePremiumGiftCodeInfo +} + +func (premiumGiftCodeInfo *PremiumGiftCodeInfo) UnmarshalJSON(data []byte) error { + var tmp struct { + CreatorId json.RawMessage `json:"creator_id"` + CreationDate int32 `json:"creation_date"` + IsFromGiveaway bool `json:"is_from_giveaway"` + GiveawayMessageId int64 `json:"giveaway_message_id"` + MonthCount int32 `json:"month_count"` + UserId int64 `json:"user_id"` + UseDate int32 `json:"use_date"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + premiumGiftCodeInfo.CreationDate = tmp.CreationDate + premiumGiftCodeInfo.IsFromGiveaway = tmp.IsFromGiveaway + premiumGiftCodeInfo.GiveawayMessageId = tmp.GiveawayMessageId + premiumGiftCodeInfo.MonthCount = tmp.MonthCount + premiumGiftCodeInfo.UserId = tmp.UserId + premiumGiftCodeInfo.UseDate = tmp.UseDate + + fieldCreatorId, _ := UnmarshalMessageSender(tmp.CreatorId) + premiumGiftCodeInfo.CreatorId = fieldCreatorId + + return nil +} + +// The user is eligible for the giveaway +type PremiumGiveawayParticipantStatusEligible struct{ + meta +} + +func (entity *PremiumGiveawayParticipantStatusEligible) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumGiveawayParticipantStatusEligible + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumGiveawayParticipantStatusEligible) GetClass() string { + return ClassPremiumGiveawayParticipantStatus +} + +func (*PremiumGiveawayParticipantStatusEligible) GetType() string { + return TypePremiumGiveawayParticipantStatusEligible +} + +func (*PremiumGiveawayParticipantStatusEligible) PremiumGiveawayParticipantStatusType() string { + return TypePremiumGiveawayParticipantStatusEligible +} + +// The user participates in the giveaway +type PremiumGiveawayParticipantStatusParticipating struct{ + meta +} + +func (entity *PremiumGiveawayParticipantStatusParticipating) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumGiveawayParticipantStatusParticipating + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumGiveawayParticipantStatusParticipating) GetClass() string { + return ClassPremiumGiveawayParticipantStatus +} + +func (*PremiumGiveawayParticipantStatusParticipating) GetType() string { + return TypePremiumGiveawayParticipantStatusParticipating +} + +func (*PremiumGiveawayParticipantStatusParticipating) PremiumGiveawayParticipantStatusType() string { + return TypePremiumGiveawayParticipantStatusParticipating +} + +// The user can't participate in the giveaway, because they have already been member of the chat +type PremiumGiveawayParticipantStatusAlreadyWasMember struct { + meta + // Point in time (Unix timestamp) when the user joined the chat + JoinedChatDate int32 `json:"joined_chat_date"` +} + +func (entity *PremiumGiveawayParticipantStatusAlreadyWasMember) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumGiveawayParticipantStatusAlreadyWasMember + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumGiveawayParticipantStatusAlreadyWasMember) GetClass() string { + return ClassPremiumGiveawayParticipantStatus +} + +func (*PremiumGiveawayParticipantStatusAlreadyWasMember) GetType() string { + return TypePremiumGiveawayParticipantStatusAlreadyWasMember +} + +func (*PremiumGiveawayParticipantStatusAlreadyWasMember) PremiumGiveawayParticipantStatusType() string { + return TypePremiumGiveawayParticipantStatusAlreadyWasMember +} + +// The user can't participate in the giveaway, because they are an administrator in one of the chats that created the giveaway +type PremiumGiveawayParticipantStatusAdministrator struct { + meta + // Identifier of the chat administered by the user + ChatId int64 `json:"chat_id"` +} + +func (entity *PremiumGiveawayParticipantStatusAdministrator) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumGiveawayParticipantStatusAdministrator + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumGiveawayParticipantStatusAdministrator) GetClass() string { + return ClassPremiumGiveawayParticipantStatus +} + +func (*PremiumGiveawayParticipantStatusAdministrator) GetType() string { + return TypePremiumGiveawayParticipantStatusAdministrator +} + +func (*PremiumGiveawayParticipantStatusAdministrator) PremiumGiveawayParticipantStatusType() string { + return TypePremiumGiveawayParticipantStatusAdministrator +} + +// The user can't participate in the giveaway, because they phone number is from a disallowed country +type PremiumGiveawayParticipantStatusDisallowedCountry struct { + meta + // A two-letter ISO 3166-1 alpha-2 country code of the user's country + UserCountryCode string `json:"user_country_code"` +} + +func (entity *PremiumGiveawayParticipantStatusDisallowedCountry) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumGiveawayParticipantStatusDisallowedCountry + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumGiveawayParticipantStatusDisallowedCountry) GetClass() string { + return ClassPremiumGiveawayParticipantStatus +} + +func (*PremiumGiveawayParticipantStatusDisallowedCountry) GetType() string { + return TypePremiumGiveawayParticipantStatusDisallowedCountry +} + +func (*PremiumGiveawayParticipantStatusDisallowedCountry) PremiumGiveawayParticipantStatusType() string { + return TypePremiumGiveawayParticipantStatusDisallowedCountry +} + +// Describes an ongoing giveaway +type PremiumGiveawayInfoOngoing struct { + meta + // Point in time (Unix timestamp) when the giveaway was created + CreationDate int32 `json:"creation_date"` + // Status of the current user in the giveaway + Status PremiumGiveawayParticipantStatus `json:"status"` + // True, if the giveaway has ended and results are being prepared + IsEnded bool `json:"is_ended"` +} + +func (entity *PremiumGiveawayInfoOngoing) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumGiveawayInfoOngoing + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumGiveawayInfoOngoing) GetClass() string { + return ClassPremiumGiveawayInfo +} + +func (*PremiumGiveawayInfoOngoing) GetType() string { + return TypePremiumGiveawayInfoOngoing +} + +func (*PremiumGiveawayInfoOngoing) PremiumGiveawayInfoType() string { + return TypePremiumGiveawayInfoOngoing +} + +func (premiumGiveawayInfoOngoing *PremiumGiveawayInfoOngoing) UnmarshalJSON(data []byte) error { + var tmp struct { + CreationDate int32 `json:"creation_date"` + Status json.RawMessage `json:"status"` + IsEnded bool `json:"is_ended"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + premiumGiveawayInfoOngoing.CreationDate = tmp.CreationDate + premiumGiveawayInfoOngoing.IsEnded = tmp.IsEnded + + fieldStatus, _ := UnmarshalPremiumGiveawayParticipantStatus(tmp.Status) + premiumGiveawayInfoOngoing.Status = fieldStatus + + return nil +} + +// Describes a completed giveaway +type PremiumGiveawayInfoCompleted struct { + meta + // Point in time (Unix timestamp) when the giveaway was created + CreationDate int32 `json:"creation_date"` + // Point in time (Unix timestamp) when the winners were selected. May be bigger than winners selection date specified in parameters of the giveaway + ActualWinnersSelectionDate int32 `json:"actual_winners_selection_date"` + // True, if the giveaway was canceled and was fully refunded + WasRefunded bool `json:"was_refunded"` + // Number of winners in the giveaway + WinnerCount int32 `json:"winner_count"` + // Number of winners, which activated their gift codes + ActivationCount int32 `json:"activation_count"` + // Telegram Premium gift code that was received by the current user; empty if the user isn't a winner in the giveaway + GiftCode string `json:"gift_code"` +} + +func (entity *PremiumGiveawayInfoCompleted) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumGiveawayInfoCompleted + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumGiveawayInfoCompleted) GetClass() string { + return ClassPremiumGiveawayInfo +} + +func (*PremiumGiveawayInfoCompleted) GetType() string { + return TypePremiumGiveawayInfoCompleted +} + +func (*PremiumGiveawayInfoCompleted) PremiumGiveawayInfoType() string { + return TypePremiumGiveawayInfoCompleted +} + +// Contains information about supported accent color for user/chat name, background of empty chat photo, replies to messages and link previews +type AccentColor struct { + meta + // Accent color identifier + Id int32 `json:"id"` + // Identifier of a built-in color to use in places, where only one color is needed; 0-6 + BuiltInAccentColorId int32 `json:"built_in_accent_color_id"` + // The list of 1-3 colors in RGB format, describing the accent color, as expected to be shown in light themes + LightThemeColors []int32 `json:"light_theme_colors"` + // The list of 1-3 colors in RGB format, describing the accent color, as expected to be shown in dark themes + DarkThemeColors []int32 `json:"dark_theme_colors"` + // The minimum chat boost level required to use the color in a channel chat + MinChannelChatBoostLevel int32 `json:"min_channel_chat_boost_level"` +} + +func (entity *AccentColor) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub AccentColor + + return json.Marshal((*stub)(entity)) +} + +func (*AccentColor) GetClass() string { + return ClassAccentColor +} + +func (*AccentColor) GetType() string { + return TypeAccentColor +} + +// Contains information about supported accent colors for user profile photo background in RGB format +type ProfileAccentColors struct { + meta + // The list of 1-2 colors in RGB format, describing the colors, as expected to be shown in the color palette settings + PaletteColors []int32 `json:"palette_colors"` + // The list of 1-2 colors in RGB format, describing the colors, as expected to be used for the profile photo background + BackgroundColors []int32 `json:"background_colors"` + // The list of 2 colors in RGB format, describing the colors of the gradient to be used for the unread active story indicator around profile photo + StoryColors []int32 `json:"story_colors"` +} + +func (entity *ProfileAccentColors) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ProfileAccentColors + + return json.Marshal((*stub)(entity)) +} + +func (*ProfileAccentColors) GetClass() string { + return ClassProfileAccentColors +} + +func (*ProfileAccentColors) GetType() string { + return TypeProfileAccentColors +} + +// Contains information about supported accent color for user profile photo background +type ProfileAccentColor struct { + meta + // Profile accent color identifier + Id int32 `json:"id"` + // Accent colors expected to be used in light themes + LightThemeColors *ProfileAccentColors `json:"light_theme_colors"` + // Accent colors expected to be used in dark themes + DarkThemeColors *ProfileAccentColors `json:"dark_theme_colors"` + // The minimum chat boost level required to use the color in a supergroup chat + MinSupergroupChatBoostLevel int32 `json:"min_supergroup_chat_boost_level"` + // The minimum chat boost level required to use the color in a channel chat + MinChannelChatBoostLevel int32 `json:"min_channel_chat_boost_level"` +} + +func (entity *ProfileAccentColor) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ProfileAccentColor + + return json.Marshal((*stub)(entity)) +} + +func (*ProfileAccentColor) GetClass() string { + return ClassProfileAccentColor +} + +func (*ProfileAccentColor) GetType() string { + return TypeProfileAccentColor +} + +// Describes a custom emoji to be shown instead of the Telegram Premium badge +type EmojiStatus struct { + meta + // Identifier of the custom emoji in stickerFormatTgs format + CustomEmojiId JsonInt64 `json:"custom_emoji_id"` + // Point in time (Unix timestamp) when the status will expire; 0 if never + ExpirationDate int32 `json:"expiration_date"` +} + +func (entity *EmojiStatus) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub EmojiStatus + + return json.Marshal((*stub)(entity)) +} + +func (*EmojiStatus) GetClass() string { + return ClassEmojiStatus +} + +func (*EmojiStatus) GetType() string { + return TypeEmojiStatus +} + +// Contains a list of custom emoji identifiers for emoji statuses +type EmojiStatuses struct { + meta + // The list of custom emoji identifiers + CustomEmojiIds []JsonInt64 `json:"custom_emoji_ids"` +} + +func (entity *EmojiStatuses) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub EmojiStatuses + + return json.Marshal((*stub)(entity)) +} + +func (*EmojiStatuses) GetClass() string { + return ClassEmojiStatuses +} + +func (*EmojiStatuses) GetType() string { + return TypeEmojiStatuses +} + +// Describes usernames assigned to a user, a supergroup, or a channel +type Usernames struct { + meta + // List of active usernames; the first one must be shown as the primary username. The order of active usernames can be changed with reorderActiveUsernames, reorderBotActiveUsernames or reorderSupergroupActiveUsernames + ActiveUsernames []string `json:"active_usernames"` + // List of currently disabled usernames; the username can be activated with toggleUsernameIsActive, toggleBotUsernameIsActive, or toggleSupergroupUsernameIsActive + DisabledUsernames []string `json:"disabled_usernames"` + // The active username, which can be changed with setUsername or setSupergroupUsername. Information about other active usernames can be received using getCollectibleItemInfo + EditableUsername string `json:"editable_username"` +} + +func (entity *Usernames) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub Usernames + + return json.Marshal((*stub)(entity)) +} + +func (*Usernames) GetClass() string { + return ClassUsernames +} + +func (*Usernames) GetType() string { + return TypeUsernames +} + +// Represents a user +type User struct { + meta + // User identifier + Id int64 `json:"id"` + // First name of the user + FirstName string `json:"first_name"` + // Last name of the user + LastName string `json:"last_name"` + // Usernames of the user; may be null + Usernames *Usernames `json:"usernames"` + // 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"` + // Identifier of the accent color for name, and backgrounds of profile photo, reply header, and link preview. For Telegram Premium users only + AccentColorId int32 `json:"accent_color_id"` + // Identifier of a custom emoji to be shown on the reply header and link preview background; 0 if none. For Telegram Premium users only + BackgroundCustomEmojiId JsonInt64 `json:"background_custom_emoji_id"` + // Identifier of the accent color for the user's profile; -1 if none. For Telegram Premium users only + ProfileAccentColorId int32 `json:"profile_accent_color_id"` + // Identifier of a custom emoji to be shown on the background of the user's profile; 0 if none. For Telegram Premium users only + ProfileBackgroundCustomEmojiId JsonInt64 `json:"profile_background_custom_emoji_id"` + // Emoji status to be shown instead of the default Telegram Premium badge; may be null. For Telegram Premium users only + EmojiStatus *EmojiStatus `json:"emoji_status"` + // 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"` + // The user is a close friend of the current user; implies that the user is a contact + IsCloseFriend bool `json:"is_close_friend"` + // True, if the user is verified + IsVerified bool `json:"is_verified"` + // True, if the user is a Telegram Premium user + IsPremium bool `json:"is_premium"` + // 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"` + // True, if the user has non-expired stories available to the current user + HasActiveStories bool `json:"has_active_stories"` + // True, if the user has unread non-expired stories available to the current user + HasUnreadActiveStories bool `json:"has_unread_active_stories"` + // True, if the user may restrict new chats with non-contacts. Use canSendMessageToUser to check whether the current user can message the user or try to create a chat with them + RestrictsNewChats bool `json:"restricts_new_chats"` + // 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 + 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"` + // True, if the user added the current bot to attachment menu; only available to bots + AddedToAttachmentMenu bool `json:"added_to_attachment_menu"` +} + +func (entity *User) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub User + + return json.Marshal((*stub)(entity)) +} + +func (*User) GetClass() string { + return ClassUser +} + +func (*User) GetType() string { + return TypeUser +} + +func (user *User) UnmarshalJSON(data []byte) error { + var tmp struct { + Id int64 `json:"id"` + FirstName string `json:"first_name"` + LastName string `json:"last_name"` + Usernames *Usernames `json:"usernames"` + PhoneNumber string `json:"phone_number"` + Status json.RawMessage `json:"status"` + ProfilePhoto *ProfilePhoto `json:"profile_photo"` + AccentColorId int32 `json:"accent_color_id"` + BackgroundCustomEmojiId JsonInt64 `json:"background_custom_emoji_id"` + ProfileAccentColorId int32 `json:"profile_accent_color_id"` + ProfileBackgroundCustomEmojiId JsonInt64 `json:"profile_background_custom_emoji_id"` + EmojiStatus *EmojiStatus `json:"emoji_status"` + IsContact bool `json:"is_contact"` + IsMutualContact bool `json:"is_mutual_contact"` + IsCloseFriend bool `json:"is_close_friend"` + IsVerified bool `json:"is_verified"` + IsPremium bool `json:"is_premium"` + IsSupport bool `json:"is_support"` + RestrictionReason string `json:"restriction_reason"` + IsScam bool `json:"is_scam"` + IsFake bool `json:"is_fake"` + HasActiveStories bool `json:"has_active_stories"` + HasUnreadActiveStories bool `json:"has_unread_active_stories"` + RestrictsNewChats bool `json:"restricts_new_chats"` + HaveAccess bool `json:"have_access"` + Type json.RawMessage `json:"type"` + LanguageCode string `json:"language_code"` + AddedToAttachmentMenu bool `json:"added_to_attachment_menu"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + user.Id = tmp.Id + user.FirstName = tmp.FirstName + user.LastName = tmp.LastName + user.Usernames = tmp.Usernames + user.PhoneNumber = tmp.PhoneNumber + user.ProfilePhoto = tmp.ProfilePhoto + user.AccentColorId = tmp.AccentColorId + user.BackgroundCustomEmojiId = tmp.BackgroundCustomEmojiId + user.ProfileAccentColorId = tmp.ProfileAccentColorId + user.ProfileBackgroundCustomEmojiId = tmp.ProfileBackgroundCustomEmojiId + user.EmojiStatus = tmp.EmojiStatus + user.IsContact = tmp.IsContact + user.IsMutualContact = tmp.IsMutualContact + user.IsCloseFriend = tmp.IsCloseFriend + user.IsVerified = tmp.IsVerified + user.IsPremium = tmp.IsPremium + user.IsSupport = tmp.IsSupport + user.RestrictionReason = tmp.RestrictionReason + user.IsScam = tmp.IsScam + user.IsFake = tmp.IsFake + user.HasActiveStories = tmp.HasActiveStories + user.HasUnreadActiveStories = tmp.HasUnreadActiveStories + user.RestrictsNewChats = tmp.RestrictsNewChats + user.HaveAccess = tmp.HaveAccess + user.LanguageCode = tmp.LanguageCode + user.AddedToAttachmentMenu = tmp.AddedToAttachmentMenu + + fieldStatus, _ := UnmarshalUserStatus(tmp.Status) + user.Status = fieldStatus + + fieldType, _ := UnmarshalUserType(tmp.Type) + user.Type = fieldType + + return nil +} + +// Contains information about a bot +type BotInfo struct { + meta + // The text that is shown on the bot's profile page and is sent together with the link when users share the bot + ShortDescription string `json:"short_description"` + // The text shown in the chat with the bot if the chat is empty + Description string `json:"description"` + // Photo shown in the chat with the bot if the chat is empty; may be null + Photo *Photo `json:"photo"` + // Animation shown in the chat with the bot if the chat is empty; may be null + Animation *Animation `json:"animation"` + // Information about a button to show instead of the bot commands menu button; may be null if ordinary bot commands menu must be shown + MenuButton *BotMenuButton `json:"menu_button"` + // List of the bot commands + Commands []*BotCommand `json:"commands"` + // Default administrator rights for adding the bot to basic group and supergroup chats; may be null + DefaultGroupAdministratorRights *ChatAdministratorRights `json:"default_group_administrator_rights"` + // Default administrator rights for adding the bot to channels; may be null + DefaultChannelAdministratorRights *ChatAdministratorRights `json:"default_channel_administrator_rights"` + // The internal link, which can be used to edit bot commands; may be null + EditCommandsLink InternalLinkType `json:"edit_commands_link"` + // The internal link, which can be used to edit bot description; may be null + EditDescriptionLink InternalLinkType `json:"edit_description_link"` + // The internal link, which can be used to edit the photo or animation shown in the chat with the bot if the chat is empty; may be null + EditDescriptionMediaLink InternalLinkType `json:"edit_description_media_link"` + // The internal link, which can be used to edit bot settings; may be null + EditSettingsLink InternalLinkType `json:"edit_settings_link"` +} + +func (entity *BotInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BotInfo + + return json.Marshal((*stub)(entity)) +} + +func (*BotInfo) GetClass() string { + return ClassBotInfo +} + +func (*BotInfo) GetType() string { + return TypeBotInfo +} + +func (botInfo *BotInfo) UnmarshalJSON(data []byte) error { + var tmp struct { + ShortDescription string `json:"short_description"` + Description string `json:"description"` + Photo *Photo `json:"photo"` + Animation *Animation `json:"animation"` + MenuButton *BotMenuButton `json:"menu_button"` + Commands []*BotCommand `json:"commands"` + DefaultGroupAdministratorRights *ChatAdministratorRights `json:"default_group_administrator_rights"` + DefaultChannelAdministratorRights *ChatAdministratorRights `json:"default_channel_administrator_rights"` + EditCommandsLink json.RawMessage `json:"edit_commands_link"` + EditDescriptionLink json.RawMessage `json:"edit_description_link"` + EditDescriptionMediaLink json.RawMessage `json:"edit_description_media_link"` + EditSettingsLink json.RawMessage `json:"edit_settings_link"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + botInfo.ShortDescription = tmp.ShortDescription + botInfo.Description = tmp.Description + botInfo.Photo = tmp.Photo + botInfo.Animation = tmp.Animation + botInfo.MenuButton = tmp.MenuButton + botInfo.Commands = tmp.Commands + botInfo.DefaultGroupAdministratorRights = tmp.DefaultGroupAdministratorRights + botInfo.DefaultChannelAdministratorRights = tmp.DefaultChannelAdministratorRights + + fieldEditCommandsLink, _ := UnmarshalInternalLinkType(tmp.EditCommandsLink) + botInfo.EditCommandsLink = fieldEditCommandsLink + + fieldEditDescriptionLink, _ := UnmarshalInternalLinkType(tmp.EditDescriptionLink) + botInfo.EditDescriptionLink = fieldEditDescriptionLink + + fieldEditDescriptionMediaLink, _ := UnmarshalInternalLinkType(tmp.EditDescriptionMediaLink) + botInfo.EditDescriptionMediaLink = fieldEditDescriptionMediaLink + + fieldEditSettingsLink, _ := UnmarshalInternalLinkType(tmp.EditSettingsLink) + botInfo.EditSettingsLink = fieldEditSettingsLink + + return nil +} + +// Contains full information about a user +type UserFullInfo struct { + meta + // User profile photo set by the current user for the contact; may be null. If null and user.profile_photo is null, then the photo is empty; otherwise, it is unknown. If non-null, then it is the same photo as in user.profile_photo and chat.photo. This photo isn't returned in the list of user photos + PersonalPhoto *ChatPhoto `json:"personal_photo"` + // User profile photo; may be null. If null and user.profile_photo is null, then the photo is empty; otherwise, it is unknown. If non-null and personal_photo is null, then it is the same photo as in user.profile_photo and chat.photo + Photo *ChatPhoto `json:"photo"` + // User profile photo visible if the main photo is hidden by privacy settings; may be null. If null and user.profile_photo is null, then the photo is empty; otherwise, it is unknown. If non-null and both photo and personal_photo are null, then it is the same photo as in user.profile_photo and chat.photo. This photo isn't returned in the list of user photos + PublicPhoto *ChatPhoto `json:"public_photo"` + // Block list to which the user is added; may be null if none + BlockList BlockList `json:"block_list"` + // 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 voice and video notes can't be sent or forwarded to the user + HasRestrictedVoiceAndVideoNoteMessages bool `json:"has_restricted_voice_and_video_note_messages"` + // True, if the user has pinned stories + HasPinnedStories bool `json:"has_pinned_stories"` + // 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"` + // True, if the user set chat background for both chat users and it wasn't reverted yet + SetChatBackground bool `json:"set_chat_background"` + // A short user bio; may be null for bots + Bio *FormattedText `json:"bio"` + // Birthdate of the user; may be null if unknown + Birthdate *Birthdate `json:"birthdate"` + // Identifier of the personal chat of the user; 0 if none + PersonalChatId int64 `json:"personal_chat_id"` + // The list of available options for gifting Telegram Premium to the user + PremiumGiftOptions []*PremiumPaymentOption `json:"premium_gift_options"` + // 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"` + // Information about business settings for Telegram Business accounts; may be null if none + BusinessInfo *BusinessInfo `json:"business_info"` + // For bots, information about the bot; may be null if the user isn't a bot + BotInfo *BotInfo `json:"bot_info"` +} + +func (entity *UserFullInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UserFullInfo + + return json.Marshal((*stub)(entity)) +} + +func (*UserFullInfo) GetClass() string { + return ClassUserFullInfo +} + +func (*UserFullInfo) GetType() string { + return TypeUserFullInfo +} + +func (userFullInfo *UserFullInfo) UnmarshalJSON(data []byte) error { + var tmp struct { + PersonalPhoto *ChatPhoto `json:"personal_photo"` + Photo *ChatPhoto `json:"photo"` + PublicPhoto *ChatPhoto `json:"public_photo"` + BlockList json.RawMessage `json:"block_list"` + CanBeCalled bool `json:"can_be_called"` + SupportsVideoCalls bool `json:"supports_video_calls"` + HasPrivateCalls bool `json:"has_private_calls"` + HasPrivateForwards bool `json:"has_private_forwards"` + HasRestrictedVoiceAndVideoNoteMessages bool `json:"has_restricted_voice_and_video_note_messages"` + HasPinnedStories bool `json:"has_pinned_stories"` + NeedPhoneNumberPrivacyException bool `json:"need_phone_number_privacy_exception"` + SetChatBackground bool `json:"set_chat_background"` + Bio *FormattedText `json:"bio"` + Birthdate *Birthdate `json:"birthdate"` + PersonalChatId int64 `json:"personal_chat_id"` + PremiumGiftOptions []*PremiumPaymentOption `json:"premium_gift_options"` + GroupInCommonCount int32 `json:"group_in_common_count"` + BusinessInfo *BusinessInfo `json:"business_info"` + BotInfo *BotInfo `json:"bot_info"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + userFullInfo.PersonalPhoto = tmp.PersonalPhoto + userFullInfo.Photo = tmp.Photo + userFullInfo.PublicPhoto = tmp.PublicPhoto + userFullInfo.CanBeCalled = tmp.CanBeCalled + userFullInfo.SupportsVideoCalls = tmp.SupportsVideoCalls + userFullInfo.HasPrivateCalls = tmp.HasPrivateCalls + userFullInfo.HasPrivateForwards = tmp.HasPrivateForwards + userFullInfo.HasRestrictedVoiceAndVideoNoteMessages = tmp.HasRestrictedVoiceAndVideoNoteMessages + userFullInfo.HasPinnedStories = tmp.HasPinnedStories + userFullInfo.NeedPhoneNumberPrivacyException = tmp.NeedPhoneNumberPrivacyException + userFullInfo.SetChatBackground = tmp.SetChatBackground + userFullInfo.Bio = tmp.Bio + userFullInfo.Birthdate = tmp.Birthdate + userFullInfo.PersonalChatId = tmp.PersonalChatId + userFullInfo.PremiumGiftOptions = tmp.PremiumGiftOptions + userFullInfo.GroupInCommonCount = tmp.GroupInCommonCount + userFullInfo.BusinessInfo = tmp.BusinessInfo + userFullInfo.BotInfo = tmp.BotInfo + + fieldBlockList, _ := UnmarshalBlockList(tmp.BlockList) + userFullInfo.BlockList = fieldBlockList + + return nil +} + +// Represents a list of users +type Users struct { + meta + // Approximate total number of users found + TotalCount int32 `json:"total_count"` + // A list of user identifiers + UserIds []int64 `json:"user_ids"` +} + +func (entity *Users) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub Users + + return json.Marshal((*stub)(entity)) +} + +func (*Users) GetClass() string { + return ClassUsers +} + +func (*Users) GetType() string { + return TypeUsers +} + +// Contains information about a chat administrator +type ChatAdministrator struct { + 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"` +} + +func (entity *ChatAdministrator) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatAdministrator + + return json.Marshal((*stub)(entity)) +} + +func (*ChatAdministrator) GetClass() string { + return ClassChatAdministrator +} + +func (*ChatAdministrator) GetType() string { + return TypeChatAdministrator +} + +// Represents a list of chat administrators +type ChatAdministrators struct { + meta + // A list of chat administrators + Administrators []*ChatAdministrator `json:"administrators"` +} + +func (entity *ChatAdministrators) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatAdministrators + + return json.Marshal((*stub)(entity)) +} + +func (*ChatAdministrators) GetClass() string { + return ClassChatAdministrators +} + +func (*ChatAdministrators) GetType() string { + return TypeChatAdministrators +} + +// The user is the owner of the chat and has all the administrator privileges +type ChatMemberStatusCreator struct { + 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"` +} + +func (entity *ChatMemberStatusCreator) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatMemberStatusCreator + + return json.Marshal((*stub)(entity)) +} + +func (*ChatMemberStatusCreator) GetClass() string { + return ClassChatMemberStatus +} + +func (*ChatMemberStatusCreator) GetType() string { + return TypeChatMemberStatusCreator +} + +func (*ChatMemberStatusCreator) ChatMemberStatusType() string { + return TypeChatMemberStatusCreator +} + +// 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 +type ChatMemberStatusAdministrator struct { + 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"` + // Rights of the administrator + Rights *ChatAdministratorRights `json:"rights"` +} + +func (entity *ChatMemberStatusAdministrator) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatMemberStatusAdministrator + + return json.Marshal((*stub)(entity)) +} + +func (*ChatMemberStatusAdministrator) GetClass() string { + return ClassChatMemberStatus +} + +func (*ChatMemberStatusAdministrator) GetType() string { + return TypeChatMemberStatusAdministrator +} + +func (*ChatMemberStatusAdministrator) ChatMemberStatusType() string { + return TypeChatMemberStatusAdministrator +} + +// The user is a member of the chat, without any additional privileges or restrictions +type ChatMemberStatusMember struct{ + meta +} + +func (entity *ChatMemberStatusMember) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatMemberStatusMember + + return json.Marshal((*stub)(entity)) +} + +func (*ChatMemberStatusMember) GetClass() string { + return ClassChatMemberStatus +} + +func (*ChatMemberStatusMember) GetType() string { + return TypeChatMemberStatusMember +} + +func (*ChatMemberStatusMember) ChatMemberStatusType() string { + return TypeChatMemberStatusMember +} + +// The user is under certain restrictions in the chat. Not supported in basic groups and channels +type ChatMemberStatusRestricted struct { + 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"` +} + +func (entity *ChatMemberStatusRestricted) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatMemberStatusRestricted + + return json.Marshal((*stub)(entity)) +} + +func (*ChatMemberStatusRestricted) GetClass() string { + return ClassChatMemberStatus +} + +func (*ChatMemberStatusRestricted) GetType() string { + return TypeChatMemberStatusRestricted +} + +func (*ChatMemberStatusRestricted) ChatMemberStatusType() string { + return TypeChatMemberStatusRestricted +} + +// The user or the chat is not a chat member +type ChatMemberStatusLeft struct{ + meta +} + +func (entity *ChatMemberStatusLeft) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatMemberStatusLeft + + return json.Marshal((*stub)(entity)) +} + +func (*ChatMemberStatusLeft) GetClass() string { + return ClassChatMemberStatus +} + +func (*ChatMemberStatusLeft) GetType() string { + return TypeChatMemberStatusLeft +} + +func (*ChatMemberStatusLeft) ChatMemberStatusType() string { + return TypeChatMemberStatusLeft +} + +// 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 +type ChatMemberStatusBanned struct { + 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"` +} + +func (entity *ChatMemberStatusBanned) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatMemberStatusBanned + + return json.Marshal((*stub)(entity)) +} + +func (*ChatMemberStatusBanned) GetClass() string { + return ClassChatMemberStatus +} + +func (*ChatMemberStatusBanned) GetType() string { + return TypeChatMemberStatusBanned +} + +func (*ChatMemberStatusBanned) ChatMemberStatusType() string { + return TypeChatMemberStatusBanned +} + +// Describes a user or a chat as a member of another chat +type ChatMember struct { + 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/was promoted/was banned in the chat + JoinedChatDate int32 `json:"joined_chat_date"` + // Status of the member in the chat + Status ChatMemberStatus `json:"status"` +} + +func (entity *ChatMember) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatMember + + return json.Marshal((*stub)(entity)) +} + +func (*ChatMember) GetClass() string { + return ClassChatMember +} + +func (*ChatMember) GetType() string { + return TypeChatMember +} + +func (chatMember *ChatMember) UnmarshalJSON(data []byte) error { + 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"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + chatMember.InviterUserId = tmp.InviterUserId + chatMember.JoinedChatDate = tmp.JoinedChatDate + + fieldMemberId, _ := UnmarshalMessageSender(tmp.MemberId) + chatMember.MemberId = fieldMemberId + + fieldStatus, _ := UnmarshalChatMemberStatus(tmp.Status) + chatMember.Status = fieldStatus + + return nil +} + +// Contains a list of chat members +type ChatMembers struct { + meta + // Approximate total number of chat members found + TotalCount int32 `json:"total_count"` + // A list of chat members + Members []*ChatMember `json:"members"` +} + +func (entity *ChatMembers) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatMembers + + return json.Marshal((*stub)(entity)) +} + +func (*ChatMembers) GetClass() string { + return ClassChatMembers +} + +func (*ChatMembers) GetType() string { + return TypeChatMembers +} + +// Returns contacts of the user +type ChatMembersFilterContacts struct{ + meta +} + +func (entity *ChatMembersFilterContacts) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatMembersFilterContacts + + return json.Marshal((*stub)(entity)) +} + +func (*ChatMembersFilterContacts) GetClass() string { + return ClassChatMembersFilter +} + +func (*ChatMembersFilterContacts) GetType() string { + return TypeChatMembersFilterContacts +} + +func (*ChatMembersFilterContacts) ChatMembersFilterType() string { + return TypeChatMembersFilterContacts +} + +// Returns the owner and administrators +type ChatMembersFilterAdministrators struct{ + meta +} + +func (entity *ChatMembersFilterAdministrators) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatMembersFilterAdministrators + + return json.Marshal((*stub)(entity)) +} + +func (*ChatMembersFilterAdministrators) GetClass() string { + return ClassChatMembersFilter +} + +func (*ChatMembersFilterAdministrators) GetType() string { + return TypeChatMembersFilterAdministrators +} + +func (*ChatMembersFilterAdministrators) ChatMembersFilterType() string { + return TypeChatMembersFilterAdministrators +} + +// Returns all chat members, including restricted chat members +type ChatMembersFilterMembers struct{ + meta +} + +func (entity *ChatMembersFilterMembers) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatMembersFilterMembers + + return json.Marshal((*stub)(entity)) +} + +func (*ChatMembersFilterMembers) GetClass() string { + return ClassChatMembersFilter +} + +func (*ChatMembersFilterMembers) GetType() string { + return TypeChatMembersFilterMembers +} + +func (*ChatMembersFilterMembers) ChatMembersFilterType() string { + return TypeChatMembersFilterMembers +} + +// Returns users which can be mentioned in the chat +type ChatMembersFilterMention struct { + meta + // If non-zero, the identifier of the current message thread + MessageThreadId int64 `json:"message_thread_id"` +} + +func (entity *ChatMembersFilterMention) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatMembersFilterMention + + return json.Marshal((*stub)(entity)) +} + +func (*ChatMembersFilterMention) GetClass() string { + return ClassChatMembersFilter +} + +func (*ChatMembersFilterMention) GetType() string { + return TypeChatMembersFilterMention +} + +func (*ChatMembersFilterMention) ChatMembersFilterType() string { + return TypeChatMembersFilterMention +} + +// Returns users under certain restrictions in the chat; can be used only by administrators in a supergroup +type ChatMembersFilterRestricted struct{ + meta +} + +func (entity *ChatMembersFilterRestricted) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatMembersFilterRestricted + + return json.Marshal((*stub)(entity)) +} + +func (*ChatMembersFilterRestricted) GetClass() string { + return ClassChatMembersFilter +} + +func (*ChatMembersFilterRestricted) GetType() string { + return TypeChatMembersFilterRestricted +} + +func (*ChatMembersFilterRestricted) ChatMembersFilterType() string { + return TypeChatMembersFilterRestricted +} + +// Returns users banned from the chat; can be used only by administrators in a supergroup or in a channel +type ChatMembersFilterBanned struct{ + meta +} + +func (entity *ChatMembersFilterBanned) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatMembersFilterBanned + + return json.Marshal((*stub)(entity)) +} + +func (*ChatMembersFilterBanned) GetClass() string { + return ClassChatMembersFilter +} + +func (*ChatMembersFilterBanned) GetType() string { + return TypeChatMembersFilterBanned +} + +func (*ChatMembersFilterBanned) ChatMembersFilterType() string { + return TypeChatMembersFilterBanned +} + +// Returns bot members of the chat +type ChatMembersFilterBots struct{ + meta +} + +func (entity *ChatMembersFilterBots) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatMembersFilterBots + + return json.Marshal((*stub)(entity)) +} + +func (*ChatMembersFilterBots) GetClass() string { + return ClassChatMembersFilter +} + +func (*ChatMembersFilterBots) GetType() string { + return TypeChatMembersFilterBots +} + +func (*ChatMembersFilterBots) ChatMembersFilterType() string { + return TypeChatMembersFilterBots +} + +// Returns recently active users in reverse chronological order +type SupergroupMembersFilterRecent struct{ + meta +} + +func (entity *SupergroupMembersFilterRecent) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SupergroupMembersFilterRecent + + return json.Marshal((*stub)(entity)) +} + +func (*SupergroupMembersFilterRecent) GetClass() string { + return ClassSupergroupMembersFilter +} + +func (*SupergroupMembersFilterRecent) GetType() string { + return TypeSupergroupMembersFilterRecent +} + +func (*SupergroupMembersFilterRecent) SupergroupMembersFilterType() string { + return TypeSupergroupMembersFilterRecent +} + +// Returns contacts of the user, which are members of the supergroup or channel +type SupergroupMembersFilterContacts struct { + meta + // Query to search for + Query string `json:"query"` +} + +func (entity *SupergroupMembersFilterContacts) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SupergroupMembersFilterContacts + + return json.Marshal((*stub)(entity)) +} + +func (*SupergroupMembersFilterContacts) GetClass() string { + return ClassSupergroupMembersFilter +} + +func (*SupergroupMembersFilterContacts) GetType() string { + return TypeSupergroupMembersFilterContacts +} + +func (*SupergroupMembersFilterContacts) SupergroupMembersFilterType() string { + return TypeSupergroupMembersFilterContacts +} + +// Returns the owner and administrators +type SupergroupMembersFilterAdministrators struct{ + meta +} + +func (entity *SupergroupMembersFilterAdministrators) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SupergroupMembersFilterAdministrators + + return json.Marshal((*stub)(entity)) +} + +func (*SupergroupMembersFilterAdministrators) GetClass() string { + return ClassSupergroupMembersFilter +} + +func (*SupergroupMembersFilterAdministrators) GetType() string { + return TypeSupergroupMembersFilterAdministrators +} + +func (*SupergroupMembersFilterAdministrators) SupergroupMembersFilterType() string { + return TypeSupergroupMembersFilterAdministrators +} + +// Used to search for supergroup or channel members via a (string) query +type SupergroupMembersFilterSearch struct { + meta + // Query to search for + Query string `json:"query"` +} + +func (entity *SupergroupMembersFilterSearch) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SupergroupMembersFilterSearch + + return json.Marshal((*stub)(entity)) +} + +func (*SupergroupMembersFilterSearch) GetClass() string { + return ClassSupergroupMembersFilter +} + +func (*SupergroupMembersFilterSearch) GetType() string { + return TypeSupergroupMembersFilterSearch +} + +func (*SupergroupMembersFilterSearch) SupergroupMembersFilterType() string { + return TypeSupergroupMembersFilterSearch +} + +// Returns restricted supergroup members; can be used only by administrators +type SupergroupMembersFilterRestricted struct { + meta + // Query to search for + Query string `json:"query"` +} + +func (entity *SupergroupMembersFilterRestricted) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SupergroupMembersFilterRestricted + + return json.Marshal((*stub)(entity)) +} + +func (*SupergroupMembersFilterRestricted) GetClass() string { + return ClassSupergroupMembersFilter +} + +func (*SupergroupMembersFilterRestricted) GetType() string { + return TypeSupergroupMembersFilterRestricted +} + +func (*SupergroupMembersFilterRestricted) SupergroupMembersFilterType() string { + return TypeSupergroupMembersFilterRestricted +} + +// Returns users banned from the supergroup or channel; can be used only by administrators +type SupergroupMembersFilterBanned struct { + meta + // Query to search for + Query string `json:"query"` +} + +func (entity *SupergroupMembersFilterBanned) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SupergroupMembersFilterBanned + + return json.Marshal((*stub)(entity)) +} + +func (*SupergroupMembersFilterBanned) GetClass() string { + return ClassSupergroupMembersFilter +} + +func (*SupergroupMembersFilterBanned) GetType() string { + return TypeSupergroupMembersFilterBanned +} + +func (*SupergroupMembersFilterBanned) SupergroupMembersFilterType() string { + return TypeSupergroupMembersFilterBanned +} + +// Returns users which can be mentioned in the supergroup +type SupergroupMembersFilterMention struct { + 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"` +} + +func (entity *SupergroupMembersFilterMention) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SupergroupMembersFilterMention + + return json.Marshal((*stub)(entity)) +} + +func (*SupergroupMembersFilterMention) GetClass() string { + return ClassSupergroupMembersFilter +} + +func (*SupergroupMembersFilterMention) GetType() string { + return TypeSupergroupMembersFilterMention +} + +func (*SupergroupMembersFilterMention) SupergroupMembersFilterType() string { + return TypeSupergroupMembersFilterMention +} + +// Returns bot members of the supergroup or channel +type SupergroupMembersFilterBots struct{ + meta +} + +func (entity *SupergroupMembersFilterBots) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SupergroupMembersFilterBots + + return json.Marshal((*stub)(entity)) +} + +func (*SupergroupMembersFilterBots) GetClass() string { + return ClassSupergroupMembersFilter +} + +func (*SupergroupMembersFilterBots) GetType() string { + return TypeSupergroupMembersFilterBots +} + +func (*SupergroupMembersFilterBots) SupergroupMembersFilterType() string { + return TypeSupergroupMembersFilterBots +} + +// Contains a chat invite link +type ChatInviteLink struct { + 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"` +} + +func (entity *ChatInviteLink) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatInviteLink + + return json.Marshal((*stub)(entity)) +} + +func (*ChatInviteLink) GetClass() string { + return ClassChatInviteLink +} + +func (*ChatInviteLink) GetType() string { + return TypeChatInviteLink +} + +// Contains a list of chat invite links +type ChatInviteLinks struct { + meta + // Approximate total number of chat invite links found + TotalCount int32 `json:"total_count"` + // List of invite links + InviteLinks []*ChatInviteLink `json:"invite_links"` +} + +func (entity *ChatInviteLinks) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatInviteLinks + + return json.Marshal((*stub)(entity)) +} + +func (*ChatInviteLinks) GetClass() string { + return ClassChatInviteLinks +} + +func (*ChatInviteLinks) GetType() string { + return TypeChatInviteLinks +} + +// Describes a chat administrator with a number of active and revoked chat invite links +type ChatInviteLinkCount struct { + 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"` +} + +func (entity *ChatInviteLinkCount) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatInviteLinkCount + + return json.Marshal((*stub)(entity)) +} + +func (*ChatInviteLinkCount) GetClass() string { + return ClassChatInviteLinkCount +} + +func (*ChatInviteLinkCount) GetType() string { + return TypeChatInviteLinkCount +} + +// Contains a list of chat invite link counts +type ChatInviteLinkCounts struct { + meta + // List of invite link counts + InviteLinkCounts []*ChatInviteLinkCount `json:"invite_link_counts"` +} + +func (entity *ChatInviteLinkCounts) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatInviteLinkCounts + + return json.Marshal((*stub)(entity)) +} + +func (*ChatInviteLinkCounts) GetClass() string { + return ClassChatInviteLinkCounts +} + +func (*ChatInviteLinkCounts) GetType() string { + return TypeChatInviteLinkCounts +} + +// Describes a chat member joined a chat via an invite link +type ChatInviteLinkMember struct { + 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"` + // True, if the user has joined the chat using an invite link for a chat folder + ViaChatFolderInviteLink bool `json:"via_chat_folder_invite_link"` + // User identifier of the chat administrator, approved user join request + ApproverUserId int64 `json:"approver_user_id"` +} + +func (entity *ChatInviteLinkMember) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatInviteLinkMember + + return json.Marshal((*stub)(entity)) +} + +func (*ChatInviteLinkMember) GetClass() string { + return ClassChatInviteLinkMember +} + +func (*ChatInviteLinkMember) GetType() string { + return TypeChatInviteLinkMember +} + +// Contains a list of chat members joined a chat via an invite link +type ChatInviteLinkMembers struct { + 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"` +} + +func (entity *ChatInviteLinkMembers) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatInviteLinkMembers + + return json.Marshal((*stub)(entity)) +} + +func (*ChatInviteLinkMembers) GetClass() string { + return ClassChatInviteLinkMembers +} + +func (*ChatInviteLinkMembers) GetType() string { + return TypeChatInviteLinkMembers +} + +// The link is an invite link for a basic group +type InviteLinkChatTypeBasicGroup struct{ + meta +} + +func (entity *InviteLinkChatTypeBasicGroup) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InviteLinkChatTypeBasicGroup + + return json.Marshal((*stub)(entity)) +} + +func (*InviteLinkChatTypeBasicGroup) GetClass() string { + return ClassInviteLinkChatType +} + +func (*InviteLinkChatTypeBasicGroup) GetType() string { + return TypeInviteLinkChatTypeBasicGroup +} + +func (*InviteLinkChatTypeBasicGroup) InviteLinkChatTypeType() string { + return TypeInviteLinkChatTypeBasicGroup +} + +// The link is an invite link for a supergroup +type InviteLinkChatTypeSupergroup struct{ + meta +} + +func (entity *InviteLinkChatTypeSupergroup) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InviteLinkChatTypeSupergroup + + return json.Marshal((*stub)(entity)) +} + +func (*InviteLinkChatTypeSupergroup) GetClass() string { + return ClassInviteLinkChatType +} + +func (*InviteLinkChatTypeSupergroup) GetType() string { + return TypeInviteLinkChatTypeSupergroup +} + +func (*InviteLinkChatTypeSupergroup) InviteLinkChatTypeType() string { + return TypeInviteLinkChatTypeSupergroup +} + +// The link is an invite link for a channel +type InviteLinkChatTypeChannel struct{ + meta +} + +func (entity *InviteLinkChatTypeChannel) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InviteLinkChatTypeChannel + + return json.Marshal((*stub)(entity)) +} + +func (*InviteLinkChatTypeChannel) GetClass() string { + return ClassInviteLinkChatType +} + +func (*InviteLinkChatTypeChannel) GetType() string { + return TypeInviteLinkChatTypeChannel +} + +func (*InviteLinkChatTypeChannel) InviteLinkChatTypeType() string { + return TypeInviteLinkChatTypeChannel +} + +// Contains information about a chat invite link +type ChatInviteLinkInfo struct { + 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 InviteLinkChatType `json:"type"` + // Title of the chat + Title string `json:"title"` + // Chat photo; may be null + Photo *ChatPhotoInfo `json:"photo"` + // Identifier of the accent color for chat title and background of chat photo + AccentColorId int32 `json:"accent_color_id"` + // 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"` + // True, if the chat is verified + IsVerified bool `json:"is_verified"` + // True, if many users reported this chat as a scam + IsScam bool `json:"is_scam"` + // True, if many users reported this chat as a fake account + IsFake bool `json:"is_fake"` +} + +func (entity *ChatInviteLinkInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatInviteLinkInfo + + return json.Marshal((*stub)(entity)) +} + +func (*ChatInviteLinkInfo) GetClass() string { + return ClassChatInviteLinkInfo +} + +func (*ChatInviteLinkInfo) GetType() string { + return TypeChatInviteLinkInfo +} + +func (chatInviteLinkInfo *ChatInviteLinkInfo) UnmarshalJSON(data []byte) error { + 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"` + AccentColorId int32 `json:"accent_color_id"` + 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"` + IsVerified bool `json:"is_verified"` + IsScam bool `json:"is_scam"` + IsFake bool `json:"is_fake"` + } + + 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.AccentColorId = tmp.AccentColorId + chatInviteLinkInfo.Description = tmp.Description + chatInviteLinkInfo.MemberCount = tmp.MemberCount + chatInviteLinkInfo.MemberUserIds = tmp.MemberUserIds + chatInviteLinkInfo.CreatesJoinRequest = tmp.CreatesJoinRequest + chatInviteLinkInfo.IsPublic = tmp.IsPublic + chatInviteLinkInfo.IsVerified = tmp.IsVerified + chatInviteLinkInfo.IsScam = tmp.IsScam + chatInviteLinkInfo.IsFake = tmp.IsFake + + fieldType, _ := UnmarshalInviteLinkChatType(tmp.Type) + chatInviteLinkInfo.Type = fieldType + + return nil +} + +// Describes a user that sent a join request and waits for administrator approval +type ChatJoinRequest struct { + 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"` +} + +func (entity *ChatJoinRequest) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatJoinRequest + + return json.Marshal((*stub)(entity)) +} + +func (*ChatJoinRequest) GetClass() string { + return ClassChatJoinRequest +} + +func (*ChatJoinRequest) GetType() string { + return TypeChatJoinRequest +} + +// Contains a list of requests to join a chat +type ChatJoinRequests struct { + meta + // Approximate total number of requests found + TotalCount int32 `json:"total_count"` + // List of the requests + Requests []*ChatJoinRequest `json:"requests"` +} + +func (entity *ChatJoinRequests) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatJoinRequests + + return json.Marshal((*stub)(entity)) +} + +func (*ChatJoinRequests) GetClass() string { + return ClassChatJoinRequests +} + +func (*ChatJoinRequests) GetType() string { + return TypeChatJoinRequests +} + +// Contains information about pending join requests for a chat +type ChatJoinRequestsInfo struct { + 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"` +} + +func (entity *ChatJoinRequestsInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatJoinRequestsInfo + + return json.Marshal((*stub)(entity)) +} + +func (*ChatJoinRequestsInfo) GetClass() string { + return ClassChatJoinRequestsInfo +} + +func (*ChatJoinRequestsInfo) GetType() string { + return TypeChatJoinRequestsInfo +} + +// Represents a basic group of 0-200 users (must be upgraded to a supergroup to accommodate more than 200 users) +type BasicGroup struct { + meta + // Group identifier + Id int64 `json:"id"` + // 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"` +} + +func (entity *BasicGroup) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BasicGroup + + return json.Marshal((*stub)(entity)) +} + +func (*BasicGroup) GetClass() string { + return ClassBasicGroup +} + +func (*BasicGroup) GetType() string { + return TypeBasicGroup +} + +func (basicGroup *BasicGroup) UnmarshalJSON(data []byte) error { + var tmp struct { + Id int64 `json:"id"` + MemberCount int32 `json:"member_count"` + Status json.RawMessage `json:"status"` + IsActive bool `json:"is_active"` + UpgradedToSupergroupId int64 `json:"upgraded_to_supergroup_id"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + basicGroup.Id = tmp.Id + basicGroup.MemberCount = tmp.MemberCount + basicGroup.IsActive = tmp.IsActive + basicGroup.UpgradedToSupergroupId = tmp.UpgradedToSupergroupId + + fieldStatus, _ := UnmarshalChatMemberStatus(tmp.Status) + basicGroup.Status = fieldStatus + + return nil +} + +// Contains full information about a basic group +type BasicGroupFullInfo struct { + meta + // Chat photo; may be null if empty or unknown. If non-null, then it is the same photo as in chat.photo + 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"` + // True, if non-administrators and non-bots can be hidden in responses to getSupergroupMembers and searchChatMembers for non-administrators after upgrading the basic group to a supergroup + CanHideMembers bool `json:"can_hide_members"` + // True, if aggressive anti-spam checks can be enabled or disabled in the supergroup after upgrading the basic group to a supergroup + CanToggleAggressiveAntiSpam bool `json:"can_toggle_aggressive_anti_spam"` + // 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"` +} + +func (entity *BasicGroupFullInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BasicGroupFullInfo + + return json.Marshal((*stub)(entity)) +} + +func (*BasicGroupFullInfo) GetClass() string { + return ClassBasicGroupFullInfo +} + +func (*BasicGroupFullInfo) GetType() string { + return TypeBasicGroupFullInfo +} + +// 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 { + meta + // Supergroup or channel identifier + Id int64 `json:"id"` + // Usernames of the supergroup or channel; may be null + Usernames *Usernames `json:"usernames"` + // 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 always be 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 getChatSimilarChats, getChatsToSendStories, getCreatedPublicChats, getGroupsInCommon, getInactiveSupergroupChats, getSuitableDiscussionChats, getUserPrivacySettingRules, getVideoChatAvailableParticipants, searchChatsNearby, searchPublicChats, or in chatFolderInviteLinkInfo.missing_chat_ids, or for public chats in which where sent messages and posted stories from publicForwards, or for public chats in which where sent messages from getMessagePublicForwards response + MemberCount int32 `json:"member_count"` + // Approximate boost level for the chat + BoostLevel int32 `json:"boost_level"` + // 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 users need to join the supergroup before they can send messages. Always true for channels and non-discussion supergroups + JoinToSendMessages bool `json:"join_to_send_messages"` + // True, if all users directly joining the supergroup need to be approved by supergroup administrators. Always false for channels and supergroups without username, location, or a linked chat + JoinByRequest bool `json:"join_by_request"` + // 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 is a forum with topics + IsForum bool `json:"is_forum"` + // 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"` + // True, if the supergroup or channel has non-expired stories available to the current user + HasActiveStories bool `json:"has_active_stories"` + // True, if the supergroup or channel has unread non-expired stories available to the current user + HasUnreadActiveStories bool `json:"has_unread_active_stories"` +} + +func (entity *Supergroup) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub Supergroup + + return json.Marshal((*stub)(entity)) +} + +func (*Supergroup) GetClass() string { + return ClassSupergroup +} + +func (*Supergroup) GetType() string { + return TypeSupergroup +} + +func (supergroup *Supergroup) UnmarshalJSON(data []byte) error { + var tmp struct { + Id int64 `json:"id"` + Usernames *Usernames `json:"usernames"` + Date int32 `json:"date"` + Status json.RawMessage `json:"status"` + MemberCount int32 `json:"member_count"` + BoostLevel int32 `json:"boost_level"` + HasLinkedChat bool `json:"has_linked_chat"` + HasLocation bool `json:"has_location"` + SignMessages bool `json:"sign_messages"` + JoinToSendMessages bool `json:"join_to_send_messages"` + JoinByRequest bool `json:"join_by_request"` + IsSlowModeEnabled bool `json:"is_slow_mode_enabled"` + IsChannel bool `json:"is_channel"` + IsBroadcastGroup bool `json:"is_broadcast_group"` + IsForum bool `json:"is_forum"` + IsVerified bool `json:"is_verified"` + RestrictionReason string `json:"restriction_reason"` + IsScam bool `json:"is_scam"` + IsFake bool `json:"is_fake"` + HasActiveStories bool `json:"has_active_stories"` + HasUnreadActiveStories bool `json:"has_unread_active_stories"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + supergroup.Id = tmp.Id + supergroup.Usernames = tmp.Usernames + supergroup.Date = tmp.Date + supergroup.MemberCount = tmp.MemberCount + supergroup.BoostLevel = tmp.BoostLevel + supergroup.HasLinkedChat = tmp.HasLinkedChat + supergroup.HasLocation = tmp.HasLocation + supergroup.SignMessages = tmp.SignMessages + supergroup.JoinToSendMessages = tmp.JoinToSendMessages + supergroup.JoinByRequest = tmp.JoinByRequest + supergroup.IsSlowModeEnabled = tmp.IsSlowModeEnabled + supergroup.IsChannel = tmp.IsChannel + supergroup.IsBroadcastGroup = tmp.IsBroadcastGroup + supergroup.IsForum = tmp.IsForum + supergroup.IsVerified = tmp.IsVerified + supergroup.RestrictionReason = tmp.RestrictionReason + supergroup.IsScam = tmp.IsScam + supergroup.IsFake = tmp.IsFake + supergroup.HasActiveStories = tmp.HasActiveStories + supergroup.HasUnreadActiveStories = tmp.HasUnreadActiveStories + + fieldStatus, _ := UnmarshalChatMemberStatus(tmp.Status) + supergroup.Status = fieldStatus + + return nil +} + +// Contains full information about a supergroup or channel +type SupergroupFullInfo struct { + meta + // Chat photo; may be null if empty or unknown. If non-null, then it is the same photo as in chat.photo + 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 via getSupergroupMembers or searchChatMembers + CanGetMembers bool `json:"can_get_members"` + // True, if non-administrators can receive only administrators and bots using getSupergroupMembers or searchChatMembers + HasHiddenMembers bool `json:"has_hidden_members"` + // True, if non-administrators and non-bots can be hidden in responses to getSupergroupMembers and searchChatMembers for non-administrators + CanHideMembers bool `json:"can_hide_members"` + // 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 aggressive anti-spam checks can be enabled or disabled in the supergroup + CanToggleAggressiveAntiSpam bool `json:"can_toggle_aggressive_anti_spam"` + // True, if new chat members will have access to old messages. In public, discussion, of forum groups and all channels, old messages are always available, so this option affects only private non-forum supergroups without a linked chat. The value of this field is only available to chat administrators + IsAllHistoryAvailable bool `json:"is_all_history_available"` + // True, if aggressive anti-spam checks are enabled in the supergroup. The value of this field is only available to chat administrators + HasAggressiveAntiSpamEnabled bool `json:"has_aggressive_anti_spam_enabled"` + // True, if the supergroup or channel has pinned stories + HasPinnedStories bool `json:"has_pinned_stories"` + // Number of times the current user boosted the supergroup or channel + MyBoostCount int32 `json:"my_boost_count"` + // Number of times the supergroup must be boosted by a user to ignore slow mode and chat permission restrictions; 0 if unspecified + UnrestrictBoostCount int32 `json:"unrestrict_boost_count"` + // Identifier of the supergroup sticker set that must be shown before user sticker sets; 0 if none + StickerSetId JsonInt64 `json:"sticker_set_id"` + // Identifier of the custom emoji sticker set that can be used in the supergroup without Telegram Premium subscription; 0 if none + CustomEmojiStickerSetId JsonInt64 `json:"custom_emoji_sticker_set_id"` + // Location to which the supergroup is connected; may be null if none + 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"` +} + +func (entity *SupergroupFullInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SupergroupFullInfo + + return json.Marshal((*stub)(entity)) +} + +func (*SupergroupFullInfo) GetClass() string { + return ClassSupergroupFullInfo +} + +func (*SupergroupFullInfo) GetType() string { + return TypeSupergroupFullInfo +} + +// The secret chat is not yet created; waiting for the other user to get online +type SecretChatStatePending struct{ + meta +} + +func (entity *SecretChatStatePending) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SecretChatStatePending + + return json.Marshal((*stub)(entity)) +} + +func (*SecretChatStatePending) GetClass() string { + return ClassSecretChatState +} + +func (*SecretChatStatePending) GetType() string { + return TypeSecretChatStatePending +} + +func (*SecretChatStatePending) SecretChatStateType() string { + return TypeSecretChatStatePending +} + +// The secret chat is ready to use +type SecretChatStateReady struct{ + meta +} + +func (entity *SecretChatStateReady) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SecretChatStateReady + + return json.Marshal((*stub)(entity)) +} + +func (*SecretChatStateReady) GetClass() string { + return ClassSecretChatState +} + +func (*SecretChatStateReady) GetType() string { + return TypeSecretChatStateReady +} + +func (*SecretChatStateReady) SecretChatStateType() string { + return TypeSecretChatStateReady +} + +// The secret chat is closed +type SecretChatStateClosed struct{ + meta +} + +func (entity *SecretChatStateClosed) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SecretChatStateClosed + + return json.Marshal((*stub)(entity)) +} + +func (*SecretChatStateClosed) GetClass() string { + return ClassSecretChatState +} + +func (*SecretChatStateClosed) GetType() string { + return TypeSecretChatStateClosed +} + +func (*SecretChatStateClosed) SecretChatStateType() string { + return TypeSecretChatStateClosed +} + +// Represents a secret chat +type SecretChat struct { + 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; false otherwise + 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, files bigger than 2000MB are supported if the layer >= 143, spoiler and custom emoji text entities are supported if the layer >= 144 + Layer int32 `json:"layer"` +} + +func (entity *SecretChat) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SecretChat + + return json.Marshal((*stub)(entity)) +} + +func (*SecretChat) GetClass() string { + return ClassSecretChat +} + +func (*SecretChat) GetType() string { + return TypeSecretChat +} + +func (secretChat *SecretChat) UnmarshalJSON(data []byte) error { + 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"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + secretChat.Id = tmp.Id + secretChat.UserId = tmp.UserId + secretChat.IsOutbound = tmp.IsOutbound + secretChat.KeyHash = tmp.KeyHash + secretChat.Layer = tmp.Layer + + fieldState, _ := UnmarshalSecretChatState(tmp.State) + secretChat.State = fieldState + + return nil +} + +// The message was sent by a known user +type MessageSenderUser struct { + meta + // Identifier of the user that sent the message + UserId int64 `json:"user_id"` +} + +func (entity *MessageSenderUser) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageSenderUser + + return json.Marshal((*stub)(entity)) +} + +func (*MessageSenderUser) GetClass() string { + return ClassMessageSender +} + +func (*MessageSenderUser) GetType() string { + return TypeMessageSenderUser +} + +func (*MessageSenderUser) MessageSenderType() string { + return TypeMessageSenderUser +} + +// The message was sent on behalf of a chat +type MessageSenderChat struct { + meta + // Identifier of the chat that sent the message + ChatId int64 `json:"chat_id"` +} + +func (entity *MessageSenderChat) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageSenderChat + + return json.Marshal((*stub)(entity)) +} + +func (*MessageSenderChat) GetClass() string { + return ClassMessageSender +} + +func (*MessageSenderChat) GetType() string { + return TypeMessageSenderChat +} + +func (*MessageSenderChat) MessageSenderType() string { + return TypeMessageSenderChat +} + +// Represents a list of message senders +type MessageSenders struct { + meta + // Approximate total number of messages senders found + TotalCount int32 `json:"total_count"` + // List of message senders + Senders []MessageSender `json:"senders"` +} + +func (entity *MessageSenders) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageSenders + + return json.Marshal((*stub)(entity)) +} + +func (*MessageSenders) GetClass() string { + return ClassMessageSenders +} + +func (*MessageSenders) GetType() string { + return TypeMessageSenders +} + +func (messageSenders *MessageSenders) UnmarshalJSON(data []byte) error { + var tmp struct { + TotalCount int32 `json:"total_count"` + Senders []json.RawMessage `json:"senders"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + messageSenders.TotalCount = tmp.TotalCount + + fieldSenders, _ := UnmarshalListOfMessageSender(tmp.Senders) + messageSenders.Senders = fieldSenders + + return nil +} + +// Represents a message sender, which can be used to send messages in a chat +type ChatMessageSender struct { + meta + // The message sender + Sender MessageSender `json:"sender"` + // True, if Telegram Premium is needed to use the message sender + NeedsPremium bool `json:"needs_premium"` +} + +func (entity *ChatMessageSender) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatMessageSender + + return json.Marshal((*stub)(entity)) +} + +func (*ChatMessageSender) GetClass() string { + return ClassChatMessageSender +} + +func (*ChatMessageSender) GetType() string { + return TypeChatMessageSender +} + +func (chatMessageSender *ChatMessageSender) UnmarshalJSON(data []byte) error { + var tmp struct { + Sender json.RawMessage `json:"sender"` + NeedsPremium bool `json:"needs_premium"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + chatMessageSender.NeedsPremium = tmp.NeedsPremium + + fieldSender, _ := UnmarshalMessageSender(tmp.Sender) + chatMessageSender.Sender = fieldSender + + return nil +} + +// Represents a list of message senders, which can be used to send messages in a chat +type ChatMessageSenders struct { + meta + // List of available message senders + Senders []*ChatMessageSender `json:"senders"` +} + +func (entity *ChatMessageSenders) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatMessageSenders + + return json.Marshal((*stub)(entity)) +} + +func (*ChatMessageSenders) GetClass() string { + return ClassChatMessageSenders +} + +func (*ChatMessageSenders) GetType() string { + return TypeChatMessageSenders +} + +// Contains read date of the message +type MessageReadDateRead struct { + meta + // Point in time (Unix timestamp) when the message was read by the other user + ReadDate int32 `json:"read_date"` +} + +func (entity *MessageReadDateRead) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageReadDateRead + + return json.Marshal((*stub)(entity)) +} + +func (*MessageReadDateRead) GetClass() string { + return ClassMessageReadDate +} + +func (*MessageReadDateRead) GetType() string { + return TypeMessageReadDateRead +} + +func (*MessageReadDateRead) MessageReadDateType() string { + return TypeMessageReadDateRead +} + +// The message is unread yet +type MessageReadDateUnread struct{ + meta +} + +func (entity *MessageReadDateUnread) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageReadDateUnread + + return json.Marshal((*stub)(entity)) +} + +func (*MessageReadDateUnread) GetClass() string { + return ClassMessageReadDate +} + +func (*MessageReadDateUnread) GetType() string { + return TypeMessageReadDateUnread +} + +func (*MessageReadDateUnread) MessageReadDateType() string { + return TypeMessageReadDateUnread +} + +// The message is too old to get read date +type MessageReadDateTooOld struct{ + meta +} + +func (entity *MessageReadDateTooOld) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageReadDateTooOld + + return json.Marshal((*stub)(entity)) +} + +func (*MessageReadDateTooOld) GetClass() string { + return ClassMessageReadDate +} + +func (*MessageReadDateTooOld) GetType() string { + return TypeMessageReadDateTooOld +} + +func (*MessageReadDateTooOld) MessageReadDateType() string { + return TypeMessageReadDateTooOld +} + +// The read date is unknown due to privacy settings of the other user +type MessageReadDateUserPrivacyRestricted struct{ + meta +} + +func (entity *MessageReadDateUserPrivacyRestricted) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageReadDateUserPrivacyRestricted + + return json.Marshal((*stub)(entity)) +} + +func (*MessageReadDateUserPrivacyRestricted) GetClass() string { + return ClassMessageReadDate +} + +func (*MessageReadDateUserPrivacyRestricted) GetType() string { + return TypeMessageReadDateUserPrivacyRestricted +} + +func (*MessageReadDateUserPrivacyRestricted) MessageReadDateType() string { + return TypeMessageReadDateUserPrivacyRestricted +} + +// The read date is unknown due to privacy settings of the current user, but will be known if the user subscribes to Telegram Premium +type MessageReadDateMyPrivacyRestricted struct{ + meta +} + +func (entity *MessageReadDateMyPrivacyRestricted) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageReadDateMyPrivacyRestricted + + return json.Marshal((*stub)(entity)) +} + +func (*MessageReadDateMyPrivacyRestricted) GetClass() string { + return ClassMessageReadDate +} + +func (*MessageReadDateMyPrivacyRestricted) GetType() string { + return TypeMessageReadDateMyPrivacyRestricted +} + +func (*MessageReadDateMyPrivacyRestricted) MessageReadDateType() string { + return TypeMessageReadDateMyPrivacyRestricted +} + +// Represents a viewer of a message +type MessageViewer struct { + meta + // User identifier of the viewer + UserId int64 `json:"user_id"` + // Approximate point in time (Unix timestamp) when the message was viewed + ViewDate int32 `json:"view_date"` +} + +func (entity *MessageViewer) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageViewer + + return json.Marshal((*stub)(entity)) +} + +func (*MessageViewer) GetClass() string { + return ClassMessageViewer +} + +func (*MessageViewer) GetType() string { + return TypeMessageViewer +} + +// Represents a list of message viewers +type MessageViewers struct { + meta + // List of message viewers + Viewers []*MessageViewer `json:"viewers"` +} + +func (entity *MessageViewers) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageViewers + + return json.Marshal((*stub)(entity)) +} + +func (*MessageViewers) GetClass() string { + return ClassMessageViewers +} + +func (*MessageViewers) GetType() string { + return TypeMessageViewers +} + +// The message was originally sent by a known user +type MessageOriginUser struct { + meta + // Identifier of the user that originally sent the message + SenderUserId int64 `json:"sender_user_id"` +} + +func (entity *MessageOriginUser) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageOriginUser + + return json.Marshal((*stub)(entity)) +} + +func (*MessageOriginUser) GetClass() string { + return ClassMessageOrigin +} + +func (*MessageOriginUser) GetType() string { + return TypeMessageOriginUser +} + +func (*MessageOriginUser) MessageOriginType() string { + return TypeMessageOriginUser +} + +// The message was originally sent by a user, which is hidden by their privacy settings +type MessageOriginHiddenUser struct { + meta + // Name of the sender + SenderName string `json:"sender_name"` +} + +func (entity *MessageOriginHiddenUser) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageOriginHiddenUser + + return json.Marshal((*stub)(entity)) +} + +func (*MessageOriginHiddenUser) GetClass() string { + return ClassMessageOrigin +} + +func (*MessageOriginHiddenUser) GetType() string { + return TypeMessageOriginHiddenUser +} + +func (*MessageOriginHiddenUser) MessageOriginType() string { + return TypeMessageOriginHiddenUser +} + +// The message was originally sent on behalf of a chat +type MessageOriginChat struct { + 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"` +} + +func (entity *MessageOriginChat) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageOriginChat + + return json.Marshal((*stub)(entity)) +} + +func (*MessageOriginChat) GetClass() string { + return ClassMessageOrigin +} + +func (*MessageOriginChat) GetType() string { + return TypeMessageOriginChat +} + +func (*MessageOriginChat) MessageOriginType() string { + return TypeMessageOriginChat +} + +// The message was originally a post in a channel +type MessageOriginChannel struct { + meta + // Identifier of the channel chat to which the message was originally sent + 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"` +} + +func (entity *MessageOriginChannel) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageOriginChannel + + return json.Marshal((*stub)(entity)) +} + +func (*MessageOriginChannel) GetClass() string { + return ClassMessageOrigin +} + +func (*MessageOriginChannel) GetType() string { + return TypeMessageOriginChannel +} + +func (*MessageOriginChannel) MessageOriginType() string { + return TypeMessageOriginChannel +} + +// Contains information about the last message from which a new message was forwarded last time +type ForwardSource struct { + meta + // Identifier of the chat to which the message that was forwarded belonged; may be 0 if unknown + ChatId int64 `json:"chat_id"` + // Identifier of the message; may be 0 if unknown + MessageId int64 `json:"message_id"` + // Identifier of the sender of the message; may be null if unknown or the new message was forwarded not to Saved Messages + SenderId MessageSender `json:"sender_id"` + // Name of the sender of the message if the sender is hidden by their privacy settings + SenderName string `json:"sender_name"` + // Point in time (Unix timestamp) when the message is sent; 0 if unknown + Date int32 `json:"date"` + // True, if the message that was forwarded is outgoing; always false if sender is unknown + IsOutgoing bool `json:"is_outgoing"` +} + +func (entity *ForwardSource) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ForwardSource + + return json.Marshal((*stub)(entity)) +} + +func (*ForwardSource) GetClass() string { + return ClassForwardSource +} + +func (*ForwardSource) GetType() string { + return TypeForwardSource +} + +func (forwardSource *ForwardSource) UnmarshalJSON(data []byte) error { + var tmp struct { + ChatId int64 `json:"chat_id"` + MessageId int64 `json:"message_id"` + SenderId json.RawMessage `json:"sender_id"` + SenderName string `json:"sender_name"` + Date int32 `json:"date"` + IsOutgoing bool `json:"is_outgoing"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + forwardSource.ChatId = tmp.ChatId + forwardSource.MessageId = tmp.MessageId + forwardSource.SenderName = tmp.SenderName + forwardSource.Date = tmp.Date + forwardSource.IsOutgoing = tmp.IsOutgoing + + fieldSenderId, _ := UnmarshalMessageSender(tmp.SenderId) + forwardSource.SenderId = fieldSenderId + + return nil +} + +// A reaction with an emoji +type ReactionTypeEmoji struct { + meta + // Text representation of the reaction + Emoji string `json:"emoji"` +} + +func (entity *ReactionTypeEmoji) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ReactionTypeEmoji + + return json.Marshal((*stub)(entity)) +} + +func (*ReactionTypeEmoji) GetClass() string { + return ClassReactionType +} + +func (*ReactionTypeEmoji) GetType() string { + return TypeReactionTypeEmoji +} + +func (*ReactionTypeEmoji) ReactionTypeType() string { + return TypeReactionTypeEmoji +} + +// A reaction with a custom emoji +type ReactionTypeCustomEmoji struct { + meta + // Unique identifier of the custom emoji + CustomEmojiId JsonInt64 `json:"custom_emoji_id"` +} + +func (entity *ReactionTypeCustomEmoji) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ReactionTypeCustomEmoji + + return json.Marshal((*stub)(entity)) +} + +func (*ReactionTypeCustomEmoji) GetClass() string { + return ClassReactionType +} + +func (*ReactionTypeCustomEmoji) GetType() string { + return TypeReactionTypeCustomEmoji +} + +func (*ReactionTypeCustomEmoji) ReactionTypeType() string { + return TypeReactionTypeCustomEmoji +} + +// Contains information about a forwarded message +type MessageForwardInfo struct { + meta + // Origin of the forwarded message + Origin MessageOrigin `json:"origin"` + // Point in time (Unix timestamp) when the message was originally sent + Date int32 `json:"date"` + // For messages forwarded to the chat with the current user (Saved Messages), to the Replies bot chat, or to the channel's discussion group, information about the source message from which the message was forwarded last time; may be null for other forwards or if unknown + Source *ForwardSource `json:"source"` + // The type of a public service announcement for the forwarded message + PublicServiceAnnouncementType string `json:"public_service_announcement_type"` +} + +func (entity *MessageForwardInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageForwardInfo + + return json.Marshal((*stub)(entity)) +} + +func (*MessageForwardInfo) GetClass() string { + return ClassMessageForwardInfo +} + +func (*MessageForwardInfo) GetType() string { + return TypeMessageForwardInfo +} + +func (messageForwardInfo *MessageForwardInfo) UnmarshalJSON(data []byte) error { + var tmp struct { + Origin json.RawMessage `json:"origin"` + Date int32 `json:"date"` + Source *ForwardSource `json:"source"` + PublicServiceAnnouncementType string `json:"public_service_announcement_type"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + messageForwardInfo.Date = tmp.Date + messageForwardInfo.Source = tmp.Source + messageForwardInfo.PublicServiceAnnouncementType = tmp.PublicServiceAnnouncementType + + fieldOrigin, _ := UnmarshalMessageOrigin(tmp.Origin) + messageForwardInfo.Origin = fieldOrigin + + return nil +} + +// Contains information about a message created with importMessages +type MessageImportInfo struct { + meta + // Name of the original sender + SenderName string `json:"sender_name"` + // Point in time (Unix timestamp) when the message was originally sent + Date int32 `json:"date"` +} + +func (entity *MessageImportInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageImportInfo + + return json.Marshal((*stub)(entity)) +} + +func (*MessageImportInfo) GetClass() string { + return ClassMessageImportInfo +} + +func (*MessageImportInfo) GetType() string { + return TypeMessageImportInfo +} + +// Contains information about replies to a message +type MessageReplyInfo struct { + 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"` +} + +func (entity *MessageReplyInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageReplyInfo + + return json.Marshal((*stub)(entity)) +} + +func (*MessageReplyInfo) GetClass() string { + return ClassMessageReplyInfo +} + +func (*MessageReplyInfo) GetType() string { + return TypeMessageReplyInfo +} + +func (messageReplyInfo *MessageReplyInfo) UnmarshalJSON(data []byte) error { + 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"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + messageReplyInfo.ReplyCount = tmp.ReplyCount + messageReplyInfo.LastReadInboxMessageId = tmp.LastReadInboxMessageId + messageReplyInfo.LastReadOutboxMessageId = tmp.LastReadOutboxMessageId + messageReplyInfo.LastMessageId = tmp.LastMessageId + + fieldRecentReplierIds, _ := UnmarshalListOfMessageSender(tmp.RecentReplierIds) + messageReplyInfo.RecentReplierIds = fieldRecentReplierIds + + return nil +} + +// Contains information about a reaction to a message +type MessageReaction struct { + meta + // Type of the reaction + Type ReactionType `json:"type"` + // 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"` + // Identifier of the message sender used by the current user to add the reaction; may be null if unknown or the reaction isn't chosen + UsedSenderId MessageSender `json:"used_sender_id"` + // Identifiers of at most 3 recent message senders, added the reaction; available in private, basic group and supergroup chats + RecentSenderIds []MessageSender `json:"recent_sender_ids"` +} + +func (entity *MessageReaction) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageReaction + + return json.Marshal((*stub)(entity)) +} + +func (*MessageReaction) GetClass() string { + return ClassMessageReaction +} + +func (*MessageReaction) GetType() string { + return TypeMessageReaction +} + +func (messageReaction *MessageReaction) UnmarshalJSON(data []byte) error { + var tmp struct { + Type json.RawMessage `json:"type"` + TotalCount int32 `json:"total_count"` + IsChosen bool `json:"is_chosen"` + UsedSenderId json.RawMessage `json:"used_sender_id"` + RecentSenderIds []json.RawMessage `json:"recent_sender_ids"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + messageReaction.TotalCount = tmp.TotalCount + messageReaction.IsChosen = tmp.IsChosen + + fieldType, _ := UnmarshalReactionType(tmp.Type) + messageReaction.Type = fieldType + + fieldUsedSenderId, _ := UnmarshalMessageSender(tmp.UsedSenderId) + messageReaction.UsedSenderId = fieldUsedSenderId + + fieldRecentSenderIds, _ := UnmarshalListOfMessageSender(tmp.RecentSenderIds) + messageReaction.RecentSenderIds = fieldRecentSenderIds + + return nil +} + +// Contains a list of reactions added to a message +type MessageReactions struct { + meta + // List of added reactions + Reactions []*MessageReaction `json:"reactions"` + // True, if the reactions are tags and Telegram Premium users can filter messages by them + AreTags bool `json:"are_tags"` +} + +func (entity *MessageReactions) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageReactions + + return json.Marshal((*stub)(entity)) +} + +func (*MessageReactions) GetClass() string { + return ClassMessageReactions +} + +func (*MessageReactions) GetType() string { + return TypeMessageReactions +} + +// Contains information about interactions with a message +type MessageInteractionInfo struct { + 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 or tags added to the message; may be null + Reactions *MessageReactions `json:"reactions"` +} + +func (entity *MessageInteractionInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageInteractionInfo + + return json.Marshal((*stub)(entity)) +} + +func (*MessageInteractionInfo) GetClass() string { + return ClassMessageInteractionInfo +} + +func (*MessageInteractionInfo) GetType() string { + return TypeMessageInteractionInfo +} + +// Contains information about an unread reaction to a message +type UnreadReaction struct { + meta + // Type of the reaction + Type ReactionType `json:"type"` + // 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"` +} + +func (entity *UnreadReaction) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UnreadReaction + + return json.Marshal((*stub)(entity)) +} + +func (*UnreadReaction) GetClass() string { + return ClassUnreadReaction +} + +func (*UnreadReaction) GetType() string { + return TypeUnreadReaction +} + +func (unreadReaction *UnreadReaction) UnmarshalJSON(data []byte) error { + var tmp struct { + Type json.RawMessage `json:"type"` + SenderId json.RawMessage `json:"sender_id"` + IsBig bool `json:"is_big"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + unreadReaction.IsBig = tmp.IsBig + + fieldType, _ := UnmarshalReactionType(tmp.Type) + unreadReaction.Type = fieldType + + fieldSenderId, _ := UnmarshalMessageSender(tmp.SenderId) + unreadReaction.SenderId = fieldSenderId + + return nil +} + +// The message is being sent now, but has not yet been delivered to the server +type MessageSendingStatePending struct { + meta + // Non-persistent message sending identifier, specified by the application + SendingId int32 `json:"sending_id"` +} + +func (entity *MessageSendingStatePending) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageSendingStatePending + + return json.Marshal((*stub)(entity)) +} + +func (*MessageSendingStatePending) GetClass() string { + return ClassMessageSendingState +} + +func (*MessageSendingStatePending) GetType() string { + return TypeMessageSendingStatePending +} + +func (*MessageSendingStatePending) MessageSendingStateType() string { + return TypeMessageSendingStatePending +} + +// The message failed to be sent +type MessageSendingStateFailed struct { + meta + // The cause of the message sending failure + Error *Error `json:"error"` + // 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"` + // True, if the message can be re-sent only if another quote is chosen in the message that is replied by the given message + NeedAnotherReplyQuote bool `json:"need_another_reply_quote"` + // True, if the message can be re-sent only if the message to be replied is removed. This will be done automatically by resendMessages + NeedDropReply bool `json:"need_drop_reply"` + // Time left before the message can be re-sent, in seconds. No update is sent when this field changes + RetryAfter float64 `json:"retry_after"` +} + +func (entity *MessageSendingStateFailed) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageSendingStateFailed + + return json.Marshal((*stub)(entity)) +} + +func (*MessageSendingStateFailed) GetClass() string { + return ClassMessageSendingState +} + +func (*MessageSendingStateFailed) GetType() string { + return TypeMessageSendingStateFailed +} + +func (*MessageSendingStateFailed) MessageSendingStateType() string { + return TypeMessageSendingStateFailed +} + +// Describes manually or automatically chosen quote from another message +type TextQuote struct { + meta + // Text of the quote. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities can be present in the text + Text *FormattedText `json:"text"` + // Approximate quote position in the original message in UTF-16 code units as specified by the message sender + Position int32 `json:"position"` + // True, if the quote was manually chosen by the message sender + IsManual bool `json:"is_manual"` +} + +func (entity *TextQuote) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TextQuote + + return json.Marshal((*stub)(entity)) +} + +func (*TextQuote) GetClass() string { + return ClassTextQuote +} + +func (*TextQuote) GetType() string { + return TypeTextQuote +} + +// Describes manually chosen quote from another message +type InputTextQuote struct { + meta + // Text of the quote; 0-getOption("message_reply_quote_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities are allowed to be kept and must be kept in the quote + Text *FormattedText `json:"text"` + // Quote position in the original message in UTF-16 code units + Position int32 `json:"position"` +} + +func (entity *InputTextQuote) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputTextQuote + + return json.Marshal((*stub)(entity)) +} + +func (*InputTextQuote) GetClass() string { + return ClassInputTextQuote +} + +func (*InputTextQuote) GetType() string { + return TypeInputTextQuote +} + +// Describes a message replied by a given message +type MessageReplyToMessage struct { + meta + // The identifier of the chat to which the message belongs; may be 0 if the replied message is in unknown chat + ChatId int64 `json:"chat_id"` + // The identifier of the message; may be 0 if the replied message is in unknown chat + MessageId int64 `json:"message_id"` + // Chosen quote from the replied message; may be null if none + Quote *TextQuote `json:"quote"` + // Information about origin of the message if the message was from another chat or topic; may be null for messages from the same chat + Origin MessageOrigin `json:"origin"` + // Point in time (Unix timestamp) when the message was sent if the message was from another chat or topic; 0 for messages from the same chat + OriginSendDate int32 `json:"origin_send_date"` + // Media content of the message if the message was from another chat or topic; may be null for messages from the same chat and messages without media. Can be only one of the following types: messageAnimation, messageAudio, messageContact, messageDice, messageDocument, messageGame, messageInvoice, messageLocation, messagePhoto, messagePoll, messagePremiumGiveaway, messagePremiumGiveawayWinners, messageSticker, messageStory, messageText (for link preview), messageVenue, messageVideo, messageVideoNote, or messageVoiceNote + Content MessageContent `json:"content"` +} + +func (entity *MessageReplyToMessage) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageReplyToMessage + + return json.Marshal((*stub)(entity)) +} + +func (*MessageReplyToMessage) GetClass() string { + return ClassMessageReplyTo +} + +func (*MessageReplyToMessage) GetType() string { + return TypeMessageReplyToMessage +} + +func (*MessageReplyToMessage) MessageReplyToType() string { + return TypeMessageReplyToMessage +} + +func (messageReplyToMessage *MessageReplyToMessage) UnmarshalJSON(data []byte) error { + var tmp struct { + ChatId int64 `json:"chat_id"` + MessageId int64 `json:"message_id"` + Quote *TextQuote `json:"quote"` + Origin json.RawMessage `json:"origin"` + OriginSendDate int32 `json:"origin_send_date"` + Content json.RawMessage `json:"content"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + messageReplyToMessage.ChatId = tmp.ChatId + messageReplyToMessage.MessageId = tmp.MessageId + messageReplyToMessage.Quote = tmp.Quote + messageReplyToMessage.OriginSendDate = tmp.OriginSendDate + + fieldOrigin, _ := UnmarshalMessageOrigin(tmp.Origin) + messageReplyToMessage.Origin = fieldOrigin + + fieldContent, _ := UnmarshalMessageContent(tmp.Content) + messageReplyToMessage.Content = fieldContent + + return nil +} + +// Describes a story replied by a given message +type MessageReplyToStory struct { + meta + // The identifier of the sender of the story + StorySenderChatId int64 `json:"story_sender_chat_id"` + // The identifier of the story + StoryId int32 `json:"story_id"` +} + +func (entity *MessageReplyToStory) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageReplyToStory + + return json.Marshal((*stub)(entity)) +} + +func (*MessageReplyToStory) GetClass() string { + return ClassMessageReplyTo +} + +func (*MessageReplyToStory) GetType() string { + return TypeMessageReplyToStory +} + +func (*MessageReplyToStory) MessageReplyToType() string { + return TypeMessageReplyToStory +} + +// Describes a message to be replied +type InputMessageReplyToMessage struct { + meta + // The identifier of the chat to which the message to be replied belongs; pass 0 if the message to be replied is in the same chat. Must always be 0 for replies in secret chats. A message can be replied in another chat or topic only if message.can_be_replied_in_another_chat + ChatId int64 `json:"chat_id"` + // The identifier of the message to be replied in the same or the specified chat + MessageId int64 `json:"message_id"` + // Quote from the message to be replied; pass null if none. Must always be null for replies in secret chats + Quote *InputTextQuote `json:"quote"` +} + +func (entity *InputMessageReplyToMessage) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputMessageReplyToMessage + + return json.Marshal((*stub)(entity)) +} + +func (*InputMessageReplyToMessage) GetClass() string { + return ClassInputMessageReplyTo +} + +func (*InputMessageReplyToMessage) GetType() string { + return TypeInputMessageReplyToMessage +} + +func (*InputMessageReplyToMessage) InputMessageReplyToType() string { + return TypeInputMessageReplyToMessage +} + +// Describes a story to be replied +type InputMessageReplyToStory struct { + meta + // The identifier of the sender of the story. Currently, stories can be replied only in the sender's chat and channel stories can't be replied + StorySenderChatId int64 `json:"story_sender_chat_id"` + // The identifier of the story + StoryId int32 `json:"story_id"` +} + +func (entity *InputMessageReplyToStory) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputMessageReplyToStory + + return json.Marshal((*stub)(entity)) +} + +func (*InputMessageReplyToStory) GetClass() string { + return ClassInputMessageReplyTo +} + +func (*InputMessageReplyToStory) GetType() string { + return TypeInputMessageReplyToStory +} + +func (*InputMessageReplyToStory) InputMessageReplyToType() string { + return TypeInputMessageReplyToStory +} + +// Describes a message +type Message struct { + 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 if the message isn't being sent and didn't fail to be sent + SendingState MessageSendingState `json:"sending_state"` + // The scheduling state of the message; may be null if the message isn't scheduled + 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 was sent because of a scheduled action by the message sender, for example, as away, or greeting service message + IsFromOffline bool `json:"is_from_offline"` + // 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 the message can be replied in another chat or topic + CanBeRepliedInAnotherChat bool `json:"can_be_replied_in_another_chat"` + // 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 and getMessageThreadHistory + CanGetMessageThread bool `json:"can_get_message_thread"` + // True, if read date of the message can be received through getMessageReadDate + CanGetReadDate bool `json:"can_get_read_date"` + // 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 reactions on the message can be reported through reportMessageReactions + CanReportReactions bool `json:"can_report_reactions"` + // 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 is a forum topic message + IsTopicMessage bool `json:"is_topic_message"` + // 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 if none or unknown + ForwardInfo *MessageForwardInfo `json:"forward_info"` + // Information about the initial message for messages created with importMessages; may be null if the message isn't imported + ImportInfo *MessageImportInfo `json:"import_info"` + // Information about interactions with the message; may be null if none + InteractionInfo *MessageInteractionInfo `json:"interaction_info"` + // Information about unread reactions added to the message + UnreadReactions []*UnreadReaction `json:"unread_reactions"` + // Information about the message or the story this message is replying to; may be null if none + ReplyTo MessageReplyTo `json:"reply_to"` + // 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"` + // Identifier of the Saved Messages topic for the message; 0 for messages not from Saved Messages + SavedMessagesTopicId int64 `json:"saved_messages_topic_id"` + // The message's self-destruct type; may be null if none + SelfDestructType MessageSelfDestructType `json:"self_destruct_type"` + // Time left before the message self-destruct timer expires, in seconds; 0 if self-destruction isn't scheduled yet + SelfDestructIn float64 `json:"self_destruct_in"` + // Time left before the message will be automatically deleted by message_auto_delete_time setting of the chat, in seconds; 0 if never + AutoDeleteIn float64 `json:"auto_delete_in"` + // If non-zero, the user identifier of the inline bot through which this message was sent + ViaBotUserId int64 `json:"via_bot_user_id"` + // If non-zero, the user identifier of the business bot that sent this message + SenderBusinessBotUserId int64 `json:"sender_business_bot_user_id"` + // Number of times the sender of the message boosted the supergroup at the time the message was sent; 0 if none or unknown. For messages sent by the current user, supergroupFullInfo.my_boost_count must be used instead + SenderBoostCount int32 `json:"sender_boost_count"` + // 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 if none + ReplyMarkup ReplyMarkup `json:"reply_markup"` +} + +func (entity *Message) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub Message + + return json.Marshal((*stub)(entity)) +} + +func (*Message) GetClass() string { + return ClassMessage +} + +func (*Message) GetType() string { + return TypeMessage +} + +func (message *Message) UnmarshalJSON(data []byte) error { + 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"` + IsFromOffline bool `json:"is_from_offline"` + CanBeEdited bool `json:"can_be_edited"` + CanBeForwarded bool `json:"can_be_forwarded"` + CanBeRepliedInAnotherChat bool `json:"can_be_replied_in_another_chat"` + 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"` + CanGetReadDate bool `json:"can_get_read_date"` + CanGetViewers bool `json:"can_get_viewers"` + CanGetMediaTimestampLinks bool `json:"can_get_media_timestamp_links"` + CanReportReactions bool `json:"can_report_reactions"` + HasTimestampedMedia bool `json:"has_timestamped_media"` + IsChannelPost bool `json:"is_channel_post"` + IsTopicMessage bool `json:"is_topic_message"` + ContainsUnreadMention bool `json:"contains_unread_mention"` + Date int32 `json:"date"` + EditDate int32 `json:"edit_date"` + ForwardInfo *MessageForwardInfo `json:"forward_info"` + ImportInfo *MessageImportInfo `json:"import_info"` + InteractionInfo *MessageInteractionInfo `json:"interaction_info"` + UnreadReactions []*UnreadReaction `json:"unread_reactions"` + ReplyTo json.RawMessage `json:"reply_to"` + MessageThreadId int64 `json:"message_thread_id"` + SavedMessagesTopicId int64 `json:"saved_messages_topic_id"` + SelfDestructType json.RawMessage `json:"self_destruct_type"` + SelfDestructIn float64 `json:"self_destruct_in"` + AutoDeleteIn float64 `json:"auto_delete_in"` + ViaBotUserId int64 `json:"via_bot_user_id"` + SenderBusinessBotUserId int64 `json:"sender_business_bot_user_id"` + SenderBoostCount int32 `json:"sender_boost_count"` + 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.IsFromOffline = tmp.IsFromOffline + message.CanBeEdited = tmp.CanBeEdited + message.CanBeForwarded = tmp.CanBeForwarded + message.CanBeRepliedInAnotherChat = tmp.CanBeRepliedInAnotherChat + 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.CanGetReadDate = tmp.CanGetReadDate + message.CanGetViewers = tmp.CanGetViewers + message.CanGetMediaTimestampLinks = tmp.CanGetMediaTimestampLinks + message.CanReportReactions = tmp.CanReportReactions + message.HasTimestampedMedia = tmp.HasTimestampedMedia + message.IsChannelPost = tmp.IsChannelPost + message.IsTopicMessage = tmp.IsTopicMessage + message.ContainsUnreadMention = tmp.ContainsUnreadMention + message.Date = tmp.Date + message.EditDate = tmp.EditDate + message.ForwardInfo = tmp.ForwardInfo + message.ImportInfo = tmp.ImportInfo + message.InteractionInfo = tmp.InteractionInfo + message.UnreadReactions = tmp.UnreadReactions + message.MessageThreadId = tmp.MessageThreadId + message.SavedMessagesTopicId = tmp.SavedMessagesTopicId + message.SelfDestructIn = tmp.SelfDestructIn + message.AutoDeleteIn = tmp.AutoDeleteIn + message.ViaBotUserId = tmp.ViaBotUserId + message.SenderBusinessBotUserId = tmp.SenderBusinessBotUserId + message.SenderBoostCount = tmp.SenderBoostCount + 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 + + fieldReplyTo, _ := UnmarshalMessageReplyTo(tmp.ReplyTo) + message.ReplyTo = fieldReplyTo + + fieldSelfDestructType, _ := UnmarshalMessageSelfDestructType(tmp.SelfDestructType) + message.SelfDestructType = fieldSelfDestructType + + fieldContent, _ := UnmarshalMessageContent(tmp.Content) + message.Content = fieldContent + + fieldReplyMarkup, _ := UnmarshalReplyMarkup(tmp.ReplyMarkup) + message.ReplyMarkup = fieldReplyMarkup + + return nil +} + +// Contains a list of messages +type Messages struct { + meta + // Approximate total number of messages found + TotalCount int32 `json:"total_count"` + // List of messages; messages may be null + Messages []*Message `json:"messages"` +} + +func (entity *Messages) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub Messages + + return json.Marshal((*stub)(entity)) +} + +func (*Messages) GetClass() string { + return ClassMessages +} + +func (*Messages) GetType() string { + return TypeMessages +} + +// Contains a list of messages found by a search +type FoundMessages struct { + 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, then there are no more results + NextOffset string `json:"next_offset"` +} + +func (entity *FoundMessages) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub FoundMessages + + return json.Marshal((*stub)(entity)) +} + +func (*FoundMessages) GetClass() string { + return ClassFoundMessages +} + +func (*FoundMessages) GetType() string { + return TypeFoundMessages +} + +// Contains a list of messages found by a search in a given chat +type FoundChatMessages struct { + 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 0, there are no more results + NextFromMessageId int64 `json:"next_from_message_id"` +} + +func (entity *FoundChatMessages) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub FoundChatMessages + + return json.Marshal((*stub)(entity)) +} + +func (*FoundChatMessages) GetClass() string { + return ClassFoundChatMessages +} + +func (*FoundChatMessages) GetType() string { + return TypeFoundChatMessages +} + +// Contains information about a message in a specific position +type MessagePosition struct { + 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"` +} + +func (entity *MessagePosition) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessagePosition + + return json.Marshal((*stub)(entity)) +} + +func (*MessagePosition) GetClass() string { + return ClassMessagePosition +} + +func (*MessagePosition) GetType() string { + return TypeMessagePosition +} + +// Contains a list of message positions +type MessagePositions struct { + meta + // Total number of messages found + TotalCount int32 `json:"total_count"` + // List of message positions + Positions []*MessagePosition `json:"positions"` +} + +func (entity *MessagePositions) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessagePositions + + return json.Marshal((*stub)(entity)) +} + +func (*MessagePositions) GetClass() string { + return ClassMessagePositions +} + +func (*MessagePositions) GetType() string { + return TypeMessagePositions +} + +// Contains information about found messages sent on a specific day +type MessageCalendarDay struct { + 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"` +} + +func (entity *MessageCalendarDay) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageCalendarDay + + return json.Marshal((*stub)(entity)) +} + +func (*MessageCalendarDay) GetClass() string { + return ClassMessageCalendarDay +} + +func (*MessageCalendarDay) GetType() string { + return TypeMessageCalendarDay +} + +// Contains information about found messages, split by days according to the option "utc_time_offset" +type MessageCalendar struct { + meta + // Total number of found messages + TotalCount int32 `json:"total_count"` + // Information about messages sent + Days []*MessageCalendarDay `json:"days"` +} + +func (entity *MessageCalendar) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageCalendar + + return json.Marshal((*stub)(entity)) +} + +func (*MessageCalendar) GetClass() string { + return ClassMessageCalendar +} + +func (*MessageCalendar) GetType() string { + return TypeMessageCalendar +} + +// Describes a message from a business account as received by a bot +type BusinessMessage struct { + meta + // The message + Message *Message `json:"message"` + // Message that is replied by the message in the same chat; may be null if none + ReplyToMessage *Message `json:"reply_to_message"` +} + +func (entity *BusinessMessage) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BusinessMessage + + return json.Marshal((*stub)(entity)) +} + +func (*BusinessMessage) GetClass() string { + return ClassBusinessMessage +} + +func (*BusinessMessage) GetType() string { + return TypeBusinessMessage +} + +// Contains a list of messages from a business account as received by a bot +type BusinessMessages struct { + meta + // List of business messages + Messages []*BusinessMessage `json:"messages"` +} + +func (entity *BusinessMessages) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BusinessMessages + + return json.Marshal((*stub)(entity)) +} + +func (*BusinessMessages) GetClass() string { + return ClassBusinessMessages +} + +func (*BusinessMessages) GetType() string { + return TypeBusinessMessages +} + +// The message is from a chat history +type MessageSourceChatHistory struct{ + meta +} + +func (entity *MessageSourceChatHistory) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageSourceChatHistory + + return json.Marshal((*stub)(entity)) +} + +func (*MessageSourceChatHistory) GetClass() string { + return ClassMessageSource +} + +func (*MessageSourceChatHistory) GetType() string { + return TypeMessageSourceChatHistory +} + +func (*MessageSourceChatHistory) MessageSourceType() string { + return TypeMessageSourceChatHistory +} + +// The message is from a message thread history +type MessageSourceMessageThreadHistory struct{ + meta +} + +func (entity *MessageSourceMessageThreadHistory) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageSourceMessageThreadHistory + + return json.Marshal((*stub)(entity)) +} + +func (*MessageSourceMessageThreadHistory) GetClass() string { + return ClassMessageSource +} + +func (*MessageSourceMessageThreadHistory) GetType() string { + return TypeMessageSourceMessageThreadHistory +} + +func (*MessageSourceMessageThreadHistory) MessageSourceType() string { + return TypeMessageSourceMessageThreadHistory +} + +// The message is from a forum topic history +type MessageSourceForumTopicHistory struct{ + meta +} + +func (entity *MessageSourceForumTopicHistory) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageSourceForumTopicHistory + + return json.Marshal((*stub)(entity)) +} + +func (*MessageSourceForumTopicHistory) GetClass() string { + return ClassMessageSource +} + +func (*MessageSourceForumTopicHistory) GetType() string { + return TypeMessageSourceForumTopicHistory +} + +func (*MessageSourceForumTopicHistory) MessageSourceType() string { + return TypeMessageSourceForumTopicHistory +} + +// The message is from chat, message thread or forum topic history preview +type MessageSourceHistoryPreview struct{ + meta +} + +func (entity *MessageSourceHistoryPreview) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageSourceHistoryPreview + + return json.Marshal((*stub)(entity)) +} + +func (*MessageSourceHistoryPreview) GetClass() string { + return ClassMessageSource +} + +func (*MessageSourceHistoryPreview) GetType() string { + return TypeMessageSourceHistoryPreview +} + +func (*MessageSourceHistoryPreview) MessageSourceType() string { + return TypeMessageSourceHistoryPreview +} + +// The message is from a chat list or a forum topic list +type MessageSourceChatList struct{ + meta +} + +func (entity *MessageSourceChatList) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageSourceChatList + + return json.Marshal((*stub)(entity)) +} + +func (*MessageSourceChatList) GetClass() string { + return ClassMessageSource +} + +func (*MessageSourceChatList) GetType() string { + return TypeMessageSourceChatList +} + +func (*MessageSourceChatList) MessageSourceType() string { + return TypeMessageSourceChatList +} + +// The message is from search results, including file downloads, local file list, outgoing document messages, calendar +type MessageSourceSearch struct{ + meta +} + +func (entity *MessageSourceSearch) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageSourceSearch + + return json.Marshal((*stub)(entity)) +} + +func (*MessageSourceSearch) GetClass() string { + return ClassMessageSource +} + +func (*MessageSourceSearch) GetType() string { + return TypeMessageSourceSearch +} + +func (*MessageSourceSearch) MessageSourceType() string { + return TypeMessageSourceSearch +} + +// The message is from a chat event log +type MessageSourceChatEventLog struct{ + meta +} + +func (entity *MessageSourceChatEventLog) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageSourceChatEventLog + + return json.Marshal((*stub)(entity)) +} + +func (*MessageSourceChatEventLog) GetClass() string { + return ClassMessageSource +} + +func (*MessageSourceChatEventLog) GetType() string { + return TypeMessageSourceChatEventLog +} + +func (*MessageSourceChatEventLog) MessageSourceType() string { + return TypeMessageSourceChatEventLog +} + +// The message is from a notification +type MessageSourceNotification struct{ + meta +} + +func (entity *MessageSourceNotification) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageSourceNotification + + return json.Marshal((*stub)(entity)) +} + +func (*MessageSourceNotification) GetClass() string { + return ClassMessageSource +} + +func (*MessageSourceNotification) GetType() string { + return TypeMessageSourceNotification +} + +func (*MessageSourceNotification) MessageSourceType() string { + return TypeMessageSourceNotification +} + +// The message was screenshotted; the source must be used only if the message content was visible during the screenshot +type MessageSourceScreenshot struct{ + meta +} + +func (entity *MessageSourceScreenshot) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageSourceScreenshot + + return json.Marshal((*stub)(entity)) +} + +func (*MessageSourceScreenshot) GetClass() string { + return ClassMessageSource +} + +func (*MessageSourceScreenshot) GetType() string { + return TypeMessageSourceScreenshot +} + +func (*MessageSourceScreenshot) MessageSourceType() string { + return TypeMessageSourceScreenshot +} + +// The message is from some other source +type MessageSourceOther struct{ + meta +} + +func (entity *MessageSourceOther) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageSourceOther + + return json.Marshal((*stub)(entity)) +} + +func (*MessageSourceOther) GetClass() string { + return ClassMessageSource +} + +func (*MessageSourceOther) GetType() string { + return TypeMessageSourceOther +} + +func (*MessageSourceOther) MessageSourceType() string { + return TypeMessageSourceOther +} + +// The sponsor is a bot +type MessageSponsorTypeBot struct { + meta + // User identifier of the bot + BotUserId int64 `json:"bot_user_id"` + // An internal link to be opened when the sponsored message is clicked + Link InternalLinkType `json:"link"` +} + +func (entity *MessageSponsorTypeBot) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageSponsorTypeBot + + return json.Marshal((*stub)(entity)) +} + +func (*MessageSponsorTypeBot) GetClass() string { + return ClassMessageSponsorType +} + +func (*MessageSponsorTypeBot) GetType() string { + return TypeMessageSponsorTypeBot +} + +func (*MessageSponsorTypeBot) MessageSponsorTypeType() string { + return TypeMessageSponsorTypeBot +} + +func (messageSponsorTypeBot *MessageSponsorTypeBot) UnmarshalJSON(data []byte) error { + var tmp struct { + BotUserId int64 `json:"bot_user_id"` + Link json.RawMessage `json:"link"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + messageSponsorTypeBot.BotUserId = tmp.BotUserId + + fieldLink, _ := UnmarshalInternalLinkType(tmp.Link) + messageSponsorTypeBot.Link = fieldLink + + return nil +} + +// The sponsor is a web app +type MessageSponsorTypeWebApp struct { + meta + // Web App title + WebAppTitle string `json:"web_app_title"` + // An internal link to be opened when the sponsored message is clicked + Link InternalLinkType `json:"link"` +} + +func (entity *MessageSponsorTypeWebApp) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageSponsorTypeWebApp + + return json.Marshal((*stub)(entity)) +} + +func (*MessageSponsorTypeWebApp) GetClass() string { + return ClassMessageSponsorType +} + +func (*MessageSponsorTypeWebApp) GetType() string { + return TypeMessageSponsorTypeWebApp +} + +func (*MessageSponsorTypeWebApp) MessageSponsorTypeType() string { + return TypeMessageSponsorTypeWebApp +} + +func (messageSponsorTypeWebApp *MessageSponsorTypeWebApp) UnmarshalJSON(data []byte) error { + var tmp struct { + WebAppTitle string `json:"web_app_title"` + Link json.RawMessage `json:"link"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + messageSponsorTypeWebApp.WebAppTitle = tmp.WebAppTitle + + fieldLink, _ := UnmarshalInternalLinkType(tmp.Link) + messageSponsorTypeWebApp.Link = fieldLink + + return nil +} + +// The sponsor is a public channel chat +type MessageSponsorTypePublicChannel struct { + meta + // Sponsor chat identifier + ChatId int64 `json:"chat_id"` + // An internal link to be opened when the sponsored message is clicked; may be null if the sponsor chat needs to be opened instead + Link InternalLinkType `json:"link"` +} + +func (entity *MessageSponsorTypePublicChannel) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageSponsorTypePublicChannel + + return json.Marshal((*stub)(entity)) +} + +func (*MessageSponsorTypePublicChannel) GetClass() string { + return ClassMessageSponsorType +} + +func (*MessageSponsorTypePublicChannel) GetType() string { + return TypeMessageSponsorTypePublicChannel +} + +func (*MessageSponsorTypePublicChannel) MessageSponsorTypeType() string { + return TypeMessageSponsorTypePublicChannel +} + +func (messageSponsorTypePublicChannel *MessageSponsorTypePublicChannel) UnmarshalJSON(data []byte) error { + var tmp struct { + ChatId int64 `json:"chat_id"` + Link json.RawMessage `json:"link"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + messageSponsorTypePublicChannel.ChatId = tmp.ChatId + + fieldLink, _ := UnmarshalInternalLinkType(tmp.Link) + messageSponsorTypePublicChannel.Link = fieldLink + + return nil +} + +// The sponsor is a private channel chat +type MessageSponsorTypePrivateChannel struct { + meta + // Title of the chat + Title string `json:"title"` + // Invite link for the channel + InviteLink string `json:"invite_link"` +} + +func (entity *MessageSponsorTypePrivateChannel) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageSponsorTypePrivateChannel + + return json.Marshal((*stub)(entity)) +} + +func (*MessageSponsorTypePrivateChannel) GetClass() string { + return ClassMessageSponsorType +} + +func (*MessageSponsorTypePrivateChannel) GetType() string { + return TypeMessageSponsorTypePrivateChannel +} + +func (*MessageSponsorTypePrivateChannel) MessageSponsorTypeType() string { + return TypeMessageSponsorTypePrivateChannel +} + +// The sponsor is a website +type MessageSponsorTypeWebsite struct { + meta + // URL of the website + Url string `json:"url"` + // Name of the website + Name string `json:"name"` +} + +func (entity *MessageSponsorTypeWebsite) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageSponsorTypeWebsite + + return json.Marshal((*stub)(entity)) +} + +func (*MessageSponsorTypeWebsite) GetClass() string { + return ClassMessageSponsorType +} + +func (*MessageSponsorTypeWebsite) GetType() string { + return TypeMessageSponsorTypeWebsite +} + +func (*MessageSponsorTypeWebsite) MessageSponsorTypeType() string { + return TypeMessageSponsorTypeWebsite +} + +// Information about the sponsor of a message +type MessageSponsor struct { + meta + // Type of the sponsor + Type MessageSponsorType `json:"type"` + // Photo of the sponsor; may be null if must not be shown + Photo *ChatPhotoInfo `json:"photo"` + // Additional optional information about the sponsor to be shown along with the message + Info string `json:"info"` +} + +func (entity *MessageSponsor) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageSponsor + + return json.Marshal((*stub)(entity)) +} + +func (*MessageSponsor) GetClass() string { + return ClassMessageSponsor +} + +func (*MessageSponsor) GetType() string { + return TypeMessageSponsor +} + +func (messageSponsor *MessageSponsor) UnmarshalJSON(data []byte) error { + var tmp struct { + Type json.RawMessage `json:"type"` + Photo *ChatPhotoInfo `json:"photo"` + Info string `json:"info"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + messageSponsor.Photo = tmp.Photo + messageSponsor.Info = tmp.Info + + fieldType, _ := UnmarshalMessageSponsorType(tmp.Type) + messageSponsor.Type = fieldType + + return nil +} + +// Describes a sponsored message +type SponsoredMessage struct { + meta + // Message identifier; unique for the chat to which the sponsored message belongs among both ordinary and sponsored messages + MessageId int64 `json:"message_id"` + // True, if the message needs to be labeled as "recommended" instead of "sponsored" + IsRecommended bool `json:"is_recommended"` + // True, if the message can be reported to Telegram moderators through reportChatSponsoredMessage + CanBeReported bool `json:"can_be_reported"` + // Content of the message. Currently, can be only of the type messageText + Content MessageContent `json:"content"` + // Information about the sponsor of the message + Sponsor *MessageSponsor `json:"sponsor"` + // If non-empty, text for the message action button + ButtonText string `json:"button_text"` + // If non-empty, additional information about the sponsored message to be shown along with the message + AdditionalInfo string `json:"additional_info"` +} + +func (entity *SponsoredMessage) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SponsoredMessage + + return json.Marshal((*stub)(entity)) +} + +func (*SponsoredMessage) GetClass() string { + return ClassSponsoredMessage +} + +func (*SponsoredMessage) GetType() string { + return TypeSponsoredMessage +} + +func (sponsoredMessage *SponsoredMessage) UnmarshalJSON(data []byte) error { + var tmp struct { + MessageId int64 `json:"message_id"` + IsRecommended bool `json:"is_recommended"` + CanBeReported bool `json:"can_be_reported"` + Content json.RawMessage `json:"content"` + Sponsor *MessageSponsor `json:"sponsor"` + ButtonText string `json:"button_text"` + AdditionalInfo string `json:"additional_info"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + sponsoredMessage.MessageId = tmp.MessageId + sponsoredMessage.IsRecommended = tmp.IsRecommended + sponsoredMessage.CanBeReported = tmp.CanBeReported + sponsoredMessage.Sponsor = tmp.Sponsor + sponsoredMessage.ButtonText = tmp.ButtonText + sponsoredMessage.AdditionalInfo = tmp.AdditionalInfo + + fieldContent, _ := UnmarshalMessageContent(tmp.Content) + sponsoredMessage.Content = fieldContent + + return nil +} + +// Contains a list of sponsored messages +type SponsoredMessages struct { + meta + // List of sponsored messages + Messages []*SponsoredMessage `json:"messages"` + // The minimum number of messages between shown sponsored messages, or 0 if only one sponsored message must be shown after all ordinary messages + MessagesBetween int32 `json:"messages_between"` +} + +func (entity *SponsoredMessages) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SponsoredMessages + + return json.Marshal((*stub)(entity)) +} + +func (*SponsoredMessages) GetClass() string { + return ClassSponsoredMessages +} + +func (*SponsoredMessages) GetType() string { + return TypeSponsoredMessages +} + +// Describes an option to report a sponsored message +type ReportChatSponsoredMessageOption struct { + meta + // Unique identifier of the option + Id []byte `json:"id"` + // Text of the option + Text string `json:"text"` +} + +func (entity *ReportChatSponsoredMessageOption) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ReportChatSponsoredMessageOption + + return json.Marshal((*stub)(entity)) +} + +func (*ReportChatSponsoredMessageOption) GetClass() string { + return ClassReportChatSponsoredMessageOption +} + +func (*ReportChatSponsoredMessageOption) GetType() string { + return TypeReportChatSponsoredMessageOption +} + +// The message was reported successfully +type ReportChatSponsoredMessageResultOk struct{ + meta +} + +func (entity *ReportChatSponsoredMessageResultOk) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ReportChatSponsoredMessageResultOk + + return json.Marshal((*stub)(entity)) +} + +func (*ReportChatSponsoredMessageResultOk) GetClass() string { + return ClassReportChatSponsoredMessageResult +} + +func (*ReportChatSponsoredMessageResultOk) GetType() string { + return TypeReportChatSponsoredMessageResultOk +} + +func (*ReportChatSponsoredMessageResultOk) ReportChatSponsoredMessageResultType() string { + return TypeReportChatSponsoredMessageResultOk +} + +// The sponsored message is too old or not found +type ReportChatSponsoredMessageResultFailed struct{ + meta +} + +func (entity *ReportChatSponsoredMessageResultFailed) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ReportChatSponsoredMessageResultFailed + + return json.Marshal((*stub)(entity)) +} + +func (*ReportChatSponsoredMessageResultFailed) GetClass() string { + return ClassReportChatSponsoredMessageResult +} + +func (*ReportChatSponsoredMessageResultFailed) GetType() string { + return TypeReportChatSponsoredMessageResultFailed +} + +func (*ReportChatSponsoredMessageResultFailed) ReportChatSponsoredMessageResultType() string { + return TypeReportChatSponsoredMessageResultFailed +} + +// The user must choose an option to report the message and repeat request with the chosen option +type ReportChatSponsoredMessageResultOptionRequired struct { + meta + // Title for the option choice + Title string `json:"title"` + // List of available options + Options []*ReportChatSponsoredMessageOption `json:"options"` +} + +func (entity *ReportChatSponsoredMessageResultOptionRequired) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ReportChatSponsoredMessageResultOptionRequired + + return json.Marshal((*stub)(entity)) +} + +func (*ReportChatSponsoredMessageResultOptionRequired) GetClass() string { + return ClassReportChatSponsoredMessageResult +} + +func (*ReportChatSponsoredMessageResultOptionRequired) GetType() string { + return TypeReportChatSponsoredMessageResultOptionRequired +} + +func (*ReportChatSponsoredMessageResultOptionRequired) ReportChatSponsoredMessageResultType() string { + return TypeReportChatSponsoredMessageResultOptionRequired +} + +// Sponsored messages were hidden for the user in all chats +type ReportChatSponsoredMessageResultAdsHidden struct{ + meta +} + +func (entity *ReportChatSponsoredMessageResultAdsHidden) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ReportChatSponsoredMessageResultAdsHidden + + return json.Marshal((*stub)(entity)) +} + +func (*ReportChatSponsoredMessageResultAdsHidden) GetClass() string { + return ClassReportChatSponsoredMessageResult +} + +func (*ReportChatSponsoredMessageResultAdsHidden) GetType() string { + return TypeReportChatSponsoredMessageResultAdsHidden +} + +func (*ReportChatSponsoredMessageResultAdsHidden) ReportChatSponsoredMessageResultType() string { + return TypeReportChatSponsoredMessageResultAdsHidden +} + +// The user asked to hide sponsored messages, but Telegram Premium is required for this +type ReportChatSponsoredMessageResultPremiumRequired struct{ + meta +} + +func (entity *ReportChatSponsoredMessageResultPremiumRequired) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ReportChatSponsoredMessageResultPremiumRequired + + return json.Marshal((*stub)(entity)) +} + +func (*ReportChatSponsoredMessageResultPremiumRequired) GetClass() string { + return ClassReportChatSponsoredMessageResult +} + +func (*ReportChatSponsoredMessageResultPremiumRequired) GetType() string { + return TypeReportChatSponsoredMessageResultPremiumRequired +} + +func (*ReportChatSponsoredMessageResultPremiumRequired) ReportChatSponsoredMessageResultType() string { + return TypeReportChatSponsoredMessageResultPremiumRequired +} + +// 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, then 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 +} + +// Notification settings applied to all private and secret chats when the corresponding chat setting has a default value +type NotificationSettingsScopePrivateChats struct{ + meta +} + +func (entity *NotificationSettingsScopePrivateChats) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub NotificationSettingsScopePrivateChats + + return json.Marshal((*stub)(entity)) +} + +func (*NotificationSettingsScopePrivateChats) GetClass() string { + return ClassNotificationSettingsScope +} + +func (*NotificationSettingsScopePrivateChats) GetType() string { + return TypeNotificationSettingsScopePrivateChats +} + +func (*NotificationSettingsScopePrivateChats) NotificationSettingsScopeType() string { + return TypeNotificationSettingsScopePrivateChats +} + +// Notification settings applied to all basic group and supergroup chats when the corresponding chat setting has a default value +type NotificationSettingsScopeGroupChats struct{ + meta +} + +func (entity *NotificationSettingsScopeGroupChats) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub NotificationSettingsScopeGroupChats + + return json.Marshal((*stub)(entity)) +} + +func (*NotificationSettingsScopeGroupChats) GetClass() string { + return ClassNotificationSettingsScope +} + +func (*NotificationSettingsScopeGroupChats) GetType() string { + return TypeNotificationSettingsScopeGroupChats +} + +func (*NotificationSettingsScopeGroupChats) NotificationSettingsScopeType() string { + return TypeNotificationSettingsScopeGroupChats +} + +// Notification settings applied to all channel chats when the corresponding chat setting has a default value +type NotificationSettingsScopeChannelChats struct{ + meta +} + +func (entity *NotificationSettingsScopeChannelChats) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub NotificationSettingsScopeChannelChats + + return json.Marshal((*stub)(entity)) +} + +func (*NotificationSettingsScopeChannelChats) GetClass() string { + return ClassNotificationSettingsScope +} + +func (*NotificationSettingsScopeChannelChats) GetType() string { + return TypeNotificationSettingsScopeChannelChats +} + +func (*NotificationSettingsScopeChannelChats) NotificationSettingsScopeType() string { + return TypeNotificationSettingsScopeChannelChats +} + +// Contains information about notification settings for a chat or a forum topic +type ChatNotificationSettings struct { + meta + // If true, the value for the relevant type of chat or the forum chat is used instead of mute_for + UseDefaultMuteFor bool `json:"use_default_mute_for"` + // Time left before notifications will be unmuted, in seconds + MuteFor int32 `json:"mute_for"` + // If true, the value for the relevant type of chat or the forum chat is used instead of sound_id + UseDefaultSound bool `json:"use_default_sound"` + // Identifier of the notification sound to be played for messages; 0 if sound is disabled + SoundId JsonInt64 `json:"sound_id"` + // If true, the value for the relevant type of chat or the forum chat is used instead of show_preview + UseDefaultShowPreview bool `json:"use_default_show_preview"` + // True, if message content must be displayed in notifications + ShowPreview bool `json:"show_preview"` + // If true, the value for the relevant type of chat is used instead of mute_stories + UseDefaultMuteStories bool `json:"use_default_mute_stories"` + // True, if story notifications are disabled for the chat + MuteStories bool `json:"mute_stories"` + // If true, the value for the relevant type of chat is used instead of story_sound_id + UseDefaultStorySound bool `json:"use_default_story_sound"` + // Identifier of the notification sound to be played for stories; 0 if sound is disabled + StorySoundId JsonInt64 `json:"story_sound_id"` + // If true, the value for the relevant type of chat is used instead of show_story_sender + UseDefaultShowStorySender bool `json:"use_default_show_story_sender"` + // True, if the sender of stories must be displayed in notifications + ShowStorySender bool `json:"show_story_sender"` + // If true, the value for the relevant type of chat or the forum chat is used instead of disable_pinned_message_notifications + 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, the value for the relevant type of chat or the forum chat is used instead of disable_mention_notifications + 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"` +} + +func (entity *ChatNotificationSettings) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatNotificationSettings + + return json.Marshal((*stub)(entity)) +} + +func (*ChatNotificationSettings) GetClass() string { + return ClassChatNotificationSettings +} + +func (*ChatNotificationSettings) GetType() string { + return TypeChatNotificationSettings +} + +// Contains information about notification settings for several chats +type ScopeNotificationSettings struct { + meta + // Time left before notifications will be unmuted, in seconds + MuteFor int32 `json:"mute_for"` + // Identifier of the notification sound to be played; 0 if sound is disabled + SoundId JsonInt64 `json:"sound_id"` + // True, if message content must be displayed in notifications + ShowPreview bool `json:"show_preview"` + // If true, story notifications are received only for the first 5 chats from topChatCategoryUsers regardless of the value of mute_stories + UseDefaultMuteStories bool `json:"use_default_mute_stories"` + // True, if story notifications are disabled + MuteStories bool `json:"mute_stories"` + // Identifier of the notification sound to be played for stories; 0 if sound is disabled + StorySoundId JsonInt64 `json:"story_sound_id"` + // True, if the sender of stories must be displayed in notifications + ShowStorySender bool `json:"show_story_sender"` + // 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"` +} + +func (entity *ScopeNotificationSettings) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ScopeNotificationSettings + + return json.Marshal((*stub)(entity)) +} + +func (*ScopeNotificationSettings) GetClass() string { + return ClassScopeNotificationSettings +} + +func (*ScopeNotificationSettings) GetType() string { + return TypeScopeNotificationSettings +} + +// Contains information about a message draft +type DraftMessage struct { + meta + // Information about the message to be replied; must be of the type inputMessageReplyToMessage; may be null if none + ReplyTo InputMessageReplyTo `json:"reply_to"` + // 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, inputMessageVideoNote, or inputMessageVoiceNote + InputMessageText InputMessageContent `json:"input_message_text"` +} + +func (entity *DraftMessage) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub DraftMessage + + return json.Marshal((*stub)(entity)) +} + +func (*DraftMessage) GetClass() string { + return ClassDraftMessage +} + +func (*DraftMessage) GetType() string { + return TypeDraftMessage +} + +func (draftMessage *DraftMessage) UnmarshalJSON(data []byte) error { + var tmp struct { + ReplyTo json.RawMessage `json:"reply_to"` + Date int32 `json:"date"` + InputMessageText json.RawMessage `json:"input_message_text"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + draftMessage.Date = tmp.Date + + fieldReplyTo, _ := UnmarshalInputMessageReplyTo(tmp.ReplyTo) + draftMessage.ReplyTo = fieldReplyTo + + fieldInputMessageText, _ := UnmarshalInputMessageContent(tmp.InputMessageText) + draftMessage.InputMessageText = fieldInputMessageText + + return nil +} + +// An ordinary chat with a user +type ChatTypePrivate struct { + meta + // User identifier + UserId int64 `json:"user_id"` +} + +func (entity *ChatTypePrivate) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatTypePrivate + + return json.Marshal((*stub)(entity)) +} + +func (*ChatTypePrivate) GetClass() string { + return ClassChatType +} + +func (*ChatTypePrivate) GetType() string { + return TypeChatTypePrivate +} + +func (*ChatTypePrivate) ChatTypeType() string { + return TypeChatTypePrivate +} + +// A basic group (a chat with 0-200 other users) +type ChatTypeBasicGroup struct { + meta + // Basic group identifier + BasicGroupId int64 `json:"basic_group_id"` +} + +func (entity *ChatTypeBasicGroup) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatTypeBasicGroup + + return json.Marshal((*stub)(entity)) +} + +func (*ChatTypeBasicGroup) GetClass() string { + return ClassChatType +} + +func (*ChatTypeBasicGroup) GetType() string { + return TypeChatTypeBasicGroup +} + +func (*ChatTypeBasicGroup) ChatTypeType() string { + return TypeChatTypeBasicGroup +} + +// A supergroup or channel (with unlimited members) +type ChatTypeSupergroup struct { + meta + // Supergroup or channel identifier + SupergroupId int64 `json:"supergroup_id"` + // True, if the supergroup is a channel + IsChannel bool `json:"is_channel"` +} + +func (entity *ChatTypeSupergroup) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatTypeSupergroup + + return json.Marshal((*stub)(entity)) +} + +func (*ChatTypeSupergroup) GetClass() string { + return ClassChatType +} + +func (*ChatTypeSupergroup) GetType() string { + return TypeChatTypeSupergroup +} + +func (*ChatTypeSupergroup) ChatTypeType() string { + return TypeChatTypeSupergroup +} + +// A secret chat with a user +type ChatTypeSecret struct { + meta + // Secret chat identifier + SecretChatId int32 `json:"secret_chat_id"` + // User identifier of the other user in the secret chat + UserId int64 `json:"user_id"` +} + +func (entity *ChatTypeSecret) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatTypeSecret + + return json.Marshal((*stub)(entity)) +} + +func (*ChatTypeSecret) GetClass() string { + return ClassChatType +} + +func (*ChatTypeSecret) GetType() string { + return TypeChatTypeSecret +} + +func (*ChatTypeSecret) ChatTypeType() string { + return TypeChatTypeSecret +} + +// Represents an icon for a chat folder +type ChatFolderIcon struct { + meta + // The chosen icon name for short folder 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", "Airplane", "Book", "Light", "Like", "Money", "Note", "Palette" + Name string `json:"name"` +} + +func (entity *ChatFolderIcon) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatFolderIcon + + return json.Marshal((*stub)(entity)) +} + +func (*ChatFolderIcon) GetClass() string { + return ClassChatFolderIcon +} + +func (*ChatFolderIcon) GetType() string { + return TypeChatFolderIcon +} + +// Represents a folder for user chats +type ChatFolder struct { + meta + // The title of the folder; 1-12 characters without line feeds + Title string `json:"title"` + // The chosen icon for the chat folder; may be null. If null, use getChatFolderDefaultIconName to get default icon name for the folder + Icon *ChatFolderIcon `json:"icon"` + // The identifier of the chosen color for the chat folder icon; from -1 to 6. If -1, then color is didabled. Can't be changed if folder tags are disabled or the current user doesn't have Telegram Premium subscription + ColorId int32 `json:"color_id"` + // True, if at least one link has been created for the folder + IsShareable bool `json:"is_shareable"` + // The chat identifiers of pinned chats in the folder. There can be up to getOption("chat_folder_chosen_chat_count_max") pinned and always included non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium + PinnedChatIds []int64 `json:"pinned_chat_ids"` + // The chat identifiers of always included chats in the folder. There can be up to getOption("chat_folder_chosen_chat_count_max") pinned and always included non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium + IncludedChatIds []int64 `json:"included_chat_ids"` + // The chat identifiers of always excluded chats in the folder. There can be up to getOption("chat_folder_chosen_chat_count_max") always excluded non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium + 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"` +} + +func (entity *ChatFolder) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatFolder + + return json.Marshal((*stub)(entity)) +} + +func (*ChatFolder) GetClass() string { + return ClassChatFolder +} + +func (*ChatFolder) GetType() string { + return TypeChatFolder +} + +// Contains basic information about a chat folder +type ChatFolderInfo struct { + meta + // Unique chat folder identifier + Id int32 `json:"id"` + // The title of the folder; 1-12 characters without line feeds + Title string `json:"title"` + // The chosen or default icon for the chat folder + Icon *ChatFolderIcon `json:"icon"` + // The identifier of the chosen color for the chat folder icon; from -1 to 6. If -1, then color is didabled + ColorId int32 `json:"color_id"` + // True, if at least one link has been created for the folder + IsShareable bool `json:"is_shareable"` + // True, if the chat folder has invite links created by the current user + HasMyInviteLinks bool `json:"has_my_invite_links"` +} + +func (entity *ChatFolderInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatFolderInfo + + return json.Marshal((*stub)(entity)) +} + +func (*ChatFolderInfo) GetClass() string { + return ClassChatFolderInfo +} + +func (*ChatFolderInfo) GetType() string { + return TypeChatFolderInfo +} + +// Contains a chat folder invite link +type ChatFolderInviteLink struct { + meta + // The chat folder invite link + InviteLink string `json:"invite_link"` + // Name of the link + Name string `json:"name"` + // Identifiers of chats, included in the link + ChatIds []int64 `json:"chat_ids"` +} + +func (entity *ChatFolderInviteLink) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatFolderInviteLink + + return json.Marshal((*stub)(entity)) +} + +func (*ChatFolderInviteLink) GetClass() string { + return ClassChatFolderInviteLink +} + +func (*ChatFolderInviteLink) GetType() string { + return TypeChatFolderInviteLink +} + +// Represents a list of chat folder invite links +type ChatFolderInviteLinks struct { + meta + // List of the invite links + InviteLinks []*ChatFolderInviteLink `json:"invite_links"` +} + +func (entity *ChatFolderInviteLinks) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatFolderInviteLinks + + return json.Marshal((*stub)(entity)) +} + +func (*ChatFolderInviteLinks) GetClass() string { + return ClassChatFolderInviteLinks +} + +func (*ChatFolderInviteLinks) GetType() string { + return TypeChatFolderInviteLinks +} + +// Contains information about an invite link to a chat folder +type ChatFolderInviteLinkInfo struct { + meta + // Basic information about the chat folder; chat folder identifier will be 0 if the user didn't have the chat folder yet + ChatFolderInfo *ChatFolderInfo `json:"chat_folder_info"` + // Identifiers of the chats from the link, which aren't added to the folder yet + MissingChatIds []int64 `json:"missing_chat_ids"` + // Identifiers of the chats from the link, which are added to the folder already + AddedChatIds []int64 `json:"added_chat_ids"` +} + +func (entity *ChatFolderInviteLinkInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatFolderInviteLinkInfo + + return json.Marshal((*stub)(entity)) +} + +func (*ChatFolderInviteLinkInfo) GetClass() string { + return ClassChatFolderInviteLinkInfo +} + +func (*ChatFolderInviteLinkInfo) GetType() string { + return TypeChatFolderInviteLinkInfo +} + +// Describes a recommended chat folder +type RecommendedChatFolder struct { + meta + // The chat folder + Folder *ChatFolder `json:"folder"` + // Chat folder description + Description string `json:"description"` +} + +func (entity *RecommendedChatFolder) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub RecommendedChatFolder + + return json.Marshal((*stub)(entity)) +} + +func (*RecommendedChatFolder) GetClass() string { + return ClassRecommendedChatFolder +} + +func (*RecommendedChatFolder) GetType() string { + return TypeRecommendedChatFolder +} + +// Contains a list of recommended chat folders +type RecommendedChatFolders struct { + meta + // List of recommended chat folders + ChatFolders []*RecommendedChatFolder `json:"chat_folders"` +} + +func (entity *RecommendedChatFolders) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub RecommendedChatFolders + + return json.Marshal((*stub)(entity)) +} + +func (*RecommendedChatFolders) GetClass() string { + return ClassRecommendedChatFolders +} + +func (*RecommendedChatFolders) GetType() string { + return TypeRecommendedChatFolders +} + +// Contains settings for automatic moving of chats to and from the Archive chat lists +type ArchiveChatListSettings struct { + meta + // True, if new chats from non-contacts will be automatically archived and muted. Can be set to true only if the option "can_archive_and_mute_new_chats_from_unknown_users" is true + ArchiveAndMuteNewChatsFromUnknownUsers bool `json:"archive_and_mute_new_chats_from_unknown_users"` + // True, if unmuted chats will be kept in the Archive chat list when they get a new message + KeepUnmutedChatsArchived bool `json:"keep_unmuted_chats_archived"` + // True, if unmuted chats, that are always included or pinned in a folder, will be kept in the Archive chat list when they get a new message. Ignored if keep_unmuted_chats_archived == true + KeepChatsFromFoldersArchived bool `json:"keep_chats_from_folders_archived"` +} + +func (entity *ArchiveChatListSettings) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ArchiveChatListSettings + + return json.Marshal((*stub)(entity)) +} + +func (*ArchiveChatListSettings) GetClass() string { + return ClassArchiveChatListSettings +} + +func (*ArchiveChatListSettings) GetType() string { + return TypeArchiveChatListSettings +} + +// A main list of chats +type ChatListMain struct{ + meta +} + +func (entity *ChatListMain) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatListMain + + return json.Marshal((*stub)(entity)) +} + +func (*ChatListMain) GetClass() string { + return ClassChatList +} + +func (*ChatListMain) GetType() string { + return TypeChatListMain +} + +func (*ChatListMain) ChatListType() string { + return TypeChatListMain +} + +// 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 +type ChatListArchive struct{ + meta +} + +func (entity *ChatListArchive) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatListArchive + + return json.Marshal((*stub)(entity)) +} + +func (*ChatListArchive) GetClass() string { + return ClassChatList +} + +func (*ChatListArchive) GetType() string { + return TypeChatListArchive +} + +func (*ChatListArchive) ChatListType() string { + return TypeChatListArchive +} + +// A list of chats added to a chat folder +type ChatListFolder struct { + meta + // Chat folder identifier + ChatFolderId int32 `json:"chat_folder_id"` +} + +func (entity *ChatListFolder) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatListFolder + + return json.Marshal((*stub)(entity)) +} + +func (*ChatListFolder) GetClass() string { + return ClassChatList +} + +func (*ChatListFolder) GetType() string { + return TypeChatListFolder +} + +func (*ChatListFolder) ChatListType() string { + return TypeChatListFolder +} + +// Contains a list of chat lists +type ChatLists struct { + meta + // List of chat lists + ChatLists []ChatList `json:"chat_lists"` +} + +func (entity *ChatLists) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatLists + + return json.Marshal((*stub)(entity)) +} + +func (*ChatLists) GetClass() string { + return ClassChatLists +} + +func (*ChatLists) GetType() string { + return TypeChatLists +} + +func (chatLists *ChatLists) UnmarshalJSON(data []byte) error { + var tmp struct { + ChatLists []json.RawMessage `json:"chat_lists"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldChatLists, _ := UnmarshalListOfChatList(tmp.ChatLists) + chatLists.ChatLists = fieldChatLists + + return nil +} + +// The chat is sponsored by the user's MTProxy server +type ChatSourceMtprotoProxy struct{ + meta +} + +func (entity *ChatSourceMtprotoProxy) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatSourceMtprotoProxy + + return json.Marshal((*stub)(entity)) +} + +func (*ChatSourceMtprotoProxy) GetClass() string { + return ClassChatSource +} + +func (*ChatSourceMtprotoProxy) GetType() string { + return TypeChatSourceMtprotoProxy +} + +func (*ChatSourceMtprotoProxy) ChatSourceType() string { + return TypeChatSourceMtprotoProxy +} + +// The chat contains a public service announcement +type ChatSourcePublicServiceAnnouncement struct { + meta + // The type of the announcement + Type string `json:"type"` + // The text of the announcement + Text string `json:"text"` +} + +func (entity *ChatSourcePublicServiceAnnouncement) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatSourcePublicServiceAnnouncement + + return json.Marshal((*stub)(entity)) +} + +func (*ChatSourcePublicServiceAnnouncement) GetClass() string { + return ClassChatSource +} + +func (*ChatSourcePublicServiceAnnouncement) GetType() string { + return TypeChatSourcePublicServiceAnnouncement +} + +func (*ChatSourcePublicServiceAnnouncement) ChatSourceType() string { + return TypeChatSourcePublicServiceAnnouncement +} + +// Describes a position of a chat in a chat list +type ChatPosition struct { + 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"` +} + +func (entity *ChatPosition) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatPosition + + return json.Marshal((*stub)(entity)) +} + +func (*ChatPosition) GetClass() string { + return ClassChatPosition +} + +func (*ChatPosition) GetType() string { + return TypeChatPosition +} + +func (chatPosition *ChatPosition) UnmarshalJSON(data []byte) error { + var tmp struct { + List json.RawMessage `json:"list"` + Order JsonInt64 `json:"order"` + IsPinned bool `json:"is_pinned"` + Source json.RawMessage `json:"source"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + chatPosition.Order = tmp.Order + chatPosition.IsPinned = tmp.IsPinned + + fieldList, _ := UnmarshalChatList(tmp.List) + chatPosition.List = fieldList + + fieldSource, _ := UnmarshalChatSource(tmp.Source) + chatPosition.Source = fieldSource + + return nil +} + +// All reactions are available in the chat +type ChatAvailableReactionsAll struct{ + meta +} + +func (entity *ChatAvailableReactionsAll) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatAvailableReactionsAll + + return json.Marshal((*stub)(entity)) +} + +func (*ChatAvailableReactionsAll) GetClass() string { + return ClassChatAvailableReactions +} + +func (*ChatAvailableReactionsAll) GetType() string { + return TypeChatAvailableReactionsAll +} + +func (*ChatAvailableReactionsAll) ChatAvailableReactionsType() string { + return TypeChatAvailableReactionsAll +} + +// Only specific reactions are available in the chat +type ChatAvailableReactionsSome struct { + meta + // The list of reactions + Reactions []ReactionType `json:"reactions"` +} + +func (entity *ChatAvailableReactionsSome) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatAvailableReactionsSome + + return json.Marshal((*stub)(entity)) +} + +func (*ChatAvailableReactionsSome) GetClass() string { + return ClassChatAvailableReactions +} + +func (*ChatAvailableReactionsSome) GetType() string { + return TypeChatAvailableReactionsSome +} + +func (*ChatAvailableReactionsSome) ChatAvailableReactionsType() string { + return TypeChatAvailableReactionsSome +} + +func (chatAvailableReactionsSome *ChatAvailableReactionsSome) UnmarshalJSON(data []byte) error { + var tmp struct { + Reactions []json.RawMessage `json:"reactions"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldReactions, _ := UnmarshalListOfReactionType(tmp.Reactions) + chatAvailableReactionsSome.Reactions = fieldReactions + + return nil +} + +// Represents a tag used in Saved Messages or a Saved Messages topic +type SavedMessagesTag struct { + meta + // The tag + Tag ReactionType `json:"tag"` + // Label of the tag; 0-12 characters. Always empty if the tag is returned for a Saved Messages topic + Label string `json:"label"` + // Number of times the tag was used; may be 0 if the tag has non-empty label + Count int32 `json:"count"` +} + +func (entity *SavedMessagesTag) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SavedMessagesTag + + return json.Marshal((*stub)(entity)) +} + +func (*SavedMessagesTag) GetClass() string { + return ClassSavedMessagesTag +} + +func (*SavedMessagesTag) GetType() string { + return TypeSavedMessagesTag +} + +func (savedMessagesTag *SavedMessagesTag) UnmarshalJSON(data []byte) error { + var tmp struct { + Tag json.RawMessage `json:"tag"` + Label string `json:"label"` + Count int32 `json:"count"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + savedMessagesTag.Label = tmp.Label + savedMessagesTag.Count = tmp.Count + + fieldTag, _ := UnmarshalReactionType(tmp.Tag) + savedMessagesTag.Tag = fieldTag + + return nil +} + +// Contains a list of tags used in Saved Messages +type SavedMessagesTags struct { + meta + // List of tags + Tags []*SavedMessagesTag `json:"tags"` +} + +func (entity *SavedMessagesTags) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SavedMessagesTags + + return json.Marshal((*stub)(entity)) +} + +func (*SavedMessagesTags) GetClass() string { + return ClassSavedMessagesTags +} + +func (*SavedMessagesTags) GetType() string { + return TypeSavedMessagesTags +} + +// Describes a video chat +type VideoChat struct { + 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"` +} + +func (entity *VideoChat) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub VideoChat + + return json.Marshal((*stub)(entity)) +} + +func (*VideoChat) GetClass() string { + return ClassVideoChat +} + +func (*VideoChat) GetType() string { + return TypeVideoChat +} + +func (videoChat *VideoChat) UnmarshalJSON(data []byte) error { + var tmp struct { + GroupCallId int32 `json:"group_call_id"` + HasParticipants bool `json:"has_participants"` + DefaultParticipantId json.RawMessage `json:"default_participant_id"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + videoChat.GroupCallId = tmp.GroupCallId + videoChat.HasParticipants = tmp.HasParticipants + + fieldDefaultParticipantId, _ := UnmarshalMessageSender(tmp.DefaultParticipantId) + videoChat.DefaultParticipantId = fieldDefaultParticipantId + + return nil +} + +// A chat. (Can be a private chat, basic group, supergroup, or secret chat) +type Chat struct { + 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"` + // Identifier of the accent color for message sender name, and backgrounds of chat photo, reply header, and link preview + AccentColorId int32 `json:"accent_color_id"` + // Identifier of a custom emoji to be shown on the reply header and link preview background for messages sent by the chat; 0 if none + BackgroundCustomEmojiId JsonInt64 `json:"background_custom_emoji_id"` + // Identifier of the profile accent color for the chat's profile; -1 if none + ProfileAccentColorId int32 `json:"profile_accent_color_id"` + // Identifier of a custom emoji to be shown on the background of the chat's profile; 0 if none + ProfileBackgroundCustomEmojiId JsonInt64 `json:"profile_background_custom_emoji_id"` + // 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 if none or unknown + LastMessage *Message `json:"last_message"` + // Positions of the chat in chat lists + Positions []*ChatPosition `json:"positions"` + // Chat lists to which the chat belongs. A chat can have a non-zero position in a chat list even it doesn't belong to the chat list and have no position in a chat list even it belongs to the chat list + ChatLists []ChatList `json:"chat_lists"` + // 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"` + // Block list to which the chat is added; may be null if none + BlockList BlockList `json:"block_list"` + // True, if chat content can't be saved locally, forwarded, or copied + HasProtectedContent bool `json:"has_protected_content"` + // True, if translation of all messages in the chat must be suggested to the user + IsTranslatable bool `json:"is_translatable"` + // True, if the chat is marked as unread + IsMarkedAsUnread bool `json:"is_marked_as_unread"` + // True, if the chat is a forum supergroup that must be shown in the "View as topics" mode, or Saved Messages chat that must be shown in the "View as chats" + ViewAsTopics bool `json:"view_as_topics"` + // 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"` + // Types of reaction, available in the chat + AvailableReactions ChatAvailableReactions `json:"available_reactions"` + // Current message auto-delete or self-destruct timer setting for the chat, in seconds; 0 if disabled. Self-destruct timer in secret chats starts after the message or its content is viewed. Auto-delete timer in other chats starts from the send date + MessageAutoDeleteTime int32 `json:"message_auto_delete_time"` + // Emoji status to be shown along with chat title; may be null + EmojiStatus *EmojiStatus `json:"emoji_status"` + // Background set for the chat; may be null if none + Background *ChatBackground `json:"background"` + // 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 if none + 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 if none + 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 if none + 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"` +} + +func (entity *Chat) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub Chat + + return json.Marshal((*stub)(entity)) +} + +func (*Chat) GetClass() string { + return ClassChat +} + +func (*Chat) GetType() string { + return TypeChat +} + +func (chat *Chat) UnmarshalJSON(data []byte) error { + var tmp struct { + Id int64 `json:"id"` + Type json.RawMessage `json:"type"` + Title string `json:"title"` + Photo *ChatPhotoInfo `json:"photo"` + AccentColorId int32 `json:"accent_color_id"` + BackgroundCustomEmojiId JsonInt64 `json:"background_custom_emoji_id"` + ProfileAccentColorId int32 `json:"profile_accent_color_id"` + ProfileBackgroundCustomEmojiId JsonInt64 `json:"profile_background_custom_emoji_id"` + Permissions *ChatPermissions `json:"permissions"` + LastMessage *Message `json:"last_message"` + Positions []*ChatPosition `json:"positions"` + ChatLists []json.RawMessage `json:"chat_lists"` + MessageSenderId json.RawMessage `json:"message_sender_id"` + BlockList json.RawMessage `json:"block_list"` + HasProtectedContent bool `json:"has_protected_content"` + IsTranslatable bool `json:"is_translatable"` + IsMarkedAsUnread bool `json:"is_marked_as_unread"` + ViewAsTopics bool `json:"view_as_topics"` + 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 json.RawMessage `json:"available_reactions"` + MessageAutoDeleteTime int32 `json:"message_auto_delete_time"` + EmojiStatus *EmojiStatus `json:"emoji_status"` + Background *ChatBackground `json:"background"` + 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.AccentColorId = tmp.AccentColorId + chat.BackgroundCustomEmojiId = tmp.BackgroundCustomEmojiId + chat.ProfileAccentColorId = tmp.ProfileAccentColorId + chat.ProfileBackgroundCustomEmojiId = tmp.ProfileBackgroundCustomEmojiId + chat.Permissions = tmp.Permissions + chat.LastMessage = tmp.LastMessage + chat.Positions = tmp.Positions + chat.HasProtectedContent = tmp.HasProtectedContent + chat.IsTranslatable = tmp.IsTranslatable + chat.IsMarkedAsUnread = tmp.IsMarkedAsUnread + chat.ViewAsTopics = tmp.ViewAsTopics + 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.MessageAutoDeleteTime = tmp.MessageAutoDeleteTime + chat.EmojiStatus = tmp.EmojiStatus + chat.Background = tmp.Background + 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 + + fieldChatLists, _ := UnmarshalListOfChatList(tmp.ChatLists) + chat.ChatLists = fieldChatLists + + fieldMessageSenderId, _ := UnmarshalMessageSender(tmp.MessageSenderId) + chat.MessageSenderId = fieldMessageSenderId + + fieldBlockList, _ := UnmarshalBlockList(tmp.BlockList) + chat.BlockList = fieldBlockList + + fieldAvailableReactions, _ := UnmarshalChatAvailableReactions(tmp.AvailableReactions) + chat.AvailableReactions = fieldAvailableReactions + + fieldActionBar, _ := UnmarshalChatActionBar(tmp.ActionBar) + chat.ActionBar = fieldActionBar + + return nil +} + +// Represents a list of chats +type Chats struct { + meta + // Approximate total number of chats found + TotalCount int32 `json:"total_count"` + // List of chat identifiers + ChatIds []int64 `json:"chat_ids"` +} + +func (entity *Chats) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub Chats + + return json.Marshal((*stub)(entity)) +} + +func (*Chats) GetClass() string { + return ClassChats +} + +func (*Chats) GetType() string { + return TypeChats +} + +// Describes a chat located nearby +type ChatNearby struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // Distance to the chat location, in meters + Distance int32 `json:"distance"` +} + +func (entity *ChatNearby) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatNearby + + return json.Marshal((*stub)(entity)) +} + +func (*ChatNearby) GetClass() string { + return ClassChatNearby +} + +func (*ChatNearby) GetType() string { + return TypeChatNearby +} + +// Represents a list of chats located nearby +type ChatsNearby struct { + meta + // List of users nearby + UsersNearby []*ChatNearby `json:"users_nearby"` + // List of location-based supergroups nearby + SupergroupsNearby []*ChatNearby `json:"supergroups_nearby"` +} + +func (entity *ChatsNearby) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatsNearby + + return json.Marshal((*stub)(entity)) +} + +func (*ChatsNearby) GetClass() string { + return ClassChatsNearby +} + +func (*ChatsNearby) GetType() string { + return TypeChatsNearby +} + +// The chat is public, because it has an active username +type PublicChatTypeHasUsername struct{ + meta +} + +func (entity *PublicChatTypeHasUsername) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PublicChatTypeHasUsername + + return json.Marshal((*stub)(entity)) +} + +func (*PublicChatTypeHasUsername) GetClass() string { + return ClassPublicChatType +} + +func (*PublicChatTypeHasUsername) GetType() string { + return TypePublicChatTypeHasUsername +} + +func (*PublicChatTypeHasUsername) PublicChatTypeType() string { + return TypePublicChatTypeHasUsername +} + +// The chat is public, because it is a location-based supergroup +type PublicChatTypeIsLocationBased struct{ + meta +} + +func (entity *PublicChatTypeIsLocationBased) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PublicChatTypeIsLocationBased + + return json.Marshal((*stub)(entity)) +} + +func (*PublicChatTypeIsLocationBased) GetClass() string { + return ClassPublicChatType +} + +func (*PublicChatTypeIsLocationBased) GetType() string { + return TypePublicChatTypeIsLocationBased +} + +func (*PublicChatTypeIsLocationBased) PublicChatTypeType() string { + return TypePublicChatTypeIsLocationBased +} + +// The chat can be reported as spam using the method reportChat with the reason reportReasonSpam. If the chat is a private chat with a user with an emoji status, then a notice about emoji status usage must be shown +type ChatActionBarReportSpam struct { + 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"` +} + +func (entity *ChatActionBarReportSpam) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatActionBarReportSpam + + return json.Marshal((*stub)(entity)) +} + +func (*ChatActionBarReportSpam) GetClass() string { + return ClassChatActionBar +} + +func (*ChatActionBarReportSpam) GetType() string { + return TypeChatActionBarReportSpam +} + +func (*ChatActionBarReportSpam) ChatActionBarType() string { + return TypeChatActionBarReportSpam +} + +// The chat is a location-based supergroup, which can be reported as having unrelated location using the method reportChat with the reason reportReasonUnrelatedLocation +type ChatActionBarReportUnrelatedLocation struct{ + meta +} + +func (entity *ChatActionBarReportUnrelatedLocation) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatActionBarReportUnrelatedLocation + + return json.Marshal((*stub)(entity)) +} + +func (*ChatActionBarReportUnrelatedLocation) GetClass() string { + return ClassChatActionBar +} + +func (*ChatActionBarReportUnrelatedLocation) GetType() string { + return TypeChatActionBarReportUnrelatedLocation +} + +func (*ChatActionBarReportUnrelatedLocation) ChatActionBarType() string { + return TypeChatActionBarReportUnrelatedLocation +} + +// The chat is a recently created group chat to which new members can be invited +type ChatActionBarInviteMembers struct{ + meta +} + +func (entity *ChatActionBarInviteMembers) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatActionBarInviteMembers + + return json.Marshal((*stub)(entity)) +} + +func (*ChatActionBarInviteMembers) GetClass() string { + return ClassChatActionBar +} + +func (*ChatActionBarInviteMembers) GetType() string { + return TypeChatActionBarInviteMembers +} + +func (*ChatActionBarInviteMembers) ChatActionBarType() string { + return TypeChatActionBarInviteMembers +} + +// 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 setMessageSenderBlockList, or the other user can be added to the contact list using the method addContact. If the chat is a private chat with a user with an emoji status, then a notice about emoji status usage must be shown +type ChatActionBarReportAddBlock struct { + 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 other user through searchChatsNearby and this is the distance between the users + Distance int32 `json:"distance"` +} + +func (entity *ChatActionBarReportAddBlock) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatActionBarReportAddBlock + + return json.Marshal((*stub)(entity)) +} + +func (*ChatActionBarReportAddBlock) GetClass() string { + return ClassChatActionBar +} + +func (*ChatActionBarReportAddBlock) GetType() string { + return TypeChatActionBarReportAddBlock +} + +func (*ChatActionBarReportAddBlock) ChatActionBarType() string { + return TypeChatActionBarReportAddBlock +} + +// The chat is a private or secret chat and the other user can be added to the contact list using the method addContact +type ChatActionBarAddContact struct{ + meta +} + +func (entity *ChatActionBarAddContact) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatActionBarAddContact + + return json.Marshal((*stub)(entity)) +} + +func (*ChatActionBarAddContact) GetClass() string { + return ClassChatActionBar +} + +func (*ChatActionBarAddContact) GetType() string { + return TypeChatActionBarAddContact +} + +func (*ChatActionBarAddContact) ChatActionBarType() string { + return TypeChatActionBarAddContact +} + +// 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 +type ChatActionBarSharePhoneNumber struct{ + meta +} + +func (entity *ChatActionBarSharePhoneNumber) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatActionBarSharePhoneNumber + + return json.Marshal((*stub)(entity)) +} + +func (*ChatActionBarSharePhoneNumber) GetClass() string { + return ClassChatActionBar +} + +func (*ChatActionBarSharePhoneNumber) GetType() string { + return TypeChatActionBarSharePhoneNumber +} + +func (*ChatActionBarSharePhoneNumber) ChatActionBarType() string { + return TypeChatActionBarSharePhoneNumber +} + +// The chat is a private chat with an administrator of a chat to which the user sent join request +type ChatActionBarJoinRequest struct { + 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"` +} + +func (entity *ChatActionBarJoinRequest) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatActionBarJoinRequest + + return json.Marshal((*stub)(entity)) +} + +func (*ChatActionBarJoinRequest) GetClass() string { + return ClassChatActionBar +} + +func (*ChatActionBarJoinRequest) GetType() string { + return TypeChatActionBarJoinRequest +} + +func (*ChatActionBarJoinRequest) ChatActionBarType() string { + return TypeChatActionBarJoinRequest +} + +// A simple button, with text that must be sent when the button is pressed +type KeyboardButtonTypeText struct{ + meta +} + +func (entity *KeyboardButtonTypeText) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub KeyboardButtonTypeText + + return json.Marshal((*stub)(entity)) +} + +func (*KeyboardButtonTypeText) GetClass() string { + return ClassKeyboardButtonType +} + +func (*KeyboardButtonTypeText) GetType() string { + return TypeKeyboardButtonTypeText +} + +func (*KeyboardButtonTypeText) KeyboardButtonTypeType() string { + return TypeKeyboardButtonTypeText +} + +// A button that sends the user's phone number when pressed; available only in private chats +type KeyboardButtonTypeRequestPhoneNumber struct{ + meta +} + +func (entity *KeyboardButtonTypeRequestPhoneNumber) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub KeyboardButtonTypeRequestPhoneNumber + + return json.Marshal((*stub)(entity)) +} + +func (*KeyboardButtonTypeRequestPhoneNumber) GetClass() string { + return ClassKeyboardButtonType +} + +func (*KeyboardButtonTypeRequestPhoneNumber) GetType() string { + return TypeKeyboardButtonTypeRequestPhoneNumber +} + +func (*KeyboardButtonTypeRequestPhoneNumber) KeyboardButtonTypeType() string { + return TypeKeyboardButtonTypeRequestPhoneNumber +} + +// A button that sends the user's location when pressed; available only in private chats +type KeyboardButtonTypeRequestLocation struct{ + meta +} + +func (entity *KeyboardButtonTypeRequestLocation) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub KeyboardButtonTypeRequestLocation + + return json.Marshal((*stub)(entity)) +} + +func (*KeyboardButtonTypeRequestLocation) GetClass() string { + return ClassKeyboardButtonType +} + +func (*KeyboardButtonTypeRequestLocation) GetType() string { + return TypeKeyboardButtonTypeRequestLocation +} + +func (*KeyboardButtonTypeRequestLocation) KeyboardButtonTypeType() string { + return TypeKeyboardButtonTypeRequestLocation +} + +// A button that allows the user to create and send a poll when pressed; available only in private chats +type KeyboardButtonTypeRequestPoll struct { + 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"` +} + +func (entity *KeyboardButtonTypeRequestPoll) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub KeyboardButtonTypeRequestPoll + + return json.Marshal((*stub)(entity)) +} + +func (*KeyboardButtonTypeRequestPoll) GetClass() string { + return ClassKeyboardButtonType +} + +func (*KeyboardButtonTypeRequestPoll) GetType() string { + return TypeKeyboardButtonTypeRequestPoll +} + +func (*KeyboardButtonTypeRequestPoll) KeyboardButtonTypeType() string { + return TypeKeyboardButtonTypeRequestPoll +} + +// A button that requests users to be shared by the current user; available only in private chats. Use the method shareUsersWithBot to complete the request +type KeyboardButtonTypeRequestUsers struct { + meta + // Unique button identifier + Id int32 `json:"id"` + // True, if the shared users must or must not be bots + RestrictUserIsBot bool `json:"restrict_user_is_bot"` + // True, if the shared users must be bots; otherwise, the shared users must not be bots. Ignored if restrict_user_is_bot is false + UserIsBot bool `json:"user_is_bot"` + // True, if the shared users must or must not be Telegram Premium users + RestrictUserIsPremium bool `json:"restrict_user_is_premium"` + // True, if the shared users must be Telegram Premium users; otherwise, the shared users must not be Telegram Premium users. Ignored if restrict_user_is_premium is false + UserIsPremium bool `json:"user_is_premium"` + // The maximum number of users to share + MaxQuantity int32 `json:"max_quantity"` + // Pass true to request name of the users; bots only + RequestName bool `json:"request_name"` + // Pass true to request username of the users; bots only + RequestUsername bool `json:"request_username"` + // Pass true to request photo of the users; bots only + RequestPhoto bool `json:"request_photo"` +} + +func (entity *KeyboardButtonTypeRequestUsers) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub KeyboardButtonTypeRequestUsers + + return json.Marshal((*stub)(entity)) +} + +func (*KeyboardButtonTypeRequestUsers) GetClass() string { + return ClassKeyboardButtonType +} + +func (*KeyboardButtonTypeRequestUsers) GetType() string { + return TypeKeyboardButtonTypeRequestUsers +} + +func (*KeyboardButtonTypeRequestUsers) KeyboardButtonTypeType() string { + return TypeKeyboardButtonTypeRequestUsers +} + +// A button that requests a chat to be shared by the current user; available only in private chats. Use the method shareChatWithBot to complete the request +type KeyboardButtonTypeRequestChat struct { + meta + // Unique button identifier + Id int32 `json:"id"` + // True, if the chat must be a channel; otherwise, a basic group or a supergroup chat is shared + ChatIsChannel bool `json:"chat_is_channel"` + // True, if the chat must or must not be a forum supergroup + RestrictChatIsForum bool `json:"restrict_chat_is_forum"` + // True, if the chat must be a forum supergroup; otherwise, the chat must not be a forum supergroup. Ignored if restrict_chat_is_forum is false + ChatIsForum bool `json:"chat_is_forum"` + // True, if the chat must or must not have a username + RestrictChatHasUsername bool `json:"restrict_chat_has_username"` + // True, if the chat must have a username; otherwise, the chat must not have a username. Ignored if restrict_chat_has_username is false + ChatHasUsername bool `json:"chat_has_username"` + // True, if the chat must be created by the current user + ChatIsCreated bool `json:"chat_is_created"` + // Expected user administrator rights in the chat; may be null if they aren't restricted + UserAdministratorRights *ChatAdministratorRights `json:"user_administrator_rights"` + // Expected bot administrator rights in the chat; may be null if they aren't restricted + BotAdministratorRights *ChatAdministratorRights `json:"bot_administrator_rights"` + // True, if the bot must be a member of the chat; for basic group and supergroup chats only + BotIsMember bool `json:"bot_is_member"` + // Pass true to request title of the chat; bots only + RequestTitle bool `json:"request_title"` + // Pass true to request username of the chat; bots only + RequestUsername bool `json:"request_username"` + // Pass true to request photo of the chat; bots only + RequestPhoto bool `json:"request_photo"` +} + +func (entity *KeyboardButtonTypeRequestChat) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub KeyboardButtonTypeRequestChat + + return json.Marshal((*stub)(entity)) +} + +func (*KeyboardButtonTypeRequestChat) GetClass() string { + return ClassKeyboardButtonType +} + +func (*KeyboardButtonTypeRequestChat) GetType() string { + return TypeKeyboardButtonTypeRequestChat +} + +func (*KeyboardButtonTypeRequestChat) KeyboardButtonTypeType() string { + return TypeKeyboardButtonTypeRequestChat +} + +// A button that opens a Web App by calling getWebAppUrl +type KeyboardButtonTypeWebApp struct { + meta + // An HTTP URL to pass to getWebAppUrl + Url string `json:"url"` +} + +func (entity *KeyboardButtonTypeWebApp) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub KeyboardButtonTypeWebApp + + return json.Marshal((*stub)(entity)) +} + +func (*KeyboardButtonTypeWebApp) GetClass() string { + return ClassKeyboardButtonType +} + +func (*KeyboardButtonTypeWebApp) GetType() string { + return TypeKeyboardButtonTypeWebApp +} + +func (*KeyboardButtonTypeWebApp) KeyboardButtonTypeType() string { + return TypeKeyboardButtonTypeWebApp +} + +// Represents a single button in a bot keyboard +type KeyboardButton struct { + meta + // Text of the button + Text string `json:"text"` + // Type of the button + Type KeyboardButtonType `json:"type"` +} + +func (entity *KeyboardButton) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub KeyboardButton + + return json.Marshal((*stub)(entity)) +} + +func (*KeyboardButton) GetClass() string { + return ClassKeyboardButton +} + +func (*KeyboardButton) GetType() string { + return TypeKeyboardButton +} + +func (keyboardButton *KeyboardButton) UnmarshalJSON(data []byte) error { + var tmp struct { + Text string `json:"text"` + Type json.RawMessage `json:"type"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + keyboardButton.Text = tmp.Text + + fieldType, _ := UnmarshalKeyboardButtonType(tmp.Type) + keyboardButton.Type = fieldType + + return nil +} + +// A button that opens a specified URL +type InlineKeyboardButtonTypeUrl struct { + meta + // HTTP or tg:// URL to open + Url string `json:"url"` +} + +func (entity *InlineKeyboardButtonTypeUrl) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InlineKeyboardButtonTypeUrl + + return json.Marshal((*stub)(entity)) +} + +func (*InlineKeyboardButtonTypeUrl) GetClass() string { + return ClassInlineKeyboardButtonType +} + +func (*InlineKeyboardButtonTypeUrl) GetType() string { + return TypeInlineKeyboardButtonTypeUrl +} + +func (*InlineKeyboardButtonTypeUrl) InlineKeyboardButtonTypeType() string { + return TypeInlineKeyboardButtonTypeUrl +} + +// A button that opens a specified URL and automatically authorize the current user by calling getLoginUrlInfo +type InlineKeyboardButtonTypeLoginUrl struct { + meta + // An HTTP URL to pass to getLoginUrlInfo + 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"` +} + +func (entity *InlineKeyboardButtonTypeLoginUrl) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InlineKeyboardButtonTypeLoginUrl + + return json.Marshal((*stub)(entity)) +} + +func (*InlineKeyboardButtonTypeLoginUrl) GetClass() string { + return ClassInlineKeyboardButtonType +} + +func (*InlineKeyboardButtonTypeLoginUrl) GetType() string { + return TypeInlineKeyboardButtonTypeLoginUrl +} + +func (*InlineKeyboardButtonTypeLoginUrl) InlineKeyboardButtonTypeType() string { + return TypeInlineKeyboardButtonTypeLoginUrl +} + +// A button that opens a Web App by calling openWebApp +type InlineKeyboardButtonTypeWebApp struct { + meta + // An HTTP URL to pass to openWebApp + Url string `json:"url"` +} + +func (entity *InlineKeyboardButtonTypeWebApp) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InlineKeyboardButtonTypeWebApp + + return json.Marshal((*stub)(entity)) +} + +func (*InlineKeyboardButtonTypeWebApp) GetClass() string { + return ClassInlineKeyboardButtonType +} + +func (*InlineKeyboardButtonTypeWebApp) GetType() string { + return TypeInlineKeyboardButtonTypeWebApp +} + +func (*InlineKeyboardButtonTypeWebApp) InlineKeyboardButtonTypeType() string { + return TypeInlineKeyboardButtonTypeWebApp +} + +// A button that sends a callback query to a bot +type InlineKeyboardButtonTypeCallback struct { + meta + // Data to be sent to the bot via a callback query + Data []byte `json:"data"` +} + +func (entity *InlineKeyboardButtonTypeCallback) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InlineKeyboardButtonTypeCallback + + return json.Marshal((*stub)(entity)) +} + +func (*InlineKeyboardButtonTypeCallback) GetClass() string { + return ClassInlineKeyboardButtonType +} + +func (*InlineKeyboardButtonTypeCallback) GetType() string { + return TypeInlineKeyboardButtonTypeCallback +} + +func (*InlineKeyboardButtonTypeCallback) InlineKeyboardButtonTypeType() string { + return TypeInlineKeyboardButtonTypeCallback +} + +// A button that asks for the 2-step verification password of the current user and then sends a callback query to a bot +type InlineKeyboardButtonTypeCallbackWithPassword struct { + meta + // Data to be sent to the bot via a callback query + Data []byte `json:"data"` +} + +func (entity *InlineKeyboardButtonTypeCallbackWithPassword) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InlineKeyboardButtonTypeCallbackWithPassword + + return json.Marshal((*stub)(entity)) +} + +func (*InlineKeyboardButtonTypeCallbackWithPassword) GetClass() string { + return ClassInlineKeyboardButtonType +} + +func (*InlineKeyboardButtonTypeCallbackWithPassword) GetType() string { + return TypeInlineKeyboardButtonTypeCallbackWithPassword +} + +func (*InlineKeyboardButtonTypeCallbackWithPassword) InlineKeyboardButtonTypeType() string { + return TypeInlineKeyboardButtonTypeCallbackWithPassword +} + +// 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 +type InlineKeyboardButtonTypeCallbackGame struct{ + meta +} + +func (entity *InlineKeyboardButtonTypeCallbackGame) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InlineKeyboardButtonTypeCallbackGame + + return json.Marshal((*stub)(entity)) +} + +func (*InlineKeyboardButtonTypeCallbackGame) GetClass() string { + return ClassInlineKeyboardButtonType +} + +func (*InlineKeyboardButtonTypeCallbackGame) GetType() string { + return TypeInlineKeyboardButtonTypeCallbackGame +} + +func (*InlineKeyboardButtonTypeCallbackGame) InlineKeyboardButtonTypeType() string { + return TypeInlineKeyboardButtonTypeCallbackGame +} + +// A button that forces an inline query to the bot to be inserted in the input field +type InlineKeyboardButtonTypeSwitchInline struct { + meta + // Inline query to be sent to the bot + Query string `json:"query"` + // Target chat from which to send the inline query + TargetChat TargetChat `json:"target_chat"` +} + +func (entity *InlineKeyboardButtonTypeSwitchInline) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InlineKeyboardButtonTypeSwitchInline + + return json.Marshal((*stub)(entity)) +} + +func (*InlineKeyboardButtonTypeSwitchInline) GetClass() string { + return ClassInlineKeyboardButtonType +} + +func (*InlineKeyboardButtonTypeSwitchInline) GetType() string { + return TypeInlineKeyboardButtonTypeSwitchInline +} + +func (*InlineKeyboardButtonTypeSwitchInline) InlineKeyboardButtonTypeType() string { + return TypeInlineKeyboardButtonTypeSwitchInline +} + +func (inlineKeyboardButtonTypeSwitchInline *InlineKeyboardButtonTypeSwitchInline) UnmarshalJSON(data []byte) error { + var tmp struct { + Query string `json:"query"` + TargetChat json.RawMessage `json:"target_chat"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + inlineKeyboardButtonTypeSwitchInline.Query = tmp.Query + + fieldTargetChat, _ := UnmarshalTargetChat(tmp.TargetChat) + inlineKeyboardButtonTypeSwitchInline.TargetChat = fieldTargetChat + + return nil +} + +// 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 +type InlineKeyboardButtonTypeBuy struct{ + meta +} + +func (entity *InlineKeyboardButtonTypeBuy) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InlineKeyboardButtonTypeBuy + + return json.Marshal((*stub)(entity)) +} + +func (*InlineKeyboardButtonTypeBuy) GetClass() string { + return ClassInlineKeyboardButtonType +} + +func (*InlineKeyboardButtonTypeBuy) GetType() string { + return TypeInlineKeyboardButtonTypeBuy +} + +func (*InlineKeyboardButtonTypeBuy) InlineKeyboardButtonTypeType() string { + return TypeInlineKeyboardButtonTypeBuy +} + +// A button with a user reference to be handled in the same way as textEntityTypeMentionName entities +type InlineKeyboardButtonTypeUser struct { + meta + // User identifier + UserId int64 `json:"user_id"` +} + +func (entity *InlineKeyboardButtonTypeUser) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InlineKeyboardButtonTypeUser + + return json.Marshal((*stub)(entity)) +} + +func (*InlineKeyboardButtonTypeUser) GetClass() string { + return ClassInlineKeyboardButtonType +} + +func (*InlineKeyboardButtonTypeUser) GetType() string { + return TypeInlineKeyboardButtonTypeUser +} + +func (*InlineKeyboardButtonTypeUser) InlineKeyboardButtonTypeType() string { + return TypeInlineKeyboardButtonTypeUser +} + +// Represents a single button in an inline keyboard +type InlineKeyboardButton struct { + meta + // Text of the button + Text string `json:"text"` + // Type of the button + Type InlineKeyboardButtonType `json:"type"` +} + +func (entity *InlineKeyboardButton) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InlineKeyboardButton + + return json.Marshal((*stub)(entity)) +} + +func (*InlineKeyboardButton) GetClass() string { + return ClassInlineKeyboardButton +} + +func (*InlineKeyboardButton) GetType() string { + return TypeInlineKeyboardButton +} + +func (inlineKeyboardButton *InlineKeyboardButton) UnmarshalJSON(data []byte) error { + var tmp struct { + Text string `json:"text"` + Type json.RawMessage `json:"type"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + inlineKeyboardButton.Text = tmp.Text + + fieldType, _ := UnmarshalInlineKeyboardButtonType(tmp.Type) + inlineKeyboardButton.Type = fieldType + + return nil +} + +// 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 { + meta + // True, if the keyboard is removed only for the mentioned users or the target user of a reply + IsPersonal bool `json:"is_personal"` +} + +func (entity *ReplyMarkupRemoveKeyboard) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ReplyMarkupRemoveKeyboard + + return json.Marshal((*stub)(entity)) +} + +func (*ReplyMarkupRemoveKeyboard) GetClass() string { + return ClassReplyMarkup +} + +func (*ReplyMarkupRemoveKeyboard) GetType() string { + return TypeReplyMarkupRemoveKeyboard +} + +func (*ReplyMarkupRemoveKeyboard) ReplyMarkupType() string { + return TypeReplyMarkupRemoveKeyboard +} + +// Instructs application to force a reply to this message +type ReplyMarkupForceReply struct { + 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"` +} + +func (entity *ReplyMarkupForceReply) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ReplyMarkupForceReply + + return json.Marshal((*stub)(entity)) +} + +func (*ReplyMarkupForceReply) GetClass() string { + return ClassReplyMarkup +} + +func (*ReplyMarkupForceReply) GetType() string { + return TypeReplyMarkupForceReply +} + +func (*ReplyMarkupForceReply) ReplyMarkupType() string { + return TypeReplyMarkupForceReply +} + +// Contains a custom keyboard layout to quickly reply to bots +type ReplyMarkupShowKeyboard struct { + meta + // A list of rows of bot keyboard buttons + Rows [][]*KeyboardButton `json:"rows"` + // True, if the keyboard is supposed to always be shown when the ordinary keyboard is hidden + IsPersistent bool `json:"is_persistent"` + // 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"` +} + +func (entity *ReplyMarkupShowKeyboard) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ReplyMarkupShowKeyboard + + return json.Marshal((*stub)(entity)) +} + +func (*ReplyMarkupShowKeyboard) GetClass() string { + return ClassReplyMarkup +} + +func (*ReplyMarkupShowKeyboard) GetType() string { + return TypeReplyMarkupShowKeyboard +} + +func (*ReplyMarkupShowKeyboard) ReplyMarkupType() string { + return TypeReplyMarkupShowKeyboard +} + +// Contains an inline keyboard layout +type ReplyMarkupInlineKeyboard struct { + meta + // A list of rows of inline keyboard buttons + Rows [][]*InlineKeyboardButton `json:"rows"` +} + +func (entity *ReplyMarkupInlineKeyboard) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ReplyMarkupInlineKeyboard + + return json.Marshal((*stub)(entity)) +} + +func (*ReplyMarkupInlineKeyboard) GetClass() string { + return ClassReplyMarkup +} + +func (*ReplyMarkupInlineKeyboard) GetType() string { + return TypeReplyMarkupInlineKeyboard +} + +func (*ReplyMarkupInlineKeyboard) ReplyMarkupType() string { + return TypeReplyMarkupInlineKeyboard +} + +// An HTTP URL needs to be open +type LoginUrlInfoOpen struct { + meta + // The URL to open + Url string `json:"url"` + // True, if there is no need to show an ordinary open URL confirmation + SkipConfirmation bool `json:"skip_confirmation"` +} + +func (entity *LoginUrlInfoOpen) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub LoginUrlInfoOpen + + return json.Marshal((*stub)(entity)) +} + +func (*LoginUrlInfoOpen) GetClass() string { + return ClassLoginUrlInfo +} + +func (*LoginUrlInfoOpen) GetType() string { + return TypeLoginUrlInfoOpen +} + +func (*LoginUrlInfoOpen) LoginUrlInfoType() string { + return TypeLoginUrlInfoOpen +} + +// An authorization confirmation dialog needs to be shown to the user +type LoginUrlInfoRequestConfirmation struct { + 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 must be asked for the permission to the bot to send them messages + RequestWriteAccess bool `json:"request_write_access"` +} + +func (entity *LoginUrlInfoRequestConfirmation) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub LoginUrlInfoRequestConfirmation + + return json.Marshal((*stub)(entity)) +} + +func (*LoginUrlInfoRequestConfirmation) GetClass() string { + return ClassLoginUrlInfo +} + +func (*LoginUrlInfoRequestConfirmation) GetType() string { + return TypeLoginUrlInfoRequestConfirmation +} + +func (*LoginUrlInfoRequestConfirmation) LoginUrlInfoType() string { + return TypeLoginUrlInfoRequestConfirmation +} + +// Contains information about a Web App found by its short name +type FoundWebApp struct { + meta + // The Web App + WebApp *WebApp `json:"web_app"` + // True, if the user must be asked for the permission to the bot to send them messages + RequestWriteAccess bool `json:"request_write_access"` + // True, if there is no need to show an ordinary open URL confirmation before opening the Web App. The field must be ignored and confirmation must be shown anyway if the Web App link was hidden + SkipConfirmation bool `json:"skip_confirmation"` +} + +func (entity *FoundWebApp) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub FoundWebApp + + return json.Marshal((*stub)(entity)) +} + +func (*FoundWebApp) GetClass() string { + return ClassFoundWebApp +} + +func (*FoundWebApp) GetType() string { + return TypeFoundWebApp +} + +// Contains information about a Web App +type WebAppInfo struct { + meta + // Unique identifier for the Web App launch + LaunchId JsonInt64 `json:"launch_id"` + // A Web App URL to open in a web view + Url string `json:"url"` +} + +func (entity *WebAppInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub WebAppInfo + + return json.Marshal((*stub)(entity)) +} + +func (*WebAppInfo) GetClass() string { + return ClassWebAppInfo +} + +func (*WebAppInfo) GetType() string { + return TypeWebAppInfo +} + +// Contains information about a message thread +type MessageThreadInfo struct { + 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; may be null for forum topic threads + 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 if none + DraftMessage *DraftMessage `json:"draft_message"` +} + +func (entity *MessageThreadInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageThreadInfo + + return json.Marshal((*stub)(entity)) +} + +func (*MessageThreadInfo) GetClass() string { + return ClassMessageThreadInfo +} + +func (*MessageThreadInfo) GetType() string { + return TypeMessageThreadInfo +} + +// Topic containing messages sent by the current user of forwarded from an unknown chat +type SavedMessagesTopicTypeMyNotes struct{ + meta +} + +func (entity *SavedMessagesTopicTypeMyNotes) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SavedMessagesTopicTypeMyNotes + + return json.Marshal((*stub)(entity)) +} + +func (*SavedMessagesTopicTypeMyNotes) GetClass() string { + return ClassSavedMessagesTopicType +} + +func (*SavedMessagesTopicTypeMyNotes) GetType() string { + return TypeSavedMessagesTopicTypeMyNotes +} + +func (*SavedMessagesTopicTypeMyNotes) SavedMessagesTopicTypeType() string { + return TypeSavedMessagesTopicTypeMyNotes +} + +// Topic containing messages forwarded from a user with hidden privacy +type SavedMessagesTopicTypeAuthorHidden struct{ + meta +} + +func (entity *SavedMessagesTopicTypeAuthorHidden) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SavedMessagesTopicTypeAuthorHidden + + return json.Marshal((*stub)(entity)) +} + +func (*SavedMessagesTopicTypeAuthorHidden) GetClass() string { + return ClassSavedMessagesTopicType +} + +func (*SavedMessagesTopicTypeAuthorHidden) GetType() string { + return TypeSavedMessagesTopicTypeAuthorHidden +} + +func (*SavedMessagesTopicTypeAuthorHidden) SavedMessagesTopicTypeType() string { + return TypeSavedMessagesTopicTypeAuthorHidden +} + +// Topic containing messages forwarded from a specific chat +type SavedMessagesTopicTypeSavedFromChat struct { + meta + // Identifier of the chat + ChatId int64 `json:"chat_id"` +} + +func (entity *SavedMessagesTopicTypeSavedFromChat) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SavedMessagesTopicTypeSavedFromChat + + return json.Marshal((*stub)(entity)) +} + +func (*SavedMessagesTopicTypeSavedFromChat) GetClass() string { + return ClassSavedMessagesTopicType +} + +func (*SavedMessagesTopicTypeSavedFromChat) GetType() string { + return TypeSavedMessagesTopicTypeSavedFromChat +} + +func (*SavedMessagesTopicTypeSavedFromChat) SavedMessagesTopicTypeType() string { + return TypeSavedMessagesTopicTypeSavedFromChat +} + +// Contains information about a Saved Messages topic +type SavedMessagesTopic struct { + meta + // Unique topic identifier + Id int64 `json:"id"` + // Type of the topic + Type SavedMessagesTopicType `json:"type"` + // True, if the topic is pinned + IsPinned bool `json:"is_pinned"` + // A parameter used to determine order of the topic in the topic list. Topics must be sorted by the order in descending order + Order JsonInt64 `json:"order"` + // Last message in the topic; may be null if none or unknown + LastMessage *Message `json:"last_message"` + // A draft of a message in the topic; may be null if none + DraftMessage *DraftMessage `json:"draft_message"` +} + +func (entity *SavedMessagesTopic) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SavedMessagesTopic + + return json.Marshal((*stub)(entity)) +} + +func (*SavedMessagesTopic) GetClass() string { + return ClassSavedMessagesTopic +} + +func (*SavedMessagesTopic) GetType() string { + return TypeSavedMessagesTopic +} + +func (savedMessagesTopic *SavedMessagesTopic) UnmarshalJSON(data []byte) error { + var tmp struct { + Id int64 `json:"id"` + Type json.RawMessage `json:"type"` + IsPinned bool `json:"is_pinned"` + Order JsonInt64 `json:"order"` + LastMessage *Message `json:"last_message"` + DraftMessage *DraftMessage `json:"draft_message"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + savedMessagesTopic.Id = tmp.Id + savedMessagesTopic.IsPinned = tmp.IsPinned + savedMessagesTopic.Order = tmp.Order + savedMessagesTopic.LastMessage = tmp.LastMessage + savedMessagesTopic.DraftMessage = tmp.DraftMessage + + fieldType, _ := UnmarshalSavedMessagesTopicType(tmp.Type) + savedMessagesTopic.Type = fieldType + + return nil +} + +// Describes a forum topic icon +type ForumTopicIcon struct { + meta + // Color of the topic icon in RGB format + Color int32 `json:"color"` + // Unique identifier of the custom emoji shown on the topic icon; 0 if none + CustomEmojiId JsonInt64 `json:"custom_emoji_id"` +} + +func (entity *ForumTopicIcon) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ForumTopicIcon + + return json.Marshal((*stub)(entity)) +} + +func (*ForumTopicIcon) GetClass() string { + return ClassForumTopicIcon +} + +func (*ForumTopicIcon) GetType() string { + return TypeForumTopicIcon +} + +// Contains basic information about a forum topic +type ForumTopicInfo struct { + meta + // Message thread identifier of the topic + MessageThreadId int64 `json:"message_thread_id"` + // Name of the topic + Name string `json:"name"` + // Icon of the topic + Icon *ForumTopicIcon `json:"icon"` + // Point in time (Unix timestamp) when the topic was created + CreationDate int32 `json:"creation_date"` + // Identifier of the creator of the topic + CreatorId MessageSender `json:"creator_id"` + // True, if the topic is the General topic list + IsGeneral bool `json:"is_general"` + // True, if the topic was created by the current user + IsOutgoing bool `json:"is_outgoing"` + // True, if the topic is closed + IsClosed bool `json:"is_closed"` + // True, if the topic is hidden above the topic list and closed; for General topic only + IsHidden bool `json:"is_hidden"` +} + +func (entity *ForumTopicInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ForumTopicInfo + + return json.Marshal((*stub)(entity)) +} + +func (*ForumTopicInfo) GetClass() string { + return ClassForumTopicInfo +} + +func (*ForumTopicInfo) GetType() string { + return TypeForumTopicInfo +} + +func (forumTopicInfo *ForumTopicInfo) UnmarshalJSON(data []byte) error { + var tmp struct { + MessageThreadId int64 `json:"message_thread_id"` + Name string `json:"name"` + Icon *ForumTopicIcon `json:"icon"` + CreationDate int32 `json:"creation_date"` + CreatorId json.RawMessage `json:"creator_id"` + IsGeneral bool `json:"is_general"` + IsOutgoing bool `json:"is_outgoing"` + IsClosed bool `json:"is_closed"` + IsHidden bool `json:"is_hidden"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + forumTopicInfo.MessageThreadId = tmp.MessageThreadId + forumTopicInfo.Name = tmp.Name + forumTopicInfo.Icon = tmp.Icon + forumTopicInfo.CreationDate = tmp.CreationDate + forumTopicInfo.IsGeneral = tmp.IsGeneral + forumTopicInfo.IsOutgoing = tmp.IsOutgoing + forumTopicInfo.IsClosed = tmp.IsClosed + forumTopicInfo.IsHidden = tmp.IsHidden + + fieldCreatorId, _ := UnmarshalMessageSender(tmp.CreatorId) + forumTopicInfo.CreatorId = fieldCreatorId + + return nil +} + +// Describes a forum topic +type ForumTopic struct { + meta + // Basic information about the topic + Info *ForumTopicInfo `json:"info"` + // Last message in the topic; may be null if unknown + LastMessage *Message `json:"last_message"` + // True, if the topic is pinned in the topic list + IsPinned bool `json:"is_pinned"` + // Number of unread messages in the topic + 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 topic + UnreadMentionCount int32 `json:"unread_mention_count"` + // Number of messages with unread reactions in the topic + UnreadReactionCount int32 `json:"unread_reaction_count"` + // Notification settings for the topic + NotificationSettings *ChatNotificationSettings `json:"notification_settings"` + // A draft of a message in the topic; may be null if none + DraftMessage *DraftMessage `json:"draft_message"` +} + +func (entity *ForumTopic) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ForumTopic + + return json.Marshal((*stub)(entity)) +} + +func (*ForumTopic) GetClass() string { + return ClassForumTopic +} + +func (*ForumTopic) GetType() string { + return TypeForumTopic +} + +// Describes a list of forum topics +type ForumTopics struct { + meta + // Approximate total number of forum topics found + TotalCount int32 `json:"total_count"` + // List of forum topics + Topics []*ForumTopic `json:"topics"` + // Offset date for the next getForumTopics request + NextOffsetDate int32 `json:"next_offset_date"` + // Offset message identifier for the next getForumTopics request + NextOffsetMessageId int64 `json:"next_offset_message_id"` + // Offset message thread identifier for the next getForumTopics request + NextOffsetMessageThreadId int64 `json:"next_offset_message_thread_id"` +} + +func (entity *ForumTopics) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ForumTopics + + return json.Marshal((*stub)(entity)) +} + +func (*ForumTopics) GetClass() string { + return ClassForumTopics +} + +func (*ForumTopics) GetType() string { + return TypeForumTopics +} + +// Options to be used for generation of a link preview +type LinkPreviewOptions struct { + meta + // True, if link preview must be disabled + IsDisabled bool `json:"is_disabled"` + // URL to use for link preview. If empty, then the first URL found in the message text will be used + Url string `json:"url"` + // True, if shown media preview must be small; ignored in secret chats or if the URL isn't explicitly specified + ForceSmallMedia bool `json:"force_small_media"` + // True, if shown media preview must be large; ignored in secret chats or if the URL isn't explicitly specified + ForceLargeMedia bool `json:"force_large_media"` + // True, if link preview must be shown above message text; otherwise, the link preview will be shown below the message text; ignored in secret chats + ShowAboveText bool `json:"show_above_text"` +} + +func (entity *LinkPreviewOptions) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub LinkPreviewOptions + + return json.Marshal((*stub)(entity)) +} + +func (*LinkPreviewOptions) GetClass() string { + return ClassLinkPreviewOptions +} + +func (*LinkPreviewOptions) GetType() string { + return TypeLinkPreviewOptions +} + +// Contains information about a user shared with a bot +type SharedUser struct { + meta + // User identifier + UserId int64 `json:"user_id"` + // First name of the user; for bots only + FirstName string `json:"first_name"` + // Last name of the user; for bots only + LastName string `json:"last_name"` + // Username of the user; for bots only + Username string `json:"username"` + // Profile photo of the user; for bots only; may be null + Photo *Photo `json:"photo"` +} + +func (entity *SharedUser) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SharedUser + + return json.Marshal((*stub)(entity)) +} + +func (*SharedUser) GetClass() string { + return ClassSharedUser +} + +func (*SharedUser) GetType() string { + return TypeSharedUser +} + +// Contains information about a chat shared with a bot +type SharedChat struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // Title of the chat; for bots only + Title string `json:"title"` + // Username of the chat; for bots only + Username string `json:"username"` + // Photo of the chat; for bots only; may be null + Photo *Photo `json:"photo"` +} + +func (entity *SharedChat) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SharedChat + + return json.Marshal((*stub)(entity)) +} + +func (*SharedChat) GetClass() string { + return ClassSharedChat +} + +func (*SharedChat) GetType() string { + return TypeSharedChat +} + +// A plain text +type RichTextPlain struct { + meta + // Text + Text string `json:"text"` +} + +func (entity *RichTextPlain) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub RichTextPlain + + return json.Marshal((*stub)(entity)) +} + +func (*RichTextPlain) GetClass() string { + return ClassRichText +} + +func (*RichTextPlain) GetType() string { + return TypeRichTextPlain +} + +func (*RichTextPlain) RichTextType() string { + return TypeRichTextPlain +} + +// A bold rich text +type RichTextBold struct { + meta + // Text + Text RichText `json:"text"` +} + +func (entity *RichTextBold) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub RichTextBold + + return json.Marshal((*stub)(entity)) +} + +func (*RichTextBold) GetClass() string { + return ClassRichText +} + +func (*RichTextBold) GetType() string { + return TypeRichTextBold +} + +func (*RichTextBold) RichTextType() string { + return TypeRichTextBold +} + +func (richTextBold *RichTextBold) UnmarshalJSON(data []byte) error { + var tmp struct { + Text json.RawMessage `json:"text"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldText, _ := UnmarshalRichText(tmp.Text) + richTextBold.Text = fieldText + + return nil +} + +// An italicized rich text +type RichTextItalic struct { + meta + // Text + Text RichText `json:"text"` +} + +func (entity *RichTextItalic) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub RichTextItalic + + return json.Marshal((*stub)(entity)) +} + +func (*RichTextItalic) GetClass() string { + return ClassRichText +} + +func (*RichTextItalic) GetType() string { + return TypeRichTextItalic +} + +func (*RichTextItalic) RichTextType() string { + return TypeRichTextItalic +} + +func (richTextItalic *RichTextItalic) UnmarshalJSON(data []byte) error { + var tmp struct { + Text json.RawMessage `json:"text"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldText, _ := UnmarshalRichText(tmp.Text) + richTextItalic.Text = fieldText + + return nil +} + +// An underlined rich text +type RichTextUnderline struct { + meta + // Text + Text RichText `json:"text"` +} + +func (entity *RichTextUnderline) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub RichTextUnderline + + return json.Marshal((*stub)(entity)) +} + +func (*RichTextUnderline) GetClass() string { + return ClassRichText +} + +func (*RichTextUnderline) GetType() string { + return TypeRichTextUnderline +} + +func (*RichTextUnderline) RichTextType() string { + return TypeRichTextUnderline +} + +func (richTextUnderline *RichTextUnderline) UnmarshalJSON(data []byte) error { + var tmp struct { + Text json.RawMessage `json:"text"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldText, _ := UnmarshalRichText(tmp.Text) + richTextUnderline.Text = fieldText + + return nil +} + +// A strikethrough rich text +type RichTextStrikethrough struct { + meta + // Text + Text RichText `json:"text"` +} + +func (entity *RichTextStrikethrough) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub RichTextStrikethrough + + return json.Marshal((*stub)(entity)) +} + +func (*RichTextStrikethrough) GetClass() string { + return ClassRichText +} + +func (*RichTextStrikethrough) GetType() string { + return TypeRichTextStrikethrough +} + +func (*RichTextStrikethrough) RichTextType() string { + return TypeRichTextStrikethrough +} + +func (richTextStrikethrough *RichTextStrikethrough) UnmarshalJSON(data []byte) error { + var tmp struct { + Text json.RawMessage `json:"text"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldText, _ := UnmarshalRichText(tmp.Text) + richTextStrikethrough.Text = fieldText + + return nil +} + +// A fixed-width rich text +type RichTextFixed struct { + meta + // Text + Text RichText `json:"text"` +} + +func (entity *RichTextFixed) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub RichTextFixed + + return json.Marshal((*stub)(entity)) +} + +func (*RichTextFixed) GetClass() string { + return ClassRichText +} + +func (*RichTextFixed) GetType() string { + return TypeRichTextFixed +} + +func (*RichTextFixed) RichTextType() string { + return TypeRichTextFixed +} + +func (richTextFixed *RichTextFixed) UnmarshalJSON(data []byte) error { + var tmp struct { + Text json.RawMessage `json:"text"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldText, _ := UnmarshalRichText(tmp.Text) + richTextFixed.Text = fieldText + + return nil +} + +// A rich text URL link +type RichTextUrl struct { + 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"` +} + +func (entity *RichTextUrl) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub RichTextUrl + + return json.Marshal((*stub)(entity)) +} + +func (*RichTextUrl) GetClass() string { + return ClassRichText +} + +func (*RichTextUrl) GetType() string { + return TypeRichTextUrl +} + +func (*RichTextUrl) RichTextType() string { + return TypeRichTextUrl +} + +func (richTextUrl *RichTextUrl) UnmarshalJSON(data []byte) error { + var tmp struct { + Text json.RawMessage `json:"text"` + Url string `json:"url"` + IsCached bool `json:"is_cached"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + richTextUrl.Url = tmp.Url + richTextUrl.IsCached = tmp.IsCached + + fieldText, _ := UnmarshalRichText(tmp.Text) + richTextUrl.Text = fieldText + + return nil +} + +// A rich text email link +type RichTextEmailAddress struct { + meta + // Text + Text RichText `json:"text"` + // Email address + EmailAddress string `json:"email_address"` +} + +func (entity *RichTextEmailAddress) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub RichTextEmailAddress + + return json.Marshal((*stub)(entity)) +} + +func (*RichTextEmailAddress) GetClass() string { + return ClassRichText +} + +func (*RichTextEmailAddress) GetType() string { + return TypeRichTextEmailAddress +} + +func (*RichTextEmailAddress) RichTextType() string { + return TypeRichTextEmailAddress +} + +func (richTextEmailAddress *RichTextEmailAddress) UnmarshalJSON(data []byte) error { + var tmp struct { + Text json.RawMessage `json:"text"` + EmailAddress string `json:"email_address"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + richTextEmailAddress.EmailAddress = tmp.EmailAddress + + fieldText, _ := UnmarshalRichText(tmp.Text) + richTextEmailAddress.Text = fieldText + + return nil +} + +// A subscript rich text +type RichTextSubscript struct { + meta + // Text + Text RichText `json:"text"` +} + +func (entity *RichTextSubscript) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub RichTextSubscript + + return json.Marshal((*stub)(entity)) +} + +func (*RichTextSubscript) GetClass() string { + return ClassRichText +} + +func (*RichTextSubscript) GetType() string { + return TypeRichTextSubscript +} + +func (*RichTextSubscript) RichTextType() string { + return TypeRichTextSubscript +} + +func (richTextSubscript *RichTextSubscript) UnmarshalJSON(data []byte) error { + var tmp struct { + Text json.RawMessage `json:"text"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldText, _ := UnmarshalRichText(tmp.Text) + richTextSubscript.Text = fieldText + + return nil +} + +// A superscript rich text +type RichTextSuperscript struct { + meta + // Text + Text RichText `json:"text"` +} + +func (entity *RichTextSuperscript) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub RichTextSuperscript + + return json.Marshal((*stub)(entity)) +} + +func (*RichTextSuperscript) GetClass() string { + return ClassRichText +} + +func (*RichTextSuperscript) GetType() string { + return TypeRichTextSuperscript +} + +func (*RichTextSuperscript) RichTextType() string { + return TypeRichTextSuperscript +} + +func (richTextSuperscript *RichTextSuperscript) UnmarshalJSON(data []byte) error { + var tmp struct { + Text json.RawMessage `json:"text"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldText, _ := UnmarshalRichText(tmp.Text) + richTextSuperscript.Text = fieldText + + return nil +} + +// A marked rich text +type RichTextMarked struct { + meta + // Text + Text RichText `json:"text"` +} + +func (entity *RichTextMarked) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub RichTextMarked + + return json.Marshal((*stub)(entity)) +} + +func (*RichTextMarked) GetClass() string { + return ClassRichText +} + +func (*RichTextMarked) GetType() string { + return TypeRichTextMarked +} + +func (*RichTextMarked) RichTextType() string { + return TypeRichTextMarked +} + +func (richTextMarked *RichTextMarked) UnmarshalJSON(data []byte) error { + var tmp struct { + Text json.RawMessage `json:"text"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldText, _ := UnmarshalRichText(tmp.Text) + richTextMarked.Text = fieldText + + return nil +} + +// A rich text phone number +type RichTextPhoneNumber struct { + meta + // Text + Text RichText `json:"text"` + // Phone number + PhoneNumber string `json:"phone_number"` +} + +func (entity *RichTextPhoneNumber) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub RichTextPhoneNumber + + return json.Marshal((*stub)(entity)) +} + +func (*RichTextPhoneNumber) GetClass() string { + return ClassRichText +} + +func (*RichTextPhoneNumber) GetType() string { + return TypeRichTextPhoneNumber +} + +func (*RichTextPhoneNumber) RichTextType() string { + return TypeRichTextPhoneNumber +} + +func (richTextPhoneNumber *RichTextPhoneNumber) UnmarshalJSON(data []byte) error { + var tmp struct { + Text json.RawMessage `json:"text"` + PhoneNumber string `json:"phone_number"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + richTextPhoneNumber.PhoneNumber = tmp.PhoneNumber + + fieldText, _ := UnmarshalRichText(tmp.Text) + richTextPhoneNumber.Text = fieldText + + return nil +} + +// A small image inside the text +type RichTextIcon struct { + 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"` +} + +func (entity *RichTextIcon) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub RichTextIcon + + return json.Marshal((*stub)(entity)) +} + +func (*RichTextIcon) GetClass() string { + return ClassRichText +} + +func (*RichTextIcon) GetType() string { + return TypeRichTextIcon +} + +func (*RichTextIcon) RichTextType() string { + return TypeRichTextIcon +} + +// A reference to a richTexts object on the same web page +type RichTextReference struct { + 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"` +} + +func (entity *RichTextReference) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub RichTextReference + + return json.Marshal((*stub)(entity)) +} + +func (*RichTextReference) GetClass() string { + return ClassRichText +} + +func (*RichTextReference) GetType() string { + return TypeRichTextReference +} + +func (*RichTextReference) RichTextType() string { + return TypeRichTextReference +} + +func (richTextReference *RichTextReference) UnmarshalJSON(data []byte) error { + var tmp struct { + Text json.RawMessage `json:"text"` + AnchorName string `json:"anchor_name"` + Url string `json:"url"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + richTextReference.AnchorName = tmp.AnchorName + richTextReference.Url = tmp.Url + + fieldText, _ := UnmarshalRichText(tmp.Text) + richTextReference.Text = fieldText + + return nil +} + +// An anchor +type RichTextAnchor struct { + meta + // Anchor name + Name string `json:"name"` +} + +func (entity *RichTextAnchor) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub RichTextAnchor + + return json.Marshal((*stub)(entity)) +} + +func (*RichTextAnchor) GetClass() string { + return ClassRichText +} + +func (*RichTextAnchor) GetType() string { + return TypeRichTextAnchor +} + +func (*RichTextAnchor) RichTextType() string { + return TypeRichTextAnchor +} + +// A link to an anchor on the same web page +type RichTextAnchorLink struct { + 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"` +} + +func (entity *RichTextAnchorLink) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub RichTextAnchorLink + + return json.Marshal((*stub)(entity)) +} + +func (*RichTextAnchorLink) GetClass() string { + return ClassRichText +} + +func (*RichTextAnchorLink) GetType() string { + return TypeRichTextAnchorLink +} + +func (*RichTextAnchorLink) RichTextType() string { + return TypeRichTextAnchorLink +} + +func (richTextAnchorLink *RichTextAnchorLink) UnmarshalJSON(data []byte) error { + var tmp struct { + Text json.RawMessage `json:"text"` + AnchorName string `json:"anchor_name"` + Url string `json:"url"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + richTextAnchorLink.AnchorName = tmp.AnchorName + richTextAnchorLink.Url = tmp.Url + + fieldText, _ := UnmarshalRichText(tmp.Text) + richTextAnchorLink.Text = fieldText + + return nil +} + +// A concatenation of rich texts +type RichTexts struct { + meta + // Texts + Texts []RichText `json:"texts"` +} + +func (entity *RichTexts) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub RichTexts + + return json.Marshal((*stub)(entity)) +} + +func (*RichTexts) GetClass() string { + return ClassRichText +} + +func (*RichTexts) GetType() string { + return TypeRichTexts +} + +func (*RichTexts) RichTextType() string { + return TypeRichTexts +} + +func (richTexts *RichTexts) UnmarshalJSON(data []byte) error { + var tmp struct { + Texts []json.RawMessage `json:"texts"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldTexts, _ := UnmarshalListOfRichText(tmp.Texts) + richTexts.Texts = fieldTexts + + return nil +} + +// Contains a caption of an instant view web page block, consisting of a text and a trailing credit +type PageBlockCaption struct { + meta + // Content of the caption + Text RichText `json:"text"` + // Block credit (like HTML tag ) + Credit RichText `json:"credit"` +} + +func (entity *PageBlockCaption) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PageBlockCaption + + return json.Marshal((*stub)(entity)) +} + +func (*PageBlockCaption) GetClass() string { + return ClassPageBlockCaption +} + +func (*PageBlockCaption) GetType() string { + return TypePageBlockCaption +} + +func (pageBlockCaption *PageBlockCaption) UnmarshalJSON(data []byte) error { + var tmp struct { + Text json.RawMessage `json:"text"` + Credit json.RawMessage `json:"credit"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldText, _ := UnmarshalRichText(tmp.Text) + pageBlockCaption.Text = fieldText + + fieldCredit, _ := UnmarshalRichText(tmp.Credit) + pageBlockCaption.Credit = fieldCredit + + return nil +} + +// Describes an item of a list page block +type PageBlockListItem struct { + meta + // Item label + Label string `json:"label"` + // Item blocks + PageBlocks []PageBlock `json:"page_blocks"` +} + +func (entity *PageBlockListItem) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PageBlockListItem + + return json.Marshal((*stub)(entity)) +} + +func (*PageBlockListItem) GetClass() string { + return ClassPageBlockListItem +} + +func (*PageBlockListItem) GetType() string { + return TypePageBlockListItem +} + +func (pageBlockListItem *PageBlockListItem) UnmarshalJSON(data []byte) error { + var tmp struct { + Label string `json:"label"` + PageBlocks []json.RawMessage `json:"page_blocks"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + pageBlockListItem.Label = tmp.Label + + fieldPageBlocks, _ := UnmarshalListOfPageBlock(tmp.PageBlocks) + pageBlockListItem.PageBlocks = fieldPageBlocks + + return nil +} + +// The content must be left-aligned +type PageBlockHorizontalAlignmentLeft struct{ + meta +} + +func (entity *PageBlockHorizontalAlignmentLeft) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PageBlockHorizontalAlignmentLeft + + return json.Marshal((*stub)(entity)) +} + +func (*PageBlockHorizontalAlignmentLeft) GetClass() string { + return ClassPageBlockHorizontalAlignment +} + +func (*PageBlockHorizontalAlignmentLeft) GetType() string { + return TypePageBlockHorizontalAlignmentLeft +} + +func (*PageBlockHorizontalAlignmentLeft) PageBlockHorizontalAlignmentType() string { + return TypePageBlockHorizontalAlignmentLeft +} + +// The content must be center-aligned +type PageBlockHorizontalAlignmentCenter struct{ + meta +} + +func (entity *PageBlockHorizontalAlignmentCenter) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PageBlockHorizontalAlignmentCenter + + return json.Marshal((*stub)(entity)) +} + +func (*PageBlockHorizontalAlignmentCenter) GetClass() string { + return ClassPageBlockHorizontalAlignment +} + +func (*PageBlockHorizontalAlignmentCenter) GetType() string { + return TypePageBlockHorizontalAlignmentCenter +} + +func (*PageBlockHorizontalAlignmentCenter) PageBlockHorizontalAlignmentType() string { + return TypePageBlockHorizontalAlignmentCenter +} + +// The content must be right-aligned +type PageBlockHorizontalAlignmentRight struct{ + meta +} + +func (entity *PageBlockHorizontalAlignmentRight) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PageBlockHorizontalAlignmentRight + + return json.Marshal((*stub)(entity)) +} + +func (*PageBlockHorizontalAlignmentRight) GetClass() string { + return ClassPageBlockHorizontalAlignment +} + +func (*PageBlockHorizontalAlignmentRight) GetType() string { + return TypePageBlockHorizontalAlignmentRight +} + +func (*PageBlockHorizontalAlignmentRight) PageBlockHorizontalAlignmentType() string { + return TypePageBlockHorizontalAlignmentRight +} + +// The content must be top-aligned +type PageBlockVerticalAlignmentTop struct{ + meta +} + +func (entity *PageBlockVerticalAlignmentTop) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PageBlockVerticalAlignmentTop + + return json.Marshal((*stub)(entity)) +} + +func (*PageBlockVerticalAlignmentTop) GetClass() string { + return ClassPageBlockVerticalAlignment +} + +func (*PageBlockVerticalAlignmentTop) GetType() string { + return TypePageBlockVerticalAlignmentTop +} + +func (*PageBlockVerticalAlignmentTop) PageBlockVerticalAlignmentType() string { + return TypePageBlockVerticalAlignmentTop +} + +// The content must be middle-aligned +type PageBlockVerticalAlignmentMiddle struct{ + meta +} + +func (entity *PageBlockVerticalAlignmentMiddle) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PageBlockVerticalAlignmentMiddle + + return json.Marshal((*stub)(entity)) +} + +func (*PageBlockVerticalAlignmentMiddle) GetClass() string { + return ClassPageBlockVerticalAlignment +} + +func (*PageBlockVerticalAlignmentMiddle) GetType() string { + return TypePageBlockVerticalAlignmentMiddle +} + +func (*PageBlockVerticalAlignmentMiddle) PageBlockVerticalAlignmentType() string { + return TypePageBlockVerticalAlignmentMiddle +} + +// The content must be bottom-aligned +type PageBlockVerticalAlignmentBottom struct{ + meta +} + +func (entity *PageBlockVerticalAlignmentBottom) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PageBlockVerticalAlignmentBottom + + return json.Marshal((*stub)(entity)) +} + +func (*PageBlockVerticalAlignmentBottom) GetClass() string { + return ClassPageBlockVerticalAlignment +} + +func (*PageBlockVerticalAlignmentBottom) GetType() string { + return TypePageBlockVerticalAlignmentBottom +} + +func (*PageBlockVerticalAlignmentBottom) PageBlockVerticalAlignmentType() string { + return TypePageBlockVerticalAlignmentBottom +} + +// Represents a cell of a table +type PageBlockTableCell struct { + 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"` +} + +func (entity *PageBlockTableCell) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PageBlockTableCell + + return json.Marshal((*stub)(entity)) +} + +func (*PageBlockTableCell) GetClass() string { + return ClassPageBlockTableCell +} + +func (*PageBlockTableCell) GetType() string { + return TypePageBlockTableCell +} + +func (pageBlockTableCell *PageBlockTableCell) UnmarshalJSON(data []byte) error { + 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"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + pageBlockTableCell.IsHeader = tmp.IsHeader + pageBlockTableCell.Colspan = tmp.Colspan + pageBlockTableCell.Rowspan = tmp.Rowspan + + fieldText, _ := UnmarshalRichText(tmp.Text) + pageBlockTableCell.Text = fieldText + + fieldAlign, _ := UnmarshalPageBlockHorizontalAlignment(tmp.Align) + pageBlockTableCell.Align = fieldAlign + + fieldValign, _ := UnmarshalPageBlockVerticalAlignment(tmp.Valign) + pageBlockTableCell.Valign = fieldValign + + return nil +} + +// Contains information about a related article +type PageBlockRelatedArticle struct { + 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"` +} + +func (entity *PageBlockRelatedArticle) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PageBlockRelatedArticle + + return json.Marshal((*stub)(entity)) +} + +func (*PageBlockRelatedArticle) GetClass() string { + return ClassPageBlockRelatedArticle +} + +func (*PageBlockRelatedArticle) GetType() string { + return TypePageBlockRelatedArticle +} + +// The title of a page +type PageBlockTitle struct { + meta + // Title + Title RichText `json:"title"` +} + +func (entity *PageBlockTitle) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PageBlockTitle + + return json.Marshal((*stub)(entity)) +} + +func (*PageBlockTitle) GetClass() string { + return ClassPageBlock +} + +func (*PageBlockTitle) GetType() string { + return TypePageBlockTitle +} + +func (*PageBlockTitle) PageBlockType() string { + return TypePageBlockTitle +} + +func (pageBlockTitle *PageBlockTitle) UnmarshalJSON(data []byte) error { + var tmp struct { + Title json.RawMessage `json:"title"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldTitle, _ := UnmarshalRichText(tmp.Title) + pageBlockTitle.Title = fieldTitle + + return nil +} + +// The subtitle of a page +type PageBlockSubtitle struct { + meta + // Subtitle + Subtitle RichText `json:"subtitle"` +} + +func (entity *PageBlockSubtitle) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PageBlockSubtitle + + return json.Marshal((*stub)(entity)) +} + +func (*PageBlockSubtitle) GetClass() string { + return ClassPageBlock +} + +func (*PageBlockSubtitle) GetType() string { + return TypePageBlockSubtitle +} + +func (*PageBlockSubtitle) PageBlockType() string { + return TypePageBlockSubtitle +} + +func (pageBlockSubtitle *PageBlockSubtitle) UnmarshalJSON(data []byte) error { + var tmp struct { + Subtitle json.RawMessage `json:"subtitle"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldSubtitle, _ := UnmarshalRichText(tmp.Subtitle) + pageBlockSubtitle.Subtitle = fieldSubtitle + + return nil +} + +// The author and publishing date of a page +type PageBlockAuthorDate struct { + meta + // Author + Author RichText `json:"author"` + // Point in time (Unix timestamp) when the article was published; 0 if unknown + PublishDate int32 `json:"publish_date"` +} + +func (entity *PageBlockAuthorDate) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PageBlockAuthorDate + + return json.Marshal((*stub)(entity)) +} + +func (*PageBlockAuthorDate) GetClass() string { + return ClassPageBlock +} + +func (*PageBlockAuthorDate) GetType() string { + return TypePageBlockAuthorDate +} + +func (*PageBlockAuthorDate) PageBlockType() string { + return TypePageBlockAuthorDate +} + +func (pageBlockAuthorDate *PageBlockAuthorDate) UnmarshalJSON(data []byte) error { + var tmp struct { + Author json.RawMessage `json:"author"` + PublishDate int32 `json:"publish_date"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + pageBlockAuthorDate.PublishDate = tmp.PublishDate + + fieldAuthor, _ := UnmarshalRichText(tmp.Author) + pageBlockAuthorDate.Author = fieldAuthor + + return nil +} + +// A header +type PageBlockHeader struct { + meta + // Header + Header RichText `json:"header"` +} + +func (entity *PageBlockHeader) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PageBlockHeader + + return json.Marshal((*stub)(entity)) +} + +func (*PageBlockHeader) GetClass() string { + return ClassPageBlock +} + +func (*PageBlockHeader) GetType() string { + return TypePageBlockHeader +} + +func (*PageBlockHeader) PageBlockType() string { + return TypePageBlockHeader +} + +func (pageBlockHeader *PageBlockHeader) UnmarshalJSON(data []byte) error { + var tmp struct { + Header json.RawMessage `json:"header"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldHeader, _ := UnmarshalRichText(tmp.Header) + pageBlockHeader.Header = fieldHeader + + return nil +} + +// A subheader +type PageBlockSubheader struct { + meta + // Subheader + Subheader RichText `json:"subheader"` +} + +func (entity *PageBlockSubheader) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PageBlockSubheader + + return json.Marshal((*stub)(entity)) +} + +func (*PageBlockSubheader) GetClass() string { + return ClassPageBlock +} + +func (*PageBlockSubheader) GetType() string { + return TypePageBlockSubheader +} + +func (*PageBlockSubheader) PageBlockType() string { + return TypePageBlockSubheader +} + +func (pageBlockSubheader *PageBlockSubheader) UnmarshalJSON(data []byte) error { + var tmp struct { + Subheader json.RawMessage `json:"subheader"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldSubheader, _ := UnmarshalRichText(tmp.Subheader) + pageBlockSubheader.Subheader = fieldSubheader + + return nil +} + +// A kicker +type PageBlockKicker struct { + meta + // Kicker + Kicker RichText `json:"kicker"` +} + +func (entity *PageBlockKicker) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PageBlockKicker + + return json.Marshal((*stub)(entity)) +} + +func (*PageBlockKicker) GetClass() string { + return ClassPageBlock +} + +func (*PageBlockKicker) GetType() string { + return TypePageBlockKicker +} + +func (*PageBlockKicker) PageBlockType() string { + return TypePageBlockKicker +} + +func (pageBlockKicker *PageBlockKicker) UnmarshalJSON(data []byte) error { + var tmp struct { + Kicker json.RawMessage `json:"kicker"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldKicker, _ := UnmarshalRichText(tmp.Kicker) + pageBlockKicker.Kicker = fieldKicker + + return nil +} + +// A text paragraph +type PageBlockParagraph struct { + meta + // Paragraph text + Text RichText `json:"text"` +} + +func (entity *PageBlockParagraph) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PageBlockParagraph + + return json.Marshal((*stub)(entity)) +} + +func (*PageBlockParagraph) GetClass() string { + return ClassPageBlock +} + +func (*PageBlockParagraph) GetType() string { + return TypePageBlockParagraph +} + +func (*PageBlockParagraph) PageBlockType() string { + return TypePageBlockParagraph +} + +func (pageBlockParagraph *PageBlockParagraph) UnmarshalJSON(data []byte) error { + var tmp struct { + Text json.RawMessage `json:"text"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldText, _ := UnmarshalRichText(tmp.Text) + pageBlockParagraph.Text = fieldText + + return nil +} + +// A preformatted text paragraph +type PageBlockPreformatted struct { + meta + // Paragraph text + Text RichText `json:"text"` + // Programming language for which the text needs to be formatted + Language string `json:"language"` +} + +func (entity *PageBlockPreformatted) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PageBlockPreformatted + + return json.Marshal((*stub)(entity)) +} + +func (*PageBlockPreformatted) GetClass() string { + return ClassPageBlock +} + +func (*PageBlockPreformatted) GetType() string { + return TypePageBlockPreformatted +} + +func (*PageBlockPreformatted) PageBlockType() string { + return TypePageBlockPreformatted +} + +func (pageBlockPreformatted *PageBlockPreformatted) UnmarshalJSON(data []byte) error { + var tmp struct { + Text json.RawMessage `json:"text"` + Language string `json:"language"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + pageBlockPreformatted.Language = tmp.Language + + fieldText, _ := UnmarshalRichText(tmp.Text) + pageBlockPreformatted.Text = fieldText + + return nil +} + +// The footer of a page +type PageBlockFooter struct { + meta + // Footer + Footer RichText `json:"footer"` +} + +func (entity *PageBlockFooter) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PageBlockFooter + + return json.Marshal((*stub)(entity)) +} + +func (*PageBlockFooter) GetClass() string { + return ClassPageBlock +} + +func (*PageBlockFooter) GetType() string { + return TypePageBlockFooter +} + +func (*PageBlockFooter) PageBlockType() string { + return TypePageBlockFooter +} + +func (pageBlockFooter *PageBlockFooter) UnmarshalJSON(data []byte) error { + var tmp struct { + Footer json.RawMessage `json:"footer"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldFooter, _ := UnmarshalRichText(tmp.Footer) + pageBlockFooter.Footer = fieldFooter + + return nil +} + +// An empty block separating a page +type PageBlockDivider struct{ + meta +} + +func (entity *PageBlockDivider) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PageBlockDivider + + return json.Marshal((*stub)(entity)) +} + +func (*PageBlockDivider) GetClass() string { + return ClassPageBlock +} + +func (*PageBlockDivider) GetType() string { + return TypePageBlockDivider +} + +func (*PageBlockDivider) PageBlockType() string { + return TypePageBlockDivider +} + +// An invisible anchor on a page, which can be used in a URL to open the page from the specified anchor +type PageBlockAnchor struct { + meta + // Name of the anchor + Name string `json:"name"` +} + +func (entity *PageBlockAnchor) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PageBlockAnchor + + return json.Marshal((*stub)(entity)) +} + +func (*PageBlockAnchor) GetClass() string { + return ClassPageBlock +} + +func (*PageBlockAnchor) GetType() string { + return TypePageBlockAnchor +} + +func (*PageBlockAnchor) PageBlockType() string { + return TypePageBlockAnchor +} + +// A list of data blocks +type PageBlockList struct { + meta + // The items of the list + Items []*PageBlockListItem `json:"items"` +} + +func (entity *PageBlockList) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PageBlockList + + return json.Marshal((*stub)(entity)) +} + +func (*PageBlockList) GetClass() string { + return ClassPageBlock +} + +func (*PageBlockList) GetType() string { + return TypePageBlockList +} + +func (*PageBlockList) PageBlockType() string { + return TypePageBlockList +} + +// A block quote +type PageBlockBlockQuote struct { + meta + // Quote text + Text RichText `json:"text"` + // Quote credit + Credit RichText `json:"credit"` +} + +func (entity *PageBlockBlockQuote) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PageBlockBlockQuote + + return json.Marshal((*stub)(entity)) +} + +func (*PageBlockBlockQuote) GetClass() string { + return ClassPageBlock +} + +func (*PageBlockBlockQuote) GetType() string { + return TypePageBlockBlockQuote +} + +func (*PageBlockBlockQuote) PageBlockType() string { + return TypePageBlockBlockQuote +} + +func (pageBlockBlockQuote *PageBlockBlockQuote) UnmarshalJSON(data []byte) error { + var tmp struct { + Text json.RawMessage `json:"text"` + Credit json.RawMessage `json:"credit"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldText, _ := UnmarshalRichText(tmp.Text) + pageBlockBlockQuote.Text = fieldText + + fieldCredit, _ := UnmarshalRichText(tmp.Credit) + pageBlockBlockQuote.Credit = fieldCredit + + return nil +} + +// A pull quote +type PageBlockPullQuote struct { + meta + // Quote text + Text RichText `json:"text"` + // Quote credit + Credit RichText `json:"credit"` +} + +func (entity *PageBlockPullQuote) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PageBlockPullQuote + + return json.Marshal((*stub)(entity)) +} + +func (*PageBlockPullQuote) GetClass() string { + return ClassPageBlock +} + +func (*PageBlockPullQuote) GetType() string { + return TypePageBlockPullQuote +} + +func (*PageBlockPullQuote) PageBlockType() string { + return TypePageBlockPullQuote +} + +func (pageBlockPullQuote *PageBlockPullQuote) UnmarshalJSON(data []byte) error { + var tmp struct { + Text json.RawMessage `json:"text"` + Credit json.RawMessage `json:"credit"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldText, _ := UnmarshalRichText(tmp.Text) + pageBlockPullQuote.Text = fieldText + + fieldCredit, _ := UnmarshalRichText(tmp.Credit) + pageBlockPullQuote.Credit = fieldCredit + + return nil +} + +// An animation +type PageBlockAnimation struct { + 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"` +} + +func (entity *PageBlockAnimation) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PageBlockAnimation + + return json.Marshal((*stub)(entity)) +} + +func (*PageBlockAnimation) GetClass() string { + return ClassPageBlock +} + +func (*PageBlockAnimation) GetType() string { + return TypePageBlockAnimation +} + +func (*PageBlockAnimation) PageBlockType() string { + return TypePageBlockAnimation +} + +// An audio file +type PageBlockAudio struct { + meta + // Audio file; may be null + Audio *Audio `json:"audio"` + // Audio file caption + Caption *PageBlockCaption `json:"caption"` +} + +func (entity *PageBlockAudio) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PageBlockAudio + + return json.Marshal((*stub)(entity)) +} + +func (*PageBlockAudio) GetClass() string { + return ClassPageBlock +} + +func (*PageBlockAudio) GetType() string { + return TypePageBlockAudio +} + +func (*PageBlockAudio) PageBlockType() string { + return TypePageBlockAudio +} + +// A photo +type PageBlockPhoto struct { + 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"` +} + +func (entity *PageBlockPhoto) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PageBlockPhoto + + return json.Marshal((*stub)(entity)) +} + +func (*PageBlockPhoto) GetClass() string { + return ClassPageBlock +} + +func (*PageBlockPhoto) GetType() string { + return TypePageBlockPhoto +} + +func (*PageBlockPhoto) PageBlockType() string { + return TypePageBlockPhoto +} + +// A video +type PageBlockVideo struct { + 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"` +} + +func (entity *PageBlockVideo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PageBlockVideo + + return json.Marshal((*stub)(entity)) +} + +func (*PageBlockVideo) GetClass() string { + return ClassPageBlock +} + +func (*PageBlockVideo) GetType() string { + return TypePageBlockVideo +} + +func (*PageBlockVideo) PageBlockType() string { + return TypePageBlockVideo +} + +// A voice note +type PageBlockVoiceNote struct { + meta + // Voice note; may be null + VoiceNote *VoiceNote `json:"voice_note"` + // Voice note caption + Caption *PageBlockCaption `json:"caption"` +} + +func (entity *PageBlockVoiceNote) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PageBlockVoiceNote + + return json.Marshal((*stub)(entity)) +} + +func (*PageBlockVoiceNote) GetClass() string { + return ClassPageBlock +} + +func (*PageBlockVoiceNote) GetType() string { + return TypePageBlockVoiceNote +} + +func (*PageBlockVoiceNote) PageBlockType() string { + return TypePageBlockVoiceNote +} + +// A page cover +type PageBlockCover struct { + meta + // Cover + Cover PageBlock `json:"cover"` +} + +func (entity *PageBlockCover) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PageBlockCover + + return json.Marshal((*stub)(entity)) +} + +func (*PageBlockCover) GetClass() string { + return ClassPageBlock +} + +func (*PageBlockCover) GetType() string { + return TypePageBlockCover +} + +func (*PageBlockCover) PageBlockType() string { + return TypePageBlockCover +} + +func (pageBlockCover *PageBlockCover) UnmarshalJSON(data []byte) error { + var tmp struct { + Cover json.RawMessage `json:"cover"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldCover, _ := UnmarshalPageBlock(tmp.Cover) + pageBlockCover.Cover = fieldCover + + return nil +} + +// An embedded web page +type PageBlockEmbedded struct { + 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"` +} + +func (entity *PageBlockEmbedded) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PageBlockEmbedded + + return json.Marshal((*stub)(entity)) +} + +func (*PageBlockEmbedded) GetClass() string { + return ClassPageBlock +} + +func (*PageBlockEmbedded) GetType() string { + return TypePageBlockEmbedded +} + +func (*PageBlockEmbedded) PageBlockType() string { + return TypePageBlockEmbedded +} + +// An embedded post +type PageBlockEmbeddedPost struct { + 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"` +} + +func (entity *PageBlockEmbeddedPost) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PageBlockEmbeddedPost + + return json.Marshal((*stub)(entity)) +} + +func (*PageBlockEmbeddedPost) GetClass() string { + return ClassPageBlock +} + +func (*PageBlockEmbeddedPost) GetType() string { + return TypePageBlockEmbeddedPost +} + +func (*PageBlockEmbeddedPost) PageBlockType() string { + return TypePageBlockEmbeddedPost +} + +func (pageBlockEmbeddedPost *PageBlockEmbeddedPost) UnmarshalJSON(data []byte) error { + 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"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + pageBlockEmbeddedPost.Url = tmp.Url + pageBlockEmbeddedPost.Author = tmp.Author + pageBlockEmbeddedPost.AuthorPhoto = tmp.AuthorPhoto + pageBlockEmbeddedPost.Date = tmp.Date + pageBlockEmbeddedPost.Caption = tmp.Caption + + fieldPageBlocks, _ := UnmarshalListOfPageBlock(tmp.PageBlocks) + pageBlockEmbeddedPost.PageBlocks = fieldPageBlocks + + return nil +} + +// A collage +type PageBlockCollage struct { + meta + // Collage item contents + PageBlocks []PageBlock `json:"page_blocks"` + // Block caption + Caption *PageBlockCaption `json:"caption"` +} + +func (entity *PageBlockCollage) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PageBlockCollage + + return json.Marshal((*stub)(entity)) +} + +func (*PageBlockCollage) GetClass() string { + return ClassPageBlock +} + +func (*PageBlockCollage) GetType() string { + return TypePageBlockCollage +} + +func (*PageBlockCollage) PageBlockType() string { + return TypePageBlockCollage +} + +func (pageBlockCollage *PageBlockCollage) UnmarshalJSON(data []byte) error { + var tmp struct { + PageBlocks []json.RawMessage `json:"page_blocks"` + Caption *PageBlockCaption `json:"caption"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + pageBlockCollage.Caption = tmp.Caption + + fieldPageBlocks, _ := UnmarshalListOfPageBlock(tmp.PageBlocks) + pageBlockCollage.PageBlocks = fieldPageBlocks + + return nil +} + +// A slideshow +type PageBlockSlideshow struct { + meta + // Slideshow item contents + PageBlocks []PageBlock `json:"page_blocks"` + // Block caption + Caption *PageBlockCaption `json:"caption"` +} + +func (entity *PageBlockSlideshow) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PageBlockSlideshow + + return json.Marshal((*stub)(entity)) +} + +func (*PageBlockSlideshow) GetClass() string { + return ClassPageBlock +} + +func (*PageBlockSlideshow) GetType() string { + return TypePageBlockSlideshow +} + +func (*PageBlockSlideshow) PageBlockType() string { + return TypePageBlockSlideshow +} + +func (pageBlockSlideshow *PageBlockSlideshow) UnmarshalJSON(data []byte) error { + var tmp struct { + PageBlocks []json.RawMessage `json:"page_blocks"` + Caption *PageBlockCaption `json:"caption"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + pageBlockSlideshow.Caption = tmp.Caption + + fieldPageBlocks, _ := UnmarshalListOfPageBlock(tmp.PageBlocks) + pageBlockSlideshow.PageBlocks = fieldPageBlocks + + return nil +} + +// A link to a chat +type PageBlockChatLink struct { + meta + // Chat title + Title string `json:"title"` + // Chat photo; may be null + Photo *ChatPhotoInfo `json:"photo"` + // Identifier of the accent color for chat title and background of chat photo + AccentColorId int32 `json:"accent_color_id"` + // Chat username by which all other information about the chat can be resolved + Username string `json:"username"` +} + +func (entity *PageBlockChatLink) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PageBlockChatLink + + return json.Marshal((*stub)(entity)) +} + +func (*PageBlockChatLink) GetClass() string { + return ClassPageBlock +} + +func (*PageBlockChatLink) GetType() string { + return TypePageBlockChatLink +} + +func (*PageBlockChatLink) PageBlockType() string { + return TypePageBlockChatLink +} + +// A table +type PageBlockTable struct { + 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"` +} + +func (entity *PageBlockTable) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PageBlockTable + + return json.Marshal((*stub)(entity)) +} + +func (*PageBlockTable) GetClass() string { + return ClassPageBlock +} + +func (*PageBlockTable) GetType() string { + return TypePageBlockTable +} + +func (*PageBlockTable) PageBlockType() string { + return TypePageBlockTable +} + +func (pageBlockTable *PageBlockTable) UnmarshalJSON(data []byte) error { + var tmp struct { + Caption json.RawMessage `json:"caption"` + Cells [][]*PageBlockTableCell `json:"cells"` + IsBordered bool `json:"is_bordered"` + IsStriped bool `json:"is_striped"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + pageBlockTable.Cells = tmp.Cells + pageBlockTable.IsBordered = tmp.IsBordered + pageBlockTable.IsStriped = tmp.IsStriped + + fieldCaption, _ := UnmarshalRichText(tmp.Caption) + pageBlockTable.Caption = fieldCaption + + return nil +} + +// A collapsible block +type PageBlockDetails struct { + 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"` +} + +func (entity *PageBlockDetails) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PageBlockDetails + + return json.Marshal((*stub)(entity)) +} + +func (*PageBlockDetails) GetClass() string { + return ClassPageBlock +} + +func (*PageBlockDetails) GetType() string { + return TypePageBlockDetails +} + +func (*PageBlockDetails) PageBlockType() string { + return TypePageBlockDetails +} + +func (pageBlockDetails *PageBlockDetails) UnmarshalJSON(data []byte) error { + var tmp struct { + Header json.RawMessage `json:"header"` + PageBlocks []json.RawMessage `json:"page_blocks"` + IsOpen bool `json:"is_open"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + pageBlockDetails.IsOpen = tmp.IsOpen + + fieldHeader, _ := UnmarshalRichText(tmp.Header) + pageBlockDetails.Header = fieldHeader + + fieldPageBlocks, _ := UnmarshalListOfPageBlock(tmp.PageBlocks) + pageBlockDetails.PageBlocks = fieldPageBlocks + + return nil +} + +// Related articles +type PageBlockRelatedArticles struct { + meta + // Block header + Header RichText `json:"header"` + // List of related articles + Articles []*PageBlockRelatedArticle `json:"articles"` +} + +func (entity *PageBlockRelatedArticles) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PageBlockRelatedArticles + + return json.Marshal((*stub)(entity)) +} + +func (*PageBlockRelatedArticles) GetClass() string { + return ClassPageBlock +} + +func (*PageBlockRelatedArticles) GetType() string { + return TypePageBlockRelatedArticles +} + +func (*PageBlockRelatedArticles) PageBlockType() string { + return TypePageBlockRelatedArticles +} + +func (pageBlockRelatedArticles *PageBlockRelatedArticles) UnmarshalJSON(data []byte) error { + var tmp struct { + Header json.RawMessage `json:"header"` + Articles []*PageBlockRelatedArticle `json:"articles"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + pageBlockRelatedArticles.Articles = tmp.Articles + + fieldHeader, _ := UnmarshalRichText(tmp.Header) + pageBlockRelatedArticles.Header = fieldHeader + + return nil +} + +// A map +type PageBlockMap struct { + 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"` +} + +func (entity *PageBlockMap) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PageBlockMap + + return json.Marshal((*stub)(entity)) +} + +func (*PageBlockMap) GetClass() string { + return ClassPageBlock +} + +func (*PageBlockMap) GetType() string { + return TypePageBlockMap +} + +func (*PageBlockMap) PageBlockType() string { + return TypePageBlockMap +} + +// Describes an instant view page for a web page +type WebPageInstantView struct { + 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"` +} + +func (entity *WebPageInstantView) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub WebPageInstantView + + return json.Marshal((*stub)(entity)) +} + +func (*WebPageInstantView) GetClass() string { + return ClassWebPageInstantView +} + +func (*WebPageInstantView) GetType() string { + return TypeWebPageInstantView +} + +func (webPageInstantView *WebPageInstantView) UnmarshalJSON(data []byte) error { + 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"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + webPageInstantView.ViewCount = tmp.ViewCount + webPageInstantView.Version = tmp.Version + webPageInstantView.IsRtl = tmp.IsRtl + webPageInstantView.IsFull = tmp.IsFull + + fieldPageBlocks, _ := UnmarshalListOfPageBlock(tmp.PageBlocks) + webPageInstantView.PageBlocks = fieldPageBlocks + + fieldFeedbackLink, _ := UnmarshalInternalLinkType(tmp.FeedbackLink) + webPageInstantView.FeedbackLink = fieldFeedbackLink + + return nil +} + +// Describes a link preview +type WebPage struct { + 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"` + // True, if size of media in the preview can be changed + HasLargeMedia bool `json:"has_large_media"` + // True, if large media preview must be shown; otherwise, the media preview must be shown small and only the first frame must be shown for videos + ShowLargeMedia bool `json:"show_large_media"` + // True, if there is no need to show an ordinary open URL confirmation, when opening the URL from the preview, because the URL is shown in the message text in clear + SkipConfirmation bool `json:"skip_confirmation"` + // True, if the link preview must be shown above message text; otherwise, the link preview must be shown below the message text + ShowAboveText bool `json:"show_above_text"` + // 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"` + // The identifier of the sender of the previewed story; 0 if none + StorySenderChatId int64 `json:"story_sender_chat_id"` + // The identifier of the previewed story; 0 if none + StoryId int32 `json:"story_id"` + // Version of web page instant view (currently, can be 1 or 2); 0 if none + InstantViewVersion int32 `json:"instant_view_version"` +} + +func (entity *WebPage) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub WebPage + + return json.Marshal((*stub)(entity)) +} + +func (*WebPage) GetClass() string { + return ClassWebPage +} + +func (*WebPage) GetType() string { + return TypeWebPage +} + +// Contains information about a country +type CountryInfo struct { + 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"` +} + +func (entity *CountryInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CountryInfo + + return json.Marshal((*stub)(entity)) +} + +func (*CountryInfo) GetClass() string { + return ClassCountryInfo +} + +func (*CountryInfo) GetType() string { + return TypeCountryInfo +} + +// Contains information about countries +type Countries struct { + meta + // The list of countries + Countries []*CountryInfo `json:"countries"` +} + +func (entity *Countries) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub Countries + + return json.Marshal((*stub)(entity)) +} + +func (*Countries) GetClass() string { + return ClassCountries +} + +func (*Countries) GetType() string { + return TypeCountries +} + +// Contains information about a phone number +type PhoneNumberInfo struct { + 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"` + // True, if the phone number was bought at https://fragment.com and isn't tied to a SIM card. Information about the phone number can be received using getCollectibleItemInfo + IsAnonymous bool `json:"is_anonymous"` +} + +func (entity *PhoneNumberInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PhoneNumberInfo + + return json.Marshal((*stub)(entity)) +} + +func (*PhoneNumberInfo) GetClass() string { + return ClassPhoneNumberInfo +} + +func (*PhoneNumberInfo) GetType() string { + return TypePhoneNumberInfo +} + +// A username +type CollectibleItemTypeUsername struct { + meta + // The username + Username string `json:"username"` +} + +func (entity *CollectibleItemTypeUsername) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CollectibleItemTypeUsername + + return json.Marshal((*stub)(entity)) +} + +func (*CollectibleItemTypeUsername) GetClass() string { + return ClassCollectibleItemType +} + +func (*CollectibleItemTypeUsername) GetType() string { + return TypeCollectibleItemTypeUsername +} + +func (*CollectibleItemTypeUsername) CollectibleItemTypeType() string { + return TypeCollectibleItemTypeUsername +} + +// A phone number +type CollectibleItemTypePhoneNumber struct { + meta + // The phone number + PhoneNumber string `json:"phone_number"` +} + +func (entity *CollectibleItemTypePhoneNumber) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CollectibleItemTypePhoneNumber + + return json.Marshal((*stub)(entity)) +} + +func (*CollectibleItemTypePhoneNumber) GetClass() string { + return ClassCollectibleItemType +} + +func (*CollectibleItemTypePhoneNumber) GetType() string { + return TypeCollectibleItemTypePhoneNumber +} + +func (*CollectibleItemTypePhoneNumber) CollectibleItemTypeType() string { + return TypeCollectibleItemTypePhoneNumber +} + +// Contains information about a collectible item and its last purchase +type CollectibleItemInfo struct { + meta + // Point in time (Unix timestamp) when the item was purchased + PurchaseDate int32 `json:"purchase_date"` + // Currency for the paid amount + Currency string `json:"currency"` + // The paid amount, in the smallest units of the currency + Amount int64 `json:"amount"` + // Cryptocurrency used to pay for the item + Cryptocurrency string `json:"cryptocurrency"` + // The paid amount, in the smallest units of the cryptocurrency + CryptocurrencyAmount JsonInt64 `json:"cryptocurrency_amount"` + // Individual URL for the item on https://fragment.com + Url string `json:"url"` +} + +func (entity *CollectibleItemInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CollectibleItemInfo + + return json.Marshal((*stub)(entity)) +} + +func (*CollectibleItemInfo) GetClass() string { + return ClassCollectibleItemInfo +} + +func (*CollectibleItemInfo) GetType() string { + return TypeCollectibleItemInfo +} + +// Describes an action associated with a bank card number +type BankCardActionOpenUrl struct { + meta + // Action text + Text string `json:"text"` + // The URL to be opened + Url string `json:"url"` +} + +func (entity *BankCardActionOpenUrl) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BankCardActionOpenUrl + + return json.Marshal((*stub)(entity)) +} + +func (*BankCardActionOpenUrl) GetClass() string { + return ClassBankCardActionOpenUrl +} + +func (*BankCardActionOpenUrl) GetType() string { + return TypeBankCardActionOpenUrl +} + +// Information about a bank card +type BankCardInfo struct { + 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"` +} + +func (entity *BankCardInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BankCardInfo + + return json.Marshal((*stub)(entity)) +} + +func (*BankCardInfo) GetClass() string { + return ClassBankCardInfo +} + +func (*BankCardInfo) GetType() string { + return TypeBankCardInfo +} + +// Describes an address +type Address struct { + 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"` +} + +func (entity *Address) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub Address + + return json.Marshal((*stub)(entity)) +} + +func (*Address) GetClass() string { + return ClassAddress +} + +func (*Address) GetType() string { + return TypeAddress +} + +// Contains parameters of the application theme +type ThemeParameters struct { + meta + // A color of the background in the RGB24 format + BackgroundColor int32 `json:"background_color"` + // A secondary color for the background in the RGB24 format + SecondaryBackgroundColor int32 `json:"secondary_background_color"` + // A color of the header background in the RGB24 format + HeaderBackgroundColor int32 `json:"header_background_color"` + // A color of the section background in the RGB24 format + SectionBackgroundColor int32 `json:"section_background_color"` + // A color of text in the RGB24 format + TextColor int32 `json:"text_color"` + // An accent color of the text in the RGB24 format + AccentTextColor int32 `json:"accent_text_color"` + // A color of text on the section headers in the RGB24 format + SectionHeaderTextColor int32 `json:"section_header_text_color"` + // A color of the subtitle text in the RGB24 format + SubtitleTextColor int32 `json:"subtitle_text_color"` + // A color of the text for destructive actions in the RGB24 format + DestructiveTextColor int32 `json:"destructive_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"` +} + +func (entity *ThemeParameters) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ThemeParameters + + return json.Marshal((*stub)(entity)) +} + +func (*ThemeParameters) GetClass() string { + return ClassThemeParameters +} + +func (*ThemeParameters) GetType() string { + return TypeThemeParameters +} + +// Portion of the price of a product (e.g., "delivery cost", "tax amount") +type LabeledPricePart struct { + 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"` +} + +func (entity *LabeledPricePart) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub LabeledPricePart + + return json.Marshal((*stub)(entity)) +} + +func (*LabeledPricePart) GetClass() string { + return ClassLabeledPricePart +} + +func (*LabeledPricePart) GetType() string { + return TypeLabeledPricePart +} + +// Product invoice +type Invoice struct { + 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"` + // An HTTP URL with terms of service for recurring payments. If non-empty, the invoice payment will result in recurring payments and the user must accept the terms of service before allowed to pay + RecurringPaymentTermsOfServiceUrl string `json:"recurring_payment_terms_of_service_url"` + // An HTTP URL with terms of service for non-recurring payments. If non-empty, then the user must accept the terms of service before allowed to pay + TermsOfServiceUrl string `json:"terms_of_service_url"` + // 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"` +} + +func (entity *Invoice) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub Invoice + + return json.Marshal((*stub)(entity)) +} + +func (*Invoice) GetClass() string { + return ClassInvoice +} + +func (*Invoice) GetType() string { + return TypeInvoice +} + +// Order information +type OrderInfo struct { + 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"` +} + +func (entity *OrderInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub OrderInfo + + return json.Marshal((*stub)(entity)) +} + +func (*OrderInfo) GetClass() string { + return ClassOrderInfo +} + +func (*OrderInfo) GetType() string { + return TypeOrderInfo +} + +// One shipping option +type ShippingOption struct { + 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"` +} + +func (entity *ShippingOption) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ShippingOption + + return json.Marshal((*stub)(entity)) +} + +func (*ShippingOption) GetClass() string { + return ClassShippingOption +} + +func (*ShippingOption) GetType() string { + return TypeShippingOption +} + +// Contains information about saved payment credentials +type SavedCredentials struct { + meta + // Unique identifier of the saved credentials + Id string `json:"id"` + // Title of the saved credentials + Title string `json:"title"` +} + +func (entity *SavedCredentials) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SavedCredentials + + return json.Marshal((*stub)(entity)) +} + +func (*SavedCredentials) GetClass() string { + return ClassSavedCredentials +} + +func (*SavedCredentials) GetType() string { + return TypeSavedCredentials +} + +// 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 { + meta + // Identifier of the saved credentials + SavedCredentialsId string `json:"saved_credentials_id"` +} + +func (entity *InputCredentialsSaved) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputCredentialsSaved + + return json.Marshal((*stub)(entity)) +} + +func (*InputCredentialsSaved) GetClass() string { + return ClassInputCredentials +} + +func (*InputCredentialsSaved) GetType() string { + return TypeInputCredentialsSaved +} + +func (*InputCredentialsSaved) InputCredentialsType() string { + return TypeInputCredentialsSaved +} + +// Applies if a user enters new credentials on a payment provider website +type InputCredentialsNew struct { + 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"` +} + +func (entity *InputCredentialsNew) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputCredentialsNew + + return json.Marshal((*stub)(entity)) +} + +func (*InputCredentialsNew) GetClass() string { + return ClassInputCredentials +} + +func (*InputCredentialsNew) GetType() string { + return TypeInputCredentialsNew +} + +func (*InputCredentialsNew) InputCredentialsType() string { + return TypeInputCredentialsNew +} + +// Applies if a user enters new credentials using Apple Pay +type InputCredentialsApplePay struct { + meta + // JSON-encoded data with the credential identifier + Data string `json:"data"` +} + +func (entity *InputCredentialsApplePay) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputCredentialsApplePay + + return json.Marshal((*stub)(entity)) +} + +func (*InputCredentialsApplePay) GetClass() string { + return ClassInputCredentials +} + +func (*InputCredentialsApplePay) GetType() string { + return TypeInputCredentialsApplePay +} + +func (*InputCredentialsApplePay) InputCredentialsType() string { + return TypeInputCredentialsApplePay +} + +// Applies if a user enters new credentials using Google Pay +type InputCredentialsGooglePay struct { + meta + // JSON-encoded data with the credential identifier + Data string `json:"data"` +} + +func (entity *InputCredentialsGooglePay) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputCredentialsGooglePay + + return json.Marshal((*stub)(entity)) +} + +func (*InputCredentialsGooglePay) GetClass() string { + return ClassInputCredentials +} + +func (*InputCredentialsGooglePay) GetType() string { + return TypeInputCredentialsGooglePay +} + +func (*InputCredentialsGooglePay) InputCredentialsType() string { + return TypeInputCredentialsGooglePay +} + +// Smart Glocal payment provider +type PaymentProviderSmartGlocal struct { + meta + // Public payment token + PublicToken string `json:"public_token"` + // URL for sending card tokenization requests + TokenizeUrl string `json:"tokenize_url"` +} + +func (entity *PaymentProviderSmartGlocal) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PaymentProviderSmartGlocal + + return json.Marshal((*stub)(entity)) +} + +func (*PaymentProviderSmartGlocal) GetClass() string { + return ClassPaymentProvider +} + +func (*PaymentProviderSmartGlocal) GetType() string { + return TypePaymentProviderSmartGlocal +} + +func (*PaymentProviderSmartGlocal) PaymentProviderType() string { + return TypePaymentProviderSmartGlocal +} + +// Stripe payment provider +type PaymentProviderStripe struct { + 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"` +} + +func (entity *PaymentProviderStripe) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PaymentProviderStripe + + return json.Marshal((*stub)(entity)) +} + +func (*PaymentProviderStripe) GetClass() string { + return ClassPaymentProvider +} + +func (*PaymentProviderStripe) GetType() string { + return TypePaymentProviderStripe +} + +func (*PaymentProviderStripe) PaymentProviderType() string { + return TypePaymentProviderStripe +} + +// Some other payment provider, for which a web payment form must be shown +type PaymentProviderOther struct { + meta + // Payment form URL + Url string `json:"url"` +} + +func (entity *PaymentProviderOther) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PaymentProviderOther + + return json.Marshal((*stub)(entity)) +} + +func (*PaymentProviderOther) GetClass() string { + return ClassPaymentProvider +} + +func (*PaymentProviderOther) GetType() string { + return TypePaymentProviderOther +} + +func (*PaymentProviderOther) PaymentProviderType() string { + return TypePaymentProviderOther +} + +// Describes an additional payment option +type PaymentOption struct { + meta + // Title for the payment option + Title string `json:"title"` + // Payment form URL to be opened in a web view + Url string `json:"url"` +} + +func (entity *PaymentOption) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PaymentOption + + return json.Marshal((*stub)(entity)) +} + +func (*PaymentOption) GetClass() string { + return ClassPaymentOption +} + +func (*PaymentOption) GetType() string { + return TypePaymentOption +} + +// Contains information about an invoice payment form +type PaymentForm struct { + meta + // The payment form identifier + Id JsonInt64 `json:"id"` + // Full information about the invoice + Invoice *Invoice `json:"invoice"` + // User identifier of the seller bot + SellerBotUserId int64 `json:"seller_bot_user_id"` + // User identifier of the payment provider bot + PaymentProviderUserId int64 `json:"payment_provider_user_id"` + // Information about the payment provider + PaymentProvider PaymentProvider `json:"payment_provider"` + // The list of additional payment options + AdditionalPaymentOptions []*PaymentOption `json:"additional_payment_options"` + // Saved server-side order information; may be null + SavedOrderInfo *OrderInfo `json:"saved_order_info"` + // The list of saved payment credentials + 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, if sets up a 2-step verification password + NeedPassword bool `json:"need_password"` + // Product title + ProductTitle string `json:"product_title"` + // Product description + ProductDescription *FormattedText `json:"product_description"` + // Product photo; may be null + ProductPhoto *Photo `json:"product_photo"` +} + +func (entity *PaymentForm) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PaymentForm + + return json.Marshal((*stub)(entity)) +} + +func (*PaymentForm) GetClass() string { + return ClassPaymentForm +} + +func (*PaymentForm) GetType() string { + return TypePaymentForm +} + +func (paymentForm *PaymentForm) UnmarshalJSON(data []byte) error { + var tmp struct { + Id JsonInt64 `json:"id"` + Invoice *Invoice `json:"invoice"` + SellerBotUserId int64 `json:"seller_bot_user_id"` + PaymentProviderUserId int64 `json:"payment_provider_user_id"` + PaymentProvider json.RawMessage `json:"payment_provider"` + AdditionalPaymentOptions []*PaymentOption `json:"additional_payment_options"` + SavedOrderInfo *OrderInfo `json:"saved_order_info"` + SavedCredentials []*SavedCredentials `json:"saved_credentials"` + CanSaveCredentials bool `json:"can_save_credentials"` + NeedPassword bool `json:"need_password"` + ProductTitle string `json:"product_title"` + ProductDescription *FormattedText `json:"product_description"` + ProductPhoto *Photo `json:"product_photo"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + paymentForm.Id = tmp.Id + paymentForm.Invoice = tmp.Invoice + paymentForm.SellerBotUserId = tmp.SellerBotUserId + paymentForm.PaymentProviderUserId = tmp.PaymentProviderUserId + paymentForm.AdditionalPaymentOptions = tmp.AdditionalPaymentOptions + paymentForm.SavedOrderInfo = tmp.SavedOrderInfo + paymentForm.SavedCredentials = tmp.SavedCredentials + paymentForm.CanSaveCredentials = tmp.CanSaveCredentials + paymentForm.NeedPassword = tmp.NeedPassword + paymentForm.ProductTitle = tmp.ProductTitle + paymentForm.ProductDescription = tmp.ProductDescription + paymentForm.ProductPhoto = tmp.ProductPhoto + + fieldPaymentProvider, _ := UnmarshalPaymentProvider(tmp.PaymentProvider) + paymentForm.PaymentProvider = fieldPaymentProvider + + return nil +} + +// Contains a temporary identifier of validated order information, which is stored for one hour, and the available shipping options +type ValidatedOrderInfo struct { + meta + // Temporary identifier of the order information + OrderInfoId string `json:"order_info_id"` + // Available shipping options + ShippingOptions []*ShippingOption `json:"shipping_options"` +} + +func (entity *ValidatedOrderInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ValidatedOrderInfo + + return json.Marshal((*stub)(entity)) +} + +func (*ValidatedOrderInfo) GetClass() string { + return ClassValidatedOrderInfo +} + +func (*ValidatedOrderInfo) GetType() string { + return TypeValidatedOrderInfo +} + +// Contains the result of a payment request +type PaymentResult struct { + 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"` +} + +func (entity *PaymentResult) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PaymentResult + + return json.Marshal((*stub)(entity)) +} + +func (*PaymentResult) GetClass() string { + return ClassPaymentResult +} + +func (*PaymentResult) GetType() string { + return TypePaymentResult +} + +// Contains information about a successful payment +type PaymentReceipt struct { + meta + // Product title + Title string `json:"title"` + // Product description + Description *FormattedText `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 + PaymentProviderUserId int64 `json:"payment_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"` +} + +func (entity *PaymentReceipt) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PaymentReceipt + + return json.Marshal((*stub)(entity)) +} + +func (*PaymentReceipt) GetClass() string { + return ClassPaymentReceipt +} + +func (*PaymentReceipt) GetType() string { + return TypePaymentReceipt +} + +// An invoice from a message of the type messageInvoice +type InputInvoiceMessage struct { + meta + // Chat identifier of the message + ChatId int64 `json:"chat_id"` + // Message identifier + MessageId int64 `json:"message_id"` +} + +func (entity *InputInvoiceMessage) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputInvoiceMessage + + return json.Marshal((*stub)(entity)) +} + +func (*InputInvoiceMessage) GetClass() string { + return ClassInputInvoice +} + +func (*InputInvoiceMessage) GetType() string { + return TypeInputInvoiceMessage +} + +func (*InputInvoiceMessage) InputInvoiceType() string { + return TypeInputInvoiceMessage +} + +// An invoice from a link of the type internalLinkTypeInvoice +type InputInvoiceName struct { + meta + // Name of the invoice + Name string `json:"name"` +} + +func (entity *InputInvoiceName) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputInvoiceName + + return json.Marshal((*stub)(entity)) +} + +func (*InputInvoiceName) GetClass() string { + return ClassInputInvoice +} + +func (*InputInvoiceName) GetType() string { + return TypeInputInvoiceName +} + +func (*InputInvoiceName) InputInvoiceType() string { + return TypeInputInvoiceName +} + +// An invoice for a payment toward Telegram; must not be used in the in-store apps +type InputInvoiceTelegram struct { + meta + // Transaction purpose + Purpose TelegramPaymentPurpose `json:"purpose"` +} + +func (entity *InputInvoiceTelegram) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputInvoiceTelegram + + return json.Marshal((*stub)(entity)) +} + +func (*InputInvoiceTelegram) GetClass() string { + return ClassInputInvoice +} + +func (*InputInvoiceTelegram) GetType() string { + return TypeInputInvoiceTelegram +} + +func (*InputInvoiceTelegram) InputInvoiceType() string { + return TypeInputInvoiceTelegram +} + +func (inputInvoiceTelegram *InputInvoiceTelegram) UnmarshalJSON(data []byte) error { + var tmp struct { + Purpose json.RawMessage `json:"purpose"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldPurpose, _ := UnmarshalTelegramPaymentPurpose(tmp.Purpose) + inputInvoiceTelegram.Purpose = fieldPurpose + + return nil +} + +// The media is hidden until the invoice is paid +type MessageExtendedMediaPreview struct { + meta + // Media width; 0 if unknown + Width int32 `json:"width"` + // Media height; 0 if unknown + Height int32 `json:"height"` + // Media duration, in seconds; 0 if unknown + Duration int32 `json:"duration"` + // Media minithumbnail; may be null + Minithumbnail *Minithumbnail `json:"minithumbnail"` + // Media caption + Caption *FormattedText `json:"caption"` +} + +func (entity *MessageExtendedMediaPreview) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageExtendedMediaPreview + + return json.Marshal((*stub)(entity)) +} + +func (*MessageExtendedMediaPreview) GetClass() string { + return ClassMessageExtendedMedia +} + +func (*MessageExtendedMediaPreview) GetType() string { + return TypeMessageExtendedMediaPreview +} + +func (*MessageExtendedMediaPreview) MessageExtendedMediaType() string { + return TypeMessageExtendedMediaPreview +} + +// The media is a photo +type MessageExtendedMediaPhoto struct { + meta + // The photo + Photo *Photo `json:"photo"` + // Photo caption + Caption *FormattedText `json:"caption"` +} + +func (entity *MessageExtendedMediaPhoto) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageExtendedMediaPhoto + + return json.Marshal((*stub)(entity)) +} + +func (*MessageExtendedMediaPhoto) GetClass() string { + return ClassMessageExtendedMedia +} + +func (*MessageExtendedMediaPhoto) GetType() string { + return TypeMessageExtendedMediaPhoto +} + +func (*MessageExtendedMediaPhoto) MessageExtendedMediaType() string { + return TypeMessageExtendedMediaPhoto +} + +// The media is a video +type MessageExtendedMediaVideo struct { + meta + // The video + Video *Video `json:"video"` + // Photo caption + Caption *FormattedText `json:"caption"` +} + +func (entity *MessageExtendedMediaVideo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageExtendedMediaVideo + + return json.Marshal((*stub)(entity)) +} + +func (*MessageExtendedMediaVideo) GetClass() string { + return ClassMessageExtendedMedia +} + +func (*MessageExtendedMediaVideo) GetType() string { + return TypeMessageExtendedMediaVideo +} + +func (*MessageExtendedMediaVideo) MessageExtendedMediaType() string { + return TypeMessageExtendedMediaVideo +} + +// The media is unsupported +type MessageExtendedMediaUnsupported struct { + meta + // Media caption + Caption *FormattedText `json:"caption"` +} + +func (entity *MessageExtendedMediaUnsupported) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageExtendedMediaUnsupported + + return json.Marshal((*stub)(entity)) +} + +func (*MessageExtendedMediaUnsupported) GetClass() string { + return ClassMessageExtendedMedia +} + +func (*MessageExtendedMediaUnsupported) GetType() string { + return TypeMessageExtendedMediaUnsupported +} + +func (*MessageExtendedMediaUnsupported) MessageExtendedMediaType() string { + return TypeMessageExtendedMediaUnsupported +} + +// Describes parameters of a Telegram Premium giveaway +type PremiumGiveawayParameters struct { + meta + // Identifier of the supergroup or channel chat, which will be automatically boosted by the winners of the giveaway for duration of the Premium subscription. If the chat is a channel, then can_post_messages right is required in the channel, otherwise, the user must be an administrator in the supergroup + BoostedChatId int64 `json:"boosted_chat_id"` + // Identifiers of other supergroup or channel chats that must be subscribed by the users to be eligible for the giveaway. There can be up to getOption("giveaway_additional_chat_count_max") additional chats + AdditionalChatIds []int64 `json:"additional_chat_ids"` + // Point in time (Unix timestamp) when the giveaway is expected to be performed; must be 60-getOption("giveaway_duration_max") seconds in the future in scheduled giveaways + WinnersSelectionDate int32 `json:"winners_selection_date"` + // True, if only new members of the chats will be eligible for the giveaway + OnlyNewMembers bool `json:"only_new_members"` + // True, if the list of winners of the giveaway will be available to everyone + HasPublicWinners bool `json:"has_public_winners"` + // The list of two-letter ISO 3166-1 alpha-2 codes of countries, users from which will be eligible for the giveaway. If empty, then all users can participate in the giveaway. There can be up to getOption("giveaway_country_count_max") chosen countries. Users with phone number that was bought at https://fragment.com can participate in any giveaway and the country code "FT" must not be specified in the list + CountryCodes []string `json:"country_codes"` + // Additional description of the giveaway prize; 0-128 characters + PrizeDescription string `json:"prize_description"` +} + +func (entity *PremiumGiveawayParameters) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumGiveawayParameters + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumGiveawayParameters) GetClass() string { + return ClassPremiumGiveawayParameters +} + +func (*PremiumGiveawayParameters) GetType() string { + return TypePremiumGiveawayParameters +} + +// File with the date it was uploaded +type DatedFile struct { + meta + // The file + File *File `json:"file"` + // Point in time (Unix timestamp) when the file was uploaded + Date int32 `json:"date"` +} + +func (entity *DatedFile) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub DatedFile + + return json.Marshal((*stub)(entity)) +} + +func (*DatedFile) GetClass() string { + return ClassDatedFile +} + +func (*DatedFile) GetType() string { + return TypeDatedFile +} + +// A Telegram Passport element containing the user's personal details +type PassportElementTypePersonalDetails struct{ + meta +} + +func (entity *PassportElementTypePersonalDetails) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PassportElementTypePersonalDetails + + return json.Marshal((*stub)(entity)) +} + +func (*PassportElementTypePersonalDetails) GetClass() string { + return ClassPassportElementType +} + +func (*PassportElementTypePersonalDetails) GetType() string { + return TypePassportElementTypePersonalDetails +} + +func (*PassportElementTypePersonalDetails) PassportElementTypeType() string { + return TypePassportElementTypePersonalDetails +} + +// A Telegram Passport element containing the user's passport +type PassportElementTypePassport struct{ + meta +} + +func (entity *PassportElementTypePassport) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PassportElementTypePassport + + return json.Marshal((*stub)(entity)) +} + +func (*PassportElementTypePassport) GetClass() string { + return ClassPassportElementType +} + +func (*PassportElementTypePassport) GetType() string { + return TypePassportElementTypePassport +} + +func (*PassportElementTypePassport) PassportElementTypeType() string { + return TypePassportElementTypePassport +} + +// A Telegram Passport element containing the user's driver license +type PassportElementTypeDriverLicense struct{ + meta +} + +func (entity *PassportElementTypeDriverLicense) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PassportElementTypeDriverLicense + + return json.Marshal((*stub)(entity)) +} + +func (*PassportElementTypeDriverLicense) GetClass() string { + return ClassPassportElementType +} + +func (*PassportElementTypeDriverLicense) GetType() string { + return TypePassportElementTypeDriverLicense +} + +func (*PassportElementTypeDriverLicense) PassportElementTypeType() string { + return TypePassportElementTypeDriverLicense +} + +// A Telegram Passport element containing the user's identity card +type PassportElementTypeIdentityCard struct{ + meta +} + +func (entity *PassportElementTypeIdentityCard) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PassportElementTypeIdentityCard + + return json.Marshal((*stub)(entity)) +} + +func (*PassportElementTypeIdentityCard) GetClass() string { + return ClassPassportElementType +} + +func (*PassportElementTypeIdentityCard) GetType() string { + return TypePassportElementTypeIdentityCard +} + +func (*PassportElementTypeIdentityCard) PassportElementTypeType() string { + return TypePassportElementTypeIdentityCard +} + +// A Telegram Passport element containing the user's internal passport +type PassportElementTypeInternalPassport struct{ + meta +} + +func (entity *PassportElementTypeInternalPassport) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PassportElementTypeInternalPassport + + return json.Marshal((*stub)(entity)) +} + +func (*PassportElementTypeInternalPassport) GetClass() string { + return ClassPassportElementType +} + +func (*PassportElementTypeInternalPassport) GetType() string { + return TypePassportElementTypeInternalPassport +} + +func (*PassportElementTypeInternalPassport) PassportElementTypeType() string { + return TypePassportElementTypeInternalPassport +} + +// A Telegram Passport element containing the user's address +type PassportElementTypeAddress struct{ + meta +} + +func (entity *PassportElementTypeAddress) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PassportElementTypeAddress + + return json.Marshal((*stub)(entity)) +} + +func (*PassportElementTypeAddress) GetClass() string { + return ClassPassportElementType +} + +func (*PassportElementTypeAddress) GetType() string { + return TypePassportElementTypeAddress +} + +func (*PassportElementTypeAddress) PassportElementTypeType() string { + return TypePassportElementTypeAddress +} + +// A Telegram Passport element containing the user's utility bill +type PassportElementTypeUtilityBill struct{ + meta +} + +func (entity *PassportElementTypeUtilityBill) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PassportElementTypeUtilityBill + + return json.Marshal((*stub)(entity)) +} + +func (*PassportElementTypeUtilityBill) GetClass() string { + return ClassPassportElementType +} + +func (*PassportElementTypeUtilityBill) GetType() string { + return TypePassportElementTypeUtilityBill +} + +func (*PassportElementTypeUtilityBill) PassportElementTypeType() string { + return TypePassportElementTypeUtilityBill +} + +// A Telegram Passport element containing the user's bank statement +type PassportElementTypeBankStatement struct{ + meta +} + +func (entity *PassportElementTypeBankStatement) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PassportElementTypeBankStatement + + return json.Marshal((*stub)(entity)) +} + +func (*PassportElementTypeBankStatement) GetClass() string { + return ClassPassportElementType +} + +func (*PassportElementTypeBankStatement) GetType() string { + return TypePassportElementTypeBankStatement +} + +func (*PassportElementTypeBankStatement) PassportElementTypeType() string { + return TypePassportElementTypeBankStatement +} + +// A Telegram Passport element containing the user's rental agreement +type PassportElementTypeRentalAgreement struct{ + meta +} + +func (entity *PassportElementTypeRentalAgreement) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PassportElementTypeRentalAgreement + + return json.Marshal((*stub)(entity)) +} + +func (*PassportElementTypeRentalAgreement) GetClass() string { + return ClassPassportElementType +} + +func (*PassportElementTypeRentalAgreement) GetType() string { + return TypePassportElementTypeRentalAgreement +} + +func (*PassportElementTypeRentalAgreement) PassportElementTypeType() string { + return TypePassportElementTypeRentalAgreement +} + +// A Telegram Passport element containing the registration page of the user's passport +type PassportElementTypePassportRegistration struct{ + meta +} + +func (entity *PassportElementTypePassportRegistration) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PassportElementTypePassportRegistration + + return json.Marshal((*stub)(entity)) +} + +func (*PassportElementTypePassportRegistration) GetClass() string { + return ClassPassportElementType +} + +func (*PassportElementTypePassportRegistration) GetType() string { + return TypePassportElementTypePassportRegistration +} + +func (*PassportElementTypePassportRegistration) PassportElementTypeType() string { + return TypePassportElementTypePassportRegistration +} + +// A Telegram Passport element containing the user's temporary registration +type PassportElementTypeTemporaryRegistration struct{ + meta +} + +func (entity *PassportElementTypeTemporaryRegistration) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PassportElementTypeTemporaryRegistration + + return json.Marshal((*stub)(entity)) +} + +func (*PassportElementTypeTemporaryRegistration) GetClass() string { + return ClassPassportElementType +} + +func (*PassportElementTypeTemporaryRegistration) GetType() string { + return TypePassportElementTypeTemporaryRegistration +} + +func (*PassportElementTypeTemporaryRegistration) PassportElementTypeType() string { + return TypePassportElementTypeTemporaryRegistration +} + +// A Telegram Passport element containing the user's phone number +type PassportElementTypePhoneNumber struct{ + meta +} + +func (entity *PassportElementTypePhoneNumber) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PassportElementTypePhoneNumber + + return json.Marshal((*stub)(entity)) +} + +func (*PassportElementTypePhoneNumber) GetClass() string { + return ClassPassportElementType +} + +func (*PassportElementTypePhoneNumber) GetType() string { + return TypePassportElementTypePhoneNumber +} + +func (*PassportElementTypePhoneNumber) PassportElementTypeType() string { + return TypePassportElementTypePhoneNumber +} + +// A Telegram Passport element containing the user's email address +type PassportElementTypeEmailAddress struct{ + meta +} + +func (entity *PassportElementTypeEmailAddress) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PassportElementTypeEmailAddress + + return json.Marshal((*stub)(entity)) +} + +func (*PassportElementTypeEmailAddress) GetClass() string { + return ClassPassportElementType +} + +func (*PassportElementTypeEmailAddress) GetType() string { + return TypePassportElementTypeEmailAddress +} + +func (*PassportElementTypeEmailAddress) PassportElementTypeType() string { + return TypePassportElementTypeEmailAddress +} + +// Represents a date according to the Gregorian calendar +type Date struct { + 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"` +} + +func (entity *Date) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub Date + + return json.Marshal((*stub)(entity)) +} + +func (*Date) GetClass() string { + return ClassDate +} + +func (*Date) GetType() string { + return TypeDate +} + +// Contains the user's personal details +type PersonalDetails struct { + 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"` +} + +func (entity *PersonalDetails) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PersonalDetails + + return json.Marshal((*stub)(entity)) +} + +func (*PersonalDetails) GetClass() string { + return ClassPersonalDetails +} + +func (*PersonalDetails) GetType() string { + return TypePersonalDetails +} + +// An identity document +type IdentityDocument struct { + meta + // Document number; 1-24 characters + Number string `json:"number"` + // Document expiration date; may be null if not applicable + ExpirationDate *Date `json:"expiration_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"` +} + +func (entity *IdentityDocument) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub IdentityDocument + + return json.Marshal((*stub)(entity)) +} + +func (*IdentityDocument) GetClass() string { + return ClassIdentityDocument +} + +func (*IdentityDocument) GetType() string { + return TypeIdentityDocument +} + +// An identity document to be saved to Telegram Passport +type InputIdentityDocument struct { + meta + // Document number; 1-24 characters + Number string `json:"number"` + // Document expiration date; pass null if not applicable + ExpirationDate *Date `json:"expiration_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"` +} + +func (entity *InputIdentityDocument) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputIdentityDocument + + return json.Marshal((*stub)(entity)) +} + +func (*InputIdentityDocument) GetClass() string { + return ClassInputIdentityDocument +} + +func (*InputIdentityDocument) GetType() string { + return TypeInputIdentityDocument +} + +func (inputIdentityDocument *InputIdentityDocument) UnmarshalJSON(data []byte) error { + var tmp struct { + Number string `json:"number"` + ExpirationDate *Date `json:"expiration_date"` + FrontSide json.RawMessage `json:"front_side"` + ReverseSide json.RawMessage `json:"reverse_side"` + Selfie json.RawMessage `json:"selfie"` + Translation []json.RawMessage `json:"translation"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + inputIdentityDocument.Number = tmp.Number + inputIdentityDocument.ExpirationDate = tmp.ExpirationDate + + fieldFrontSide, _ := UnmarshalInputFile(tmp.FrontSide) + inputIdentityDocument.FrontSide = fieldFrontSide + + fieldReverseSide, _ := UnmarshalInputFile(tmp.ReverseSide) + inputIdentityDocument.ReverseSide = fieldReverseSide + + fieldSelfie, _ := UnmarshalInputFile(tmp.Selfie) + inputIdentityDocument.Selfie = fieldSelfie + + fieldTranslation, _ := UnmarshalListOfInputFile(tmp.Translation) + inputIdentityDocument.Translation = fieldTranslation + + return nil +} + +// A personal document, containing some information about a user +type PersonalDocument struct { + 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"` +} + +func (entity *PersonalDocument) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PersonalDocument + + return json.Marshal((*stub)(entity)) +} + +func (*PersonalDocument) GetClass() string { + return ClassPersonalDocument +} + +func (*PersonalDocument) GetType() string { + return TypePersonalDocument +} + +// A personal document to be saved to Telegram Passport +type InputPersonalDocument struct { + 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"` +} + +func (entity *InputPersonalDocument) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputPersonalDocument + + return json.Marshal((*stub)(entity)) +} + +func (*InputPersonalDocument) GetClass() string { + return ClassInputPersonalDocument +} + +func (*InputPersonalDocument) GetType() string { + return TypeInputPersonalDocument +} + +func (inputPersonalDocument *InputPersonalDocument) UnmarshalJSON(data []byte) error { + var tmp struct { + Files []json.RawMessage `json:"files"` + Translation []json.RawMessage `json:"translation"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldFiles, _ := UnmarshalListOfInputFile(tmp.Files) + inputPersonalDocument.Files = fieldFiles + + fieldTranslation, _ := UnmarshalListOfInputFile(tmp.Translation) + inputPersonalDocument.Translation = fieldTranslation + + return nil +} + +// A Telegram Passport element containing the user's personal details +type PassportElementPersonalDetails struct { + meta + // Personal details of the user + PersonalDetails *PersonalDetails `json:"personal_details"` +} + +func (entity *PassportElementPersonalDetails) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PassportElementPersonalDetails + + return json.Marshal((*stub)(entity)) +} + +func (*PassportElementPersonalDetails) GetClass() string { + return ClassPassportElement +} + +func (*PassportElementPersonalDetails) GetType() string { + return TypePassportElementPersonalDetails +} + +func (*PassportElementPersonalDetails) PassportElementType() string { + return TypePassportElementPersonalDetails +} + +// A Telegram Passport element containing the user's passport +type PassportElementPassport struct { + meta + // Passport + Passport *IdentityDocument `json:"passport"` +} + +func (entity *PassportElementPassport) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PassportElementPassport + + return json.Marshal((*stub)(entity)) +} + +func (*PassportElementPassport) GetClass() string { + return ClassPassportElement +} + +func (*PassportElementPassport) GetType() string { + return TypePassportElementPassport +} + +func (*PassportElementPassport) PassportElementType() string { + return TypePassportElementPassport +} + +// A Telegram Passport element containing the user's driver license +type PassportElementDriverLicense struct { + meta + // Driver license + DriverLicense *IdentityDocument `json:"driver_license"` +} + +func (entity *PassportElementDriverLicense) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PassportElementDriverLicense + + return json.Marshal((*stub)(entity)) +} + +func (*PassportElementDriverLicense) GetClass() string { + return ClassPassportElement +} + +func (*PassportElementDriverLicense) GetType() string { + return TypePassportElementDriverLicense +} + +func (*PassportElementDriverLicense) PassportElementType() string { + return TypePassportElementDriverLicense +} + +// A Telegram Passport element containing the user's identity card +type PassportElementIdentityCard struct { + meta + // Identity card + IdentityCard *IdentityDocument `json:"identity_card"` +} + +func (entity *PassportElementIdentityCard) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PassportElementIdentityCard + + return json.Marshal((*stub)(entity)) +} + +func (*PassportElementIdentityCard) GetClass() string { + return ClassPassportElement +} + +func (*PassportElementIdentityCard) GetType() string { + return TypePassportElementIdentityCard +} + +func (*PassportElementIdentityCard) PassportElementType() string { + return TypePassportElementIdentityCard +} + +// A Telegram Passport element containing the user's internal passport +type PassportElementInternalPassport struct { + meta + // Internal passport + InternalPassport *IdentityDocument `json:"internal_passport"` +} + +func (entity *PassportElementInternalPassport) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PassportElementInternalPassport + + return json.Marshal((*stub)(entity)) +} + +func (*PassportElementInternalPassport) GetClass() string { + return ClassPassportElement +} + +func (*PassportElementInternalPassport) GetType() string { + return TypePassportElementInternalPassport +} + +func (*PassportElementInternalPassport) PassportElementType() string { + return TypePassportElementInternalPassport +} + +// A Telegram Passport element containing the user's address +type PassportElementAddress struct { + meta + // Address + Address *Address `json:"address"` +} + +func (entity *PassportElementAddress) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PassportElementAddress + + return json.Marshal((*stub)(entity)) +} + +func (*PassportElementAddress) GetClass() string { + return ClassPassportElement +} + +func (*PassportElementAddress) GetType() string { + return TypePassportElementAddress +} + +func (*PassportElementAddress) PassportElementType() string { + return TypePassportElementAddress +} + +// A Telegram Passport element containing the user's utility bill +type PassportElementUtilityBill struct { + meta + // Utility bill + UtilityBill *PersonalDocument `json:"utility_bill"` +} + +func (entity *PassportElementUtilityBill) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PassportElementUtilityBill + + return json.Marshal((*stub)(entity)) +} + +func (*PassportElementUtilityBill) GetClass() string { + return ClassPassportElement +} + +func (*PassportElementUtilityBill) GetType() string { + return TypePassportElementUtilityBill +} + +func (*PassportElementUtilityBill) PassportElementType() string { + return TypePassportElementUtilityBill +} + +// A Telegram Passport element containing the user's bank statement +type PassportElementBankStatement struct { + meta + // Bank statement + BankStatement *PersonalDocument `json:"bank_statement"` +} + +func (entity *PassportElementBankStatement) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PassportElementBankStatement + + return json.Marshal((*stub)(entity)) +} + +func (*PassportElementBankStatement) GetClass() string { + return ClassPassportElement +} + +func (*PassportElementBankStatement) GetType() string { + return TypePassportElementBankStatement +} + +func (*PassportElementBankStatement) PassportElementType() string { + return TypePassportElementBankStatement +} + +// A Telegram Passport element containing the user's rental agreement +type PassportElementRentalAgreement struct { + meta + // Rental agreement + RentalAgreement *PersonalDocument `json:"rental_agreement"` +} + +func (entity *PassportElementRentalAgreement) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PassportElementRentalAgreement + + return json.Marshal((*stub)(entity)) +} + +func (*PassportElementRentalAgreement) GetClass() string { + return ClassPassportElement +} + +func (*PassportElementRentalAgreement) GetType() string { + return TypePassportElementRentalAgreement +} + +func (*PassportElementRentalAgreement) PassportElementType() string { + return TypePassportElementRentalAgreement +} + +// A Telegram Passport element containing the user's passport registration pages +type PassportElementPassportRegistration struct { + meta + // Passport registration pages + PassportRegistration *PersonalDocument `json:"passport_registration"` +} + +func (entity *PassportElementPassportRegistration) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PassportElementPassportRegistration + + return json.Marshal((*stub)(entity)) +} + +func (*PassportElementPassportRegistration) GetClass() string { + return ClassPassportElement +} + +func (*PassportElementPassportRegistration) GetType() string { + return TypePassportElementPassportRegistration +} + +func (*PassportElementPassportRegistration) PassportElementType() string { + return TypePassportElementPassportRegistration +} + +// A Telegram Passport element containing the user's temporary registration +type PassportElementTemporaryRegistration struct { + meta + // Temporary registration + TemporaryRegistration *PersonalDocument `json:"temporary_registration"` +} + +func (entity *PassportElementTemporaryRegistration) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PassportElementTemporaryRegistration + + return json.Marshal((*stub)(entity)) +} + +func (*PassportElementTemporaryRegistration) GetClass() string { + return ClassPassportElement +} + +func (*PassportElementTemporaryRegistration) GetType() string { + return TypePassportElementTemporaryRegistration +} + +func (*PassportElementTemporaryRegistration) PassportElementType() string { + return TypePassportElementTemporaryRegistration +} + +// A Telegram Passport element containing the user's phone number +type PassportElementPhoneNumber struct { + meta + // Phone number + PhoneNumber string `json:"phone_number"` +} + +func (entity *PassportElementPhoneNumber) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PassportElementPhoneNumber + + return json.Marshal((*stub)(entity)) +} + +func (*PassportElementPhoneNumber) GetClass() string { + return ClassPassportElement +} + +func (*PassportElementPhoneNumber) GetType() string { + return TypePassportElementPhoneNumber +} + +func (*PassportElementPhoneNumber) PassportElementType() string { + return TypePassportElementPhoneNumber +} + +// A Telegram Passport element containing the user's email address +type PassportElementEmailAddress struct { + meta + // Email address + EmailAddress string `json:"email_address"` +} + +func (entity *PassportElementEmailAddress) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PassportElementEmailAddress + + return json.Marshal((*stub)(entity)) +} + +func (*PassportElementEmailAddress) GetClass() string { + return ClassPassportElement +} + +func (*PassportElementEmailAddress) GetType() string { + return TypePassportElementEmailAddress +} + +func (*PassportElementEmailAddress) PassportElementType() string { + return TypePassportElementEmailAddress +} + +// A Telegram Passport element to be saved containing the user's personal details +type InputPassportElementPersonalDetails struct { + meta + // Personal details of the user + PersonalDetails *PersonalDetails `json:"personal_details"` +} + +func (entity *InputPassportElementPersonalDetails) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputPassportElementPersonalDetails + + return json.Marshal((*stub)(entity)) +} + +func (*InputPassportElementPersonalDetails) GetClass() string { + return ClassInputPassportElement +} + +func (*InputPassportElementPersonalDetails) GetType() string { + return TypeInputPassportElementPersonalDetails +} + +func (*InputPassportElementPersonalDetails) InputPassportElementType() string { + return TypeInputPassportElementPersonalDetails +} + +// A Telegram Passport element to be saved containing the user's passport +type InputPassportElementPassport struct { + meta + // The passport to be saved + Passport *InputIdentityDocument `json:"passport"` +} + +func (entity *InputPassportElementPassport) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputPassportElementPassport + + return json.Marshal((*stub)(entity)) +} + +func (*InputPassportElementPassport) GetClass() string { + return ClassInputPassportElement +} + +func (*InputPassportElementPassport) GetType() string { + return TypeInputPassportElementPassport +} + +func (*InputPassportElementPassport) InputPassportElementType() string { + return TypeInputPassportElementPassport +} + +// A Telegram Passport element to be saved containing the user's driver license +type InputPassportElementDriverLicense struct { + meta + // The driver license to be saved + DriverLicense *InputIdentityDocument `json:"driver_license"` +} + +func (entity *InputPassportElementDriverLicense) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputPassportElementDriverLicense + + return json.Marshal((*stub)(entity)) +} + +func (*InputPassportElementDriverLicense) GetClass() string { + return ClassInputPassportElement +} + +func (*InputPassportElementDriverLicense) GetType() string { + return TypeInputPassportElementDriverLicense +} + +func (*InputPassportElementDriverLicense) InputPassportElementType() string { + return TypeInputPassportElementDriverLicense +} + +// A Telegram Passport element to be saved containing the user's identity card +type InputPassportElementIdentityCard struct { + meta + // The identity card to be saved + IdentityCard *InputIdentityDocument `json:"identity_card"` +} + +func (entity *InputPassportElementIdentityCard) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputPassportElementIdentityCard + + return json.Marshal((*stub)(entity)) +} + +func (*InputPassportElementIdentityCard) GetClass() string { + return ClassInputPassportElement +} + +func (*InputPassportElementIdentityCard) GetType() string { + return TypeInputPassportElementIdentityCard +} + +func (*InputPassportElementIdentityCard) InputPassportElementType() string { + return TypeInputPassportElementIdentityCard +} + +// A Telegram Passport element to be saved containing the user's internal passport +type InputPassportElementInternalPassport struct { + meta + // The internal passport to be saved + InternalPassport *InputIdentityDocument `json:"internal_passport"` +} + +func (entity *InputPassportElementInternalPassport) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputPassportElementInternalPassport + + return json.Marshal((*stub)(entity)) +} + +func (*InputPassportElementInternalPassport) GetClass() string { + return ClassInputPassportElement +} + +func (*InputPassportElementInternalPassport) GetType() string { + return TypeInputPassportElementInternalPassport +} + +func (*InputPassportElementInternalPassport) InputPassportElementType() string { + return TypeInputPassportElementInternalPassport +} + +// A Telegram Passport element to be saved containing the user's address +type InputPassportElementAddress struct { + meta + // The address to be saved + Address *Address `json:"address"` +} + +func (entity *InputPassportElementAddress) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputPassportElementAddress + + return json.Marshal((*stub)(entity)) +} + +func (*InputPassportElementAddress) GetClass() string { + return ClassInputPassportElement +} + +func (*InputPassportElementAddress) GetType() string { + return TypeInputPassportElementAddress +} + +func (*InputPassportElementAddress) InputPassportElementType() string { + return TypeInputPassportElementAddress +} + +// A Telegram Passport element to be saved containing the user's utility bill +type InputPassportElementUtilityBill struct { + meta + // The utility bill to be saved + UtilityBill *InputPersonalDocument `json:"utility_bill"` +} + +func (entity *InputPassportElementUtilityBill) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputPassportElementUtilityBill + + return json.Marshal((*stub)(entity)) +} + +func (*InputPassportElementUtilityBill) GetClass() string { + return ClassInputPassportElement +} + +func (*InputPassportElementUtilityBill) GetType() string { + return TypeInputPassportElementUtilityBill +} + +func (*InputPassportElementUtilityBill) InputPassportElementType() string { + return TypeInputPassportElementUtilityBill +} + +// A Telegram Passport element to be saved containing the user's bank statement +type InputPassportElementBankStatement struct { + meta + // The bank statement to be saved + BankStatement *InputPersonalDocument `json:"bank_statement"` +} + +func (entity *InputPassportElementBankStatement) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputPassportElementBankStatement + + return json.Marshal((*stub)(entity)) +} + +func (*InputPassportElementBankStatement) GetClass() string { + return ClassInputPassportElement +} + +func (*InputPassportElementBankStatement) GetType() string { + return TypeInputPassportElementBankStatement +} + +func (*InputPassportElementBankStatement) InputPassportElementType() string { + return TypeInputPassportElementBankStatement +} + +// A Telegram Passport element to be saved containing the user's rental agreement +type InputPassportElementRentalAgreement struct { + meta + // The rental agreement to be saved + RentalAgreement *InputPersonalDocument `json:"rental_agreement"` +} + +func (entity *InputPassportElementRentalAgreement) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputPassportElementRentalAgreement + + return json.Marshal((*stub)(entity)) +} + +func (*InputPassportElementRentalAgreement) GetClass() string { + return ClassInputPassportElement +} + +func (*InputPassportElementRentalAgreement) GetType() string { + return TypeInputPassportElementRentalAgreement +} + +func (*InputPassportElementRentalAgreement) InputPassportElementType() string { + return TypeInputPassportElementRentalAgreement +} + +// A Telegram Passport element to be saved containing the user's passport registration +type InputPassportElementPassportRegistration struct { + meta + // The passport registration page to be saved + PassportRegistration *InputPersonalDocument `json:"passport_registration"` +} + +func (entity *InputPassportElementPassportRegistration) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputPassportElementPassportRegistration + + return json.Marshal((*stub)(entity)) +} + +func (*InputPassportElementPassportRegistration) GetClass() string { + return ClassInputPassportElement +} + +func (*InputPassportElementPassportRegistration) GetType() string { + return TypeInputPassportElementPassportRegistration +} + +func (*InputPassportElementPassportRegistration) InputPassportElementType() string { + return TypeInputPassportElementPassportRegistration +} + +// A Telegram Passport element to be saved containing the user's temporary registration +type InputPassportElementTemporaryRegistration struct { + meta + // The temporary registration document to be saved + TemporaryRegistration *InputPersonalDocument `json:"temporary_registration"` +} + +func (entity *InputPassportElementTemporaryRegistration) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputPassportElementTemporaryRegistration + + return json.Marshal((*stub)(entity)) +} + +func (*InputPassportElementTemporaryRegistration) GetClass() string { + return ClassInputPassportElement +} + +func (*InputPassportElementTemporaryRegistration) GetType() string { + return TypeInputPassportElementTemporaryRegistration +} + +func (*InputPassportElementTemporaryRegistration) InputPassportElementType() string { + return TypeInputPassportElementTemporaryRegistration +} + +// A Telegram Passport element to be saved containing the user's phone number +type InputPassportElementPhoneNumber struct { + meta + // The phone number to be saved + PhoneNumber string `json:"phone_number"` +} + +func (entity *InputPassportElementPhoneNumber) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputPassportElementPhoneNumber + + return json.Marshal((*stub)(entity)) +} + +func (*InputPassportElementPhoneNumber) GetClass() string { + return ClassInputPassportElement +} + +func (*InputPassportElementPhoneNumber) GetType() string { + return TypeInputPassportElementPhoneNumber +} + +func (*InputPassportElementPhoneNumber) InputPassportElementType() string { + return TypeInputPassportElementPhoneNumber +} + +// A Telegram Passport element to be saved containing the user's email address +type InputPassportElementEmailAddress struct { + meta + // The email address to be saved + EmailAddress string `json:"email_address"` +} + +func (entity *InputPassportElementEmailAddress) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputPassportElementEmailAddress + + return json.Marshal((*stub)(entity)) +} + +func (*InputPassportElementEmailAddress) GetClass() string { + return ClassInputPassportElement +} + +func (*InputPassportElementEmailAddress) GetType() string { + return TypeInputPassportElementEmailAddress +} + +func (*InputPassportElementEmailAddress) InputPassportElementType() string { + return TypeInputPassportElementEmailAddress +} + +// Contains information about saved Telegram Passport elements +type PassportElements struct { + meta + // Telegram Passport elements + Elements []PassportElement `json:"elements"` +} + +func (entity *PassportElements) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PassportElements + + return json.Marshal((*stub)(entity)) +} + +func (*PassportElements) GetClass() string { + return ClassPassportElements +} + +func (*PassportElements) GetType() string { + return TypePassportElements +} + +func (passportElements *PassportElements) UnmarshalJSON(data []byte) error { + var tmp struct { + Elements []json.RawMessage `json:"elements"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldElements, _ := UnmarshalListOfPassportElement(tmp.Elements) + passportElements.Elements = fieldElements + + return nil +} + +// The element contains an error in an unspecified place. The error will be considered resolved when new data is added +type PassportElementErrorSourceUnspecified struct{ + meta +} + +func (entity *PassportElementErrorSourceUnspecified) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PassportElementErrorSourceUnspecified + + return json.Marshal((*stub)(entity)) +} + +func (*PassportElementErrorSourceUnspecified) GetClass() string { + return ClassPassportElementErrorSource +} + +func (*PassportElementErrorSourceUnspecified) GetType() string { + return TypePassportElementErrorSourceUnspecified +} + +func (*PassportElementErrorSourceUnspecified) PassportElementErrorSourceType() string { + return TypePassportElementErrorSourceUnspecified +} + +// One of the data fields contains an error. The error will be considered resolved when the value of the field changes +type PassportElementErrorSourceDataField struct { + meta + // Field name + FieldName string `json:"field_name"` +} + +func (entity *PassportElementErrorSourceDataField) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PassportElementErrorSourceDataField + + return json.Marshal((*stub)(entity)) +} + +func (*PassportElementErrorSourceDataField) GetClass() string { + return ClassPassportElementErrorSource +} + +func (*PassportElementErrorSourceDataField) GetType() string { + return TypePassportElementErrorSourceDataField +} + +func (*PassportElementErrorSourceDataField) PassportElementErrorSourceType() string { + return TypePassportElementErrorSourceDataField +} + +// The front side of the document contains an error. The error will be considered resolved when the file with the front side changes +type PassportElementErrorSourceFrontSide struct{ + meta +} + +func (entity *PassportElementErrorSourceFrontSide) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PassportElementErrorSourceFrontSide + + return json.Marshal((*stub)(entity)) +} + +func (*PassportElementErrorSourceFrontSide) GetClass() string { + return ClassPassportElementErrorSource +} + +func (*PassportElementErrorSourceFrontSide) GetType() string { + return TypePassportElementErrorSourceFrontSide +} + +func (*PassportElementErrorSourceFrontSide) PassportElementErrorSourceType() string { + return TypePassportElementErrorSourceFrontSide +} + +// The reverse side of the document contains an error. The error will be considered resolved when the file with the reverse side changes +type PassportElementErrorSourceReverseSide struct{ + meta +} + +func (entity *PassportElementErrorSourceReverseSide) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PassportElementErrorSourceReverseSide + + return json.Marshal((*stub)(entity)) +} + +func (*PassportElementErrorSourceReverseSide) GetClass() string { + return ClassPassportElementErrorSource +} + +func (*PassportElementErrorSourceReverseSide) GetType() string { + return TypePassportElementErrorSourceReverseSide +} + +func (*PassportElementErrorSourceReverseSide) PassportElementErrorSourceType() string { + return TypePassportElementErrorSourceReverseSide +} + +// The selfie with the document contains an error. The error will be considered resolved when the file with the selfie changes +type PassportElementErrorSourceSelfie struct{ + meta +} + +func (entity *PassportElementErrorSourceSelfie) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PassportElementErrorSourceSelfie + + return json.Marshal((*stub)(entity)) +} + +func (*PassportElementErrorSourceSelfie) GetClass() string { + return ClassPassportElementErrorSource +} + +func (*PassportElementErrorSourceSelfie) GetType() string { + return TypePassportElementErrorSourceSelfie +} + +func (*PassportElementErrorSourceSelfie) PassportElementErrorSourceType() string { + return TypePassportElementErrorSourceSelfie +} + +// 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 { + meta + // Index of a file with the error + FileIndex int32 `json:"file_index"` +} + +func (entity *PassportElementErrorSourceTranslationFile) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PassportElementErrorSourceTranslationFile + + return json.Marshal((*stub)(entity)) +} + +func (*PassportElementErrorSourceTranslationFile) GetClass() string { + return ClassPassportElementErrorSource +} + +func (*PassportElementErrorSourceTranslationFile) GetType() string { + return TypePassportElementErrorSourceTranslationFile +} + +func (*PassportElementErrorSourceTranslationFile) PassportElementErrorSourceType() string { + return TypePassportElementErrorSourceTranslationFile +} + +// The translation of the document contains an error. The error will be considered resolved when the list of translation files changes +type PassportElementErrorSourceTranslationFiles struct{ + meta +} + +func (entity *PassportElementErrorSourceTranslationFiles) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PassportElementErrorSourceTranslationFiles + + return json.Marshal((*stub)(entity)) +} + +func (*PassportElementErrorSourceTranslationFiles) GetClass() string { + return ClassPassportElementErrorSource +} + +func (*PassportElementErrorSourceTranslationFiles) GetType() string { + return TypePassportElementErrorSourceTranslationFiles +} + +func (*PassportElementErrorSourceTranslationFiles) PassportElementErrorSourceType() string { + return TypePassportElementErrorSourceTranslationFiles +} + +// The file contains an error. The error will be considered resolved when the file changes +type PassportElementErrorSourceFile struct { + meta + // Index of a file with the error + FileIndex int32 `json:"file_index"` +} + +func (entity *PassportElementErrorSourceFile) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PassportElementErrorSourceFile + + return json.Marshal((*stub)(entity)) +} + +func (*PassportElementErrorSourceFile) GetClass() string { + return ClassPassportElementErrorSource +} + +func (*PassportElementErrorSourceFile) GetType() string { + return TypePassportElementErrorSourceFile +} + +func (*PassportElementErrorSourceFile) PassportElementErrorSourceType() string { + return TypePassportElementErrorSourceFile +} + +// The list of attached files contains an error. The error will be considered resolved when the list of files changes +type PassportElementErrorSourceFiles struct{ + meta +} + +func (entity *PassportElementErrorSourceFiles) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PassportElementErrorSourceFiles + + return json.Marshal((*stub)(entity)) +} + +func (*PassportElementErrorSourceFiles) GetClass() string { + return ClassPassportElementErrorSource +} + +func (*PassportElementErrorSourceFiles) GetType() string { + return TypePassportElementErrorSourceFiles +} + +func (*PassportElementErrorSourceFiles) PassportElementErrorSourceType() string { + return TypePassportElementErrorSourceFiles +} + +// Contains the description of an error in a Telegram Passport element +type PassportElementError struct { + 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"` +} + +func (entity *PassportElementError) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PassportElementError + + return json.Marshal((*stub)(entity)) +} + +func (*PassportElementError) GetClass() string { + return ClassPassportElementError +} + +func (*PassportElementError) GetType() string { + return TypePassportElementError +} + +func (passportElementError *PassportElementError) UnmarshalJSON(data []byte) error { + var tmp struct { + Type json.RawMessage `json:"type"` + Message string `json:"message"` + Source json.RawMessage `json:"source"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + passportElementError.Message = tmp.Message + + fieldType, _ := UnmarshalPassportElementType(tmp.Type) + passportElementError.Type = fieldType + + fieldSource, _ := UnmarshalPassportElementErrorSource(tmp.Source) + passportElementError.Source = fieldSource + + return nil +} + +// Contains information about a Telegram Passport element that was requested by a service +type PassportSuitableElement struct { + 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"` +} + +func (entity *PassportSuitableElement) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PassportSuitableElement + + return json.Marshal((*stub)(entity)) +} + +func (*PassportSuitableElement) GetClass() string { + return ClassPassportSuitableElement +} + +func (*PassportSuitableElement) GetType() string { + return TypePassportSuitableElement +} + +func (passportSuitableElement *PassportSuitableElement) UnmarshalJSON(data []byte) error { + 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"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + passportSuitableElement.IsSelfieRequired = tmp.IsSelfieRequired + passportSuitableElement.IsTranslationRequired = tmp.IsTranslationRequired + passportSuitableElement.IsNativeNameRequired = tmp.IsNativeNameRequired + + fieldType, _ := UnmarshalPassportElementType(tmp.Type) + passportSuitableElement.Type = fieldType + + return nil +} + +// Contains a description of the required Telegram Passport element that was requested by a service +type PassportRequiredElement struct { + meta + // List of Telegram Passport elements any of which is enough to provide + SuitableElements []*PassportSuitableElement `json:"suitable_elements"` +} + +func (entity *PassportRequiredElement) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PassportRequiredElement + + return json.Marshal((*stub)(entity)) +} + +func (*PassportRequiredElement) GetClass() string { + return ClassPassportRequiredElement +} + +func (*PassportRequiredElement) GetType() string { + return TypePassportRequiredElement +} + +// Contains information about a Telegram Passport authorization form that was requested +type PassportAuthorizationForm struct { + 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"` +} + +func (entity *PassportAuthorizationForm) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PassportAuthorizationForm + + return json.Marshal((*stub)(entity)) +} + +func (*PassportAuthorizationForm) GetClass() string { + return ClassPassportAuthorizationForm +} + +func (*PassportAuthorizationForm) GetType() string { + return TypePassportAuthorizationForm +} + +// Contains information about a Telegram Passport elements and corresponding errors +type PassportElementsWithErrors struct { + meta + // Telegram Passport elements + Elements []PassportElement `json:"elements"` + // Errors in the elements that are already available + Errors []*PassportElementError `json:"errors"` +} + +func (entity *PassportElementsWithErrors) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PassportElementsWithErrors + + return json.Marshal((*stub)(entity)) +} + +func (*PassportElementsWithErrors) GetClass() string { + return ClassPassportElementsWithErrors +} + +func (*PassportElementsWithErrors) GetType() string { + return TypePassportElementsWithErrors +} + +func (passportElementsWithErrors *PassportElementsWithErrors) UnmarshalJSON(data []byte) error { + var tmp struct { + Elements []json.RawMessage `json:"elements"` + Errors []*PassportElementError `json:"errors"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + passportElementsWithErrors.Errors = tmp.Errors + + fieldElements, _ := UnmarshalListOfPassportElement(tmp.Elements) + passportElementsWithErrors.Elements = fieldElements + + return nil +} + +// Contains encrypted Telegram Passport data credentials +type EncryptedCredentials struct { + 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"` +} + +func (entity *EncryptedCredentials) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub EncryptedCredentials + + return json.Marshal((*stub)(entity)) +} + +func (*EncryptedCredentials) GetClass() string { + return ClassEncryptedCredentials +} + +func (*EncryptedCredentials) GetType() string { + return TypeEncryptedCredentials +} + +// Contains information about an encrypted Telegram Passport element; for bots only +type EncryptedPassportElement struct { + 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"` +} + +func (entity *EncryptedPassportElement) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub EncryptedPassportElement + + return json.Marshal((*stub)(entity)) +} + +func (*EncryptedPassportElement) GetClass() string { + return ClassEncryptedPassportElement +} + +func (*EncryptedPassportElement) GetType() string { + return TypeEncryptedPassportElement +} + +func (encryptedPassportElement *EncryptedPassportElement) UnmarshalJSON(data []byte) error { + 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 +} + +// The element contains an error in an unspecified place. The error will be considered resolved when new data is added +type InputPassportElementErrorSourceUnspecified struct { + meta + // Current hash of the entire element + ElementHash []byte `json:"element_hash"` +} + +func (entity *InputPassportElementErrorSourceUnspecified) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputPassportElementErrorSourceUnspecified + + return json.Marshal((*stub)(entity)) +} + +func (*InputPassportElementErrorSourceUnspecified) GetClass() string { + return ClassInputPassportElementErrorSource +} + +func (*InputPassportElementErrorSourceUnspecified) GetType() string { + return TypeInputPassportElementErrorSourceUnspecified +} + +func (*InputPassportElementErrorSourceUnspecified) InputPassportElementErrorSourceType() string { + return TypeInputPassportElementErrorSourceUnspecified +} + +// A data field contains an error. The error is considered resolved when the field's value changes +type InputPassportElementErrorSourceDataField struct { + meta + // Field name + FieldName string `json:"field_name"` + // Current data hash + DataHash []byte `json:"data_hash"` +} + +func (entity *InputPassportElementErrorSourceDataField) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputPassportElementErrorSourceDataField + + return json.Marshal((*stub)(entity)) +} + +func (*InputPassportElementErrorSourceDataField) GetClass() string { + return ClassInputPassportElementErrorSource +} + +func (*InputPassportElementErrorSourceDataField) GetType() string { + return TypeInputPassportElementErrorSourceDataField +} + +func (*InputPassportElementErrorSourceDataField) InputPassportElementErrorSourceType() string { + return TypeInputPassportElementErrorSourceDataField +} + +// 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 { + meta + // Current hash of the file containing the front side + FileHash []byte `json:"file_hash"` +} + +func (entity *InputPassportElementErrorSourceFrontSide) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputPassportElementErrorSourceFrontSide + + return json.Marshal((*stub)(entity)) +} + +func (*InputPassportElementErrorSourceFrontSide) GetClass() string { + return ClassInputPassportElementErrorSource +} + +func (*InputPassportElementErrorSourceFrontSide) GetType() string { + return TypeInputPassportElementErrorSourceFrontSide +} + +func (*InputPassportElementErrorSourceFrontSide) InputPassportElementErrorSourceType() string { + return TypeInputPassportElementErrorSourceFrontSide +} + +// 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 { + meta + // Current hash of the file containing the reverse side + FileHash []byte `json:"file_hash"` +} + +func (entity *InputPassportElementErrorSourceReverseSide) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputPassportElementErrorSourceReverseSide + + return json.Marshal((*stub)(entity)) +} + +func (*InputPassportElementErrorSourceReverseSide) GetClass() string { + return ClassInputPassportElementErrorSource +} + +func (*InputPassportElementErrorSourceReverseSide) GetType() string { + return TypeInputPassportElementErrorSourceReverseSide +} + +func (*InputPassportElementErrorSourceReverseSide) InputPassportElementErrorSourceType() string { + return TypeInputPassportElementErrorSourceReverseSide +} + +// The selfie contains an error. The error is considered resolved when the file with the selfie changes +type InputPassportElementErrorSourceSelfie struct { + meta + // Current hash of the file containing the selfie + FileHash []byte `json:"file_hash"` +} + +func (entity *InputPassportElementErrorSourceSelfie) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputPassportElementErrorSourceSelfie + + return json.Marshal((*stub)(entity)) +} + +func (*InputPassportElementErrorSourceSelfie) GetClass() string { + return ClassInputPassportElementErrorSource +} + +func (*InputPassportElementErrorSourceSelfie) GetType() string { + return TypeInputPassportElementErrorSourceSelfie +} + +func (*InputPassportElementErrorSourceSelfie) InputPassportElementErrorSourceType() string { + return TypeInputPassportElementErrorSourceSelfie +} + +// 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 { + meta + // Current hash of the file containing the translation + FileHash []byte `json:"file_hash"` +} + +func (entity *InputPassportElementErrorSourceTranslationFile) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputPassportElementErrorSourceTranslationFile + + return json.Marshal((*stub)(entity)) +} + +func (*InputPassportElementErrorSourceTranslationFile) GetClass() string { + return ClassInputPassportElementErrorSource +} + +func (*InputPassportElementErrorSourceTranslationFile) GetType() string { + return TypeInputPassportElementErrorSourceTranslationFile +} + +func (*InputPassportElementErrorSourceTranslationFile) InputPassportElementErrorSourceType() string { + return TypeInputPassportElementErrorSourceTranslationFile +} + +// The translation of the document contains an error. The error is considered resolved when the list of files changes +type InputPassportElementErrorSourceTranslationFiles struct { + meta + // Current hashes of all files with the translation + FileHashes [][]byte `json:"file_hashes"` +} + +func (entity *InputPassportElementErrorSourceTranslationFiles) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputPassportElementErrorSourceTranslationFiles + + return json.Marshal((*stub)(entity)) +} + +func (*InputPassportElementErrorSourceTranslationFiles) GetClass() string { + return ClassInputPassportElementErrorSource +} + +func (*InputPassportElementErrorSourceTranslationFiles) GetType() string { + return TypeInputPassportElementErrorSourceTranslationFiles +} + +func (*InputPassportElementErrorSourceTranslationFiles) InputPassportElementErrorSourceType() string { + return TypeInputPassportElementErrorSourceTranslationFiles +} + +// The file contains an error. The error is considered resolved when the file changes +type InputPassportElementErrorSourceFile struct { + meta + // Current hash of the file which has the error + FileHash []byte `json:"file_hash"` +} + +func (entity *InputPassportElementErrorSourceFile) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputPassportElementErrorSourceFile + + return json.Marshal((*stub)(entity)) +} + +func (*InputPassportElementErrorSourceFile) GetClass() string { + return ClassInputPassportElementErrorSource +} + +func (*InputPassportElementErrorSourceFile) GetType() string { + return TypeInputPassportElementErrorSourceFile +} + +func (*InputPassportElementErrorSourceFile) InputPassportElementErrorSourceType() string { + return TypeInputPassportElementErrorSourceFile +} + +// The list of attached files contains an error. The error is considered resolved when the file list changes +type InputPassportElementErrorSourceFiles struct { + meta + // Current hashes of all attached files + FileHashes [][]byte `json:"file_hashes"` +} + +func (entity *InputPassportElementErrorSourceFiles) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputPassportElementErrorSourceFiles + + return json.Marshal((*stub)(entity)) +} + +func (*InputPassportElementErrorSourceFiles) GetClass() string { + return ClassInputPassportElementErrorSource +} + +func (*InputPassportElementErrorSourceFiles) GetType() string { + return TypeInputPassportElementErrorSourceFiles +} + +func (*InputPassportElementErrorSourceFiles) InputPassportElementErrorSourceType() string { + return TypeInputPassportElementErrorSourceFiles +} + +// Contains the description of an error in a Telegram Passport element; for bots only +type InputPassportElementError struct { + 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"` +} + +func (entity *InputPassportElementError) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputPassportElementError + + return json.Marshal((*stub)(entity)) +} + +func (*InputPassportElementError) GetClass() string { + return ClassInputPassportElementError +} + +func (*InputPassportElementError) GetType() string { + return TypeInputPassportElementError +} + +func (inputPassportElementError *InputPassportElementError) UnmarshalJSON(data []byte) error { + var tmp struct { + Type json.RawMessage `json:"type"` + Message string `json:"message"` + Source json.RawMessage `json:"source"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + inputPassportElementError.Message = tmp.Message + + fieldType, _ := UnmarshalPassportElementType(tmp.Type) + inputPassportElementError.Type = fieldType + + fieldSource, _ := UnmarshalInputPassportElementErrorSource(tmp.Source) + inputPassportElementError.Source = fieldSource + + return nil +} + +// A text message +type MessageText struct { + meta + // Text of the message + Text *FormattedText `json:"text"` + // A link preview attached to the message; may be null + WebPage *WebPage `json:"web_page"` + // Options which were used for generation of the link preview; may be null if default options were used + LinkPreviewOptions *LinkPreviewOptions `json:"link_preview_options"` +} + +func (entity *MessageText) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageText + + return json.Marshal((*stub)(entity)) +} + +func (*MessageText) GetClass() string { + return ClassMessageContent +} + +func (*MessageText) GetType() string { + return TypeMessageText +} + +func (*MessageText) MessageContentType() string { + return TypeMessageText +} + +// An animation message (GIF-style). +type MessageAnimation struct { + meta + // The animation description + Animation *Animation `json:"animation"` + // Animation caption + Caption *FormattedText `json:"caption"` + // True, if the animation preview must be covered by a spoiler animation + HasSpoiler bool `json:"has_spoiler"` + // True, if the animation thumbnail must be blurred and the animation must be shown only while tapped + IsSecret bool `json:"is_secret"` +} + +func (entity *MessageAnimation) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageAnimation + + return json.Marshal((*stub)(entity)) +} + +func (*MessageAnimation) GetClass() string { + return ClassMessageContent +} + +func (*MessageAnimation) GetType() string { + return TypeMessageAnimation +} + +func (*MessageAnimation) MessageContentType() string { + return TypeMessageAnimation +} + +// An audio message +type MessageAudio struct { + meta + // The audio description + Audio *Audio `json:"audio"` + // Audio caption + Caption *FormattedText `json:"caption"` +} + +func (entity *MessageAudio) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageAudio + + return json.Marshal((*stub)(entity)) +} + +func (*MessageAudio) GetClass() string { + return ClassMessageContent +} + +func (*MessageAudio) GetType() string { + return TypeMessageAudio +} + +func (*MessageAudio) MessageContentType() string { + return TypeMessageAudio +} + +// A document message (general file) +type MessageDocument struct { + meta + // The document description + Document *Document `json:"document"` + // Document caption + Caption *FormattedText `json:"caption"` +} + +func (entity *MessageDocument) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageDocument + + return json.Marshal((*stub)(entity)) +} + +func (*MessageDocument) GetClass() string { + return ClassMessageContent +} + +func (*MessageDocument) GetType() string { + return TypeMessageDocument +} + +func (*MessageDocument) MessageContentType() string { + return TypeMessageDocument +} + +// A photo message +type MessagePhoto struct { + meta + // The photo + Photo *Photo `json:"photo"` + // Photo caption + Caption *FormattedText `json:"caption"` + // True, if the photo preview must be covered by a spoiler animation + HasSpoiler bool `json:"has_spoiler"` + // True, if the photo must be blurred and must be shown only while tapped + IsSecret bool `json:"is_secret"` +} + +func (entity *MessagePhoto) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessagePhoto + + return json.Marshal((*stub)(entity)) +} + +func (*MessagePhoto) GetClass() string { + return ClassMessageContent +} + +func (*MessagePhoto) GetType() string { + return TypeMessagePhoto +} + +func (*MessagePhoto) MessageContentType() string { + return TypeMessagePhoto +} + +// A sticker message +type MessageSticker struct { + meta + // The sticker description + Sticker *Sticker `json:"sticker"` + // True, if premium animation of the sticker must be played + IsPremium bool `json:"is_premium"` +} + +func (entity *MessageSticker) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageSticker + + return json.Marshal((*stub)(entity)) +} + +func (*MessageSticker) GetClass() string { + return ClassMessageContent +} + +func (*MessageSticker) GetType() string { + return TypeMessageSticker +} + +func (*MessageSticker) MessageContentType() string { + return TypeMessageSticker +} + +// A video message +type MessageVideo struct { + meta + // The video description + Video *Video `json:"video"` + // Video caption + Caption *FormattedText `json:"caption"` + // True, if the video preview must be covered by a spoiler animation + HasSpoiler bool `json:"has_spoiler"` + // True, if the video thumbnail must be blurred and the video must be shown only while tapped + IsSecret bool `json:"is_secret"` +} + +func (entity *MessageVideo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageVideo + + return json.Marshal((*stub)(entity)) +} + +func (*MessageVideo) GetClass() string { + return ClassMessageContent +} + +func (*MessageVideo) GetType() string { + return TypeMessageVideo +} + +func (*MessageVideo) MessageContentType() string { + return TypeMessageVideo +} + +// A video note message +type MessageVideoNote struct { + 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"` +} + +func (entity *MessageVideoNote) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageVideoNote + + return json.Marshal((*stub)(entity)) +} + +func (*MessageVideoNote) GetClass() string { + return ClassMessageContent +} + +func (*MessageVideoNote) GetType() string { + return TypeMessageVideoNote +} + +func (*MessageVideoNote) MessageContentType() string { + return TypeMessageVideoNote +} + +// A voice note message +type MessageVoiceNote struct { + 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"` +} + +func (entity *MessageVoiceNote) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageVoiceNote + + return json.Marshal((*stub)(entity)) +} + +func (*MessageVoiceNote) GetClass() string { + return ClassMessageContent +} + +func (*MessageVoiceNote) GetType() string { + return TypeMessageVoiceNote +} + +func (*MessageVoiceNote) MessageContentType() string { + return TypeMessageVoiceNote +} + +// A self-destructed photo message +type MessageExpiredPhoto struct{ + meta +} + +func (entity *MessageExpiredPhoto) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageExpiredPhoto + + return json.Marshal((*stub)(entity)) +} + +func (*MessageExpiredPhoto) GetClass() string { + return ClassMessageContent +} + +func (*MessageExpiredPhoto) GetType() string { + return TypeMessageExpiredPhoto +} + +func (*MessageExpiredPhoto) MessageContentType() string { + return TypeMessageExpiredPhoto +} + +// A self-destructed video message +type MessageExpiredVideo struct{ + meta +} + +func (entity *MessageExpiredVideo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageExpiredVideo + + return json.Marshal((*stub)(entity)) +} + +func (*MessageExpiredVideo) GetClass() string { + return ClassMessageContent +} + +func (*MessageExpiredVideo) GetType() string { + return TypeMessageExpiredVideo +} + +func (*MessageExpiredVideo) MessageContentType() string { + return TypeMessageExpiredVideo +} + +// A self-destructed video note message +type MessageExpiredVideoNote struct{ + meta +} + +func (entity *MessageExpiredVideoNote) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageExpiredVideoNote + + return json.Marshal((*stub)(entity)) +} + +func (*MessageExpiredVideoNote) GetClass() string { + return ClassMessageContent +} + +func (*MessageExpiredVideoNote) GetType() string { + return TypeMessageExpiredVideoNote +} + +func (*MessageExpiredVideoNote) MessageContentType() string { + return TypeMessageExpiredVideoNote +} + +// A self-destructed voice note message +type MessageExpiredVoiceNote struct{ + meta +} + +func (entity *MessageExpiredVoiceNote) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageExpiredVoiceNote + + return json.Marshal((*stub)(entity)) +} + +func (*MessageExpiredVoiceNote) GetClass() string { + return ClassMessageContent +} + +func (*MessageExpiredVoiceNote) GetType() string { + return TypeMessageExpiredVoiceNote +} + +func (*MessageExpiredVoiceNote) MessageContentType() string { + return TypeMessageExpiredVoiceNote +} + +// A message with a location +type MessageLocation struct { + 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 to the message sender + ProximityAlertRadius int32 `json:"proximity_alert_radius"` +} + +func (entity *MessageLocation) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageLocation + + return json.Marshal((*stub)(entity)) +} + +func (*MessageLocation) GetClass() string { + return ClassMessageContent +} + +func (*MessageLocation) GetType() string { + return TypeMessageLocation +} + +func (*MessageLocation) MessageContentType() string { + return TypeMessageLocation +} + +// A message with information about a venue +type MessageVenue struct { + meta + // The venue description + Venue *Venue `json:"venue"` +} + +func (entity *MessageVenue) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageVenue + + return json.Marshal((*stub)(entity)) +} + +func (*MessageVenue) GetClass() string { + return ClassMessageContent +} + +func (*MessageVenue) GetType() string { + return TypeMessageVenue +} + +func (*MessageVenue) MessageContentType() string { + return TypeMessageVenue +} + +// A message with a user contact +type MessageContact struct { + meta + // The contact description + Contact *Contact `json:"contact"` +} + +func (entity *MessageContact) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageContact + + return json.Marshal((*stub)(entity)) +} + +func (*MessageContact) GetClass() string { + return ClassMessageContent +} + +func (*MessageContact) GetType() string { + return TypeMessageContact +} + +func (*MessageContact) MessageContentType() string { + return TypeMessageContact +} + +// A message with an animated emoji +type MessageAnimatedEmoji struct { + meta + // The animated emoji + AnimatedEmoji *AnimatedEmoji `json:"animated_emoji"` + // The corresponding emoji + Emoji string `json:"emoji"` +} + +func (entity *MessageAnimatedEmoji) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageAnimatedEmoji + + return json.Marshal((*stub)(entity)) +} + +func (*MessageAnimatedEmoji) GetClass() string { + return ClassMessageContent +} + +func (*MessageAnimatedEmoji) GetType() string { + return TypeMessageAnimatedEmoji +} + +func (*MessageAnimatedEmoji) MessageContentType() string { + return TypeMessageAnimatedEmoji +} + +// A dice message. The dice value is randomly generated by the server +type MessageDice struct { + 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"` +} + +func (entity *MessageDice) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageDice + + return json.Marshal((*stub)(entity)) +} + +func (*MessageDice) GetClass() string { + return ClassMessageContent +} + +func (*MessageDice) GetType() string { + return TypeMessageDice +} + +func (*MessageDice) MessageContentType() string { + return TypeMessageDice +} + +func (messageDice *MessageDice) UnmarshalJSON(data []byte) error { + 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"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + messageDice.Emoji = tmp.Emoji + messageDice.Value = tmp.Value + messageDice.SuccessAnimationFrameNumber = tmp.SuccessAnimationFrameNumber + + fieldInitialState, _ := UnmarshalDiceStickers(tmp.InitialState) + messageDice.InitialState = fieldInitialState + + fieldFinalState, _ := UnmarshalDiceStickers(tmp.FinalState) + messageDice.FinalState = fieldFinalState + + return nil +} + +// A message with a game +type MessageGame struct { + meta + // The game description + Game *Game `json:"game"` +} + +func (entity *MessageGame) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageGame + + return json.Marshal((*stub)(entity)) +} + +func (*MessageGame) GetClass() string { + return ClassMessageContent +} + +func (*MessageGame) GetType() string { + return TypeMessageGame +} + +func (*MessageGame) MessageContentType() string { + return TypeMessageGame +} + +// A message with a poll +type MessagePoll struct { + meta + // The poll description + Poll *Poll `json:"poll"` +} + +func (entity *MessagePoll) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessagePoll + + return json.Marshal((*stub)(entity)) +} + +func (*MessagePoll) GetClass() string { + return ClassMessageContent +} + +func (*MessagePoll) GetType() string { + return TypeMessagePoll +} + +func (*MessagePoll) MessageContentType() string { + return TypeMessagePoll +} + +// A message with a forwarded story +type MessageStory struct { + meta + // Identifier of the chat that posted the story + StorySenderChatId int64 `json:"story_sender_chat_id"` + // Story identifier + StoryId int32 `json:"story_id"` + // True, if the story was automatically forwarded because of a mention of the user + ViaMention bool `json:"via_mention"` +} + +func (entity *MessageStory) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageStory + + return json.Marshal((*stub)(entity)) +} + +func (*MessageStory) GetClass() string { + return ClassMessageContent +} + +func (*MessageStory) GetType() string { + return TypeMessageStory +} + +func (*MessageStory) MessageContentType() string { + return TypeMessageStory +} + +// A message with an invoice from a bot. Use getInternalLink with internalLinkTypeBotStart to share the invoice +type MessageInvoice struct { + meta + // Product title + Title string `json:"title"` + // Product description + Description *FormattedText `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 be passed to getInternalLink + 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"` + // Extended media attached to the invoice; may be null + ExtendedMedia MessageExtendedMedia `json:"extended_media"` +} + +func (entity *MessageInvoice) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageInvoice + + return json.Marshal((*stub)(entity)) +} + +func (*MessageInvoice) GetClass() string { + return ClassMessageContent +} + +func (*MessageInvoice) GetType() string { + return TypeMessageInvoice +} + +func (*MessageInvoice) MessageContentType() string { + return TypeMessageInvoice +} + +func (messageInvoice *MessageInvoice) UnmarshalJSON(data []byte) error { + var tmp struct { + Title string `json:"title"` + Description *FormattedText `json:"description"` + Photo *Photo `json:"photo"` + Currency string `json:"currency"` + TotalAmount int64 `json:"total_amount"` + StartParameter string `json:"start_parameter"` + IsTest bool `json:"is_test"` + NeedShippingAddress bool `json:"need_shipping_address"` + ReceiptMessageId int64 `json:"receipt_message_id"` + ExtendedMedia json.RawMessage `json:"extended_media"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + messageInvoice.Title = tmp.Title + messageInvoice.Description = tmp.Description + messageInvoice.Photo = tmp.Photo + messageInvoice.Currency = tmp.Currency + messageInvoice.TotalAmount = tmp.TotalAmount + messageInvoice.StartParameter = tmp.StartParameter + messageInvoice.IsTest = tmp.IsTest + messageInvoice.NeedShippingAddress = tmp.NeedShippingAddress + messageInvoice.ReceiptMessageId = tmp.ReceiptMessageId + + fieldExtendedMedia, _ := UnmarshalMessageExtendedMedia(tmp.ExtendedMedia) + messageInvoice.ExtendedMedia = fieldExtendedMedia + + return nil +} + +// A message with information about an ended call +type MessageCall struct { + 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"` +} + +func (entity *MessageCall) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageCall + + return json.Marshal((*stub)(entity)) +} + +func (*MessageCall) GetClass() string { + return ClassMessageContent +} + +func (*MessageCall) GetType() string { + return TypeMessageCall +} + +func (*MessageCall) MessageContentType() string { + return TypeMessageCall +} + +func (messageCall *MessageCall) UnmarshalJSON(data []byte) error { + var tmp struct { + IsVideo bool `json:"is_video"` + DiscardReason json.RawMessage `json:"discard_reason"` + Duration int32 `json:"duration"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + messageCall.IsVideo = tmp.IsVideo + messageCall.Duration = tmp.Duration + + fieldDiscardReason, _ := UnmarshalCallDiscardReason(tmp.DiscardReason) + messageCall.DiscardReason = fieldDiscardReason + + return nil +} + +// A new video chat was scheduled +type MessageVideoChatScheduled struct { + 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"` +} + +func (entity *MessageVideoChatScheduled) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageVideoChatScheduled + + return json.Marshal((*stub)(entity)) +} + +func (*MessageVideoChatScheduled) GetClass() string { + return ClassMessageContent +} + +func (*MessageVideoChatScheduled) GetType() string { + return TypeMessageVideoChatScheduled +} + +func (*MessageVideoChatScheduled) MessageContentType() string { + return TypeMessageVideoChatScheduled +} + +// A newly created video chat +type MessageVideoChatStarted struct { + meta + // Identifier of the video chat. The video chat can be received through the method getGroupCall + GroupCallId int32 `json:"group_call_id"` +} + +func (entity *MessageVideoChatStarted) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageVideoChatStarted + + return json.Marshal((*stub)(entity)) +} + +func (*MessageVideoChatStarted) GetClass() string { + return ClassMessageContent +} + +func (*MessageVideoChatStarted) GetType() string { + return TypeMessageVideoChatStarted +} + +func (*MessageVideoChatStarted) MessageContentType() string { + return TypeMessageVideoChatStarted +} + +// A message with information about an ended video chat +type MessageVideoChatEnded struct { + meta + // Call duration, in seconds + Duration int32 `json:"duration"` +} + +func (entity *MessageVideoChatEnded) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageVideoChatEnded + + return json.Marshal((*stub)(entity)) +} + +func (*MessageVideoChatEnded) GetClass() string { + return ClassMessageContent +} + +func (*MessageVideoChatEnded) GetType() string { + return TypeMessageVideoChatEnded +} + +func (*MessageVideoChatEnded) MessageContentType() string { + return TypeMessageVideoChatEnded +} + +// A message with information about an invite to a video chat +type MessageInviteVideoChatParticipants struct { + 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"` +} + +func (entity *MessageInviteVideoChatParticipants) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageInviteVideoChatParticipants + + return json.Marshal((*stub)(entity)) +} + +func (*MessageInviteVideoChatParticipants) GetClass() string { + return ClassMessageContent +} + +func (*MessageInviteVideoChatParticipants) GetType() string { + return TypeMessageInviteVideoChatParticipants +} + +func (*MessageInviteVideoChatParticipants) MessageContentType() string { + return TypeMessageInviteVideoChatParticipants +} + +// A newly created basic group +type MessageBasicGroupChatCreate struct { + meta + // Title of the basic group + Title string `json:"title"` + // User identifiers of members in the basic group + MemberUserIds []int64 `json:"member_user_ids"` +} + +func (entity *MessageBasicGroupChatCreate) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageBasicGroupChatCreate + + return json.Marshal((*stub)(entity)) +} + +func (*MessageBasicGroupChatCreate) GetClass() string { + return ClassMessageContent +} + +func (*MessageBasicGroupChatCreate) GetType() string { + return TypeMessageBasicGroupChatCreate +} + +func (*MessageBasicGroupChatCreate) MessageContentType() string { + return TypeMessageBasicGroupChatCreate +} + +// A newly created supergroup or channel +type MessageSupergroupChatCreate struct { + meta + // Title of the supergroup or channel + Title string `json:"title"` +} + +func (entity *MessageSupergroupChatCreate) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageSupergroupChatCreate + + return json.Marshal((*stub)(entity)) +} + +func (*MessageSupergroupChatCreate) GetClass() string { + return ClassMessageContent +} + +func (*MessageSupergroupChatCreate) GetType() string { + return TypeMessageSupergroupChatCreate +} + +func (*MessageSupergroupChatCreate) MessageContentType() string { + return TypeMessageSupergroupChatCreate +} + +// An updated chat title +type MessageChatChangeTitle struct { + meta + // New chat title + Title string `json:"title"` +} + +func (entity *MessageChatChangeTitle) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageChatChangeTitle + + return json.Marshal((*stub)(entity)) +} + +func (*MessageChatChangeTitle) GetClass() string { + return ClassMessageContent +} + +func (*MessageChatChangeTitle) GetType() string { + return TypeMessageChatChangeTitle +} + +func (*MessageChatChangeTitle) MessageContentType() string { + return TypeMessageChatChangeTitle +} + +// An updated chat photo +type MessageChatChangePhoto struct { + meta + // New chat photo + Photo *ChatPhoto `json:"photo"` +} + +func (entity *MessageChatChangePhoto) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageChatChangePhoto + + return json.Marshal((*stub)(entity)) +} + +func (*MessageChatChangePhoto) GetClass() string { + return ClassMessageContent +} + +func (*MessageChatChangePhoto) GetType() string { + return TypeMessageChatChangePhoto +} + +func (*MessageChatChangePhoto) MessageContentType() string { + return TypeMessageChatChangePhoto +} + +// A deleted chat photo +type MessageChatDeletePhoto struct{ + meta +} + +func (entity *MessageChatDeletePhoto) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageChatDeletePhoto + + return json.Marshal((*stub)(entity)) +} + +func (*MessageChatDeletePhoto) GetClass() string { + return ClassMessageContent +} + +func (*MessageChatDeletePhoto) GetType() string { + return TypeMessageChatDeletePhoto +} + +func (*MessageChatDeletePhoto) MessageContentType() string { + return TypeMessageChatDeletePhoto +} + +// New chat members were added +type MessageChatAddMembers struct { + meta + // User identifiers of the new members + MemberUserIds []int64 `json:"member_user_ids"` +} + +func (entity *MessageChatAddMembers) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageChatAddMembers + + return json.Marshal((*stub)(entity)) +} + +func (*MessageChatAddMembers) GetClass() string { + return ClassMessageContent +} + +func (*MessageChatAddMembers) GetType() string { + return TypeMessageChatAddMembers +} + +func (*MessageChatAddMembers) MessageContentType() string { + return TypeMessageChatAddMembers +} + +// A new member joined the chat via an invite link +type MessageChatJoinByLink struct{ + meta +} + +func (entity *MessageChatJoinByLink) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageChatJoinByLink + + return json.Marshal((*stub)(entity)) +} + +func (*MessageChatJoinByLink) GetClass() string { + return ClassMessageContent +} + +func (*MessageChatJoinByLink) GetType() string { + return TypeMessageChatJoinByLink +} + +func (*MessageChatJoinByLink) MessageContentType() string { + return TypeMessageChatJoinByLink +} + +// A new member was accepted to the chat by an administrator +type MessageChatJoinByRequest struct{ + meta +} + +func (entity *MessageChatJoinByRequest) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageChatJoinByRequest + + return json.Marshal((*stub)(entity)) +} + +func (*MessageChatJoinByRequest) GetClass() string { + return ClassMessageContent +} + +func (*MessageChatJoinByRequest) GetType() string { + return TypeMessageChatJoinByRequest +} + +func (*MessageChatJoinByRequest) MessageContentType() string { + return TypeMessageChatJoinByRequest +} + +// A chat member was deleted +type MessageChatDeleteMember struct { + meta + // User identifier of the deleted chat member + UserId int64 `json:"user_id"` +} + +func (entity *MessageChatDeleteMember) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageChatDeleteMember + + return json.Marshal((*stub)(entity)) +} + +func (*MessageChatDeleteMember) GetClass() string { + return ClassMessageContent +} + +func (*MessageChatDeleteMember) GetType() string { + return TypeMessageChatDeleteMember +} + +func (*MessageChatDeleteMember) MessageContentType() string { + return TypeMessageChatDeleteMember +} + +// A basic group was upgraded to a supergroup and was deactivated as the result +type MessageChatUpgradeTo struct { + meta + // Identifier of the supergroup to which the basic group was upgraded + SupergroupId int64 `json:"supergroup_id"` +} + +func (entity *MessageChatUpgradeTo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageChatUpgradeTo + + return json.Marshal((*stub)(entity)) +} + +func (*MessageChatUpgradeTo) GetClass() string { + return ClassMessageContent +} + +func (*MessageChatUpgradeTo) GetType() string { + return TypeMessageChatUpgradeTo +} + +func (*MessageChatUpgradeTo) MessageContentType() string { + return TypeMessageChatUpgradeTo +} + +// A supergroup has been created from a basic group +type MessageChatUpgradeFrom struct { + meta + // Title of the newly created supergroup + Title string `json:"title"` + // The identifier of the original basic group + BasicGroupId int64 `json:"basic_group_id"` +} + +func (entity *MessageChatUpgradeFrom) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageChatUpgradeFrom + + return json.Marshal((*stub)(entity)) +} + +func (*MessageChatUpgradeFrom) GetClass() string { + return ClassMessageContent +} + +func (*MessageChatUpgradeFrom) GetType() string { + return TypeMessageChatUpgradeFrom +} + +func (*MessageChatUpgradeFrom) MessageContentType() string { + return TypeMessageChatUpgradeFrom +} + +// A message has been pinned +type MessagePinMessage struct { + meta + // Identifier of the pinned message, can be an identifier of a deleted message or 0 + MessageId int64 `json:"message_id"` +} + +func (entity *MessagePinMessage) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessagePinMessage + + return json.Marshal((*stub)(entity)) +} + +func (*MessagePinMessage) GetClass() string { + return ClassMessageContent +} + +func (*MessagePinMessage) GetType() string { + return TypeMessagePinMessage +} + +func (*MessagePinMessage) MessageContentType() string { + return TypeMessagePinMessage +} + +// A screenshot of a message in the chat has been taken +type MessageScreenshotTaken struct{ + meta +} + +func (entity *MessageScreenshotTaken) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageScreenshotTaken + + return json.Marshal((*stub)(entity)) +} + +func (*MessageScreenshotTaken) GetClass() string { + return ClassMessageContent +} + +func (*MessageScreenshotTaken) GetType() string { + return TypeMessageScreenshotTaken +} + +func (*MessageScreenshotTaken) MessageContentType() string { + return TypeMessageScreenshotTaken +} + +// A new background was set in the chat +type MessageChatSetBackground struct { + meta + // Identifier of the message with a previously set same background; 0 if none. Can be an identifier of a deleted message + OldBackgroundMessageId int64 `json:"old_background_message_id"` + // The new background + Background *ChatBackground `json:"background"` + // True, if the background was set only for self + OnlyForSelf bool `json:"only_for_self"` +} + +func (entity *MessageChatSetBackground) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageChatSetBackground + + return json.Marshal((*stub)(entity)) +} + +func (*MessageChatSetBackground) GetClass() string { + return ClassMessageContent +} + +func (*MessageChatSetBackground) GetType() string { + return TypeMessageChatSetBackground +} + +func (*MessageChatSetBackground) MessageContentType() string { + return TypeMessageChatSetBackground +} + +// A theme in the chat has been changed +type MessageChatSetTheme struct { + 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"` +} + +func (entity *MessageChatSetTheme) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageChatSetTheme + + return json.Marshal((*stub)(entity)) +} + +func (*MessageChatSetTheme) GetClass() string { + return ClassMessageContent +} + +func (*MessageChatSetTheme) GetType() string { + return TypeMessageChatSetTheme +} + +func (*MessageChatSetTheme) MessageContentType() string { + return TypeMessageChatSetTheme +} + +// The auto-delete or self-destruct timer for messages in the chat has been changed +type MessageChatSetMessageAutoDeleteTime struct { + meta + // New value auto-delete or self-destruct time, in seconds; 0 if disabled + MessageAutoDeleteTime int32 `json:"message_auto_delete_time"` + // If not 0, a user identifier, which default setting was automatically applied + FromUserId int64 `json:"from_user_id"` +} + +func (entity *MessageChatSetMessageAutoDeleteTime) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageChatSetMessageAutoDeleteTime + + return json.Marshal((*stub)(entity)) +} + +func (*MessageChatSetMessageAutoDeleteTime) GetClass() string { + return ClassMessageContent +} + +func (*MessageChatSetMessageAutoDeleteTime) GetType() string { + return TypeMessageChatSetMessageAutoDeleteTime +} + +func (*MessageChatSetMessageAutoDeleteTime) MessageContentType() string { + return TypeMessageChatSetMessageAutoDeleteTime +} + +// The chat was boosted by the sender of the message +type MessageChatBoost struct { + meta + // Number of times the chat was boosted + BoostCount int32 `json:"boost_count"` +} + +func (entity *MessageChatBoost) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageChatBoost + + return json.Marshal((*stub)(entity)) +} + +func (*MessageChatBoost) GetClass() string { + return ClassMessageContent +} + +func (*MessageChatBoost) GetType() string { + return TypeMessageChatBoost +} + +func (*MessageChatBoost) MessageContentType() string { + return TypeMessageChatBoost +} + +// A forum topic has been created +type MessageForumTopicCreated struct { + meta + // Name of the topic + Name string `json:"name"` + // Icon of the topic + Icon *ForumTopicIcon `json:"icon"` +} + +func (entity *MessageForumTopicCreated) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageForumTopicCreated + + return json.Marshal((*stub)(entity)) +} + +func (*MessageForumTopicCreated) GetClass() string { + return ClassMessageContent +} + +func (*MessageForumTopicCreated) GetType() string { + return TypeMessageForumTopicCreated +} + +func (*MessageForumTopicCreated) MessageContentType() string { + return TypeMessageForumTopicCreated +} + +// A forum topic has been edited +type MessageForumTopicEdited struct { + meta + // If non-empty, the new name of the topic + Name string `json:"name"` + // True, if icon's custom_emoji_id is changed + EditIconCustomEmojiId bool `json:"edit_icon_custom_emoji_id"` + // New unique identifier of the custom emoji shown on the topic icon; 0 if none. Must be ignored if edit_icon_custom_emoji_id is false + IconCustomEmojiId JsonInt64 `json:"icon_custom_emoji_id"` +} + +func (entity *MessageForumTopicEdited) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageForumTopicEdited + + return json.Marshal((*stub)(entity)) +} + +func (*MessageForumTopicEdited) GetClass() string { + return ClassMessageContent +} + +func (*MessageForumTopicEdited) GetType() string { + return TypeMessageForumTopicEdited +} + +func (*MessageForumTopicEdited) MessageContentType() string { + return TypeMessageForumTopicEdited +} + +// A forum topic has been closed or opened +type MessageForumTopicIsClosedToggled struct { + meta + // True, if the topic was closed; otherwise, the topic was reopened + IsClosed bool `json:"is_closed"` +} + +func (entity *MessageForumTopicIsClosedToggled) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageForumTopicIsClosedToggled + + return json.Marshal((*stub)(entity)) +} + +func (*MessageForumTopicIsClosedToggled) GetClass() string { + return ClassMessageContent +} + +func (*MessageForumTopicIsClosedToggled) GetType() string { + return TypeMessageForumTopicIsClosedToggled +} + +func (*MessageForumTopicIsClosedToggled) MessageContentType() string { + return TypeMessageForumTopicIsClosedToggled +} + +// A General forum topic has been hidden or unhidden +type MessageForumTopicIsHiddenToggled struct { + meta + // True, if the topic was hidden; otherwise, the topic was unhidden + IsHidden bool `json:"is_hidden"` +} + +func (entity *MessageForumTopicIsHiddenToggled) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageForumTopicIsHiddenToggled + + return json.Marshal((*stub)(entity)) +} + +func (*MessageForumTopicIsHiddenToggled) GetClass() string { + return ClassMessageContent +} + +func (*MessageForumTopicIsHiddenToggled) GetType() string { + return TypeMessageForumTopicIsHiddenToggled +} + +func (*MessageForumTopicIsHiddenToggled) MessageContentType() string { + return TypeMessageForumTopicIsHiddenToggled +} + +// A profile photo was suggested to a user in a private chat +type MessageSuggestProfilePhoto struct { + meta + // The suggested chat photo. Use the method setProfilePhoto with inputChatPhotoPrevious to apply the photo + Photo *ChatPhoto `json:"photo"` +} + +func (entity *MessageSuggestProfilePhoto) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageSuggestProfilePhoto + + return json.Marshal((*stub)(entity)) +} + +func (*MessageSuggestProfilePhoto) GetClass() string { + return ClassMessageContent +} + +func (*MessageSuggestProfilePhoto) GetType() string { + return TypeMessageSuggestProfilePhoto +} + +func (*MessageSuggestProfilePhoto) MessageContentType() string { + return TypeMessageSuggestProfilePhoto +} + +// A non-standard action has happened in the chat +type MessageCustomServiceAction struct { + meta + // Message text to be shown in the chat + Text string `json:"text"` +} + +func (entity *MessageCustomServiceAction) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageCustomServiceAction + + return json.Marshal((*stub)(entity)) +} + +func (*MessageCustomServiceAction) GetClass() string { + return ClassMessageContent +} + +func (*MessageCustomServiceAction) GetType() string { + return TypeMessageCustomServiceAction +} + +func (*MessageCustomServiceAction) MessageContentType() string { + return TypeMessageCustomServiceAction +} + +// A new high score was achieved in a game +type MessageGameScore struct { + 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"` +} + +func (entity *MessageGameScore) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageGameScore + + return json.Marshal((*stub)(entity)) +} + +func (*MessageGameScore) GetClass() string { + return ClassMessageContent +} + +func (*MessageGameScore) GetType() string { + return TypeMessageGameScore +} + +func (*MessageGameScore) MessageContentType() string { + return TypeMessageGameScore +} + +// A payment has been completed +type MessagePaymentSuccessful struct { + meta + // Identifier of the chat, containing the corresponding invoice message + InvoiceChatId int64 `json:"invoice_chat_id"` + // Identifier of the message with the corresponding invoice; can be 0 or 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"` + // True, if this is a recurring payment + IsRecurring bool `json:"is_recurring"` + // True, if this is the first recurring payment + IsFirstRecurring bool `json:"is_first_recurring"` + // Name of the invoice; may be empty if unknown + InvoiceName string `json:"invoice_name"` +} + +func (entity *MessagePaymentSuccessful) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessagePaymentSuccessful + + return json.Marshal((*stub)(entity)) +} + +func (*MessagePaymentSuccessful) GetClass() string { + return ClassMessageContent +} + +func (*MessagePaymentSuccessful) GetType() string { + return TypeMessagePaymentSuccessful +} + +func (*MessagePaymentSuccessful) MessageContentType() string { + return TypeMessagePaymentSuccessful +} + +// A payment has been completed; for bots only +type MessagePaymentSuccessfulBot struct { + 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"` + // True, if this is a recurring payment + IsRecurring bool `json:"is_recurring"` + // True, if this is the first recurring payment + IsFirstRecurring bool `json:"is_first_recurring"` + // 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"` +} + +func (entity *MessagePaymentSuccessfulBot) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessagePaymentSuccessfulBot + + return json.Marshal((*stub)(entity)) +} + +func (*MessagePaymentSuccessfulBot) GetClass() string { + return ClassMessageContent +} + +func (*MessagePaymentSuccessfulBot) GetType() string { + return TypeMessagePaymentSuccessfulBot +} + +func (*MessagePaymentSuccessfulBot) MessageContentType() string { + return TypeMessagePaymentSuccessfulBot +} + +// Telegram Premium was gifted to the user +type MessageGiftedPremium struct { + meta + // The identifier of a user that gifted Telegram Premium; 0 if the gift was anonymous + GifterUserId int64 `json:"gifter_user_id"` + // Currency for the paid amount + Currency string `json:"currency"` + // The paid amount, in the smallest units of the currency + Amount int64 `json:"amount"` + // Cryptocurrency used to pay for the gift; may be empty if none + Cryptocurrency string `json:"cryptocurrency"` + // The paid amount, in the smallest units of the cryptocurrency; 0 if none + CryptocurrencyAmount JsonInt64 `json:"cryptocurrency_amount"` + // Number of months the Telegram Premium subscription will be active + MonthCount int32 `json:"month_count"` + // A sticker to be shown in the message; may be null if unknown + Sticker *Sticker `json:"sticker"` +} + +func (entity *MessageGiftedPremium) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageGiftedPremium + + return json.Marshal((*stub)(entity)) +} + +func (*MessageGiftedPremium) GetClass() string { + return ClassMessageContent +} + +func (*MessageGiftedPremium) GetType() string { + return TypeMessageGiftedPremium +} + +func (*MessageGiftedPremium) MessageContentType() string { + return TypeMessageGiftedPremium +} + +// A Telegram Premium gift code was created for the user +type MessagePremiumGiftCode struct { + meta + // Identifier of a chat or a user that created the gift code; may be null if unknown + CreatorId MessageSender `json:"creator_id"` + // True, if the gift code was created for a giveaway + IsFromGiveaway bool `json:"is_from_giveaway"` + // True, if the winner for the corresponding Telegram Premium subscription wasn't chosen + IsUnclaimed bool `json:"is_unclaimed"` + // Currency for the paid amount; empty if unknown + Currency string `json:"currency"` + // The paid amount, in the smallest units of the currency; 0 if unknown + Amount int64 `json:"amount"` + // Cryptocurrency used to pay for the gift; may be empty if none or unknown + Cryptocurrency string `json:"cryptocurrency"` + // The paid amount, in the smallest units of the cryptocurrency; 0 if unknown + CryptocurrencyAmount JsonInt64 `json:"cryptocurrency_amount"` + // Number of months the Telegram Premium subscription will be active after code activation + MonthCount int32 `json:"month_count"` + // A sticker to be shown in the message; may be null if unknown + Sticker *Sticker `json:"sticker"` + // The gift code + Code string `json:"code"` +} + +func (entity *MessagePremiumGiftCode) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessagePremiumGiftCode + + return json.Marshal((*stub)(entity)) +} + +func (*MessagePremiumGiftCode) GetClass() string { + return ClassMessageContent +} + +func (*MessagePremiumGiftCode) GetType() string { + return TypeMessagePremiumGiftCode +} + +func (*MessagePremiumGiftCode) MessageContentType() string { + return TypeMessagePremiumGiftCode +} + +func (messagePremiumGiftCode *MessagePremiumGiftCode) UnmarshalJSON(data []byte) error { + var tmp struct { + CreatorId json.RawMessage `json:"creator_id"` + IsFromGiveaway bool `json:"is_from_giveaway"` + IsUnclaimed bool `json:"is_unclaimed"` + Currency string `json:"currency"` + Amount int64 `json:"amount"` + Cryptocurrency string `json:"cryptocurrency"` + CryptocurrencyAmount JsonInt64 `json:"cryptocurrency_amount"` + MonthCount int32 `json:"month_count"` + Sticker *Sticker `json:"sticker"` + Code string `json:"code"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + messagePremiumGiftCode.IsFromGiveaway = tmp.IsFromGiveaway + messagePremiumGiftCode.IsUnclaimed = tmp.IsUnclaimed + messagePremiumGiftCode.Currency = tmp.Currency + messagePremiumGiftCode.Amount = tmp.Amount + messagePremiumGiftCode.Cryptocurrency = tmp.Cryptocurrency + messagePremiumGiftCode.CryptocurrencyAmount = tmp.CryptocurrencyAmount + messagePremiumGiftCode.MonthCount = tmp.MonthCount + messagePremiumGiftCode.Sticker = tmp.Sticker + messagePremiumGiftCode.Code = tmp.Code + + fieldCreatorId, _ := UnmarshalMessageSender(tmp.CreatorId) + messagePremiumGiftCode.CreatorId = fieldCreatorId + + return nil +} + +// A Telegram Premium giveaway was created for the chat +type MessagePremiumGiveawayCreated struct{ + meta +} + +func (entity *MessagePremiumGiveawayCreated) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessagePremiumGiveawayCreated + + return json.Marshal((*stub)(entity)) +} + +func (*MessagePremiumGiveawayCreated) GetClass() string { + return ClassMessageContent +} + +func (*MessagePremiumGiveawayCreated) GetType() string { + return TypeMessagePremiumGiveawayCreated +} + +func (*MessagePremiumGiveawayCreated) MessageContentType() string { + return TypeMessagePremiumGiveawayCreated +} + +// A Telegram Premium giveaway +type MessagePremiumGiveaway struct { + meta + // Giveaway parameters + Parameters *PremiumGiveawayParameters `json:"parameters"` + // Number of users which will receive Telegram Premium subscription gift codes + WinnerCount int32 `json:"winner_count"` + // Number of months the Telegram Premium subscription will be active after code activation + MonthCount int32 `json:"month_count"` + // A sticker to be shown in the message; may be null if unknown + Sticker *Sticker `json:"sticker"` +} + +func (entity *MessagePremiumGiveaway) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessagePremiumGiveaway + + return json.Marshal((*stub)(entity)) +} + +func (*MessagePremiumGiveaway) GetClass() string { + return ClassMessageContent +} + +func (*MessagePremiumGiveaway) GetType() string { + return TypeMessagePremiumGiveaway +} + +func (*MessagePremiumGiveaway) MessageContentType() string { + return TypeMessagePremiumGiveaway +} + +// A Telegram Premium giveaway without public winners has been completed for the chat +type MessagePremiumGiveawayCompleted struct { + meta + // Identifier of the message with the giveaway; can be 0 if the message was deleted + GiveawayMessageId int64 `json:"giveaway_message_id"` + // Number of winners in the giveaway + WinnerCount int32 `json:"winner_count"` + // Number of undistributed prizes + UnclaimedPrizeCount int32 `json:"unclaimed_prize_count"` +} + +func (entity *MessagePremiumGiveawayCompleted) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessagePremiumGiveawayCompleted + + return json.Marshal((*stub)(entity)) +} + +func (*MessagePremiumGiveawayCompleted) GetClass() string { + return ClassMessageContent +} + +func (*MessagePremiumGiveawayCompleted) GetType() string { + return TypeMessagePremiumGiveawayCompleted +} + +func (*MessagePremiumGiveawayCompleted) MessageContentType() string { + return TypeMessagePremiumGiveawayCompleted +} + +// A Telegram Premium giveaway with public winners has been completed for the chat +type MessagePremiumGiveawayWinners struct { + meta + // Identifier of the channel chat, which was automatically boosted by the winners of the giveaway for duration of the Premium subscription + BoostedChatId int64 `json:"boosted_chat_id"` + // Identifier of the message with the giveaway in the boosted chat + GiveawayMessageId int64 `json:"giveaway_message_id"` + // Number of other chats that participated in the giveaway + AdditionalChatCount int32 `json:"additional_chat_count"` + // Point in time (Unix timestamp) when the winners were selected. May be bigger than winners selection date specified in parameters of the giveaway + ActualWinnersSelectionDate int32 `json:"actual_winners_selection_date"` + // True, if only new members of the chats were eligible for the giveaway + OnlyNewMembers bool `json:"only_new_members"` + // True, if the giveaway was canceled and was fully refunded + WasRefunded bool `json:"was_refunded"` + // Number of months the Telegram Premium subscription will be active after code activation + MonthCount int32 `json:"month_count"` + // Additional description of the giveaway prize + PrizeDescription string `json:"prize_description"` + // Total number of winners in the giveaway + WinnerCount int32 `json:"winner_count"` + // Up to 100 user identifiers of the winners of the giveaway + WinnerUserIds []int64 `json:"winner_user_ids"` + // Number of undistributed prizes + UnclaimedPrizeCount int32 `json:"unclaimed_prize_count"` +} + +func (entity *MessagePremiumGiveawayWinners) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessagePremiumGiveawayWinners + + return json.Marshal((*stub)(entity)) +} + +func (*MessagePremiumGiveawayWinners) GetClass() string { + return ClassMessageContent +} + +func (*MessagePremiumGiveawayWinners) GetType() string { + return TypeMessagePremiumGiveawayWinners +} + +func (*MessagePremiumGiveawayWinners) MessageContentType() string { + return TypeMessagePremiumGiveawayWinners +} + +// A contact has registered with Telegram +type MessageContactRegistered struct{ + meta +} + +func (entity *MessageContactRegistered) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageContactRegistered + + return json.Marshal((*stub)(entity)) +} + +func (*MessageContactRegistered) GetClass() string { + return ClassMessageContent +} + +func (*MessageContactRegistered) GetType() string { + return TypeMessageContactRegistered +} + +func (*MessageContactRegistered) MessageContentType() string { + return TypeMessageContactRegistered +} + +// The current user shared users, which were requested by the bot +type MessageUsersShared struct { + meta + // The shared users + Users []*SharedUser `json:"users"` + // Identifier of the keyboard button with the request + ButtonId int32 `json:"button_id"` +} + +func (entity *MessageUsersShared) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageUsersShared + + return json.Marshal((*stub)(entity)) +} + +func (*MessageUsersShared) GetClass() string { + return ClassMessageContent +} + +func (*MessageUsersShared) GetType() string { + return TypeMessageUsersShared +} + +func (*MessageUsersShared) MessageContentType() string { + return TypeMessageUsersShared +} + +// The current user shared a chat, which was requested by the bot +type MessageChatShared struct { + meta + // The shared chat + Chat *SharedChat `json:"chat"` + // Identifier of the keyboard button with the request + ButtonId int32 `json:"button_id"` +} + +func (entity *MessageChatShared) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageChatShared + + return json.Marshal((*stub)(entity)) +} + +func (*MessageChatShared) GetClass() string { + return ClassMessageContent +} + +func (*MessageChatShared) GetType() string { + return TypeMessageChatShared +} + +func (*MessageChatShared) MessageContentType() string { + return TypeMessageChatShared +} + +// The user allowed the bot to send messages +type MessageBotWriteAccessAllowed struct { + meta + // The reason why the bot was allowed to write messages + Reason BotWriteAccessAllowReason `json:"reason"` +} + +func (entity *MessageBotWriteAccessAllowed) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageBotWriteAccessAllowed + + return json.Marshal((*stub)(entity)) +} + +func (*MessageBotWriteAccessAllowed) GetClass() string { + return ClassMessageContent +} + +func (*MessageBotWriteAccessAllowed) GetType() string { + return TypeMessageBotWriteAccessAllowed +} + +func (*MessageBotWriteAccessAllowed) MessageContentType() string { + return TypeMessageBotWriteAccessAllowed +} + +func (messageBotWriteAccessAllowed *MessageBotWriteAccessAllowed) UnmarshalJSON(data []byte) error { + var tmp struct { + Reason json.RawMessage `json:"reason"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldReason, _ := UnmarshalBotWriteAccessAllowReason(tmp.Reason) + messageBotWriteAccessAllowed.Reason = fieldReason + + return nil +} + +// Data from a Web App has been sent to a bot +type MessageWebAppDataSent struct { + meta + // Text of the keyboardButtonTypeWebApp button, which opened the Web App + ButtonText string `json:"button_text"` +} + +func (entity *MessageWebAppDataSent) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageWebAppDataSent + + return json.Marshal((*stub)(entity)) +} + +func (*MessageWebAppDataSent) GetClass() string { + return ClassMessageContent +} + +func (*MessageWebAppDataSent) GetType() string { + return TypeMessageWebAppDataSent +} + +func (*MessageWebAppDataSent) MessageContentType() string { + return TypeMessageWebAppDataSent +} + +// Data from a Web App has been received; for bots only +type MessageWebAppDataReceived struct { + meta + // Text of the keyboardButtonTypeWebApp button, which opened the Web App + ButtonText string `json:"button_text"` + // The data + Data string `json:"data"` +} + +func (entity *MessageWebAppDataReceived) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageWebAppDataReceived + + return json.Marshal((*stub)(entity)) +} + +func (*MessageWebAppDataReceived) GetClass() string { + return ClassMessageContent +} + +func (*MessageWebAppDataReceived) GetType() string { + return TypeMessageWebAppDataReceived +} + +func (*MessageWebAppDataReceived) MessageContentType() string { + return TypeMessageWebAppDataReceived +} + +// Telegram Passport data has been sent to a bot +type MessagePassportDataSent struct { + meta + // List of Telegram Passport element types sent + Types []PassportElementType `json:"types"` +} + +func (entity *MessagePassportDataSent) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessagePassportDataSent + + return json.Marshal((*stub)(entity)) +} + +func (*MessagePassportDataSent) GetClass() string { + return ClassMessageContent +} + +func (*MessagePassportDataSent) GetType() string { + return TypeMessagePassportDataSent +} + +func (*MessagePassportDataSent) MessageContentType() string { + return TypeMessagePassportDataSent +} + +func (messagePassportDataSent *MessagePassportDataSent) UnmarshalJSON(data []byte) error { + var tmp struct { + Types []json.RawMessage `json:"types"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldTypes, _ := UnmarshalListOfPassportElementType(tmp.Types) + messagePassportDataSent.Types = fieldTypes + + return nil +} + +// Telegram Passport data has been received; for bots only +type MessagePassportDataReceived struct { + meta + // List of received Telegram Passport elements + Elements []*EncryptedPassportElement `json:"elements"` + // Encrypted data credentials + Credentials *EncryptedCredentials `json:"credentials"` +} + +func (entity *MessagePassportDataReceived) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessagePassportDataReceived + + return json.Marshal((*stub)(entity)) +} + +func (*MessagePassportDataReceived) GetClass() string { + return ClassMessageContent +} + +func (*MessagePassportDataReceived) GetType() string { + return TypeMessagePassportDataReceived +} + +func (*MessagePassportDataReceived) MessageContentType() string { + return TypeMessagePassportDataReceived +} + +// A user in the chat came within proximity alert range +type MessageProximityAlertTriggered struct { + 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"` +} + +func (entity *MessageProximityAlertTriggered) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageProximityAlertTriggered + + return json.Marshal((*stub)(entity)) +} + +func (*MessageProximityAlertTriggered) GetClass() string { + return ClassMessageContent +} + +func (*MessageProximityAlertTriggered) GetType() string { + return TypeMessageProximityAlertTriggered +} + +func (*MessageProximityAlertTriggered) MessageContentType() string { + return TypeMessageProximityAlertTriggered +} + +func (messageProximityAlertTriggered *MessageProximityAlertTriggered) UnmarshalJSON(data []byte) error { + var tmp struct { + TravelerId json.RawMessage `json:"traveler_id"` + WatcherId json.RawMessage `json:"watcher_id"` + Distance int32 `json:"distance"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + messageProximityAlertTriggered.Distance = tmp.Distance + + fieldTravelerId, _ := UnmarshalMessageSender(tmp.TravelerId) + messageProximityAlertTriggered.TravelerId = fieldTravelerId + + fieldWatcherId, _ := UnmarshalMessageSender(tmp.WatcherId) + messageProximityAlertTriggered.WatcherId = fieldWatcherId + + return nil +} + +// A message content that is not supported in the current TDLib version +type MessageUnsupported struct{ + meta +} + +func (entity *MessageUnsupported) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageUnsupported + + return json.Marshal((*stub)(entity)) +} + +func (*MessageUnsupported) GetClass() string { + return ClassMessageContent +} + +func (*MessageUnsupported) GetType() string { + return TypeMessageUnsupported +} + +func (*MessageUnsupported) MessageContentType() string { + return TypeMessageUnsupported +} + +// A mention of a user, a supergroup, or a channel by their username +type TextEntityTypeMention struct{ + meta +} + +func (entity *TextEntityTypeMention) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TextEntityTypeMention + + return json.Marshal((*stub)(entity)) +} + +func (*TextEntityTypeMention) GetClass() string { + return ClassTextEntityType +} + +func (*TextEntityTypeMention) GetType() string { + return TypeTextEntityTypeMention +} + +func (*TextEntityTypeMention) TextEntityTypeType() string { + return TypeTextEntityTypeMention +} + +// A hashtag text, beginning with "#" +type TextEntityTypeHashtag struct{ + meta +} + +func (entity *TextEntityTypeHashtag) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TextEntityTypeHashtag + + return json.Marshal((*stub)(entity)) +} + +func (*TextEntityTypeHashtag) GetClass() string { + return ClassTextEntityType +} + +func (*TextEntityTypeHashtag) GetType() string { + return TypeTextEntityTypeHashtag +} + +func (*TextEntityTypeHashtag) TextEntityTypeType() string { + return TypeTextEntityTypeHashtag +} + +// A cashtag text, beginning with "$" and consisting of capital English letters (e.g., "$USD") +type TextEntityTypeCashtag struct{ + meta +} + +func (entity *TextEntityTypeCashtag) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TextEntityTypeCashtag + + return json.Marshal((*stub)(entity)) +} + +func (*TextEntityTypeCashtag) GetClass() string { + return ClassTextEntityType +} + +func (*TextEntityTypeCashtag) GetType() string { + return TypeTextEntityTypeCashtag +} + +func (*TextEntityTypeCashtag) TextEntityTypeType() string { + return TypeTextEntityTypeCashtag +} + +// A bot command, beginning with "/" +type TextEntityTypeBotCommand struct{ + meta +} + +func (entity *TextEntityTypeBotCommand) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TextEntityTypeBotCommand + + return json.Marshal((*stub)(entity)) +} + +func (*TextEntityTypeBotCommand) GetClass() string { + return ClassTextEntityType +} + +func (*TextEntityTypeBotCommand) GetType() string { + return TypeTextEntityTypeBotCommand +} + +func (*TextEntityTypeBotCommand) TextEntityTypeType() string { + return TypeTextEntityTypeBotCommand +} + +// An HTTP URL +type TextEntityTypeUrl struct{ + meta +} + +func (entity *TextEntityTypeUrl) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TextEntityTypeUrl + + return json.Marshal((*stub)(entity)) +} + +func (*TextEntityTypeUrl) GetClass() string { + return ClassTextEntityType +} + +func (*TextEntityTypeUrl) GetType() string { + return TypeTextEntityTypeUrl +} + +func (*TextEntityTypeUrl) TextEntityTypeType() string { + return TypeTextEntityTypeUrl +} + +// An email address +type TextEntityTypeEmailAddress struct{ + meta +} + +func (entity *TextEntityTypeEmailAddress) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TextEntityTypeEmailAddress + + return json.Marshal((*stub)(entity)) +} + +func (*TextEntityTypeEmailAddress) GetClass() string { + return ClassTextEntityType +} + +func (*TextEntityTypeEmailAddress) GetType() string { + return TypeTextEntityTypeEmailAddress +} + +func (*TextEntityTypeEmailAddress) TextEntityTypeType() string { + return TypeTextEntityTypeEmailAddress +} + +// A phone number +type TextEntityTypePhoneNumber struct{ + meta +} + +func (entity *TextEntityTypePhoneNumber) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TextEntityTypePhoneNumber + + return json.Marshal((*stub)(entity)) +} + +func (*TextEntityTypePhoneNumber) GetClass() string { + return ClassTextEntityType +} + +func (*TextEntityTypePhoneNumber) GetType() string { + return TypeTextEntityTypePhoneNumber +} + +func (*TextEntityTypePhoneNumber) TextEntityTypeType() string { + return TypeTextEntityTypePhoneNumber +} + +// A bank card number. The getBankCardInfo method can be used to get information about the bank card +type TextEntityTypeBankCardNumber struct{ + meta +} + +func (entity *TextEntityTypeBankCardNumber) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TextEntityTypeBankCardNumber + + return json.Marshal((*stub)(entity)) +} + +func (*TextEntityTypeBankCardNumber) GetClass() string { + return ClassTextEntityType +} + +func (*TextEntityTypeBankCardNumber) GetType() string { + return TypeTextEntityTypeBankCardNumber +} + +func (*TextEntityTypeBankCardNumber) TextEntityTypeType() string { + return TypeTextEntityTypeBankCardNumber +} + +// A bold text +type TextEntityTypeBold struct{ + meta +} + +func (entity *TextEntityTypeBold) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TextEntityTypeBold + + return json.Marshal((*stub)(entity)) +} + +func (*TextEntityTypeBold) GetClass() string { + return ClassTextEntityType +} + +func (*TextEntityTypeBold) GetType() string { + return TypeTextEntityTypeBold +} + +func (*TextEntityTypeBold) TextEntityTypeType() string { + return TypeTextEntityTypeBold +} + +// An italic text +type TextEntityTypeItalic struct{ + meta +} + +func (entity *TextEntityTypeItalic) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TextEntityTypeItalic + + return json.Marshal((*stub)(entity)) +} + +func (*TextEntityTypeItalic) GetClass() string { + return ClassTextEntityType +} + +func (*TextEntityTypeItalic) GetType() string { + return TypeTextEntityTypeItalic +} + +func (*TextEntityTypeItalic) TextEntityTypeType() string { + return TypeTextEntityTypeItalic +} + +// An underlined text +type TextEntityTypeUnderline struct{ + meta +} + +func (entity *TextEntityTypeUnderline) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TextEntityTypeUnderline + + return json.Marshal((*stub)(entity)) +} + +func (*TextEntityTypeUnderline) GetClass() string { + return ClassTextEntityType +} + +func (*TextEntityTypeUnderline) GetType() string { + return TypeTextEntityTypeUnderline +} + +func (*TextEntityTypeUnderline) TextEntityTypeType() string { + return TypeTextEntityTypeUnderline +} + +// A strikethrough text +type TextEntityTypeStrikethrough struct{ + meta +} + +func (entity *TextEntityTypeStrikethrough) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TextEntityTypeStrikethrough + + return json.Marshal((*stub)(entity)) +} + +func (*TextEntityTypeStrikethrough) GetClass() string { + return ClassTextEntityType +} + +func (*TextEntityTypeStrikethrough) GetType() string { + return TypeTextEntityTypeStrikethrough +} + +func (*TextEntityTypeStrikethrough) TextEntityTypeType() string { + return TypeTextEntityTypeStrikethrough +} + +// A spoiler text +type TextEntityTypeSpoiler struct{ + meta +} + +func (entity *TextEntityTypeSpoiler) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TextEntityTypeSpoiler + + return json.Marshal((*stub)(entity)) +} + +func (*TextEntityTypeSpoiler) GetClass() string { + return ClassTextEntityType +} + +func (*TextEntityTypeSpoiler) GetType() string { + return TypeTextEntityTypeSpoiler +} + +func (*TextEntityTypeSpoiler) TextEntityTypeType() string { + return TypeTextEntityTypeSpoiler +} + +// Text that must be formatted as if inside a code HTML tag +type TextEntityTypeCode struct{ + meta +} + +func (entity *TextEntityTypeCode) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TextEntityTypeCode + + return json.Marshal((*stub)(entity)) +} + +func (*TextEntityTypeCode) GetClass() string { + return ClassTextEntityType +} + +func (*TextEntityTypeCode) GetType() string { + return TypeTextEntityTypeCode +} + +func (*TextEntityTypeCode) TextEntityTypeType() string { + return TypeTextEntityTypeCode +} + +// Text that must be formatted as if inside a pre HTML tag +type TextEntityTypePre struct{ + meta +} + +func (entity *TextEntityTypePre) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TextEntityTypePre + + return json.Marshal((*stub)(entity)) +} + +func (*TextEntityTypePre) GetClass() string { + return ClassTextEntityType +} + +func (*TextEntityTypePre) GetType() string { + return TypeTextEntityTypePre +} + +func (*TextEntityTypePre) TextEntityTypeType() string { + return TypeTextEntityTypePre +} + +// Text that must be formatted as if inside pre, and code HTML tags +type TextEntityTypePreCode struct { + meta + // Programming language of the code; as defined by the sender + Language string `json:"language"` +} + +func (entity *TextEntityTypePreCode) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TextEntityTypePreCode + + return json.Marshal((*stub)(entity)) +} + +func (*TextEntityTypePreCode) GetClass() string { + return ClassTextEntityType +} + +func (*TextEntityTypePreCode) GetType() string { + return TypeTextEntityTypePreCode +} + +func (*TextEntityTypePreCode) TextEntityTypeType() string { + return TypeTextEntityTypePreCode +} + +// Text that must be formatted as if inside a blockquote HTML tag +type TextEntityTypeBlockQuote struct{ + meta +} + +func (entity *TextEntityTypeBlockQuote) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TextEntityTypeBlockQuote + + return json.Marshal((*stub)(entity)) +} + +func (*TextEntityTypeBlockQuote) GetClass() string { + return ClassTextEntityType +} + +func (*TextEntityTypeBlockQuote) GetType() string { + return TypeTextEntityTypeBlockQuote +} + +func (*TextEntityTypeBlockQuote) TextEntityTypeType() string { + return TypeTextEntityTypeBlockQuote +} + +// A text description shown instead of a raw URL +type TextEntityTypeTextUrl struct { + meta + // HTTP or tg:// URL to be opened when the link is clicked + Url string `json:"url"` +} + +func (entity *TextEntityTypeTextUrl) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TextEntityTypeTextUrl + + return json.Marshal((*stub)(entity)) +} + +func (*TextEntityTypeTextUrl) GetClass() string { + return ClassTextEntityType +} + +func (*TextEntityTypeTextUrl) GetType() string { + return TypeTextEntityTypeTextUrl +} + +func (*TextEntityTypeTextUrl) TextEntityTypeType() string { + return TypeTextEntityTypeTextUrl +} + +// A text shows instead of a raw mention of the user (e.g., when the user has no username) +type TextEntityTypeMentionName struct { + meta + // Identifier of the mentioned user + UserId int64 `json:"user_id"` +} + +func (entity *TextEntityTypeMentionName) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TextEntityTypeMentionName + + return json.Marshal((*stub)(entity)) +} + +func (*TextEntityTypeMentionName) GetClass() string { + return ClassTextEntityType +} + +func (*TextEntityTypeMentionName) GetType() string { + return TypeTextEntityTypeMentionName +} + +func (*TextEntityTypeMentionName) TextEntityTypeType() string { + return TypeTextEntityTypeMentionName +} + +// A custom emoji. The text behind a custom emoji must be an emoji. Only premium users can use premium custom emoji +type TextEntityTypeCustomEmoji struct { + meta + // Unique identifier of the custom emoji + CustomEmojiId JsonInt64 `json:"custom_emoji_id"` +} + +func (entity *TextEntityTypeCustomEmoji) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TextEntityTypeCustomEmoji + + return json.Marshal((*stub)(entity)) +} + +func (*TextEntityTypeCustomEmoji) GetClass() string { + return ClassTextEntityType +} + +func (*TextEntityTypeCustomEmoji) GetType() string { + return TypeTextEntityTypeCustomEmoji +} + +func (*TextEntityTypeCustomEmoji) TextEntityTypeType() string { + return TypeTextEntityTypeCustomEmoji +} + +// A media timestamp +type TextEntityTypeMediaTimestamp struct { + meta + // Timestamp from which a video/audio/video note/voice note/story 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"` +} + +func (entity *TextEntityTypeMediaTimestamp) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TextEntityTypeMediaTimestamp + + return json.Marshal((*stub)(entity)) +} + +func (*TextEntityTypeMediaTimestamp) GetClass() string { + return ClassTextEntityType +} + +func (*TextEntityTypeMediaTimestamp) GetType() string { + return TypeTextEntityTypeMediaTimestamp +} + +func (*TextEntityTypeMediaTimestamp) TextEntityTypeType() string { + return TypeTextEntityTypeMediaTimestamp +} + +// 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 { + 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"` +} + +func (entity *InputThumbnail) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputThumbnail + + return json.Marshal((*stub)(entity)) +} + +func (*InputThumbnail) GetClass() string { + return ClassInputThumbnail +} + +func (*InputThumbnail) GetType() string { + return TypeInputThumbnail +} + +func (inputThumbnail *InputThumbnail) UnmarshalJSON(data []byte) error { + var tmp struct { + Thumbnail json.RawMessage `json:"thumbnail"` + Width int32 `json:"width"` + Height int32 `json:"height"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + inputThumbnail.Width = tmp.Width + inputThumbnail.Height = tmp.Height + + fieldThumbnail, _ := UnmarshalInputFile(tmp.Thumbnail) + inputThumbnail.Thumbnail = fieldThumbnail + + return nil +} + +// The message will be sent at the specified date +type MessageSchedulingStateSendAtDate struct { + meta + // Point in time (Unix timestamp) when the message will be sent. The date must be within 367 days in the future + SendDate int32 `json:"send_date"` +} + +func (entity *MessageSchedulingStateSendAtDate) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageSchedulingStateSendAtDate + + return json.Marshal((*stub)(entity)) +} + +func (*MessageSchedulingStateSendAtDate) GetClass() string { + return ClassMessageSchedulingState +} + +func (*MessageSchedulingStateSendAtDate) GetType() string { + return TypeMessageSchedulingStateSendAtDate +} + +func (*MessageSchedulingStateSendAtDate) MessageSchedulingStateType() string { + return TypeMessageSchedulingStateSendAtDate +} + +// The message will be sent when the other user is online. Applicable to private chats only and when the exact online status of the other user is known +type MessageSchedulingStateSendWhenOnline struct{ + meta +} + +func (entity *MessageSchedulingStateSendWhenOnline) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageSchedulingStateSendWhenOnline + + return json.Marshal((*stub)(entity)) +} + +func (*MessageSchedulingStateSendWhenOnline) GetClass() string { + return ClassMessageSchedulingState +} + +func (*MessageSchedulingStateSendWhenOnline) GetType() string { + return TypeMessageSchedulingStateSendWhenOnline +} + +func (*MessageSchedulingStateSendWhenOnline) MessageSchedulingStateType() string { + return TypeMessageSchedulingStateSendWhenOnline +} + +// The message will be self-destructed in the specified time after its content was opened +type MessageSelfDestructTypeTimer struct { + meta + // The message's self-destruct time, in seconds; must be between 0 and 60 in private chats + SelfDestructTime int32 `json:"self_destruct_time"` +} + +func (entity *MessageSelfDestructTypeTimer) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageSelfDestructTypeTimer + + return json.Marshal((*stub)(entity)) +} + +func (*MessageSelfDestructTypeTimer) GetClass() string { + return ClassMessageSelfDestructType +} + +func (*MessageSelfDestructTypeTimer) GetType() string { + return TypeMessageSelfDestructTypeTimer +} + +func (*MessageSelfDestructTypeTimer) MessageSelfDestructTypeType() string { + return TypeMessageSelfDestructTypeTimer +} + +// The message can be opened only once and will be self-destructed once closed +type MessageSelfDestructTypeImmediately struct{ + meta +} + +func (entity *MessageSelfDestructTypeImmediately) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageSelfDestructTypeImmediately + + return json.Marshal((*stub)(entity)) +} + +func (*MessageSelfDestructTypeImmediately) GetClass() string { + return ClassMessageSelfDestructType +} + +func (*MessageSelfDestructTypeImmediately) GetType() string { + return TypeMessageSelfDestructTypeImmediately +} + +func (*MessageSelfDestructTypeImmediately) MessageSelfDestructTypeType() string { + return TypeMessageSelfDestructTypeImmediately +} + +// Options to be used when a message is sent +type MessageSendOptions struct { + 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"` + // Pass true if the user explicitly chosen a sticker or a custom emoji from an installed sticker set; applicable only to sendMessage and sendMessageAlbum + UpdateOrderOfInstalledStickerSets bool `json:"update_order_of_installed_sticker_sets"` + // 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"` + // Non-persistent identifier, which will be returned back in messageSendingStatePending object and can be used to match sent messages and corresponding updateNewMessage updates + SendingId int32 `json:"sending_id"` + // Pass true to get a fake message instead of actually sending them + OnlyPreview bool `json:"only_preview"` +} + +func (entity *MessageSendOptions) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageSendOptions + + return json.Marshal((*stub)(entity)) +} + +func (*MessageSendOptions) GetClass() string { + return ClassMessageSendOptions +} + +func (*MessageSendOptions) GetType() string { + return TypeMessageSendOptions +} + +func (messageSendOptions *MessageSendOptions) UnmarshalJSON(data []byte) error { + var tmp struct { + DisableNotification bool `json:"disable_notification"` + FromBackground bool `json:"from_background"` + ProtectContent bool `json:"protect_content"` + UpdateOrderOfInstalledStickerSets bool `json:"update_order_of_installed_sticker_sets"` + SchedulingState json.RawMessage `json:"scheduling_state"` + SendingId int32 `json:"sending_id"` + OnlyPreview bool `json:"only_preview"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + messageSendOptions.DisableNotification = tmp.DisableNotification + messageSendOptions.FromBackground = tmp.FromBackground + messageSendOptions.ProtectContent = tmp.ProtectContent + messageSendOptions.UpdateOrderOfInstalledStickerSets = tmp.UpdateOrderOfInstalledStickerSets + messageSendOptions.SendingId = tmp.SendingId + messageSendOptions.OnlyPreview = tmp.OnlyPreview + + fieldSchedulingState, _ := UnmarshalMessageSchedulingState(tmp.SchedulingState) + messageSendOptions.SchedulingState = fieldSchedulingState + + return nil +} + +// Options to be used when a message content is copied without reference to the original sender. Service messages, messages with messageInvoice, messagePremiumGiveaway, or messagePremiumGiveawayWinners content can't be copied +type MessageCopyOptions struct { + 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"` +} + +func (entity *MessageCopyOptions) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageCopyOptions + + return json.Marshal((*stub)(entity)) +} + +func (*MessageCopyOptions) GetClass() string { + return ClassMessageCopyOptions +} + +func (*MessageCopyOptions) GetType() string { + return TypeMessageCopyOptions +} + +// A text message +type InputMessageText struct { + meta + // Formatted text to be sent; 0-getOption("message_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, BlockQuote, Code, Pre, PreCode, TextUrl and MentionName entities are allowed to be specified manually + Text *FormattedText `json:"text"` + // Options to be used for generation of a link preview; may be null if none; pass null to use default link preview options + LinkPreviewOptions *LinkPreviewOptions `json:"link_preview_options"` + // True, if a chat message draft must be deleted + ClearDraft bool `json:"clear_draft"` +} + +func (entity *InputMessageText) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputMessageText + + return json.Marshal((*stub)(entity)) +} + +func (*InputMessageText) GetClass() string { + return ClassInputMessageContent +} + +func (*InputMessageText) GetType() string { + return TypeInputMessageText +} + +func (*InputMessageText) InputMessageContentType() string { + return TypeInputMessageText +} + +// An animation message (GIF-style). +type InputMessageAnimation struct { + 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"` + // True, if the animation preview must be covered by a spoiler animation; not supported in secret chats + HasSpoiler bool `json:"has_spoiler"` +} + +func (entity *InputMessageAnimation) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputMessageAnimation + + return json.Marshal((*stub)(entity)) +} + +func (*InputMessageAnimation) GetClass() string { + return ClassInputMessageContent +} + +func (*InputMessageAnimation) GetType() string { + return TypeInputMessageAnimation +} + +func (*InputMessageAnimation) InputMessageContentType() string { + return TypeInputMessageAnimation +} + +func (inputMessageAnimation *InputMessageAnimation) UnmarshalJSON(data []byte) error { + 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"` + HasSpoiler bool `json:"has_spoiler"` + } + + 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 + inputMessageAnimation.HasSpoiler = tmp.HasSpoiler + + fieldAnimation, _ := UnmarshalInputFile(tmp.Animation) + inputMessageAnimation.Animation = fieldAnimation + + return nil +} + +// An audio message +type InputMessageAudio struct { + 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"` +} + +func (entity *InputMessageAudio) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputMessageAudio + + return json.Marshal((*stub)(entity)) +} + +func (*InputMessageAudio) GetClass() string { + return ClassInputMessageContent +} + +func (*InputMessageAudio) GetType() string { + return TypeInputMessageAudio +} + +func (*InputMessageAudio) InputMessageContentType() string { + return TypeInputMessageAudio +} + +func (inputMessageAudio *InputMessageAudio) UnmarshalJSON(data []byte) error { + 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"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + inputMessageAudio.AlbumCoverThumbnail = tmp.AlbumCoverThumbnail + inputMessageAudio.Duration = tmp.Duration + inputMessageAudio.Title = tmp.Title + inputMessageAudio.Performer = tmp.Performer + inputMessageAudio.Caption = tmp.Caption + + fieldAudio, _ := UnmarshalInputFile(tmp.Audio) + inputMessageAudio.Audio = fieldAudio + + return nil +} + +// A document message (general file) +type InputMessageDocument struct { + meta + // Document to be sent + Document InputFile `json:"document"` + // Document thumbnail; pass null to skip thumbnail uploading + Thumbnail *InputThumbnail `json:"thumbnail"` + // Pass true to disable automatic file type detection and send the document as a 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"` +} + +func (entity *InputMessageDocument) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputMessageDocument + + return json.Marshal((*stub)(entity)) +} + +func (*InputMessageDocument) GetClass() string { + return ClassInputMessageContent +} + +func (*InputMessageDocument) GetType() string { + return TypeInputMessageDocument +} + +func (*InputMessageDocument) InputMessageContentType() string { + return TypeInputMessageDocument +} + +func (inputMessageDocument *InputMessageDocument) UnmarshalJSON(data []byte) error { + var tmp struct { + Document json.RawMessage `json:"document"` + Thumbnail *InputThumbnail `json:"thumbnail"` + DisableContentTypeDetection bool `json:"disable_content_type_detection"` + Caption *FormattedText `json:"caption"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + inputMessageDocument.Thumbnail = tmp.Thumbnail + inputMessageDocument.DisableContentTypeDetection = tmp.DisableContentTypeDetection + inputMessageDocument.Caption = tmp.Caption + + fieldDocument, _ := UnmarshalInputFile(tmp.Document) + inputMessageDocument.Document = fieldDocument + + return nil +} + +// A photo message +type InputMessagePhoto struct { + meta + // Photo to send. The photo must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total. Width and height ratio must be at most 20 + 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 self-destruct type; pass null if none; private chats only + SelfDestructType MessageSelfDestructType `json:"self_destruct_type"` + // True, if the photo preview must be covered by a spoiler animation; not supported in secret chats + HasSpoiler bool `json:"has_spoiler"` +} + +func (entity *InputMessagePhoto) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputMessagePhoto + + return json.Marshal((*stub)(entity)) +} + +func (*InputMessagePhoto) GetClass() string { + return ClassInputMessageContent +} + +func (*InputMessagePhoto) GetType() string { + return TypeInputMessagePhoto +} + +func (*InputMessagePhoto) InputMessageContentType() string { + return TypeInputMessagePhoto +} + +func (inputMessagePhoto *InputMessagePhoto) UnmarshalJSON(data []byte) error { + 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"` + SelfDestructType json.RawMessage `json:"self_destruct_type"` + HasSpoiler bool `json:"has_spoiler"` + } + + 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.HasSpoiler = tmp.HasSpoiler + + fieldPhoto, _ := UnmarshalInputFile(tmp.Photo) + inputMessagePhoto.Photo = fieldPhoto + + fieldSelfDestructType, _ := UnmarshalMessageSelfDestructType(tmp.SelfDestructType) + inputMessagePhoto.SelfDestructType = fieldSelfDestructType + + return nil +} + +// A sticker message +type InputMessageSticker struct { + 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"` +} + +func (entity *InputMessageSticker) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputMessageSticker + + return json.Marshal((*stub)(entity)) +} + +func (*InputMessageSticker) GetClass() string { + return ClassInputMessageContent +} + +func (*InputMessageSticker) GetType() string { + return TypeInputMessageSticker +} + +func (*InputMessageSticker) InputMessageContentType() string { + return TypeInputMessageSticker +} + +func (inputMessageSticker *InputMessageSticker) UnmarshalJSON(data []byte) error { + var tmp struct { + Sticker json.RawMessage `json:"sticker"` + Thumbnail *InputThumbnail `json:"thumbnail"` + Width int32 `json:"width"` + Height int32 `json:"height"` + Emoji string `json:"emoji"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + inputMessageSticker.Thumbnail = tmp.Thumbnail + inputMessageSticker.Width = tmp.Width + inputMessageSticker.Height = tmp.Height + inputMessageSticker.Emoji = tmp.Emoji + + fieldSticker, _ := UnmarshalInputFile(tmp.Sticker) + inputMessageSticker.Sticker = fieldSticker + + return nil +} + +// A video message +type InputMessageVideo struct { + 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 self-destruct type; pass null if none; private chats only + SelfDestructType MessageSelfDestructType `json:"self_destruct_type"` + // True, if the video preview must be covered by a spoiler animation; not supported in secret chats + HasSpoiler bool `json:"has_spoiler"` +} + +func (entity *InputMessageVideo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputMessageVideo + + return json.Marshal((*stub)(entity)) +} + +func (*InputMessageVideo) GetClass() string { + return ClassInputMessageContent +} + +func (*InputMessageVideo) GetType() string { + return TypeInputMessageVideo +} + +func (*InputMessageVideo) InputMessageContentType() string { + return TypeInputMessageVideo +} + +func (inputMessageVideo *InputMessageVideo) UnmarshalJSON(data []byte) error { + 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"` + SelfDestructType json.RawMessage `json:"self_destruct_type"` + HasSpoiler bool `json:"has_spoiler"` + } + + 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.HasSpoiler = tmp.HasSpoiler + + fieldVideo, _ := UnmarshalInputFile(tmp.Video) + inputMessageVideo.Video = fieldVideo + + fieldSelfDestructType, _ := UnmarshalMessageSelfDestructType(tmp.SelfDestructType) + inputMessageVideo.SelfDestructType = fieldSelfDestructType + + return nil +} + +// A video note message +type InputMessageVideoNote struct { + meta + // Video note to be sent + VideoNote InputFile `json:"video_note"` + // Video thumbnail; may be null if empty; pass null to skip thumbnail uploading + Thumbnail *InputThumbnail `json:"thumbnail"` + // Duration of the video, in seconds; 0-60 + Duration int32 `json:"duration"` + // Video width and height; must be positive and not greater than 640 + Length int32 `json:"length"` + // Video note self-destruct type; may be null if none; pass null if none; private chats only + SelfDestructType MessageSelfDestructType `json:"self_destruct_type"` +} + +func (entity *InputMessageVideoNote) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputMessageVideoNote + + return json.Marshal((*stub)(entity)) +} + +func (*InputMessageVideoNote) GetClass() string { + return ClassInputMessageContent +} + +func (*InputMessageVideoNote) GetType() string { + return TypeInputMessageVideoNote +} + +func (*InputMessageVideoNote) InputMessageContentType() string { + return TypeInputMessageVideoNote +} + +func (inputMessageVideoNote *InputMessageVideoNote) UnmarshalJSON(data []byte) error { + var tmp struct { + VideoNote json.RawMessage `json:"video_note"` + Thumbnail *InputThumbnail `json:"thumbnail"` + Duration int32 `json:"duration"` + Length int32 `json:"length"` + SelfDestructType json.RawMessage `json:"self_destruct_type"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + inputMessageVideoNote.Thumbnail = tmp.Thumbnail + inputMessageVideoNote.Duration = tmp.Duration + inputMessageVideoNote.Length = tmp.Length + + fieldVideoNote, _ := UnmarshalInputFile(tmp.VideoNote) + inputMessageVideoNote.VideoNote = fieldVideoNote + + fieldSelfDestructType, _ := UnmarshalMessageSelfDestructType(tmp.SelfDestructType) + inputMessageVideoNote.SelfDestructType = fieldSelfDestructType + + return nil +} + +// A voice note message +type InputMessageVoiceNote struct { + 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; may be null if empty; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters + Caption *FormattedText `json:"caption"` + // Voice note self-destruct type; may be null if none; pass null if none; private chats only + SelfDestructType MessageSelfDestructType `json:"self_destruct_type"` +} + +func (entity *InputMessageVoiceNote) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputMessageVoiceNote + + return json.Marshal((*stub)(entity)) +} + +func (*InputMessageVoiceNote) GetClass() string { + return ClassInputMessageContent +} + +func (*InputMessageVoiceNote) GetType() string { + return TypeInputMessageVoiceNote +} + +func (*InputMessageVoiceNote) InputMessageContentType() string { + return TypeInputMessageVoiceNote +} + +func (inputMessageVoiceNote *InputMessageVoiceNote) UnmarshalJSON(data []byte) error { + var tmp struct { + VoiceNote json.RawMessage `json:"voice_note"` + Duration int32 `json:"duration"` + Waveform []byte `json:"waveform"` + Caption *FormattedText `json:"caption"` + SelfDestructType json.RawMessage `json:"self_destruct_type"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + inputMessageVoiceNote.Duration = tmp.Duration + inputMessageVoiceNote.Waveform = tmp.Waveform + inputMessageVoiceNote.Caption = tmp.Caption + + fieldVoiceNote, _ := UnmarshalInputFile(tmp.VoiceNote) + inputMessageVoiceNote.VoiceNote = fieldVoiceNote + + fieldSelfDestructType, _ := UnmarshalMessageSelfDestructType(tmp.SelfDestructType) + inputMessageVoiceNote.SelfDestructType = fieldSelfDestructType + + return nil +} + +// A message with a location +type InputMessageLocation struct { + 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"` +} + +func (entity *InputMessageLocation) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputMessageLocation + + return json.Marshal((*stub)(entity)) +} + +func (*InputMessageLocation) GetClass() string { + return ClassInputMessageContent +} + +func (*InputMessageLocation) GetType() string { + return TypeInputMessageLocation +} + +func (*InputMessageLocation) InputMessageContentType() string { + return TypeInputMessageLocation +} + +// A message with information about a venue +type InputMessageVenue struct { + meta + // Venue to send + Venue *Venue `json:"venue"` +} + +func (entity *InputMessageVenue) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputMessageVenue + + return json.Marshal((*stub)(entity)) +} + +func (*InputMessageVenue) GetClass() string { + return ClassInputMessageContent +} + +func (*InputMessageVenue) GetType() string { + return TypeInputMessageVenue +} + +func (*InputMessageVenue) InputMessageContentType() string { + return TypeInputMessageVenue +} + +// A message containing a user contact +type InputMessageContact struct { + meta + // Contact to send + Contact *Contact `json:"contact"` +} + +func (entity *InputMessageContact) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputMessageContact + + return json.Marshal((*stub)(entity)) +} + +func (*InputMessageContact) GetClass() string { + return ClassInputMessageContent +} + +func (*InputMessageContact) GetType() string { + return TypeInputMessageContact +} + +func (*InputMessageContact) InputMessageContentType() string { + return TypeInputMessageContact +} + +// A dice message +type InputMessageDice struct { + 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"` +} + +func (entity *InputMessageDice) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputMessageDice + + return json.Marshal((*stub)(entity)) +} + +func (*InputMessageDice) GetClass() string { + return ClassInputMessageContent +} + +func (*InputMessageDice) GetType() string { + return TypeInputMessageDice +} + +func (*InputMessageDice) InputMessageContentType() string { + return TypeInputMessageDice +} + +// A message with a game; not supported for channels or secret chats +type InputMessageGame struct { + 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"` +} + +func (entity *InputMessageGame) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputMessageGame + + return json.Marshal((*stub)(entity)) +} + +func (*InputMessageGame) GetClass() string { + return ClassInputMessageContent +} + +func (*InputMessageGame) GetType() string { + return TypeInputMessageGame +} + +func (*InputMessageGame) InputMessageContentType() string { + return TypeInputMessageGame +} + +// A message with an invoice; can be used only by bots +type InputMessageInvoice struct { + 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"` + // The content of extended media attached to the invoice. The content of the message to be sent. Must be one of the following types: inputMessagePhoto, inputMessageVideo + ExtendedMediaContent InputMessageContent `json:"extended_media_content"` +} + +func (entity *InputMessageInvoice) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputMessageInvoice + + return json.Marshal((*stub)(entity)) +} + +func (*InputMessageInvoice) GetClass() string { + return ClassInputMessageContent +} + +func (*InputMessageInvoice) GetType() string { + return TypeInputMessageInvoice +} + +func (*InputMessageInvoice) InputMessageContentType() string { + return TypeInputMessageInvoice +} + +func (inputMessageInvoice *InputMessageInvoice) UnmarshalJSON(data []byte) error { + var tmp struct { + Invoice *Invoice `json:"invoice"` + Title string `json:"title"` + Description string `json:"description"` + PhotoUrl string `json:"photo_url"` + PhotoSize int32 `json:"photo_size"` + PhotoWidth int32 `json:"photo_width"` + PhotoHeight int32 `json:"photo_height"` + Payload []byte `json:"payload"` + ProviderToken string `json:"provider_token"` + ProviderData string `json:"provider_data"` + StartParameter string `json:"start_parameter"` + ExtendedMediaContent json.RawMessage `json:"extended_media_content"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + inputMessageInvoice.Invoice = tmp.Invoice + inputMessageInvoice.Title = tmp.Title + inputMessageInvoice.Description = tmp.Description + inputMessageInvoice.PhotoUrl = tmp.PhotoUrl + inputMessageInvoice.PhotoSize = tmp.PhotoSize + inputMessageInvoice.PhotoWidth = tmp.PhotoWidth + inputMessageInvoice.PhotoHeight = tmp.PhotoHeight + inputMessageInvoice.Payload = tmp.Payload + inputMessageInvoice.ProviderToken = tmp.ProviderToken + inputMessageInvoice.ProviderData = tmp.ProviderData + inputMessageInvoice.StartParameter = tmp.StartParameter + + fieldExtendedMediaContent, _ := UnmarshalInputMessageContent(tmp.ExtendedMediaContent) + inputMessageInvoice.ExtendedMediaContent = fieldExtendedMediaContent + + return nil +} + +// 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 { + 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"` +} + +func (entity *InputMessagePoll) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputMessagePoll + + return json.Marshal((*stub)(entity)) +} + +func (*InputMessagePoll) GetClass() string { + return ClassInputMessageContent +} + +func (*InputMessagePoll) GetType() string { + return TypeInputMessagePoll +} + +func (*InputMessagePoll) InputMessageContentType() string { + return TypeInputMessagePoll +} + +func (inputMessagePoll *InputMessagePoll) UnmarshalJSON(data []byte) error { + 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 +} + +// A message with a forwarded story. Stories can't be sent to secret chats. A story can be forwarded only if story.can_be_forwarded +type InputMessageStory struct { + meta + // Identifier of the chat that posted the story + StorySenderChatId int64 `json:"story_sender_chat_id"` + // Story identifier + StoryId int32 `json:"story_id"` +} + +func (entity *InputMessageStory) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputMessageStory + + return json.Marshal((*stub)(entity)) +} + +func (*InputMessageStory) GetClass() string { + return ClassInputMessageContent +} + +func (*InputMessageStory) GetType() string { + return TypeInputMessageStory +} + +func (*InputMessageStory) InputMessageContentType() string { + return TypeInputMessageStory +} + +// A forwarded message +type InputMessageForwarded struct { + meta + // Identifier for the chat this forwarded message came from + FromChatId int64 `json:"from_chat_id"` + // Identifier of the message to forward. A message can be forwarded only if message.can_be_forwarded + 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"` +} + +func (entity *InputMessageForwarded) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputMessageForwarded + + return json.Marshal((*stub)(entity)) +} + +func (*InputMessageForwarded) GetClass() string { + return ClassInputMessageContent +} + +func (*InputMessageForwarded) GetType() string { + return TypeInputMessageForwarded +} + +func (*InputMessageForwarded) InputMessageContentType() string { + return TypeInputMessageForwarded +} + +// Returns all found messages, no filter is applied +type SearchMessagesFilterEmpty struct{ + meta +} + +func (entity *SearchMessagesFilterEmpty) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SearchMessagesFilterEmpty + + return json.Marshal((*stub)(entity)) +} + +func (*SearchMessagesFilterEmpty) GetClass() string { + return ClassSearchMessagesFilter +} + +func (*SearchMessagesFilterEmpty) GetType() string { + return TypeSearchMessagesFilterEmpty +} + +func (*SearchMessagesFilterEmpty) SearchMessagesFilterType() string { + return TypeSearchMessagesFilterEmpty +} + +// Returns only animation messages +type SearchMessagesFilterAnimation struct{ + meta +} + +func (entity *SearchMessagesFilterAnimation) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SearchMessagesFilterAnimation + + return json.Marshal((*stub)(entity)) +} + +func (*SearchMessagesFilterAnimation) GetClass() string { + return ClassSearchMessagesFilter +} + +func (*SearchMessagesFilterAnimation) GetType() string { + return TypeSearchMessagesFilterAnimation +} + +func (*SearchMessagesFilterAnimation) SearchMessagesFilterType() string { + return TypeSearchMessagesFilterAnimation +} + +// Returns only audio messages +type SearchMessagesFilterAudio struct{ + meta +} + +func (entity *SearchMessagesFilterAudio) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SearchMessagesFilterAudio + + return json.Marshal((*stub)(entity)) +} + +func (*SearchMessagesFilterAudio) GetClass() string { + return ClassSearchMessagesFilter +} + +func (*SearchMessagesFilterAudio) GetType() string { + return TypeSearchMessagesFilterAudio +} + +func (*SearchMessagesFilterAudio) SearchMessagesFilterType() string { + return TypeSearchMessagesFilterAudio +} + +// Returns only document messages +type SearchMessagesFilterDocument struct{ + meta +} + +func (entity *SearchMessagesFilterDocument) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SearchMessagesFilterDocument + + return json.Marshal((*stub)(entity)) +} + +func (*SearchMessagesFilterDocument) GetClass() string { + return ClassSearchMessagesFilter +} + +func (*SearchMessagesFilterDocument) GetType() string { + return TypeSearchMessagesFilterDocument +} + +func (*SearchMessagesFilterDocument) SearchMessagesFilterType() string { + return TypeSearchMessagesFilterDocument +} + +// Returns only photo messages +type SearchMessagesFilterPhoto struct{ + meta +} + +func (entity *SearchMessagesFilterPhoto) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SearchMessagesFilterPhoto + + return json.Marshal((*stub)(entity)) +} + +func (*SearchMessagesFilterPhoto) GetClass() string { + return ClassSearchMessagesFilter +} + +func (*SearchMessagesFilterPhoto) GetType() string { + return TypeSearchMessagesFilterPhoto +} + +func (*SearchMessagesFilterPhoto) SearchMessagesFilterType() string { + return TypeSearchMessagesFilterPhoto +} + +// Returns only video messages +type SearchMessagesFilterVideo struct{ + meta +} + +func (entity *SearchMessagesFilterVideo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SearchMessagesFilterVideo + + return json.Marshal((*stub)(entity)) +} + +func (*SearchMessagesFilterVideo) GetClass() string { + return ClassSearchMessagesFilter +} + +func (*SearchMessagesFilterVideo) GetType() string { + return TypeSearchMessagesFilterVideo +} + +func (*SearchMessagesFilterVideo) SearchMessagesFilterType() string { + return TypeSearchMessagesFilterVideo +} + +// Returns only voice note messages +type SearchMessagesFilterVoiceNote struct{ + meta +} + +func (entity *SearchMessagesFilterVoiceNote) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SearchMessagesFilterVoiceNote + + return json.Marshal((*stub)(entity)) +} + +func (*SearchMessagesFilterVoiceNote) GetClass() string { + return ClassSearchMessagesFilter +} + +func (*SearchMessagesFilterVoiceNote) GetType() string { + return TypeSearchMessagesFilterVoiceNote +} + +func (*SearchMessagesFilterVoiceNote) SearchMessagesFilterType() string { + return TypeSearchMessagesFilterVoiceNote +} + +// Returns only photo and video messages +type SearchMessagesFilterPhotoAndVideo struct{ + meta +} + +func (entity *SearchMessagesFilterPhotoAndVideo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SearchMessagesFilterPhotoAndVideo + + return json.Marshal((*stub)(entity)) +} + +func (*SearchMessagesFilterPhotoAndVideo) GetClass() string { + return ClassSearchMessagesFilter +} + +func (*SearchMessagesFilterPhotoAndVideo) GetType() string { + return TypeSearchMessagesFilterPhotoAndVideo +} + +func (*SearchMessagesFilterPhotoAndVideo) SearchMessagesFilterType() string { + return TypeSearchMessagesFilterPhotoAndVideo +} + +// Returns only messages containing URLs +type SearchMessagesFilterUrl struct{ + meta +} + +func (entity *SearchMessagesFilterUrl) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SearchMessagesFilterUrl + + return json.Marshal((*stub)(entity)) +} + +func (*SearchMessagesFilterUrl) GetClass() string { + return ClassSearchMessagesFilter +} + +func (*SearchMessagesFilterUrl) GetType() string { + return TypeSearchMessagesFilterUrl +} + +func (*SearchMessagesFilterUrl) SearchMessagesFilterType() string { + return TypeSearchMessagesFilterUrl +} + +// Returns only messages containing chat photos +type SearchMessagesFilterChatPhoto struct{ + meta +} + +func (entity *SearchMessagesFilterChatPhoto) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SearchMessagesFilterChatPhoto + + return json.Marshal((*stub)(entity)) +} + +func (*SearchMessagesFilterChatPhoto) GetClass() string { + return ClassSearchMessagesFilter +} + +func (*SearchMessagesFilterChatPhoto) GetType() string { + return TypeSearchMessagesFilterChatPhoto +} + +func (*SearchMessagesFilterChatPhoto) SearchMessagesFilterType() string { + return TypeSearchMessagesFilterChatPhoto +} + +// Returns only video note messages +type SearchMessagesFilterVideoNote struct{ + meta +} + +func (entity *SearchMessagesFilterVideoNote) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SearchMessagesFilterVideoNote + + return json.Marshal((*stub)(entity)) +} + +func (*SearchMessagesFilterVideoNote) GetClass() string { + return ClassSearchMessagesFilter +} + +func (*SearchMessagesFilterVideoNote) GetType() string { + return TypeSearchMessagesFilterVideoNote +} + +func (*SearchMessagesFilterVideoNote) SearchMessagesFilterType() string { + return TypeSearchMessagesFilterVideoNote +} + +// Returns only voice and video note messages +type SearchMessagesFilterVoiceAndVideoNote struct{ + meta +} + +func (entity *SearchMessagesFilterVoiceAndVideoNote) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SearchMessagesFilterVoiceAndVideoNote + + return json.Marshal((*stub)(entity)) +} + +func (*SearchMessagesFilterVoiceAndVideoNote) GetClass() string { + return ClassSearchMessagesFilter +} + +func (*SearchMessagesFilterVoiceAndVideoNote) GetType() string { + return TypeSearchMessagesFilterVoiceAndVideoNote +} + +func (*SearchMessagesFilterVoiceAndVideoNote) SearchMessagesFilterType() string { + return TypeSearchMessagesFilterVoiceAndVideoNote +} + +// Returns only messages with mentions of the current user, or messages that are replies to their messages +type SearchMessagesFilterMention struct{ + meta +} + +func (entity *SearchMessagesFilterMention) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SearchMessagesFilterMention + + return json.Marshal((*stub)(entity)) +} + +func (*SearchMessagesFilterMention) GetClass() string { + return ClassSearchMessagesFilter +} + +func (*SearchMessagesFilterMention) GetType() string { + return TypeSearchMessagesFilterMention +} + +func (*SearchMessagesFilterMention) SearchMessagesFilterType() string { + return TypeSearchMessagesFilterMention +} + +// 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 +type SearchMessagesFilterUnreadMention struct{ + meta +} + +func (entity *SearchMessagesFilterUnreadMention) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SearchMessagesFilterUnreadMention + + return json.Marshal((*stub)(entity)) +} + +func (*SearchMessagesFilterUnreadMention) GetClass() string { + return ClassSearchMessagesFilter +} + +func (*SearchMessagesFilterUnreadMention) GetType() string { + return TypeSearchMessagesFilterUnreadMention +} + +func (*SearchMessagesFilterUnreadMention) SearchMessagesFilterType() string { + return TypeSearchMessagesFilterUnreadMention +} + +// 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 +type SearchMessagesFilterUnreadReaction struct{ + meta +} + +func (entity *SearchMessagesFilterUnreadReaction) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SearchMessagesFilterUnreadReaction + + return json.Marshal((*stub)(entity)) +} + +func (*SearchMessagesFilterUnreadReaction) GetClass() string { + return ClassSearchMessagesFilter +} + +func (*SearchMessagesFilterUnreadReaction) GetType() string { + return TypeSearchMessagesFilterUnreadReaction +} + +func (*SearchMessagesFilterUnreadReaction) SearchMessagesFilterType() string { + return TypeSearchMessagesFilterUnreadReaction +} + +// Returns only failed to send messages. This filter can be used only if the message database is used +type SearchMessagesFilterFailedToSend struct{ + meta +} + +func (entity *SearchMessagesFilterFailedToSend) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SearchMessagesFilterFailedToSend + + return json.Marshal((*stub)(entity)) +} + +func (*SearchMessagesFilterFailedToSend) GetClass() string { + return ClassSearchMessagesFilter +} + +func (*SearchMessagesFilterFailedToSend) GetType() string { + return TypeSearchMessagesFilterFailedToSend +} + +func (*SearchMessagesFilterFailedToSend) SearchMessagesFilterType() string { + return TypeSearchMessagesFilterFailedToSend +} + +// Returns only pinned messages +type SearchMessagesFilterPinned struct{ + meta +} + +func (entity *SearchMessagesFilterPinned) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SearchMessagesFilterPinned + + return json.Marshal((*stub)(entity)) +} + +func (*SearchMessagesFilterPinned) GetClass() string { + return ClassSearchMessagesFilter +} + +func (*SearchMessagesFilterPinned) GetType() string { + return TypeSearchMessagesFilterPinned +} + +func (*SearchMessagesFilterPinned) SearchMessagesFilterType() string { + return TypeSearchMessagesFilterPinned +} + +// The user is typing a message +type ChatActionTyping struct{ + meta +} + +func (entity *ChatActionTyping) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatActionTyping + + return json.Marshal((*stub)(entity)) +} + +func (*ChatActionTyping) GetClass() string { + return ClassChatAction +} + +func (*ChatActionTyping) GetType() string { + return TypeChatActionTyping +} + +func (*ChatActionTyping) ChatActionType() string { + return TypeChatActionTyping +} + +// The user is recording a video +type ChatActionRecordingVideo struct{ + meta +} + +func (entity *ChatActionRecordingVideo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatActionRecordingVideo + + return json.Marshal((*stub)(entity)) +} + +func (*ChatActionRecordingVideo) GetClass() string { + return ClassChatAction +} + +func (*ChatActionRecordingVideo) GetType() string { + return TypeChatActionRecordingVideo +} + +func (*ChatActionRecordingVideo) ChatActionType() string { + return TypeChatActionRecordingVideo +} + +// The user is uploading a video +type ChatActionUploadingVideo struct { + meta + // Upload progress, as a percentage + Progress int32 `json:"progress"` +} + +func (entity *ChatActionUploadingVideo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatActionUploadingVideo + + return json.Marshal((*stub)(entity)) +} + +func (*ChatActionUploadingVideo) GetClass() string { + return ClassChatAction +} + +func (*ChatActionUploadingVideo) GetType() string { + return TypeChatActionUploadingVideo +} + +func (*ChatActionUploadingVideo) ChatActionType() string { + return TypeChatActionUploadingVideo +} + +// The user is recording a voice note +type ChatActionRecordingVoiceNote struct{ + meta +} + +func (entity *ChatActionRecordingVoiceNote) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatActionRecordingVoiceNote + + return json.Marshal((*stub)(entity)) +} + +func (*ChatActionRecordingVoiceNote) GetClass() string { + return ClassChatAction +} + +func (*ChatActionRecordingVoiceNote) GetType() string { + return TypeChatActionRecordingVoiceNote +} + +func (*ChatActionRecordingVoiceNote) ChatActionType() string { + return TypeChatActionRecordingVoiceNote +} + +// The user is uploading a voice note +type ChatActionUploadingVoiceNote struct { + meta + // Upload progress, as a percentage + Progress int32 `json:"progress"` +} + +func (entity *ChatActionUploadingVoiceNote) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatActionUploadingVoiceNote + + return json.Marshal((*stub)(entity)) +} + +func (*ChatActionUploadingVoiceNote) GetClass() string { + return ClassChatAction +} + +func (*ChatActionUploadingVoiceNote) GetType() string { + return TypeChatActionUploadingVoiceNote +} + +func (*ChatActionUploadingVoiceNote) ChatActionType() string { + return TypeChatActionUploadingVoiceNote +} + +// The user is uploading a photo +type ChatActionUploadingPhoto struct { + meta + // Upload progress, as a percentage + Progress int32 `json:"progress"` +} + +func (entity *ChatActionUploadingPhoto) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatActionUploadingPhoto + + return json.Marshal((*stub)(entity)) +} + +func (*ChatActionUploadingPhoto) GetClass() string { + return ClassChatAction +} + +func (*ChatActionUploadingPhoto) GetType() string { + return TypeChatActionUploadingPhoto +} + +func (*ChatActionUploadingPhoto) ChatActionType() string { + return TypeChatActionUploadingPhoto +} + +// The user is uploading a document +type ChatActionUploadingDocument struct { + meta + // Upload progress, as a percentage + Progress int32 `json:"progress"` +} + +func (entity *ChatActionUploadingDocument) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatActionUploadingDocument + + return json.Marshal((*stub)(entity)) +} + +func (*ChatActionUploadingDocument) GetClass() string { + return ClassChatAction +} + +func (*ChatActionUploadingDocument) GetType() string { + return TypeChatActionUploadingDocument +} + +func (*ChatActionUploadingDocument) ChatActionType() string { + return TypeChatActionUploadingDocument +} + +// The user is picking a sticker to send +type ChatActionChoosingSticker struct{ + meta +} + +func (entity *ChatActionChoosingSticker) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatActionChoosingSticker + + return json.Marshal((*stub)(entity)) +} + +func (*ChatActionChoosingSticker) GetClass() string { + return ClassChatAction +} + +func (*ChatActionChoosingSticker) GetType() string { + return TypeChatActionChoosingSticker +} + +func (*ChatActionChoosingSticker) ChatActionType() string { + return TypeChatActionChoosingSticker +} + +// The user is picking a location or venue to send +type ChatActionChoosingLocation struct{ + meta +} + +func (entity *ChatActionChoosingLocation) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatActionChoosingLocation + + return json.Marshal((*stub)(entity)) +} + +func (*ChatActionChoosingLocation) GetClass() string { + return ClassChatAction +} + +func (*ChatActionChoosingLocation) GetType() string { + return TypeChatActionChoosingLocation +} + +func (*ChatActionChoosingLocation) ChatActionType() string { + return TypeChatActionChoosingLocation +} + +// The user is picking a contact to send +type ChatActionChoosingContact struct{ + meta +} + +func (entity *ChatActionChoosingContact) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatActionChoosingContact + + return json.Marshal((*stub)(entity)) +} + +func (*ChatActionChoosingContact) GetClass() string { + return ClassChatAction +} + +func (*ChatActionChoosingContact) GetType() string { + return TypeChatActionChoosingContact +} + +func (*ChatActionChoosingContact) ChatActionType() string { + return TypeChatActionChoosingContact +} + +// The user has started to play a game +type ChatActionStartPlayingGame struct{ + meta +} + +func (entity *ChatActionStartPlayingGame) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatActionStartPlayingGame + + return json.Marshal((*stub)(entity)) +} + +func (*ChatActionStartPlayingGame) GetClass() string { + return ClassChatAction +} + +func (*ChatActionStartPlayingGame) GetType() string { + return TypeChatActionStartPlayingGame +} + +func (*ChatActionStartPlayingGame) ChatActionType() string { + return TypeChatActionStartPlayingGame +} + +// The user is recording a video note +type ChatActionRecordingVideoNote struct{ + meta +} + +func (entity *ChatActionRecordingVideoNote) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatActionRecordingVideoNote + + return json.Marshal((*stub)(entity)) +} + +func (*ChatActionRecordingVideoNote) GetClass() string { + return ClassChatAction +} + +func (*ChatActionRecordingVideoNote) GetType() string { + return TypeChatActionRecordingVideoNote +} + +func (*ChatActionRecordingVideoNote) ChatActionType() string { + return TypeChatActionRecordingVideoNote +} + +// The user is uploading a video note +type ChatActionUploadingVideoNote struct { + meta + // Upload progress, as a percentage + Progress int32 `json:"progress"` +} + +func (entity *ChatActionUploadingVideoNote) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatActionUploadingVideoNote + + return json.Marshal((*stub)(entity)) +} + +func (*ChatActionUploadingVideoNote) GetClass() string { + return ClassChatAction +} + +func (*ChatActionUploadingVideoNote) GetType() string { + return TypeChatActionUploadingVideoNote +} + +func (*ChatActionUploadingVideoNote) ChatActionType() string { + return TypeChatActionUploadingVideoNote +} + +// The user is watching animations sent by the other party by clicking on an animated emoji +type ChatActionWatchingAnimations struct { + meta + // The animated emoji + Emoji string `json:"emoji"` +} + +func (entity *ChatActionWatchingAnimations) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatActionWatchingAnimations + + return json.Marshal((*stub)(entity)) +} + +func (*ChatActionWatchingAnimations) GetClass() string { + return ClassChatAction +} + +func (*ChatActionWatchingAnimations) GetType() string { + return TypeChatActionWatchingAnimations +} + +func (*ChatActionWatchingAnimations) ChatActionType() string { + return TypeChatActionWatchingAnimations +} + +// The user has canceled the previous action +type ChatActionCancel struct{ + meta +} + +func (entity *ChatActionCancel) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatActionCancel + + return json.Marshal((*stub)(entity)) +} + +func (*ChatActionCancel) GetClass() string { + return ClassChatAction +} + +func (*ChatActionCancel) GetType() string { + return TypeChatActionCancel +} + +func (*ChatActionCancel) ChatActionType() string { + return TypeChatActionCancel +} + +// The user's status has never been changed +type UserStatusEmpty struct{ + meta +} + +func (entity *UserStatusEmpty) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UserStatusEmpty + + return json.Marshal((*stub)(entity)) +} + +func (*UserStatusEmpty) GetClass() string { + return ClassUserStatus +} + +func (*UserStatusEmpty) GetType() string { + return TypeUserStatusEmpty +} + +func (*UserStatusEmpty) UserStatusType() string { + return TypeUserStatusEmpty +} + +// The user is online +type UserStatusOnline struct { + meta + // Point in time (Unix timestamp) when the user's online status will expire + Expires int32 `json:"expires"` +} + +func (entity *UserStatusOnline) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UserStatusOnline + + return json.Marshal((*stub)(entity)) +} + +func (*UserStatusOnline) GetClass() string { + return ClassUserStatus +} + +func (*UserStatusOnline) GetType() string { + return TypeUserStatusOnline +} + +func (*UserStatusOnline) UserStatusType() string { + return TypeUserStatusOnline +} + +// The user is offline +type UserStatusOffline struct { + meta + // Point in time (Unix timestamp) when the user was last online + WasOnline int32 `json:"was_online"` +} + +func (entity *UserStatusOffline) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UserStatusOffline + + return json.Marshal((*stub)(entity)) +} + +func (*UserStatusOffline) GetClass() string { + return ClassUserStatus +} + +func (*UserStatusOffline) GetType() string { + return TypeUserStatusOffline +} + +func (*UserStatusOffline) UserStatusType() string { + return TypeUserStatusOffline +} + +// The user was online recently +type UserStatusRecently struct { + meta + // Exact user's status is hidden because the current user enabled userPrivacySettingShowStatus privacy setting for the user and has no Telegram Premium + ByMyPrivacySettings bool `json:"by_my_privacy_settings"` +} + +func (entity *UserStatusRecently) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UserStatusRecently + + return json.Marshal((*stub)(entity)) +} + +func (*UserStatusRecently) GetClass() string { + return ClassUserStatus +} + +func (*UserStatusRecently) GetType() string { + return TypeUserStatusRecently +} + +func (*UserStatusRecently) UserStatusType() string { + return TypeUserStatusRecently +} + +// The user is offline, but was online last week +type UserStatusLastWeek struct { + meta + // Exact user's status is hidden because the current user enabled userPrivacySettingShowStatus privacy setting for the user and has no Telegram Premium + ByMyPrivacySettings bool `json:"by_my_privacy_settings"` +} + +func (entity *UserStatusLastWeek) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UserStatusLastWeek + + return json.Marshal((*stub)(entity)) +} + +func (*UserStatusLastWeek) GetClass() string { + return ClassUserStatus +} + +func (*UserStatusLastWeek) GetType() string { + return TypeUserStatusLastWeek +} + +func (*UserStatusLastWeek) UserStatusType() string { + return TypeUserStatusLastWeek +} + +// The user is offline, but was online last month +type UserStatusLastMonth struct { + meta + // Exact user's status is hidden because the current user enabled userPrivacySettingShowStatus privacy setting for the user and has no Telegram Premium + ByMyPrivacySettings bool `json:"by_my_privacy_settings"` +} + +func (entity *UserStatusLastMonth) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UserStatusLastMonth + + return json.Marshal((*stub)(entity)) +} + +func (*UserStatusLastMonth) GetClass() string { + return ClassUserStatus +} + +func (*UserStatusLastMonth) GetType() string { + return TypeUserStatusLastMonth +} + +func (*UserStatusLastMonth) UserStatusType() string { + return TypeUserStatusLastMonth +} + +// Represents an emoji with its keyword +type EmojiKeyword struct { + meta + // The emoji + Emoji string `json:"emoji"` + // The keyword + Keyword string `json:"keyword"` +} + +func (entity *EmojiKeyword) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub EmojiKeyword + + return json.Marshal((*stub)(entity)) +} + +func (*EmojiKeyword) GetClass() string { + return ClassEmojiKeyword +} + +func (*EmojiKeyword) GetType() string { + return TypeEmojiKeyword +} + +// Represents a list of emoji with their keywords +type EmojiKeywords struct { + meta + // List of emoji with their keywords + EmojiKeywords []*EmojiKeyword `json:"emoji_keywords"` +} + +func (entity *EmojiKeywords) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub EmojiKeywords + + return json.Marshal((*stub)(entity)) +} + +func (*EmojiKeywords) GetClass() string { + return ClassEmojiKeywords +} + +func (*EmojiKeywords) GetType() string { + return TypeEmojiKeywords +} + +// Represents a list of stickers +type Stickers struct { + meta + // List of stickers + Stickers []*Sticker `json:"stickers"` +} + +func (entity *Stickers) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub Stickers + + return json.Marshal((*stub)(entity)) +} + +func (*Stickers) GetClass() string { + return ClassStickers +} + +func (*Stickers) GetType() string { + return TypeStickers +} + +// Represents a list of emoji +type Emojis struct { + meta + // List of emojis + Emojis []string `json:"emojis"` +} + +func (entity *Emojis) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub Emojis + + return json.Marshal((*stub)(entity)) +} + +func (*Emojis) GetClass() string { + return ClassEmojis +} + +func (*Emojis) GetType() string { + return TypeEmojis +} + +// Represents a sticker set +type StickerSet struct { + 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 is owned by the current user + IsOwned bool `json:"is_owned"` + // 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, if stickers in the sticker set are custom emoji that must be repainted; for custom emoji sticker sets only + NeedsRepainting bool `json:"needs_repainting"` + // True, if stickers in the sticker set are custom emoji that can be used as chat emoji status; for custom emoji sticker sets only + IsAllowedAsChatEmojiStatus bool `json:"is_allowed_as_chat_emoji_status"` + // 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"` +} + +func (entity *StickerSet) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StickerSet + + return json.Marshal((*stub)(entity)) +} + +func (*StickerSet) GetClass() string { + return ClassStickerSet +} + +func (*StickerSet) GetType() string { + return TypeStickerSet +} + +func (stickerSet *StickerSet) UnmarshalJSON(data []byte) error { + var tmp struct { + Id JsonInt64 `json:"id"` + Title string `json:"title"` + Name string `json:"name"` + Thumbnail *Thumbnail `json:"thumbnail"` + ThumbnailOutline []*ClosedVectorPath `json:"thumbnail_outline"` + IsOwned bool `json:"is_owned"` + IsInstalled bool `json:"is_installed"` + IsArchived bool `json:"is_archived"` + IsOfficial bool `json:"is_official"` + StickerType json.RawMessage `json:"sticker_type"` + NeedsRepainting bool `json:"needs_repainting"` + IsAllowedAsChatEmojiStatus bool `json:"is_allowed_as_chat_emoji_status"` + 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.IsOwned = tmp.IsOwned + stickerSet.IsInstalled = tmp.IsInstalled + stickerSet.IsArchived = tmp.IsArchived + stickerSet.IsOfficial = tmp.IsOfficial + stickerSet.NeedsRepainting = tmp.NeedsRepainting + stickerSet.IsAllowedAsChatEmojiStatus = tmp.IsAllowedAsChatEmojiStatus + stickerSet.IsViewed = tmp.IsViewed + stickerSet.Stickers = tmp.Stickers + stickerSet.Emojis = tmp.Emojis + + fieldStickerType, _ := UnmarshalStickerType(tmp.StickerType) + stickerSet.StickerType = fieldStickerType + + return nil +} + +// Represents short information about a sticker set +type StickerSetInfo struct { + 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 is owned by the current user + IsOwned bool `json:"is_owned"` + // 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, if stickers in the sticker set are custom emoji that must be repainted; for custom emoji sticker sets only + NeedsRepainting bool `json:"needs_repainting"` + // True, if stickers in the sticker set are custom emoji that can be used as chat emoji status; for custom emoji sticker sets only + IsAllowedAsChatEmojiStatus bool `json:"is_allowed_as_chat_emoji_status"` + // 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"` +} + +func (entity *StickerSetInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StickerSetInfo + + return json.Marshal((*stub)(entity)) +} + +func (*StickerSetInfo) GetClass() string { + return ClassStickerSetInfo +} + +func (*StickerSetInfo) GetType() string { + return TypeStickerSetInfo +} + +func (stickerSetInfo *StickerSetInfo) UnmarshalJSON(data []byte) error { + var tmp struct { + Id JsonInt64 `json:"id"` + Title string `json:"title"` + Name string `json:"name"` + Thumbnail *Thumbnail `json:"thumbnail"` + ThumbnailOutline []*ClosedVectorPath `json:"thumbnail_outline"` + IsOwned bool `json:"is_owned"` + IsInstalled bool `json:"is_installed"` + IsArchived bool `json:"is_archived"` + IsOfficial bool `json:"is_official"` + StickerType json.RawMessage `json:"sticker_type"` + NeedsRepainting bool `json:"needs_repainting"` + IsAllowedAsChatEmojiStatus bool `json:"is_allowed_as_chat_emoji_status"` + 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.IsOwned = tmp.IsOwned + stickerSetInfo.IsInstalled = tmp.IsInstalled + stickerSetInfo.IsArchived = tmp.IsArchived + stickerSetInfo.IsOfficial = tmp.IsOfficial + stickerSetInfo.NeedsRepainting = tmp.NeedsRepainting + stickerSetInfo.IsAllowedAsChatEmojiStatus = tmp.IsAllowedAsChatEmojiStatus + stickerSetInfo.IsViewed = tmp.IsViewed + stickerSetInfo.Size = tmp.Size + stickerSetInfo.Covers = tmp.Covers + + fieldStickerType, _ := UnmarshalStickerType(tmp.StickerType) + stickerSetInfo.StickerType = fieldStickerType + + return nil +} + +// Represents a list of sticker sets +type StickerSets struct { + meta + // Approximate total number of sticker sets found + TotalCount int32 `json:"total_count"` + // List of sticker sets + Sets []*StickerSetInfo `json:"sets"` +} + +func (entity *StickerSets) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StickerSets + + return json.Marshal((*stub)(entity)) +} + +func (*StickerSets) GetClass() string { + return ClassStickerSets +} + +func (*StickerSets) GetType() string { + return TypeStickerSets +} + +// Represents a list of trending sticker sets +type TrendingStickerSets struct { + meta + // Approximate total number of trending sticker sets + TotalCount int32 `json:"total_count"` + // List of trending sticker sets + Sets []*StickerSetInfo `json:"sets"` + // True, if the list contains sticker sets with premium stickers + IsPremium bool `json:"is_premium"` +} + +func (entity *TrendingStickerSets) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TrendingStickerSets + + return json.Marshal((*stub)(entity)) +} + +func (*TrendingStickerSets) GetClass() string { + return ClassTrendingStickerSets +} + +func (*TrendingStickerSets) GetType() string { + return TypeTrendingStickerSets +} + +// Contains a list of similar emoji to search for in getStickers and searchStickers +type EmojiCategory struct { + meta + // Name of the category + Name string `json:"name"` + // Custom emoji sticker, which represents icon of the category + Icon *Sticker `json:"icon"` + // List of emojis in the category + Emojis []string `json:"emojis"` +} + +func (entity *EmojiCategory) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub EmojiCategory + + return json.Marshal((*stub)(entity)) +} + +func (*EmojiCategory) GetClass() string { + return ClassEmojiCategory +} + +func (*EmojiCategory) GetType() string { + return TypeEmojiCategory +} + +// Represents a list of emoji categories +type EmojiCategories struct { + meta + // List of categories + Categories []*EmojiCategory `json:"categories"` +} + +func (entity *EmojiCategories) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub EmojiCategories + + return json.Marshal((*stub)(entity)) +} + +func (*EmojiCategories) GetClass() string { + return ClassEmojiCategories +} + +func (*EmojiCategories) GetType() string { + return TypeEmojiCategories +} + +// The category must be used by default +type EmojiCategoryTypeDefault struct{ + meta +} + +func (entity *EmojiCategoryTypeDefault) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub EmojiCategoryTypeDefault + + return json.Marshal((*stub)(entity)) +} + +func (*EmojiCategoryTypeDefault) GetClass() string { + return ClassEmojiCategoryType +} + +func (*EmojiCategoryTypeDefault) GetType() string { + return TypeEmojiCategoryTypeDefault +} + +func (*EmojiCategoryTypeDefault) EmojiCategoryTypeType() string { + return TypeEmojiCategoryTypeDefault +} + +// The category must be used for emoji status selection +type EmojiCategoryTypeEmojiStatus struct{ + meta +} + +func (entity *EmojiCategoryTypeEmojiStatus) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub EmojiCategoryTypeEmojiStatus + + return json.Marshal((*stub)(entity)) +} + +func (*EmojiCategoryTypeEmojiStatus) GetClass() string { + return ClassEmojiCategoryType +} + +func (*EmojiCategoryTypeEmojiStatus) GetType() string { + return TypeEmojiCategoryTypeEmojiStatus +} + +func (*EmojiCategoryTypeEmojiStatus) EmojiCategoryTypeType() string { + return TypeEmojiCategoryTypeEmojiStatus +} + +// The category must be used for chat photo emoji selection +type EmojiCategoryTypeChatPhoto struct{ + meta +} + +func (entity *EmojiCategoryTypeChatPhoto) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub EmojiCategoryTypeChatPhoto + + return json.Marshal((*stub)(entity)) +} + +func (*EmojiCategoryTypeChatPhoto) GetClass() string { + return ClassEmojiCategoryType +} + +func (*EmojiCategoryTypeChatPhoto) GetType() string { + return TypeEmojiCategoryTypeChatPhoto +} + +func (*EmojiCategoryTypeChatPhoto) EmojiCategoryTypeType() string { + return TypeEmojiCategoryTypeChatPhoto +} + +// Describes position of a clickable rectangle area on a story media +type StoryAreaPosition struct { + meta + // The abscissa of the rectangle's center, as a percentage of the media width + XPercentage float64 `json:"x_percentage"` + // The ordinate of the rectangle's center, as a percentage of the media height + YPercentage float64 `json:"y_percentage"` + // The width of the rectangle, as a percentage of the media width + WidthPercentage float64 `json:"width_percentage"` + // The height of the rectangle, as a percentage of the media height + HeightPercentage float64 `json:"height_percentage"` + // Clockwise rotation angle of the rectangle, in degrees; 0-360 + RotationAngle float64 `json:"rotation_angle"` +} + +func (entity *StoryAreaPosition) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryAreaPosition + + return json.Marshal((*stub)(entity)) +} + +func (*StoryAreaPosition) GetClass() string { + return ClassStoryAreaPosition +} + +func (*StoryAreaPosition) GetType() string { + return TypeStoryAreaPosition +} + +// An area pointing to a location +type StoryAreaTypeLocation struct { + meta + // The location + Location *Location `json:"location"` +} + +func (entity *StoryAreaTypeLocation) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryAreaTypeLocation + + return json.Marshal((*stub)(entity)) +} + +func (*StoryAreaTypeLocation) GetClass() string { + return ClassStoryAreaType +} + +func (*StoryAreaTypeLocation) GetType() string { + return TypeStoryAreaTypeLocation +} + +func (*StoryAreaTypeLocation) StoryAreaTypeType() string { + return TypeStoryAreaTypeLocation +} + +// An area pointing to a venue +type StoryAreaTypeVenue struct { + meta + // Information about the venue + Venue *Venue `json:"venue"` +} + +func (entity *StoryAreaTypeVenue) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryAreaTypeVenue + + return json.Marshal((*stub)(entity)) +} + +func (*StoryAreaTypeVenue) GetClass() string { + return ClassStoryAreaType +} + +func (*StoryAreaTypeVenue) GetType() string { + return TypeStoryAreaTypeVenue +} + +func (*StoryAreaTypeVenue) StoryAreaTypeType() string { + return TypeStoryAreaTypeVenue +} + +// An area pointing to a suggested reaction. App needs to show a clickable reaction on the area and call setStoryReaction when the are is clicked +type StoryAreaTypeSuggestedReaction struct { + meta + // Type of the reaction + ReactionType ReactionType `json:"reaction_type"` + // Number of times the reaction was added + TotalCount int32 `json:"total_count"` + // True, if reaction has a dark background + IsDark bool `json:"is_dark"` + // True, if reaction corner is flipped + IsFlipped bool `json:"is_flipped"` +} + +func (entity *StoryAreaTypeSuggestedReaction) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryAreaTypeSuggestedReaction + + return json.Marshal((*stub)(entity)) +} + +func (*StoryAreaTypeSuggestedReaction) GetClass() string { + return ClassStoryAreaType +} + +func (*StoryAreaTypeSuggestedReaction) GetType() string { + return TypeStoryAreaTypeSuggestedReaction +} + +func (*StoryAreaTypeSuggestedReaction) StoryAreaTypeType() string { + return TypeStoryAreaTypeSuggestedReaction +} + +func (storyAreaTypeSuggestedReaction *StoryAreaTypeSuggestedReaction) UnmarshalJSON(data []byte) error { + var tmp struct { + ReactionType json.RawMessage `json:"reaction_type"` + TotalCount int32 `json:"total_count"` + IsDark bool `json:"is_dark"` + IsFlipped bool `json:"is_flipped"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + storyAreaTypeSuggestedReaction.TotalCount = tmp.TotalCount + storyAreaTypeSuggestedReaction.IsDark = tmp.IsDark + storyAreaTypeSuggestedReaction.IsFlipped = tmp.IsFlipped + + fieldReactionType, _ := UnmarshalReactionType(tmp.ReactionType) + storyAreaTypeSuggestedReaction.ReactionType = fieldReactionType + + return nil +} + +// An area pointing to a message +type StoryAreaTypeMessage struct { + meta + // Identifier of the chat with the message + ChatId int64 `json:"chat_id"` + // Identifier of the message + MessageId int64 `json:"message_id"` +} + +func (entity *StoryAreaTypeMessage) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryAreaTypeMessage + + return json.Marshal((*stub)(entity)) +} + +func (*StoryAreaTypeMessage) GetClass() string { + return ClassStoryAreaType +} + +func (*StoryAreaTypeMessage) GetType() string { + return TypeStoryAreaTypeMessage +} + +func (*StoryAreaTypeMessage) StoryAreaTypeType() string { + return TypeStoryAreaTypeMessage +} + +// Describes a clickable rectangle area on a story media +type StoryArea struct { + meta + // Position of the area + Position *StoryAreaPosition `json:"position"` + // Type of the area + Type StoryAreaType `json:"type"` +} + +func (entity *StoryArea) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryArea + + return json.Marshal((*stub)(entity)) +} + +func (*StoryArea) GetClass() string { + return ClassStoryArea +} + +func (*StoryArea) GetType() string { + return TypeStoryArea +} + +func (storyArea *StoryArea) UnmarshalJSON(data []byte) error { + var tmp struct { + Position *StoryAreaPosition `json:"position"` + Type json.RawMessage `json:"type"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + storyArea.Position = tmp.Position + + fieldType, _ := UnmarshalStoryAreaType(tmp.Type) + storyArea.Type = fieldType + + return nil +} + +// An area pointing to a location +type InputStoryAreaTypeLocation struct { + meta + // The location + Location *Location `json:"location"` +} + +func (entity *InputStoryAreaTypeLocation) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputStoryAreaTypeLocation + + return json.Marshal((*stub)(entity)) +} + +func (*InputStoryAreaTypeLocation) GetClass() string { + return ClassInputStoryAreaType +} + +func (*InputStoryAreaTypeLocation) GetType() string { + return TypeInputStoryAreaTypeLocation +} + +func (*InputStoryAreaTypeLocation) InputStoryAreaTypeType() string { + return TypeInputStoryAreaTypeLocation +} + +// An area pointing to a venue found by the bot getOption("venue_search_bot_username") +type InputStoryAreaTypeFoundVenue struct { + meta + // Identifier of the inline query, used to found the venue + QueryId JsonInt64 `json:"query_id"` + // Identifier of the inline query result + ResultId string `json:"result_id"` +} + +func (entity *InputStoryAreaTypeFoundVenue) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputStoryAreaTypeFoundVenue + + return json.Marshal((*stub)(entity)) +} + +func (*InputStoryAreaTypeFoundVenue) GetClass() string { + return ClassInputStoryAreaType +} + +func (*InputStoryAreaTypeFoundVenue) GetType() string { + return TypeInputStoryAreaTypeFoundVenue +} + +func (*InputStoryAreaTypeFoundVenue) InputStoryAreaTypeType() string { + return TypeInputStoryAreaTypeFoundVenue +} + +// An area pointing to a venue already added to the story +type InputStoryAreaTypePreviousVenue struct { + meta + // Provider of the venue + VenueProvider string `json:"venue_provider"` + // Identifier of the venue in the provider database + VenueId string `json:"venue_id"` +} + +func (entity *InputStoryAreaTypePreviousVenue) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputStoryAreaTypePreviousVenue + + return json.Marshal((*stub)(entity)) +} + +func (*InputStoryAreaTypePreviousVenue) GetClass() string { + return ClassInputStoryAreaType +} + +func (*InputStoryAreaTypePreviousVenue) GetType() string { + return TypeInputStoryAreaTypePreviousVenue +} + +func (*InputStoryAreaTypePreviousVenue) InputStoryAreaTypeType() string { + return TypeInputStoryAreaTypePreviousVenue +} + +// An area pointing to a suggested reaction +type InputStoryAreaTypeSuggestedReaction struct { + meta + // Type of the reaction + ReactionType ReactionType `json:"reaction_type"` + // True, if reaction has a dark background + IsDark bool `json:"is_dark"` + // True, if reaction corner is flipped + IsFlipped bool `json:"is_flipped"` +} + +func (entity *InputStoryAreaTypeSuggestedReaction) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputStoryAreaTypeSuggestedReaction + + return json.Marshal((*stub)(entity)) +} + +func (*InputStoryAreaTypeSuggestedReaction) GetClass() string { + return ClassInputStoryAreaType +} + +func (*InputStoryAreaTypeSuggestedReaction) GetType() string { + return TypeInputStoryAreaTypeSuggestedReaction +} + +func (*InputStoryAreaTypeSuggestedReaction) InputStoryAreaTypeType() string { + return TypeInputStoryAreaTypeSuggestedReaction +} + +func (inputStoryAreaTypeSuggestedReaction *InputStoryAreaTypeSuggestedReaction) UnmarshalJSON(data []byte) error { + var tmp struct { + ReactionType json.RawMessage `json:"reaction_type"` + IsDark bool `json:"is_dark"` + IsFlipped bool `json:"is_flipped"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + inputStoryAreaTypeSuggestedReaction.IsDark = tmp.IsDark + inputStoryAreaTypeSuggestedReaction.IsFlipped = tmp.IsFlipped + + fieldReactionType, _ := UnmarshalReactionType(tmp.ReactionType) + inputStoryAreaTypeSuggestedReaction.ReactionType = fieldReactionType + + return nil +} + +// An area pointing to a message +type InputStoryAreaTypeMessage struct { + meta + // Identifier of the chat with the message. Currently, the chat must be a supergroup or a channel chat + ChatId int64 `json:"chat_id"` + // Identifier of the message. Only successfully sent non-scheduled messages can be specified + MessageId int64 `json:"message_id"` +} + +func (entity *InputStoryAreaTypeMessage) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputStoryAreaTypeMessage + + return json.Marshal((*stub)(entity)) +} + +func (*InputStoryAreaTypeMessage) GetClass() string { + return ClassInputStoryAreaType +} + +func (*InputStoryAreaTypeMessage) GetType() string { + return TypeInputStoryAreaTypeMessage +} + +func (*InputStoryAreaTypeMessage) InputStoryAreaTypeType() string { + return TypeInputStoryAreaTypeMessage +} + +// Describes a clickable rectangle area on a story media to be added +type InputStoryArea struct { + meta + // Position of the area + Position *StoryAreaPosition `json:"position"` + // Type of the area + Type InputStoryAreaType `json:"type"` +} + +func (entity *InputStoryArea) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputStoryArea + + return json.Marshal((*stub)(entity)) +} + +func (*InputStoryArea) GetClass() string { + return ClassInputStoryArea +} + +func (*InputStoryArea) GetType() string { + return TypeInputStoryArea +} + +func (inputStoryArea *InputStoryArea) UnmarshalJSON(data []byte) error { + var tmp struct { + Position *StoryAreaPosition `json:"position"` + Type json.RawMessage `json:"type"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + inputStoryArea.Position = tmp.Position + + fieldType, _ := UnmarshalInputStoryAreaType(tmp.Type) + inputStoryArea.Type = fieldType + + return nil +} + +// Contains a list of story areas to be added +type InputStoryAreas struct { + meta + // List of input story areas. Currently, a story can have up to 10 inputStoryAreaTypeLocation, inputStoryAreaTypeFoundVenue, and inputStoryAreaTypePreviousVenue areas, up to getOption("story_suggested_reaction_area_count_max") inputStoryAreaTypeSuggestedReaction areas, and up to 1 inputStoryAreaTypeMessage area + Areas []*InputStoryArea `json:"areas"` +} + +func (entity *InputStoryAreas) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputStoryAreas + + return json.Marshal((*stub)(entity)) +} + +func (*InputStoryAreas) GetClass() string { + return ClassInputStoryAreas +} + +func (*InputStoryAreas) GetType() string { + return TypeInputStoryAreas +} + +// Describes a video file sent in a story +type StoryVideo struct { + meta + // Duration of the video, in seconds + Duration float64 `json:"duration"` + // Video width + Width int32 `json:"width"` + // Video height + Height int32 `json:"height"` + // 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 has no sound + IsAnimation bool `json:"is_animation"` + // Video minithumbnail; may be null + Minithumbnail *Minithumbnail `json:"minithumbnail"` + // Video thumbnail in JPEG or MPEG4 format; may be null + Thumbnail *Thumbnail `json:"thumbnail"` + // Size of file prefix, which is supposed to be preloaded, in bytes + PreloadPrefixSize int32 `json:"preload_prefix_size"` + // File containing the video + Video *File `json:"video"` +} + +func (entity *StoryVideo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryVideo + + return json.Marshal((*stub)(entity)) +} + +func (*StoryVideo) GetClass() string { + return ClassStoryVideo +} + +func (*StoryVideo) GetType() string { + return TypeStoryVideo +} + +// A photo story +type StoryContentPhoto struct { + meta + // The photo + Photo *Photo `json:"photo"` +} + +func (entity *StoryContentPhoto) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryContentPhoto + + return json.Marshal((*stub)(entity)) +} + +func (*StoryContentPhoto) GetClass() string { + return ClassStoryContent +} + +func (*StoryContentPhoto) GetType() string { + return TypeStoryContentPhoto +} + +func (*StoryContentPhoto) StoryContentType() string { + return TypeStoryContentPhoto +} + +// A video story +type StoryContentVideo struct { + meta + // The video in MPEG4 format + Video *StoryVideo `json:"video"` + // Alternative version of the video in MPEG4 format, encoded by x264 codec; may be null + AlternativeVideo *StoryVideo `json:"alternative_video"` +} + +func (entity *StoryContentVideo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryContentVideo + + return json.Marshal((*stub)(entity)) +} + +func (*StoryContentVideo) GetClass() string { + return ClassStoryContent +} + +func (*StoryContentVideo) GetType() string { + return TypeStoryContentVideo +} + +func (*StoryContentVideo) StoryContentType() string { + return TypeStoryContentVideo +} + +// A story content that is not supported in the current TDLib version +type StoryContentUnsupported struct{ + meta +} + +func (entity *StoryContentUnsupported) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryContentUnsupported + + return json.Marshal((*stub)(entity)) +} + +func (*StoryContentUnsupported) GetClass() string { + return ClassStoryContent +} + +func (*StoryContentUnsupported) GetType() string { + return TypeStoryContentUnsupported +} + +func (*StoryContentUnsupported) StoryContentType() string { + return TypeStoryContentUnsupported +} + +// A photo story +type InputStoryContentPhoto struct { + meta + // Photo to send. The photo must be at most 10 MB in size. The photo size must be 1080x1920 + Photo InputFile `json:"photo"` + // File identifiers of the stickers added to the photo, if applicable + AddedStickerFileIds []int32 `json:"added_sticker_file_ids"` +} + +func (entity *InputStoryContentPhoto) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputStoryContentPhoto + + return json.Marshal((*stub)(entity)) +} + +func (*InputStoryContentPhoto) GetClass() string { + return ClassInputStoryContent +} + +func (*InputStoryContentPhoto) GetType() string { + return TypeInputStoryContentPhoto +} + +func (*InputStoryContentPhoto) InputStoryContentType() string { + return TypeInputStoryContentPhoto +} + +func (inputStoryContentPhoto *InputStoryContentPhoto) UnmarshalJSON(data []byte) error { + var tmp struct { + Photo json.RawMessage `json:"photo"` + AddedStickerFileIds []int32 `json:"added_sticker_file_ids"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + inputStoryContentPhoto.AddedStickerFileIds = tmp.AddedStickerFileIds + + fieldPhoto, _ := UnmarshalInputFile(tmp.Photo) + inputStoryContentPhoto.Photo = fieldPhoto + + return nil +} + +// A video story +type InputStoryContentVideo struct { + meta + // Video to be sent. The video size must be 720x1280. The video must be streamable and stored in MPEG4 format, after encoding with x265 codec and key frames added each second + Video InputFile `json:"video"` + // File identifiers of the stickers added to the video, if applicable + AddedStickerFileIds []int32 `json:"added_sticker_file_ids"` + // Precise duration of the video, in seconds; 0-60 + Duration float64 `json:"duration"` + // True, if the video has no sound + IsAnimation bool `json:"is_animation"` +} + +func (entity *InputStoryContentVideo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputStoryContentVideo + + return json.Marshal((*stub)(entity)) +} + +func (*InputStoryContentVideo) GetClass() string { + return ClassInputStoryContent +} + +func (*InputStoryContentVideo) GetType() string { + return TypeInputStoryContentVideo +} + +func (*InputStoryContentVideo) InputStoryContentType() string { + return TypeInputStoryContentVideo +} + +func (inputStoryContentVideo *InputStoryContentVideo) UnmarshalJSON(data []byte) error { + var tmp struct { + Video json.RawMessage `json:"video"` + AddedStickerFileIds []int32 `json:"added_sticker_file_ids"` + Duration float64 `json:"duration"` + IsAnimation bool `json:"is_animation"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + inputStoryContentVideo.AddedStickerFileIds = tmp.AddedStickerFileIds + inputStoryContentVideo.Duration = tmp.Duration + inputStoryContentVideo.IsAnimation = tmp.IsAnimation + + fieldVideo, _ := UnmarshalInputFile(tmp.Video) + inputStoryContentVideo.Video = fieldVideo + + return nil +} + +// The list of stories, shown in the main chat list and folder chat lists +type StoryListMain struct{ + meta +} + +func (entity *StoryListMain) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryListMain + + return json.Marshal((*stub)(entity)) +} + +func (*StoryListMain) GetClass() string { + return ClassStoryList +} + +func (*StoryListMain) GetType() string { + return TypeStoryListMain +} + +func (*StoryListMain) StoryListType() string { + return TypeStoryListMain +} + +// The list of stories, shown in the Arvhive chat list +type StoryListArchive struct{ + meta +} + +func (entity *StoryListArchive) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryListArchive + + return json.Marshal((*stub)(entity)) +} + +func (*StoryListArchive) GetClass() string { + return ClassStoryList +} + +func (*StoryListArchive) GetType() string { + return TypeStoryListArchive +} + +func (*StoryListArchive) StoryListType() string { + return TypeStoryListArchive +} + +// The original story was a public story with known sender +type StoryOriginPublicStory struct { + meta + // Identifier of the chat that posted original story + ChatId int64 `json:"chat_id"` + // Story identifier of the original story + StoryId int32 `json:"story_id"` +} + +func (entity *StoryOriginPublicStory) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryOriginPublicStory + + return json.Marshal((*stub)(entity)) +} + +func (*StoryOriginPublicStory) GetClass() string { + return ClassStoryOrigin +} + +func (*StoryOriginPublicStory) GetType() string { + return TypeStoryOriginPublicStory +} + +func (*StoryOriginPublicStory) StoryOriginType() string { + return TypeStoryOriginPublicStory +} + +// The original story was sent by an unknown user +type StoryOriginHiddenUser struct { + meta + // Name of the story sender + SenderName string `json:"sender_name"` +} + +func (entity *StoryOriginHiddenUser) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryOriginHiddenUser + + return json.Marshal((*stub)(entity)) +} + +func (*StoryOriginHiddenUser) GetClass() string { + return ClassStoryOrigin +} + +func (*StoryOriginHiddenUser) GetType() string { + return TypeStoryOriginHiddenUser +} + +func (*StoryOriginHiddenUser) StoryOriginType() string { + return TypeStoryOriginHiddenUser +} + +// Contains information about original story that was reposted +type StoryRepostInfo struct { + meta + // Origin of the story that was reposted + Origin StoryOrigin `json:"origin"` + // True, if story content was modified during reposting; otherwise, story wasn't modified + IsContentModified bool `json:"is_content_modified"` +} + +func (entity *StoryRepostInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryRepostInfo + + return json.Marshal((*stub)(entity)) +} + +func (*StoryRepostInfo) GetClass() string { + return ClassStoryRepostInfo +} + +func (*StoryRepostInfo) GetType() string { + return TypeStoryRepostInfo +} + +func (storyRepostInfo *StoryRepostInfo) UnmarshalJSON(data []byte) error { + var tmp struct { + Origin json.RawMessage `json:"origin"` + IsContentModified bool `json:"is_content_modified"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + storyRepostInfo.IsContentModified = tmp.IsContentModified + + fieldOrigin, _ := UnmarshalStoryOrigin(tmp.Origin) + storyRepostInfo.Origin = fieldOrigin + + return nil +} + +// Contains information about interactions with a story +type StoryInteractionInfo struct { + meta + // Number of times the story was viewed + ViewCount int32 `json:"view_count"` + // Number of times the story was forwarded; 0 if none or unknown + ForwardCount int32 `json:"forward_count"` + // Number of reactions added to the story; 0 if none or unknown + ReactionCount int32 `json:"reaction_count"` + // Identifiers of at most 3 recent viewers of the story + RecentViewerUserIds []int64 `json:"recent_viewer_user_ids"` +} + +func (entity *StoryInteractionInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryInteractionInfo + + return json.Marshal((*stub)(entity)) +} + +func (*StoryInteractionInfo) GetClass() string { + return ClassStoryInteractionInfo +} + +func (*StoryInteractionInfo) GetType() string { + return TypeStoryInteractionInfo +} + +// Represents a story +type Story struct { + meta + // Unique story identifier among stories of the given sender + Id int32 `json:"id"` + // Identifier of the chat that posted the story + SenderChatId int64 `json:"sender_chat_id"` + // Identifier of the sender of the story; may be null if the story is posted on behalf of the sender_chat_id + SenderId MessageSender `json:"sender_id"` + // Point in time (Unix timestamp) when the story was published + Date int32 `json:"date"` + // True, if the story is being sent by the current user + IsBeingSent bool `json:"is_being_sent"` + // True, if the story is being edited by the current user + IsBeingEdited bool `json:"is_being_edited"` + // True, if the story was edited + IsEdited bool `json:"is_edited"` + // True, if the story is saved in the sender's profile and will be available there after expiration + IsPinned bool `json:"is_pinned"` + // True, if the story is visible only for the current user + IsVisibleOnlyForSelf bool `json:"is_visible_only_for_self"` + // True, if the story can be deleted + CanBeDeleted bool `json:"can_be_deleted"` + // True, if the story can be edited + CanBeEdited bool `json:"can_be_edited"` + // True, if the story can be forwarded as a message. Otherwise, screenshots and saving of the story content must be also forbidden + CanBeForwarded bool `json:"can_be_forwarded"` + // True, if the story can be replied in the chat with the story sender + CanBeReplied bool `json:"can_be_replied"` + // True, if the story's is_pinned value can be changed + CanToggleIsPinned bool `json:"can_toggle_is_pinned"` + // True, if the story statistics are available through getStoryStatistics + CanGetStatistics bool `json:"can_get_statistics"` + // True, if interactions with the story can be received through getStoryInteractions + CanGetInteractions bool `json:"can_get_interactions"` + // True, if users viewed the story can't be received, because the story has expired more than getOption("story_viewers_expiration_delay") seconds ago + HasExpiredViewers bool `json:"has_expired_viewers"` + // Information about the original story; may be null if the story wasn't reposted + RepostInfo *StoryRepostInfo `json:"repost_info"` + // Information about interactions with the story; may be null if the story isn't owned or there were no interactions + InteractionInfo *StoryInteractionInfo `json:"interaction_info"` + // Type of the chosen reaction; may be null if none + ChosenReactionType ReactionType `json:"chosen_reaction_type"` + // Privacy rules affecting story visibility; may be approximate for non-owned stories + PrivacySettings StoryPrivacySettings `json:"privacy_settings"` + // Content of the story + Content StoryContent `json:"content"` + // Clickable areas to be shown on the story content + Areas []*StoryArea `json:"areas"` + // Caption of the story + Caption *FormattedText `json:"caption"` +} + +func (entity *Story) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub Story + + return json.Marshal((*stub)(entity)) +} + +func (*Story) GetClass() string { + return ClassStory +} + +func (*Story) GetType() string { + return TypeStory +} + +func (story *Story) UnmarshalJSON(data []byte) error { + var tmp struct { + Id int32 `json:"id"` + SenderChatId int64 `json:"sender_chat_id"` + SenderId json.RawMessage `json:"sender_id"` + Date int32 `json:"date"` + IsBeingSent bool `json:"is_being_sent"` + IsBeingEdited bool `json:"is_being_edited"` + IsEdited bool `json:"is_edited"` + IsPinned bool `json:"is_pinned"` + IsVisibleOnlyForSelf bool `json:"is_visible_only_for_self"` + CanBeDeleted bool `json:"can_be_deleted"` + CanBeEdited bool `json:"can_be_edited"` + CanBeForwarded bool `json:"can_be_forwarded"` + CanBeReplied bool `json:"can_be_replied"` + CanToggleIsPinned bool `json:"can_toggle_is_pinned"` + CanGetStatistics bool `json:"can_get_statistics"` + CanGetInteractions bool `json:"can_get_interactions"` + HasExpiredViewers bool `json:"has_expired_viewers"` + RepostInfo *StoryRepostInfo `json:"repost_info"` + InteractionInfo *StoryInteractionInfo `json:"interaction_info"` + ChosenReactionType json.RawMessage `json:"chosen_reaction_type"` + PrivacySettings json.RawMessage `json:"privacy_settings"` + Content json.RawMessage `json:"content"` + Areas []*StoryArea `json:"areas"` + Caption *FormattedText `json:"caption"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + story.Id = tmp.Id + story.SenderChatId = tmp.SenderChatId + story.Date = tmp.Date + story.IsBeingSent = tmp.IsBeingSent + story.IsBeingEdited = tmp.IsBeingEdited + story.IsEdited = tmp.IsEdited + story.IsPinned = tmp.IsPinned + story.IsVisibleOnlyForSelf = tmp.IsVisibleOnlyForSelf + story.CanBeDeleted = tmp.CanBeDeleted + story.CanBeEdited = tmp.CanBeEdited + story.CanBeForwarded = tmp.CanBeForwarded + story.CanBeReplied = tmp.CanBeReplied + story.CanToggleIsPinned = tmp.CanToggleIsPinned + story.CanGetStatistics = tmp.CanGetStatistics + story.CanGetInteractions = tmp.CanGetInteractions + story.HasExpiredViewers = tmp.HasExpiredViewers + story.RepostInfo = tmp.RepostInfo + story.InteractionInfo = tmp.InteractionInfo + story.Areas = tmp.Areas + story.Caption = tmp.Caption + + fieldSenderId, _ := UnmarshalMessageSender(tmp.SenderId) + story.SenderId = fieldSenderId + + fieldChosenReactionType, _ := UnmarshalReactionType(tmp.ChosenReactionType) + story.ChosenReactionType = fieldChosenReactionType + + fieldPrivacySettings, _ := UnmarshalStoryPrivacySettings(tmp.PrivacySettings) + story.PrivacySettings = fieldPrivacySettings + + fieldContent, _ := UnmarshalStoryContent(tmp.Content) + story.Content = fieldContent + + return nil +} + +// Represents a list of stories +type Stories struct { + meta + // Approximate total number of stories found + TotalCount int32 `json:"total_count"` + // The list of stories + Stories []*Story `json:"stories"` +} + +func (entity *Stories) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub Stories + + return json.Marshal((*stub)(entity)) +} + +func (*Stories) GetClass() string { + return ClassStories +} + +func (*Stories) GetType() string { + return TypeStories +} + +// Contains identifier of a story along with identifier of its sender +type StoryFullId struct { + meta + // Identifier of the chat that posted the story + SenderChatId int64 `json:"sender_chat_id"` + // Unique story identifier among stories of the given sender + StoryId int32 `json:"story_id"` +} + +func (entity *StoryFullId) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryFullId + + return json.Marshal((*stub)(entity)) +} + +func (*StoryFullId) GetClass() string { + return ClassStoryFullId +} + +func (*StoryFullId) GetType() string { + return TypeStoryFullId +} + +// Contains basic information about a story +type StoryInfo struct { + meta + // Unique story identifier among stories of the given sender + StoryId int32 `json:"story_id"` + // Point in time (Unix timestamp) when the story was published + Date int32 `json:"date"` + // True, if the story is available only to close friends + IsForCloseFriends bool `json:"is_for_close_friends"` +} + +func (entity *StoryInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryInfo + + return json.Marshal((*stub)(entity)) +} + +func (*StoryInfo) GetClass() string { + return ClassStoryInfo +} + +func (*StoryInfo) GetType() string { + return TypeStoryInfo +} + +// Describes active stories posted by a chat +type ChatActiveStories struct { + meta + // Identifier of the chat that posted the stories + ChatId int64 `json:"chat_id"` + // Identifier of the story list in which the stories are shown; may be null if the stories aren't shown in a story list + List StoryList `json:"list"` + // A parameter used to determine order of the stories in the story list; 0 if the stories doesn't need to be shown in the story list. Stories must be sorted by the pair (order, story_sender_chat_id) in descending order + Order int64 `json:"order"` + // Identifier of the last read active story + MaxReadStoryId int32 `json:"max_read_story_id"` + // Basic information about the stories; use getStory to get full information about the stories. The stories are in a chronological order (i.e., in order of increasing story identifiers) + Stories []*StoryInfo `json:"stories"` +} + +func (entity *ChatActiveStories) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatActiveStories + + return json.Marshal((*stub)(entity)) +} + +func (*ChatActiveStories) GetClass() string { + return ClassChatActiveStories +} + +func (*ChatActiveStories) GetType() string { + return TypeChatActiveStories +} + +func (chatActiveStories *ChatActiveStories) UnmarshalJSON(data []byte) error { + var tmp struct { + ChatId int64 `json:"chat_id"` + List json.RawMessage `json:"list"` + Order int64 `json:"order"` + MaxReadStoryId int32 `json:"max_read_story_id"` + Stories []*StoryInfo `json:"stories"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + chatActiveStories.ChatId = tmp.ChatId + chatActiveStories.Order = tmp.Order + chatActiveStories.MaxReadStoryId = tmp.MaxReadStoryId + chatActiveStories.Stories = tmp.Stories + + fieldList, _ := UnmarshalStoryList(tmp.List) + chatActiveStories.List = fieldList + + return nil +} + +// A view of the story +type StoryInteractionTypeView struct { + meta + // Type of the reaction that was chosen by the viewer; may be null if none + ChosenReactionType ReactionType `json:"chosen_reaction_type"` +} + +func (entity *StoryInteractionTypeView) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryInteractionTypeView + + return json.Marshal((*stub)(entity)) +} + +func (*StoryInteractionTypeView) GetClass() string { + return ClassStoryInteractionType +} + +func (*StoryInteractionTypeView) GetType() string { + return TypeStoryInteractionTypeView +} + +func (*StoryInteractionTypeView) StoryInteractionTypeType() string { + return TypeStoryInteractionTypeView +} + +func (storyInteractionTypeView *StoryInteractionTypeView) UnmarshalJSON(data []byte) error { + var tmp struct { + ChosenReactionType json.RawMessage `json:"chosen_reaction_type"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldChosenReactionType, _ := UnmarshalReactionType(tmp.ChosenReactionType) + storyInteractionTypeView.ChosenReactionType = fieldChosenReactionType + + return nil +} + +// A forward of the story as a message +type StoryInteractionTypeForward struct { + meta + // The message with story forward + Message *Message `json:"message"` +} + +func (entity *StoryInteractionTypeForward) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryInteractionTypeForward + + return json.Marshal((*stub)(entity)) +} + +func (*StoryInteractionTypeForward) GetClass() string { + return ClassStoryInteractionType +} + +func (*StoryInteractionTypeForward) GetType() string { + return TypeStoryInteractionTypeForward +} + +func (*StoryInteractionTypeForward) StoryInteractionTypeType() string { + return TypeStoryInteractionTypeForward +} + +// A repost of the story as a story +type StoryInteractionTypeRepost struct { + meta + // The reposted story + Story *Story `json:"story"` +} + +func (entity *StoryInteractionTypeRepost) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryInteractionTypeRepost + + return json.Marshal((*stub)(entity)) +} + +func (*StoryInteractionTypeRepost) GetClass() string { + return ClassStoryInteractionType +} + +func (*StoryInteractionTypeRepost) GetType() string { + return TypeStoryInteractionTypeRepost +} + +func (*StoryInteractionTypeRepost) StoryInteractionTypeType() string { + return TypeStoryInteractionTypeRepost +} + +// Represents interaction with a story +type StoryInteraction struct { + meta + // Identifier of the user or chat that made the interaction + ActorId MessageSender `json:"actor_id"` + // Approximate point in time (Unix timestamp) when the interaction happened + InteractionDate int32 `json:"interaction_date"` + // Block list to which the actor is added; may be null if none or for chat stories + BlockList BlockList `json:"block_list"` + // Type of the interaction + Type StoryInteractionType `json:"type"` +} + +func (entity *StoryInteraction) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryInteraction + + return json.Marshal((*stub)(entity)) +} + +func (*StoryInteraction) GetClass() string { + return ClassStoryInteraction +} + +func (*StoryInteraction) GetType() string { + return TypeStoryInteraction +} + +func (storyInteraction *StoryInteraction) UnmarshalJSON(data []byte) error { + var tmp struct { + ActorId json.RawMessage `json:"actor_id"` + InteractionDate int32 `json:"interaction_date"` + BlockList json.RawMessage `json:"block_list"` + Type json.RawMessage `json:"type"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + storyInteraction.InteractionDate = tmp.InteractionDate + + fieldActorId, _ := UnmarshalMessageSender(tmp.ActorId) + storyInteraction.ActorId = fieldActorId + + fieldBlockList, _ := UnmarshalBlockList(tmp.BlockList) + storyInteraction.BlockList = fieldBlockList + + fieldType, _ := UnmarshalStoryInteractionType(tmp.Type) + storyInteraction.Type = fieldType + + return nil +} + +// Represents a list of interactions with a story +type StoryInteractions struct { + meta + // Approximate total number of interactions found + TotalCount int32 `json:"total_count"` + // Approximate total number of found forwards and reposts; always 0 for chat stories + TotalForwardCount int32 `json:"total_forward_count"` + // Approximate total number of found reactions; always 0 for chat stories + TotalReactionCount int32 `json:"total_reaction_count"` + // List of story interactions + Interactions []*StoryInteraction `json:"interactions"` + // The offset for the next request. If empty, then there are no more results + NextOffset string `json:"next_offset"` +} + +func (entity *StoryInteractions) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryInteractions + + return json.Marshal((*stub)(entity)) +} + +func (*StoryInteractions) GetClass() string { + return ClassStoryInteractions +} + +func (*StoryInteractions) GetType() string { + return TypeStoryInteractions +} + +// Describes a message that can be used for quick reply +type QuickReplyMessage struct { + meta + // Unique message identifier among all quick replies + Id int64 `json:"id"` + // The sending state of the message; may be null if the message isn't being sent and didn't fail to be sent + SendingState MessageSendingState `json:"sending_state"` + // True, if the message can be edited + CanBeEdited bool `json:"can_be_edited"` + // Information about the identifier of the quick reply message to which the message replies + ReplyToMessageId int64 `json:"reply_to_message_id"` + // If non-zero, the user identifier of the bot through which this message was sent + ViaBotUserId int64 `json:"via_bot_user_id"` + // 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"` + // Content of the message + Content MessageContent `json:"content"` + // Inline keyboard reply markup for the message; may be null if none + ReplyMarkup ReplyMarkup `json:"reply_markup"` +} + +func (entity *QuickReplyMessage) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub QuickReplyMessage + + return json.Marshal((*stub)(entity)) +} + +func (*QuickReplyMessage) GetClass() string { + return ClassQuickReplyMessage +} + +func (*QuickReplyMessage) GetType() string { + return TypeQuickReplyMessage +} + +func (quickReplyMessage *QuickReplyMessage) UnmarshalJSON(data []byte) error { + var tmp struct { + Id int64 `json:"id"` + SendingState json.RawMessage `json:"sending_state"` + CanBeEdited bool `json:"can_be_edited"` + ReplyToMessageId int64 `json:"reply_to_message_id"` + ViaBotUserId int64 `json:"via_bot_user_id"` + MediaAlbumId JsonInt64 `json:"media_album_id"` + Content json.RawMessage `json:"content"` + ReplyMarkup json.RawMessage `json:"reply_markup"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + quickReplyMessage.Id = tmp.Id + quickReplyMessage.CanBeEdited = tmp.CanBeEdited + quickReplyMessage.ReplyToMessageId = tmp.ReplyToMessageId + quickReplyMessage.ViaBotUserId = tmp.ViaBotUserId + quickReplyMessage.MediaAlbumId = tmp.MediaAlbumId + + fieldSendingState, _ := UnmarshalMessageSendingState(tmp.SendingState) + quickReplyMessage.SendingState = fieldSendingState + + fieldContent, _ := UnmarshalMessageContent(tmp.Content) + quickReplyMessage.Content = fieldContent + + fieldReplyMarkup, _ := UnmarshalReplyMarkup(tmp.ReplyMarkup) + quickReplyMessage.ReplyMarkup = fieldReplyMarkup + + return nil +} + +// Describes a shortcut that can be used for a quick reply +type QuickReplyShortcut struct { + meta + // Unique shortcut identifier + Id int32 `json:"id"` + // The name of the shortcut that can be used to use the shortcut + Name string `json:"name"` + // The first shortcut message + FirstMessage *QuickReplyMessage `json:"first_message"` + // The total number of messages in the shortcut + MessageCount int32 `json:"message_count"` +} + +func (entity *QuickReplyShortcut) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub QuickReplyShortcut + + return json.Marshal((*stub)(entity)) +} + +func (*QuickReplyShortcut) GetClass() string { + return ClassQuickReplyShortcut +} + +func (*QuickReplyShortcut) GetType() string { + return TypeQuickReplyShortcut +} + +// Contains a public forward as a message +type PublicForwardMessage struct { + meta + // Information about the message + Message *Message `json:"message"` +} + +func (entity *PublicForwardMessage) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PublicForwardMessage + + return json.Marshal((*stub)(entity)) +} + +func (*PublicForwardMessage) GetClass() string { + return ClassPublicForward +} + +func (*PublicForwardMessage) GetType() string { + return TypePublicForwardMessage +} + +func (*PublicForwardMessage) PublicForwardType() string { + return TypePublicForwardMessage +} + +// Contains a public repost to a story +type PublicForwardStory struct { + meta + // Information about the story + Story *Story `json:"story"` +} + +func (entity *PublicForwardStory) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PublicForwardStory + + return json.Marshal((*stub)(entity)) +} + +func (*PublicForwardStory) GetClass() string { + return ClassPublicForward +} + +func (*PublicForwardStory) GetType() string { + return TypePublicForwardStory +} + +func (*PublicForwardStory) PublicForwardType() string { + return TypePublicForwardStory +} + +// Represents a list of public forwards and reposts as a story of a message or a story +type PublicForwards struct { + meta + // Approximate total number of messages and stories found + TotalCount int32 `json:"total_count"` + // List of found public forwards and reposts + Forwards []PublicForward `json:"forwards"` + // The offset for the next request. If empty, then there are no more results + NextOffset string `json:"next_offset"` +} + +func (entity *PublicForwards) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PublicForwards + + return json.Marshal((*stub)(entity)) +} + +func (*PublicForwards) GetClass() string { + return ClassPublicForwards +} + +func (*PublicForwards) GetType() string { + return TypePublicForwards +} + +func (publicForwards *PublicForwards) UnmarshalJSON(data []byte) error { + var tmp struct { + TotalCount int32 `json:"total_count"` + Forwards []json.RawMessage `json:"forwards"` + NextOffset string `json:"next_offset"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + publicForwards.TotalCount = tmp.TotalCount + publicForwards.NextOffset = tmp.NextOffset + + fieldForwards, _ := UnmarshalListOfPublicForward(tmp.Forwards) + publicForwards.Forwards = fieldForwards + + return nil +} + +// Contains a list of features available on a specific chat boost level +type ChatBoostLevelFeatures struct { + meta + // Target chat boost level + Level int32 `json:"level"` + // Number of stories that the chat can publish daily + StoryPerDayCount int32 `json:"story_per_day_count"` + // Number of custom emoji reactions that can be added to the list of available reactions + CustomEmojiReactionCount int32 `json:"custom_emoji_reaction_count"` + // Number of custom colors for chat title + TitleColorCount int32 `json:"title_color_count"` + // Number of custom colors for profile photo background + ProfileAccentColorCount int32 `json:"profile_accent_color_count"` + // True, if custom emoji for profile background can be set + CanSetProfileBackgroundCustomEmoji bool `json:"can_set_profile_background_custom_emoji"` + // Number of custom colors for background of empty chat photo, replies to messages and link previews + AccentColorCount int32 `json:"accent_color_count"` + // True, if custom emoji for reply header and link preview background can be set + CanSetBackgroundCustomEmoji bool `json:"can_set_background_custom_emoji"` + // True, if emoji status can be set + CanSetEmojiStatus bool `json:"can_set_emoji_status"` + // Number of chat theme backgrounds that can be set as chat background + ChatThemeBackgroundCount int32 `json:"chat_theme_background_count"` + // True, if custom background can be set in the chat for all users + CanSetCustomBackground bool `json:"can_set_custom_background"` + // True, if custom emoji sticker set can be set for the chat + CanSetCustomEmojiStickerSet bool `json:"can_set_custom_emoji_sticker_set"` + // True, if speech recognition can be used for video note and voice note messages by all users + CanRecognizeSpeech bool `json:"can_recognize_speech"` +} + +func (entity *ChatBoostLevelFeatures) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatBoostLevelFeatures + + return json.Marshal((*stub)(entity)) +} + +func (*ChatBoostLevelFeatures) GetClass() string { + return ClassChatBoostLevelFeatures +} + +func (*ChatBoostLevelFeatures) GetType() string { + return TypeChatBoostLevelFeatures +} + +// Contains a list of features available on the first chat boost levels +type ChatBoostFeatures struct { + meta + // The list of features + Features []*ChatBoostLevelFeatures `json:"features"` + // The minimum boost level required to set custom emoji for profile background + MinProfileBackgroundCustomEmojiBoostLevel int32 `json:"min_profile_background_custom_emoji_boost_level"` + // The minimum boost level required to set custom emoji for reply header and link preview background; for channel chats only + MinBackgroundCustomEmojiBoostLevel int32 `json:"min_background_custom_emoji_boost_level"` + // The minimum boost level required to set emoji status + MinEmojiStatusBoostLevel int32 `json:"min_emoji_status_boost_level"` + // The minimum boost level required to set a chat theme background as chat background + MinChatThemeBackgroundBoostLevel int32 `json:"min_chat_theme_background_boost_level"` + // The minimum boost level required to set custom chat background + MinCustomBackgroundBoostLevel int32 `json:"min_custom_background_boost_level"` + // The minimum boost level required to set custom emoji sticker set for the chat; for supergroup chats only + MinCustomEmojiStickerSetBoostLevel int32 `json:"min_custom_emoji_sticker_set_boost_level"` + // The minimum boost level allowing to recognize speech in video note and voice note messages for non-Premium users; for supergroup chats only + MinSpeechRecognitionBoostLevel int32 `json:"min_speech_recognition_boost_level"` +} + +func (entity *ChatBoostFeatures) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatBoostFeatures + + return json.Marshal((*stub)(entity)) +} + +func (*ChatBoostFeatures) GetClass() string { + return ClassChatBoostFeatures +} + +func (*ChatBoostFeatures) GetType() string { + return TypeChatBoostFeatures +} + +// The chat created a Telegram Premium gift code for a user +type ChatBoostSourceGiftCode struct { + meta + // Identifier of a user, for which the gift code was created + UserId int64 `json:"user_id"` + // The created Telegram Premium gift code, which is known only if this is a gift code for the current user, or it has already been claimed + GiftCode string `json:"gift_code"` +} + +func (entity *ChatBoostSourceGiftCode) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatBoostSourceGiftCode + + return json.Marshal((*stub)(entity)) +} + +func (*ChatBoostSourceGiftCode) GetClass() string { + return ClassChatBoostSource +} + +func (*ChatBoostSourceGiftCode) GetType() string { + return TypeChatBoostSourceGiftCode +} + +func (*ChatBoostSourceGiftCode) ChatBoostSourceType() string { + return TypeChatBoostSourceGiftCode +} + +// The chat created a Telegram Premium giveaway +type ChatBoostSourceGiveaway struct { + meta + // Identifier of a user that won in the giveaway; 0 if none + UserId int64 `json:"user_id"` + // The created Telegram Premium gift code if it was used by the user or can be claimed by the current user; an empty string otherwise + GiftCode string `json:"gift_code"` + // Identifier of the corresponding giveaway message; can be an identifier of a deleted message + GiveawayMessageId int64 `json:"giveaway_message_id"` + // True, if the winner for the corresponding Telegram Premium subscription wasn't chosen, because there were not enough participants + IsUnclaimed bool `json:"is_unclaimed"` +} + +func (entity *ChatBoostSourceGiveaway) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatBoostSourceGiveaway + + return json.Marshal((*stub)(entity)) +} + +func (*ChatBoostSourceGiveaway) GetClass() string { + return ClassChatBoostSource +} + +func (*ChatBoostSourceGiveaway) GetType() string { + return TypeChatBoostSourceGiveaway +} + +func (*ChatBoostSourceGiveaway) ChatBoostSourceType() string { + return TypeChatBoostSourceGiveaway +} + +// A user with Telegram Premium subscription or gifted Telegram Premium boosted the chat +type ChatBoostSourcePremium struct { + meta + // Identifier of the user + UserId int64 `json:"user_id"` +} + +func (entity *ChatBoostSourcePremium) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatBoostSourcePremium + + return json.Marshal((*stub)(entity)) +} + +func (*ChatBoostSourcePremium) GetClass() string { + return ClassChatBoostSource +} + +func (*ChatBoostSourcePremium) GetType() string { + return TypeChatBoostSourcePremium +} + +func (*ChatBoostSourcePremium) ChatBoostSourceType() string { + return TypeChatBoostSourcePremium +} + +// Describes a prepaid Telegram Premium giveaway +type PrepaidPremiumGiveaway struct { + meta + // Unique identifier of the prepaid giveaway + Id JsonInt64 `json:"id"` + // Number of users which will receive Telegram Premium subscription gift codes + WinnerCount int32 `json:"winner_count"` + // Number of months the Telegram Premium subscription will be active after code activation + MonthCount int32 `json:"month_count"` + // Point in time (Unix timestamp) when the giveaway was paid + PaymentDate int32 `json:"payment_date"` +} + +func (entity *PrepaidPremiumGiveaway) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PrepaidPremiumGiveaway + + return json.Marshal((*stub)(entity)) +} + +func (*PrepaidPremiumGiveaway) GetClass() string { + return ClassPrepaidPremiumGiveaway +} + +func (*PrepaidPremiumGiveaway) GetType() string { + return TypePrepaidPremiumGiveaway +} + +// Describes current boost status of a chat +type ChatBoostStatus struct { + meta + // An HTTP URL, which can be used to boost the chat + BoostUrl string `json:"boost_url"` + // Identifiers of boost slots of the current user applied to the chat + AppliedSlotIds []int32 `json:"applied_slot_ids"` + // Current boost level of the chat + Level int32 `json:"level"` + // The number of boosts received by the chat from created Telegram Premium gift codes and giveaways; always 0 if the current user isn't an administrator in the chat + GiftCodeBoostCount int32 `json:"gift_code_boost_count"` + // The number of boosts received by the chat + BoostCount int32 `json:"boost_count"` + // The number of boosts added to reach the current level + CurrentLevelBoostCount int32 `json:"current_level_boost_count"` + // The number of boosts needed to reach the next level; 0 if the next level isn't available + NextLevelBoostCount int32 `json:"next_level_boost_count"` + // Approximate number of Telegram Premium subscribers joined the chat; always 0 if the current user isn't an administrator in the chat + PremiumMemberCount int32 `json:"premium_member_count"` + // A percentage of Telegram Premium subscribers joined the chat; always 0 if the current user isn't an administrator in the chat + PremiumMemberPercentage float64 `json:"premium_member_percentage"` + // The list of prepaid giveaways available for the chat; only for chat administrators + PrepaidGiveaways []*PrepaidPremiumGiveaway `json:"prepaid_giveaways"` +} + +func (entity *ChatBoostStatus) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatBoostStatus + + return json.Marshal((*stub)(entity)) +} + +func (*ChatBoostStatus) GetClass() string { + return ClassChatBoostStatus +} + +func (*ChatBoostStatus) GetType() string { + return TypeChatBoostStatus +} + +// Describes a boost applied to a chat +type ChatBoost struct { + meta + // Unique identifier of the boost + Id string `json:"id"` + // The number of identical boosts applied + Count int32 `json:"count"` + // Source of the boost + Source ChatBoostSource `json:"source"` + // Point in time (Unix timestamp) when the chat was boosted + StartDate int32 `json:"start_date"` + // Point in time (Unix timestamp) when the boost will expire + ExpirationDate int32 `json:"expiration_date"` +} + +func (entity *ChatBoost) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatBoost + + return json.Marshal((*stub)(entity)) +} + +func (*ChatBoost) GetClass() string { + return ClassChatBoost +} + +func (*ChatBoost) GetType() string { + return TypeChatBoost +} + +func (chatBoost *ChatBoost) UnmarshalJSON(data []byte) error { + var tmp struct { + Id string `json:"id"` + Count int32 `json:"count"` + Source json.RawMessage `json:"source"` + StartDate int32 `json:"start_date"` + ExpirationDate int32 `json:"expiration_date"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + chatBoost.Id = tmp.Id + chatBoost.Count = tmp.Count + chatBoost.StartDate = tmp.StartDate + chatBoost.ExpirationDate = tmp.ExpirationDate + + fieldSource, _ := UnmarshalChatBoostSource(tmp.Source) + chatBoost.Source = fieldSource + + return nil +} + +// Contains a list of boosts applied to a chat +type FoundChatBoosts struct { + meta + // Total number of boosts applied to the chat + TotalCount int32 `json:"total_count"` + // List of boosts + Boosts []*ChatBoost `json:"boosts"` + // The offset for the next request. If empty, then there are no more results + NextOffset string `json:"next_offset"` +} + +func (entity *FoundChatBoosts) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub FoundChatBoosts + + return json.Marshal((*stub)(entity)) +} + +func (*FoundChatBoosts) GetClass() string { + return ClassFoundChatBoosts +} + +func (*FoundChatBoosts) GetType() string { + return TypeFoundChatBoosts +} + +// Describes a slot for chat boost +type ChatBoostSlot struct { + meta + // Unique identifier of the slot + SlotId int32 `json:"slot_id"` + // Identifier of the currently boosted chat; 0 if none + CurrentlyBoostedChatId int64 `json:"currently_boosted_chat_id"` + // Point in time (Unix timestamp) when the chat was boosted; 0 if none + StartDate int32 `json:"start_date"` + // Point in time (Unix timestamp) when the boost will expire + ExpirationDate int32 `json:"expiration_date"` + // Point in time (Unix timestamp) after which the boost can be used for another chat + CooldownUntilDate int32 `json:"cooldown_until_date"` +} + +func (entity *ChatBoostSlot) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatBoostSlot + + return json.Marshal((*stub)(entity)) +} + +func (*ChatBoostSlot) GetClass() string { + return ClassChatBoostSlot +} + +func (*ChatBoostSlot) GetType() string { + return TypeChatBoostSlot +} + +// Contains a list of chat boost slots +type ChatBoostSlots struct { + meta + // List of boost slots + Slots []*ChatBoostSlot `json:"slots"` +} + +func (entity *ChatBoostSlots) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatBoostSlots + + return json.Marshal((*stub)(entity)) +} + +func (*ChatBoostSlots) GetClass() string { + return ClassChatBoostSlots +} + +func (*ChatBoostSlots) GetType() string { + return TypeChatBoostSlots +} + +// The call wasn't discarded, or the reason is unknown +type CallDiscardReasonEmpty struct{ + meta +} + +func (entity *CallDiscardReasonEmpty) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CallDiscardReasonEmpty + + return json.Marshal((*stub)(entity)) +} + +func (*CallDiscardReasonEmpty) GetClass() string { + return ClassCallDiscardReason +} + +func (*CallDiscardReasonEmpty) GetType() string { + return TypeCallDiscardReasonEmpty +} + +func (*CallDiscardReasonEmpty) CallDiscardReasonType() string { + return TypeCallDiscardReasonEmpty +} + +// The call was ended before the conversation started. It was canceled by the caller or missed by the other party +type CallDiscardReasonMissed struct{ + meta +} + +func (entity *CallDiscardReasonMissed) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CallDiscardReasonMissed + + return json.Marshal((*stub)(entity)) +} + +func (*CallDiscardReasonMissed) GetClass() string { + return ClassCallDiscardReason +} + +func (*CallDiscardReasonMissed) GetType() string { + return TypeCallDiscardReasonMissed +} + +func (*CallDiscardReasonMissed) CallDiscardReasonType() string { + return TypeCallDiscardReasonMissed +} + +// The call was ended before the conversation started. It was declined by the other party +type CallDiscardReasonDeclined struct{ + meta +} + +func (entity *CallDiscardReasonDeclined) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CallDiscardReasonDeclined + + return json.Marshal((*stub)(entity)) +} + +func (*CallDiscardReasonDeclined) GetClass() string { + return ClassCallDiscardReason +} + +func (*CallDiscardReasonDeclined) GetType() string { + return TypeCallDiscardReasonDeclined +} + +func (*CallDiscardReasonDeclined) CallDiscardReasonType() string { + return TypeCallDiscardReasonDeclined +} + +// The call was ended during the conversation because the users were disconnected +type CallDiscardReasonDisconnected struct{ + meta +} + +func (entity *CallDiscardReasonDisconnected) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CallDiscardReasonDisconnected + + return json.Marshal((*stub)(entity)) +} + +func (*CallDiscardReasonDisconnected) GetClass() string { + return ClassCallDiscardReason +} + +func (*CallDiscardReasonDisconnected) GetType() string { + return TypeCallDiscardReasonDisconnected +} + +func (*CallDiscardReasonDisconnected) CallDiscardReasonType() string { + return TypeCallDiscardReasonDisconnected +} + +// The call was ended because one of the parties hung up +type CallDiscardReasonHungUp struct{ + meta +} + +func (entity *CallDiscardReasonHungUp) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CallDiscardReasonHungUp + + return json.Marshal((*stub)(entity)) +} + +func (*CallDiscardReasonHungUp) GetClass() string { + return ClassCallDiscardReason +} + +func (*CallDiscardReasonHungUp) GetType() string { + return TypeCallDiscardReasonHungUp +} + +func (*CallDiscardReasonHungUp) CallDiscardReasonType() string { + return TypeCallDiscardReasonHungUp +} + +// Specifies the supported call protocols +type CallProtocol struct { + 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 92 + MaxLayer int32 `json:"max_layer"` + // List of supported tgcalls versions + LibraryVersions []string `json:"library_versions"` +} + +func (entity *CallProtocol) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CallProtocol + + return json.Marshal((*stub)(entity)) +} + +func (*CallProtocol) GetClass() string { + return ClassCallProtocol +} + +func (*CallProtocol) GetType() string { + return TypeCallProtocol +} + +// A Telegram call reflector +type CallServerTypeTelegramReflector struct { + meta + // A peer tag to be used with the reflector + PeerTag []byte `json:"peer_tag"` + // True, if the server uses TCP instead of UDP + IsTcp bool `json:"is_tcp"` +} + +func (entity *CallServerTypeTelegramReflector) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CallServerTypeTelegramReflector + + return json.Marshal((*stub)(entity)) +} + +func (*CallServerTypeTelegramReflector) GetClass() string { + return ClassCallServerType +} + +func (*CallServerTypeTelegramReflector) GetType() string { + return TypeCallServerTypeTelegramReflector +} + +func (*CallServerTypeTelegramReflector) CallServerTypeType() string { + return TypeCallServerTypeTelegramReflector +} + +// A WebRTC server +type CallServerTypeWebrtc struct { + 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"` +} + +func (entity *CallServerTypeWebrtc) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CallServerTypeWebrtc + + return json.Marshal((*stub)(entity)) +} + +func (*CallServerTypeWebrtc) GetClass() string { + return ClassCallServerType +} + +func (*CallServerTypeWebrtc) GetType() string { + return TypeCallServerTypeWebrtc +} + +func (*CallServerTypeWebrtc) CallServerTypeType() string { + return TypeCallServerTypeWebrtc +} + +// Describes a server for relaying call data +type CallServer struct { + 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"` +} + +func (entity *CallServer) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CallServer + + return json.Marshal((*stub)(entity)) +} + +func (*CallServer) GetClass() string { + return ClassCallServer +} + +func (*CallServer) GetType() string { + return TypeCallServer +} + +func (callServer *CallServer) UnmarshalJSON(data []byte) error { + 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"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + callServer.Id = tmp.Id + callServer.IpAddress = tmp.IpAddress + callServer.Ipv6Address = tmp.Ipv6Address + callServer.Port = tmp.Port + + fieldType, _ := UnmarshalCallServerType(tmp.Type) + callServer.Type = fieldType + + return nil +} + +// Contains the call identifier +type CallId struct { + meta + // Call identifier + Id int32 `json:"id"` +} + +func (entity *CallId) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CallId + + return json.Marshal((*stub)(entity)) +} + +func (*CallId) GetClass() string { + return ClassCallId +} + +func (*CallId) GetType() string { + return TypeCallId +} + +// Contains the group call identifier +type GroupCallId struct { + meta + // Group call identifier + Id int32 `json:"id"` +} + +func (entity *GroupCallId) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub GroupCallId + + return json.Marshal((*stub)(entity)) +} + +func (*GroupCallId) GetClass() string { + return ClassGroupCallId +} + +func (*GroupCallId) GetType() string { + return TypeGroupCallId +} + +// The call is pending, waiting to be accepted by a user +type CallStatePending struct { + 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"` +} + +func (entity *CallStatePending) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CallStatePending + + return json.Marshal((*stub)(entity)) +} + +func (*CallStatePending) GetClass() string { + return ClassCallState +} + +func (*CallStatePending) GetType() string { + return TypeCallStatePending +} + +func (*CallStatePending) CallStateType() string { + return TypeCallStatePending +} + +// The call has been answered and encryption keys are being exchanged +type CallStateExchangingKeys struct{ + meta +} + +func (entity *CallStateExchangingKeys) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CallStateExchangingKeys + + return json.Marshal((*stub)(entity)) +} + +func (*CallStateExchangingKeys) GetClass() string { + return ClassCallState +} + +func (*CallStateExchangingKeys) GetType() string { + return TypeCallStateExchangingKeys +} + +func (*CallStateExchangingKeys) CallStateType() string { + return TypeCallStateExchangingKeys +} + +// The call is ready to use +type CallStateReady struct { + meta + // Call protocols supported by the other call participant + 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"` +} + +func (entity *CallStateReady) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CallStateReady + + return json.Marshal((*stub)(entity)) +} + +func (*CallStateReady) GetClass() string { + return ClassCallState +} + +func (*CallStateReady) GetType() string { + return TypeCallStateReady +} + +func (*CallStateReady) CallStateType() string { + return TypeCallStateReady +} + +// The call is hanging up after discardCall has been called +type CallStateHangingUp struct{ + meta +} + +func (entity *CallStateHangingUp) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CallStateHangingUp + + return json.Marshal((*stub)(entity)) +} + +func (*CallStateHangingUp) GetClass() string { + return ClassCallState +} + +func (*CallStateHangingUp) GetType() string { + return TypeCallStateHangingUp +} + +func (*CallStateHangingUp) CallStateType() string { + return TypeCallStateHangingUp +} + +// The call has ended successfully +type CallStateDiscarded struct { + 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"` + // True, if the call log must be sent to the server + NeedLog bool `json:"need_log"` +} + +func (entity *CallStateDiscarded) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CallStateDiscarded + + return json.Marshal((*stub)(entity)) +} + +func (*CallStateDiscarded) GetClass() string { + return ClassCallState +} + +func (*CallStateDiscarded) GetType() string { + return TypeCallStateDiscarded +} + +func (*CallStateDiscarded) CallStateType() string { + return TypeCallStateDiscarded +} + +func (callStateDiscarded *CallStateDiscarded) UnmarshalJSON(data []byte) error { + var tmp struct { + Reason json.RawMessage `json:"reason"` + NeedRating bool `json:"need_rating"` + NeedDebugInformation bool `json:"need_debug_information"` + NeedLog bool `json:"need_log"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + callStateDiscarded.NeedRating = tmp.NeedRating + callStateDiscarded.NeedDebugInformation = tmp.NeedDebugInformation + callStateDiscarded.NeedLog = tmp.NeedLog + + fieldReason, _ := UnmarshalCallDiscardReason(tmp.Reason) + callStateDiscarded.Reason = fieldReason + + return nil +} + +// The call has ended with an error +type CallStateError struct { + 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"` +} + +func (entity *CallStateError) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CallStateError + + return json.Marshal((*stub)(entity)) +} + +func (*CallStateError) GetClass() string { + return ClassCallState +} + +func (*CallStateError) GetType() string { + return TypeCallStateError +} + +func (*CallStateError) CallStateType() string { + return TypeCallStateError +} + +// The worst available video quality +type GroupCallVideoQualityThumbnail struct{ + meta +} + +func (entity *GroupCallVideoQualityThumbnail) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub GroupCallVideoQualityThumbnail + + return json.Marshal((*stub)(entity)) +} + +func (*GroupCallVideoQualityThumbnail) GetClass() string { + return ClassGroupCallVideoQuality +} + +func (*GroupCallVideoQualityThumbnail) GetType() string { + return TypeGroupCallVideoQualityThumbnail +} + +func (*GroupCallVideoQualityThumbnail) GroupCallVideoQualityType() string { + return TypeGroupCallVideoQualityThumbnail +} + +// The medium video quality +type GroupCallVideoQualityMedium struct{ + meta +} + +func (entity *GroupCallVideoQualityMedium) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub GroupCallVideoQualityMedium + + return json.Marshal((*stub)(entity)) +} + +func (*GroupCallVideoQualityMedium) GetClass() string { + return ClassGroupCallVideoQuality +} + +func (*GroupCallVideoQualityMedium) GetType() string { + return TypeGroupCallVideoQualityMedium +} + +func (*GroupCallVideoQualityMedium) GroupCallVideoQualityType() string { + return TypeGroupCallVideoQualityMedium +} + +// The best available video quality +type GroupCallVideoQualityFull struct{ + meta +} + +func (entity *GroupCallVideoQualityFull) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub GroupCallVideoQualityFull + + return json.Marshal((*stub)(entity)) +} + +func (*GroupCallVideoQualityFull) GetClass() string { + return ClassGroupCallVideoQuality +} + +func (*GroupCallVideoQualityFull) GetType() string { + return TypeGroupCallVideoQualityFull +} + +func (*GroupCallVideoQualityFull) GroupCallVideoQualityType() string { + 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 +} + +// Describes a recently speaking participant in a group call +type GroupCallRecentSpeaker struct { + meta + // Group call participant identifier + ParticipantId MessageSender `json:"participant_id"` + // True, is the user has spoken recently + IsSpeaking bool `json:"is_speaking"` +} + +func (entity *GroupCallRecentSpeaker) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub GroupCallRecentSpeaker + + return json.Marshal((*stub)(entity)) +} + +func (*GroupCallRecentSpeaker) GetClass() string { + return ClassGroupCallRecentSpeaker +} + +func (*GroupCallRecentSpeaker) GetType() string { + return TypeGroupCallRecentSpeaker +} + +func (groupCallRecentSpeaker *GroupCallRecentSpeaker) UnmarshalJSON(data []byte) error { + var tmp struct { + ParticipantId json.RawMessage `json:"participant_id"` + IsSpeaking bool `json:"is_speaking"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + groupCallRecentSpeaker.IsSpeaking = tmp.IsSpeaking + + fieldParticipantId, _ := UnmarshalMessageSender(tmp.ParticipantId) + groupCallRecentSpeaker.ParticipantId = fieldParticipantId + + return nil +} + +// Describes a group call +type GroupCall struct { + 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 starts + 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"` +} + +func (entity *GroupCall) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub GroupCall + + return json.Marshal((*stub)(entity)) +} + +func (*GroupCall) GetClass() string { + return ClassGroupCall +} + +func (*GroupCall) GetType() string { + return TypeGroupCall +} + +// Describes a group of video synchronization source identifiers +type GroupCallVideoSourceGroup struct { + 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"` +} + +func (entity *GroupCallVideoSourceGroup) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub GroupCallVideoSourceGroup + + return json.Marshal((*stub)(entity)) +} + +func (*GroupCallVideoSourceGroup) GetClass() string { + return ClassGroupCallVideoSourceGroup +} + +func (*GroupCallVideoSourceGroup) GetType() string { + return TypeGroupCallVideoSourceGroup +} + +// Contains information about a group call participant's video channel +type GroupCallParticipantVideoInfo struct { + 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"` +} + +func (entity *GroupCallParticipantVideoInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub GroupCallParticipantVideoInfo + + return json.Marshal((*stub)(entity)) +} + +func (*GroupCallParticipantVideoInfo) GetClass() string { + return ClassGroupCallParticipantVideoInfo +} + +func (*GroupCallParticipantVideoInfo) GetType() string { + return TypeGroupCallParticipantVideoInfo +} + +// Represents a group call participant +type GroupCallParticipant struct { + 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"` +} + +func (entity *GroupCallParticipant) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub GroupCallParticipant + + return json.Marshal((*stub)(entity)) +} + +func (*GroupCallParticipant) GetClass() string { + return ClassGroupCallParticipant +} + +func (*GroupCallParticipant) GetType() string { + return TypeGroupCallParticipant +} + +func (groupCallParticipant *GroupCallParticipant) UnmarshalJSON(data []byte) error { + 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 +} + +// The user heard their own voice +type CallProblemEcho struct{ + meta +} + +func (entity *CallProblemEcho) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CallProblemEcho + + return json.Marshal((*stub)(entity)) +} + +func (*CallProblemEcho) GetClass() string { + return ClassCallProblem +} + +func (*CallProblemEcho) GetType() string { + return TypeCallProblemEcho +} + +func (*CallProblemEcho) CallProblemType() string { + return TypeCallProblemEcho +} + +// The user heard background noise +type CallProblemNoise struct{ + meta +} + +func (entity *CallProblemNoise) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CallProblemNoise + + return json.Marshal((*stub)(entity)) +} + +func (*CallProblemNoise) GetClass() string { + return ClassCallProblem +} + +func (*CallProblemNoise) GetType() string { + return TypeCallProblemNoise +} + +func (*CallProblemNoise) CallProblemType() string { + return TypeCallProblemNoise +} + +// The other side kept disappearing +type CallProblemInterruptions struct{ + meta +} + +func (entity *CallProblemInterruptions) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CallProblemInterruptions + + return json.Marshal((*stub)(entity)) +} + +func (*CallProblemInterruptions) GetClass() string { + return ClassCallProblem +} + +func (*CallProblemInterruptions) GetType() string { + return TypeCallProblemInterruptions +} + +func (*CallProblemInterruptions) CallProblemType() string { + return TypeCallProblemInterruptions +} + +// The speech was distorted +type CallProblemDistortedSpeech struct{ + meta +} + +func (entity *CallProblemDistortedSpeech) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CallProblemDistortedSpeech + + return json.Marshal((*stub)(entity)) +} + +func (*CallProblemDistortedSpeech) GetClass() string { + return ClassCallProblem +} + +func (*CallProblemDistortedSpeech) GetType() string { + return TypeCallProblemDistortedSpeech +} + +func (*CallProblemDistortedSpeech) CallProblemType() string { + return TypeCallProblemDistortedSpeech +} + +// The user couldn't hear the other side +type CallProblemSilentLocal struct{ + meta +} + +func (entity *CallProblemSilentLocal) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CallProblemSilentLocal + + return json.Marshal((*stub)(entity)) +} + +func (*CallProblemSilentLocal) GetClass() string { + return ClassCallProblem +} + +func (*CallProblemSilentLocal) GetType() string { + return TypeCallProblemSilentLocal +} + +func (*CallProblemSilentLocal) CallProblemType() string { + return TypeCallProblemSilentLocal +} + +// The other side couldn't hear the user +type CallProblemSilentRemote struct{ + meta +} + +func (entity *CallProblemSilentRemote) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CallProblemSilentRemote + + return json.Marshal((*stub)(entity)) +} + +func (*CallProblemSilentRemote) GetClass() string { + return ClassCallProblem +} + +func (*CallProblemSilentRemote) GetType() string { + return TypeCallProblemSilentRemote +} + +func (*CallProblemSilentRemote) CallProblemType() string { + return TypeCallProblemSilentRemote +} + +// The call ended unexpectedly +type CallProblemDropped struct{ + meta +} + +func (entity *CallProblemDropped) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CallProblemDropped + + return json.Marshal((*stub)(entity)) +} + +func (*CallProblemDropped) GetClass() string { + return ClassCallProblem +} + +func (*CallProblemDropped) GetType() string { + return TypeCallProblemDropped +} + +func (*CallProblemDropped) CallProblemType() string { + return TypeCallProblemDropped +} + +// The video was distorted +type CallProblemDistortedVideo struct{ + meta +} + +func (entity *CallProblemDistortedVideo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CallProblemDistortedVideo + + return json.Marshal((*stub)(entity)) +} + +func (*CallProblemDistortedVideo) GetClass() string { + return ClassCallProblem +} + +func (*CallProblemDistortedVideo) GetType() string { + return TypeCallProblemDistortedVideo +} + +func (*CallProblemDistortedVideo) CallProblemType() string { + return TypeCallProblemDistortedVideo +} + +// The video was pixelated +type CallProblemPixelatedVideo struct{ + meta +} + +func (entity *CallProblemPixelatedVideo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CallProblemPixelatedVideo + + return json.Marshal((*stub)(entity)) +} + +func (*CallProblemPixelatedVideo) GetClass() string { + return ClassCallProblem +} + +func (*CallProblemPixelatedVideo) GetType() string { + return TypeCallProblemPixelatedVideo +} + +func (*CallProblemPixelatedVideo) CallProblemType() string { + return TypeCallProblemPixelatedVideo +} + +// Describes a call +type Call struct { + meta + // Call identifier, not persistent + Id int32 `json:"id"` + // User identifier of the other call participant + 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"` +} + +func (entity *Call) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub Call + + return json.Marshal((*stub)(entity)) +} + +func (*Call) GetClass() string { + return ClassCall +} + +func (*Call) GetType() string { + return TypeCall +} + +func (call *Call) UnmarshalJSON(data []byte) error { + 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"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + call.Id = tmp.Id + call.UserId = tmp.UserId + call.IsOutgoing = tmp.IsOutgoing + call.IsVideo = tmp.IsVideo + + fieldState, _ := UnmarshalCallState(tmp.State) + call.State = fieldState + + return nil +} + +// Settings for Firebase Authentication in the official Android application +type FirebaseAuthenticationSettingsAndroid struct{ + meta +} + +func (entity *FirebaseAuthenticationSettingsAndroid) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub FirebaseAuthenticationSettingsAndroid + + return json.Marshal((*stub)(entity)) +} + +func (*FirebaseAuthenticationSettingsAndroid) GetClass() string { + return ClassFirebaseAuthenticationSettings +} + +func (*FirebaseAuthenticationSettingsAndroid) GetType() string { + return TypeFirebaseAuthenticationSettingsAndroid +} + +func (*FirebaseAuthenticationSettingsAndroid) FirebaseAuthenticationSettingsType() string { + return TypeFirebaseAuthenticationSettingsAndroid +} + +// Settings for Firebase Authentication in the official iOS application +type FirebaseAuthenticationSettingsIos struct { + meta + // Device token from Apple Push Notification service + DeviceToken string `json:"device_token"` + // True, if App Sandbox is enabled + IsAppSandbox bool `json:"is_app_sandbox"` +} + +func (entity *FirebaseAuthenticationSettingsIos) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub FirebaseAuthenticationSettingsIos + + return json.Marshal((*stub)(entity)) +} + +func (*FirebaseAuthenticationSettingsIos) GetClass() string { + return ClassFirebaseAuthenticationSettings +} + +func (*FirebaseAuthenticationSettingsIos) GetType() string { + return TypeFirebaseAuthenticationSettingsIos +} + +func (*FirebaseAuthenticationSettingsIos) FirebaseAuthenticationSettingsType() string { + return TypeFirebaseAuthenticationSettingsIos +} + +// Contains settings for the authentication of the user's phone number +type PhoneNumberAuthenticationSettings struct { + 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"` + // For official Android and iOS applications only; pass null otherwise. Settings for Firebase Authentication + FirebaseAuthenticationSettings FirebaseAuthenticationSettings `json:"firebase_authentication_settings"` + // List of up to 20 authentication tokens, recently received in updateOption("authentication_token") in previously logged out sessions + AuthenticationTokens []string `json:"authentication_tokens"` +} + +func (entity *PhoneNumberAuthenticationSettings) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PhoneNumberAuthenticationSettings + + return json.Marshal((*stub)(entity)) +} + +func (*PhoneNumberAuthenticationSettings) GetClass() string { + return ClassPhoneNumberAuthenticationSettings +} + +func (*PhoneNumberAuthenticationSettings) GetType() string { + return TypePhoneNumberAuthenticationSettings +} + +func (phoneNumberAuthenticationSettings *PhoneNumberAuthenticationSettings) UnmarshalJSON(data []byte) error { + var tmp struct { + AllowFlashCall bool `json:"allow_flash_call"` + AllowMissedCall bool `json:"allow_missed_call"` + IsCurrentPhoneNumber bool `json:"is_current_phone_number"` + AllowSmsRetrieverApi bool `json:"allow_sms_retriever_api"` + FirebaseAuthenticationSettings json.RawMessage `json:"firebase_authentication_settings"` + AuthenticationTokens []string `json:"authentication_tokens"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + phoneNumberAuthenticationSettings.AllowFlashCall = tmp.AllowFlashCall + phoneNumberAuthenticationSettings.AllowMissedCall = tmp.AllowMissedCall + phoneNumberAuthenticationSettings.IsCurrentPhoneNumber = tmp.IsCurrentPhoneNumber + phoneNumberAuthenticationSettings.AllowSmsRetrieverApi = tmp.AllowSmsRetrieverApi + phoneNumberAuthenticationSettings.AuthenticationTokens = tmp.AuthenticationTokens + + fieldFirebaseAuthenticationSettings, _ := UnmarshalFirebaseAuthenticationSettings(tmp.FirebaseAuthenticationSettings) + phoneNumberAuthenticationSettings.FirebaseAuthenticationSettings = fieldFirebaseAuthenticationSettings + + return nil +} + +// Represents a reaction applied to a message +type AddedReaction struct { + meta + // Type of the reaction + Type ReactionType `json:"type"` + // Identifier of the chat member, applied the reaction + SenderId MessageSender `json:"sender_id"` + // True, if the reaction was added by the current user + IsOutgoing bool `json:"is_outgoing"` + // Point in time (Unix timestamp) when the reaction was added + Date int32 `json:"date"` +} + +func (entity *AddedReaction) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub AddedReaction + + return json.Marshal((*stub)(entity)) +} + +func (*AddedReaction) GetClass() string { + return ClassAddedReaction +} + +func (*AddedReaction) GetType() string { + return TypeAddedReaction +} + +func (addedReaction *AddedReaction) UnmarshalJSON(data []byte) error { + var tmp struct { + Type json.RawMessage `json:"type"` + SenderId json.RawMessage `json:"sender_id"` + IsOutgoing bool `json:"is_outgoing"` + Date int32 `json:"date"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + addedReaction.IsOutgoing = tmp.IsOutgoing + addedReaction.Date = tmp.Date + + fieldType, _ := UnmarshalReactionType(tmp.Type) + addedReaction.Type = fieldType + + fieldSenderId, _ := UnmarshalMessageSender(tmp.SenderId) + addedReaction.SenderId = fieldSenderId + + return nil +} + +// Represents a list of reactions added to a message +type AddedReactions struct { + 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, then there are no more results + NextOffset string `json:"next_offset"` +} + +func (entity *AddedReactions) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub AddedReactions + + return json.Marshal((*stub)(entity)) +} + +func (*AddedReactions) GetClass() string { + return ClassAddedReactions +} + +func (*AddedReactions) GetType() string { + return TypeAddedReactions +} + +// Represents an available reaction +type AvailableReaction struct { + meta + // Type of the reaction + Type ReactionType `json:"type"` + // True, if Telegram Premium is needed to send the reaction + NeedsPremium bool `json:"needs_premium"` +} + +func (entity *AvailableReaction) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub AvailableReaction + + return json.Marshal((*stub)(entity)) +} + +func (*AvailableReaction) GetClass() string { + return ClassAvailableReaction +} + +func (*AvailableReaction) GetType() string { + return TypeAvailableReaction +} + +func (availableReaction *AvailableReaction) UnmarshalJSON(data []byte) error { + var tmp struct { + Type json.RawMessage `json:"type"` + NeedsPremium bool `json:"needs_premium"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + availableReaction.NeedsPremium = tmp.NeedsPremium + + fieldType, _ := UnmarshalReactionType(tmp.Type) + availableReaction.Type = fieldType + + return nil +} + +// Represents a list of reactions that can be added to a message +type AvailableReactions struct { + meta + // List of reactions to be shown at the top + TopReactions []*AvailableReaction `json:"top_reactions"` + // List of recently used reactions + RecentReactions []*AvailableReaction `json:"recent_reactions"` + // List of popular reactions + PopularReactions []*AvailableReaction `json:"popular_reactions"` + // True, if any custom emoji reaction can be added by Telegram Premium subscribers + AllowCustomEmoji bool `json:"allow_custom_emoji"` + // True, if the reactions will be tags and the message can be found by them + AreTags bool `json:"are_tags"` + // The reason why the current user can't add reactions to the message, despite some other users can; may be null if none + UnavailabilityReason ReactionUnavailabilityReason `json:"unavailability_reason"` +} + +func (entity *AvailableReactions) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub AvailableReactions + + return json.Marshal((*stub)(entity)) +} + +func (*AvailableReactions) GetClass() string { + return ClassAvailableReactions +} + +func (*AvailableReactions) GetType() string { + return TypeAvailableReactions +} + +func (availableReactions *AvailableReactions) UnmarshalJSON(data []byte) error { + var tmp struct { + TopReactions []*AvailableReaction `json:"top_reactions"` + RecentReactions []*AvailableReaction `json:"recent_reactions"` + PopularReactions []*AvailableReaction `json:"popular_reactions"` + AllowCustomEmoji bool `json:"allow_custom_emoji"` + AreTags bool `json:"are_tags"` + UnavailabilityReason json.RawMessage `json:"unavailability_reason"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + availableReactions.TopReactions = tmp.TopReactions + availableReactions.RecentReactions = tmp.RecentReactions + availableReactions.PopularReactions = tmp.PopularReactions + availableReactions.AllowCustomEmoji = tmp.AllowCustomEmoji + availableReactions.AreTags = tmp.AreTags + + fieldUnavailabilityReason, _ := UnmarshalReactionUnavailabilityReason(tmp.UnavailabilityReason) + availableReactions.UnavailabilityReason = fieldUnavailabilityReason + + return nil +} + +// Contains information about an emoji reaction +type EmojiReaction struct { + meta + // Text representation of the reaction + Emoji string `json:"emoji"` + // 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"` +} + +func (entity *EmojiReaction) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub EmojiReaction + + return json.Marshal((*stub)(entity)) +} + +func (*EmojiReaction) GetClass() string { + return ClassEmojiReaction +} + +func (*EmojiReaction) GetType() string { + return TypeEmojiReaction +} + +// The user is an anonymous administrator in the supergroup, but isn't a creator of it, so they can't vote on behalf of the supergroup +type ReactionUnavailabilityReasonAnonymousAdministrator struct{ + meta +} + +func (entity *ReactionUnavailabilityReasonAnonymousAdministrator) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ReactionUnavailabilityReasonAnonymousAdministrator + + return json.Marshal((*stub)(entity)) +} + +func (*ReactionUnavailabilityReasonAnonymousAdministrator) GetClass() string { + return ClassReactionUnavailabilityReason +} + +func (*ReactionUnavailabilityReasonAnonymousAdministrator) GetType() string { + return TypeReactionUnavailabilityReasonAnonymousAdministrator +} + +func (*ReactionUnavailabilityReasonAnonymousAdministrator) ReactionUnavailabilityReasonType() string { + return TypeReactionUnavailabilityReasonAnonymousAdministrator +} + +// The user isn't a member of the supergroup and can't send messages and reactions there without joining +type ReactionUnavailabilityReasonGuest struct{ + meta +} + +func (entity *ReactionUnavailabilityReasonGuest) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ReactionUnavailabilityReasonGuest + + return json.Marshal((*stub)(entity)) +} + +func (*ReactionUnavailabilityReasonGuest) GetClass() string { + return ClassReactionUnavailabilityReason +} + +func (*ReactionUnavailabilityReasonGuest) GetType() string { + return TypeReactionUnavailabilityReasonGuest +} + +func (*ReactionUnavailabilityReasonGuest) ReactionUnavailabilityReasonType() string { + return TypeReactionUnavailabilityReasonGuest +} + +// Represents a list of animations +type Animations struct { + meta + // List of animations + Animations []*Animation `json:"animations"` +} + +func (entity *Animations) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub Animations + + return json.Marshal((*stub)(entity)) +} + +func (*Animations) GetClass() string { + return ClassAnimations +} + +func (*Animations) GetType() string { + return TypeAnimations +} + +// A regular animated sticker +type DiceStickersRegular struct { + meta + // The animated sticker with the dice animation + Sticker *Sticker `json:"sticker"` +} + +func (entity *DiceStickersRegular) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub DiceStickersRegular + + return json.Marshal((*stub)(entity)) +} + +func (*DiceStickersRegular) GetClass() string { + return ClassDiceStickers +} + +func (*DiceStickersRegular) GetType() string { + return TypeDiceStickersRegular +} + +func (*DiceStickersRegular) DiceStickersType() string { + return TypeDiceStickersRegular +} + +// Animated stickers to be combined into a slot machine +type DiceStickersSlotMachine struct { + 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"` +} + +func (entity *DiceStickersSlotMachine) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub DiceStickersSlotMachine + + return json.Marshal((*stub)(entity)) +} + +func (*DiceStickersSlotMachine) GetClass() string { + return ClassDiceStickers +} + +func (*DiceStickersSlotMachine) GetType() string { + return TypeDiceStickersSlotMachine +} + +func (*DiceStickersSlotMachine) DiceStickersType() string { + return TypeDiceStickersSlotMachine +} + +// Represents the result of an importContacts request +type ImportedContacts struct { + 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"` +} + +func (entity *ImportedContacts) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ImportedContacts + + return json.Marshal((*stub)(entity)) +} + +func (*ImportedContacts) GetClass() string { + return ClassImportedContacts +} + +func (*ImportedContacts) GetType() string { + return TypeImportedContacts +} + +// The speech recognition is ongoing +type SpeechRecognitionResultPending struct { + meta + // Partially recognized text + PartialText string `json:"partial_text"` +} + +func (entity *SpeechRecognitionResultPending) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SpeechRecognitionResultPending + + return json.Marshal((*stub)(entity)) +} + +func (*SpeechRecognitionResultPending) GetClass() string { + return ClassSpeechRecognitionResult +} + +func (*SpeechRecognitionResultPending) GetType() string { + return TypeSpeechRecognitionResultPending +} + +func (*SpeechRecognitionResultPending) SpeechRecognitionResultType() string { + return TypeSpeechRecognitionResultPending +} + +// The speech recognition successfully finished +type SpeechRecognitionResultText struct { + meta + // Recognized text + Text string `json:"text"` +} + +func (entity *SpeechRecognitionResultText) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SpeechRecognitionResultText + + return json.Marshal((*stub)(entity)) +} + +func (*SpeechRecognitionResultText) GetClass() string { + return ClassSpeechRecognitionResult +} + +func (*SpeechRecognitionResultText) GetType() string { + return TypeSpeechRecognitionResultText +} + +func (*SpeechRecognitionResultText) SpeechRecognitionResultType() string { + return TypeSpeechRecognitionResultText +} + +// The speech recognition failed +type SpeechRecognitionResultError struct { + meta + // Recognition error. An error with a message "MSG_VOICE_TOO_LONG" is returned when media duration is too big to be recognized + Error *Error `json:"error"` +} + +func (entity *SpeechRecognitionResultError) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SpeechRecognitionResultError + + return json.Marshal((*stub)(entity)) +} + +func (*SpeechRecognitionResultError) GetClass() string { + return ClassSpeechRecognitionResult +} + +func (*SpeechRecognitionResultError) GetType() string { + return TypeSpeechRecognitionResultError +} + +func (*SpeechRecognitionResultError) SpeechRecognitionResultType() string { + return TypeSpeechRecognitionResultError +} + +// Describes a connection of the bot with a business account +type BusinessConnection struct { + meta + // Unique identifier of the connection + Id string `json:"id"` + // Identifier of the business user that created the connection + UserId int64 `json:"user_id"` + // Chat identifier of the private chat with the user + UserChatId int64 `json:"user_chat_id"` + // Point in time (Unix timestamp) when the connection was established + Date int32 `json:"date"` + // True, if the bot can send messages to the connected user; false otherwise + CanReply bool `json:"can_reply"` + // True, if the connection is enabled; false otherwise + IsEnabled bool `json:"is_enabled"` +} + +func (entity *BusinessConnection) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BusinessConnection + + return json.Marshal((*stub)(entity)) +} + +func (*BusinessConnection) GetClass() string { + return ClassBusinessConnection +} + +func (*BusinessConnection) GetType() string { + return TypeBusinessConnection +} + +// Describes a color to highlight a bot added to attachment menu +type AttachmentMenuBotColor struct { + meta + // Color in the RGB24 format for light themes + LightColor int32 `json:"light_color"` + // Color in the RGB24 format for dark themes + DarkColor int32 `json:"dark_color"` +} + +func (entity *AttachmentMenuBotColor) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub AttachmentMenuBotColor + + return json.Marshal((*stub)(entity)) +} + +func (*AttachmentMenuBotColor) GetClass() string { + return ClassAttachmentMenuBotColor +} + +func (*AttachmentMenuBotColor) GetType() string { + return TypeAttachmentMenuBotColor +} + +// Represents a bot, which can be added to attachment or side menu +type AttachmentMenuBot struct { + meta + // User identifier of the bot + BotUserId int64 `json:"bot_user_id"` + // True, if the bot supports opening from attachment menu in the chat with the bot + SupportsSelfChat bool `json:"supports_self_chat"` + // True, if the bot supports opening from attachment menu in private chats with ordinary users + SupportsUserChats bool `json:"supports_user_chats"` + // True, if the bot supports opening from attachment menu in private chats with other bots + SupportsBotChats bool `json:"supports_bot_chats"` + // True, if the bot supports opening from attachment menu in basic group and supergroup chats + SupportsGroupChats bool `json:"supports_group_chats"` + // True, if the bot supports opening from attachment menu in channel chats + SupportsChannelChats bool `json:"supports_channel_chats"` + // True, if the user must be asked for the permission to send messages to the bot + RequestWriteAccess bool `json:"request_write_access"` + // True, if the bot was explicitly added by the user. If the bot isn't added, then on the first bot launch toggleBotIsAddedToAttachmentMenu must be called and the bot must be added or removed + IsAdded bool `json:"is_added"` + // True, if the bot must be shown in the attachment menu + ShowInAttachmentMenu bool `json:"show_in_attachment_menu"` + // True, if the bot must be shown in the side menu + ShowInSideMenu bool `json:"show_in_side_menu"` + // True, if a disclaimer, why the bot is shown in the side menu, is needed + ShowDisclaimerInSideMenu bool `json:"show_disclaimer_in_side_menu"` + // Name for the bot in attachment menu + Name string `json:"name"` + // Color to highlight selected name of the bot if appropriate; may be null + NameColor *AttachmentMenuBotColor `json:"name_color"` + // Default icon for the bot in SVG format; may be null + DefaultIcon *File `json:"default_icon"` + // Icon for the bot in SVG format for the official iOS app; may be null + IosStaticIcon *File `json:"ios_static_icon"` + // Icon for the bot in TGS format for the official iOS app; may be null + IosAnimatedIcon *File `json:"ios_animated_icon"` + // Icon for the bot in PNG format for the official iOS app side menu; may be null + IosSideMenuIcon *File `json:"ios_side_menu_icon"` + // Icon for the bot in TGS format for the official Android app; may be null + AndroidIcon *File `json:"android_icon"` + // Icon for the bot in SVG format for the official Android app side menu; may be null + AndroidSideMenuIcon *File `json:"android_side_menu_icon"` + // Icon for the bot in TGS format for the official native macOS app; may be null + MacosIcon *File `json:"macos_icon"` + // Icon for the bot in PNG format for the official macOS app side menu; may be null + MacosSideMenuIcon *File `json:"macos_side_menu_icon"` + // Color to highlight selected icon of the bot if appropriate; may be null + IconColor *AttachmentMenuBotColor `json:"icon_color"` + // Default placeholder for opened Web Apps in SVG format; may be null + WebAppPlaceholder *File `json:"web_app_placeholder"` +} + +func (entity *AttachmentMenuBot) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub AttachmentMenuBot + + return json.Marshal((*stub)(entity)) +} + +func (*AttachmentMenuBot) GetClass() string { + return ClassAttachmentMenuBot +} + +func (*AttachmentMenuBot) GetType() string { + return TypeAttachmentMenuBot +} + +// Information about the message sent by answerWebAppQuery +type SentWebAppMessage struct { + meta + // Identifier of the sent inline message, if known + InlineMessageId string `json:"inline_message_id"` +} + +func (entity *SentWebAppMessage) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SentWebAppMessage + + return json.Marshal((*stub)(entity)) +} + +func (*SentWebAppMessage) GetClass() string { + return ClassSentWebAppMessage +} + +func (*SentWebAppMessage) GetType() string { + return TypeSentWebAppMessage +} + +// The user connected a website by logging in using Telegram Login Widget on it +type BotWriteAccessAllowReasonConnectedWebsite struct { + meta + // Domain name of the connected website + DomainName string `json:"domain_name"` +} + +func (entity *BotWriteAccessAllowReasonConnectedWebsite) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BotWriteAccessAllowReasonConnectedWebsite + + return json.Marshal((*stub)(entity)) +} + +func (*BotWriteAccessAllowReasonConnectedWebsite) GetClass() string { + return ClassBotWriteAccessAllowReason +} + +func (*BotWriteAccessAllowReasonConnectedWebsite) GetType() string { + return TypeBotWriteAccessAllowReasonConnectedWebsite +} + +func (*BotWriteAccessAllowReasonConnectedWebsite) BotWriteAccessAllowReasonType() string { + return TypeBotWriteAccessAllowReasonConnectedWebsite +} + +// The user added the bot to attachment or side menu using toggleBotIsAddedToAttachmentMenu +type BotWriteAccessAllowReasonAddedToAttachmentMenu struct{ + meta +} + +func (entity *BotWriteAccessAllowReasonAddedToAttachmentMenu) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BotWriteAccessAllowReasonAddedToAttachmentMenu + + return json.Marshal((*stub)(entity)) +} + +func (*BotWriteAccessAllowReasonAddedToAttachmentMenu) GetClass() string { + return ClassBotWriteAccessAllowReason +} + +func (*BotWriteAccessAllowReasonAddedToAttachmentMenu) GetType() string { + return TypeBotWriteAccessAllowReasonAddedToAttachmentMenu +} + +func (*BotWriteAccessAllowReasonAddedToAttachmentMenu) BotWriteAccessAllowReasonType() string { + return TypeBotWriteAccessAllowReasonAddedToAttachmentMenu +} + +// The user launched a Web App using getWebAppLinkUrl +type BotWriteAccessAllowReasonLaunchedWebApp struct { + meta + // Information about the Web App + WebApp *WebApp `json:"web_app"` +} + +func (entity *BotWriteAccessAllowReasonLaunchedWebApp) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BotWriteAccessAllowReasonLaunchedWebApp + + return json.Marshal((*stub)(entity)) +} + +func (*BotWriteAccessAllowReasonLaunchedWebApp) GetClass() string { + return ClassBotWriteAccessAllowReason +} + +func (*BotWriteAccessAllowReasonLaunchedWebApp) GetType() string { + return TypeBotWriteAccessAllowReasonLaunchedWebApp +} + +func (*BotWriteAccessAllowReasonLaunchedWebApp) BotWriteAccessAllowReasonType() string { + return TypeBotWriteAccessAllowReasonLaunchedWebApp +} + +// The user accepted bot's request to send messages with allowBotToSendMessages +type BotWriteAccessAllowReasonAcceptedRequest struct{ + meta +} + +func (entity *BotWriteAccessAllowReasonAcceptedRequest) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BotWriteAccessAllowReasonAcceptedRequest + + return json.Marshal((*stub)(entity)) +} + +func (*BotWriteAccessAllowReasonAcceptedRequest) GetClass() string { + return ClassBotWriteAccessAllowReason +} + +func (*BotWriteAccessAllowReasonAcceptedRequest) GetType() string { + return TypeBotWriteAccessAllowReasonAcceptedRequest +} + +func (*BotWriteAccessAllowReasonAcceptedRequest) BotWriteAccessAllowReasonType() string { + return TypeBotWriteAccessAllowReasonAcceptedRequest +} + +// Contains an HTTP URL +type HttpUrl struct { + meta + // The URL + Url string `json:"url"` +} + +func (entity *HttpUrl) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub HttpUrl + + return json.Marshal((*stub)(entity)) +} + +func (*HttpUrl) GetClass() string { + return ClassHttpUrl +} + +func (*HttpUrl) GetType() string { + return TypeHttpUrl +} + +// Contains an HTTPS URL, which can be used to get information about a user +type UserLink struct { + meta + // The URL + Url string `json:"url"` + // Left time for which the link is valid, in seconds; 0 if the link is a public username link + ExpiresIn int32 `json:"expires_in"` +} + +func (entity *UserLink) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UserLink + + return json.Marshal((*stub)(entity)) +} + +func (*UserLink) GetClass() string { + return ClassUserLink +} + +func (*UserLink) GetType() string { + return TypeUserLink +} + +// Represents a link to an animated GIF or an animated (i.e., without sound) H.264/MPEG-4 AVC video +type InputInlineQueryResultAnimation struct { + 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"` +} + +func (entity *InputInlineQueryResultAnimation) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputInlineQueryResultAnimation + + return json.Marshal((*stub)(entity)) +} + +func (*InputInlineQueryResultAnimation) GetClass() string { + return ClassInputInlineQueryResult +} + +func (*InputInlineQueryResultAnimation) GetType() string { + return TypeInputInlineQueryResultAnimation +} + +func (*InputInlineQueryResultAnimation) InputInlineQueryResultType() string { + return TypeInputInlineQueryResultAnimation +} + +func (inputInlineQueryResultAnimation *InputInlineQueryResultAnimation) UnmarshalJSON(data []byte) error { + 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 +} + +// Represents a link to an article or web page +type InputInlineQueryResultArticle struct { + 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"` +} + +func (entity *InputInlineQueryResultArticle) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputInlineQueryResultArticle + + return json.Marshal((*stub)(entity)) +} + +func (*InputInlineQueryResultArticle) GetClass() string { + return ClassInputInlineQueryResult +} + +func (*InputInlineQueryResultArticle) GetType() string { + return TypeInputInlineQueryResultArticle +} + +func (*InputInlineQueryResultArticle) InputInlineQueryResultType() string { + return TypeInputInlineQueryResultArticle +} + +func (inputInlineQueryResultArticle *InputInlineQueryResultArticle) UnmarshalJSON(data []byte) error { + 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 +} + +// Represents a link to an MP3 audio file +type InputInlineQueryResultAudio struct { + 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"` +} + +func (entity *InputInlineQueryResultAudio) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputInlineQueryResultAudio + + return json.Marshal((*stub)(entity)) +} + +func (*InputInlineQueryResultAudio) GetClass() string { + return ClassInputInlineQueryResult +} + +func (*InputInlineQueryResultAudio) GetType() string { + return TypeInputInlineQueryResultAudio +} + +func (*InputInlineQueryResultAudio) InputInlineQueryResultType() string { + return TypeInputInlineQueryResultAudio +} + +func (inputInlineQueryResultAudio *InputInlineQueryResultAudio) UnmarshalJSON(data []byte) error { + 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"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + inputInlineQueryResultAudio.Id = tmp.Id + inputInlineQueryResultAudio.Title = tmp.Title + inputInlineQueryResultAudio.Performer = tmp.Performer + inputInlineQueryResultAudio.AudioUrl = tmp.AudioUrl + inputInlineQueryResultAudio.AudioDuration = tmp.AudioDuration + + fieldReplyMarkup, _ := UnmarshalReplyMarkup(tmp.ReplyMarkup) + inputInlineQueryResultAudio.ReplyMarkup = fieldReplyMarkup + + fieldInputMessageContent, _ := UnmarshalInputMessageContent(tmp.InputMessageContent) + inputInlineQueryResultAudio.InputMessageContent = fieldInputMessageContent + + return nil +} + +// Represents a user contact +type InputInlineQueryResultContact struct { + 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"` +} + +func (entity *InputInlineQueryResultContact) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputInlineQueryResultContact + + return json.Marshal((*stub)(entity)) +} + +func (*InputInlineQueryResultContact) GetClass() string { + return ClassInputInlineQueryResult +} + +func (*InputInlineQueryResultContact) GetType() string { + return TypeInputInlineQueryResultContact +} + +func (*InputInlineQueryResultContact) InputInlineQueryResultType() string { + return TypeInputInlineQueryResultContact +} + +func (inputInlineQueryResultContact *InputInlineQueryResultContact) UnmarshalJSON(data []byte) error { + 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"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + inputInlineQueryResultContact.Id = tmp.Id + inputInlineQueryResultContact.Contact = tmp.Contact + inputInlineQueryResultContact.ThumbnailUrl = tmp.ThumbnailUrl + inputInlineQueryResultContact.ThumbnailWidth = tmp.ThumbnailWidth + inputInlineQueryResultContact.ThumbnailHeight = tmp.ThumbnailHeight + + fieldReplyMarkup, _ := UnmarshalReplyMarkup(tmp.ReplyMarkup) + inputInlineQueryResultContact.ReplyMarkup = fieldReplyMarkup + + fieldInputMessageContent, _ := UnmarshalInputMessageContent(tmp.InputMessageContent) + inputInlineQueryResultContact.InputMessageContent = fieldInputMessageContent + + return nil +} + +// Represents a link to a file +type InputInlineQueryResultDocument struct { + 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"` +} + +func (entity *InputInlineQueryResultDocument) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputInlineQueryResultDocument + + return json.Marshal((*stub)(entity)) +} + +func (*InputInlineQueryResultDocument) GetClass() string { + return ClassInputInlineQueryResult +} + +func (*InputInlineQueryResultDocument) GetType() string { + return TypeInputInlineQueryResultDocument +} + +func (*InputInlineQueryResultDocument) InputInlineQueryResultType() string { + return TypeInputInlineQueryResultDocument +} + +func (inputInlineQueryResultDocument *InputInlineQueryResultDocument) UnmarshalJSON(data []byte) error { + 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 +} + +// Represents a game +type InputInlineQueryResultGame struct { + 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"` +} + +func (entity *InputInlineQueryResultGame) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputInlineQueryResultGame + + return json.Marshal((*stub)(entity)) +} + +func (*InputInlineQueryResultGame) GetClass() string { + return ClassInputInlineQueryResult +} + +func (*InputInlineQueryResultGame) GetType() string { + return TypeInputInlineQueryResultGame +} + +func (*InputInlineQueryResultGame) InputInlineQueryResultType() string { + return TypeInputInlineQueryResultGame +} + +func (inputInlineQueryResultGame *InputInlineQueryResultGame) UnmarshalJSON(data []byte) error { + var tmp struct { + Id string `json:"id"` + GameShortName string `json:"game_short_name"` + ReplyMarkup json.RawMessage `json:"reply_markup"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + inputInlineQueryResultGame.Id = tmp.Id + inputInlineQueryResultGame.GameShortName = tmp.GameShortName + + fieldReplyMarkup, _ := UnmarshalReplyMarkup(tmp.ReplyMarkup) + inputInlineQueryResultGame.ReplyMarkup = fieldReplyMarkup + + return nil +} + +// Represents a point on the map +type InputInlineQueryResultLocation struct { + 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"` +} + +func (entity *InputInlineQueryResultLocation) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputInlineQueryResultLocation + + return json.Marshal((*stub)(entity)) +} + +func (*InputInlineQueryResultLocation) GetClass() string { + return ClassInputInlineQueryResult +} + +func (*InputInlineQueryResultLocation) GetType() string { + return TypeInputInlineQueryResultLocation +} + +func (*InputInlineQueryResultLocation) InputInlineQueryResultType() string { + return TypeInputInlineQueryResultLocation +} + +func (inputInlineQueryResultLocation *InputInlineQueryResultLocation) UnmarshalJSON(data []byte) error { + 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 +} + +// Represents link to a JPEG image +type InputInlineQueryResultPhoto struct { + 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"` +} + +func (entity *InputInlineQueryResultPhoto) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputInlineQueryResultPhoto + + return json.Marshal((*stub)(entity)) +} + +func (*InputInlineQueryResultPhoto) GetClass() string { + return ClassInputInlineQueryResult +} + +func (*InputInlineQueryResultPhoto) GetType() string { + return TypeInputInlineQueryResultPhoto +} + +func (*InputInlineQueryResultPhoto) InputInlineQueryResultType() string { + return TypeInputInlineQueryResultPhoto +} + +func (inputInlineQueryResultPhoto *InputInlineQueryResultPhoto) UnmarshalJSON(data []byte) error { + 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 +} + +// Represents a link to a WEBP, TGS, or WEBM sticker +type InputInlineQueryResultSticker struct { + 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"` +} + +func (entity *InputInlineQueryResultSticker) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputInlineQueryResultSticker + + return json.Marshal((*stub)(entity)) +} + +func (*InputInlineQueryResultSticker) GetClass() string { + return ClassInputInlineQueryResult +} + +func (*InputInlineQueryResultSticker) GetType() string { + return TypeInputInlineQueryResultSticker +} + +func (*InputInlineQueryResultSticker) InputInlineQueryResultType() string { + return TypeInputInlineQueryResultSticker +} + +func (inputInlineQueryResultSticker *InputInlineQueryResultSticker) UnmarshalJSON(data []byte) error { + 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"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + inputInlineQueryResultSticker.Id = tmp.Id + inputInlineQueryResultSticker.ThumbnailUrl = tmp.ThumbnailUrl + inputInlineQueryResultSticker.StickerUrl = tmp.StickerUrl + inputInlineQueryResultSticker.StickerWidth = tmp.StickerWidth + inputInlineQueryResultSticker.StickerHeight = tmp.StickerHeight + + fieldReplyMarkup, _ := UnmarshalReplyMarkup(tmp.ReplyMarkup) + inputInlineQueryResultSticker.ReplyMarkup = fieldReplyMarkup + + fieldInputMessageContent, _ := UnmarshalInputMessageContent(tmp.InputMessageContent) + inputInlineQueryResultSticker.InputMessageContent = fieldInputMessageContent + + return nil +} + +// Represents information about a venue +type InputInlineQueryResultVenue struct { + 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"` +} + +func (entity *InputInlineQueryResultVenue) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputInlineQueryResultVenue + + return json.Marshal((*stub)(entity)) +} + +func (*InputInlineQueryResultVenue) GetClass() string { + return ClassInputInlineQueryResult +} + +func (*InputInlineQueryResultVenue) GetType() string { + return TypeInputInlineQueryResultVenue +} + +func (*InputInlineQueryResultVenue) InputInlineQueryResultType() string { + return TypeInputInlineQueryResultVenue +} + +func (inputInlineQueryResultVenue *InputInlineQueryResultVenue) UnmarshalJSON(data []byte) error { + 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"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + inputInlineQueryResultVenue.Id = tmp.Id + inputInlineQueryResultVenue.Venue = tmp.Venue + inputInlineQueryResultVenue.ThumbnailUrl = tmp.ThumbnailUrl + inputInlineQueryResultVenue.ThumbnailWidth = tmp.ThumbnailWidth + inputInlineQueryResultVenue.ThumbnailHeight = tmp.ThumbnailHeight + + fieldReplyMarkup, _ := UnmarshalReplyMarkup(tmp.ReplyMarkup) + inputInlineQueryResultVenue.ReplyMarkup = fieldReplyMarkup + + fieldInputMessageContent, _ := UnmarshalInputMessageContent(tmp.InputMessageContent) + inputInlineQueryResultVenue.InputMessageContent = fieldInputMessageContent + + return nil +} + +// Represents a link to a page containing an embedded video player or a video file +type InputInlineQueryResultVideo struct { + 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"` +} + +func (entity *InputInlineQueryResultVideo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputInlineQueryResultVideo + + return json.Marshal((*stub)(entity)) +} + +func (*InputInlineQueryResultVideo) GetClass() string { + return ClassInputInlineQueryResult +} + +func (*InputInlineQueryResultVideo) GetType() string { + return TypeInputInlineQueryResultVideo +} + +func (*InputInlineQueryResultVideo) InputInlineQueryResultType() string { + return TypeInputInlineQueryResultVideo +} + +func (inputInlineQueryResultVideo *InputInlineQueryResultVideo) UnmarshalJSON(data []byte) error { + 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 +} + +// Represents a link to an opus-encoded audio file within an OGG container, single channel audio +type InputInlineQueryResultVoiceNote struct { + 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"` +} + +func (entity *InputInlineQueryResultVoiceNote) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputInlineQueryResultVoiceNote + + return json.Marshal((*stub)(entity)) +} + +func (*InputInlineQueryResultVoiceNote) GetClass() string { + return ClassInputInlineQueryResult +} + +func (*InputInlineQueryResultVoiceNote) GetType() string { + return TypeInputInlineQueryResultVoiceNote +} + +func (*InputInlineQueryResultVoiceNote) InputInlineQueryResultType() string { + return TypeInputInlineQueryResultVoiceNote +} + +func (inputInlineQueryResultVoiceNote *InputInlineQueryResultVoiceNote) UnmarshalJSON(data []byte) error { + 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"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + inputInlineQueryResultVoiceNote.Id = tmp.Id + inputInlineQueryResultVoiceNote.Title = tmp.Title + inputInlineQueryResultVoiceNote.VoiceNoteUrl = tmp.VoiceNoteUrl + inputInlineQueryResultVoiceNote.VoiceNoteDuration = tmp.VoiceNoteDuration + + fieldReplyMarkup, _ := UnmarshalReplyMarkup(tmp.ReplyMarkup) + inputInlineQueryResultVoiceNote.ReplyMarkup = fieldReplyMarkup + + fieldInputMessageContent, _ := UnmarshalInputMessageContent(tmp.InputMessageContent) + inputInlineQueryResultVoiceNote.InputMessageContent = fieldInputMessageContent + + return nil +} + +// Represents a link to an article or web page +type InlineQueryResultArticle struct { + 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"` +} + +func (entity *InlineQueryResultArticle) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InlineQueryResultArticle + + return json.Marshal((*stub)(entity)) +} + +func (*InlineQueryResultArticle) GetClass() string { + return ClassInlineQueryResult +} + +func (*InlineQueryResultArticle) GetType() string { + return TypeInlineQueryResultArticle +} + +func (*InlineQueryResultArticle) InlineQueryResultType() string { + return TypeInlineQueryResultArticle +} + +// Represents a user contact +type InlineQueryResultContact struct { + 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"` +} + +func (entity *InlineQueryResultContact) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InlineQueryResultContact + + return json.Marshal((*stub)(entity)) +} + +func (*InlineQueryResultContact) GetClass() string { + return ClassInlineQueryResult +} + +func (*InlineQueryResultContact) GetType() string { + return TypeInlineQueryResultContact +} + +func (*InlineQueryResultContact) InlineQueryResultType() string { + return TypeInlineQueryResultContact +} + +// Represents a point on the map +type InlineQueryResultLocation struct { + 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"` +} + +func (entity *InlineQueryResultLocation) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InlineQueryResultLocation + + return json.Marshal((*stub)(entity)) +} + +func (*InlineQueryResultLocation) GetClass() string { + return ClassInlineQueryResult +} + +func (*InlineQueryResultLocation) GetType() string { + return TypeInlineQueryResultLocation +} + +func (*InlineQueryResultLocation) InlineQueryResultType() string { + return TypeInlineQueryResultLocation +} + +// Represents information about a venue +type InlineQueryResultVenue struct { + 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"` +} + +func (entity *InlineQueryResultVenue) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InlineQueryResultVenue + + return json.Marshal((*stub)(entity)) +} + +func (*InlineQueryResultVenue) GetClass() string { + return ClassInlineQueryResult +} + +func (*InlineQueryResultVenue) GetType() string { + return TypeInlineQueryResultVenue +} + +func (*InlineQueryResultVenue) InlineQueryResultType() string { + return TypeInlineQueryResultVenue +} + +// Represents information about a game +type InlineQueryResultGame struct { + meta + // Unique identifier of the query result + Id string `json:"id"` + // Game result + Game *Game `json:"game"` +} + +func (entity *InlineQueryResultGame) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InlineQueryResultGame + + return json.Marshal((*stub)(entity)) +} + +func (*InlineQueryResultGame) GetClass() string { + return ClassInlineQueryResult +} + +func (*InlineQueryResultGame) GetType() string { + return TypeInlineQueryResultGame +} + +func (*InlineQueryResultGame) InlineQueryResultType() string { + return TypeInlineQueryResultGame +} + +// Represents an animation file +type InlineQueryResultAnimation struct { + meta + // Unique identifier of the query result + Id string `json:"id"` + // Animation file + Animation *Animation `json:"animation"` + // Animation title + Title string `json:"title"` +} + +func (entity *InlineQueryResultAnimation) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InlineQueryResultAnimation + + return json.Marshal((*stub)(entity)) +} + +func (*InlineQueryResultAnimation) GetClass() string { + return ClassInlineQueryResult +} + +func (*InlineQueryResultAnimation) GetType() string { + return TypeInlineQueryResultAnimation +} + +func (*InlineQueryResultAnimation) InlineQueryResultType() string { + return TypeInlineQueryResultAnimation +} + +// Represents an audio file +type InlineQueryResultAudio struct { + meta + // Unique identifier of the query result + Id string `json:"id"` + // Audio file + Audio *Audio `json:"audio"` +} + +func (entity *InlineQueryResultAudio) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InlineQueryResultAudio + + return json.Marshal((*stub)(entity)) +} + +func (*InlineQueryResultAudio) GetClass() string { + return ClassInlineQueryResult +} + +func (*InlineQueryResultAudio) GetType() string { + return TypeInlineQueryResultAudio +} + +func (*InlineQueryResultAudio) InlineQueryResultType() string { + return TypeInlineQueryResultAudio +} + +// Represents a document +type InlineQueryResultDocument struct { + 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"` +} + +func (entity *InlineQueryResultDocument) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InlineQueryResultDocument + + return json.Marshal((*stub)(entity)) +} + +func (*InlineQueryResultDocument) GetClass() string { + return ClassInlineQueryResult +} + +func (*InlineQueryResultDocument) GetType() string { + return TypeInlineQueryResultDocument +} + +func (*InlineQueryResultDocument) InlineQueryResultType() string { + return TypeInlineQueryResultDocument +} + +// Represents a photo +type InlineQueryResultPhoto struct { + 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"` +} + +func (entity *InlineQueryResultPhoto) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InlineQueryResultPhoto + + return json.Marshal((*stub)(entity)) +} + +func (*InlineQueryResultPhoto) GetClass() string { + return ClassInlineQueryResult +} + +func (*InlineQueryResultPhoto) GetType() string { + return TypeInlineQueryResultPhoto +} + +func (*InlineQueryResultPhoto) InlineQueryResultType() string { + return TypeInlineQueryResultPhoto +} + +// Represents a sticker +type InlineQueryResultSticker struct { + meta + // Unique identifier of the query result + Id string `json:"id"` + // Sticker + Sticker *Sticker `json:"sticker"` +} + +func (entity *InlineQueryResultSticker) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InlineQueryResultSticker + + return json.Marshal((*stub)(entity)) +} + +func (*InlineQueryResultSticker) GetClass() string { + return ClassInlineQueryResult +} + +func (*InlineQueryResultSticker) GetType() string { + return TypeInlineQueryResultSticker +} + +func (*InlineQueryResultSticker) InlineQueryResultType() string { + return TypeInlineQueryResultSticker +} + +// Represents a video +type InlineQueryResultVideo struct { + 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"` +} + +func (entity *InlineQueryResultVideo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InlineQueryResultVideo + + return json.Marshal((*stub)(entity)) +} + +func (*InlineQueryResultVideo) GetClass() string { + return ClassInlineQueryResult +} + +func (*InlineQueryResultVideo) GetType() string { + return TypeInlineQueryResultVideo +} + +func (*InlineQueryResultVideo) InlineQueryResultType() string { + return TypeInlineQueryResultVideo +} + +// Represents a voice note +type InlineQueryResultVoiceNote struct { + 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"` +} + +func (entity *InlineQueryResultVoiceNote) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InlineQueryResultVoiceNote + + return json.Marshal((*stub)(entity)) +} + +func (*InlineQueryResultVoiceNote) GetClass() string { + return ClassInlineQueryResult +} + +func (*InlineQueryResultVoiceNote) GetType() string { + return TypeInlineQueryResultVoiceNote +} + +func (*InlineQueryResultVoiceNote) InlineQueryResultType() string { + return TypeInlineQueryResultVoiceNote +} + +// Describes the button that opens a private chat with the bot and sends a start message to the bot with the given parameter +type InlineQueryResultsButtonTypeStartBot struct { + meta + // The parameter for the bot start message + Parameter string `json:"parameter"` +} + +func (entity *InlineQueryResultsButtonTypeStartBot) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InlineQueryResultsButtonTypeStartBot + + return json.Marshal((*stub)(entity)) +} + +func (*InlineQueryResultsButtonTypeStartBot) GetClass() string { + return ClassInlineQueryResultsButtonType +} + +func (*InlineQueryResultsButtonTypeStartBot) GetType() string { + return TypeInlineQueryResultsButtonTypeStartBot +} + +func (*InlineQueryResultsButtonTypeStartBot) InlineQueryResultsButtonTypeType() string { + return TypeInlineQueryResultsButtonTypeStartBot +} + +// Describes the button that opens a Web App by calling getWebAppUrl +type InlineQueryResultsButtonTypeWebApp struct { + meta + // An HTTP URL to pass to getWebAppUrl + Url string `json:"url"` +} + +func (entity *InlineQueryResultsButtonTypeWebApp) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InlineQueryResultsButtonTypeWebApp + + return json.Marshal((*stub)(entity)) +} + +func (*InlineQueryResultsButtonTypeWebApp) GetClass() string { + return ClassInlineQueryResultsButtonType +} + +func (*InlineQueryResultsButtonTypeWebApp) GetType() string { + return TypeInlineQueryResultsButtonTypeWebApp +} + +func (*InlineQueryResultsButtonTypeWebApp) InlineQueryResultsButtonTypeType() string { + return TypeInlineQueryResultsButtonTypeWebApp +} + +// Represents a button to be shown above inline query results +type InlineQueryResultsButton struct { + meta + // The text of the button + Text string `json:"text"` + // Type of the button + Type InlineQueryResultsButtonType `json:"type"` +} + +func (entity *InlineQueryResultsButton) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InlineQueryResultsButton + + return json.Marshal((*stub)(entity)) +} + +func (*InlineQueryResultsButton) GetClass() string { + return ClassInlineQueryResultsButton +} + +func (*InlineQueryResultsButton) GetType() string { + return TypeInlineQueryResultsButton +} + +func (inlineQueryResultsButton *InlineQueryResultsButton) UnmarshalJSON(data []byte) error { + var tmp struct { + Text string `json:"text"` + Type json.RawMessage `json:"type"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + inlineQueryResultsButton.Text = tmp.Text + + fieldType, _ := UnmarshalInlineQueryResultsButtonType(tmp.Type) + inlineQueryResultsButton.Type = fieldType + + return nil +} + +// Represents the results of the inline query. Use sendInlineQueryResultMessage to send the result of the query +type InlineQueryResults struct { + meta + // Unique identifier of the inline query + InlineQueryId JsonInt64 `json:"inline_query_id"` + // Button to be shown above inline query results; may be null + Button *InlineQueryResultsButton `json:"button"` + // Results of the query + Results []InlineQueryResult `json:"results"` + // The offset for the next request. If empty, then there are no more results + NextOffset string `json:"next_offset"` +} + +func (entity *InlineQueryResults) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InlineQueryResults + + return json.Marshal((*stub)(entity)) +} + +func (*InlineQueryResults) GetClass() string { + return ClassInlineQueryResults +} + +func (*InlineQueryResults) GetType() string { + return TypeInlineQueryResults +} + +func (inlineQueryResults *InlineQueryResults) UnmarshalJSON(data []byte) error { + var tmp struct { + InlineQueryId JsonInt64 `json:"inline_query_id"` + Button *InlineQueryResultsButton `json:"button"` + Results []json.RawMessage `json:"results"` + NextOffset string `json:"next_offset"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + inlineQueryResults.InlineQueryId = tmp.InlineQueryId + inlineQueryResults.Button = tmp.Button + inlineQueryResults.NextOffset = tmp.NextOffset + + fieldResults, _ := UnmarshalListOfInlineQueryResult(tmp.Results) + inlineQueryResults.Results = fieldResults + + return nil +} + +// The payload for a general callback button +type CallbackQueryPayloadData struct { + meta + // Data that was attached to the callback button + Data []byte `json:"data"` +} + +func (entity *CallbackQueryPayloadData) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CallbackQueryPayloadData + + return json.Marshal((*stub)(entity)) +} + +func (*CallbackQueryPayloadData) GetClass() string { + return ClassCallbackQueryPayload +} + +func (*CallbackQueryPayloadData) GetType() string { + return TypeCallbackQueryPayloadData +} + +func (*CallbackQueryPayloadData) CallbackQueryPayloadType() string { + return TypeCallbackQueryPayloadData +} + +// The payload for a callback button requiring password +type CallbackQueryPayloadDataWithPassword struct { + meta + // The 2-step verification password for the current user + Password string `json:"password"` + // Data that was attached to the callback button + Data []byte `json:"data"` +} + +func (entity *CallbackQueryPayloadDataWithPassword) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CallbackQueryPayloadDataWithPassword + + return json.Marshal((*stub)(entity)) +} + +func (*CallbackQueryPayloadDataWithPassword) GetClass() string { + return ClassCallbackQueryPayload +} + +func (*CallbackQueryPayloadDataWithPassword) GetType() string { + return TypeCallbackQueryPayloadDataWithPassword +} + +func (*CallbackQueryPayloadDataWithPassword) CallbackQueryPayloadType() string { + return TypeCallbackQueryPayloadDataWithPassword +} + +// The payload for a game callback button +type CallbackQueryPayloadGame struct { + meta + // A short name of the game that was attached to the callback button + GameShortName string `json:"game_short_name"` +} + +func (entity *CallbackQueryPayloadGame) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CallbackQueryPayloadGame + + return json.Marshal((*stub)(entity)) +} + +func (*CallbackQueryPayloadGame) GetClass() string { + return ClassCallbackQueryPayload +} + +func (*CallbackQueryPayloadGame) GetType() string { + return TypeCallbackQueryPayloadGame +} + +func (*CallbackQueryPayloadGame) CallbackQueryPayloadType() string { + return TypeCallbackQueryPayloadGame +} + +// Contains a bot's answer to a callback query +type CallbackQueryAnswer struct { + 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"` +} + +func (entity *CallbackQueryAnswer) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CallbackQueryAnswer + + return json.Marshal((*stub)(entity)) +} + +func (*CallbackQueryAnswer) GetClass() string { + return ClassCallbackQueryAnswer +} + +func (*CallbackQueryAnswer) GetType() string { + return TypeCallbackQueryAnswer +} + +// Contains the result of a custom request +type CustomRequestResult struct { + meta + // A JSON-serialized result + Result string `json:"result"` +} + +func (entity *CustomRequestResult) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CustomRequestResult + + return json.Marshal((*stub)(entity)) +} + +func (*CustomRequestResult) GetClass() string { + return ClassCustomRequestResult +} + +func (*CustomRequestResult) GetType() string { + return TypeCustomRequestResult +} + +// Contains one row of the game high score table +type GameHighScore struct { + meta + // Position in the high score table + Position int32 `json:"position"` + // User identifier + UserId int64 `json:"user_id"` + // User score + Score int32 `json:"score"` +} + +func (entity *GameHighScore) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub GameHighScore + + return json.Marshal((*stub)(entity)) +} + +func (*GameHighScore) GetClass() string { + return ClassGameHighScore +} + +func (*GameHighScore) GetType() string { + return TypeGameHighScore +} + +// Contains a list of game high scores +type GameHighScores struct { + meta + // A list of game high scores + Scores []*GameHighScore `json:"scores"` +} + +func (entity *GameHighScores) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub GameHighScores + + return json.Marshal((*stub)(entity)) +} + +func (*GameHighScores) GetClass() string { + return ClassGameHighScores +} + +func (*GameHighScores) GetType() string { + return TypeGameHighScores +} + +// A message was edited +type ChatEventMessageEdited struct { + meta + // The original message before the edit + OldMessage *Message `json:"old_message"` + // The message after it was edited + NewMessage *Message `json:"new_message"` +} + +func (entity *ChatEventMessageEdited) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventMessageEdited + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventMessageEdited) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventMessageEdited) GetType() string { + return TypeChatEventMessageEdited +} + +func (*ChatEventMessageEdited) ChatEventActionType() string { + return TypeChatEventMessageEdited +} + +// A message was deleted +type ChatEventMessageDeleted struct { + meta + // Deleted message + Message *Message `json:"message"` + // True, if the message deletion can be reported via reportSupergroupAntiSpamFalsePositive + CanReportAntiSpamFalsePositive bool `json:"can_report_anti_spam_false_positive"` +} + +func (entity *ChatEventMessageDeleted) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventMessageDeleted + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventMessageDeleted) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventMessageDeleted) GetType() string { + return TypeChatEventMessageDeleted +} + +func (*ChatEventMessageDeleted) ChatEventActionType() string { + return TypeChatEventMessageDeleted +} + +// A message was pinned +type ChatEventMessagePinned struct { + meta + // Pinned message + Message *Message `json:"message"` +} + +func (entity *ChatEventMessagePinned) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventMessagePinned + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventMessagePinned) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventMessagePinned) GetType() string { + return TypeChatEventMessagePinned +} + +func (*ChatEventMessagePinned) ChatEventActionType() string { + return TypeChatEventMessagePinned +} + +// A message was unpinned +type ChatEventMessageUnpinned struct { + meta + // Unpinned message + Message *Message `json:"message"` +} + +func (entity *ChatEventMessageUnpinned) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventMessageUnpinned + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventMessageUnpinned) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventMessageUnpinned) GetType() string { + return TypeChatEventMessageUnpinned +} + +func (*ChatEventMessageUnpinned) ChatEventActionType() string { + return TypeChatEventMessageUnpinned +} + +// A poll in a message was stopped +type ChatEventPollStopped struct { + meta + // The message with the poll + Message *Message `json:"message"` +} + +func (entity *ChatEventPollStopped) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventPollStopped + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventPollStopped) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventPollStopped) GetType() string { + return TypeChatEventPollStopped +} + +func (*ChatEventPollStopped) ChatEventActionType() string { + return TypeChatEventPollStopped +} + +// A new member joined the chat +type ChatEventMemberJoined struct{ + meta +} + +func (entity *ChatEventMemberJoined) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventMemberJoined + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventMemberJoined) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventMemberJoined) GetType() string { + return TypeChatEventMemberJoined +} + +func (*ChatEventMemberJoined) ChatEventActionType() string { + return TypeChatEventMemberJoined +} + +// A new member joined the chat via an invite link +type ChatEventMemberJoinedByInviteLink struct { + meta + // Invite link used to join the chat + InviteLink *ChatInviteLink `json:"invite_link"` + // True, if the user has joined the chat using an invite link for a chat folder + ViaChatFolderInviteLink bool `json:"via_chat_folder_invite_link"` +} + +func (entity *ChatEventMemberJoinedByInviteLink) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventMemberJoinedByInviteLink + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventMemberJoinedByInviteLink) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventMemberJoinedByInviteLink) GetType() string { + return TypeChatEventMemberJoinedByInviteLink +} + +func (*ChatEventMemberJoinedByInviteLink) ChatEventActionType() string { + return TypeChatEventMemberJoinedByInviteLink +} + +// A new member was accepted to the chat by an administrator +type ChatEventMemberJoinedByRequest struct { + 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"` +} + +func (entity *ChatEventMemberJoinedByRequest) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventMemberJoinedByRequest + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventMemberJoinedByRequest) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventMemberJoinedByRequest) GetType() string { + return TypeChatEventMemberJoinedByRequest +} + +func (*ChatEventMemberJoinedByRequest) ChatEventActionType() string { + return TypeChatEventMemberJoinedByRequest +} + +// A new chat member was invited +type ChatEventMemberInvited struct { + meta + // New member user identifier + UserId int64 `json:"user_id"` + // New member status + Status ChatMemberStatus `json:"status"` +} + +func (entity *ChatEventMemberInvited) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventMemberInvited + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventMemberInvited) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventMemberInvited) GetType() string { + return TypeChatEventMemberInvited +} + +func (*ChatEventMemberInvited) ChatEventActionType() string { + return TypeChatEventMemberInvited +} + +func (chatEventMemberInvited *ChatEventMemberInvited) UnmarshalJSON(data []byte) error { + var tmp struct { + UserId int64 `json:"user_id"` + Status json.RawMessage `json:"status"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + chatEventMemberInvited.UserId = tmp.UserId + + fieldStatus, _ := UnmarshalChatMemberStatus(tmp.Status) + chatEventMemberInvited.Status = fieldStatus + + return nil +} + +// A member left the chat +type ChatEventMemberLeft struct{ + meta +} + +func (entity *ChatEventMemberLeft) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventMemberLeft + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventMemberLeft) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventMemberLeft) GetType() string { + return TypeChatEventMemberLeft +} + +func (*ChatEventMemberLeft) ChatEventActionType() string { + return TypeChatEventMemberLeft +} + +// A chat member has gained/lost administrator status, or the list of their administrator privileges has changed +type ChatEventMemberPromoted struct { + 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"` +} + +func (entity *ChatEventMemberPromoted) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventMemberPromoted + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventMemberPromoted) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventMemberPromoted) GetType() string { + return TypeChatEventMemberPromoted +} + +func (*ChatEventMemberPromoted) ChatEventActionType() string { + return TypeChatEventMemberPromoted +} + +func (chatEventMemberPromoted *ChatEventMemberPromoted) UnmarshalJSON(data []byte) error { + var tmp struct { + UserId int64 `json:"user_id"` + OldStatus json.RawMessage `json:"old_status"` + NewStatus json.RawMessage `json:"new_status"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + chatEventMemberPromoted.UserId = tmp.UserId + + fieldOldStatus, _ := UnmarshalChatMemberStatus(tmp.OldStatus) + chatEventMemberPromoted.OldStatus = fieldOldStatus + + fieldNewStatus, _ := UnmarshalChatMemberStatus(tmp.NewStatus) + chatEventMemberPromoted.NewStatus = fieldNewStatus + + return nil +} + +// A chat member was restricted/unrestricted or banned/unbanned, or the list of their restrictions has changed +type ChatEventMemberRestricted struct { + 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"` +} + +func (entity *ChatEventMemberRestricted) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventMemberRestricted + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventMemberRestricted) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventMemberRestricted) GetType() string { + return TypeChatEventMemberRestricted +} + +func (*ChatEventMemberRestricted) ChatEventActionType() string { + return TypeChatEventMemberRestricted +} + +func (chatEventMemberRestricted *ChatEventMemberRestricted) UnmarshalJSON(data []byte) error { + var tmp struct { + MemberId json.RawMessage `json:"member_id"` + OldStatus json.RawMessage `json:"old_status"` + NewStatus json.RawMessage `json:"new_status"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldMemberId, _ := UnmarshalMessageSender(tmp.MemberId) + chatEventMemberRestricted.MemberId = fieldMemberId + + fieldOldStatus, _ := UnmarshalChatMemberStatus(tmp.OldStatus) + chatEventMemberRestricted.OldStatus = fieldOldStatus + + fieldNewStatus, _ := UnmarshalChatMemberStatus(tmp.NewStatus) + chatEventMemberRestricted.NewStatus = fieldNewStatus + + return nil +} + +// The chat available reactions were changed +type ChatEventAvailableReactionsChanged struct { + meta + // Previous chat available reactions + OldAvailableReactions ChatAvailableReactions `json:"old_available_reactions"` + // New chat available reactions + NewAvailableReactions ChatAvailableReactions `json:"new_available_reactions"` +} + +func (entity *ChatEventAvailableReactionsChanged) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventAvailableReactionsChanged + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventAvailableReactionsChanged) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventAvailableReactionsChanged) GetType() string { + return TypeChatEventAvailableReactionsChanged +} + +func (*ChatEventAvailableReactionsChanged) ChatEventActionType() string { + return TypeChatEventAvailableReactionsChanged +} + +func (chatEventAvailableReactionsChanged *ChatEventAvailableReactionsChanged) UnmarshalJSON(data []byte) error { + var tmp struct { + OldAvailableReactions json.RawMessage `json:"old_available_reactions"` + NewAvailableReactions json.RawMessage `json:"new_available_reactions"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldOldAvailableReactions, _ := UnmarshalChatAvailableReactions(tmp.OldAvailableReactions) + chatEventAvailableReactionsChanged.OldAvailableReactions = fieldOldAvailableReactions + + fieldNewAvailableReactions, _ := UnmarshalChatAvailableReactions(tmp.NewAvailableReactions) + chatEventAvailableReactionsChanged.NewAvailableReactions = fieldNewAvailableReactions + + return nil +} + +// The chat background was changed +type ChatEventBackgroundChanged struct { + meta + // Previous background; may be null if none + OldBackground *ChatBackground `json:"old_background"` + // New background; may be null if none + NewBackground *ChatBackground `json:"new_background"` +} + +func (entity *ChatEventBackgroundChanged) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventBackgroundChanged + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventBackgroundChanged) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventBackgroundChanged) GetType() string { + return TypeChatEventBackgroundChanged +} + +func (*ChatEventBackgroundChanged) ChatEventActionType() string { + return TypeChatEventBackgroundChanged +} + +// The chat description was changed +type ChatEventDescriptionChanged struct { + meta + // Previous chat description + OldDescription string `json:"old_description"` + // New chat description + NewDescription string `json:"new_description"` +} + +func (entity *ChatEventDescriptionChanged) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventDescriptionChanged + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventDescriptionChanged) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventDescriptionChanged) GetType() string { + return TypeChatEventDescriptionChanged +} + +func (*ChatEventDescriptionChanged) ChatEventActionType() string { + return TypeChatEventDescriptionChanged +} + +// The chat emoji status was changed +type ChatEventEmojiStatusChanged struct { + meta + // Previous emoji status; may be null if none + OldEmojiStatus *EmojiStatus `json:"old_emoji_status"` + // New emoji status; may be null if none + NewEmojiStatus *EmojiStatus `json:"new_emoji_status"` +} + +func (entity *ChatEventEmojiStatusChanged) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventEmojiStatusChanged + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventEmojiStatusChanged) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventEmojiStatusChanged) GetType() string { + return TypeChatEventEmojiStatusChanged +} + +func (*ChatEventEmojiStatusChanged) ChatEventActionType() string { + return TypeChatEventEmojiStatusChanged +} + +// The linked chat of a supergroup was changed +type ChatEventLinkedChatChanged struct { + 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"` +} + +func (entity *ChatEventLinkedChatChanged) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventLinkedChatChanged + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventLinkedChatChanged) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventLinkedChatChanged) GetType() string { + return TypeChatEventLinkedChatChanged +} + +func (*ChatEventLinkedChatChanged) ChatEventActionType() string { + return TypeChatEventLinkedChatChanged +} + +// The supergroup location was changed +type ChatEventLocationChanged struct { + meta + // Previous location; may be null + OldLocation *ChatLocation `json:"old_location"` + // New location; may be null + NewLocation *ChatLocation `json:"new_location"` +} + +func (entity *ChatEventLocationChanged) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventLocationChanged + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventLocationChanged) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventLocationChanged) GetType() string { + return TypeChatEventLocationChanged +} + +func (*ChatEventLocationChanged) ChatEventActionType() string { + return TypeChatEventLocationChanged +} + +// The message auto-delete timer was changed +type ChatEventMessageAutoDeleteTimeChanged struct { + meta + // Previous value of message_auto_delete_time + OldMessageAutoDeleteTime int32 `json:"old_message_auto_delete_time"` + // New value of message_auto_delete_time + NewMessageAutoDeleteTime int32 `json:"new_message_auto_delete_time"` +} + +func (entity *ChatEventMessageAutoDeleteTimeChanged) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventMessageAutoDeleteTimeChanged + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventMessageAutoDeleteTimeChanged) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventMessageAutoDeleteTimeChanged) GetType() string { + return TypeChatEventMessageAutoDeleteTimeChanged +} + +func (*ChatEventMessageAutoDeleteTimeChanged) ChatEventActionType() string { + return TypeChatEventMessageAutoDeleteTimeChanged +} + +// The chat permissions were changed +type ChatEventPermissionsChanged struct { + meta + // Previous chat permissions + OldPermissions *ChatPermissions `json:"old_permissions"` + // New chat permissions + NewPermissions *ChatPermissions `json:"new_permissions"` +} + +func (entity *ChatEventPermissionsChanged) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventPermissionsChanged + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventPermissionsChanged) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventPermissionsChanged) GetType() string { + return TypeChatEventPermissionsChanged +} + +func (*ChatEventPermissionsChanged) ChatEventActionType() string { + return TypeChatEventPermissionsChanged +} + +// The chat photo was changed +type ChatEventPhotoChanged struct { + 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"` +} + +func (entity *ChatEventPhotoChanged) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventPhotoChanged + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventPhotoChanged) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventPhotoChanged) GetType() string { + return TypeChatEventPhotoChanged +} + +func (*ChatEventPhotoChanged) ChatEventActionType() string { + return TypeChatEventPhotoChanged +} + +// The slow_mode_delay setting of a supergroup was changed +type ChatEventSlowModeDelayChanged struct { + 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"` +} + +func (entity *ChatEventSlowModeDelayChanged) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventSlowModeDelayChanged + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventSlowModeDelayChanged) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventSlowModeDelayChanged) GetType() string { + return TypeChatEventSlowModeDelayChanged +} + +func (*ChatEventSlowModeDelayChanged) ChatEventActionType() string { + return TypeChatEventSlowModeDelayChanged +} + +// The supergroup sticker set was changed +type ChatEventStickerSetChanged struct { + 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"` +} + +func (entity *ChatEventStickerSetChanged) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventStickerSetChanged + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventStickerSetChanged) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventStickerSetChanged) GetType() string { + return TypeChatEventStickerSetChanged +} + +func (*ChatEventStickerSetChanged) ChatEventActionType() string { + return TypeChatEventStickerSetChanged +} + +// The supergroup sticker set with allowed custom emoji was changed +type ChatEventCustomEmojiStickerSetChanged struct { + 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"` +} + +func (entity *ChatEventCustomEmojiStickerSetChanged) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventCustomEmojiStickerSetChanged + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventCustomEmojiStickerSetChanged) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventCustomEmojiStickerSetChanged) GetType() string { + return TypeChatEventCustomEmojiStickerSetChanged +} + +func (*ChatEventCustomEmojiStickerSetChanged) ChatEventActionType() string { + return TypeChatEventCustomEmojiStickerSetChanged +} + +// The chat title was changed +type ChatEventTitleChanged struct { + meta + // Previous chat title + OldTitle string `json:"old_title"` + // New chat title + NewTitle string `json:"new_title"` +} + +func (entity *ChatEventTitleChanged) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventTitleChanged + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventTitleChanged) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventTitleChanged) GetType() string { + return TypeChatEventTitleChanged +} + +func (*ChatEventTitleChanged) ChatEventActionType() string { + return TypeChatEventTitleChanged +} + +// The chat editable username was changed +type ChatEventUsernameChanged struct { + meta + // Previous chat username + OldUsername string `json:"old_username"` + // New chat username + NewUsername string `json:"new_username"` +} + +func (entity *ChatEventUsernameChanged) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventUsernameChanged + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventUsernameChanged) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventUsernameChanged) GetType() string { + return TypeChatEventUsernameChanged +} + +func (*ChatEventUsernameChanged) ChatEventActionType() string { + return TypeChatEventUsernameChanged +} + +// The chat active usernames were changed +type ChatEventActiveUsernamesChanged struct { + meta + // Previous list of active usernames + OldUsernames []string `json:"old_usernames"` + // New list of active usernames + NewUsernames []string `json:"new_usernames"` +} + +func (entity *ChatEventActiveUsernamesChanged) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventActiveUsernamesChanged + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventActiveUsernamesChanged) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventActiveUsernamesChanged) GetType() string { + return TypeChatEventActiveUsernamesChanged +} + +func (*ChatEventActiveUsernamesChanged) ChatEventActionType() string { + return TypeChatEventActiveUsernamesChanged +} + +// The chat accent color or background custom emoji were changed +type ChatEventAccentColorChanged struct { + meta + // Previous identifier of chat accent color + OldAccentColorId int32 `json:"old_accent_color_id"` + // Previous identifier of the custom emoji; 0 if none + OldBackgroundCustomEmojiId JsonInt64 `json:"old_background_custom_emoji_id"` + // New identifier of chat accent color + NewAccentColorId int32 `json:"new_accent_color_id"` + // New identifier of the custom emoji; 0 if none + NewBackgroundCustomEmojiId JsonInt64 `json:"new_background_custom_emoji_id"` +} + +func (entity *ChatEventAccentColorChanged) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventAccentColorChanged + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventAccentColorChanged) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventAccentColorChanged) GetType() string { + return TypeChatEventAccentColorChanged +} + +func (*ChatEventAccentColorChanged) ChatEventActionType() string { + return TypeChatEventAccentColorChanged +} + +// The chat's profile accent color or profile background custom emoji were changed +type ChatEventProfileAccentColorChanged struct { + meta + // Previous identifier of chat's profile accent color; -1 if none + OldProfileAccentColorId int32 `json:"old_profile_accent_color_id"` + // Previous identifier of the custom emoji; 0 if none + OldProfileBackgroundCustomEmojiId JsonInt64 `json:"old_profile_background_custom_emoji_id"` + // New identifier of chat's profile accent color; -1 if none + NewProfileAccentColorId int32 `json:"new_profile_accent_color_id"` + // New identifier of the custom emoji; 0 if none + NewProfileBackgroundCustomEmojiId JsonInt64 `json:"new_profile_background_custom_emoji_id"` +} + +func (entity *ChatEventProfileAccentColorChanged) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventProfileAccentColorChanged + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventProfileAccentColorChanged) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventProfileAccentColorChanged) GetType() string { + return TypeChatEventProfileAccentColorChanged +} + +func (*ChatEventProfileAccentColorChanged) ChatEventActionType() string { + return TypeChatEventProfileAccentColorChanged +} + +// The has_protected_content setting of a channel was toggled +type ChatEventHasProtectedContentToggled struct { + meta + // New value of has_protected_content + HasProtectedContent bool `json:"has_protected_content"` +} + +func (entity *ChatEventHasProtectedContentToggled) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventHasProtectedContentToggled + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventHasProtectedContentToggled) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventHasProtectedContentToggled) GetType() string { + return TypeChatEventHasProtectedContentToggled +} + +func (*ChatEventHasProtectedContentToggled) ChatEventActionType() string { + return TypeChatEventHasProtectedContentToggled +} + +// The can_invite_users permission of a supergroup chat was toggled +type ChatEventInvitesToggled struct { + meta + // New value of can_invite_users permission + CanInviteUsers bool `json:"can_invite_users"` +} + +func (entity *ChatEventInvitesToggled) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventInvitesToggled + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventInvitesToggled) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventInvitesToggled) GetType() string { + return TypeChatEventInvitesToggled +} + +func (*ChatEventInvitesToggled) ChatEventActionType() string { + return TypeChatEventInvitesToggled +} + +// The is_all_history_available setting of a supergroup was toggled +type ChatEventIsAllHistoryAvailableToggled struct { + meta + // New value of is_all_history_available + IsAllHistoryAvailable bool `json:"is_all_history_available"` +} + +func (entity *ChatEventIsAllHistoryAvailableToggled) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventIsAllHistoryAvailableToggled + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventIsAllHistoryAvailableToggled) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventIsAllHistoryAvailableToggled) GetType() string { + return TypeChatEventIsAllHistoryAvailableToggled +} + +func (*ChatEventIsAllHistoryAvailableToggled) ChatEventActionType() string { + return TypeChatEventIsAllHistoryAvailableToggled +} + +// The has_aggressive_anti_spam_enabled setting of a supergroup was toggled +type ChatEventHasAggressiveAntiSpamEnabledToggled struct { + meta + // New value of has_aggressive_anti_spam_enabled + HasAggressiveAntiSpamEnabled bool `json:"has_aggressive_anti_spam_enabled"` +} + +func (entity *ChatEventHasAggressiveAntiSpamEnabledToggled) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventHasAggressiveAntiSpamEnabledToggled + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventHasAggressiveAntiSpamEnabledToggled) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventHasAggressiveAntiSpamEnabledToggled) GetType() string { + return TypeChatEventHasAggressiveAntiSpamEnabledToggled +} + +func (*ChatEventHasAggressiveAntiSpamEnabledToggled) ChatEventActionType() string { + return TypeChatEventHasAggressiveAntiSpamEnabledToggled +} + +// The sign_messages setting of a channel was toggled +type ChatEventSignMessagesToggled struct { + meta + // New value of sign_messages + SignMessages bool `json:"sign_messages"` +} + +func (entity *ChatEventSignMessagesToggled) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventSignMessagesToggled + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventSignMessagesToggled) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventSignMessagesToggled) GetType() string { + return TypeChatEventSignMessagesToggled +} + +func (*ChatEventSignMessagesToggled) ChatEventActionType() string { + return TypeChatEventSignMessagesToggled +} + +// A chat invite link was edited +type ChatEventInviteLinkEdited struct { + 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"` +} + +func (entity *ChatEventInviteLinkEdited) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventInviteLinkEdited + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventInviteLinkEdited) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventInviteLinkEdited) GetType() string { + return TypeChatEventInviteLinkEdited +} + +func (*ChatEventInviteLinkEdited) ChatEventActionType() string { + return TypeChatEventInviteLinkEdited +} + +// A chat invite link was revoked +type ChatEventInviteLinkRevoked struct { + meta + // The invite link + InviteLink *ChatInviteLink `json:"invite_link"` +} + +func (entity *ChatEventInviteLinkRevoked) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventInviteLinkRevoked + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventInviteLinkRevoked) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventInviteLinkRevoked) GetType() string { + return TypeChatEventInviteLinkRevoked +} + +func (*ChatEventInviteLinkRevoked) ChatEventActionType() string { + return TypeChatEventInviteLinkRevoked +} + +// A revoked chat invite link was deleted +type ChatEventInviteLinkDeleted struct { + meta + // The invite link + InviteLink *ChatInviteLink `json:"invite_link"` +} + +func (entity *ChatEventInviteLinkDeleted) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventInviteLinkDeleted + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventInviteLinkDeleted) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventInviteLinkDeleted) GetType() string { + return TypeChatEventInviteLinkDeleted +} + +func (*ChatEventInviteLinkDeleted) ChatEventActionType() string { + return TypeChatEventInviteLinkDeleted +} + +// A video chat was created +type ChatEventVideoChatCreated struct { + meta + // Identifier of the video chat. The video chat can be received through the method getGroupCall + GroupCallId int32 `json:"group_call_id"` +} + +func (entity *ChatEventVideoChatCreated) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventVideoChatCreated + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventVideoChatCreated) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventVideoChatCreated) GetType() string { + return TypeChatEventVideoChatCreated +} + +func (*ChatEventVideoChatCreated) ChatEventActionType() string { + return TypeChatEventVideoChatCreated +} + +// A video chat was ended +type ChatEventVideoChatEnded struct { + meta + // Identifier of the video chat. The video chat can be received through the method getGroupCall + GroupCallId int32 `json:"group_call_id"` +} + +func (entity *ChatEventVideoChatEnded) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventVideoChatEnded + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventVideoChatEnded) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventVideoChatEnded) GetType() string { + return TypeChatEventVideoChatEnded +} + +func (*ChatEventVideoChatEnded) ChatEventActionType() string { + return TypeChatEventVideoChatEnded +} + +// The mute_new_participants setting of a video chat was toggled +type ChatEventVideoChatMuteNewParticipantsToggled struct { + meta + // New value of the mute_new_participants setting + MuteNewParticipants bool `json:"mute_new_participants"` +} + +func (entity *ChatEventVideoChatMuteNewParticipantsToggled) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventVideoChatMuteNewParticipantsToggled + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventVideoChatMuteNewParticipantsToggled) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventVideoChatMuteNewParticipantsToggled) GetType() string { + return TypeChatEventVideoChatMuteNewParticipantsToggled +} + +func (*ChatEventVideoChatMuteNewParticipantsToggled) ChatEventActionType() string { + return TypeChatEventVideoChatMuteNewParticipantsToggled +} + +// A video chat participant was muted or unmuted +type ChatEventVideoChatParticipantIsMutedToggled struct { + meta + // Identifier of the affected group call participant + ParticipantId MessageSender `json:"participant_id"` + // New value of is_muted + IsMuted bool `json:"is_muted"` +} + +func (entity *ChatEventVideoChatParticipantIsMutedToggled) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventVideoChatParticipantIsMutedToggled + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventVideoChatParticipantIsMutedToggled) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventVideoChatParticipantIsMutedToggled) GetType() string { + return TypeChatEventVideoChatParticipantIsMutedToggled +} + +func (*ChatEventVideoChatParticipantIsMutedToggled) ChatEventActionType() string { + return TypeChatEventVideoChatParticipantIsMutedToggled +} + +func (chatEventVideoChatParticipantIsMutedToggled *ChatEventVideoChatParticipantIsMutedToggled) UnmarshalJSON(data []byte) error { + var tmp struct { + ParticipantId json.RawMessage `json:"participant_id"` + IsMuted bool `json:"is_muted"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + chatEventVideoChatParticipantIsMutedToggled.IsMuted = tmp.IsMuted + + fieldParticipantId, _ := UnmarshalMessageSender(tmp.ParticipantId) + chatEventVideoChatParticipantIsMutedToggled.ParticipantId = fieldParticipantId + + return nil +} + +// A video chat participant volume level was changed +type ChatEventVideoChatParticipantVolumeLevelChanged struct { + 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"` +} + +func (entity *ChatEventVideoChatParticipantVolumeLevelChanged) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventVideoChatParticipantVolumeLevelChanged + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventVideoChatParticipantVolumeLevelChanged) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventVideoChatParticipantVolumeLevelChanged) GetType() string { + return TypeChatEventVideoChatParticipantVolumeLevelChanged +} + +func (*ChatEventVideoChatParticipantVolumeLevelChanged) ChatEventActionType() string { + return TypeChatEventVideoChatParticipantVolumeLevelChanged +} + +func (chatEventVideoChatParticipantVolumeLevelChanged *ChatEventVideoChatParticipantVolumeLevelChanged) UnmarshalJSON(data []byte) error { + var tmp struct { + ParticipantId json.RawMessage `json:"participant_id"` + VolumeLevel int32 `json:"volume_level"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + chatEventVideoChatParticipantVolumeLevelChanged.VolumeLevel = tmp.VolumeLevel + + fieldParticipantId, _ := UnmarshalMessageSender(tmp.ParticipantId) + chatEventVideoChatParticipantVolumeLevelChanged.ParticipantId = fieldParticipantId + + return nil +} + +// The is_forum setting of a channel was toggled +type ChatEventIsForumToggled struct { + meta + // New value of is_forum + IsForum bool `json:"is_forum"` +} + +func (entity *ChatEventIsForumToggled) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventIsForumToggled + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventIsForumToggled) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventIsForumToggled) GetType() string { + return TypeChatEventIsForumToggled +} + +func (*ChatEventIsForumToggled) ChatEventActionType() string { + return TypeChatEventIsForumToggled +} + +// A new forum topic was created +type ChatEventForumTopicCreated struct { + meta + // Information about the topic + TopicInfo *ForumTopicInfo `json:"topic_info"` +} + +func (entity *ChatEventForumTopicCreated) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventForumTopicCreated + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventForumTopicCreated) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventForumTopicCreated) GetType() string { + return TypeChatEventForumTopicCreated +} + +func (*ChatEventForumTopicCreated) ChatEventActionType() string { + return TypeChatEventForumTopicCreated +} + +// A forum topic was edited +type ChatEventForumTopicEdited struct { + meta + // Old information about the topic + OldTopicInfo *ForumTopicInfo `json:"old_topic_info"` + // New information about the topic + NewTopicInfo *ForumTopicInfo `json:"new_topic_info"` +} + +func (entity *ChatEventForumTopicEdited) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventForumTopicEdited + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventForumTopicEdited) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventForumTopicEdited) GetType() string { + return TypeChatEventForumTopicEdited +} + +func (*ChatEventForumTopicEdited) ChatEventActionType() string { + return TypeChatEventForumTopicEdited +} + +// A forum topic was closed or reopened +type ChatEventForumTopicToggleIsClosed struct { + meta + // New information about the topic + TopicInfo *ForumTopicInfo `json:"topic_info"` +} + +func (entity *ChatEventForumTopicToggleIsClosed) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventForumTopicToggleIsClosed + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventForumTopicToggleIsClosed) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventForumTopicToggleIsClosed) GetType() string { + return TypeChatEventForumTopicToggleIsClosed +} + +func (*ChatEventForumTopicToggleIsClosed) ChatEventActionType() string { + return TypeChatEventForumTopicToggleIsClosed +} + +// The General forum topic was hidden or unhidden +type ChatEventForumTopicToggleIsHidden struct { + meta + // New information about the topic + TopicInfo *ForumTopicInfo `json:"topic_info"` +} + +func (entity *ChatEventForumTopicToggleIsHidden) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventForumTopicToggleIsHidden + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventForumTopicToggleIsHidden) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventForumTopicToggleIsHidden) GetType() string { + return TypeChatEventForumTopicToggleIsHidden +} + +func (*ChatEventForumTopicToggleIsHidden) ChatEventActionType() string { + return TypeChatEventForumTopicToggleIsHidden +} + +// A forum topic was deleted +type ChatEventForumTopicDeleted struct { + meta + // Information about the topic + TopicInfo *ForumTopicInfo `json:"topic_info"` +} + +func (entity *ChatEventForumTopicDeleted) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventForumTopicDeleted + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventForumTopicDeleted) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventForumTopicDeleted) GetType() string { + return TypeChatEventForumTopicDeleted +} + +func (*ChatEventForumTopicDeleted) ChatEventActionType() string { + return TypeChatEventForumTopicDeleted +} + +// A pinned forum topic was changed +type ChatEventForumTopicPinned struct { + meta + // Information about the old pinned topic; may be null + OldTopicInfo *ForumTopicInfo `json:"old_topic_info"` + // Information about the new pinned topic; may be null + NewTopicInfo *ForumTopicInfo `json:"new_topic_info"` +} + +func (entity *ChatEventForumTopicPinned) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventForumTopicPinned + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventForumTopicPinned) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventForumTopicPinned) GetType() string { + return TypeChatEventForumTopicPinned +} + +func (*ChatEventForumTopicPinned) ChatEventActionType() string { + return TypeChatEventForumTopicPinned +} + +// Represents a chat event +type ChatEvent struct { + 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"` +} + +func (entity *ChatEvent) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEvent + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEvent) GetClass() string { + return ClassChatEvent +} + +func (*ChatEvent) GetType() string { + return TypeChatEvent +} + +func (chatEvent *ChatEvent) UnmarshalJSON(data []byte) error { + var tmp struct { + Id JsonInt64 `json:"id"` + Date int32 `json:"date"` + MemberId json.RawMessage `json:"member_id"` + Action json.RawMessage `json:"action"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + chatEvent.Id = tmp.Id + chatEvent.Date = tmp.Date + + fieldMemberId, _ := UnmarshalMessageSender(tmp.MemberId) + chatEvent.MemberId = fieldMemberId + + fieldAction, _ := UnmarshalChatEventAction(tmp.Action) + chatEvent.Action = fieldAction + + return nil +} + +// Contains a list of chat events +type ChatEvents struct { + meta + // List of events + Events []*ChatEvent `json:"events"` +} + +func (entity *ChatEvents) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEvents + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEvents) GetClass() string { + return ClassChatEvents +} + +func (*ChatEvents) GetType() string { + return TypeChatEvents +} + +// Represents a set of filters used to obtain a chat event log +type ChatEventLogFilters struct { + 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"` + // True, if forum-related actions need to be returned + ForumChanges bool `json:"forum_changes"` +} + +func (entity *ChatEventLogFilters) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventLogFilters + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventLogFilters) GetClass() string { + return ClassChatEventLogFilters +} + +func (*ChatEventLogFilters) GetType() string { + return TypeChatEventLogFilters +} + +// An ordinary language pack string +type LanguagePackStringValueOrdinary struct { + meta + // String value + Value string `json:"value"` +} + +func (entity *LanguagePackStringValueOrdinary) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub LanguagePackStringValueOrdinary + + return json.Marshal((*stub)(entity)) +} + +func (*LanguagePackStringValueOrdinary) GetClass() string { + return ClassLanguagePackStringValue +} + +func (*LanguagePackStringValueOrdinary) GetType() string { + return TypeLanguagePackStringValueOrdinary +} + +func (*LanguagePackStringValueOrdinary) LanguagePackStringValueType() string { + return TypeLanguagePackStringValueOrdinary +} + +// 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 +type LanguagePackStringValuePluralized struct { + 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"` +} + +func (entity *LanguagePackStringValuePluralized) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub LanguagePackStringValuePluralized + + return json.Marshal((*stub)(entity)) +} + +func (*LanguagePackStringValuePluralized) GetClass() string { + return ClassLanguagePackStringValue +} + +func (*LanguagePackStringValuePluralized) GetType() string { + return TypeLanguagePackStringValuePluralized +} + +func (*LanguagePackStringValuePluralized) LanguagePackStringValueType() string { + return TypeLanguagePackStringValuePluralized +} + +// A deleted language pack string, the value must be taken from the built-in English language pack +type LanguagePackStringValueDeleted struct{ + meta +} + +func (entity *LanguagePackStringValueDeleted) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub LanguagePackStringValueDeleted + + return json.Marshal((*stub)(entity)) +} + +func (*LanguagePackStringValueDeleted) GetClass() string { + return ClassLanguagePackStringValue +} + +func (*LanguagePackStringValueDeleted) GetType() string { + return TypeLanguagePackStringValueDeleted +} + +func (*LanguagePackStringValueDeleted) LanguagePackStringValueType() string { + return TypeLanguagePackStringValueDeleted +} + +// Represents one language pack string +type LanguagePackString struct { + 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"` +} + +func (entity *LanguagePackString) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub LanguagePackString + + return json.Marshal((*stub)(entity)) +} + +func (*LanguagePackString) GetClass() string { + return ClassLanguagePackString +} + +func (*LanguagePackString) GetType() string { + return TypeLanguagePackString +} + +func (languagePackString *LanguagePackString) UnmarshalJSON(data []byte) error { + var tmp struct { + Key string `json:"key"` + Value json.RawMessage `json:"value"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + languagePackString.Key = tmp.Key + + fieldValue, _ := UnmarshalLanguagePackStringValue(tmp.Value) + languagePackString.Value = fieldValue + + return nil +} + +// Contains a list of language pack strings +type LanguagePackStrings struct { + meta + // A list of language pack strings + Strings []*LanguagePackString `json:"strings"` +} + +func (entity *LanguagePackStrings) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub LanguagePackStrings + + return json.Marshal((*stub)(entity)) +} + +func (*LanguagePackStrings) GetClass() string { + return ClassLanguagePackStrings +} + +func (*LanguagePackStrings) GetType() string { + return TypeLanguagePackStrings +} + +// Contains information about a language pack +type LanguagePackInfo struct { + 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"` +} + +func (entity *LanguagePackInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub LanguagePackInfo + + return json.Marshal((*stub)(entity)) +} + +func (*LanguagePackInfo) GetClass() string { + return ClassLanguagePackInfo +} + +func (*LanguagePackInfo) GetType() string { + return TypeLanguagePackInfo +} + +// Contains information about the current localization target +type LocalizationTargetInfo struct { + meta + // List of available language packs for this application + LanguagePacks []*LanguagePackInfo `json:"language_packs"` +} + +func (entity *LocalizationTargetInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub LocalizationTargetInfo + + return json.Marshal((*stub)(entity)) +} + +func (*LocalizationTargetInfo) GetClass() string { + return ClassLocalizationTargetInfo +} + +func (*LocalizationTargetInfo) GetType() string { + return TypeLocalizationTargetInfo +} + +// The maximum number of joined supergroups and channels +type PremiumLimitTypeSupergroupCount struct{ + meta +} + +func (entity *PremiumLimitTypeSupergroupCount) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumLimitTypeSupergroupCount + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumLimitTypeSupergroupCount) GetClass() string { + return ClassPremiumLimitType +} + +func (*PremiumLimitTypeSupergroupCount) GetType() string { + return TypePremiumLimitTypeSupergroupCount +} + +func (*PremiumLimitTypeSupergroupCount) PremiumLimitTypeType() string { + return TypePremiumLimitTypeSupergroupCount +} + +// The maximum number of pinned chats in the main chat list +type PremiumLimitTypePinnedChatCount struct{ + meta +} + +func (entity *PremiumLimitTypePinnedChatCount) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumLimitTypePinnedChatCount + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumLimitTypePinnedChatCount) GetClass() string { + return ClassPremiumLimitType +} + +func (*PremiumLimitTypePinnedChatCount) GetType() string { + return TypePremiumLimitTypePinnedChatCount +} + +func (*PremiumLimitTypePinnedChatCount) PremiumLimitTypeType() string { + return TypePremiumLimitTypePinnedChatCount +} + +// The maximum number of created public chats +type PremiumLimitTypeCreatedPublicChatCount struct{ + meta +} + +func (entity *PremiumLimitTypeCreatedPublicChatCount) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumLimitTypeCreatedPublicChatCount + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumLimitTypeCreatedPublicChatCount) GetClass() string { + return ClassPremiumLimitType +} + +func (*PremiumLimitTypeCreatedPublicChatCount) GetType() string { + return TypePremiumLimitTypeCreatedPublicChatCount +} + +func (*PremiumLimitTypeCreatedPublicChatCount) PremiumLimitTypeType() string { + return TypePremiumLimitTypeCreatedPublicChatCount +} + +// The maximum number of saved animations +type PremiumLimitTypeSavedAnimationCount struct{ + meta +} + +func (entity *PremiumLimitTypeSavedAnimationCount) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumLimitTypeSavedAnimationCount + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumLimitTypeSavedAnimationCount) GetClass() string { + return ClassPremiumLimitType +} + +func (*PremiumLimitTypeSavedAnimationCount) GetType() string { + return TypePremiumLimitTypeSavedAnimationCount +} + +func (*PremiumLimitTypeSavedAnimationCount) PremiumLimitTypeType() string { + return TypePremiumLimitTypeSavedAnimationCount +} + +// The maximum number of favorite stickers +type PremiumLimitTypeFavoriteStickerCount struct{ + meta +} + +func (entity *PremiumLimitTypeFavoriteStickerCount) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumLimitTypeFavoriteStickerCount + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumLimitTypeFavoriteStickerCount) GetClass() string { + return ClassPremiumLimitType +} + +func (*PremiumLimitTypeFavoriteStickerCount) GetType() string { + return TypePremiumLimitTypeFavoriteStickerCount +} + +func (*PremiumLimitTypeFavoriteStickerCount) PremiumLimitTypeType() string { + return TypePremiumLimitTypeFavoriteStickerCount +} + +// The maximum number of chat folders +type PremiumLimitTypeChatFolderCount struct{ + meta +} + +func (entity *PremiumLimitTypeChatFolderCount) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumLimitTypeChatFolderCount + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumLimitTypeChatFolderCount) GetClass() string { + return ClassPremiumLimitType +} + +func (*PremiumLimitTypeChatFolderCount) GetType() string { + return TypePremiumLimitTypeChatFolderCount +} + +func (*PremiumLimitTypeChatFolderCount) PremiumLimitTypeType() string { + return TypePremiumLimitTypeChatFolderCount +} + +// The maximum number of pinned and always included, or always excluded chats in a chat folder +type PremiumLimitTypeChatFolderChosenChatCount struct{ + meta +} + +func (entity *PremiumLimitTypeChatFolderChosenChatCount) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumLimitTypeChatFolderChosenChatCount + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumLimitTypeChatFolderChosenChatCount) GetClass() string { + return ClassPremiumLimitType +} + +func (*PremiumLimitTypeChatFolderChosenChatCount) GetType() string { + return TypePremiumLimitTypeChatFolderChosenChatCount +} + +func (*PremiumLimitTypeChatFolderChosenChatCount) PremiumLimitTypeType() string { + return TypePremiumLimitTypeChatFolderChosenChatCount +} + +// The maximum number of pinned chats in the archive chat list +type PremiumLimitTypePinnedArchivedChatCount struct{ + meta +} + +func (entity *PremiumLimitTypePinnedArchivedChatCount) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumLimitTypePinnedArchivedChatCount + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumLimitTypePinnedArchivedChatCount) GetClass() string { + return ClassPremiumLimitType +} + +func (*PremiumLimitTypePinnedArchivedChatCount) GetType() string { + return TypePremiumLimitTypePinnedArchivedChatCount +} + +func (*PremiumLimitTypePinnedArchivedChatCount) PremiumLimitTypeType() string { + return TypePremiumLimitTypePinnedArchivedChatCount +} + +// The maximum number of pinned Saved Messages topics +type PremiumLimitTypePinnedSavedMessagesTopicCount struct{ + meta +} + +func (entity *PremiumLimitTypePinnedSavedMessagesTopicCount) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumLimitTypePinnedSavedMessagesTopicCount + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumLimitTypePinnedSavedMessagesTopicCount) GetClass() string { + return ClassPremiumLimitType +} + +func (*PremiumLimitTypePinnedSavedMessagesTopicCount) GetType() string { + return TypePremiumLimitTypePinnedSavedMessagesTopicCount +} + +func (*PremiumLimitTypePinnedSavedMessagesTopicCount) PremiumLimitTypeType() string { + return TypePremiumLimitTypePinnedSavedMessagesTopicCount +} + +// The maximum length of sent media caption +type PremiumLimitTypeCaptionLength struct{ + meta +} + +func (entity *PremiumLimitTypeCaptionLength) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumLimitTypeCaptionLength + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumLimitTypeCaptionLength) GetClass() string { + return ClassPremiumLimitType +} + +func (*PremiumLimitTypeCaptionLength) GetType() string { + return TypePremiumLimitTypeCaptionLength +} + +func (*PremiumLimitTypeCaptionLength) PremiumLimitTypeType() string { + return TypePremiumLimitTypeCaptionLength +} + +// The maximum length of the user's bio +type PremiumLimitTypeBioLength struct{ + meta +} + +func (entity *PremiumLimitTypeBioLength) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumLimitTypeBioLength + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumLimitTypeBioLength) GetClass() string { + return ClassPremiumLimitType +} + +func (*PremiumLimitTypeBioLength) GetType() string { + return TypePremiumLimitTypeBioLength +} + +func (*PremiumLimitTypeBioLength) PremiumLimitTypeType() string { + return TypePremiumLimitTypeBioLength +} + +// The maximum number of invite links for a chat folder +type PremiumLimitTypeChatFolderInviteLinkCount struct{ + meta +} + +func (entity *PremiumLimitTypeChatFolderInviteLinkCount) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumLimitTypeChatFolderInviteLinkCount + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumLimitTypeChatFolderInviteLinkCount) GetClass() string { + return ClassPremiumLimitType +} + +func (*PremiumLimitTypeChatFolderInviteLinkCount) GetType() string { + return TypePremiumLimitTypeChatFolderInviteLinkCount +} + +func (*PremiumLimitTypeChatFolderInviteLinkCount) PremiumLimitTypeType() string { + return TypePremiumLimitTypeChatFolderInviteLinkCount +} + +// The maximum number of added shareable chat folders +type PremiumLimitTypeShareableChatFolderCount struct{ + meta +} + +func (entity *PremiumLimitTypeShareableChatFolderCount) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumLimitTypeShareableChatFolderCount + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumLimitTypeShareableChatFolderCount) GetClass() string { + return ClassPremiumLimitType +} + +func (*PremiumLimitTypeShareableChatFolderCount) GetType() string { + return TypePremiumLimitTypeShareableChatFolderCount +} + +func (*PremiumLimitTypeShareableChatFolderCount) PremiumLimitTypeType() string { + return TypePremiumLimitTypeShareableChatFolderCount +} + +// The maximum number of active stories +type PremiumLimitTypeActiveStoryCount struct{ + meta +} + +func (entity *PremiumLimitTypeActiveStoryCount) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumLimitTypeActiveStoryCount + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumLimitTypeActiveStoryCount) GetClass() string { + return ClassPremiumLimitType +} + +func (*PremiumLimitTypeActiveStoryCount) GetType() string { + return TypePremiumLimitTypeActiveStoryCount +} + +func (*PremiumLimitTypeActiveStoryCount) PremiumLimitTypeType() string { + return TypePremiumLimitTypeActiveStoryCount +} + +// The maximum number of stories sent per week +type PremiumLimitTypeWeeklySentStoryCount struct{ + meta +} + +func (entity *PremiumLimitTypeWeeklySentStoryCount) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumLimitTypeWeeklySentStoryCount + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumLimitTypeWeeklySentStoryCount) GetClass() string { + return ClassPremiumLimitType +} + +func (*PremiumLimitTypeWeeklySentStoryCount) GetType() string { + return TypePremiumLimitTypeWeeklySentStoryCount +} + +func (*PremiumLimitTypeWeeklySentStoryCount) PremiumLimitTypeType() string { + return TypePremiumLimitTypeWeeklySentStoryCount +} + +// The maximum number of stories sent per month +type PremiumLimitTypeMonthlySentStoryCount struct{ + meta +} + +func (entity *PremiumLimitTypeMonthlySentStoryCount) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumLimitTypeMonthlySentStoryCount + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumLimitTypeMonthlySentStoryCount) GetClass() string { + return ClassPremiumLimitType +} + +func (*PremiumLimitTypeMonthlySentStoryCount) GetType() string { + return TypePremiumLimitTypeMonthlySentStoryCount +} + +func (*PremiumLimitTypeMonthlySentStoryCount) PremiumLimitTypeType() string { + return TypePremiumLimitTypeMonthlySentStoryCount +} + +// The maximum length of captions of sent stories +type PremiumLimitTypeStoryCaptionLength struct{ + meta +} + +func (entity *PremiumLimitTypeStoryCaptionLength) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumLimitTypeStoryCaptionLength + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumLimitTypeStoryCaptionLength) GetClass() string { + return ClassPremiumLimitType +} + +func (*PremiumLimitTypeStoryCaptionLength) GetType() string { + return TypePremiumLimitTypeStoryCaptionLength +} + +func (*PremiumLimitTypeStoryCaptionLength) PremiumLimitTypeType() string { + return TypePremiumLimitTypeStoryCaptionLength +} + +// The maximum number of suggested reaction areas on a story +type PremiumLimitTypeStorySuggestedReactionAreaCount struct{ + meta +} + +func (entity *PremiumLimitTypeStorySuggestedReactionAreaCount) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumLimitTypeStorySuggestedReactionAreaCount + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumLimitTypeStorySuggestedReactionAreaCount) GetClass() string { + return ClassPremiumLimitType +} + +func (*PremiumLimitTypeStorySuggestedReactionAreaCount) GetType() string { + return TypePremiumLimitTypeStorySuggestedReactionAreaCount +} + +func (*PremiumLimitTypeStorySuggestedReactionAreaCount) PremiumLimitTypeType() string { + return TypePremiumLimitTypeStorySuggestedReactionAreaCount +} + +// The maximum number of received similar chats +type PremiumLimitTypeSimilarChatCount struct{ + meta +} + +func (entity *PremiumLimitTypeSimilarChatCount) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumLimitTypeSimilarChatCount + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumLimitTypeSimilarChatCount) GetClass() string { + return ClassPremiumLimitType +} + +func (*PremiumLimitTypeSimilarChatCount) GetType() string { + return TypePremiumLimitTypeSimilarChatCount +} + +func (*PremiumLimitTypeSimilarChatCount) PremiumLimitTypeType() string { + return TypePremiumLimitTypeSimilarChatCount +} + +// Increased limits +type PremiumFeatureIncreasedLimits struct{ + meta +} + +func (entity *PremiumFeatureIncreasedLimits) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumFeatureIncreasedLimits + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumFeatureIncreasedLimits) GetClass() string { + return ClassPremiumFeature +} + +func (*PremiumFeatureIncreasedLimits) GetType() string { + return TypePremiumFeatureIncreasedLimits +} + +func (*PremiumFeatureIncreasedLimits) PremiumFeatureType() string { + return TypePremiumFeatureIncreasedLimits +} + +// Increased maximum upload file size +type PremiumFeatureIncreasedUploadFileSize struct{ + meta +} + +func (entity *PremiumFeatureIncreasedUploadFileSize) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumFeatureIncreasedUploadFileSize + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumFeatureIncreasedUploadFileSize) GetClass() string { + return ClassPremiumFeature +} + +func (*PremiumFeatureIncreasedUploadFileSize) GetType() string { + return TypePremiumFeatureIncreasedUploadFileSize +} + +func (*PremiumFeatureIncreasedUploadFileSize) PremiumFeatureType() string { + return TypePremiumFeatureIncreasedUploadFileSize +} + +// Improved download speed +type PremiumFeatureImprovedDownloadSpeed struct{ + meta +} + +func (entity *PremiumFeatureImprovedDownloadSpeed) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumFeatureImprovedDownloadSpeed + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumFeatureImprovedDownloadSpeed) GetClass() string { + return ClassPremiumFeature +} + +func (*PremiumFeatureImprovedDownloadSpeed) GetType() string { + return TypePremiumFeatureImprovedDownloadSpeed +} + +func (*PremiumFeatureImprovedDownloadSpeed) PremiumFeatureType() string { + return TypePremiumFeatureImprovedDownloadSpeed +} + +// The ability to convert voice notes to text +type PremiumFeatureVoiceRecognition struct{ + meta +} + +func (entity *PremiumFeatureVoiceRecognition) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumFeatureVoiceRecognition + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumFeatureVoiceRecognition) GetClass() string { + return ClassPremiumFeature +} + +func (*PremiumFeatureVoiceRecognition) GetType() string { + return TypePremiumFeatureVoiceRecognition +} + +func (*PremiumFeatureVoiceRecognition) PremiumFeatureType() string { + return TypePremiumFeatureVoiceRecognition +} + +// Disabled ads +type PremiumFeatureDisabledAds struct{ + meta +} + +func (entity *PremiumFeatureDisabledAds) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumFeatureDisabledAds + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumFeatureDisabledAds) GetClass() string { + return ClassPremiumFeature +} + +func (*PremiumFeatureDisabledAds) GetType() string { + return TypePremiumFeatureDisabledAds +} + +func (*PremiumFeatureDisabledAds) PremiumFeatureType() string { + return TypePremiumFeatureDisabledAds +} + +// Allowed to use more reactions +type PremiumFeatureUniqueReactions struct{ + meta +} + +func (entity *PremiumFeatureUniqueReactions) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumFeatureUniqueReactions + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumFeatureUniqueReactions) GetClass() string { + return ClassPremiumFeature +} + +func (*PremiumFeatureUniqueReactions) GetType() string { + return TypePremiumFeatureUniqueReactions +} + +func (*PremiumFeatureUniqueReactions) PremiumFeatureType() string { + return TypePremiumFeatureUniqueReactions +} + +// Allowed to use premium stickers with unique effects +type PremiumFeatureUniqueStickers struct{ + meta +} + +func (entity *PremiumFeatureUniqueStickers) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumFeatureUniqueStickers + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumFeatureUniqueStickers) GetClass() string { + return ClassPremiumFeature +} + +func (*PremiumFeatureUniqueStickers) GetType() string { + return TypePremiumFeatureUniqueStickers +} + +func (*PremiumFeatureUniqueStickers) PremiumFeatureType() string { + return TypePremiumFeatureUniqueStickers +} + +// Allowed to use custom emoji stickers in message texts and captions +type PremiumFeatureCustomEmoji struct{ + meta +} + +func (entity *PremiumFeatureCustomEmoji) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumFeatureCustomEmoji + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumFeatureCustomEmoji) GetClass() string { + return ClassPremiumFeature +} + +func (*PremiumFeatureCustomEmoji) GetType() string { + return TypePremiumFeatureCustomEmoji +} + +func (*PremiumFeatureCustomEmoji) PremiumFeatureType() string { + return TypePremiumFeatureCustomEmoji +} + +// Ability to change position of the main chat list, archive and mute all new chats from non-contacts, and completely disable notifications about the user's contacts joined Telegram +type PremiumFeatureAdvancedChatManagement struct{ + meta +} + +func (entity *PremiumFeatureAdvancedChatManagement) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumFeatureAdvancedChatManagement + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumFeatureAdvancedChatManagement) GetClass() string { + return ClassPremiumFeature +} + +func (*PremiumFeatureAdvancedChatManagement) GetType() string { + return TypePremiumFeatureAdvancedChatManagement +} + +func (*PremiumFeatureAdvancedChatManagement) PremiumFeatureType() string { + return TypePremiumFeatureAdvancedChatManagement +} + +// A badge in the user's profile +type PremiumFeatureProfileBadge struct{ + meta +} + +func (entity *PremiumFeatureProfileBadge) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumFeatureProfileBadge + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumFeatureProfileBadge) GetClass() string { + return ClassPremiumFeature +} + +func (*PremiumFeatureProfileBadge) GetType() string { + return TypePremiumFeatureProfileBadge +} + +func (*PremiumFeatureProfileBadge) PremiumFeatureType() string { + return TypePremiumFeatureProfileBadge +} + +// The ability to show an emoji status along with the user's name +type PremiumFeatureEmojiStatus struct{ + meta +} + +func (entity *PremiumFeatureEmojiStatus) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumFeatureEmojiStatus + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumFeatureEmojiStatus) GetClass() string { + return ClassPremiumFeature +} + +func (*PremiumFeatureEmojiStatus) GetType() string { + return TypePremiumFeatureEmojiStatus +} + +func (*PremiumFeatureEmojiStatus) PremiumFeatureType() string { + return TypePremiumFeatureEmojiStatus +} + +// Profile photo animation on message and chat screens +type PremiumFeatureAnimatedProfilePhoto struct{ + meta +} + +func (entity *PremiumFeatureAnimatedProfilePhoto) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumFeatureAnimatedProfilePhoto + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumFeatureAnimatedProfilePhoto) GetClass() string { + return ClassPremiumFeature +} + +func (*PremiumFeatureAnimatedProfilePhoto) GetType() string { + return TypePremiumFeatureAnimatedProfilePhoto +} + +func (*PremiumFeatureAnimatedProfilePhoto) PremiumFeatureType() string { + return TypePremiumFeatureAnimatedProfilePhoto +} + +// The ability to set a custom emoji as a forum topic icon +type PremiumFeatureForumTopicIcon struct{ + meta +} + +func (entity *PremiumFeatureForumTopicIcon) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumFeatureForumTopicIcon + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumFeatureForumTopicIcon) GetClass() string { + return ClassPremiumFeature +} + +func (*PremiumFeatureForumTopicIcon) GetType() string { + return TypePremiumFeatureForumTopicIcon +} + +func (*PremiumFeatureForumTopicIcon) PremiumFeatureType() string { + return TypePremiumFeatureForumTopicIcon +} + +// Allowed to set a premium application icons +type PremiumFeatureAppIcons struct{ + meta +} + +func (entity *PremiumFeatureAppIcons) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumFeatureAppIcons + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumFeatureAppIcons) GetClass() string { + return ClassPremiumFeature +} + +func (*PremiumFeatureAppIcons) GetType() string { + return TypePremiumFeatureAppIcons +} + +func (*PremiumFeatureAppIcons) PremiumFeatureType() string { + return TypePremiumFeatureAppIcons +} + +// Allowed to translate chat messages real-time +type PremiumFeatureRealTimeChatTranslation struct{ + meta +} + +func (entity *PremiumFeatureRealTimeChatTranslation) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumFeatureRealTimeChatTranslation + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumFeatureRealTimeChatTranslation) GetClass() string { + return ClassPremiumFeature +} + +func (*PremiumFeatureRealTimeChatTranslation) GetType() string { + return TypePremiumFeatureRealTimeChatTranslation +} + +func (*PremiumFeatureRealTimeChatTranslation) PremiumFeatureType() string { + return TypePremiumFeatureRealTimeChatTranslation +} + +// Allowed to use many additional features for stories +type PremiumFeatureUpgradedStories struct{ + meta +} + +func (entity *PremiumFeatureUpgradedStories) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumFeatureUpgradedStories + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumFeatureUpgradedStories) GetClass() string { + return ClassPremiumFeature +} + +func (*PremiumFeatureUpgradedStories) GetType() string { + return TypePremiumFeatureUpgradedStories +} + +func (*PremiumFeatureUpgradedStories) PremiumFeatureType() string { + return TypePremiumFeatureUpgradedStories +} + +// The ability to boost chats +type PremiumFeatureChatBoost struct{ + meta +} + +func (entity *PremiumFeatureChatBoost) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumFeatureChatBoost + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumFeatureChatBoost) GetClass() string { + return ClassPremiumFeature +} + +func (*PremiumFeatureChatBoost) GetType() string { + return TypePremiumFeatureChatBoost +} + +func (*PremiumFeatureChatBoost) PremiumFeatureType() string { + return TypePremiumFeatureChatBoost +} + +// The ability to choose accent color for replies and user profile +type PremiumFeatureAccentColor struct{ + meta +} + +func (entity *PremiumFeatureAccentColor) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumFeatureAccentColor + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumFeatureAccentColor) GetClass() string { + return ClassPremiumFeature +} + +func (*PremiumFeatureAccentColor) GetType() string { + return TypePremiumFeatureAccentColor +} + +func (*PremiumFeatureAccentColor) PremiumFeatureType() string { + return TypePremiumFeatureAccentColor +} + +// The ability to set private chat background for both users +type PremiumFeatureBackgroundForBoth struct{ + meta +} + +func (entity *PremiumFeatureBackgroundForBoth) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumFeatureBackgroundForBoth + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumFeatureBackgroundForBoth) GetClass() string { + return ClassPremiumFeature +} + +func (*PremiumFeatureBackgroundForBoth) GetType() string { + return TypePremiumFeatureBackgroundForBoth +} + +func (*PremiumFeatureBackgroundForBoth) PremiumFeatureType() string { + return TypePremiumFeatureBackgroundForBoth +} + +// The ability to use tags in Saved Messages +type PremiumFeatureSavedMessagesTags struct{ + meta +} + +func (entity *PremiumFeatureSavedMessagesTags) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumFeatureSavedMessagesTags + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumFeatureSavedMessagesTags) GetClass() string { + return ClassPremiumFeature +} + +func (*PremiumFeatureSavedMessagesTags) GetType() string { + return TypePremiumFeatureSavedMessagesTags +} + +func (*PremiumFeatureSavedMessagesTags) PremiumFeatureType() string { + return TypePremiumFeatureSavedMessagesTags +} + +// The ability to disallow incoming voice and video note messages in private chats using setUserPrivacySettingRules with userPrivacySettingAllowPrivateVoiceAndVideoNoteMessages and to restrict incoming messages from non-contacts using setNewChatPrivacySettings +type PremiumFeatureMessagePrivacy struct{ + meta +} + +func (entity *PremiumFeatureMessagePrivacy) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumFeatureMessagePrivacy + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumFeatureMessagePrivacy) GetClass() string { + return ClassPremiumFeature +} + +func (*PremiumFeatureMessagePrivacy) GetType() string { + return TypePremiumFeatureMessagePrivacy +} + +func (*PremiumFeatureMessagePrivacy) PremiumFeatureType() string { + return TypePremiumFeatureMessagePrivacy +} + +// The ability to view last seen and read times of other users even they can't view last seen or read time for the current user +type PremiumFeatureLastSeenTimes struct{ + meta +} + +func (entity *PremiumFeatureLastSeenTimes) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumFeatureLastSeenTimes + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumFeatureLastSeenTimes) GetClass() string { + return ClassPremiumFeature +} + +func (*PremiumFeatureLastSeenTimes) GetType() string { + return TypePremiumFeatureLastSeenTimes +} + +func (*PremiumFeatureLastSeenTimes) PremiumFeatureType() string { + return TypePremiumFeatureLastSeenTimes +} + +// The ability to use Business features +type PremiumFeatureBusiness struct{ + meta +} + +func (entity *PremiumFeatureBusiness) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumFeatureBusiness + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumFeatureBusiness) GetClass() string { + return ClassPremiumFeature +} + +func (*PremiumFeatureBusiness) GetType() string { + return TypePremiumFeatureBusiness +} + +func (*PremiumFeatureBusiness) PremiumFeatureType() string { + return TypePremiumFeatureBusiness +} + +// The ability to set location +type BusinessFeatureLocation struct{ + meta +} + +func (entity *BusinessFeatureLocation) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BusinessFeatureLocation + + return json.Marshal((*stub)(entity)) +} + +func (*BusinessFeatureLocation) GetClass() string { + return ClassBusinessFeature +} + +func (*BusinessFeatureLocation) GetType() string { + return TypeBusinessFeatureLocation +} + +func (*BusinessFeatureLocation) BusinessFeatureType() string { + return TypeBusinessFeatureLocation +} + +// The ability to set opening hours +type BusinessFeatureOpeningHours struct{ + meta +} + +func (entity *BusinessFeatureOpeningHours) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BusinessFeatureOpeningHours + + return json.Marshal((*stub)(entity)) +} + +func (*BusinessFeatureOpeningHours) GetClass() string { + return ClassBusinessFeature +} + +func (*BusinessFeatureOpeningHours) GetType() string { + return TypeBusinessFeatureOpeningHours +} + +func (*BusinessFeatureOpeningHours) BusinessFeatureType() string { + return TypeBusinessFeatureOpeningHours +} + +// The ability to use quick replies +type BusinessFeatureQuickReplies struct{ + meta +} + +func (entity *BusinessFeatureQuickReplies) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BusinessFeatureQuickReplies + + return json.Marshal((*stub)(entity)) +} + +func (*BusinessFeatureQuickReplies) GetClass() string { + return ClassBusinessFeature +} + +func (*BusinessFeatureQuickReplies) GetType() string { + return TypeBusinessFeatureQuickReplies +} + +func (*BusinessFeatureQuickReplies) BusinessFeatureType() string { + return TypeBusinessFeatureQuickReplies +} + +// The ability to set up a greeting message +type BusinessFeatureGreetingMessage struct{ + meta +} + +func (entity *BusinessFeatureGreetingMessage) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BusinessFeatureGreetingMessage + + return json.Marshal((*stub)(entity)) +} + +func (*BusinessFeatureGreetingMessage) GetClass() string { + return ClassBusinessFeature +} + +func (*BusinessFeatureGreetingMessage) GetType() string { + return TypeBusinessFeatureGreetingMessage +} + +func (*BusinessFeatureGreetingMessage) BusinessFeatureType() string { + return TypeBusinessFeatureGreetingMessage +} + +// The ability to set up an away message +type BusinessFeatureAwayMessage struct{ + meta +} + +func (entity *BusinessFeatureAwayMessage) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BusinessFeatureAwayMessage + + return json.Marshal((*stub)(entity)) +} + +func (*BusinessFeatureAwayMessage) GetClass() string { + return ClassBusinessFeature +} + +func (*BusinessFeatureAwayMessage) GetType() string { + return TypeBusinessFeatureAwayMessage +} + +func (*BusinessFeatureAwayMessage) BusinessFeatureType() string { + return TypeBusinessFeatureAwayMessage +} + +// The ability to create links to the business account with predefined message text +type BusinessFeatureAccountLinks struct{ + meta +} + +func (entity *BusinessFeatureAccountLinks) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BusinessFeatureAccountLinks + + return json.Marshal((*stub)(entity)) +} + +func (*BusinessFeatureAccountLinks) GetClass() string { + return ClassBusinessFeature +} + +func (*BusinessFeatureAccountLinks) GetType() string { + return TypeBusinessFeatureAccountLinks +} + +func (*BusinessFeatureAccountLinks) BusinessFeatureType() string { + return TypeBusinessFeatureAccountLinks +} + +// The ability to customize intro +type BusinessFeatureIntro struct{ + meta +} + +func (entity *BusinessFeatureIntro) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BusinessFeatureIntro + + return json.Marshal((*stub)(entity)) +} + +func (*BusinessFeatureIntro) GetClass() string { + return ClassBusinessFeature +} + +func (*BusinessFeatureIntro) GetType() string { + return TypeBusinessFeatureIntro +} + +func (*BusinessFeatureIntro) BusinessFeatureType() string { + return TypeBusinessFeatureIntro +} + +// The ability to connect a bot to the account +type BusinessFeatureBots struct{ + meta +} + +func (entity *BusinessFeatureBots) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BusinessFeatureBots + + return json.Marshal((*stub)(entity)) +} + +func (*BusinessFeatureBots) GetClass() string { + return ClassBusinessFeature +} + +func (*BusinessFeatureBots) GetType() string { + return TypeBusinessFeatureBots +} + +func (*BusinessFeatureBots) BusinessFeatureType() string { + return TypeBusinessFeatureBots +} + +// The ability to show an emoji status along with the business name +type BusinessFeatureEmojiStatus struct{ + meta +} + +func (entity *BusinessFeatureEmojiStatus) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BusinessFeatureEmojiStatus + + return json.Marshal((*stub)(entity)) +} + +func (*BusinessFeatureEmojiStatus) GetClass() string { + return ClassBusinessFeature +} + +func (*BusinessFeatureEmojiStatus) GetType() string { + return TypeBusinessFeatureEmojiStatus +} + +func (*BusinessFeatureEmojiStatus) BusinessFeatureType() string { + return TypeBusinessFeatureEmojiStatus +} + +// The ability to display folder names for each chat in the chat list +type BusinessFeatureChatFolderTags struct{ + meta +} + +func (entity *BusinessFeatureChatFolderTags) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BusinessFeatureChatFolderTags + + return json.Marshal((*stub)(entity)) +} + +func (*BusinessFeatureChatFolderTags) GetClass() string { + return ClassBusinessFeature +} + +func (*BusinessFeatureChatFolderTags) GetType() string { + return TypeBusinessFeatureChatFolderTags +} + +func (*BusinessFeatureChatFolderTags) BusinessFeatureType() string { + return TypeBusinessFeatureChatFolderTags +} + +// Allowed to use many additional features for stories +type BusinessFeatureUpgradedStories struct{ + meta +} + +func (entity *BusinessFeatureUpgradedStories) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BusinessFeatureUpgradedStories + + return json.Marshal((*stub)(entity)) +} + +func (*BusinessFeatureUpgradedStories) GetClass() string { + return ClassBusinessFeature +} + +func (*BusinessFeatureUpgradedStories) GetType() string { + return TypeBusinessFeatureUpgradedStories +} + +func (*BusinessFeatureUpgradedStories) BusinessFeatureType() string { + return TypeBusinessFeatureUpgradedStories +} + +// Stories of the current user are displayed before stories of non-Premium contacts, supergroups, and channels +type PremiumStoryFeaturePriorityOrder struct{ + meta +} + +func (entity *PremiumStoryFeaturePriorityOrder) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumStoryFeaturePriorityOrder + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumStoryFeaturePriorityOrder) GetClass() string { + return ClassPremiumStoryFeature +} + +func (*PremiumStoryFeaturePriorityOrder) GetType() string { + return TypePremiumStoryFeaturePriorityOrder +} + +func (*PremiumStoryFeaturePriorityOrder) PremiumStoryFeatureType() string { + return TypePremiumStoryFeaturePriorityOrder +} + +// The ability to hide the fact that the user viewed other's stories +type PremiumStoryFeatureStealthMode struct{ + meta +} + +func (entity *PremiumStoryFeatureStealthMode) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumStoryFeatureStealthMode + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumStoryFeatureStealthMode) GetClass() string { + return ClassPremiumStoryFeature +} + +func (*PremiumStoryFeatureStealthMode) GetType() string { + return TypePremiumStoryFeatureStealthMode +} + +func (*PremiumStoryFeatureStealthMode) PremiumStoryFeatureType() string { + return TypePremiumStoryFeatureStealthMode +} + +// The ability to check who opened the current user's stories after they expire +type PremiumStoryFeaturePermanentViewsHistory struct{ + meta +} + +func (entity *PremiumStoryFeaturePermanentViewsHistory) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumStoryFeaturePermanentViewsHistory + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumStoryFeaturePermanentViewsHistory) GetClass() string { + return ClassPremiumStoryFeature +} + +func (*PremiumStoryFeaturePermanentViewsHistory) GetType() string { + return TypePremiumStoryFeaturePermanentViewsHistory +} + +func (*PremiumStoryFeaturePermanentViewsHistory) PremiumStoryFeatureType() string { + return TypePremiumStoryFeaturePermanentViewsHistory +} + +// The ability to set custom expiration duration for stories +type PremiumStoryFeatureCustomExpirationDuration struct{ + meta +} + +func (entity *PremiumStoryFeatureCustomExpirationDuration) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumStoryFeatureCustomExpirationDuration + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumStoryFeatureCustomExpirationDuration) GetClass() string { + return ClassPremiumStoryFeature +} + +func (*PremiumStoryFeatureCustomExpirationDuration) GetType() string { + return TypePremiumStoryFeatureCustomExpirationDuration +} + +func (*PremiumStoryFeatureCustomExpirationDuration) PremiumStoryFeatureType() string { + return TypePremiumStoryFeatureCustomExpirationDuration +} + +// The ability to save other's unprotected stories +type PremiumStoryFeatureSaveStories struct{ + meta +} + +func (entity *PremiumStoryFeatureSaveStories) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumStoryFeatureSaveStories + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumStoryFeatureSaveStories) GetClass() string { + return ClassPremiumStoryFeature +} + +func (*PremiumStoryFeatureSaveStories) GetType() string { + return TypePremiumStoryFeatureSaveStories +} + +func (*PremiumStoryFeatureSaveStories) PremiumStoryFeatureType() string { + return TypePremiumStoryFeatureSaveStories +} + +// The ability to use links and formatting in story caption +type PremiumStoryFeatureLinksAndFormatting struct{ + meta +} + +func (entity *PremiumStoryFeatureLinksAndFormatting) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumStoryFeatureLinksAndFormatting + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumStoryFeatureLinksAndFormatting) GetClass() string { + return ClassPremiumStoryFeature +} + +func (*PremiumStoryFeatureLinksAndFormatting) GetType() string { + return TypePremiumStoryFeatureLinksAndFormatting +} + +func (*PremiumStoryFeatureLinksAndFormatting) PremiumStoryFeatureType() string { + return TypePremiumStoryFeatureLinksAndFormatting +} + +// The ability to choose better quality for viewed stories +type PremiumStoryFeatureVideoQuality struct{ + meta +} + +func (entity *PremiumStoryFeatureVideoQuality) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumStoryFeatureVideoQuality + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumStoryFeatureVideoQuality) GetClass() string { + return ClassPremiumStoryFeature +} + +func (*PremiumStoryFeatureVideoQuality) GetType() string { + return TypePremiumStoryFeatureVideoQuality +} + +func (*PremiumStoryFeatureVideoQuality) PremiumStoryFeatureType() string { + return TypePremiumStoryFeatureVideoQuality +} + +// Contains information about a limit, increased for Premium users +type PremiumLimit struct { + meta + // The type of the limit + Type PremiumLimitType `json:"type"` + // Default value of the limit + DefaultValue int32 `json:"default_value"` + // Value of the limit for Premium users + PremiumValue int32 `json:"premium_value"` +} + +func (entity *PremiumLimit) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumLimit + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumLimit) GetClass() string { + return ClassPremiumLimit +} + +func (*PremiumLimit) GetType() string { + return TypePremiumLimit +} + +func (premiumLimit *PremiumLimit) UnmarshalJSON(data []byte) error { + var tmp struct { + Type json.RawMessage `json:"type"` + DefaultValue int32 `json:"default_value"` + PremiumValue int32 `json:"premium_value"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + premiumLimit.DefaultValue = tmp.DefaultValue + premiumLimit.PremiumValue = tmp.PremiumValue + + fieldType, _ := UnmarshalPremiumLimitType(tmp.Type) + premiumLimit.Type = fieldType + + return nil +} + +// Contains information about features, available to Premium users +type PremiumFeatures struct { + meta + // The list of available features + Features []PremiumFeature `json:"features"` + // The list of limits, increased for Premium users + Limits []*PremiumLimit `json:"limits"` + // An internal link to be opened to pay for Telegram Premium if store payment isn't possible; may be null if direct payment isn't available + PaymentLink InternalLinkType `json:"payment_link"` +} + +func (entity *PremiumFeatures) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumFeatures + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumFeatures) GetClass() string { + return ClassPremiumFeatures +} + +func (*PremiumFeatures) GetType() string { + return TypePremiumFeatures +} + +func (premiumFeatures *PremiumFeatures) UnmarshalJSON(data []byte) error { + var tmp struct { + Features []json.RawMessage `json:"features"` + Limits []*PremiumLimit `json:"limits"` + PaymentLink json.RawMessage `json:"payment_link"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + premiumFeatures.Limits = tmp.Limits + + fieldFeatures, _ := UnmarshalListOfPremiumFeature(tmp.Features) + premiumFeatures.Features = fieldFeatures + + fieldPaymentLink, _ := UnmarshalInternalLinkType(tmp.PaymentLink) + premiumFeatures.PaymentLink = fieldPaymentLink + + return nil +} + +// Contains information about features, available to Business user accounts +type BusinessFeatures struct { + meta + // The list of available business features + Features []BusinessFeature `json:"features"` +} + +func (entity *BusinessFeatures) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BusinessFeatures + + return json.Marshal((*stub)(entity)) +} + +func (*BusinessFeatures) GetClass() string { + return ClassBusinessFeatures +} + +func (*BusinessFeatures) GetType() string { + return TypeBusinessFeatures +} + +func (businessFeatures *BusinessFeatures) UnmarshalJSON(data []byte) error { + var tmp struct { + Features []json.RawMessage `json:"features"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldFeatures, _ := UnmarshalListOfBusinessFeature(tmp.Features) + businessFeatures.Features = fieldFeatures + + return nil +} + +// A limit was exceeded +type PremiumSourceLimitExceeded struct { + meta + // Type of the exceeded limit + LimitType PremiumLimitType `json:"limit_type"` +} + +func (entity *PremiumSourceLimitExceeded) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumSourceLimitExceeded + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumSourceLimitExceeded) GetClass() string { + return ClassPremiumSource +} + +func (*PremiumSourceLimitExceeded) GetType() string { + return TypePremiumSourceLimitExceeded +} + +func (*PremiumSourceLimitExceeded) PremiumSourceType() string { + return TypePremiumSourceLimitExceeded +} + +func (premiumSourceLimitExceeded *PremiumSourceLimitExceeded) UnmarshalJSON(data []byte) error { + var tmp struct { + LimitType json.RawMessage `json:"limit_type"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldLimitType, _ := UnmarshalPremiumLimitType(tmp.LimitType) + premiumSourceLimitExceeded.LimitType = fieldLimitType + + return nil +} + +// A user tried to use a Premium feature +type PremiumSourceFeature struct { + meta + // The used feature + Feature PremiumFeature `json:"feature"` +} + +func (entity *PremiumSourceFeature) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumSourceFeature + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumSourceFeature) GetClass() string { + return ClassPremiumSource +} + +func (*PremiumSourceFeature) GetType() string { + return TypePremiumSourceFeature +} + +func (*PremiumSourceFeature) PremiumSourceType() string { + return TypePremiumSourceFeature +} + +func (premiumSourceFeature *PremiumSourceFeature) UnmarshalJSON(data []byte) error { + var tmp struct { + Feature json.RawMessage `json:"feature"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldFeature, _ := UnmarshalPremiumFeature(tmp.Feature) + premiumSourceFeature.Feature = fieldFeature + + return nil +} + +// A user tried to use a Business feature +type PremiumSourceBusinessFeature struct { + meta + // The used feature; pass null if none specific feature was used + Feature BusinessFeature `json:"feature"` +} + +func (entity *PremiumSourceBusinessFeature) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumSourceBusinessFeature + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumSourceBusinessFeature) GetClass() string { + return ClassPremiumSource +} + +func (*PremiumSourceBusinessFeature) GetType() string { + return TypePremiumSourceBusinessFeature +} + +func (*PremiumSourceBusinessFeature) PremiumSourceType() string { + return TypePremiumSourceBusinessFeature +} + +func (premiumSourceBusinessFeature *PremiumSourceBusinessFeature) UnmarshalJSON(data []byte) error { + var tmp struct { + Feature json.RawMessage `json:"feature"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldFeature, _ := UnmarshalBusinessFeature(tmp.Feature) + premiumSourceBusinessFeature.Feature = fieldFeature + + return nil +} + +// A user tried to use a Premium story feature +type PremiumSourceStoryFeature struct { + meta + // The used feature + Feature PremiumStoryFeature `json:"feature"` +} + +func (entity *PremiumSourceStoryFeature) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumSourceStoryFeature + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumSourceStoryFeature) GetClass() string { + return ClassPremiumSource +} + +func (*PremiumSourceStoryFeature) GetType() string { + return TypePremiumSourceStoryFeature +} + +func (*PremiumSourceStoryFeature) PremiumSourceType() string { + return TypePremiumSourceStoryFeature +} + +func (premiumSourceStoryFeature *PremiumSourceStoryFeature) UnmarshalJSON(data []byte) error { + var tmp struct { + Feature json.RawMessage `json:"feature"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldFeature, _ := UnmarshalPremiumStoryFeature(tmp.Feature) + premiumSourceStoryFeature.Feature = fieldFeature + + return nil +} + +// A user opened an internal link of the type internalLinkTypePremiumFeatures +type PremiumSourceLink struct { + meta + // The referrer from the link + Referrer string `json:"referrer"` +} + +func (entity *PremiumSourceLink) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumSourceLink + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumSourceLink) GetClass() string { + return ClassPremiumSource +} + +func (*PremiumSourceLink) GetType() string { + return TypePremiumSourceLink +} + +func (*PremiumSourceLink) PremiumSourceType() string { + return TypePremiumSourceLink +} + +// A user opened the Premium features screen from settings +type PremiumSourceSettings struct{ + meta +} + +func (entity *PremiumSourceSettings) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumSourceSettings + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumSourceSettings) GetClass() string { + return ClassPremiumSource +} + +func (*PremiumSourceSettings) GetType() string { + return TypePremiumSourceSettings +} + +func (*PremiumSourceSettings) PremiumSourceType() string { + return TypePremiumSourceSettings +} + +// Describes a promotion animation for a Premium feature +type PremiumFeaturePromotionAnimation struct { + meta + // Premium feature + Feature PremiumFeature `json:"feature"` + // Promotion animation for the feature + Animation *Animation `json:"animation"` +} + +func (entity *PremiumFeaturePromotionAnimation) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumFeaturePromotionAnimation + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumFeaturePromotionAnimation) GetClass() string { + return ClassPremiumFeaturePromotionAnimation +} + +func (*PremiumFeaturePromotionAnimation) GetType() string { + return TypePremiumFeaturePromotionAnimation +} + +func (premiumFeaturePromotionAnimation *PremiumFeaturePromotionAnimation) UnmarshalJSON(data []byte) error { + var tmp struct { + Feature json.RawMessage `json:"feature"` + Animation *Animation `json:"animation"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + premiumFeaturePromotionAnimation.Animation = tmp.Animation + + fieldFeature, _ := UnmarshalPremiumFeature(tmp.Feature) + premiumFeaturePromotionAnimation.Feature = fieldFeature + + return nil +} + +// Describes a promotion animation for a Business feature +type BusinessFeaturePromotionAnimation struct { + meta + // Business feature + Feature BusinessFeature `json:"feature"` + // Promotion animation for the feature + Animation *Animation `json:"animation"` +} + +func (entity *BusinessFeaturePromotionAnimation) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BusinessFeaturePromotionAnimation + + return json.Marshal((*stub)(entity)) +} + +func (*BusinessFeaturePromotionAnimation) GetClass() string { + return ClassBusinessFeaturePromotionAnimation +} + +func (*BusinessFeaturePromotionAnimation) GetType() string { + return TypeBusinessFeaturePromotionAnimation +} + +func (businessFeaturePromotionAnimation *BusinessFeaturePromotionAnimation) UnmarshalJSON(data []byte) error { + var tmp struct { + Feature json.RawMessage `json:"feature"` + Animation *Animation `json:"animation"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + businessFeaturePromotionAnimation.Animation = tmp.Animation + + fieldFeature, _ := UnmarshalBusinessFeature(tmp.Feature) + businessFeaturePromotionAnimation.Feature = fieldFeature + + return nil +} + +// Contains state of Telegram Premium subscription and promotion videos for Premium features +type PremiumState struct { + meta + // Text description of the state of the current Premium subscription; may be empty if the current user has no Telegram Premium subscription + State *FormattedText `json:"state"` + // The list of available options for buying Telegram Premium + PaymentOptions []*PremiumStatePaymentOption `json:"payment_options"` + // The list of available promotion animations for Premium features + Animations []*PremiumFeaturePromotionAnimation `json:"animations"` + // The list of available promotion animations for Business features + BusinessAnimations []*BusinessFeaturePromotionAnimation `json:"business_animations"` +} + +func (entity *PremiumState) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumState + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumState) GetClass() string { + return ClassPremiumState +} + +func (*PremiumState) GetType() string { + return TypePremiumState +} + +// The user subscribing to Telegram Premium +type StorePaymentPurposePremiumSubscription struct { + meta + // Pass true if this is a restore of a Telegram Premium purchase; only for App Store + IsRestore bool `json:"is_restore"` + // Pass true if this is an upgrade from a monthly subscription to early subscription; only for App Store + IsUpgrade bool `json:"is_upgrade"` +} + +func (entity *StorePaymentPurposePremiumSubscription) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StorePaymentPurposePremiumSubscription + + return json.Marshal((*stub)(entity)) +} + +func (*StorePaymentPurposePremiumSubscription) GetClass() string { + return ClassStorePaymentPurpose +} + +func (*StorePaymentPurposePremiumSubscription) GetType() string { + return TypeStorePaymentPurposePremiumSubscription +} + +func (*StorePaymentPurposePremiumSubscription) StorePaymentPurposeType() string { + return TypeStorePaymentPurposePremiumSubscription +} + +// The user gifting Telegram Premium to another user +type StorePaymentPurposeGiftedPremium struct { + meta + // Identifier of the user to which Premium was gifted + UserId int64 `json:"user_id"` + // ISO 4217 currency code of the payment currency + Currency string `json:"currency"` + // Paid amount, in the smallest units of the currency + Amount int64 `json:"amount"` +} + +func (entity *StorePaymentPurposeGiftedPremium) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StorePaymentPurposeGiftedPremium + + return json.Marshal((*stub)(entity)) +} + +func (*StorePaymentPurposeGiftedPremium) GetClass() string { + return ClassStorePaymentPurpose +} + +func (*StorePaymentPurposeGiftedPremium) GetType() string { + return TypeStorePaymentPurposeGiftedPremium +} + +func (*StorePaymentPurposeGiftedPremium) StorePaymentPurposeType() string { + return TypeStorePaymentPurposeGiftedPremium +} + +// The user creating Telegram Premium gift codes for other users +type StorePaymentPurposePremiumGiftCodes struct { + meta + // Identifier of the supergroup or channel chat, which will be automatically boosted by the users for duration of the Premium subscription and which is administered by the user; 0 if none + BoostedChatId int64 `json:"boosted_chat_id"` + // ISO 4217 currency code of the payment currency + Currency string `json:"currency"` + // Paid amount, in the smallest units of the currency + Amount int64 `json:"amount"` + // Identifiers of the users which can activate the gift codes + UserIds []int64 `json:"user_ids"` +} + +func (entity *StorePaymentPurposePremiumGiftCodes) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StorePaymentPurposePremiumGiftCodes + + return json.Marshal((*stub)(entity)) +} + +func (*StorePaymentPurposePremiumGiftCodes) GetClass() string { + return ClassStorePaymentPurpose +} + +func (*StorePaymentPurposePremiumGiftCodes) GetType() string { + return TypeStorePaymentPurposePremiumGiftCodes +} + +func (*StorePaymentPurposePremiumGiftCodes) StorePaymentPurposeType() string { + return TypeStorePaymentPurposePremiumGiftCodes +} + +// The user creating a Telegram Premium giveaway +type StorePaymentPurposePremiumGiveaway struct { + meta + // Giveaway parameters + Parameters *PremiumGiveawayParameters `json:"parameters"` + // ISO 4217 currency code of the payment currency + Currency string `json:"currency"` + // Paid amount, in the smallest units of the currency + Amount int64 `json:"amount"` +} + +func (entity *StorePaymentPurposePremiumGiveaway) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StorePaymentPurposePremiumGiveaway + + return json.Marshal((*stub)(entity)) +} + +func (*StorePaymentPurposePremiumGiveaway) GetClass() string { + return ClassStorePaymentPurpose +} + +func (*StorePaymentPurposePremiumGiveaway) GetType() string { + return TypeStorePaymentPurposePremiumGiveaway +} + +func (*StorePaymentPurposePremiumGiveaway) StorePaymentPurposeType() string { + return TypeStorePaymentPurposePremiumGiveaway +} + +// The user creating Telegram Premium gift codes for other users +type TelegramPaymentPurposePremiumGiftCodes struct { + meta + // Identifier of the supergroup or channel chat, which will be automatically boosted by the users for duration of the Premium subscription and which is administered by the user; 0 if none + BoostedChatId int64 `json:"boosted_chat_id"` + // ISO 4217 currency code of the payment currency + Currency string `json:"currency"` + // Paid amount, in the smallest units of the currency + Amount int64 `json:"amount"` + // Identifiers of the users which can activate the gift codes + UserIds []int64 `json:"user_ids"` + // Number of months the Telegram Premium subscription will be active for the users + MonthCount int32 `json:"month_count"` +} + +func (entity *TelegramPaymentPurposePremiumGiftCodes) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TelegramPaymentPurposePremiumGiftCodes + + return json.Marshal((*stub)(entity)) +} + +func (*TelegramPaymentPurposePremiumGiftCodes) GetClass() string { + return ClassTelegramPaymentPurpose +} + +func (*TelegramPaymentPurposePremiumGiftCodes) GetType() string { + return TypeTelegramPaymentPurposePremiumGiftCodes +} + +func (*TelegramPaymentPurposePremiumGiftCodes) TelegramPaymentPurposeType() string { + return TypeTelegramPaymentPurposePremiumGiftCodes +} + +// The user creating a Telegram Premium giveaway +type TelegramPaymentPurposePremiumGiveaway struct { + meta + // Giveaway parameters + Parameters *PremiumGiveawayParameters `json:"parameters"` + // ISO 4217 currency code of the payment currency + Currency string `json:"currency"` + // Paid amount, in the smallest units of the currency + Amount int64 `json:"amount"` + // Number of users which will be able to activate the gift codes + WinnerCount int32 `json:"winner_count"` + // Number of months the Telegram Premium subscription will be active for the users + MonthCount int32 `json:"month_count"` +} + +func (entity *TelegramPaymentPurposePremiumGiveaway) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TelegramPaymentPurposePremiumGiveaway + + return json.Marshal((*stub)(entity)) +} + +func (*TelegramPaymentPurposePremiumGiveaway) GetClass() string { + return ClassTelegramPaymentPurpose +} + +func (*TelegramPaymentPurposePremiumGiveaway) GetType() string { + return TypeTelegramPaymentPurposePremiumGiveaway +} + +func (*TelegramPaymentPurposePremiumGiveaway) TelegramPaymentPurposeType() string { + return TypeTelegramPaymentPurposePremiumGiveaway +} + +// +type //-To struct{ + meta +} + +func (entity *//-To) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub //-To + + return json.Marshal((*stub)(entity)) +} + +func (*//-To) GetClass() string { + return Class//-To +} + +func (*//-To) GetType() string { + return Type//-To +} + +// A token for Firebase Cloud Messaging +type DeviceTokenFirebaseCloudMessaging struct { + 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"` +} + +func (entity *DeviceTokenFirebaseCloudMessaging) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub DeviceTokenFirebaseCloudMessaging + + return json.Marshal((*stub)(entity)) +} + +func (*DeviceTokenFirebaseCloudMessaging) GetClass() string { + return ClassDeviceToken +} + +func (*DeviceTokenFirebaseCloudMessaging) GetType() string { + return TypeDeviceTokenFirebaseCloudMessaging +} + +func (*DeviceTokenFirebaseCloudMessaging) DeviceTokenType() string { + return TypeDeviceTokenFirebaseCloudMessaging +} + +// A token for Apple Push Notification service +type DeviceTokenApplePush struct { + 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"` +} + +func (entity *DeviceTokenApplePush) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub DeviceTokenApplePush + + return json.Marshal((*stub)(entity)) +} + +func (*DeviceTokenApplePush) GetClass() string { + return ClassDeviceToken +} + +func (*DeviceTokenApplePush) GetType() string { + return TypeDeviceTokenApplePush +} + +func (*DeviceTokenApplePush) DeviceTokenType() string { + return TypeDeviceTokenApplePush +} + +// A token for Apple Push Notification service VoIP notifications +type DeviceTokenApplePushVoIP struct { + 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"` +} + +func (entity *DeviceTokenApplePushVoIP) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub DeviceTokenApplePushVoIP + + return json.Marshal((*stub)(entity)) +} + +func (*DeviceTokenApplePushVoIP) GetClass() string { + return ClassDeviceToken +} + +func (*DeviceTokenApplePushVoIP) GetType() string { + return TypeDeviceTokenApplePushVoIP +} + +func (*DeviceTokenApplePushVoIP) DeviceTokenType() string { + return TypeDeviceTokenApplePushVoIP +} + +// A token for Windows Push Notification Services +type DeviceTokenWindowsPush struct { + meta + // The access token that will be used to send notifications; may be empty to deregister a device + AccessToken string `json:"access_token"` +} + +func (entity *DeviceTokenWindowsPush) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub DeviceTokenWindowsPush + + return json.Marshal((*stub)(entity)) +} + +func (*DeviceTokenWindowsPush) GetClass() string { + return ClassDeviceToken +} + +func (*DeviceTokenWindowsPush) GetType() string { + return TypeDeviceTokenWindowsPush +} + +func (*DeviceTokenWindowsPush) DeviceTokenType() string { + return TypeDeviceTokenWindowsPush +} + +// A token for Microsoft Push Notification Service +type DeviceTokenMicrosoftPush struct { + meta + // Push notification channel URI; may be empty to deregister a device + ChannelUri string `json:"channel_uri"` +} + +func (entity *DeviceTokenMicrosoftPush) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub DeviceTokenMicrosoftPush + + return json.Marshal((*stub)(entity)) +} + +func (*DeviceTokenMicrosoftPush) GetClass() string { + return ClassDeviceToken +} + +func (*DeviceTokenMicrosoftPush) GetType() string { + return TypeDeviceTokenMicrosoftPush +} + +func (*DeviceTokenMicrosoftPush) DeviceTokenType() string { + return TypeDeviceTokenMicrosoftPush +} + +// A token for Microsoft Push Notification Service VoIP channel +type DeviceTokenMicrosoftPushVoIP struct { + meta + // Push notification channel URI; may be empty to deregister a device + ChannelUri string `json:"channel_uri"` +} + +func (entity *DeviceTokenMicrosoftPushVoIP) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub DeviceTokenMicrosoftPushVoIP + + return json.Marshal((*stub)(entity)) +} + +func (*DeviceTokenMicrosoftPushVoIP) GetClass() string { + return ClassDeviceToken +} + +func (*DeviceTokenMicrosoftPushVoIP) GetType() string { + return TypeDeviceTokenMicrosoftPushVoIP +} + +func (*DeviceTokenMicrosoftPushVoIP) DeviceTokenType() string { + return TypeDeviceTokenMicrosoftPushVoIP +} + +// A token for web Push API +type DeviceTokenWebPush struct { + 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"` +} + +func (entity *DeviceTokenWebPush) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub DeviceTokenWebPush + + return json.Marshal((*stub)(entity)) +} + +func (*DeviceTokenWebPush) GetClass() string { + return ClassDeviceToken +} + +func (*DeviceTokenWebPush) GetType() string { + return TypeDeviceTokenWebPush +} + +func (*DeviceTokenWebPush) DeviceTokenType() string { + return TypeDeviceTokenWebPush +} + +// A token for Simple Push API for Firefox OS +type DeviceTokenSimplePush struct { + 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"` +} + +func (entity *DeviceTokenSimplePush) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub DeviceTokenSimplePush + + return json.Marshal((*stub)(entity)) +} + +func (*DeviceTokenSimplePush) GetClass() string { + return ClassDeviceToken +} + +func (*DeviceTokenSimplePush) GetType() string { + return TypeDeviceTokenSimplePush +} + +func (*DeviceTokenSimplePush) DeviceTokenType() string { + return TypeDeviceTokenSimplePush +} + +// A token for Ubuntu Push Client service +type DeviceTokenUbuntuPush struct { + meta + // Token; may be empty to deregister a device + Token string `json:"token"` +} + +func (entity *DeviceTokenUbuntuPush) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub DeviceTokenUbuntuPush + + return json.Marshal((*stub)(entity)) +} + +func (*DeviceTokenUbuntuPush) GetClass() string { + return ClassDeviceToken +} + +func (*DeviceTokenUbuntuPush) GetType() string { + return TypeDeviceTokenUbuntuPush +} + +func (*DeviceTokenUbuntuPush) DeviceTokenType() string { + return TypeDeviceTokenUbuntuPush +} + +// A token for BlackBerry Push Service +type DeviceTokenBlackBerryPush struct { + meta + // Token; may be empty to deregister a device + Token string `json:"token"` +} + +func (entity *DeviceTokenBlackBerryPush) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub DeviceTokenBlackBerryPush + + return json.Marshal((*stub)(entity)) +} + +func (*DeviceTokenBlackBerryPush) GetClass() string { + return ClassDeviceToken +} + +func (*DeviceTokenBlackBerryPush) GetType() string { + return TypeDeviceTokenBlackBerryPush +} + +func (*DeviceTokenBlackBerryPush) DeviceTokenType() string { + return TypeDeviceTokenBlackBerryPush +} + +// A token for Tizen Push Service +type DeviceTokenTizenPush struct { + meta + // Push service registration identifier; may be empty to deregister a device + RegId string `json:"reg_id"` +} + +func (entity *DeviceTokenTizenPush) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub DeviceTokenTizenPush + + return json.Marshal((*stub)(entity)) +} + +func (*DeviceTokenTizenPush) GetClass() string { + return ClassDeviceToken +} + +func (*DeviceTokenTizenPush) GetType() string { + return TypeDeviceTokenTizenPush +} + +func (*DeviceTokenTizenPush) DeviceTokenType() string { + return TypeDeviceTokenTizenPush +} + +// A token for HUAWEI Push Service +type DeviceTokenHuaweiPush struct { + 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"` +} + +func (entity *DeviceTokenHuaweiPush) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub DeviceTokenHuaweiPush + + return json.Marshal((*stub)(entity)) +} + +func (*DeviceTokenHuaweiPush) GetClass() string { + return ClassDeviceToken +} + +func (*DeviceTokenHuaweiPush) GetType() string { + return TypeDeviceTokenHuaweiPush +} + +func (*DeviceTokenHuaweiPush) DeviceTokenType() string { + return TypeDeviceTokenHuaweiPush +} + +// Contains a globally unique push receiver identifier, which can be used to identify which account has received a push notification +type PushReceiverId struct { + meta + // The globally unique identifier of push notification subscription + Id JsonInt64 `json:"id"` +} + +func (entity *PushReceiverId) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PushReceiverId + + return json.Marshal((*stub)(entity)) +} + +func (*PushReceiverId) GetClass() string { + return ClassPushReceiverId +} + +func (*PushReceiverId) GetType() string { + return TypePushReceiverId +} + +// Describes a solid fill of a background +type BackgroundFillSolid struct { + meta + // A color of the background in the RGB24 format + Color int32 `json:"color"` +} + +func (entity *BackgroundFillSolid) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BackgroundFillSolid + + return json.Marshal((*stub)(entity)) +} + +func (*BackgroundFillSolid) GetClass() string { + return ClassBackgroundFill +} + +func (*BackgroundFillSolid) GetType() string { + return TypeBackgroundFillSolid +} + +func (*BackgroundFillSolid) BackgroundFillType() string { + return TypeBackgroundFillSolid +} + +// Describes a gradient fill of a background +type BackgroundFillGradient struct { + 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 always be divisible by 45 + RotationAngle int32 `json:"rotation_angle"` +} + +func (entity *BackgroundFillGradient) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BackgroundFillGradient + + return json.Marshal((*stub)(entity)) +} + +func (*BackgroundFillGradient) GetClass() string { + return ClassBackgroundFill +} + +func (*BackgroundFillGradient) GetType() string { + return TypeBackgroundFillGradient +} + +func (*BackgroundFillGradient) BackgroundFillType() string { + return TypeBackgroundFillGradient +} + +// Describes a freeform gradient fill of a background +type BackgroundFillFreeformGradient struct { + meta + // A list of 3 or 4 colors of the freeform gradients in the RGB24 format + Colors []int32 `json:"colors"` +} + +func (entity *BackgroundFillFreeformGradient) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BackgroundFillFreeformGradient + + return json.Marshal((*stub)(entity)) +} + +func (*BackgroundFillFreeformGradient) GetClass() string { + return ClassBackgroundFill +} + +func (*BackgroundFillFreeformGradient) GetType() string { + return TypeBackgroundFillFreeformGradient +} + +func (*BackgroundFillFreeformGradient) BackgroundFillType() string { + return TypeBackgroundFillFreeformGradient +} + +// A wallpaper in JPEG format +type BackgroundTypeWallpaper struct { + 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"` +} + +func (entity *BackgroundTypeWallpaper) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BackgroundTypeWallpaper + + return json.Marshal((*stub)(entity)) +} + +func (*BackgroundTypeWallpaper) GetClass() string { + return ClassBackgroundType +} + +func (*BackgroundTypeWallpaper) GetType() string { + return TypeBackgroundTypeWallpaper +} + +func (*BackgroundTypeWallpaper) BackgroundTypeType() string { + return TypeBackgroundTypeWallpaper +} + +// 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 { + 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"` +} + +func (entity *BackgroundTypePattern) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BackgroundTypePattern + + return json.Marshal((*stub)(entity)) +} + +func (*BackgroundTypePattern) GetClass() string { + return ClassBackgroundType +} + +func (*BackgroundTypePattern) GetType() string { + return TypeBackgroundTypePattern +} + +func (*BackgroundTypePattern) BackgroundTypeType() string { + return TypeBackgroundTypePattern +} + +func (backgroundTypePattern *BackgroundTypePattern) UnmarshalJSON(data []byte) error { + var tmp struct { + Fill json.RawMessage `json:"fill"` + Intensity int32 `json:"intensity"` + IsInverted bool `json:"is_inverted"` + IsMoving bool `json:"is_moving"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + backgroundTypePattern.Intensity = tmp.Intensity + backgroundTypePattern.IsInverted = tmp.IsInverted + backgroundTypePattern.IsMoving = tmp.IsMoving + + fieldFill, _ := UnmarshalBackgroundFill(tmp.Fill) + backgroundTypePattern.Fill = fieldFill + + return nil +} + +// A filled background +type BackgroundTypeFill struct { + meta + // The background fill + Fill BackgroundFill `json:"fill"` +} + +func (entity *BackgroundTypeFill) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BackgroundTypeFill + + return json.Marshal((*stub)(entity)) +} + +func (*BackgroundTypeFill) GetClass() string { + return ClassBackgroundType +} + +func (*BackgroundTypeFill) GetType() string { + return TypeBackgroundTypeFill +} + +func (*BackgroundTypeFill) BackgroundTypeType() string { + return TypeBackgroundTypeFill +} + +func (backgroundTypeFill *BackgroundTypeFill) UnmarshalJSON(data []byte) error { + var tmp struct { + Fill json.RawMessage `json:"fill"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldFill, _ := UnmarshalBackgroundFill(tmp.Fill) + backgroundTypeFill.Fill = fieldFill + + return nil +} + +// A background from a chat theme; can be used only as a chat background in channels +type BackgroundTypeChatTheme struct { + meta + // Name of the chat theme + ThemeName string `json:"theme_name"` +} + +func (entity *BackgroundTypeChatTheme) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BackgroundTypeChatTheme + + return json.Marshal((*stub)(entity)) +} + +func (*BackgroundTypeChatTheme) GetClass() string { + return ClassBackgroundType +} + +func (*BackgroundTypeChatTheme) GetType() string { + return TypeBackgroundTypeChatTheme +} + +func (*BackgroundTypeChatTheme) BackgroundTypeType() string { + return TypeBackgroundTypeChatTheme } // A background from a local file type InputBackgroundLocal struct { - 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"` + 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"` } func (entity *InputBackgroundLocal) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub InputBackgroundLocal + type stub InputBackgroundLocal - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*InputBackgroundLocal) GetClass() string { - return ClassInputBackground + return ClassInputBackground } func (*InputBackgroundLocal) GetType() string { - return TypeInputBackgroundLocal + return TypeInputBackgroundLocal } func (*InputBackgroundLocal) InputBackgroundType() string { - return TypeInputBackgroundLocal + return TypeInputBackgroundLocal } func (inputBackgroundLocal *InputBackgroundLocal) UnmarshalJSON(data []byte) error { - var tmp struct { - Background json.RawMessage `json:"background"` - } + var tmp struct { + Background json.RawMessage `json:"background"` + } - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } - fieldBackground, _ := UnmarshalInputFile(tmp.Background) - inputBackgroundLocal.Background = fieldBackground + fieldBackground, _ := UnmarshalInputFile(tmp.Background) + inputBackgroundLocal.Background = fieldBackground - return nil + return nil } // A background from the server type InputBackgroundRemote struct { - meta - // The background identifier - BackgroundId JsonInt64 `json:"background_id"` + meta + // The background identifier + BackgroundId JsonInt64 `json:"background_id"` } func (entity *InputBackgroundRemote) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub InputBackgroundRemote + type stub InputBackgroundRemote - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*InputBackgroundRemote) GetClass() string { - return ClassInputBackground + return ClassInputBackground } func (*InputBackgroundRemote) GetType() string { - return TypeInputBackgroundRemote + return TypeInputBackgroundRemote } func (*InputBackgroundRemote) InputBackgroundType() string { - return TypeInputBackgroundRemote + return TypeInputBackgroundRemote +} + +// A background previously set in the chat; for chat backgrounds only +type InputBackgroundPrevious struct { + meta + // Identifier of the message with the background + MessageId int64 `json:"message_id"` +} + +func (entity *InputBackgroundPrevious) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputBackgroundPrevious + + return json.Marshal((*stub)(entity)) +} + +func (*InputBackgroundPrevious) GetClass() string { + return ClassInputBackground +} + +func (*InputBackgroundPrevious) GetType() string { + return TypeInputBackgroundPrevious +} + +func (*InputBackgroundPrevious) InputBackgroundType() string { + return TypeInputBackgroundPrevious } // Describes theme settings type ThemeSettings struct { - 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"` + 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"` } func (entity *ThemeSettings) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub ThemeSettings + type stub ThemeSettings - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*ThemeSettings) GetClass() string { - return ClassThemeSettings + return ClassThemeSettings } func (*ThemeSettings) GetType() string { - return TypeThemeSettings + return TypeThemeSettings } func (themeSettings *ThemeSettings) UnmarshalJSON(data []byte) error { - 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"` - } + 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"` + } - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } - themeSettings.AccentColor = tmp.AccentColor - themeSettings.Background = tmp.Background - themeSettings.AnimateOutgoingMessageFill = tmp.AnimateOutgoingMessageFill - themeSettings.OutgoingMessageAccentColor = tmp.OutgoingMessageAccentColor + themeSettings.AccentColor = tmp.AccentColor + themeSettings.Background = tmp.Background + themeSettings.AnimateOutgoingMessageFill = tmp.AnimateOutgoingMessageFill + themeSettings.OutgoingMessageAccentColor = tmp.OutgoingMessageAccentColor - fieldOutgoingMessageFill, _ := UnmarshalBackgroundFill(tmp.OutgoingMessageFill) - themeSettings.OutgoingMessageFill = fieldOutgoingMessageFill + fieldOutgoingMessageFill, _ := UnmarshalBackgroundFill(tmp.OutgoingMessageFill) + themeSettings.OutgoingMessageFill = fieldOutgoingMessageFill - return nil + return nil } // Describes a chat theme type ChatTheme struct { - 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"` + 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"` } func (entity *ChatTheme) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub ChatTheme + type stub ChatTheme - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*ChatTheme) GetClass() string { - return ClassChatTheme + return ClassChatTheme } func (*ChatTheme) GetType() string { - return TypeChatTheme + return TypeChatTheme +} + +// Describes a time zone +type TimeZone struct { + meta + // Unique time zone identifier + Id string `json:"id"` + // Time zone name + Name string `json:"name"` + // Current UTC time offset for the time zone + UtcTimeOffset int32 `json:"utc_time_offset"` +} + +func (entity *TimeZone) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TimeZone + + return json.Marshal((*stub)(entity)) +} + +func (*TimeZone) GetClass() string { + return ClassTimeZone +} + +func (*TimeZone) GetType() string { + return TypeTimeZone +} + +// Contains a list of time zones +type TimeZones struct { + meta + // A list of time zones + TimeZones []*TimeZone `json:"time_zones"` +} + +func (entity *TimeZones) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TimeZones + + return json.Marshal((*stub)(entity)) +} + +func (*TimeZones) GetClass() string { + return ClassTimeZones +} + +func (*TimeZones) GetType() string { + return TypeTimeZones } // Contains a list of hashtags type Hashtags struct { - meta - // A list of hashtags - Hashtags []string `json:"hashtags"` + meta + // A list of hashtags + Hashtags []string `json:"hashtags"` } func (entity *Hashtags) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub Hashtags + type stub Hashtags - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*Hashtags) GetClass() string { - return ClassHashtags + return ClassHashtags } func (*Hashtags) GetType() string { - return TypeHashtags + return TypeHashtags +} + +// A story can be sent +type CanSendStoryResultOk struct{ + meta +} + +func (entity *CanSendStoryResultOk) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CanSendStoryResultOk + + return json.Marshal((*stub)(entity)) +} + +func (*CanSendStoryResultOk) GetClass() string { + return ClassCanSendStoryResult +} + +func (*CanSendStoryResultOk) GetType() string { + return TypeCanSendStoryResultOk +} + +func (*CanSendStoryResultOk) CanSendStoryResultType() string { + return TypeCanSendStoryResultOk +} + +// The user must subscribe to Telegram Premium to be able to post stories +type CanSendStoryResultPremiumNeeded struct{ + meta +} + +func (entity *CanSendStoryResultPremiumNeeded) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CanSendStoryResultPremiumNeeded + + return json.Marshal((*stub)(entity)) +} + +func (*CanSendStoryResultPremiumNeeded) GetClass() string { + return ClassCanSendStoryResult +} + +func (*CanSendStoryResultPremiumNeeded) GetType() string { + return TypeCanSendStoryResultPremiumNeeded +} + +func (*CanSendStoryResultPremiumNeeded) CanSendStoryResultType() string { + return TypeCanSendStoryResultPremiumNeeded +} + +// The chat must be boosted first by Telegram Premium subscribers to post more stories. Call getChatBoostStatus to get current boost status of the chat +type CanSendStoryResultBoostNeeded struct{ + meta +} + +func (entity *CanSendStoryResultBoostNeeded) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CanSendStoryResultBoostNeeded + + return json.Marshal((*stub)(entity)) +} + +func (*CanSendStoryResultBoostNeeded) GetClass() string { + return ClassCanSendStoryResult +} + +func (*CanSendStoryResultBoostNeeded) GetType() string { + return TypeCanSendStoryResultBoostNeeded +} + +func (*CanSendStoryResultBoostNeeded) CanSendStoryResultType() string { + return TypeCanSendStoryResultBoostNeeded +} + +// The limit for the number of active stories exceeded. The user can buy Telegram Premium, delete an active story, or wait for the oldest story to expire +type CanSendStoryResultActiveStoryLimitExceeded struct{ + meta +} + +func (entity *CanSendStoryResultActiveStoryLimitExceeded) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CanSendStoryResultActiveStoryLimitExceeded + + return json.Marshal((*stub)(entity)) +} + +func (*CanSendStoryResultActiveStoryLimitExceeded) GetClass() string { + return ClassCanSendStoryResult +} + +func (*CanSendStoryResultActiveStoryLimitExceeded) GetType() string { + return TypeCanSendStoryResultActiveStoryLimitExceeded +} + +func (*CanSendStoryResultActiveStoryLimitExceeded) CanSendStoryResultType() string { + return TypeCanSendStoryResultActiveStoryLimitExceeded +} + +// The weekly limit for the number of posted stories exceeded. The user needs to buy Telegram Premium or wait specified time +type CanSendStoryResultWeeklyLimitExceeded struct { + meta + // Time left before the user can send the next story + RetryAfter int32 `json:"retry_after"` +} + +func (entity *CanSendStoryResultWeeklyLimitExceeded) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CanSendStoryResultWeeklyLimitExceeded + + return json.Marshal((*stub)(entity)) +} + +func (*CanSendStoryResultWeeklyLimitExceeded) GetClass() string { + return ClassCanSendStoryResult +} + +func (*CanSendStoryResultWeeklyLimitExceeded) GetType() string { + return TypeCanSendStoryResultWeeklyLimitExceeded +} + +func (*CanSendStoryResultWeeklyLimitExceeded) CanSendStoryResultType() string { + return TypeCanSendStoryResultWeeklyLimitExceeded +} + +// The monthly limit for the number of posted stories exceeded. The user needs to buy Telegram Premium or wait specified time +type CanSendStoryResultMonthlyLimitExceeded struct { + meta + // Time left before the user can send the next story + RetryAfter int32 `json:"retry_after"` +} + +func (entity *CanSendStoryResultMonthlyLimitExceeded) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CanSendStoryResultMonthlyLimitExceeded + + return json.Marshal((*stub)(entity)) +} + +func (*CanSendStoryResultMonthlyLimitExceeded) GetClass() string { + return ClassCanSendStoryResult +} + +func (*CanSendStoryResultMonthlyLimitExceeded) GetType() string { + return TypeCanSendStoryResultMonthlyLimitExceeded +} + +func (*CanSendStoryResultMonthlyLimitExceeded) CanSendStoryResultType() string { + return TypeCanSendStoryResultMonthlyLimitExceeded } // The session can be used -type CanTransferOwnershipResultOk struct { - meta +type CanTransferOwnershipResultOk struct{ + meta } func (entity *CanTransferOwnershipResultOk) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub CanTransferOwnershipResultOk + type stub CanTransferOwnershipResultOk - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*CanTransferOwnershipResultOk) GetClass() string { - return ClassCanTransferOwnershipResult + return ClassCanTransferOwnershipResult } func (*CanTransferOwnershipResultOk) GetType() string { - return TypeCanTransferOwnershipResultOk + return TypeCanTransferOwnershipResultOk } func (*CanTransferOwnershipResultOk) CanTransferOwnershipResultType() string { - return TypeCanTransferOwnershipResultOk + return TypeCanTransferOwnershipResultOk } // The 2-step verification needs to be enabled first -type CanTransferOwnershipResultPasswordNeeded struct { - meta +type CanTransferOwnershipResultPasswordNeeded struct{ + meta } func (entity *CanTransferOwnershipResultPasswordNeeded) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub CanTransferOwnershipResultPasswordNeeded + type stub CanTransferOwnershipResultPasswordNeeded - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*CanTransferOwnershipResultPasswordNeeded) GetClass() string { - return ClassCanTransferOwnershipResult + return ClassCanTransferOwnershipResult } func (*CanTransferOwnershipResultPasswordNeeded) GetType() string { - return TypeCanTransferOwnershipResultPasswordNeeded + return TypeCanTransferOwnershipResultPasswordNeeded } func (*CanTransferOwnershipResultPasswordNeeded) CanTransferOwnershipResultType() string { - return TypeCanTransferOwnershipResultPasswordNeeded + return TypeCanTransferOwnershipResultPasswordNeeded } // The 2-step verification was enabled recently, user needs to wait type CanTransferOwnershipResultPasswordTooFresh struct { - meta - // Time left before the session can be used to transfer ownership of a chat, in seconds - RetryAfter int32 `json:"retry_after"` + meta + // Time left before the session can be used to transfer ownership of a chat, in seconds + RetryAfter int32 `json:"retry_after"` } func (entity *CanTransferOwnershipResultPasswordTooFresh) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub CanTransferOwnershipResultPasswordTooFresh + type stub CanTransferOwnershipResultPasswordTooFresh - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*CanTransferOwnershipResultPasswordTooFresh) GetClass() string { - return ClassCanTransferOwnershipResult + return ClassCanTransferOwnershipResult } func (*CanTransferOwnershipResultPasswordTooFresh) GetType() string { - return TypeCanTransferOwnershipResultPasswordTooFresh + return TypeCanTransferOwnershipResultPasswordTooFresh } func (*CanTransferOwnershipResultPasswordTooFresh) CanTransferOwnershipResultType() string { - return TypeCanTransferOwnershipResultPasswordTooFresh + return TypeCanTransferOwnershipResultPasswordTooFresh } // The session was created recently, user needs to wait type CanTransferOwnershipResultSessionTooFresh struct { - meta - // Time left before the session can be used to transfer ownership of a chat, in seconds - RetryAfter int32 `json:"retry_after"` + meta + // Time left before the session can be used to transfer ownership of a chat, in seconds + RetryAfter int32 `json:"retry_after"` } func (entity *CanTransferOwnershipResultSessionTooFresh) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub CanTransferOwnershipResultSessionTooFresh + type stub CanTransferOwnershipResultSessionTooFresh - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*CanTransferOwnershipResultSessionTooFresh) GetClass() string { - return ClassCanTransferOwnershipResult + return ClassCanTransferOwnershipResult } func (*CanTransferOwnershipResultSessionTooFresh) GetType() string { - return TypeCanTransferOwnershipResultSessionTooFresh + return TypeCanTransferOwnershipResultSessionTooFresh } func (*CanTransferOwnershipResultSessionTooFresh) CanTransferOwnershipResultType() string { - return TypeCanTransferOwnershipResultSessionTooFresh + return TypeCanTransferOwnershipResultSessionTooFresh } // The username can be set -type CheckChatUsernameResultOk struct { - meta +type CheckChatUsernameResultOk struct{ + meta } func (entity *CheckChatUsernameResultOk) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub CheckChatUsernameResultOk + type stub CheckChatUsernameResultOk - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*CheckChatUsernameResultOk) GetClass() string { - return ClassCheckChatUsernameResult + return ClassCheckChatUsernameResult } func (*CheckChatUsernameResultOk) GetType() string { - return TypeCheckChatUsernameResultOk + return TypeCheckChatUsernameResultOk } func (*CheckChatUsernameResultOk) CheckChatUsernameResultType() string { - return TypeCheckChatUsernameResultOk + return TypeCheckChatUsernameResultOk } // The username is invalid -type CheckChatUsernameResultUsernameInvalid struct { - meta +type CheckChatUsernameResultUsernameInvalid struct{ + meta } func (entity *CheckChatUsernameResultUsernameInvalid) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub CheckChatUsernameResultUsernameInvalid + type stub CheckChatUsernameResultUsernameInvalid - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*CheckChatUsernameResultUsernameInvalid) GetClass() string { - return ClassCheckChatUsernameResult + return ClassCheckChatUsernameResult } func (*CheckChatUsernameResultUsernameInvalid) GetType() string { - return TypeCheckChatUsernameResultUsernameInvalid + return TypeCheckChatUsernameResultUsernameInvalid } func (*CheckChatUsernameResultUsernameInvalid) CheckChatUsernameResultType() string { - return TypeCheckChatUsernameResultUsernameInvalid + return TypeCheckChatUsernameResultUsernameInvalid } // The username is occupied -type CheckChatUsernameResultUsernameOccupied struct { - meta +type CheckChatUsernameResultUsernameOccupied struct{ + meta } func (entity *CheckChatUsernameResultUsernameOccupied) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub CheckChatUsernameResultUsernameOccupied + type stub CheckChatUsernameResultUsernameOccupied - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*CheckChatUsernameResultUsernameOccupied) GetClass() string { - return ClassCheckChatUsernameResult + return ClassCheckChatUsernameResult } func (*CheckChatUsernameResultUsernameOccupied) GetType() string { - return TypeCheckChatUsernameResultUsernameOccupied + return TypeCheckChatUsernameResultUsernameOccupied } func (*CheckChatUsernameResultUsernameOccupied) CheckChatUsernameResultType() string { - return TypeCheckChatUsernameResultUsernameOccupied + return TypeCheckChatUsernameResultUsernameOccupied } -// The username can be purchased at fragment.com -type CheckChatUsernameResultUsernamePurchasable struct { - meta +// The username can be purchased at https://fragment.com. Information about the username can be received using getCollectibleItemInfo +type CheckChatUsernameResultUsernamePurchasable struct{ + meta } func (entity *CheckChatUsernameResultUsernamePurchasable) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub CheckChatUsernameResultUsernamePurchasable + type stub CheckChatUsernameResultUsernamePurchasable - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*CheckChatUsernameResultUsernamePurchasable) GetClass() string { - return ClassCheckChatUsernameResult + return ClassCheckChatUsernameResult } func (*CheckChatUsernameResultUsernamePurchasable) GetType() string { - return TypeCheckChatUsernameResultUsernamePurchasable + return TypeCheckChatUsernameResultUsernamePurchasable } func (*CheckChatUsernameResultUsernamePurchasable) CheckChatUsernameResultType() string { - return TypeCheckChatUsernameResultUsernamePurchasable + return TypeCheckChatUsernameResultUsernamePurchasable } // The user has too many chats with username, one of them must be made private first -type CheckChatUsernameResultPublicChatsTooMany struct { - meta +type CheckChatUsernameResultPublicChatsTooMany struct{ + meta } func (entity *CheckChatUsernameResultPublicChatsTooMany) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub CheckChatUsernameResultPublicChatsTooMany + type stub CheckChatUsernameResultPublicChatsTooMany - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*CheckChatUsernameResultPublicChatsTooMany) GetClass() string { - return ClassCheckChatUsernameResult + return ClassCheckChatUsernameResult } func (*CheckChatUsernameResultPublicChatsTooMany) GetType() string { - return TypeCheckChatUsernameResultPublicChatsTooMany + return TypeCheckChatUsernameResultPublicChatsTooMany } func (*CheckChatUsernameResultPublicChatsTooMany) CheckChatUsernameResultType() string { - return TypeCheckChatUsernameResultPublicChatsTooMany + return TypeCheckChatUsernameResultPublicChatsTooMany } // The user can't be a member of a public supergroup -type CheckChatUsernameResultPublicGroupsUnavailable struct { - meta +type CheckChatUsernameResultPublicGroupsUnavailable struct{ + meta } func (entity *CheckChatUsernameResultPublicGroupsUnavailable) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub CheckChatUsernameResultPublicGroupsUnavailable + type stub CheckChatUsernameResultPublicGroupsUnavailable - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*CheckChatUsernameResultPublicGroupsUnavailable) GetClass() string { - return ClassCheckChatUsernameResult + return ClassCheckChatUsernameResult } func (*CheckChatUsernameResultPublicGroupsUnavailable) GetType() string { - return TypeCheckChatUsernameResultPublicGroupsUnavailable + return TypeCheckChatUsernameResultPublicGroupsUnavailable } func (*CheckChatUsernameResultPublicGroupsUnavailable) CheckChatUsernameResultType() string { - return TypeCheckChatUsernameResultPublicGroupsUnavailable + return TypeCheckChatUsernameResultPublicGroupsUnavailable } // The name can be set -type CheckStickerSetNameResultOk struct { - meta +type CheckStickerSetNameResultOk struct{ + meta } func (entity *CheckStickerSetNameResultOk) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub CheckStickerSetNameResultOk + type stub CheckStickerSetNameResultOk - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*CheckStickerSetNameResultOk) GetClass() string { - return ClassCheckStickerSetNameResult + return ClassCheckStickerSetNameResult } func (*CheckStickerSetNameResultOk) GetType() string { - return TypeCheckStickerSetNameResultOk + return TypeCheckStickerSetNameResultOk } func (*CheckStickerSetNameResultOk) CheckStickerSetNameResultType() string { - return TypeCheckStickerSetNameResultOk + return TypeCheckStickerSetNameResultOk } // The name is invalid -type CheckStickerSetNameResultNameInvalid struct { - meta +type CheckStickerSetNameResultNameInvalid struct{ + meta } func (entity *CheckStickerSetNameResultNameInvalid) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub CheckStickerSetNameResultNameInvalid + type stub CheckStickerSetNameResultNameInvalid - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*CheckStickerSetNameResultNameInvalid) GetClass() string { - return ClassCheckStickerSetNameResult + return ClassCheckStickerSetNameResult } func (*CheckStickerSetNameResultNameInvalid) GetType() string { - return TypeCheckStickerSetNameResultNameInvalid + return TypeCheckStickerSetNameResultNameInvalid } func (*CheckStickerSetNameResultNameInvalid) CheckStickerSetNameResultType() string { - return TypeCheckStickerSetNameResultNameInvalid + return TypeCheckStickerSetNameResultNameInvalid } // The name is occupied -type CheckStickerSetNameResultNameOccupied struct { - meta +type CheckStickerSetNameResultNameOccupied struct{ + meta } func (entity *CheckStickerSetNameResultNameOccupied) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub CheckStickerSetNameResultNameOccupied + type stub CheckStickerSetNameResultNameOccupied - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*CheckStickerSetNameResultNameOccupied) GetClass() string { - return ClassCheckStickerSetNameResult + return ClassCheckStickerSetNameResult } func (*CheckStickerSetNameResultNameOccupied) GetType() string { - return TypeCheckStickerSetNameResultNameOccupied + return TypeCheckStickerSetNameResultNameOccupied } func (*CheckStickerSetNameResultNameOccupied) CheckStickerSetNameResultType() string { - return TypeCheckStickerSetNameResultNameOccupied + return TypeCheckStickerSetNameResultNameOccupied } // The password was reset -type ResetPasswordResultOk struct { - meta +type ResetPasswordResultOk struct{ + meta } func (entity *ResetPasswordResultOk) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub ResetPasswordResultOk + type stub ResetPasswordResultOk - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*ResetPasswordResultOk) GetClass() string { - return ClassResetPasswordResult + return ClassResetPasswordResult } func (*ResetPasswordResultOk) GetType() string { - return TypeResetPasswordResultOk + return TypeResetPasswordResultOk } func (*ResetPasswordResultOk) ResetPasswordResultType() string { - return TypeResetPasswordResultOk + return TypeResetPasswordResultOk } // The password reset request is pending type ResetPasswordResultPending struct { - meta - // Point in time (Unix timestamp) after which the password can be reset immediately using resetPassword - PendingResetDate int32 `json:"pending_reset_date"` + meta + // Point in time (Unix timestamp) after which the password can be reset immediately using resetPassword + PendingResetDate int32 `json:"pending_reset_date"` } func (entity *ResetPasswordResultPending) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub ResetPasswordResultPending + type stub ResetPasswordResultPending - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*ResetPasswordResultPending) GetClass() string { - return ClassResetPasswordResult + return ClassResetPasswordResult } func (*ResetPasswordResultPending) GetType() string { - return TypeResetPasswordResultPending + return TypeResetPasswordResultPending } func (*ResetPasswordResultPending) ResetPasswordResultType() string { - return TypeResetPasswordResultPending + return TypeResetPasswordResultPending } // The password reset request was declined type ResetPasswordResultDeclined struct { - meta - // Point in time (Unix timestamp) when the password reset can be retried - RetryDate int32 `json:"retry_date"` + meta + // Point in time (Unix timestamp) when the password reset can be retried + RetryDate int32 `json:"retry_date"` } func (entity *ResetPasswordResultDeclined) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub ResetPasswordResultDeclined + type stub ResetPasswordResultDeclined - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*ResetPasswordResultDeclined) GetClass() string { - return ClassResetPasswordResult + return ClassResetPasswordResult } func (*ResetPasswordResultDeclined) GetType() string { - return TypeResetPasswordResultDeclined + return TypeResetPasswordResultDeclined } func (*ResetPasswordResultDeclined) ResetPasswordResultType() string { - return TypeResetPasswordResultDeclined + return TypeResetPasswordResultDeclined } -// The messages was exported from a private chat +// The messages were exported from a private chat type MessageFileTypePrivate struct { - meta - // Name of the other party; may be empty if unrecognized - Name string `json:"name"` + meta + // Name of the other party; may be empty if unrecognized + Name string `json:"name"` } func (entity *MessageFileTypePrivate) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub MessageFileTypePrivate + type stub MessageFileTypePrivate - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*MessageFileTypePrivate) GetClass() string { - return ClassMessageFileType + return ClassMessageFileType } func (*MessageFileTypePrivate) GetType() string { - return TypeMessageFileTypePrivate + return TypeMessageFileTypePrivate } func (*MessageFileTypePrivate) MessageFileTypeType() string { - return TypeMessageFileTypePrivate + return TypeMessageFileTypePrivate } -// The messages was exported from a group chat +// The messages were exported from a group chat type MessageFileTypeGroup struct { - meta - // Title of the group chat; may be empty if unrecognized - Title string `json:"title"` + meta + // Title of the group chat; may be empty if unrecognized + Title string `json:"title"` } func (entity *MessageFileTypeGroup) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub MessageFileTypeGroup + type stub MessageFileTypeGroup - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*MessageFileTypeGroup) GetClass() string { - return ClassMessageFileType + return ClassMessageFileType } func (*MessageFileTypeGroup) GetType() string { - return TypeMessageFileTypeGroup + return TypeMessageFileTypeGroup } func (*MessageFileTypeGroup) MessageFileTypeType() string { - return TypeMessageFileTypeGroup + return TypeMessageFileTypeGroup } -// The messages was exported from a chat of unknown type -type MessageFileTypeUnknown struct { - meta +// The messages were exported from a chat of unknown type +type MessageFileTypeUnknown struct{ + meta } func (entity *MessageFileTypeUnknown) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub MessageFileTypeUnknown + type stub MessageFileTypeUnknown - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*MessageFileTypeUnknown) GetClass() string { - return ClassMessageFileType + return ClassMessageFileType } func (*MessageFileTypeUnknown) GetType() string { - return TypeMessageFileTypeUnknown + return TypeMessageFileTypeUnknown } func (*MessageFileTypeUnknown) MessageFileTypeType() string { - return TypeMessageFileTypeUnknown + return TypeMessageFileTypeUnknown } // A general message with hidden content type PushMessageContentHidden struct { - meta - // True, if the message is a pinned message with the specified content - IsPinned bool `json:"is_pinned"` + meta + // True, if the message is a pinned message with the specified content + IsPinned bool `json:"is_pinned"` } func (entity *PushMessageContentHidden) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub PushMessageContentHidden + type stub PushMessageContentHidden - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*PushMessageContentHidden) GetClass() string { - return ClassPushMessageContent + return ClassPushMessageContent } func (*PushMessageContentHidden) GetType() string { - return TypePushMessageContentHidden + return TypePushMessageContentHidden } func (*PushMessageContentHidden) PushMessageContentType() string { - return TypePushMessageContentHidden + return TypePushMessageContentHidden } // An animation message (GIF-style). type PushMessageContentAnimation struct { - 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"` + 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"` } func (entity *PushMessageContentAnimation) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub PushMessageContentAnimation + type stub PushMessageContentAnimation - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*PushMessageContentAnimation) GetClass() string { - return ClassPushMessageContent + return ClassPushMessageContent } func (*PushMessageContentAnimation) GetType() string { - return TypePushMessageContentAnimation + return TypePushMessageContentAnimation } func (*PushMessageContentAnimation) PushMessageContentType() string { - return TypePushMessageContentAnimation + return TypePushMessageContentAnimation } // An audio message type PushMessageContentAudio struct { - 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"` + 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"` } func (entity *PushMessageContentAudio) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub PushMessageContentAudio + type stub PushMessageContentAudio - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*PushMessageContentAudio) GetClass() string { - return ClassPushMessageContent + return ClassPushMessageContent } func (*PushMessageContentAudio) GetType() string { - return TypePushMessageContentAudio + return TypePushMessageContentAudio } func (*PushMessageContentAudio) PushMessageContentType() string { - return TypePushMessageContentAudio + return TypePushMessageContentAudio } // A message with a user contact type PushMessageContentContact struct { - 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"` + 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"` } func (entity *PushMessageContentContact) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub PushMessageContentContact + type stub PushMessageContentContact - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*PushMessageContentContact) GetClass() string { - return ClassPushMessageContent + return ClassPushMessageContent } func (*PushMessageContentContact) GetType() string { - return TypePushMessageContentContact + return TypePushMessageContentContact } func (*PushMessageContentContact) PushMessageContentType() string { - return TypePushMessageContentContact + return TypePushMessageContentContact } // A contact has registered with Telegram -type PushMessageContentContactRegistered struct { - meta +type PushMessageContentContactRegistered struct{ + meta } func (entity *PushMessageContentContactRegistered) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub PushMessageContentContactRegistered + type stub PushMessageContentContactRegistered - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*PushMessageContentContactRegistered) GetClass() string { - return ClassPushMessageContent + return ClassPushMessageContent } func (*PushMessageContentContactRegistered) GetType() string { - return TypePushMessageContentContactRegistered + return TypePushMessageContentContactRegistered } func (*PushMessageContentContactRegistered) PushMessageContentType() string { - return TypePushMessageContentContactRegistered + return TypePushMessageContentContactRegistered } // A document message (a general file) type PushMessageContentDocument struct { - 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"` + 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"` } func (entity *PushMessageContentDocument) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub PushMessageContentDocument + type stub PushMessageContentDocument - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*PushMessageContentDocument) GetClass() string { - return ClassPushMessageContent + return ClassPushMessageContent } func (*PushMessageContentDocument) GetType() string { - return TypePushMessageContentDocument + return TypePushMessageContentDocument } func (*PushMessageContentDocument) PushMessageContentType() string { - return TypePushMessageContentDocument + return TypePushMessageContentDocument } // A message with a game type PushMessageContentGame struct { - 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"` + 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"` } func (entity *PushMessageContentGame) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub PushMessageContentGame + type stub PushMessageContentGame - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*PushMessageContentGame) GetClass() string { - return ClassPushMessageContent + return ClassPushMessageContent } func (*PushMessageContentGame) GetType() string { - return TypePushMessageContentGame + return TypePushMessageContentGame } func (*PushMessageContentGame) PushMessageContentType() string { - return TypePushMessageContentGame + return TypePushMessageContentGame } // A new high score was achieved in a game type PushMessageContentGameScore struct { - 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"` + 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"` } func (entity *PushMessageContentGameScore) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub PushMessageContentGameScore + type stub PushMessageContentGameScore - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*PushMessageContentGameScore) GetClass() string { - return ClassPushMessageContent + return ClassPushMessageContent } func (*PushMessageContentGameScore) GetType() string { - return TypePushMessageContentGameScore + return TypePushMessageContentGameScore } func (*PushMessageContentGameScore) PushMessageContentType() string { - return TypePushMessageContentGameScore + return TypePushMessageContentGameScore } // A message with an invoice from a bot type PushMessageContentInvoice struct { - meta - // Product price - Price string `json:"price"` - // True, if the message is a pinned message with the specified content - IsPinned bool `json:"is_pinned"` + meta + // Product price + Price string `json:"price"` + // True, if the message is a pinned message with the specified content + IsPinned bool `json:"is_pinned"` } func (entity *PushMessageContentInvoice) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub PushMessageContentInvoice + type stub PushMessageContentInvoice - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*PushMessageContentInvoice) GetClass() string { - return ClassPushMessageContent + return ClassPushMessageContent } func (*PushMessageContentInvoice) GetType() string { - return TypePushMessageContentInvoice + return TypePushMessageContentInvoice } func (*PushMessageContentInvoice) PushMessageContentType() string { - return TypePushMessageContentInvoice + return TypePushMessageContentInvoice } // A message with a location type PushMessageContentLocation struct { - 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"` + 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"` } func (entity *PushMessageContentLocation) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub PushMessageContentLocation + type stub PushMessageContentLocation - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*PushMessageContentLocation) GetClass() string { - return ClassPushMessageContent + return ClassPushMessageContent } func (*PushMessageContentLocation) GetType() string { - return TypePushMessageContentLocation + return TypePushMessageContentLocation } func (*PushMessageContentLocation) PushMessageContentType() string { - return TypePushMessageContentLocation + return TypePushMessageContentLocation } // A photo message type PushMessageContentPhoto struct { - 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"` + 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"` } func (entity *PushMessageContentPhoto) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub PushMessageContentPhoto + type stub PushMessageContentPhoto - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*PushMessageContentPhoto) GetClass() string { - return ClassPushMessageContent + return ClassPushMessageContent } func (*PushMessageContentPhoto) GetType() string { - return TypePushMessageContentPhoto + return TypePushMessageContentPhoto } func (*PushMessageContentPhoto) PushMessageContentType() string { - return TypePushMessageContentPhoto + return TypePushMessageContentPhoto } // A message with a poll type PushMessageContentPoll struct { - 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"` + 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"` } func (entity *PushMessageContentPoll) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub PushMessageContentPoll + type stub PushMessageContentPoll - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*PushMessageContentPoll) GetClass() string { - return ClassPushMessageContent + return ClassPushMessageContent } func (*PushMessageContentPoll) GetType() string { - return TypePushMessageContentPoll + return TypePushMessageContentPoll } func (*PushMessageContentPoll) PushMessageContentType() string { - return TypePushMessageContentPoll + return TypePushMessageContentPoll +} + +// A message with a Telegram Premium gift code created for the user +type PushMessageContentPremiumGiftCode struct { + meta + // Number of months the Telegram Premium subscription will be active after code activation + MonthCount int32 `json:"month_count"` +} + +func (entity *PushMessageContentPremiumGiftCode) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PushMessageContentPremiumGiftCode + + return json.Marshal((*stub)(entity)) +} + +func (*PushMessageContentPremiumGiftCode) GetClass() string { + return ClassPushMessageContent +} + +func (*PushMessageContentPremiumGiftCode) GetType() string { + return TypePushMessageContentPremiumGiftCode +} + +func (*PushMessageContentPremiumGiftCode) PushMessageContentType() string { + return TypePushMessageContentPremiumGiftCode +} + +// A message with a Telegram Premium giveaway +type PushMessageContentPremiumGiveaway struct { + meta + // Number of users which will receive Telegram Premium subscription gift codes; 0 for pinned message + WinnerCount int32 `json:"winner_count"` + // Number of months the Telegram Premium subscription will be active after code activation; 0 for pinned message + MonthCount int32 `json:"month_count"` + // True, if the message is a pinned message with the specified content + IsPinned bool `json:"is_pinned"` +} + +func (entity *PushMessageContentPremiumGiveaway) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PushMessageContentPremiumGiveaway + + return json.Marshal((*stub)(entity)) +} + +func (*PushMessageContentPremiumGiveaway) GetClass() string { + return ClassPushMessageContent +} + +func (*PushMessageContentPremiumGiveaway) GetType() string { + return TypePushMessageContentPremiumGiveaway +} + +func (*PushMessageContentPremiumGiveaway) PushMessageContentType() string { + return TypePushMessageContentPremiumGiveaway } // A screenshot of a message in the chat has been taken -type PushMessageContentScreenshotTaken struct { - meta +type PushMessageContentScreenshotTaken struct{ + meta } func (entity *PushMessageContentScreenshotTaken) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub PushMessageContentScreenshotTaken + type stub PushMessageContentScreenshotTaken - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*PushMessageContentScreenshotTaken) GetClass() string { - return ClassPushMessageContent + return ClassPushMessageContent } func (*PushMessageContentScreenshotTaken) GetType() string { - return TypePushMessageContentScreenshotTaken + return TypePushMessageContentScreenshotTaken } func (*PushMessageContentScreenshotTaken) PushMessageContentType() string { - return TypePushMessageContentScreenshotTaken + return TypePushMessageContentScreenshotTaken } // A message with a sticker type PushMessageContentSticker struct { - 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"` + 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"` } func (entity *PushMessageContentSticker) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub PushMessageContentSticker + type stub PushMessageContentSticker - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*PushMessageContentSticker) GetClass() string { - return ClassPushMessageContent + return ClassPushMessageContent } func (*PushMessageContentSticker) GetType() string { - return TypePushMessageContentSticker + return TypePushMessageContentSticker } func (*PushMessageContentSticker) PushMessageContentType() string { - return TypePushMessageContentSticker + return TypePushMessageContentSticker +} + +// A message with a story +type PushMessageContentStory struct { + meta + // True, if the message is a pinned message with the specified content + IsPinned bool `json:"is_pinned"` +} + +func (entity *PushMessageContentStory) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PushMessageContentStory + + return json.Marshal((*stub)(entity)) +} + +func (*PushMessageContentStory) GetClass() string { + return ClassPushMessageContent +} + +func (*PushMessageContentStory) GetType() string { + return TypePushMessageContentStory +} + +func (*PushMessageContentStory) PushMessageContentType() string { + return TypePushMessageContentStory } // A text message type PushMessageContentText struct { - meta - // Message text - Text string `json:"text"` - // True, if the message is a pinned message with the specified content - IsPinned bool `json:"is_pinned"` + meta + // Message text + Text string `json:"text"` + // True, if the message is a pinned message with the specified content + IsPinned bool `json:"is_pinned"` } func (entity *PushMessageContentText) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub PushMessageContentText + type stub PushMessageContentText - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*PushMessageContentText) GetClass() string { - return ClassPushMessageContent + return ClassPushMessageContent } func (*PushMessageContentText) GetType() string { - return TypePushMessageContentText + return TypePushMessageContentText } func (*PushMessageContentText) PushMessageContentType() string { - return TypePushMessageContentText + return TypePushMessageContentText } // A video message type PushMessageContentVideo struct { - 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"` + 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"` } func (entity *PushMessageContentVideo) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub PushMessageContentVideo + type stub PushMessageContentVideo - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*PushMessageContentVideo) GetClass() string { - return ClassPushMessageContent + return ClassPushMessageContent } func (*PushMessageContentVideo) GetType() string { - return TypePushMessageContentVideo + return TypePushMessageContentVideo } func (*PushMessageContentVideo) PushMessageContentType() string { - return TypePushMessageContentVideo + return TypePushMessageContentVideo } // A video note message type PushMessageContentVideoNote struct { - 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"` + 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"` } func (entity *PushMessageContentVideoNote) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub PushMessageContentVideoNote + type stub PushMessageContentVideoNote - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*PushMessageContentVideoNote) GetClass() string { - return ClassPushMessageContent + return ClassPushMessageContent } func (*PushMessageContentVideoNote) GetType() string { - return TypePushMessageContentVideoNote + return TypePushMessageContentVideoNote } func (*PushMessageContentVideoNote) PushMessageContentType() string { - return TypePushMessageContentVideoNote + return TypePushMessageContentVideoNote } // A voice note message type PushMessageContentVoiceNote struct { - 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"` + 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"` } func (entity *PushMessageContentVoiceNote) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub PushMessageContentVoiceNote + type stub PushMessageContentVoiceNote - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*PushMessageContentVoiceNote) GetClass() string { - return ClassPushMessageContent + return ClassPushMessageContent } func (*PushMessageContentVoiceNote) GetType() string { - return TypePushMessageContentVoiceNote + return TypePushMessageContentVoiceNote } func (*PushMessageContentVoiceNote) PushMessageContentType() string { - return TypePushMessageContentVoiceNote + return TypePushMessageContentVoiceNote } // A newly created basic group -type PushMessageContentBasicGroupChatCreate struct { - meta +type PushMessageContentBasicGroupChatCreate struct{ + meta } func (entity *PushMessageContentBasicGroupChatCreate) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub PushMessageContentBasicGroupChatCreate + type stub PushMessageContentBasicGroupChatCreate - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*PushMessageContentBasicGroupChatCreate) GetClass() string { - return ClassPushMessageContent + return ClassPushMessageContent } func (*PushMessageContentBasicGroupChatCreate) GetType() string { - return TypePushMessageContentBasicGroupChatCreate + return TypePushMessageContentBasicGroupChatCreate } func (*PushMessageContentBasicGroupChatCreate) PushMessageContentType() string { - return TypePushMessageContentBasicGroupChatCreate + return TypePushMessageContentBasicGroupChatCreate } // New chat members were invited to a group type PushMessageContentChatAddMembers struct { - 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"` + 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"` } func (entity *PushMessageContentChatAddMembers) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub PushMessageContentChatAddMembers + type stub PushMessageContentChatAddMembers - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*PushMessageContentChatAddMembers) GetClass() string { - return ClassPushMessageContent + return ClassPushMessageContent } func (*PushMessageContentChatAddMembers) GetType() string { - return TypePushMessageContentChatAddMembers + return TypePushMessageContentChatAddMembers } func (*PushMessageContentChatAddMembers) PushMessageContentType() string { - return TypePushMessageContentChatAddMembers + return TypePushMessageContentChatAddMembers } // A chat photo was edited -type PushMessageContentChatChangePhoto struct { - meta +type PushMessageContentChatChangePhoto struct{ + meta } func (entity *PushMessageContentChatChangePhoto) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub PushMessageContentChatChangePhoto + type stub PushMessageContentChatChangePhoto - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*PushMessageContentChatChangePhoto) GetClass() string { - return ClassPushMessageContent + return ClassPushMessageContent } func (*PushMessageContentChatChangePhoto) GetType() string { - return TypePushMessageContentChatChangePhoto + return TypePushMessageContentChatChangePhoto } func (*PushMessageContentChatChangePhoto) PushMessageContentType() string { - return TypePushMessageContentChatChangePhoto + return TypePushMessageContentChatChangePhoto } // A chat title was edited type PushMessageContentChatChangeTitle struct { - meta - // New chat title - Title string `json:"title"` + meta + // New chat title + Title string `json:"title"` } func (entity *PushMessageContentChatChangeTitle) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub PushMessageContentChatChangeTitle + type stub PushMessageContentChatChangeTitle - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*PushMessageContentChatChangeTitle) GetClass() string { - return ClassPushMessageContent + return ClassPushMessageContent } func (*PushMessageContentChatChangeTitle) GetType() string { - return TypePushMessageContentChatChangeTitle + return TypePushMessageContentChatChangeTitle } func (*PushMessageContentChatChangeTitle) PushMessageContentType() string { - return TypePushMessageContentChatChangeTitle + return TypePushMessageContentChatChangeTitle +} + +// A chat background was edited +type PushMessageContentChatSetBackground struct { + meta + // True, if the set background is the same as the background of the current user + IsSame bool `json:"is_same"` +} + +func (entity *PushMessageContentChatSetBackground) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PushMessageContentChatSetBackground + + return json.Marshal((*stub)(entity)) +} + +func (*PushMessageContentChatSetBackground) GetClass() string { + return ClassPushMessageContent +} + +func (*PushMessageContentChatSetBackground) GetType() string { + return TypePushMessageContentChatSetBackground +} + +func (*PushMessageContentChatSetBackground) PushMessageContentType() string { + return TypePushMessageContentChatSetBackground } // A chat theme was edited type PushMessageContentChatSetTheme struct { - 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"` + meta + // If non-empty, name of a new theme, set for the chat. Otherwise, the chat theme was reset to the default one + ThemeName string `json:"theme_name"` } func (entity *PushMessageContentChatSetTheme) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub PushMessageContentChatSetTheme + type stub PushMessageContentChatSetTheme - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*PushMessageContentChatSetTheme) GetClass() string { - return ClassPushMessageContent + return ClassPushMessageContent } func (*PushMessageContentChatSetTheme) GetType() string { - return TypePushMessageContentChatSetTheme + return TypePushMessageContentChatSetTheme } func (*PushMessageContentChatSetTheme) PushMessageContentType() string { - return TypePushMessageContentChatSetTheme + return TypePushMessageContentChatSetTheme } // A chat member was deleted type PushMessageContentChatDeleteMember struct { - 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"` + 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"` } func (entity *PushMessageContentChatDeleteMember) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub PushMessageContentChatDeleteMember + type stub PushMessageContentChatDeleteMember - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*PushMessageContentChatDeleteMember) GetClass() string { - return ClassPushMessageContent + return ClassPushMessageContent } func (*PushMessageContentChatDeleteMember) GetType() string { - return TypePushMessageContentChatDeleteMember + return TypePushMessageContentChatDeleteMember } func (*PushMessageContentChatDeleteMember) PushMessageContentType() string { - return TypePushMessageContentChatDeleteMember + return TypePushMessageContentChatDeleteMember } // A new member joined the chat via an invite link -type PushMessageContentChatJoinByLink struct { - meta +type PushMessageContentChatJoinByLink struct{ + meta } func (entity *PushMessageContentChatJoinByLink) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub PushMessageContentChatJoinByLink + type stub PushMessageContentChatJoinByLink - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*PushMessageContentChatJoinByLink) GetClass() string { - return ClassPushMessageContent + return ClassPushMessageContent } func (*PushMessageContentChatJoinByLink) GetType() string { - return TypePushMessageContentChatJoinByLink + return TypePushMessageContentChatJoinByLink } func (*PushMessageContentChatJoinByLink) PushMessageContentType() string { - return TypePushMessageContentChatJoinByLink + return TypePushMessageContentChatJoinByLink } // A new member was accepted to the chat by an administrator -type PushMessageContentChatJoinByRequest struct { - meta +type PushMessageContentChatJoinByRequest struct{ + meta } func (entity *PushMessageContentChatJoinByRequest) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub PushMessageContentChatJoinByRequest + type stub PushMessageContentChatJoinByRequest - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*PushMessageContentChatJoinByRequest) GetClass() string { - return ClassPushMessageContent + return ClassPushMessageContent } func (*PushMessageContentChatJoinByRequest) GetType() string { - return TypePushMessageContentChatJoinByRequest + return TypePushMessageContentChatJoinByRequest } func (*PushMessageContentChatJoinByRequest) PushMessageContentType() string { - return TypePushMessageContentChatJoinByRequest + return TypePushMessageContentChatJoinByRequest } -// A new recurrent payment was made by the current user +// A new recurring payment was made by the current user type PushMessageContentRecurringPayment struct { - meta - // The paid amount - Amount string `json:"amount"` + meta + // The paid amount + Amount string `json:"amount"` } func (entity *PushMessageContentRecurringPayment) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub PushMessageContentRecurringPayment + type stub PushMessageContentRecurringPayment - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*PushMessageContentRecurringPayment) GetClass() string { - return ClassPushMessageContent + return ClassPushMessageContent } func (*PushMessageContentRecurringPayment) GetType() string { - return TypePushMessageContentRecurringPayment + return TypePushMessageContentRecurringPayment } func (*PushMessageContentRecurringPayment) PushMessageContentType() string { - return TypePushMessageContentRecurringPayment + return TypePushMessageContentRecurringPayment } // A profile photo was suggested to the user -type PushMessageContentSuggestProfilePhoto struct { - meta +type PushMessageContentSuggestProfilePhoto struct{ + meta } func (entity *PushMessageContentSuggestProfilePhoto) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub PushMessageContentSuggestProfilePhoto + type stub PushMessageContentSuggestProfilePhoto - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*PushMessageContentSuggestProfilePhoto) GetClass() string { - return ClassPushMessageContent + return ClassPushMessageContent } func (*PushMessageContentSuggestProfilePhoto) GetType() string { - return TypePushMessageContentSuggestProfilePhoto + return TypePushMessageContentSuggestProfilePhoto } func (*PushMessageContentSuggestProfilePhoto) PushMessageContentType() string { - return TypePushMessageContentSuggestProfilePhoto + return TypePushMessageContentSuggestProfilePhoto } // A forwarded messages type PushMessageContentMessageForwards struct { - meta - // Number of forwarded messages - TotalCount int32 `json:"total_count"` + meta + // Number of forwarded messages + TotalCount int32 `json:"total_count"` } func (entity *PushMessageContentMessageForwards) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub PushMessageContentMessageForwards + type stub PushMessageContentMessageForwards - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*PushMessageContentMessageForwards) GetClass() string { - return ClassPushMessageContent + return ClassPushMessageContent } func (*PushMessageContentMessageForwards) GetType() string { - return TypePushMessageContentMessageForwards + return TypePushMessageContentMessageForwards } func (*PushMessageContentMessageForwards) PushMessageContentType() string { - return TypePushMessageContentMessageForwards + return TypePushMessageContentMessageForwards } // A media album type PushMessageContentMediaAlbum struct { - 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 file - 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"` + 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 file + 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"` } func (entity *PushMessageContentMediaAlbum) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub PushMessageContentMediaAlbum + type stub PushMessageContentMediaAlbum - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*PushMessageContentMediaAlbum) GetClass() string { - return ClassPushMessageContent + return ClassPushMessageContent } func (*PushMessageContentMediaAlbum) GetType() string { - return TypePushMessageContentMediaAlbum + return TypePushMessageContentMediaAlbum } func (*PushMessageContentMediaAlbum) PushMessageContentType() string { - return TypePushMessageContentMediaAlbum + return TypePushMessageContentMediaAlbum } // New message was received type NotificationTypeNewMessage struct { - meta - // The message - Message *Message `json:"message"` - // True, if message content must be displayed in notifications - ShowPreview bool `json:"show_preview"` + meta + // The message + Message *Message `json:"message"` + // True, if message content must be displayed in notifications + ShowPreview bool `json:"show_preview"` } func (entity *NotificationTypeNewMessage) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub NotificationTypeNewMessage + type stub NotificationTypeNewMessage - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*NotificationTypeNewMessage) GetClass() string { - return ClassNotificationType + return ClassNotificationType } func (*NotificationTypeNewMessage) GetType() string { - return TypeNotificationTypeNewMessage + return TypeNotificationTypeNewMessage } func (*NotificationTypeNewMessage) NotificationTypeType() string { - return TypeNotificationTypeNewMessage + return TypeNotificationTypeNewMessage } // New secret chat was created -type NotificationTypeNewSecretChat struct { - meta +type NotificationTypeNewSecretChat struct{ + meta } func (entity *NotificationTypeNewSecretChat) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub NotificationTypeNewSecretChat + type stub NotificationTypeNewSecretChat - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*NotificationTypeNewSecretChat) GetClass() string { - return ClassNotificationType + return ClassNotificationType } func (*NotificationTypeNewSecretChat) GetType() string { - return TypeNotificationTypeNewSecretChat + return TypeNotificationTypeNewSecretChat } func (*NotificationTypeNewSecretChat) NotificationTypeType() string { - return TypeNotificationTypeNewSecretChat + return TypeNotificationTypeNewSecretChat } // New call was received type NotificationTypeNewCall struct { - meta - // Call identifier - CallId int32 `json:"call_id"` + meta + // Call identifier + CallId int32 `json:"call_id"` } func (entity *NotificationTypeNewCall) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub NotificationTypeNewCall + type stub NotificationTypeNewCall - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*NotificationTypeNewCall) GetClass() string { - return ClassNotificationType + return ClassNotificationType } func (*NotificationTypeNewCall) GetType() string { - return TypeNotificationTypeNewCall + return TypeNotificationTypeNewCall } func (*NotificationTypeNewCall) NotificationTypeType() string { - return TypeNotificationTypeNewCall + return TypeNotificationTypeNewCall } // New message was received through a push notification type NotificationTypeNewPushMessage struct { - 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"` + meta + // The message identifier. The message will not be available in the chat history, but the identifier can be used in viewMessages, or as a message to be replied in the same chat + 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"` } func (entity *NotificationTypeNewPushMessage) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub NotificationTypeNewPushMessage + type stub NotificationTypeNewPushMessage - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*NotificationTypeNewPushMessage) GetClass() string { - return ClassNotificationType + return ClassNotificationType } func (*NotificationTypeNewPushMessage) GetType() string { - return TypeNotificationTypeNewPushMessage + return TypeNotificationTypeNewPushMessage } func (*NotificationTypeNewPushMessage) NotificationTypeType() string { - return TypeNotificationTypeNewPushMessage + return TypeNotificationTypeNewPushMessage } func (notificationTypeNewPushMessage *NotificationTypeNewPushMessage) UnmarshalJSON(data []byte) error { - 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"` - } + 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"` + } - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } - notificationTypeNewPushMessage.MessageId = tmp.MessageId - notificationTypeNewPushMessage.SenderName = tmp.SenderName - notificationTypeNewPushMessage.IsOutgoing = tmp.IsOutgoing + notificationTypeNewPushMessage.MessageId = tmp.MessageId + notificationTypeNewPushMessage.SenderName = tmp.SenderName + notificationTypeNewPushMessage.IsOutgoing = tmp.IsOutgoing - fieldSenderId, _ := UnmarshalMessageSender(tmp.SenderId) - notificationTypeNewPushMessage.SenderId = fieldSenderId + fieldSenderId, _ := UnmarshalMessageSender(tmp.SenderId) + notificationTypeNewPushMessage.SenderId = fieldSenderId - fieldContent, _ := UnmarshalPushMessageContent(tmp.Content) - notificationTypeNewPushMessage.Content = fieldContent + fieldContent, _ := UnmarshalPushMessageContent(tmp.Content) + notificationTypeNewPushMessage.Content = fieldContent - return nil + return nil } // A group containing notifications of type notificationTypeNewMessage and notificationTypeNewPushMessage with ordinary unread messages -type NotificationGroupTypeMessages struct { - meta +type NotificationGroupTypeMessages struct{ + meta } func (entity *NotificationGroupTypeMessages) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub NotificationGroupTypeMessages + type stub NotificationGroupTypeMessages - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*NotificationGroupTypeMessages) GetClass() string { - return ClassNotificationGroupType + return ClassNotificationGroupType } func (*NotificationGroupTypeMessages) GetType() string { - return TypeNotificationGroupTypeMessages + return TypeNotificationGroupTypeMessages } func (*NotificationGroupTypeMessages) NotificationGroupTypeType() string { - return TypeNotificationGroupTypeMessages + return TypeNotificationGroupTypeMessages } // A group containing notifications of type notificationTypeNewMessage and notificationTypeNewPushMessage with unread mentions of the current user, replies to their messages, or a pinned message -type NotificationGroupTypeMentions struct { - meta +type NotificationGroupTypeMentions struct{ + meta } func (entity *NotificationGroupTypeMentions) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub NotificationGroupTypeMentions + type stub NotificationGroupTypeMentions - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*NotificationGroupTypeMentions) GetClass() string { - return ClassNotificationGroupType + return ClassNotificationGroupType } func (*NotificationGroupTypeMentions) GetType() string { - return TypeNotificationGroupTypeMentions + return TypeNotificationGroupTypeMentions } func (*NotificationGroupTypeMentions) NotificationGroupTypeType() string { - return TypeNotificationGroupTypeMentions + return TypeNotificationGroupTypeMentions } // A group containing a notification of type notificationTypeNewSecretChat -type NotificationGroupTypeSecretChat struct { - meta +type NotificationGroupTypeSecretChat struct{ + meta } func (entity *NotificationGroupTypeSecretChat) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub NotificationGroupTypeSecretChat + type stub NotificationGroupTypeSecretChat - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*NotificationGroupTypeSecretChat) GetClass() string { - return ClassNotificationGroupType + return ClassNotificationGroupType } func (*NotificationGroupTypeSecretChat) GetType() string { - return TypeNotificationGroupTypeSecretChat + return TypeNotificationGroupTypeSecretChat } func (*NotificationGroupTypeSecretChat) NotificationGroupTypeType() string { - return TypeNotificationGroupTypeSecretChat + return TypeNotificationGroupTypeSecretChat } // A group containing notifications of type notificationTypeNewCall -type NotificationGroupTypeCalls struct { - meta +type NotificationGroupTypeCalls struct{ + meta } func (entity *NotificationGroupTypeCalls) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub NotificationGroupTypeCalls + type stub NotificationGroupTypeCalls - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*NotificationGroupTypeCalls) GetClass() string { - return ClassNotificationGroupType + return ClassNotificationGroupType } func (*NotificationGroupTypeCalls) GetType() string { - return TypeNotificationGroupTypeCalls + return TypeNotificationGroupTypeCalls } func (*NotificationGroupTypeCalls) NotificationGroupTypeType() string { - return TypeNotificationGroupTypeCalls + return TypeNotificationGroupTypeCalls } // Describes a notification sound in MP3 format type NotificationSound struct { - meta - // Unique identifier of the notification sound - Id JsonInt64 `json:"id"` - // Duration of the sound, in seconds - Duration int32 `json:"duration"` - // Point in time (Unix timestamp) when the sound was created - Date int32 `json:"date"` - // Title of the notification sound - Title string `json:"title"` - // Arbitrary data, defined while the sound was uploaded - Data string `json:"data"` - // File containing the sound - Sound *File `json:"sound"` + meta + // Unique identifier of the notification sound + Id JsonInt64 `json:"id"` + // Duration of the sound, in seconds + Duration int32 `json:"duration"` + // Point in time (Unix timestamp) when the sound was created + Date int32 `json:"date"` + // Title of the notification sound + Title string `json:"title"` + // Arbitrary data, defined while the sound was uploaded + Data string `json:"data"` + // File containing the sound + Sound *File `json:"sound"` } func (entity *NotificationSound) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub NotificationSound + type stub NotificationSound - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*NotificationSound) GetClass() string { - return ClassNotificationSound + return ClassNotificationSound } func (*NotificationSound) GetType() string { - return TypeNotificationSound + return TypeNotificationSound } // Contains a list of notification sounds type NotificationSounds struct { - meta - // A list of notification sounds - NotificationSounds []*NotificationSound `json:"notification_sounds"` + meta + // A list of notification sounds + NotificationSounds []*NotificationSound `json:"notification_sounds"` } func (entity *NotificationSounds) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub NotificationSounds + type stub NotificationSounds - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*NotificationSounds) GetClass() string { - return ClassNotificationSounds + return ClassNotificationSounds } func (*NotificationSounds) GetType() string { - return TypeNotificationSounds + return TypeNotificationSounds } // Contains information about a notification type Notification struct { - meta - // Unique persistent identifier of this notification - Id int32 `json:"id"` - // Notification date - Date int32 `json:"date"` - // True, if the notification was explicitly sent without sound - IsSilent bool `json:"is_silent"` - // Notification type - Type NotificationType `json:"type"` + meta + // Unique persistent identifier of this notification + Id int32 `json:"id"` + // Notification date + Date int32 `json:"date"` + // True, if the notification was explicitly sent without sound + IsSilent bool `json:"is_silent"` + // Notification type + Type NotificationType `json:"type"` } func (entity *Notification) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub Notification + type stub Notification - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*Notification) GetClass() string { - return ClassNotification + return ClassNotification } func (*Notification) GetType() string { - return TypeNotification + return TypeNotification } func (notification *Notification) UnmarshalJSON(data []byte) error { - var tmp struct { - Id int32 `json:"id"` - Date int32 `json:"date"` - IsSilent bool `json:"is_silent"` - Type json.RawMessage `json:"type"` - } + var tmp struct { + Id int32 `json:"id"` + Date int32 `json:"date"` + IsSilent bool `json:"is_silent"` + Type json.RawMessage `json:"type"` + } - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } - notification.Id = tmp.Id - notification.Date = tmp.Date - notification.IsSilent = tmp.IsSilent + notification.Id = tmp.Id + notification.Date = tmp.Date + notification.IsSilent = tmp.IsSilent - fieldType, _ := UnmarshalNotificationType(tmp.Type) - notification.Type = fieldType + fieldType, _ := UnmarshalNotificationType(tmp.Type) + notification.Type = fieldType - return nil + return nil } // Describes a group of notifications type NotificationGroup struct { - 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"` + 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"` } func (entity *NotificationGroup) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub NotificationGroup + type stub NotificationGroup - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*NotificationGroup) GetClass() string { - return ClassNotificationGroup + return ClassNotificationGroup } func (*NotificationGroup) GetType() string { - return TypeNotificationGroup + return TypeNotificationGroup } func (notificationGroup *NotificationGroup) UnmarshalJSON(data []byte) error { - 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"` - } + 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"` + } - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } - notificationGroup.Id = tmp.Id - notificationGroup.ChatId = tmp.ChatId - notificationGroup.TotalCount = tmp.TotalCount - notificationGroup.Notifications = tmp.Notifications + notificationGroup.Id = tmp.Id + notificationGroup.ChatId = tmp.ChatId + notificationGroup.TotalCount = tmp.TotalCount + notificationGroup.Notifications = tmp.Notifications - fieldType, _ := UnmarshalNotificationGroupType(tmp.Type) - notificationGroup.Type = fieldType + fieldType, _ := UnmarshalNotificationGroupType(tmp.Type) + notificationGroup.Type = fieldType - return nil + return nil } // Represents a boolean option type OptionValueBoolean struct { - meta - // The value of the option - Value bool `json:"value"` + meta + // The value of the option + Value bool `json:"value"` } func (entity *OptionValueBoolean) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub OptionValueBoolean + type stub OptionValueBoolean - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*OptionValueBoolean) GetClass() string { - return ClassOptionValue + return ClassOptionValue } func (*OptionValueBoolean) GetType() string { - return TypeOptionValueBoolean + return TypeOptionValueBoolean } func (*OptionValueBoolean) OptionValueType() string { - return TypeOptionValueBoolean + return TypeOptionValueBoolean } // Represents an unknown option or an option which has a default value -type OptionValueEmpty struct { - meta +type OptionValueEmpty struct{ + meta } func (entity *OptionValueEmpty) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub OptionValueEmpty + type stub OptionValueEmpty - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*OptionValueEmpty) GetClass() string { - return ClassOptionValue + return ClassOptionValue } func (*OptionValueEmpty) GetType() string { - return TypeOptionValueEmpty + return TypeOptionValueEmpty } func (*OptionValueEmpty) OptionValueType() string { - return TypeOptionValueEmpty + return TypeOptionValueEmpty } // Represents an integer option type OptionValueInteger struct { - meta - // The value of the option - Value JsonInt64 `json:"value"` + meta + // The value of the option + Value JsonInt64 `json:"value"` } func (entity *OptionValueInteger) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub OptionValueInteger + type stub OptionValueInteger - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*OptionValueInteger) GetClass() string { - return ClassOptionValue + return ClassOptionValue } func (*OptionValueInteger) GetType() string { - return TypeOptionValueInteger + return TypeOptionValueInteger } func (*OptionValueInteger) OptionValueType() string { - return TypeOptionValueInteger + return TypeOptionValueInteger } // Represents a string option type OptionValueString struct { - meta - // The value of the option - Value string `json:"value"` + meta + // The value of the option + Value string `json:"value"` } func (entity *OptionValueString) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub OptionValueString + type stub OptionValueString - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*OptionValueString) GetClass() string { - return ClassOptionValue + return ClassOptionValue } func (*OptionValueString) GetType() string { - return TypeOptionValueString + return TypeOptionValueString } func (*OptionValueString) OptionValueType() string { - return TypeOptionValueString + return TypeOptionValueString } // Represents one member of a JSON object type JsonObjectMember struct { - meta - // Member's key - Key string `json:"key"` - // Member's value - Value JsonValue `json:"value"` + meta + // Member's key + Key string `json:"key"` + // Member's value + Value JsonValue `json:"value"` } func (entity *JsonObjectMember) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub JsonObjectMember + type stub JsonObjectMember - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*JsonObjectMember) GetClass() string { - return ClassJsonObjectMember + return ClassJsonObjectMember } func (*JsonObjectMember) GetType() string { - return TypeJsonObjectMember + return TypeJsonObjectMember } func (jsonObjectMember *JsonObjectMember) UnmarshalJSON(data []byte) error { - var tmp struct { - Key string `json:"key"` - Value json.RawMessage `json:"value"` - } + var tmp struct { + Key string `json:"key"` + Value json.RawMessage `json:"value"` + } - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } - jsonObjectMember.Key = tmp.Key + jsonObjectMember.Key = tmp.Key - fieldValue, _ := UnmarshalJsonValue(tmp.Value) - jsonObjectMember.Value = fieldValue + fieldValue, _ := UnmarshalJsonValue(tmp.Value) + jsonObjectMember.Value = fieldValue - return nil + return nil } // Represents a null JSON value -type JsonValueNull struct { - meta +type JsonValueNull struct{ + meta } func (entity *JsonValueNull) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub JsonValueNull + type stub JsonValueNull - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*JsonValueNull) GetClass() string { - return ClassJsonValue + return ClassJsonValue } func (*JsonValueNull) GetType() string { - return TypeJsonValueNull + return TypeJsonValueNull } func (*JsonValueNull) JsonValueType() string { - return TypeJsonValueNull + return TypeJsonValueNull } // Represents a boolean JSON value type JsonValueBoolean struct { - meta - // The value - Value bool `json:"value"` + meta + // The value + Value bool `json:"value"` } func (entity *JsonValueBoolean) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub JsonValueBoolean + type stub JsonValueBoolean - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*JsonValueBoolean) GetClass() string { - return ClassJsonValue + return ClassJsonValue } func (*JsonValueBoolean) GetType() string { - return TypeJsonValueBoolean + return TypeJsonValueBoolean } func (*JsonValueBoolean) JsonValueType() string { - return TypeJsonValueBoolean + return TypeJsonValueBoolean } // Represents a numeric JSON value type JsonValueNumber struct { - meta - // The value - Value float64 `json:"value"` + meta + // The value + Value float64 `json:"value"` } func (entity *JsonValueNumber) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub JsonValueNumber + type stub JsonValueNumber - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*JsonValueNumber) GetClass() string { - return ClassJsonValue + return ClassJsonValue } func (*JsonValueNumber) GetType() string { - return TypeJsonValueNumber + return TypeJsonValueNumber } func (*JsonValueNumber) JsonValueType() string { - return TypeJsonValueNumber + return TypeJsonValueNumber } // Represents a string JSON value type JsonValueString struct { - meta - // The value - Value string `json:"value"` + meta + // The value + Value string `json:"value"` } func (entity *JsonValueString) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub JsonValueString + type stub JsonValueString - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*JsonValueString) GetClass() string { - return ClassJsonValue + return ClassJsonValue } func (*JsonValueString) GetType() string { - return TypeJsonValueString + return TypeJsonValueString } func (*JsonValueString) JsonValueType() string { - return TypeJsonValueString + return TypeJsonValueString } // Represents a JSON array type JsonValueArray struct { - meta - // The list of array elements - Values []JsonValue `json:"values"` + meta + // The list of array elements + Values []JsonValue `json:"values"` } func (entity *JsonValueArray) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub JsonValueArray + type stub JsonValueArray - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*JsonValueArray) GetClass() string { - return ClassJsonValue + return ClassJsonValue } func (*JsonValueArray) GetType() string { - return TypeJsonValueArray + return TypeJsonValueArray } func (*JsonValueArray) JsonValueType() string { - return TypeJsonValueArray + return TypeJsonValueArray } func (jsonValueArray *JsonValueArray) UnmarshalJSON(data []byte) error { - var tmp struct { - Values []json.RawMessage `json:"values"` - } + var tmp struct { + Values []json.RawMessage `json:"values"` + } - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } - fieldValues, _ := UnmarshalListOfJsonValue(tmp.Values) - jsonValueArray.Values = fieldValues + fieldValues, _ := UnmarshalListOfJsonValue(tmp.Values) + jsonValueArray.Values = fieldValues - return nil + return nil } // Represents a JSON object type JsonValueObject struct { - meta - // The list of object members - Members []*JsonObjectMember `json:"members"` + meta + // The list of object members + Members []*JsonObjectMember `json:"members"` } func (entity *JsonValueObject) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub JsonValueObject + type stub JsonValueObject - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*JsonValueObject) GetClass() string { - return ClassJsonValue + return ClassJsonValue } func (*JsonValueObject) GetType() string { - return TypeJsonValueObject + return TypeJsonValueObject } func (*JsonValueObject) JsonValueType() string { - return TypeJsonValueObject + return TypeJsonValueObject +} + +// The story can be viewed by everyone +type StoryPrivacySettingsEveryone struct { + meta + // Identifiers of the users that can't see the story; always unknown and empty for non-owned stories + ExceptUserIds []int64 `json:"except_user_ids"` +} + +func (entity *StoryPrivacySettingsEveryone) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryPrivacySettingsEveryone + + return json.Marshal((*stub)(entity)) +} + +func (*StoryPrivacySettingsEveryone) GetClass() string { + return ClassStoryPrivacySettings +} + +func (*StoryPrivacySettingsEveryone) GetType() string { + return TypeStoryPrivacySettingsEveryone +} + +func (*StoryPrivacySettingsEveryone) StoryPrivacySettingsType() string { + return TypeStoryPrivacySettingsEveryone +} + +// The story can be viewed by all contacts except chosen users +type StoryPrivacySettingsContacts struct { + meta + // User identifiers of the contacts that can't see the story; always unknown and empty for non-owned stories + ExceptUserIds []int64 `json:"except_user_ids"` +} + +func (entity *StoryPrivacySettingsContacts) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryPrivacySettingsContacts + + return json.Marshal((*stub)(entity)) +} + +func (*StoryPrivacySettingsContacts) GetClass() string { + return ClassStoryPrivacySettings +} + +func (*StoryPrivacySettingsContacts) GetType() string { + return TypeStoryPrivacySettingsContacts +} + +func (*StoryPrivacySettingsContacts) StoryPrivacySettingsType() string { + return TypeStoryPrivacySettingsContacts +} + +// The story can be viewed by all close friends +type StoryPrivacySettingsCloseFriends struct{ + meta +} + +func (entity *StoryPrivacySettingsCloseFriends) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryPrivacySettingsCloseFriends + + return json.Marshal((*stub)(entity)) +} + +func (*StoryPrivacySettingsCloseFriends) GetClass() string { + return ClassStoryPrivacySettings +} + +func (*StoryPrivacySettingsCloseFriends) GetType() string { + return TypeStoryPrivacySettingsCloseFriends +} + +func (*StoryPrivacySettingsCloseFriends) StoryPrivacySettingsType() string { + return TypeStoryPrivacySettingsCloseFriends +} + +// The story can be viewed by certain specified users +type StoryPrivacySettingsSelectedUsers struct { + meta + // Identifiers of the users; always unknown and empty for non-owned stories + UserIds []int64 `json:"user_ids"` +} + +func (entity *StoryPrivacySettingsSelectedUsers) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryPrivacySettingsSelectedUsers + + return json.Marshal((*stub)(entity)) +} + +func (*StoryPrivacySettingsSelectedUsers) GetClass() string { + return ClassStoryPrivacySettings +} + +func (*StoryPrivacySettingsSelectedUsers) GetType() string { + return TypeStoryPrivacySettingsSelectedUsers +} + +func (*StoryPrivacySettingsSelectedUsers) StoryPrivacySettingsType() string { + return TypeStoryPrivacySettingsSelectedUsers } // A rule to allow all users to do something -type UserPrivacySettingRuleAllowAll struct { - meta +type UserPrivacySettingRuleAllowAll struct{ + meta } func (entity *UserPrivacySettingRuleAllowAll) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UserPrivacySettingRuleAllowAll + type stub UserPrivacySettingRuleAllowAll - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UserPrivacySettingRuleAllowAll) GetClass() string { - return ClassUserPrivacySettingRule + return ClassUserPrivacySettingRule } func (*UserPrivacySettingRuleAllowAll) GetType() string { - return TypeUserPrivacySettingRuleAllowAll + return TypeUserPrivacySettingRuleAllowAll } func (*UserPrivacySettingRuleAllowAll) UserPrivacySettingRuleType() string { - return TypeUserPrivacySettingRuleAllowAll + return TypeUserPrivacySettingRuleAllowAll } -// A rule to allow all of a user's contacts to do something -type UserPrivacySettingRuleAllowContacts struct { - meta +// A rule to allow all contacts of the user to do something +type UserPrivacySettingRuleAllowContacts struct{ + meta } func (entity *UserPrivacySettingRuleAllowContacts) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UserPrivacySettingRuleAllowContacts + type stub UserPrivacySettingRuleAllowContacts - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UserPrivacySettingRuleAllowContacts) GetClass() string { - return ClassUserPrivacySettingRule + return ClassUserPrivacySettingRule } func (*UserPrivacySettingRuleAllowContacts) GetType() string { - return TypeUserPrivacySettingRuleAllowContacts + return TypeUserPrivacySettingRuleAllowContacts } func (*UserPrivacySettingRuleAllowContacts) UserPrivacySettingRuleType() string { - return TypeUserPrivacySettingRuleAllowContacts + return TypeUserPrivacySettingRuleAllowContacts +} + +// A rule to allow all Premium Users to do something; currently, allowed only for userPrivacySettingAllowChatInvites +type UserPrivacySettingRuleAllowPremiumUsers struct{ + meta +} + +func (entity *UserPrivacySettingRuleAllowPremiumUsers) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UserPrivacySettingRuleAllowPremiumUsers + + return json.Marshal((*stub)(entity)) +} + +func (*UserPrivacySettingRuleAllowPremiumUsers) GetClass() string { + return ClassUserPrivacySettingRule +} + +func (*UserPrivacySettingRuleAllowPremiumUsers) GetType() string { + return TypeUserPrivacySettingRuleAllowPremiumUsers +} + +func (*UserPrivacySettingRuleAllowPremiumUsers) UserPrivacySettingRuleType() string { + return TypeUserPrivacySettingRuleAllowPremiumUsers } // A rule to allow certain specified users to do something type UserPrivacySettingRuleAllowUsers struct { - meta - // The user identifiers, total number of users in all rules must not exceed 1000 - UserIds []int64 `json:"user_ids"` + meta + // The user identifiers, total number of users in all rules must not exceed 1000 + UserIds []int64 `json:"user_ids"` } func (entity *UserPrivacySettingRuleAllowUsers) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UserPrivacySettingRuleAllowUsers + type stub UserPrivacySettingRuleAllowUsers - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UserPrivacySettingRuleAllowUsers) GetClass() string { - return ClassUserPrivacySettingRule + return ClassUserPrivacySettingRule } func (*UserPrivacySettingRuleAllowUsers) GetType() string { - return TypeUserPrivacySettingRuleAllowUsers + return TypeUserPrivacySettingRuleAllowUsers } func (*UserPrivacySettingRuleAllowUsers) UserPrivacySettingRuleType() string { - return TypeUserPrivacySettingRuleAllowUsers + return TypeUserPrivacySettingRuleAllowUsers } // A rule to allow all members of certain specified basic groups and supergroups to doing something type UserPrivacySettingRuleAllowChatMembers struct { - meta - // The chat identifiers, total number of chats in all rules must not exceed 20 - ChatIds []int64 `json:"chat_ids"` + meta + // The chat identifiers, total number of chats in all rules must not exceed 20 + ChatIds []int64 `json:"chat_ids"` } func (entity *UserPrivacySettingRuleAllowChatMembers) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UserPrivacySettingRuleAllowChatMembers + type stub UserPrivacySettingRuleAllowChatMembers - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UserPrivacySettingRuleAllowChatMembers) GetClass() string { - return ClassUserPrivacySettingRule + return ClassUserPrivacySettingRule } func (*UserPrivacySettingRuleAllowChatMembers) GetType() string { - return TypeUserPrivacySettingRuleAllowChatMembers + return TypeUserPrivacySettingRuleAllowChatMembers } func (*UserPrivacySettingRuleAllowChatMembers) UserPrivacySettingRuleType() string { - return TypeUserPrivacySettingRuleAllowChatMembers + return TypeUserPrivacySettingRuleAllowChatMembers } // A rule to restrict all users from doing something -type UserPrivacySettingRuleRestrictAll struct { - meta +type UserPrivacySettingRuleRestrictAll struct{ + meta } func (entity *UserPrivacySettingRuleRestrictAll) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UserPrivacySettingRuleRestrictAll + type stub UserPrivacySettingRuleRestrictAll - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UserPrivacySettingRuleRestrictAll) GetClass() string { - return ClassUserPrivacySettingRule + return ClassUserPrivacySettingRule } func (*UserPrivacySettingRuleRestrictAll) GetType() string { - return TypeUserPrivacySettingRuleRestrictAll + return TypeUserPrivacySettingRuleRestrictAll } func (*UserPrivacySettingRuleRestrictAll) UserPrivacySettingRuleType() string { - return TypeUserPrivacySettingRuleRestrictAll + return TypeUserPrivacySettingRuleRestrictAll } -// A rule to restrict all contacts of a user from doing something -type UserPrivacySettingRuleRestrictContacts struct { - meta +// A rule to restrict all contacts of the user from doing something +type UserPrivacySettingRuleRestrictContacts struct{ + meta } func (entity *UserPrivacySettingRuleRestrictContacts) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UserPrivacySettingRuleRestrictContacts + type stub UserPrivacySettingRuleRestrictContacts - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UserPrivacySettingRuleRestrictContacts) GetClass() string { - return ClassUserPrivacySettingRule + return ClassUserPrivacySettingRule } func (*UserPrivacySettingRuleRestrictContacts) GetType() string { - return TypeUserPrivacySettingRuleRestrictContacts + return TypeUserPrivacySettingRuleRestrictContacts } func (*UserPrivacySettingRuleRestrictContacts) UserPrivacySettingRuleType() string { - return TypeUserPrivacySettingRuleRestrictContacts + return TypeUserPrivacySettingRuleRestrictContacts } // A rule to restrict all specified users from doing something type UserPrivacySettingRuleRestrictUsers struct { - meta - // The user identifiers, total number of users in all rules must not exceed 1000 - UserIds []int64 `json:"user_ids"` + meta + // The user identifiers, total number of users in all rules must not exceed 1000 + UserIds []int64 `json:"user_ids"` } func (entity *UserPrivacySettingRuleRestrictUsers) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UserPrivacySettingRuleRestrictUsers + type stub UserPrivacySettingRuleRestrictUsers - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UserPrivacySettingRuleRestrictUsers) GetClass() string { - return ClassUserPrivacySettingRule + return ClassUserPrivacySettingRule } func (*UserPrivacySettingRuleRestrictUsers) GetType() string { - return TypeUserPrivacySettingRuleRestrictUsers + return TypeUserPrivacySettingRuleRestrictUsers } func (*UserPrivacySettingRuleRestrictUsers) UserPrivacySettingRuleType() string { - return TypeUserPrivacySettingRuleRestrictUsers + return TypeUserPrivacySettingRuleRestrictUsers } // A rule to restrict all members of specified basic groups and supergroups from doing something type UserPrivacySettingRuleRestrictChatMembers struct { - meta - // The chat identifiers, total number of chats in all rules must not exceed 20 - ChatIds []int64 `json:"chat_ids"` + meta + // The chat identifiers, total number of chats in all rules must not exceed 20 + ChatIds []int64 `json:"chat_ids"` } func (entity *UserPrivacySettingRuleRestrictChatMembers) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UserPrivacySettingRuleRestrictChatMembers + type stub UserPrivacySettingRuleRestrictChatMembers - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UserPrivacySettingRuleRestrictChatMembers) GetClass() string { - return ClassUserPrivacySettingRule + return ClassUserPrivacySettingRule } func (*UserPrivacySettingRuleRestrictChatMembers) GetType() string { - return TypeUserPrivacySettingRuleRestrictChatMembers + return TypeUserPrivacySettingRuleRestrictChatMembers } func (*UserPrivacySettingRuleRestrictChatMembers) UserPrivacySettingRuleType() string { - return TypeUserPrivacySettingRuleRestrictChatMembers + return TypeUserPrivacySettingRuleRestrictChatMembers } // 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 { - meta - // A list of rules - Rules []UserPrivacySettingRule `json:"rules"` + meta + // A list of rules + Rules []UserPrivacySettingRule `json:"rules"` } func (entity *UserPrivacySettingRules) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UserPrivacySettingRules + type stub UserPrivacySettingRules - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UserPrivacySettingRules) GetClass() string { - return ClassUserPrivacySettingRules + return ClassUserPrivacySettingRules } func (*UserPrivacySettingRules) GetType() string { - return TypeUserPrivacySettingRules + return TypeUserPrivacySettingRules } func (userPrivacySettingRules *UserPrivacySettingRules) UnmarshalJSON(data []byte) error { - var tmp struct { - Rules []json.RawMessage `json:"rules"` - } + var tmp struct { + Rules []json.RawMessage `json:"rules"` + } - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } - fieldRules, _ := UnmarshalListOfUserPrivacySettingRule(tmp.Rules) - userPrivacySettingRules.Rules = fieldRules + fieldRules, _ := UnmarshalListOfUserPrivacySettingRule(tmp.Rules) + userPrivacySettingRules.Rules = fieldRules - return nil + return nil } // A privacy setting for managing whether the user's online status is visible -type UserPrivacySettingShowStatus struct { - meta +type UserPrivacySettingShowStatus struct{ + meta } func (entity *UserPrivacySettingShowStatus) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UserPrivacySettingShowStatus + type stub UserPrivacySettingShowStatus - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UserPrivacySettingShowStatus) GetClass() string { - return ClassUserPrivacySetting + return ClassUserPrivacySetting } func (*UserPrivacySettingShowStatus) GetType() string { - return TypeUserPrivacySettingShowStatus + return TypeUserPrivacySettingShowStatus } func (*UserPrivacySettingShowStatus) UserPrivacySettingType() string { - return TypeUserPrivacySettingShowStatus + return TypeUserPrivacySettingShowStatus } // A privacy setting for managing whether the user's profile photo is visible -type UserPrivacySettingShowProfilePhoto struct { - meta +type UserPrivacySettingShowProfilePhoto struct{ + meta } func (entity *UserPrivacySettingShowProfilePhoto) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UserPrivacySettingShowProfilePhoto + type stub UserPrivacySettingShowProfilePhoto - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UserPrivacySettingShowProfilePhoto) GetClass() string { - return ClassUserPrivacySetting + return ClassUserPrivacySetting } func (*UserPrivacySettingShowProfilePhoto) GetType() string { - return TypeUserPrivacySettingShowProfilePhoto + return TypeUserPrivacySettingShowProfilePhoto } func (*UserPrivacySettingShowProfilePhoto) UserPrivacySettingType() string { - return TypeUserPrivacySettingShowProfilePhoto + return TypeUserPrivacySettingShowProfilePhoto } // A privacy setting for managing whether a link to the user's account is included in forwarded messages -type UserPrivacySettingShowLinkInForwardedMessages struct { - meta +type UserPrivacySettingShowLinkInForwardedMessages struct{ + meta } func (entity *UserPrivacySettingShowLinkInForwardedMessages) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UserPrivacySettingShowLinkInForwardedMessages + type stub UserPrivacySettingShowLinkInForwardedMessages - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UserPrivacySettingShowLinkInForwardedMessages) GetClass() string { - return ClassUserPrivacySetting + return ClassUserPrivacySetting } func (*UserPrivacySettingShowLinkInForwardedMessages) GetType() string { - return TypeUserPrivacySettingShowLinkInForwardedMessages + return TypeUserPrivacySettingShowLinkInForwardedMessages } func (*UserPrivacySettingShowLinkInForwardedMessages) UserPrivacySettingType() string { - return TypeUserPrivacySettingShowLinkInForwardedMessages + return TypeUserPrivacySettingShowLinkInForwardedMessages } // A privacy setting for managing whether the user's phone number is visible -type UserPrivacySettingShowPhoneNumber struct { - meta +type UserPrivacySettingShowPhoneNumber struct{ + meta } func (entity *UserPrivacySettingShowPhoneNumber) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UserPrivacySettingShowPhoneNumber + type stub UserPrivacySettingShowPhoneNumber - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UserPrivacySettingShowPhoneNumber) GetClass() string { - return ClassUserPrivacySetting + return ClassUserPrivacySetting } func (*UserPrivacySettingShowPhoneNumber) GetType() string { - return TypeUserPrivacySettingShowPhoneNumber + return TypeUserPrivacySettingShowPhoneNumber } func (*UserPrivacySettingShowPhoneNumber) UserPrivacySettingType() string { - return TypeUserPrivacySettingShowPhoneNumber + return TypeUserPrivacySettingShowPhoneNumber +} + +// A privacy setting for managing whether the user's bio is visible +type UserPrivacySettingShowBio struct{ + meta +} + +func (entity *UserPrivacySettingShowBio) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UserPrivacySettingShowBio + + return json.Marshal((*stub)(entity)) +} + +func (*UserPrivacySettingShowBio) GetClass() string { + return ClassUserPrivacySetting +} + +func (*UserPrivacySettingShowBio) GetType() string { + return TypeUserPrivacySettingShowBio +} + +func (*UserPrivacySettingShowBio) UserPrivacySettingType() string { + return TypeUserPrivacySettingShowBio +} + +// A privacy setting for managing whether the user's birthdate is visible +type UserPrivacySettingShowBirthdate struct{ + meta +} + +func (entity *UserPrivacySettingShowBirthdate) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UserPrivacySettingShowBirthdate + + return json.Marshal((*stub)(entity)) +} + +func (*UserPrivacySettingShowBirthdate) GetClass() string { + return ClassUserPrivacySetting +} + +func (*UserPrivacySettingShowBirthdate) GetType() string { + return TypeUserPrivacySettingShowBirthdate +} + +func (*UserPrivacySettingShowBirthdate) UserPrivacySettingType() string { + return TypeUserPrivacySettingShowBirthdate } // A privacy setting for managing whether the user can be invited to chats -type UserPrivacySettingAllowChatInvites struct { - meta +type UserPrivacySettingAllowChatInvites struct{ + meta } func (entity *UserPrivacySettingAllowChatInvites) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UserPrivacySettingAllowChatInvites + type stub UserPrivacySettingAllowChatInvites - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UserPrivacySettingAllowChatInvites) GetClass() string { - return ClassUserPrivacySetting + return ClassUserPrivacySetting } func (*UserPrivacySettingAllowChatInvites) GetType() string { - return TypeUserPrivacySettingAllowChatInvites + return TypeUserPrivacySettingAllowChatInvites } func (*UserPrivacySettingAllowChatInvites) UserPrivacySettingType() string { - return TypeUserPrivacySettingAllowChatInvites + return TypeUserPrivacySettingAllowChatInvites } // A privacy setting for managing whether the user can be called -type UserPrivacySettingAllowCalls struct { - meta +type UserPrivacySettingAllowCalls struct{ + meta } func (entity *UserPrivacySettingAllowCalls) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UserPrivacySettingAllowCalls + type stub UserPrivacySettingAllowCalls - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UserPrivacySettingAllowCalls) GetClass() string { - return ClassUserPrivacySetting + return ClassUserPrivacySetting } func (*UserPrivacySettingAllowCalls) GetType() string { - return TypeUserPrivacySettingAllowCalls + return TypeUserPrivacySettingAllowCalls } func (*UserPrivacySettingAllowCalls) UserPrivacySettingType() string { - return TypeUserPrivacySettingAllowCalls + return TypeUserPrivacySettingAllowCalls } // A privacy setting for managing whether peer-to-peer connections can be used for calls -type UserPrivacySettingAllowPeerToPeerCalls struct { - meta +type UserPrivacySettingAllowPeerToPeerCalls struct{ + meta } func (entity *UserPrivacySettingAllowPeerToPeerCalls) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UserPrivacySettingAllowPeerToPeerCalls + type stub UserPrivacySettingAllowPeerToPeerCalls - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UserPrivacySettingAllowPeerToPeerCalls) GetClass() string { - return ClassUserPrivacySetting + return ClassUserPrivacySetting } func (*UserPrivacySettingAllowPeerToPeerCalls) GetType() string { - return TypeUserPrivacySettingAllowPeerToPeerCalls + return TypeUserPrivacySettingAllowPeerToPeerCalls } func (*UserPrivacySettingAllowPeerToPeerCalls) UserPrivacySettingType() string { - return TypeUserPrivacySettingAllowPeerToPeerCalls + return TypeUserPrivacySettingAllowPeerToPeerCalls } // 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" -type UserPrivacySettingAllowFindingByPhoneNumber struct { - meta +type UserPrivacySettingAllowFindingByPhoneNumber struct{ + meta } func (entity *UserPrivacySettingAllowFindingByPhoneNumber) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UserPrivacySettingAllowFindingByPhoneNumber + type stub UserPrivacySettingAllowFindingByPhoneNumber - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UserPrivacySettingAllowFindingByPhoneNumber) GetClass() string { - return ClassUserPrivacySetting + return ClassUserPrivacySetting } func (*UserPrivacySettingAllowFindingByPhoneNumber) GetType() string { - return TypeUserPrivacySettingAllowFindingByPhoneNumber + return TypeUserPrivacySettingAllowFindingByPhoneNumber } func (*UserPrivacySettingAllowFindingByPhoneNumber) UserPrivacySettingType() string { - return TypeUserPrivacySettingAllowFindingByPhoneNumber + return TypeUserPrivacySettingAllowFindingByPhoneNumber } -// A privacy setting for managing whether the user can receive voice and video messages in private chats -type UserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages struct { - meta +// A privacy setting for managing whether the user can receive voice and video messages in private chats; for Telegram Premium users only +type UserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages struct{ + meta } func (entity *UserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages + type stub UserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages) GetClass() string { - return ClassUserPrivacySetting + return ClassUserPrivacySetting } func (*UserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages) GetType() string { - return TypeUserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages + return TypeUserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages } func (*UserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages) UserPrivacySettingType() string { - return TypeUserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages + return TypeUserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages +} + +// Contains privacy settings for message read date in private chats. Read dates are always shown to the users that can see online status of the current user regardless of this setting +type ReadDatePrivacySettings struct { + meta + // True, if message read date is shown to other users in private chats. If false and the current user isn't a Telegram Premium user, then they will not be able to see other's message read date. + ShowReadDate bool `json:"show_read_date"` +} + +func (entity *ReadDatePrivacySettings) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ReadDatePrivacySettings + + return json.Marshal((*stub)(entity)) +} + +func (*ReadDatePrivacySettings) GetClass() string { + return ClassReadDatePrivacySettings +} + +func (*ReadDatePrivacySettings) GetType() string { + return TypeReadDatePrivacySettings +} + +// Contains privacy settings for new chats with non-contacts +type NewChatPrivacySettings struct { + meta + // True, if non-contacts users are able to write first to the current user. Telegram Premium subscribers are able to write first regardless of this setting + AllowNewChatsFromUnknownUsers bool `json:"allow_new_chats_from_unknown_users"` +} + +func (entity *NewChatPrivacySettings) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub NewChatPrivacySettings + + return json.Marshal((*stub)(entity)) +} + +func (*NewChatPrivacySettings) GetClass() string { + return ClassNewChatPrivacySettings +} + +func (*NewChatPrivacySettings) GetType() string { + return TypeNewChatPrivacySettings +} + +// The user can be messaged +type CanSendMessageToUserResultOk struct{ + meta +} + +func (entity *CanSendMessageToUserResultOk) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CanSendMessageToUserResultOk + + return json.Marshal((*stub)(entity)) +} + +func (*CanSendMessageToUserResultOk) GetClass() string { + return ClassCanSendMessageToUserResult +} + +func (*CanSendMessageToUserResultOk) GetType() string { + return TypeCanSendMessageToUserResultOk +} + +func (*CanSendMessageToUserResultOk) CanSendMessageToUserResultType() string { + return TypeCanSendMessageToUserResultOk +} + +// The user can't be messaged, because they are deleted or unknown +type CanSendMessageToUserResultUserIsDeleted struct{ + meta +} + +func (entity *CanSendMessageToUserResultUserIsDeleted) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CanSendMessageToUserResultUserIsDeleted + + return json.Marshal((*stub)(entity)) +} + +func (*CanSendMessageToUserResultUserIsDeleted) GetClass() string { + return ClassCanSendMessageToUserResult +} + +func (*CanSendMessageToUserResultUserIsDeleted) GetType() string { + return TypeCanSendMessageToUserResultUserIsDeleted +} + +func (*CanSendMessageToUserResultUserIsDeleted) CanSendMessageToUserResultType() string { + return TypeCanSendMessageToUserResultUserIsDeleted +} + +// The user can't be messaged, because they restrict new chats with non-contacts +type CanSendMessageToUserResultUserRestrictsNewChats struct{ + meta +} + +func (entity *CanSendMessageToUserResultUserRestrictsNewChats) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CanSendMessageToUserResultUserRestrictsNewChats + + return json.Marshal((*stub)(entity)) +} + +func (*CanSendMessageToUserResultUserRestrictsNewChats) GetClass() string { + return ClassCanSendMessageToUserResult +} + +func (*CanSendMessageToUserResultUserRestrictsNewChats) GetType() string { + return TypeCanSendMessageToUserResultUserRestrictsNewChats +} + +func (*CanSendMessageToUserResultUserRestrictsNewChats) CanSendMessageToUserResultType() string { + return TypeCanSendMessageToUserResultUserRestrictsNewChats } // Contains information about the period of inactivity after which the current user's account will automatically be deleted type AccountTtl struct { - meta - // Number of days of inactivity before the account will be flagged for deletion; 30-366 days - Days int32 `json:"days"` + meta + // Number of days of inactivity before the account will be flagged for deletion; 30-366 days + Days int32 `json:"days"` } func (entity *AccountTtl) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub AccountTtl + type stub AccountTtl - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*AccountTtl) GetClass() string { - return ClassAccountTtl + return ClassAccountTtl } func (*AccountTtl) GetType() string { - return TypeAccountTtl + return TypeAccountTtl } // Contains default auto-delete timer setting for new chats type MessageAutoDeleteTime struct { - meta - // Message auto-delete time, in seconds. If 0, then messages aren't deleted automatically - Time int32 `json:"time"` + meta + // Message auto-delete time, in seconds. If 0, then messages aren't deleted automatically + Time int32 `json:"time"` } func (entity *MessageAutoDeleteTime) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub MessageAutoDeleteTime + type stub MessageAutoDeleteTime - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*MessageAutoDeleteTime) GetClass() string { - return ClassMessageAutoDeleteTime + return ClassMessageAutoDeleteTime } func (*MessageAutoDeleteTime) GetType() string { - return TypeMessageAutoDeleteTime + return TypeMessageAutoDeleteTime } // The session is running on an Android device -type SessionTypeAndroid struct { - meta +type SessionTypeAndroid struct{ + meta } func (entity *SessionTypeAndroid) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub SessionTypeAndroid + type stub SessionTypeAndroid - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*SessionTypeAndroid) GetClass() string { - return ClassSessionType + return ClassSessionType } func (*SessionTypeAndroid) GetType() string { - return TypeSessionTypeAndroid + return TypeSessionTypeAndroid } func (*SessionTypeAndroid) SessionTypeType() string { - return TypeSessionTypeAndroid + return TypeSessionTypeAndroid } // The session is running on a generic Apple device -type SessionTypeApple struct { - meta +type SessionTypeApple struct{ + meta } func (entity *SessionTypeApple) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub SessionTypeApple + type stub SessionTypeApple - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*SessionTypeApple) GetClass() string { - return ClassSessionType + return ClassSessionType } func (*SessionTypeApple) GetType() string { - return TypeSessionTypeApple + return TypeSessionTypeApple } func (*SessionTypeApple) SessionTypeType() string { - return TypeSessionTypeApple + return TypeSessionTypeApple } // The session is running on the Brave browser -type SessionTypeBrave struct { - meta +type SessionTypeBrave struct{ + meta } func (entity *SessionTypeBrave) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub SessionTypeBrave + type stub SessionTypeBrave - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*SessionTypeBrave) GetClass() string { - return ClassSessionType + return ClassSessionType } func (*SessionTypeBrave) GetType() string { - return TypeSessionTypeBrave + return TypeSessionTypeBrave } func (*SessionTypeBrave) SessionTypeType() string { - return TypeSessionTypeBrave + return TypeSessionTypeBrave } // The session is running on the Chrome browser -type SessionTypeChrome struct { - meta +type SessionTypeChrome struct{ + meta } func (entity *SessionTypeChrome) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub SessionTypeChrome + type stub SessionTypeChrome - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*SessionTypeChrome) GetClass() string { - return ClassSessionType + return ClassSessionType } func (*SessionTypeChrome) GetType() string { - return TypeSessionTypeChrome + return TypeSessionTypeChrome } func (*SessionTypeChrome) SessionTypeType() string { - return TypeSessionTypeChrome + return TypeSessionTypeChrome } // The session is running on the Edge browser -type SessionTypeEdge struct { - meta +type SessionTypeEdge struct{ + meta } func (entity *SessionTypeEdge) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub SessionTypeEdge + type stub SessionTypeEdge - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*SessionTypeEdge) GetClass() string { - return ClassSessionType + return ClassSessionType } func (*SessionTypeEdge) GetType() string { - return TypeSessionTypeEdge + return TypeSessionTypeEdge } func (*SessionTypeEdge) SessionTypeType() string { - return TypeSessionTypeEdge + return TypeSessionTypeEdge } // The session is running on the Firefox browser -type SessionTypeFirefox struct { - meta +type SessionTypeFirefox struct{ + meta } func (entity *SessionTypeFirefox) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub SessionTypeFirefox + type stub SessionTypeFirefox - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*SessionTypeFirefox) GetClass() string { - return ClassSessionType + return ClassSessionType } func (*SessionTypeFirefox) GetType() string { - return TypeSessionTypeFirefox + return TypeSessionTypeFirefox } func (*SessionTypeFirefox) SessionTypeType() string { - return TypeSessionTypeFirefox + return TypeSessionTypeFirefox } // The session is running on an iPad device -type SessionTypeIpad struct { - meta +type SessionTypeIpad struct{ + meta } func (entity *SessionTypeIpad) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub SessionTypeIpad + type stub SessionTypeIpad - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*SessionTypeIpad) GetClass() string { - return ClassSessionType + return ClassSessionType } func (*SessionTypeIpad) GetType() string { - return TypeSessionTypeIpad + return TypeSessionTypeIpad } func (*SessionTypeIpad) SessionTypeType() string { - return TypeSessionTypeIpad + return TypeSessionTypeIpad } // The session is running on an iPhone device -type SessionTypeIphone struct { - meta +type SessionTypeIphone struct{ + meta } func (entity *SessionTypeIphone) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub SessionTypeIphone + type stub SessionTypeIphone - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*SessionTypeIphone) GetClass() string { - return ClassSessionType + return ClassSessionType } func (*SessionTypeIphone) GetType() string { - return TypeSessionTypeIphone + return TypeSessionTypeIphone } func (*SessionTypeIphone) SessionTypeType() string { - return TypeSessionTypeIphone + return TypeSessionTypeIphone } // The session is running on a Linux device -type SessionTypeLinux struct { - meta +type SessionTypeLinux struct{ + meta } func (entity *SessionTypeLinux) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub SessionTypeLinux + type stub SessionTypeLinux - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*SessionTypeLinux) GetClass() string { - return ClassSessionType + return ClassSessionType } func (*SessionTypeLinux) GetType() string { - return TypeSessionTypeLinux + return TypeSessionTypeLinux } func (*SessionTypeLinux) SessionTypeType() string { - return TypeSessionTypeLinux + return TypeSessionTypeLinux } // The session is running on a Mac device -type SessionTypeMac struct { - meta +type SessionTypeMac struct{ + meta } func (entity *SessionTypeMac) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub SessionTypeMac + type stub SessionTypeMac - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*SessionTypeMac) GetClass() string { - return ClassSessionType + return ClassSessionType } func (*SessionTypeMac) GetType() string { - return TypeSessionTypeMac + return TypeSessionTypeMac } func (*SessionTypeMac) SessionTypeType() string { - return TypeSessionTypeMac + return TypeSessionTypeMac } // The session is running on the Opera browser -type SessionTypeOpera struct { - meta +type SessionTypeOpera struct{ + meta } func (entity *SessionTypeOpera) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub SessionTypeOpera + type stub SessionTypeOpera - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*SessionTypeOpera) GetClass() string { - return ClassSessionType + return ClassSessionType } func (*SessionTypeOpera) GetType() string { - return TypeSessionTypeOpera + return TypeSessionTypeOpera } func (*SessionTypeOpera) SessionTypeType() string { - return TypeSessionTypeOpera + return TypeSessionTypeOpera } // The session is running on the Safari browser -type SessionTypeSafari struct { - meta +type SessionTypeSafari struct{ + meta } func (entity *SessionTypeSafari) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub SessionTypeSafari + type stub SessionTypeSafari - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*SessionTypeSafari) GetClass() string { - return ClassSessionType + return ClassSessionType } func (*SessionTypeSafari) GetType() string { - return TypeSessionTypeSafari + return TypeSessionTypeSafari } func (*SessionTypeSafari) SessionTypeType() string { - return TypeSessionTypeSafari + return TypeSessionTypeSafari } // The session is running on an Ubuntu device -type SessionTypeUbuntu struct { - meta +type SessionTypeUbuntu struct{ + meta } func (entity *SessionTypeUbuntu) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub SessionTypeUbuntu + type stub SessionTypeUbuntu - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*SessionTypeUbuntu) GetClass() string { - return ClassSessionType + return ClassSessionType } func (*SessionTypeUbuntu) GetType() string { - return TypeSessionTypeUbuntu + return TypeSessionTypeUbuntu } func (*SessionTypeUbuntu) SessionTypeType() string { - return TypeSessionTypeUbuntu + return TypeSessionTypeUbuntu } // The session is running on an unknown type of device -type SessionTypeUnknown struct { - meta +type SessionTypeUnknown struct{ + meta } func (entity *SessionTypeUnknown) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub SessionTypeUnknown + type stub SessionTypeUnknown - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*SessionTypeUnknown) GetClass() string { - return ClassSessionType + return ClassSessionType } func (*SessionTypeUnknown) GetType() string { - return TypeSessionTypeUnknown + return TypeSessionTypeUnknown } func (*SessionTypeUnknown) SessionTypeType() string { - return TypeSessionTypeUnknown + return TypeSessionTypeUnknown } // The session is running on the Vivaldi browser -type SessionTypeVivaldi struct { - meta +type SessionTypeVivaldi struct{ + meta } func (entity *SessionTypeVivaldi) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub SessionTypeVivaldi + type stub SessionTypeVivaldi - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*SessionTypeVivaldi) GetClass() string { - return ClassSessionType + return ClassSessionType } func (*SessionTypeVivaldi) GetType() string { - return TypeSessionTypeVivaldi + return TypeSessionTypeVivaldi } func (*SessionTypeVivaldi) SessionTypeType() string { - return TypeSessionTypeVivaldi + return TypeSessionTypeVivaldi } // The session is running on a Windows device -type SessionTypeWindows struct { - meta +type SessionTypeWindows struct{ + meta } func (entity *SessionTypeWindows) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub SessionTypeWindows + type stub SessionTypeWindows - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*SessionTypeWindows) GetClass() string { - return ClassSessionType + return ClassSessionType } func (*SessionTypeWindows) GetType() string { - return TypeSessionTypeWindows + return TypeSessionTypeWindows } func (*SessionTypeWindows) SessionTypeType() string { - return TypeSessionTypeWindows + return TypeSessionTypeWindows } // The session is running on an Xbox console -type SessionTypeXbox struct { - meta +type SessionTypeXbox struct{ + meta } func (entity *SessionTypeXbox) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub SessionTypeXbox + type stub SessionTypeXbox - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*SessionTypeXbox) GetClass() string { - return ClassSessionType + return ClassSessionType } func (*SessionTypeXbox) GetType() string { - return TypeSessionTypeXbox + return TypeSessionTypeXbox } func (*SessionTypeXbox) SessionTypeType() string { - return TypeSessionTypeXbox + return TypeSessionTypeXbox } // 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 { - meta - // Session identifier - Id JsonInt64 `json:"id"` - // True, if this session is the current session - IsCurrent bool `json:"is_current"` - // True, if a 2-step verification 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"` - // Session type based on the system and application version, which can be used to display a corresponding icon - Type SessionType `json:"type"` - // 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"` + meta + // Session identifier + Id JsonInt64 `json:"id"` + // True, if this session is the current session + IsCurrent bool `json:"is_current"` + // True, if a 2-step verification password is needed to complete authorization of the session + IsPasswordPending bool `json:"is_password_pending"` + // True, if the session wasn't confirmed from another session + IsUnconfirmed bool `json:"is_unconfirmed"` + // 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"` + // Session type based on the system and application version, which can be used to display a corresponding icon + Type SessionType `json:"type"` + // 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 + IpAddress string `json:"ip_address"` + // A human-readable description of the location from which the session was created, based on the IP address + Location string `json:"location"` } func (entity *Session) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub Session + type stub Session - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*Session) GetClass() string { - return ClassSession + return ClassSession } func (*Session) GetType() string { - return TypeSession + return TypeSession } func (session *Session) UnmarshalJSON(data []byte) error { - var tmp struct { - Id JsonInt64 `json:"id"` - IsCurrent bool `json:"is_current"` - IsPasswordPending bool `json:"is_password_pending"` - CanAcceptSecretChats bool `json:"can_accept_secret_chats"` - CanAcceptCalls bool `json:"can_accept_calls"` - Type json.RawMessage `json:"type"` - ApiId int32 `json:"api_id"` - ApplicationName string `json:"application_name"` - ApplicationVersion string `json:"application_version"` - IsOfficialApplication bool `json:"is_official_application"` - DeviceModel string `json:"device_model"` - Platform string `json:"platform"` - SystemVersion string `json:"system_version"` - LogInDate int32 `json:"log_in_date"` - LastActiveDate int32 `json:"last_active_date"` - Ip string `json:"ip"` - Country string `json:"country"` - Region string `json:"region"` - } + var tmp struct { + Id JsonInt64 `json:"id"` + IsCurrent bool `json:"is_current"` + IsPasswordPending bool `json:"is_password_pending"` + IsUnconfirmed bool `json:"is_unconfirmed"` + CanAcceptSecretChats bool `json:"can_accept_secret_chats"` + CanAcceptCalls bool `json:"can_accept_calls"` + Type json.RawMessage `json:"type"` + ApiId int32 `json:"api_id"` + ApplicationName string `json:"application_name"` + ApplicationVersion string `json:"application_version"` + IsOfficialApplication bool `json:"is_official_application"` + DeviceModel string `json:"device_model"` + Platform string `json:"platform"` + SystemVersion string `json:"system_version"` + LogInDate int32 `json:"log_in_date"` + LastActiveDate int32 `json:"last_active_date"` + IpAddress string `json:"ip_address"` + Location string `json:"location"` + } - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } - session.Id = tmp.Id - session.IsCurrent = tmp.IsCurrent - session.IsPasswordPending = tmp.IsPasswordPending - session.CanAcceptSecretChats = tmp.CanAcceptSecretChats - session.CanAcceptCalls = tmp.CanAcceptCalls - session.ApiId = tmp.ApiId - session.ApplicationName = tmp.ApplicationName - session.ApplicationVersion = tmp.ApplicationVersion - session.IsOfficialApplication = tmp.IsOfficialApplication - session.DeviceModel = tmp.DeviceModel - session.Platform = tmp.Platform - session.SystemVersion = tmp.SystemVersion - session.LogInDate = tmp.LogInDate - session.LastActiveDate = tmp.LastActiveDate - session.Ip = tmp.Ip - session.Country = tmp.Country - session.Region = tmp.Region + session.Id = tmp.Id + session.IsCurrent = tmp.IsCurrent + session.IsPasswordPending = tmp.IsPasswordPending + session.IsUnconfirmed = tmp.IsUnconfirmed + session.CanAcceptSecretChats = tmp.CanAcceptSecretChats + session.CanAcceptCalls = tmp.CanAcceptCalls + session.ApiId = tmp.ApiId + session.ApplicationName = tmp.ApplicationName + session.ApplicationVersion = tmp.ApplicationVersion + session.IsOfficialApplication = tmp.IsOfficialApplication + session.DeviceModel = tmp.DeviceModel + session.Platform = tmp.Platform + session.SystemVersion = tmp.SystemVersion + session.LogInDate = tmp.LogInDate + session.LastActiveDate = tmp.LastActiveDate + session.IpAddress = tmp.IpAddress + session.Location = tmp.Location - fieldType, _ := UnmarshalSessionType(tmp.Type) - session.Type = fieldType + fieldType, _ := UnmarshalSessionType(tmp.Type) + session.Type = fieldType - return nil + return nil } // Contains a list of sessions type Sessions struct { - 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"` + 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"` } func (entity *Sessions) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub Sessions + type stub Sessions - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*Sessions) GetClass() string { - return ClassSessions + return ClassSessions } func (*Sessions) GetType() string { - return TypeSessions + return TypeSessions +} + +// Contains information about an unconfirmed session +type UnconfirmedSession struct { + meta + // Session identifier + Id JsonInt64 `json:"id"` + // Point in time (Unix timestamp) when the user has logged in + LogInDate int32 `json:"log_in_date"` + // Model of the device that was used for the session creation, as provided by the application + DeviceModel string `json:"device_model"` + // A human-readable description of the location from which the session was created, based on the IP address + Location string `json:"location"` +} + +func (entity *UnconfirmedSession) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UnconfirmedSession + + return json.Marshal((*stub)(entity)) +} + +func (*UnconfirmedSession) GetClass() string { + return ClassUnconfirmedSession +} + +func (*UnconfirmedSession) GetType() string { + return TypeUnconfirmedSession } // Contains information about one website the current user is logged in with Telegram type ConnectedWebsite struct { - 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"` + 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 + IpAddress string `json:"ip_address"` + // 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"` } func (entity *ConnectedWebsite) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub ConnectedWebsite + type stub ConnectedWebsite - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*ConnectedWebsite) GetClass() string { - return ClassConnectedWebsite + return ClassConnectedWebsite } func (*ConnectedWebsite) GetType() string { - return TypeConnectedWebsite + return TypeConnectedWebsite } // Contains a list of websites the current user is logged in with Telegram type ConnectedWebsites struct { - meta - // List of connected websites - Websites []*ConnectedWebsite `json:"websites"` + meta + // List of connected websites + Websites []*ConnectedWebsite `json:"websites"` } func (entity *ConnectedWebsites) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub ConnectedWebsites + type stub ConnectedWebsites - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*ConnectedWebsites) GetClass() string { - return ClassConnectedWebsites + return ClassConnectedWebsites } func (*ConnectedWebsites) GetType() string { - return TypeConnectedWebsites + return TypeConnectedWebsites } // The chat contains spam messages -type ChatReportReasonSpam struct { - meta +type ReportReasonSpam struct{ + meta } -func (entity *ChatReportReasonSpam) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() +func (entity *ReportReasonSpam) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() - type stub ChatReportReasonSpam + type stub ReportReasonSpam - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } -func (*ChatReportReasonSpam) GetClass() string { - return ClassChatReportReason +func (*ReportReasonSpam) GetClass() string { + return ClassReportReason } -func (*ChatReportReasonSpam) GetType() string { - return TypeChatReportReasonSpam +func (*ReportReasonSpam) GetType() string { + return TypeReportReasonSpam } -func (*ChatReportReasonSpam) ChatReportReasonType() string { - return TypeChatReportReasonSpam +func (*ReportReasonSpam) ReportReasonType() string { + return TypeReportReasonSpam } // The chat promotes violence -type ChatReportReasonViolence struct { - meta +type ReportReasonViolence struct{ + meta } -func (entity *ChatReportReasonViolence) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() +func (entity *ReportReasonViolence) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() - type stub ChatReportReasonViolence + type stub ReportReasonViolence - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } -func (*ChatReportReasonViolence) GetClass() string { - return ClassChatReportReason +func (*ReportReasonViolence) GetClass() string { + return ClassReportReason } -func (*ChatReportReasonViolence) GetType() string { - return TypeChatReportReasonViolence +func (*ReportReasonViolence) GetType() string { + return TypeReportReasonViolence } -func (*ChatReportReasonViolence) ChatReportReasonType() string { - return TypeChatReportReasonViolence +func (*ReportReasonViolence) ReportReasonType() string { + return TypeReportReasonViolence } // The chat contains pornographic messages -type ChatReportReasonPornography struct { - meta +type ReportReasonPornography struct{ + meta } -func (entity *ChatReportReasonPornography) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() +func (entity *ReportReasonPornography) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() - type stub ChatReportReasonPornography + type stub ReportReasonPornography - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } -func (*ChatReportReasonPornography) GetClass() string { - return ClassChatReportReason +func (*ReportReasonPornography) GetClass() string { + return ClassReportReason } -func (*ChatReportReasonPornography) GetType() string { - return TypeChatReportReasonPornography +func (*ReportReasonPornography) GetType() string { + return TypeReportReasonPornography } -func (*ChatReportReasonPornography) ChatReportReasonType() string { - return TypeChatReportReasonPornography +func (*ReportReasonPornography) ReportReasonType() string { + return TypeReportReasonPornography } // The chat has child abuse related content -type ChatReportReasonChildAbuse struct { - meta +type ReportReasonChildAbuse struct{ + meta } -func (entity *ChatReportReasonChildAbuse) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() +func (entity *ReportReasonChildAbuse) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() - type stub ChatReportReasonChildAbuse + type stub ReportReasonChildAbuse - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } -func (*ChatReportReasonChildAbuse) GetClass() string { - return ClassChatReportReason +func (*ReportReasonChildAbuse) GetClass() string { + return ClassReportReason } -func (*ChatReportReasonChildAbuse) GetType() string { - return TypeChatReportReasonChildAbuse +func (*ReportReasonChildAbuse) GetType() string { + return TypeReportReasonChildAbuse } -func (*ChatReportReasonChildAbuse) ChatReportReasonType() string { - return TypeChatReportReasonChildAbuse +func (*ReportReasonChildAbuse) ReportReasonType() string { + return TypeReportReasonChildAbuse } // The chat contains copyrighted content -type ChatReportReasonCopyright struct { - meta +type ReportReasonCopyright struct{ + meta } -func (entity *ChatReportReasonCopyright) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() +func (entity *ReportReasonCopyright) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() - type stub ChatReportReasonCopyright + type stub ReportReasonCopyright - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } -func (*ChatReportReasonCopyright) GetClass() string { - return ClassChatReportReason +func (*ReportReasonCopyright) GetClass() string { + return ClassReportReason } -func (*ChatReportReasonCopyright) GetType() string { - return TypeChatReportReasonCopyright +func (*ReportReasonCopyright) GetType() string { + return TypeReportReasonCopyright } -func (*ChatReportReasonCopyright) ChatReportReasonType() string { - return TypeChatReportReasonCopyright +func (*ReportReasonCopyright) ReportReasonType() string { + return TypeReportReasonCopyright } // The location-based chat is unrelated to its stated location -type ChatReportReasonUnrelatedLocation struct { - meta +type ReportReasonUnrelatedLocation struct{ + meta } -func (entity *ChatReportReasonUnrelatedLocation) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() +func (entity *ReportReasonUnrelatedLocation) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() - type stub ChatReportReasonUnrelatedLocation + type stub ReportReasonUnrelatedLocation - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } -func (*ChatReportReasonUnrelatedLocation) GetClass() string { - return ClassChatReportReason +func (*ReportReasonUnrelatedLocation) GetClass() string { + return ClassReportReason } -func (*ChatReportReasonUnrelatedLocation) GetType() string { - return TypeChatReportReasonUnrelatedLocation +func (*ReportReasonUnrelatedLocation) GetType() string { + return TypeReportReasonUnrelatedLocation } -func (*ChatReportReasonUnrelatedLocation) ChatReportReasonType() string { - return TypeChatReportReasonUnrelatedLocation +func (*ReportReasonUnrelatedLocation) ReportReasonType() string { + return TypeReportReasonUnrelatedLocation } // The chat represents a fake account -type ChatReportReasonFake struct { - meta +type ReportReasonFake struct{ + meta } -func (entity *ChatReportReasonFake) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() +func (entity *ReportReasonFake) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() - type stub ChatReportReasonFake + type stub ReportReasonFake - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } -func (*ChatReportReasonFake) GetClass() string { - return ClassChatReportReason +func (*ReportReasonFake) GetClass() string { + return ClassReportReason } -func (*ChatReportReasonFake) GetType() string { - return TypeChatReportReasonFake +func (*ReportReasonFake) GetType() string { + return TypeReportReasonFake } -func (*ChatReportReasonFake) ChatReportReasonType() string { - return TypeChatReportReasonFake +func (*ReportReasonFake) ReportReasonType() string { + return TypeReportReasonFake } // The chat has illegal drugs related content -type ChatReportReasonIllegalDrugs struct { - meta +type ReportReasonIllegalDrugs struct{ + meta } -func (entity *ChatReportReasonIllegalDrugs) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() +func (entity *ReportReasonIllegalDrugs) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() - type stub ChatReportReasonIllegalDrugs + type stub ReportReasonIllegalDrugs - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } -func (*ChatReportReasonIllegalDrugs) GetClass() string { - return ClassChatReportReason +func (*ReportReasonIllegalDrugs) GetClass() string { + return ClassReportReason } -func (*ChatReportReasonIllegalDrugs) GetType() string { - return TypeChatReportReasonIllegalDrugs +func (*ReportReasonIllegalDrugs) GetType() string { + return TypeReportReasonIllegalDrugs } -func (*ChatReportReasonIllegalDrugs) ChatReportReasonType() string { - return TypeChatReportReasonIllegalDrugs +func (*ReportReasonIllegalDrugs) ReportReasonType() string { + return TypeReportReasonIllegalDrugs } // The chat contains messages with personal details -type ChatReportReasonPersonalDetails struct { - meta +type ReportReasonPersonalDetails struct{ + meta } -func (entity *ChatReportReasonPersonalDetails) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() +func (entity *ReportReasonPersonalDetails) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() - type stub ChatReportReasonPersonalDetails + type stub ReportReasonPersonalDetails - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } -func (*ChatReportReasonPersonalDetails) GetClass() string { - return ClassChatReportReason +func (*ReportReasonPersonalDetails) GetClass() string { + return ClassReportReason } -func (*ChatReportReasonPersonalDetails) GetType() string { - return TypeChatReportReasonPersonalDetails +func (*ReportReasonPersonalDetails) GetType() string { + return TypeReportReasonPersonalDetails } -func (*ChatReportReasonPersonalDetails) ChatReportReasonType() string { - return TypeChatReportReasonPersonalDetails +func (*ReportReasonPersonalDetails) ReportReasonType() string { + return TypeReportReasonPersonalDetails } // A custom reason provided by the user -type ChatReportReasonCustom struct { - meta +type ReportReasonCustom struct{ + meta } -func (entity *ChatReportReasonCustom) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() +func (entity *ReportReasonCustom) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() - type stub ChatReportReasonCustom + type stub ReportReasonCustom - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } -func (*ChatReportReasonCustom) GetClass() string { - return ClassChatReportReason +func (*ReportReasonCustom) GetClass() string { + return ClassReportReason } -func (*ChatReportReasonCustom) GetType() string { - return TypeChatReportReasonCustom +func (*ReportReasonCustom) GetType() string { + return TypeReportReasonCustom } -func (*ChatReportReasonCustom) ChatReportReasonType() string { - return TypeChatReportReasonCustom +func (*ReportReasonCustom) ReportReasonType() string { + return TypeReportReasonCustom } // The currently opened chat needs to be kept -type TargetChatCurrent struct { - meta +type TargetChatCurrent struct{ + meta } func (entity *TargetChatCurrent) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub TargetChatCurrent + type stub TargetChatCurrent - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*TargetChatCurrent) GetClass() string { - return ClassTargetChat + return ClassTargetChat } func (*TargetChatCurrent) GetType() string { - return TypeTargetChatCurrent + return TypeTargetChatCurrent } func (*TargetChatCurrent) TargetChatType() string { - return TypeTargetChatCurrent + return TypeTargetChatCurrent } // The chat needs to be chosen by the user among chats of the specified types type TargetChatChosen struct { - meta - // True, if private chats with ordinary users are allowed - AllowUserChats bool `json:"allow_user_chats"` - // True, if private chats with other bots are allowed - AllowBotChats bool `json:"allow_bot_chats"` - // True, if basic group and supergroup chats are allowed - AllowGroupChats bool `json:"allow_group_chats"` - // True, if channel chats are allowed - AllowChannelChats bool `json:"allow_channel_chats"` + meta + // True, if private chats with ordinary users are allowed + AllowUserChats bool `json:"allow_user_chats"` + // True, if private chats with other bots are allowed + AllowBotChats bool `json:"allow_bot_chats"` + // True, if basic group and supergroup chats are allowed + AllowGroupChats bool `json:"allow_group_chats"` + // True, if channel chats are allowed + AllowChannelChats bool `json:"allow_channel_chats"` } func (entity *TargetChatChosen) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub TargetChatChosen + type stub TargetChatChosen - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*TargetChatChosen) GetClass() string { - return ClassTargetChat + return ClassTargetChat } func (*TargetChatChosen) GetType() string { - return TypeTargetChatChosen + return TypeTargetChatChosen } func (*TargetChatChosen) TargetChatType() string { - return TypeTargetChatChosen + return TypeTargetChatChosen } // The chat needs to be open with the provided internal link type TargetChatInternalLink struct { - meta - // An internal link pointing to the chat - Link InternalLinkType `json:"link"` + meta + // An internal link pointing to the chat + Link InternalLinkType `json:"link"` } func (entity *TargetChatInternalLink) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub TargetChatInternalLink + type stub TargetChatInternalLink - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*TargetChatInternalLink) GetClass() string { - return ClassTargetChat + return ClassTargetChat } func (*TargetChatInternalLink) GetType() string { - return TypeTargetChatInternalLink + return TypeTargetChatInternalLink } func (*TargetChatInternalLink) TargetChatType() string { - return TypeTargetChatInternalLink + return TypeTargetChatInternalLink } func (targetChatInternalLink *TargetChatInternalLink) UnmarshalJSON(data []byte) error { - var tmp struct { - Link json.RawMessage `json:"link"` - } + var tmp struct { + Link json.RawMessage `json:"link"` + } - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } - fieldLink, _ := UnmarshalInternalLinkType(tmp.Link) - targetChatInternalLink.Link = fieldLink + fieldLink, _ := UnmarshalInternalLinkType(tmp.Link) + targetChatInternalLink.Link = fieldLink - return nil + return nil } -// The link is a link to the active sessions section of the application. Use getActiveSessions to handle the link -type InternalLinkTypeActiveSessions struct { - meta +// The link is a link to the Devices section of the application. Use getActiveSessions to get the list of active sessions and show them to the user +type InternalLinkTypeActiveSessions struct{ + meta } func (entity *InternalLinkTypeActiveSessions) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub InternalLinkTypeActiveSessions + type stub InternalLinkTypeActiveSessions - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*InternalLinkTypeActiveSessions) GetClass() string { - return ClassInternalLinkType + return ClassInternalLinkType } func (*InternalLinkTypeActiveSessions) GetType() string { - return TypeInternalLinkTypeActiveSessions + return TypeInternalLinkTypeActiveSessions } func (*InternalLinkTypeActiveSessions) InternalLinkTypeType() string { - return TypeInternalLinkTypeActiveSessions + return TypeInternalLinkTypeActiveSessions } -// The link is a link to an attachment menu bot to be opened in the specified or a chosen chat. Process given target_chat to open the chat. Then call searchPublicChat with the given bot username, check that the user is a bot and can be added to attachment menu. Then use getAttachmentMenuBot to receive information about the bot. If the bot isn't added to attachment menu, then user needs to confirm adding the bot to attachment menu. If user confirms adding, then use toggleBotIsAddedToAttachmentMenu to add it. If the attachment menu bot can't be used in the opened chat, show an error to the user. If the bot is added to attachment menu and can be used in the chat, then use openWebApp with the given URL +// The link is a link to an attachment menu bot to be opened in the specified or a chosen chat. Process given target_chat to open the chat. Then, call searchPublicChat with the given bot username, check that the user is a bot and can be added to attachment menu. Then, use getAttachmentMenuBot to receive information about the bot. If the bot isn't added to attachment menu, then show a disclaimer about Mini Apps being a third-party apps, ask the user to accept their Terms of service and confirm adding the bot to side and attachment menu. If the user accept the terms and confirms adding, then use toggleBotIsAddedToAttachmentMenu to add the bot. If the attachment menu bot can't be used in the opened chat, show an error to the user. If the bot is added to attachment menu and can be used in the chat, then use openWebApp with the given URL type InternalLinkTypeAttachmentMenuBot struct { - meta - // Target chat to be opened - TargetChat TargetChat `json:"target_chat"` - // Username of the bot - BotUsername string `json:"bot_username"` - // URL to be passed to openWebApp - Url string `json:"url"` + meta + // Target chat to be opened + TargetChat TargetChat `json:"target_chat"` + // Username of the bot + BotUsername string `json:"bot_username"` + // URL to be passed to openWebApp + Url string `json:"url"` } func (entity *InternalLinkTypeAttachmentMenuBot) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub InternalLinkTypeAttachmentMenuBot + type stub InternalLinkTypeAttachmentMenuBot - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*InternalLinkTypeAttachmentMenuBot) GetClass() string { - return ClassInternalLinkType + return ClassInternalLinkType } func (*InternalLinkTypeAttachmentMenuBot) GetType() string { - return TypeInternalLinkTypeAttachmentMenuBot + return TypeInternalLinkTypeAttachmentMenuBot } func (*InternalLinkTypeAttachmentMenuBot) InternalLinkTypeType() string { - return TypeInternalLinkTypeAttachmentMenuBot + return TypeInternalLinkTypeAttachmentMenuBot } func (internalLinkTypeAttachmentMenuBot *InternalLinkTypeAttachmentMenuBot) UnmarshalJSON(data []byte) error { - var tmp struct { - TargetChat json.RawMessage `json:"target_chat"` - BotUsername string `json:"bot_username"` - Url string `json:"url"` - } + var tmp struct { + TargetChat json.RawMessage `json:"target_chat"` + BotUsername string `json:"bot_username"` + Url string `json:"url"` + } - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } - internalLinkTypeAttachmentMenuBot.BotUsername = tmp.BotUsername - internalLinkTypeAttachmentMenuBot.Url = tmp.Url + internalLinkTypeAttachmentMenuBot.BotUsername = tmp.BotUsername + internalLinkTypeAttachmentMenuBot.Url = tmp.Url - fieldTargetChat, _ := UnmarshalTargetChat(tmp.TargetChat) - internalLinkTypeAttachmentMenuBot.TargetChat = fieldTargetChat + fieldTargetChat, _ := UnmarshalTargetChat(tmp.TargetChat) + internalLinkTypeAttachmentMenuBot.TargetChat = fieldTargetChat - return nil + return nil } // The link contains an authentication code. Call checkAuthenticationCode with the code if the current authorization state is authorizationStateWaitCode type InternalLinkTypeAuthenticationCode struct { - meta - // The authentication code - Code string `json:"code"` + meta + // The authentication code + Code string `json:"code"` } func (entity *InternalLinkTypeAuthenticationCode) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub InternalLinkTypeAuthenticationCode + type stub InternalLinkTypeAuthenticationCode - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*InternalLinkTypeAuthenticationCode) GetClass() string { - return ClassInternalLinkType + return ClassInternalLinkType } func (*InternalLinkTypeAuthenticationCode) GetType() string { - return TypeInternalLinkTypeAuthenticationCode + return TypeInternalLinkTypeAuthenticationCode } func (*InternalLinkTypeAuthenticationCode) InternalLinkTypeType() string { - return TypeInternalLinkTypeAuthenticationCode + return TypeInternalLinkTypeAuthenticationCode } -// The link is a link to a background. Call searchBackground with the given background name to process the link +// The link is a link to a background. Call searchBackground with the given background name to process the link If background is found and the user wants to apply it, then call setDefaultBackground type InternalLinkTypeBackground struct { - meta - // Name of the background - BackgroundName string `json:"background_name"` + meta + // Name of the background + BackgroundName string `json:"background_name"` } func (entity *InternalLinkTypeBackground) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub InternalLinkTypeBackground + type stub InternalLinkTypeBackground - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*InternalLinkTypeBackground) GetClass() string { - return ClassInternalLinkType + return ClassInternalLinkType } func (*InternalLinkTypeBackground) GetType() string { - return TypeInternalLinkTypeBackground + return TypeInternalLinkTypeBackground } func (*InternalLinkTypeBackground) InternalLinkTypeType() string { - return TypeInternalLinkTypeBackground + return TypeInternalLinkTypeBackground +} + +// The link is a link to a Telegram bot, which is supposed to be added to a channel chat as an administrator. Call searchPublicChat with the given bot username and check that the user is a bot, ask the current user to select a channel chat to add the bot to as an administrator. Then, call getChatMember to receive the current bot rights in the chat and if the bot already is an administrator, check that the current user can edit its administrator rights and combine received rights with the requested administrator rights. Then, show confirmation box to the user, and call setChatMemberStatus with the chosen chat and confirmed rights +type InternalLinkTypeBotAddToChannel struct { + meta + // Username of the bot + BotUsername string `json:"bot_username"` + // Expected administrator rights for the bot + AdministratorRights *ChatAdministratorRights `json:"administrator_rights"` +} + +func (entity *InternalLinkTypeBotAddToChannel) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeBotAddToChannel + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeBotAddToChannel) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeBotAddToChannel) GetType() string { + return TypeInternalLinkTypeBotAddToChannel +} + +func (*InternalLinkTypeBotAddToChannel) InternalLinkTypeType() string { + return TypeInternalLinkTypeBotAddToChannel } // 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 { - meta - // Username of the bot - BotUsername string `json:"bot_username"` - // The parameter to be passed to sendBotStartMessage - StartParameter string `json:"start_parameter"` - // True, if sendBotStartMessage must be called automatically without showing the START button - Autostart bool `json:"autostart"` + meta + // Username of the bot + BotUsername string `json:"bot_username"` + // The parameter to be passed to sendBotStartMessage + StartParameter string `json:"start_parameter"` + // True, if sendBotStartMessage must be called automatically without showing the START button + Autostart bool `json:"autostart"` } func (entity *InternalLinkTypeBotStart) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub InternalLinkTypeBotStart + type stub InternalLinkTypeBotStart - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*InternalLinkTypeBotStart) GetClass() string { - return ClassInternalLinkType + return ClassInternalLinkType } func (*InternalLinkTypeBotStart) GetType() string { - return TypeInternalLinkTypeBotStart + return TypeInternalLinkTypeBotStart } func (*InternalLinkTypeBotStart) InternalLinkTypeType() string { - return TypeInternalLinkTypeBotStart + return TypeInternalLinkTypeBotStart } -// 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 basic group or a supergroup chat to add the bot to, taking into account that bots can be added to a public supergroup only by administrators of the supergroup. If administrator rights are provided by the link, call getChatMember to receive the current bot rights in the chat and if the bot already is an administrator, check that the current user can edit its administrator rights, combine received rights with the requested administrator rights, show confirmation box to the user, and call setChatMemberStatus with the chosen chat and confirmed administrator rights. Before call to setChatMemberStatus it may be required to upgrade the chosen basic group chat to a supergroup chat. Then if start_parameter isn't empty, call sendBotStartMessage with the given start parameter and the chosen chat, otherwise just send /start message with bot's username added to the chat. +// 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 basic group or a supergroup chat to add the bot to, taking into account that bots can be added to a public supergroup only by administrators of the supergroup. If administrator rights are provided by the link, call getChatMember to receive the current bot rights in the chat and if the bot already is an administrator, check that the current user can edit its administrator rights, combine received rights with the requested administrator rights, show confirmation box to the user, and call setChatMemberStatus with the chosen chat and confirmed administrator rights. Before call to setChatMemberStatus it may be required to upgrade the chosen basic group chat to a supergroup chat. Then, if start_parameter isn't empty, call sendBotStartMessage with the given start parameter and the chosen chat; otherwise, just send /start message with bot's username added to the chat. type InternalLinkTypeBotStartInGroup struct { - meta - // Username of the bot - BotUsername string `json:"bot_username"` - // The parameter to be passed to sendBotStartMessage - StartParameter string `json:"start_parameter"` - // Expected administrator rights for the bot; may be null - AdministratorRights *ChatAdministratorRights `json:"administrator_rights"` + meta + // Username of the bot + BotUsername string `json:"bot_username"` + // The parameter to be passed to sendBotStartMessage + StartParameter string `json:"start_parameter"` + // Expected administrator rights for the bot; may be null + AdministratorRights *ChatAdministratorRights `json:"administrator_rights"` } func (entity *InternalLinkTypeBotStartInGroup) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub InternalLinkTypeBotStartInGroup + type stub InternalLinkTypeBotStartInGroup - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*InternalLinkTypeBotStartInGroup) GetClass() string { - return ClassInternalLinkType + return ClassInternalLinkType } func (*InternalLinkTypeBotStartInGroup) GetType() string { - return TypeInternalLinkTypeBotStartInGroup + return TypeInternalLinkTypeBotStartInGroup } func (*InternalLinkTypeBotStartInGroup) InternalLinkTypeType() string { - return TypeInternalLinkTypeBotStartInGroup -} - -// The link is a link to a Telegram bot, which is supposed to be added to a channel chat as an administrator. Call searchPublicChat with the given bot username and check that the user is a bot, ask the current user to select a channel chat to add the bot to as an administrator. Then call getChatMember to receive the current bot rights in the chat and if the bot already is an administrator, check that the current user can edit its administrator rights and combine received rights with the requested administrator rights. Then show confirmation box to the user, and call setChatMemberStatus with the chosen chat and confirmed rights -type InternalLinkTypeBotAddToChannel struct { - meta - // Username of the bot - BotUsername string `json:"bot_username"` - // Expected administrator rights for the bot - AdministratorRights *ChatAdministratorRights `json:"administrator_rights"` -} - -func (entity *InternalLinkTypeBotAddToChannel) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InternalLinkTypeBotAddToChannel - - return json.Marshal((*stub)(entity)) -} - -func (*InternalLinkTypeBotAddToChannel) GetClass() string { - return ClassInternalLinkType -} - -func (*InternalLinkTypeBotAddToChannel) GetType() string { - return TypeInternalLinkTypeBotAddToChannel -} - -func (*InternalLinkTypeBotAddToChannel) InternalLinkTypeType() string { - return TypeInternalLinkTypeBotAddToChannel + return TypeInternalLinkTypeBotStartInGroup } // The link is a link to the change phone number section of the app -type InternalLinkTypeChangePhoneNumber struct { - meta +type InternalLinkTypeChangePhoneNumber struct{ + meta } func (entity *InternalLinkTypeChangePhoneNumber) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub InternalLinkTypeChangePhoneNumber + type stub InternalLinkTypeChangePhoneNumber - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*InternalLinkTypeChangePhoneNumber) GetClass() string { - return ClassInternalLinkType + return ClassInternalLinkType } func (*InternalLinkTypeChangePhoneNumber) GetType() string { - return TypeInternalLinkTypeChangePhoneNumber + return TypeInternalLinkTypeChangePhoneNumber } func (*InternalLinkTypeChangePhoneNumber) InternalLinkTypeType() string { - return TypeInternalLinkTypeChangePhoneNumber + return TypeInternalLinkTypeChangePhoneNumber } -// The link is a chat invite link. Call checkChatInviteLink with the given invite link to process the link +// The link is a link to boost a Telegram chat. Call getChatBoostLinkInfo with the given URL to process the link. If the chat is found, then call getChatBoostStatus and getAvailableChatBoostSlots to get the current boost status and check whether the chat can be boosted. If the user wants to boost the chat and the chat can be boosted, then call boostChat +type InternalLinkTypeChatBoost struct { + meta + // URL to be passed to getChatBoostLinkInfo + Url string `json:"url"` +} + +func (entity *InternalLinkTypeChatBoost) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeChatBoost + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeChatBoost) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeChatBoost) GetType() string { + return TypeInternalLinkTypeChatBoost +} + +func (*InternalLinkTypeChatBoost) InternalLinkTypeType() string { + return TypeInternalLinkTypeChatBoost +} + +// The link is an invite link to a chat folder. Call checkChatFolderInviteLink with the given invite link to process the link. If the link is valid and the user wants to join the chat folder, then call addChatFolderByInviteLink +type InternalLinkTypeChatFolderInvite struct { + meta + // Internal representation of the invite link + InviteLink string `json:"invite_link"` +} + +func (entity *InternalLinkTypeChatFolderInvite) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeChatFolderInvite + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeChatFolderInvite) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeChatFolderInvite) GetType() string { + return TypeInternalLinkTypeChatFolderInvite +} + +func (*InternalLinkTypeChatFolderInvite) InternalLinkTypeType() string { + return TypeInternalLinkTypeChatFolderInvite +} + +// The link is a link to the folder section of the app settings +type InternalLinkTypeChatFolderSettings struct{ + meta +} + +func (entity *InternalLinkTypeChatFolderSettings) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeChatFolderSettings + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeChatFolderSettings) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeChatFolderSettings) GetType() string { + return TypeInternalLinkTypeChatFolderSettings +} + +func (*InternalLinkTypeChatFolderSettings) InternalLinkTypeType() string { + return TypeInternalLinkTypeChatFolderSettings +} + +// The link is a chat invite link. Call checkChatInviteLink with the given invite link to process the link. If the link is valid and the user wants to join the chat, then call joinChatByInviteLink type InternalLinkTypeChatInvite struct { - meta - // Internal representation of the invite link - InviteLink string `json:"invite_link"` + meta + // Internal representation of the invite link + InviteLink string `json:"invite_link"` } func (entity *InternalLinkTypeChatInvite) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub InternalLinkTypeChatInvite + type stub InternalLinkTypeChatInvite - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*InternalLinkTypeChatInvite) GetClass() string { - return ClassInternalLinkType + return ClassInternalLinkType } func (*InternalLinkTypeChatInvite) GetType() string { - return TypeInternalLinkTypeChatInvite + return TypeInternalLinkTypeChatInvite } func (*InternalLinkTypeChatInvite) InternalLinkTypeType() string { - return TypeInternalLinkTypeChatInvite + return TypeInternalLinkTypeChatInvite } // The link is a link to the default message auto-delete timer settings section of the app settings -type InternalLinkTypeDefaultMessageAutoDeleteTimerSettings struct { - meta +type InternalLinkTypeDefaultMessageAutoDeleteTimerSettings struct{ + meta } func (entity *InternalLinkTypeDefaultMessageAutoDeleteTimerSettings) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub InternalLinkTypeDefaultMessageAutoDeleteTimerSettings + type stub InternalLinkTypeDefaultMessageAutoDeleteTimerSettings - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*InternalLinkTypeDefaultMessageAutoDeleteTimerSettings) GetClass() string { - return ClassInternalLinkType + return ClassInternalLinkType } func (*InternalLinkTypeDefaultMessageAutoDeleteTimerSettings) GetType() string { - return TypeInternalLinkTypeDefaultMessageAutoDeleteTimerSettings + return TypeInternalLinkTypeDefaultMessageAutoDeleteTimerSettings } func (*InternalLinkTypeDefaultMessageAutoDeleteTimerSettings) InternalLinkTypeType() string { - return TypeInternalLinkTypeDefaultMessageAutoDeleteTimerSettings + return TypeInternalLinkTypeDefaultMessageAutoDeleteTimerSettings } // The link is a link to the edit profile section of the app settings -type InternalLinkTypeEditProfileSettings struct { - meta +type InternalLinkTypeEditProfileSettings struct{ + meta } func (entity *InternalLinkTypeEditProfileSettings) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub InternalLinkTypeEditProfileSettings + type stub InternalLinkTypeEditProfileSettings - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*InternalLinkTypeEditProfileSettings) GetClass() string { - return ClassInternalLinkType + return ClassInternalLinkType } func (*InternalLinkTypeEditProfileSettings) GetType() string { - return TypeInternalLinkTypeEditProfileSettings + return TypeInternalLinkTypeEditProfileSettings } func (*InternalLinkTypeEditProfileSettings) InternalLinkTypeType() string { - return TypeInternalLinkTypeEditProfileSettings -} - -// The link is a link to the filter section of the app settings -type InternalLinkTypeFilterSettings struct { - meta -} - -func (entity *InternalLinkTypeFilterSettings) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InternalLinkTypeFilterSettings - - return json.Marshal((*stub)(entity)) -} - -func (*InternalLinkTypeFilterSettings) GetClass() string { - return ClassInternalLinkType -} - -func (*InternalLinkTypeFilterSettings) GetType() string { - return TypeInternalLinkTypeFilterSettings -} - -func (*InternalLinkTypeFilterSettings) InternalLinkTypeType() string { - return TypeInternalLinkTypeFilterSettings + return TypeInternalLinkTypeEditProfileSettings } // 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 { - 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"` + 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"` } func (entity *InternalLinkTypeGame) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub InternalLinkTypeGame + type stub InternalLinkTypeGame - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*InternalLinkTypeGame) GetClass() string { - return ClassInternalLinkType + return ClassInternalLinkType } func (*InternalLinkTypeGame) GetType() string { - return TypeInternalLinkTypeGame + return TypeInternalLinkTypeGame } func (*InternalLinkTypeGame) InternalLinkTypeType() string { - return TypeInternalLinkTypeGame + return TypeInternalLinkTypeGame } -// The link must be opened in an Instant View. Call getWebPageInstantView with the given URL to process the link +// The link must be opened in an Instant View. Call getWebPageInstantView with the given URL to process the link. If Instant View is found, then show it, otherwise, open the fallback URL in an external browser type InternalLinkTypeInstantView struct { - meta - // URL to be passed to getWebPageInstantView - Url string `json:"url"` - // An URL to open if getWebPageInstantView fails - FallbackUrl string `json:"fallback_url"` + meta + // URL to be passed to getWebPageInstantView + Url string `json:"url"` + // An URL to open if getWebPageInstantView fails + FallbackUrl string `json:"fallback_url"` } func (entity *InternalLinkTypeInstantView) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub InternalLinkTypeInstantView + type stub InternalLinkTypeInstantView - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*InternalLinkTypeInstantView) GetClass() string { - return ClassInternalLinkType + return ClassInternalLinkType } func (*InternalLinkTypeInstantView) GetType() string { - return TypeInternalLinkTypeInstantView + return TypeInternalLinkTypeInstantView } func (*InternalLinkTypeInstantView) InternalLinkTypeType() string { - return TypeInternalLinkTypeInstantView + return TypeInternalLinkTypeInstantView } // The link is a link to an invoice. Call getPaymentForm with the given invoice name to process the link type InternalLinkTypeInvoice struct { - meta - // Name of the invoice - InvoiceName string `json:"invoice_name"` + meta + // Name of the invoice + InvoiceName string `json:"invoice_name"` } func (entity *InternalLinkTypeInvoice) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub InternalLinkTypeInvoice + type stub InternalLinkTypeInvoice - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*InternalLinkTypeInvoice) GetClass() string { - return ClassInternalLinkType + return ClassInternalLinkType } func (*InternalLinkTypeInvoice) GetType() string { - return TypeInternalLinkTypeInvoice + return TypeInternalLinkTypeInvoice } func (*InternalLinkTypeInvoice) InternalLinkTypeType() string { - return TypeInternalLinkTypeInvoice + return TypeInternalLinkTypeInvoice } -// The link is a link to a language pack. Call getLanguagePackInfo with the given language pack identifier to process the link +// The link is a link to a language pack. Call getLanguagePackInfo with the given language pack identifier to process the link. If the language pack is found and the user wants to apply it, then call setOption for the option "language_pack_id" type InternalLinkTypeLanguagePack struct { - meta - // Language pack identifier - LanguagePackId string `json:"language_pack_id"` + meta + // Language pack identifier + LanguagePackId string `json:"language_pack_id"` } func (entity *InternalLinkTypeLanguagePack) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub InternalLinkTypeLanguagePack + type stub InternalLinkTypeLanguagePack - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*InternalLinkTypeLanguagePack) GetClass() string { - return ClassInternalLinkType + return ClassInternalLinkType } func (*InternalLinkTypeLanguagePack) GetType() string { - return TypeInternalLinkTypeLanguagePack + return TypeInternalLinkTypeLanguagePack } func (*InternalLinkTypeLanguagePack) InternalLinkTypeType() string { - return TypeInternalLinkTypeLanguagePack + return TypeInternalLinkTypeLanguagePack } // The link is a link to the language section of the app settings -type InternalLinkTypeLanguageSettings struct { - meta +type InternalLinkTypeLanguageSettings struct{ + meta } func (entity *InternalLinkTypeLanguageSettings) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub InternalLinkTypeLanguageSettings + type stub InternalLinkTypeLanguageSettings - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*InternalLinkTypeLanguageSettings) GetClass() string { - return ClassInternalLinkType + return ClassInternalLinkType } func (*InternalLinkTypeLanguageSettings) GetType() string { - return TypeInternalLinkTypeLanguageSettings + return TypeInternalLinkTypeLanguageSettings } func (*InternalLinkTypeLanguageSettings) InternalLinkTypeType() string { - return TypeInternalLinkTypeLanguageSettings + return TypeInternalLinkTypeLanguageSettings } -// The link is a link to a Telegram message or a forum topic. Call getMessageLinkInfo with the given URL to process the link +// The link is a link to a Telegram message or a forum topic. Call getMessageLinkInfo with the given URL to process the link, and then open received forum topic or chat and show the message there type InternalLinkTypeMessage struct { - meta - // URL to be passed to getMessageLinkInfo - Url string `json:"url"` + meta + // URL to be passed to getMessageLinkInfo + Url string `json:"url"` } func (entity *InternalLinkTypeMessage) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub InternalLinkTypeMessage + type stub InternalLinkTypeMessage - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*InternalLinkTypeMessage) GetClass() string { - return ClassInternalLinkType + return ClassInternalLinkType } func (*InternalLinkTypeMessage) GetType() string { - return TypeInternalLinkTypeMessage + return TypeInternalLinkTypeMessage } func (*InternalLinkTypeMessage) InternalLinkTypeType() string { - return TypeInternalLinkTypeMessage + return TypeInternalLinkTypeMessage } // 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 { - 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"` + 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"` } func (entity *InternalLinkTypeMessageDraft) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub InternalLinkTypeMessageDraft + type stub InternalLinkTypeMessageDraft - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*InternalLinkTypeMessageDraft) GetClass() string { - return ClassInternalLinkType + return ClassInternalLinkType } func (*InternalLinkTypeMessageDraft) GetType() string { - return TypeInternalLinkTypeMessageDraft + return TypeInternalLinkTypeMessageDraft } func (*InternalLinkTypeMessageDraft) InternalLinkTypeType() string { - return TypeInternalLinkTypeMessageDraft + return TypeInternalLinkTypeMessageDraft } -// 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 application, otherwise ignore it +// 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 application; otherwise, ignore it type InternalLinkTypePassportDataRequest struct { - 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"` + meta + // User identifier of the service's bot; the corresponding user may be unknown yet + 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, canceled, or failed with the parameters tg_passport=success, tg_passport=cancel, or tg_passport=error&error=... respectively. If empty, then onActivityResult method must be used to return response on Android, or the link tgbot{bot_user_id}://passport/success or tgbot{bot_user_id}://passport/cancel must be opened otherwise + CallbackUrl string `json:"callback_url"` } func (entity *InternalLinkTypePassportDataRequest) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub InternalLinkTypePassportDataRequest + type stub InternalLinkTypePassportDataRequest - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*InternalLinkTypePassportDataRequest) GetClass() string { - return ClassInternalLinkType + return ClassInternalLinkType } func (*InternalLinkTypePassportDataRequest) GetType() string { - return TypeInternalLinkTypePassportDataRequest + return TypeInternalLinkTypePassportDataRequest } func (*InternalLinkTypePassportDataRequest) InternalLinkTypeType() string { - return TypeInternalLinkTypePassportDataRequest + return TypeInternalLinkTypePassportDataRequest } -// 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 +// 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. If succeeded, call checkPhoneNumberConfirmationCode to check entered by the user code, or resendPhoneNumberConfirmationCode to resend it type InternalLinkTypePhoneNumberConfirmation struct { - meta - // Hash value from the link - Hash string `json:"hash"` - // Phone number value from the link - PhoneNumber string `json:"phone_number"` + meta + // Hash value from the link + Hash string `json:"hash"` + // Phone number value from the link + PhoneNumber string `json:"phone_number"` } func (entity *InternalLinkTypePhoneNumberConfirmation) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub InternalLinkTypePhoneNumberConfirmation + type stub InternalLinkTypePhoneNumberConfirmation - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*InternalLinkTypePhoneNumberConfirmation) GetClass() string { - return ClassInternalLinkType + return ClassInternalLinkType } func (*InternalLinkTypePhoneNumberConfirmation) GetType() string { - return TypeInternalLinkTypePhoneNumberConfirmation + return TypeInternalLinkTypePhoneNumberConfirmation } func (*InternalLinkTypePhoneNumberConfirmation) InternalLinkTypeType() string { - return TypeInternalLinkTypePhoneNumberConfirmation + return TypeInternalLinkTypePhoneNumberConfirmation } -// The link is a link to the Premium features screen of the applcation from which the user can subscribe to Telegram Premium. Call getPremiumFeatures with the given referrer to process the link +// The link is a link to the Premium features screen of the application from which the user can subscribe to Telegram Premium. Call getPremiumFeatures with the given referrer to process the link type InternalLinkTypePremiumFeatures struct { - meta - // Referrer specified in the link - Referrer string `json:"referrer"` + meta + // Referrer specified in the link + Referrer string `json:"referrer"` } func (entity *InternalLinkTypePremiumFeatures) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub InternalLinkTypePremiumFeatures + type stub InternalLinkTypePremiumFeatures - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*InternalLinkTypePremiumFeatures) GetClass() string { - return ClassInternalLinkType + return ClassInternalLinkType } func (*InternalLinkTypePremiumFeatures) GetType() string { - return TypeInternalLinkTypePremiumFeatures + return TypeInternalLinkTypePremiumFeatures } func (*InternalLinkTypePremiumFeatures) InternalLinkTypeType() string { - return TypeInternalLinkTypePremiumFeatures + return TypeInternalLinkTypePremiumFeatures +} + +// The link is a link to the screen for gifting Telegram Premium subscriptions to friends via inputInvoiceTelegram payments or in-store purchases +type InternalLinkTypePremiumGift struct { + meta + // Referrer specified in the link + Referrer string `json:"referrer"` +} + +func (entity *InternalLinkTypePremiumGift) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypePremiumGift + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypePremiumGift) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypePremiumGift) GetType() string { + return TypeInternalLinkTypePremiumGift +} + +func (*InternalLinkTypePremiumGift) InternalLinkTypeType() string { + return TypeInternalLinkTypePremiumGift +} + +// The link is a link with a Telegram Premium gift code. Call checkPremiumGiftCode with the given code to process the link. If the code is valid and the user wants to apply it, then call applyPremiumGiftCode +type InternalLinkTypePremiumGiftCode struct { + meta + // The Telegram Premium gift code + Code string `json:"code"` +} + +func (entity *InternalLinkTypePremiumGiftCode) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypePremiumGiftCode + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypePremiumGiftCode) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypePremiumGiftCode) GetType() string { + return TypeInternalLinkTypePremiumGiftCode +} + +func (*InternalLinkTypePremiumGiftCode) InternalLinkTypeType() string { + return TypeInternalLinkTypePremiumGiftCode } // The link is a link to the privacy and security section of the app settings -type InternalLinkTypePrivacyAndSecuritySettings struct { - meta +type InternalLinkTypePrivacyAndSecuritySettings struct{ + meta } func (entity *InternalLinkTypePrivacyAndSecuritySettings) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub InternalLinkTypePrivacyAndSecuritySettings + type stub InternalLinkTypePrivacyAndSecuritySettings - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*InternalLinkTypePrivacyAndSecuritySettings) GetClass() string { - return ClassInternalLinkType + return ClassInternalLinkType } func (*InternalLinkTypePrivacyAndSecuritySettings) GetType() string { - return TypeInternalLinkTypePrivacyAndSecuritySettings + return TypeInternalLinkTypePrivacyAndSecuritySettings } func (*InternalLinkTypePrivacyAndSecuritySettings) InternalLinkTypeType() string { - return TypeInternalLinkTypePrivacyAndSecuritySettings + return TypeInternalLinkTypePrivacyAndSecuritySettings } // 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 { - meta - // Proxy server IP address - Server string `json:"server"` - // Proxy server port - Port int32 `json:"port"` - // Type of the proxy - Type ProxyType `json:"type"` + meta + // Proxy server domain or IP address + Server string `json:"server"` + // Proxy server port + Port int32 `json:"port"` + // Type of the proxy + Type ProxyType `json:"type"` } func (entity *InternalLinkTypeProxy) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub InternalLinkTypeProxy + type stub InternalLinkTypeProxy - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*InternalLinkTypeProxy) GetClass() string { - return ClassInternalLinkType + return ClassInternalLinkType } func (*InternalLinkTypeProxy) GetType() string { - return TypeInternalLinkTypeProxy + return TypeInternalLinkTypeProxy } func (*InternalLinkTypeProxy) InternalLinkTypeType() string { - return TypeInternalLinkTypeProxy + return TypeInternalLinkTypeProxy } func (internalLinkTypeProxy *InternalLinkTypeProxy) UnmarshalJSON(data []byte) error { - var tmp struct { - Server string `json:"server"` - Port int32 `json:"port"` - Type json.RawMessage `json:"type"` - } + var tmp struct { + Server string `json:"server"` + Port int32 `json:"port"` + Type json.RawMessage `json:"type"` + } - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } - internalLinkTypeProxy.Server = tmp.Server - internalLinkTypeProxy.Port = tmp.Port + internalLinkTypeProxy.Server = tmp.Server + internalLinkTypeProxy.Port = tmp.Port - fieldType, _ := UnmarshalProxyType(tmp.Type) - internalLinkTypeProxy.Type = fieldType + fieldType, _ := UnmarshalProxyType(tmp.Type) + internalLinkTypeProxy.Type = fieldType - return nil + return nil } -// The link is a link to a chat by its username. Call searchPublicChat with the given chat username to process the link +// The link is a link to a chat by its username. Call searchPublicChat with the given chat username to process the link If the chat is found, open its profile information screen or the chat itself type InternalLinkTypePublicChat struct { - meta - // Username of the chat - ChatUsername string `json:"chat_username"` + meta + // Username of the chat + ChatUsername string `json:"chat_username"` } func (entity *InternalLinkTypePublicChat) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub InternalLinkTypePublicChat + type stub InternalLinkTypePublicChat - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*InternalLinkTypePublicChat) GetClass() string { - return ClassInternalLinkType + return ClassInternalLinkType } func (*InternalLinkTypePublicChat) GetType() string { - return TypeInternalLinkTypePublicChat + return TypeInternalLinkTypePublicChat } func (*InternalLinkTypePublicChat) InternalLinkTypeType() string { - return TypeInternalLinkTypePublicChat + return TypeInternalLinkTypePublicChat } // 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 -type InternalLinkTypeQrCodeAuthentication struct { - meta +type InternalLinkTypeQrCodeAuthentication struct{ + meta } func (entity *InternalLinkTypeQrCodeAuthentication) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub InternalLinkTypeQrCodeAuthentication + type stub InternalLinkTypeQrCodeAuthentication - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*InternalLinkTypeQrCodeAuthentication) GetClass() string { - return ClassInternalLinkType + return ClassInternalLinkType } func (*InternalLinkTypeQrCodeAuthentication) GetType() string { - return TypeInternalLinkTypeQrCodeAuthentication + return TypeInternalLinkTypeQrCodeAuthentication } func (*InternalLinkTypeQrCodeAuthentication) InternalLinkTypeType() string { - return TypeInternalLinkTypeQrCodeAuthentication + return TypeInternalLinkTypeQrCodeAuthentication } // The link forces restore of App Store purchases when opened. For official iOS application only -type InternalLinkTypeRestorePurchases struct { - meta +type InternalLinkTypeRestorePurchases struct{ + meta } func (entity *InternalLinkTypeRestorePurchases) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub InternalLinkTypeRestorePurchases + type stub InternalLinkTypeRestorePurchases - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*InternalLinkTypeRestorePurchases) GetClass() string { - return ClassInternalLinkType + return ClassInternalLinkType } func (*InternalLinkTypeRestorePurchases) GetType() string { - return TypeInternalLinkTypeRestorePurchases + return TypeInternalLinkTypeRestorePurchases } func (*InternalLinkTypeRestorePurchases) InternalLinkTypeType() string { - return TypeInternalLinkTypeRestorePurchases + return TypeInternalLinkTypeRestorePurchases } // The link is a link to application settings -type InternalLinkTypeSettings struct { - meta +type InternalLinkTypeSettings struct{ + meta } func (entity *InternalLinkTypeSettings) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub InternalLinkTypeSettings + type stub InternalLinkTypeSettings - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*InternalLinkTypeSettings) GetClass() string { - return ClassInternalLinkType + return ClassInternalLinkType } func (*InternalLinkTypeSettings) GetType() string { - return TypeInternalLinkTypeSettings + return TypeInternalLinkTypeSettings } func (*InternalLinkTypeSettings) InternalLinkTypeType() string { - return TypeInternalLinkTypeSettings + return TypeInternalLinkTypeSettings } -// 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 +// The link is a link to a bot, which can be installed to the side menu. Call searchPublicChat with the given bot username, check that the user is a bot and can be added to attachment menu. Then, use getAttachmentMenuBot to receive information about the bot. If the bot isn't added to side menu, then show a disclaimer about Mini Apps being a third-party apps, ask the user to accept their Terms of service and confirm adding the bot to side and attachment menu. If the user accept the terms and confirms adding, then use toggleBotIsAddedToAttachmentMenu to add the bot. If the bot is added to side menu, then use getWebAppUrl with the given URL and open the returned URL as a Web App +type InternalLinkTypeSideMenuBot struct { + meta + // Username of the bot + BotUsername string `json:"bot_username"` + // URL to be passed to getWebAppUrl + Url string `json:"url"` +} + +func (entity *InternalLinkTypeSideMenuBot) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeSideMenuBot + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeSideMenuBot) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeSideMenuBot) GetType() string { + return TypeInternalLinkTypeSideMenuBot +} + +func (*InternalLinkTypeSideMenuBot) InternalLinkTypeType() string { + return TypeInternalLinkTypeSideMenuBot +} + +// 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. If the sticker set is found and the user wants to add it, then call changeStickerSet type InternalLinkTypeStickerSet struct { - meta - // Name of the sticker set - StickerSetName string `json:"sticker_set_name"` - // True, if the sticker set is expected to contain custom emoji - ExpectCustomEmoji bool `json:"expect_custom_emoji"` + meta + // Name of the sticker set + StickerSetName string `json:"sticker_set_name"` + // True, if the sticker set is expected to contain custom emoji + ExpectCustomEmoji bool `json:"expect_custom_emoji"` } func (entity *InternalLinkTypeStickerSet) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub InternalLinkTypeStickerSet + type stub InternalLinkTypeStickerSet - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*InternalLinkTypeStickerSet) GetClass() string { - return ClassInternalLinkType + return ClassInternalLinkType } func (*InternalLinkTypeStickerSet) GetType() string { - return TypeInternalLinkTypeStickerSet + return TypeInternalLinkTypeStickerSet } func (*InternalLinkTypeStickerSet) InternalLinkTypeType() string { - return TypeInternalLinkTypeStickerSet + return TypeInternalLinkTypeStickerSet +} + +// The link is a link to a story. Call searchPublicChat with the given sender username, then call getStory with the received chat identifier and the given story identifier, then show the story if received +type InternalLinkTypeStory struct { + meta + // Username of the sender of the story + StorySenderUsername string `json:"story_sender_username"` + // Story identifier + StoryId int32 `json:"story_id"` +} + +func (entity *InternalLinkTypeStory) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeStory + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeStory) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeStory) GetType() string { + return TypeInternalLinkTypeStory +} + +func (*InternalLinkTypeStory) InternalLinkTypeType() string { + return TypeInternalLinkTypeStory } // The link is a link to a theme. TDLib has no theme support yet type InternalLinkTypeTheme struct { - meta - // Name of the theme - ThemeName string `json:"theme_name"` + meta + // Name of the theme + ThemeName string `json:"theme_name"` } func (entity *InternalLinkTypeTheme) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub InternalLinkTypeTheme + type stub InternalLinkTypeTheme - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*InternalLinkTypeTheme) GetClass() string { - return ClassInternalLinkType + return ClassInternalLinkType } func (*InternalLinkTypeTheme) GetType() string { - return TypeInternalLinkTypeTheme + return TypeInternalLinkTypeTheme } func (*InternalLinkTypeTheme) InternalLinkTypeType() string { - return TypeInternalLinkTypeTheme + return TypeInternalLinkTypeTheme } // The link is a link to the theme section of the app settings -type InternalLinkTypeThemeSettings struct { - meta +type InternalLinkTypeThemeSettings struct{ + meta } func (entity *InternalLinkTypeThemeSettings) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub InternalLinkTypeThemeSettings + type stub InternalLinkTypeThemeSettings - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*InternalLinkTypeThemeSettings) GetClass() string { - return ClassInternalLinkType + return ClassInternalLinkType } func (*InternalLinkTypeThemeSettings) GetType() string { - return TypeInternalLinkTypeThemeSettings + return TypeInternalLinkTypeThemeSettings } func (*InternalLinkTypeThemeSettings) InternalLinkTypeType() string { - return TypeInternalLinkTypeThemeSettings + return TypeInternalLinkTypeThemeSettings } // The link is an unknown tg: link. Call getDeepLinkInfo to process the link type InternalLinkTypeUnknownDeepLink struct { - meta - // Link to be passed to getDeepLinkInfo - Link string `json:"link"` + meta + // Link to be passed to getDeepLinkInfo + Link string `json:"link"` } func (entity *InternalLinkTypeUnknownDeepLink) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub InternalLinkTypeUnknownDeepLink + type stub InternalLinkTypeUnknownDeepLink - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*InternalLinkTypeUnknownDeepLink) GetClass() string { - return ClassInternalLinkType + return ClassInternalLinkType } func (*InternalLinkTypeUnknownDeepLink) GetType() string { - return TypeInternalLinkTypeUnknownDeepLink + return TypeInternalLinkTypeUnknownDeepLink } func (*InternalLinkTypeUnknownDeepLink) InternalLinkTypeType() string { - return TypeInternalLinkTypeUnknownDeepLink + return TypeInternalLinkTypeUnknownDeepLink } // The link is a link to an unsupported proxy. An alert can be shown to the user -type InternalLinkTypeUnsupportedProxy struct { - meta +type InternalLinkTypeUnsupportedProxy struct{ + meta } func (entity *InternalLinkTypeUnsupportedProxy) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub InternalLinkTypeUnsupportedProxy + type stub InternalLinkTypeUnsupportedProxy - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*InternalLinkTypeUnsupportedProxy) GetClass() string { - return ClassInternalLinkType + return ClassInternalLinkType } func (*InternalLinkTypeUnsupportedProxy) GetType() string { - return TypeInternalLinkTypeUnsupportedProxy + return TypeInternalLinkTypeUnsupportedProxy } func (*InternalLinkTypeUnsupportedProxy) InternalLinkTypeType() string { - return TypeInternalLinkTypeUnsupportedProxy + 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 +// The link is a link to a user by its phone number. Call searchUserByPhoneNumber with the given phone number to process the link. If the user is found, then call createPrivateChat and open the chat type InternalLinkTypeUserPhoneNumber struct { - meta - // Phone number of the user - PhoneNumber string `json:"phone_number"` + meta + // Phone number of the user + PhoneNumber string `json:"phone_number"` } func (entity *InternalLinkTypeUserPhoneNumber) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub InternalLinkTypeUserPhoneNumber + type stub InternalLinkTypeUserPhoneNumber - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*InternalLinkTypeUserPhoneNumber) GetClass() string { - return ClassInternalLinkType + return ClassInternalLinkType } func (*InternalLinkTypeUserPhoneNumber) GetType() string { - return TypeInternalLinkTypeUserPhoneNumber + return TypeInternalLinkTypeUserPhoneNumber } func (*InternalLinkTypeUserPhoneNumber) InternalLinkTypeType() string { - return TypeInternalLinkTypeUserPhoneNumber + return TypeInternalLinkTypeUserPhoneNumber } -// The link is a link to a user by a temporary token. Call searchUserByToken with the given token to process the link +// The link is a link to a user by a temporary token. Call searchUserByToken with the given token to process the link. If the user is found, then call createPrivateChat and open the chat type InternalLinkTypeUserToken struct { - meta - // The token - Token string `json:"token"` + meta + // The token + Token string `json:"token"` } func (entity *InternalLinkTypeUserToken) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub InternalLinkTypeUserToken + type stub InternalLinkTypeUserToken - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*InternalLinkTypeUserToken) GetClass() string { - return ClassInternalLinkType + return ClassInternalLinkType } func (*InternalLinkTypeUserToken) GetType() string { - return TypeInternalLinkTypeUserToken + return TypeInternalLinkTypeUserToken } func (*InternalLinkTypeUserToken) InternalLinkTypeType() string { - return TypeInternalLinkTypeUserToken + return TypeInternalLinkTypeUserToken } // 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 type InternalLinkTypeVideoChat struct { - 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"` + 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"` } func (entity *InternalLinkTypeVideoChat) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub InternalLinkTypeVideoChat + type stub InternalLinkTypeVideoChat - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*InternalLinkTypeVideoChat) GetClass() string { - return ClassInternalLinkType + return ClassInternalLinkType } func (*InternalLinkTypeVideoChat) GetType() string { - return TypeInternalLinkTypeVideoChat + return TypeInternalLinkTypeVideoChat } func (*InternalLinkTypeVideoChat) InternalLinkTypeType() string { - return TypeInternalLinkTypeVideoChat + return TypeInternalLinkTypeVideoChat +} + +// The link is a link to a Web App. Call searchPublicChat with the given bot username, check that the user is a bot, then call searchWebApp with the received bot and the given web_app_short_name. Process received foundWebApp by showing a confirmation dialog if needed. If the bot can be added to attachment or side menu, but isn't added yet, then show a disclaimer about Mini Apps being a third-party apps instead of the dialog and ask the user to accept their Terms of service. If the user accept the terms and confirms adding, then use toggleBotIsAddedToAttachmentMenu to add the bot. Then, call getWebAppLinkUrl and open the returned URL as a Web App +type InternalLinkTypeWebApp struct { + meta + // Username of the bot that owns the Web App + BotUsername string `json:"bot_username"` + // Short name of the Web App + WebAppShortName string `json:"web_app_short_name"` + // Start parameter to be passed to getWebAppLinkUrl + StartParameter string `json:"start_parameter"` +} + +func (entity *InternalLinkTypeWebApp) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeWebApp + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeWebApp) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeWebApp) GetType() string { + return TypeInternalLinkTypeWebApp +} + +func (*InternalLinkTypeWebApp) InternalLinkTypeType() string { + return TypeInternalLinkTypeWebApp } // Contains an HTTPS link to a message in a supergroup or channel, or a forum topic type MessageLink struct { - meta - // The link - Link string `json:"link"` - // True, if the link will work for non-members of the chat - IsPublic bool `json:"is_public"` + meta + // The link + Link string `json:"link"` + // True, if the link will work for non-members of the chat + IsPublic bool `json:"is_public"` } func (entity *MessageLink) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub MessageLink + type stub MessageLink - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*MessageLink) GetClass() string { - return ClassMessageLink + return ClassMessageLink } func (*MessageLink) GetType() string { - return TypeMessageLink + return TypeMessageLink } // Contains information about a link to a message or a forum topic in a chat type MessageLinkInfo struct { - meta - // True, if the link is a public link for a message or a forum topic in a chat - IsPublic bool `json:"is_public"` - // If found, identifier of the chat to which the link points, 0 otherwise - ChatId int64 `json:"chat_id"` - // If found, identifier of the message thread in which to open the message, or a forum topic to open if the message is missing - MessageThreadId int64 `json:"message_thread_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"` + meta + // True, if the link is a public link for a message or a forum topic in a chat + IsPublic bool `json:"is_public"` + // If found, identifier of the chat to which the link points, 0 otherwise + ChatId int64 `json:"chat_id"` + // If found, identifier of the message thread in which to open the message, or a forum topic to open if the message is missing + MessageThreadId int64 `json:"message_thread_id"` + // If found, the linked message; may be null + Message *Message `json:"message"` + // Timestamp from which the video/audio/video note/voice note/story 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"` } func (entity *MessageLinkInfo) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub MessageLinkInfo + type stub MessageLinkInfo - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*MessageLinkInfo) GetClass() string { - return ClassMessageLinkInfo + return ClassMessageLinkInfo } func (*MessageLinkInfo) GetType() string { - return TypeMessageLinkInfo + return TypeMessageLinkInfo +} + +// Contains an HTTPS link to boost a chat +type ChatBoostLink struct { + meta + // The link + Link string `json:"link"` + // True, if the link will work for non-members of the chat + IsPublic bool `json:"is_public"` +} + +func (entity *ChatBoostLink) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatBoostLink + + return json.Marshal((*stub)(entity)) +} + +func (*ChatBoostLink) GetClass() string { + return ClassChatBoostLink +} + +func (*ChatBoostLink) GetType() string { + return TypeChatBoostLink +} + +// Contains information about a link to boost a chat +type ChatBoostLinkInfo struct { + meta + // True, if the link will work for non-members of the chat + IsPublic bool `json:"is_public"` + // Identifier of the chat to which the link points; 0 if the chat isn't found + ChatId int64 `json:"chat_id"` +} + +func (entity *ChatBoostLinkInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatBoostLinkInfo + + return json.Marshal((*stub)(entity)) +} + +func (*ChatBoostLinkInfo) GetClass() string { + return ClassChatBoostLinkInfo +} + +func (*ChatBoostLinkInfo) GetType() string { + return TypeChatBoostLinkInfo +} + +// The main block list that disallows writing messages to the current user, receiving their status and photo, viewing of stories, and some other actions +type BlockListMain struct{ + meta +} + +func (entity *BlockListMain) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BlockListMain + + return json.Marshal((*stub)(entity)) +} + +func (*BlockListMain) GetClass() string { + return ClassBlockList +} + +func (*BlockListMain) GetType() string { + return TypeBlockListMain +} + +func (*BlockListMain) BlockListType() string { + return TypeBlockListMain +} + +// The block list that disallows viewing of stories of the current user +type BlockListStories struct{ + meta +} + +func (entity *BlockListStories) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BlockListStories + + return json.Marshal((*stub)(entity)) +} + +func (*BlockListStories) GetClass() string { + return ClassBlockList +} + +func (*BlockListStories) GetType() string { + return TypeBlockListStories +} + +func (*BlockListStories) BlockListType() string { + return TypeBlockListStories } // Contains a part of a file type FilePart struct { - meta - // File bytes - Data []byte `json:"data"` + meta + // File bytes + Data []byte `json:"data"` } func (entity *FilePart) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub FilePart + type stub FilePart - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*FilePart) GetClass() string { - return ClassFilePart + return ClassFilePart } func (*FilePart) GetType() string { - return TypeFilePart + return TypeFilePart } // The data is not a file -type FileTypeNone struct { - meta +type FileTypeNone struct{ + meta } func (entity *FileTypeNone) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub FileTypeNone + type stub FileTypeNone - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*FileTypeNone) GetClass() string { - return ClassFileType + return ClassFileType } func (*FileTypeNone) GetType() string { - return TypeFileTypeNone + return TypeFileTypeNone } func (*FileTypeNone) FileTypeType() string { - return TypeFileTypeNone + return TypeFileTypeNone } // The file is an animation -type FileTypeAnimation struct { - meta +type FileTypeAnimation struct{ + meta } func (entity *FileTypeAnimation) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub FileTypeAnimation + type stub FileTypeAnimation - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*FileTypeAnimation) GetClass() string { - return ClassFileType + return ClassFileType } func (*FileTypeAnimation) GetType() string { - return TypeFileTypeAnimation + return TypeFileTypeAnimation } func (*FileTypeAnimation) FileTypeType() string { - return TypeFileTypeAnimation + return TypeFileTypeAnimation } // The file is an audio file -type FileTypeAudio struct { - meta +type FileTypeAudio struct{ + meta } func (entity *FileTypeAudio) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub FileTypeAudio + type stub FileTypeAudio - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*FileTypeAudio) GetClass() string { - return ClassFileType + return ClassFileType } func (*FileTypeAudio) GetType() string { - return TypeFileTypeAudio + return TypeFileTypeAudio } func (*FileTypeAudio) FileTypeType() string { - return TypeFileTypeAudio + return TypeFileTypeAudio } // The file is a document -type FileTypeDocument struct { - meta +type FileTypeDocument struct{ + meta } func (entity *FileTypeDocument) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub FileTypeDocument + type stub FileTypeDocument - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*FileTypeDocument) GetClass() string { - return ClassFileType + return ClassFileType } func (*FileTypeDocument) GetType() string { - return TypeFileTypeDocument + return TypeFileTypeDocument } func (*FileTypeDocument) FileTypeType() string { - return TypeFileTypeDocument + return TypeFileTypeDocument } // The file is a notification sound -type FileTypeNotificationSound struct { - meta +type FileTypeNotificationSound struct{ + meta } func (entity *FileTypeNotificationSound) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub FileTypeNotificationSound + type stub FileTypeNotificationSound - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*FileTypeNotificationSound) GetClass() string { - return ClassFileType + return ClassFileType } func (*FileTypeNotificationSound) GetType() string { - return TypeFileTypeNotificationSound + return TypeFileTypeNotificationSound } func (*FileTypeNotificationSound) FileTypeType() string { - return TypeFileTypeNotificationSound + return TypeFileTypeNotificationSound } // The file is a photo -type FileTypePhoto struct { - meta +type FileTypePhoto struct{ + meta } func (entity *FileTypePhoto) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub FileTypePhoto + type stub FileTypePhoto - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*FileTypePhoto) GetClass() string { - return ClassFileType + return ClassFileType } func (*FileTypePhoto) GetType() string { - return TypeFileTypePhoto + return TypeFileTypePhoto } func (*FileTypePhoto) FileTypeType() string { - return TypeFileTypePhoto + return TypeFileTypePhoto +} + +// The file is a photo published as a story +type FileTypePhotoStory struct{ + meta +} + +func (entity *FileTypePhotoStory) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub FileTypePhotoStory + + return json.Marshal((*stub)(entity)) +} + +func (*FileTypePhotoStory) GetClass() string { + return ClassFileType +} + +func (*FileTypePhotoStory) GetType() string { + return TypeFileTypePhotoStory +} + +func (*FileTypePhotoStory) FileTypeType() string { + return TypeFileTypePhotoStory } // The file is a profile photo -type FileTypeProfilePhoto struct { - meta +type FileTypeProfilePhoto struct{ + meta } func (entity *FileTypeProfilePhoto) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub FileTypeProfilePhoto + type stub FileTypeProfilePhoto - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*FileTypeProfilePhoto) GetClass() string { - return ClassFileType + return ClassFileType } func (*FileTypeProfilePhoto) GetType() string { - return TypeFileTypeProfilePhoto + return TypeFileTypeProfilePhoto } func (*FileTypeProfilePhoto) FileTypeType() string { - return TypeFileTypeProfilePhoto + return TypeFileTypeProfilePhoto } // The file was sent to a secret chat (the file type is not known to the server) -type FileTypeSecret struct { - meta +type FileTypeSecret struct{ + meta } func (entity *FileTypeSecret) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub FileTypeSecret + type stub FileTypeSecret - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*FileTypeSecret) GetClass() string { - return ClassFileType + return ClassFileType } func (*FileTypeSecret) GetType() string { - return TypeFileTypeSecret + return TypeFileTypeSecret } func (*FileTypeSecret) FileTypeType() string { - return TypeFileTypeSecret + return TypeFileTypeSecret } // The file is a thumbnail of a file from a secret chat -type FileTypeSecretThumbnail struct { - meta +type FileTypeSecretThumbnail struct{ + meta } func (entity *FileTypeSecretThumbnail) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub FileTypeSecretThumbnail + type stub FileTypeSecretThumbnail - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*FileTypeSecretThumbnail) GetClass() string { - return ClassFileType + return ClassFileType } func (*FileTypeSecretThumbnail) GetType() string { - return TypeFileTypeSecretThumbnail + return TypeFileTypeSecretThumbnail } func (*FileTypeSecretThumbnail) FileTypeType() string { - return TypeFileTypeSecretThumbnail + return TypeFileTypeSecretThumbnail } // The file is a file from Secure storage used for storing Telegram Passport files -type FileTypeSecure struct { - meta +type FileTypeSecure struct{ + meta } func (entity *FileTypeSecure) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub FileTypeSecure + type stub FileTypeSecure - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*FileTypeSecure) GetClass() string { - return ClassFileType + return ClassFileType } func (*FileTypeSecure) GetType() string { - return TypeFileTypeSecure + return TypeFileTypeSecure } func (*FileTypeSecure) FileTypeType() string { - return TypeFileTypeSecure + return TypeFileTypeSecure } // The file is a sticker -type FileTypeSticker struct { - meta +type FileTypeSticker struct{ + meta } func (entity *FileTypeSticker) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub FileTypeSticker + type stub FileTypeSticker - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*FileTypeSticker) GetClass() string { - return ClassFileType + return ClassFileType } func (*FileTypeSticker) GetType() string { - return TypeFileTypeSticker + return TypeFileTypeSticker } func (*FileTypeSticker) FileTypeType() string { - return TypeFileTypeSticker + return TypeFileTypeSticker } // The file is a thumbnail of another file -type FileTypeThumbnail struct { - meta +type FileTypeThumbnail struct{ + meta } func (entity *FileTypeThumbnail) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub FileTypeThumbnail + type stub FileTypeThumbnail - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*FileTypeThumbnail) GetClass() string { - return ClassFileType + return ClassFileType } func (*FileTypeThumbnail) GetType() string { - return TypeFileTypeThumbnail + return TypeFileTypeThumbnail } func (*FileTypeThumbnail) FileTypeType() string { - return TypeFileTypeThumbnail + return TypeFileTypeThumbnail } // The file type is not yet known -type FileTypeUnknown struct { - meta +type FileTypeUnknown struct{ + meta } func (entity *FileTypeUnknown) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub FileTypeUnknown + type stub FileTypeUnknown - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*FileTypeUnknown) GetClass() string { - return ClassFileType + return ClassFileType } func (*FileTypeUnknown) GetType() string { - return TypeFileTypeUnknown + return TypeFileTypeUnknown } func (*FileTypeUnknown) FileTypeType() string { - return TypeFileTypeUnknown + return TypeFileTypeUnknown } // The file is a video -type FileTypeVideo struct { - meta +type FileTypeVideo struct{ + meta } func (entity *FileTypeVideo) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub FileTypeVideo + type stub FileTypeVideo - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*FileTypeVideo) GetClass() string { - return ClassFileType + return ClassFileType } func (*FileTypeVideo) GetType() string { - return TypeFileTypeVideo + return TypeFileTypeVideo } func (*FileTypeVideo) FileTypeType() string { - return TypeFileTypeVideo + return TypeFileTypeVideo } // The file is a video note -type FileTypeVideoNote struct { - meta +type FileTypeVideoNote struct{ + meta } func (entity *FileTypeVideoNote) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub FileTypeVideoNote + type stub FileTypeVideoNote - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*FileTypeVideoNote) GetClass() string { - return ClassFileType + return ClassFileType } func (*FileTypeVideoNote) GetType() string { - return TypeFileTypeVideoNote + return TypeFileTypeVideoNote } func (*FileTypeVideoNote) FileTypeType() string { - return TypeFileTypeVideoNote + return TypeFileTypeVideoNote +} + +// The file is a video published as a story +type FileTypeVideoStory struct{ + meta +} + +func (entity *FileTypeVideoStory) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub FileTypeVideoStory + + return json.Marshal((*stub)(entity)) +} + +func (*FileTypeVideoStory) GetClass() string { + return ClassFileType +} + +func (*FileTypeVideoStory) GetType() string { + return TypeFileTypeVideoStory +} + +func (*FileTypeVideoStory) FileTypeType() string { + return TypeFileTypeVideoStory } // The file is a voice note -type FileTypeVoiceNote struct { - meta +type FileTypeVoiceNote struct{ + meta } func (entity *FileTypeVoiceNote) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub FileTypeVoiceNote + type stub FileTypeVoiceNote - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*FileTypeVoiceNote) GetClass() string { - return ClassFileType + return ClassFileType } func (*FileTypeVoiceNote) GetType() string { - return TypeFileTypeVoiceNote + return TypeFileTypeVoiceNote } func (*FileTypeVoiceNote) FileTypeType() string { - return TypeFileTypeVoiceNote + return TypeFileTypeVoiceNote } // The file is a wallpaper or a background pattern -type FileTypeWallpaper struct { - meta +type FileTypeWallpaper struct{ + meta } func (entity *FileTypeWallpaper) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub FileTypeWallpaper + type stub FileTypeWallpaper - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*FileTypeWallpaper) GetClass() string { - return ClassFileType + return ClassFileType } func (*FileTypeWallpaper) GetType() string { - return TypeFileTypeWallpaper + return TypeFileTypeWallpaper } func (*FileTypeWallpaper) FileTypeType() string { - return TypeFileTypeWallpaper + return TypeFileTypeWallpaper } // Contains the storage usage statistics for a specific file type type StorageStatisticsByFileType struct { - 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"` + 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"` } func (entity *StorageStatisticsByFileType) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub StorageStatisticsByFileType + type stub StorageStatisticsByFileType - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*StorageStatisticsByFileType) GetClass() string { - return ClassStorageStatisticsByFileType + return ClassStorageStatisticsByFileType } func (*StorageStatisticsByFileType) GetType() string { - return TypeStorageStatisticsByFileType + return TypeStorageStatisticsByFileType } func (storageStatisticsByFileType *StorageStatisticsByFileType) UnmarshalJSON(data []byte) error { - var tmp struct { - FileType json.RawMessage `json:"file_type"` - Size int64 `json:"size"` - Count int32 `json:"count"` - } + var tmp struct { + FileType json.RawMessage `json:"file_type"` + Size int64 `json:"size"` + Count int32 `json:"count"` + } - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } - storageStatisticsByFileType.Size = tmp.Size - storageStatisticsByFileType.Count = tmp.Count + storageStatisticsByFileType.Size = tmp.Size + storageStatisticsByFileType.Count = tmp.Count - fieldFileType, _ := UnmarshalFileType(tmp.FileType) - storageStatisticsByFileType.FileType = fieldFileType + fieldFileType, _ := UnmarshalFileType(tmp.FileType) + storageStatisticsByFileType.FileType = fieldFileType - return nil + return nil } // Contains the storage usage statistics for a specific chat type StorageStatisticsByChat struct { - 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"` + 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"` } func (entity *StorageStatisticsByChat) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub StorageStatisticsByChat + type stub StorageStatisticsByChat - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*StorageStatisticsByChat) GetClass() string { - return ClassStorageStatisticsByChat + return ClassStorageStatisticsByChat } func (*StorageStatisticsByChat) GetType() string { - return TypeStorageStatisticsByChat + return TypeStorageStatisticsByChat } // Contains the exact storage usage statistics split by chats and file type type StorageStatistics struct { - 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"` + 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"` } func (entity *StorageStatistics) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub StorageStatistics + type stub StorageStatistics - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*StorageStatistics) GetClass() string { - return ClassStorageStatistics + return ClassStorageStatistics } func (*StorageStatistics) GetType() string { - return TypeStorageStatistics + return TypeStorageStatistics } // Contains approximate storage usage statistics, excluding files of unknown file type type StorageStatisticsFast struct { - 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"` + 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"` } func (entity *StorageStatisticsFast) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub StorageStatisticsFast + type stub StorageStatisticsFast - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*StorageStatisticsFast) GetClass() string { - return ClassStorageStatisticsFast + return ClassStorageStatisticsFast } func (*StorageStatisticsFast) GetType() string { - return TypeStorageStatisticsFast + return TypeStorageStatisticsFast } // Contains database statistics type DatabaseStatistics struct { - meta - // Database statistics in an unspecified human-readable format - Statistics string `json:"statistics"` + meta + // Database statistics in an unspecified human-readable format + Statistics string `json:"statistics"` } func (entity *DatabaseStatistics) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub DatabaseStatistics + type stub DatabaseStatistics - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*DatabaseStatistics) GetClass() string { - return ClassDatabaseStatistics + return ClassDatabaseStatistics } func (*DatabaseStatistics) GetType() string { - return TypeDatabaseStatistics + return TypeDatabaseStatistics } // The network is not available -type NetworkTypeNone struct { - meta +type NetworkTypeNone struct{ + meta } func (entity *NetworkTypeNone) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub NetworkTypeNone + type stub NetworkTypeNone - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*NetworkTypeNone) GetClass() string { - return ClassNetworkType + return ClassNetworkType } func (*NetworkTypeNone) GetType() string { - return TypeNetworkTypeNone + return TypeNetworkTypeNone } func (*NetworkTypeNone) NetworkTypeType() string { - return TypeNetworkTypeNone + return TypeNetworkTypeNone } // A mobile network -type NetworkTypeMobile struct { - meta +type NetworkTypeMobile struct{ + meta } func (entity *NetworkTypeMobile) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub NetworkTypeMobile + type stub NetworkTypeMobile - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*NetworkTypeMobile) GetClass() string { - return ClassNetworkType + return ClassNetworkType } func (*NetworkTypeMobile) GetType() string { - return TypeNetworkTypeMobile + return TypeNetworkTypeMobile } func (*NetworkTypeMobile) NetworkTypeType() string { - return TypeNetworkTypeMobile + return TypeNetworkTypeMobile } // A mobile roaming network -type NetworkTypeMobileRoaming struct { - meta +type NetworkTypeMobileRoaming struct{ + meta } func (entity *NetworkTypeMobileRoaming) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub NetworkTypeMobileRoaming + type stub NetworkTypeMobileRoaming - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*NetworkTypeMobileRoaming) GetClass() string { - return ClassNetworkType + return ClassNetworkType } func (*NetworkTypeMobileRoaming) GetType() string { - return TypeNetworkTypeMobileRoaming + return TypeNetworkTypeMobileRoaming } func (*NetworkTypeMobileRoaming) NetworkTypeType() string { - return TypeNetworkTypeMobileRoaming + return TypeNetworkTypeMobileRoaming } // A Wi-Fi network -type NetworkTypeWiFi struct { - meta +type NetworkTypeWiFi struct{ + meta } func (entity *NetworkTypeWiFi) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub NetworkTypeWiFi + type stub NetworkTypeWiFi - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*NetworkTypeWiFi) GetClass() string { - return ClassNetworkType + return ClassNetworkType } func (*NetworkTypeWiFi) GetType() string { - return TypeNetworkTypeWiFi + return TypeNetworkTypeWiFi } func (*NetworkTypeWiFi) NetworkTypeType() string { - return TypeNetworkTypeWiFi + return TypeNetworkTypeWiFi } // A different network type (e.g., Ethernet network) -type NetworkTypeOther struct { - meta +type NetworkTypeOther struct{ + meta } func (entity *NetworkTypeOther) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub NetworkTypeOther + type stub NetworkTypeOther - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*NetworkTypeOther) GetClass() string { - return ClassNetworkType + return ClassNetworkType } func (*NetworkTypeOther) GetType() string { - return TypeNetworkTypeOther + return TypeNetworkTypeOther } func (*NetworkTypeOther) NetworkTypeType() string { - return TypeNetworkTypeOther + return TypeNetworkTypeOther } // Contains information about the total amount of data that was used to send and receive files type NetworkStatisticsEntryFile struct { - 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"` + 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"` } func (entity *NetworkStatisticsEntryFile) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub NetworkStatisticsEntryFile + type stub NetworkStatisticsEntryFile - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*NetworkStatisticsEntryFile) GetClass() string { - return ClassNetworkStatisticsEntry + return ClassNetworkStatisticsEntry } func (*NetworkStatisticsEntryFile) GetType() string { - return TypeNetworkStatisticsEntryFile + return TypeNetworkStatisticsEntryFile } func (*NetworkStatisticsEntryFile) NetworkStatisticsEntryType() string { - return TypeNetworkStatisticsEntryFile + return TypeNetworkStatisticsEntryFile } func (networkStatisticsEntryFile *NetworkStatisticsEntryFile) UnmarshalJSON(data []byte) error { - 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"` - } + 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"` + } - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } - networkStatisticsEntryFile.SentBytes = tmp.SentBytes - networkStatisticsEntryFile.ReceivedBytes = tmp.ReceivedBytes + networkStatisticsEntryFile.SentBytes = tmp.SentBytes + networkStatisticsEntryFile.ReceivedBytes = tmp.ReceivedBytes - fieldFileType, _ := UnmarshalFileType(tmp.FileType) - networkStatisticsEntryFile.FileType = fieldFileType + fieldFileType, _ := UnmarshalFileType(tmp.FileType) + networkStatisticsEntryFile.FileType = fieldFileType - fieldNetworkType, _ := UnmarshalNetworkType(tmp.NetworkType) - networkStatisticsEntryFile.NetworkType = fieldNetworkType + fieldNetworkType, _ := UnmarshalNetworkType(tmp.NetworkType) + networkStatisticsEntryFile.NetworkType = fieldNetworkType - return nil + return nil } // Contains information about the total amount of data that was used for calls type NetworkStatisticsEntryCall struct { - 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"` + 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"` } func (entity *NetworkStatisticsEntryCall) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub NetworkStatisticsEntryCall + type stub NetworkStatisticsEntryCall - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*NetworkStatisticsEntryCall) GetClass() string { - return ClassNetworkStatisticsEntry + return ClassNetworkStatisticsEntry } func (*NetworkStatisticsEntryCall) GetType() string { - return TypeNetworkStatisticsEntryCall + return TypeNetworkStatisticsEntryCall } func (*NetworkStatisticsEntryCall) NetworkStatisticsEntryType() string { - return TypeNetworkStatisticsEntryCall + return TypeNetworkStatisticsEntryCall } func (networkStatisticsEntryCall *NetworkStatisticsEntryCall) UnmarshalJSON(data []byte) error { - var tmp struct { - NetworkType json.RawMessage `json:"network_type"` - SentBytes int64 `json:"sent_bytes"` - ReceivedBytes int64 `json:"received_bytes"` - Duration float64 `json:"duration"` - } + var tmp struct { + NetworkType json.RawMessage `json:"network_type"` + SentBytes int64 `json:"sent_bytes"` + ReceivedBytes int64 `json:"received_bytes"` + Duration float64 `json:"duration"` + } - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } - networkStatisticsEntryCall.SentBytes = tmp.SentBytes - networkStatisticsEntryCall.ReceivedBytes = tmp.ReceivedBytes - networkStatisticsEntryCall.Duration = tmp.Duration + networkStatisticsEntryCall.SentBytes = tmp.SentBytes + networkStatisticsEntryCall.ReceivedBytes = tmp.ReceivedBytes + networkStatisticsEntryCall.Duration = tmp.Duration - fieldNetworkType, _ := UnmarshalNetworkType(tmp.NetworkType) - networkStatisticsEntryCall.NetworkType = fieldNetworkType + fieldNetworkType, _ := UnmarshalNetworkType(tmp.NetworkType) + networkStatisticsEntryCall.NetworkType = fieldNetworkType - return nil + return nil } // A full list of available network statistic entries type NetworkStatistics struct { - meta - // Point in time (Unix timestamp) from which the statistics are collected - SinceDate int32 `json:"since_date"` - // Network statistics entries - Entries []NetworkStatisticsEntry `json:"entries"` + meta + // Point in time (Unix timestamp) from which the statistics are collected + SinceDate int32 `json:"since_date"` + // Network statistics entries + Entries []NetworkStatisticsEntry `json:"entries"` } func (entity *NetworkStatistics) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub NetworkStatistics + type stub NetworkStatistics - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*NetworkStatistics) GetClass() string { - return ClassNetworkStatistics + return ClassNetworkStatistics } func (*NetworkStatistics) GetType() string { - return TypeNetworkStatistics + return TypeNetworkStatistics } func (networkStatistics *NetworkStatistics) UnmarshalJSON(data []byte) error { - var tmp struct { - SinceDate int32 `json:"since_date"` - Entries []json.RawMessage `json:"entries"` - } + var tmp struct { + SinceDate int32 `json:"since_date"` + Entries []json.RawMessage `json:"entries"` + } - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } - networkStatistics.SinceDate = tmp.SinceDate + networkStatistics.SinceDate = tmp.SinceDate - fieldEntries, _ := UnmarshalListOfNetworkStatisticsEntry(tmp.Entries) - networkStatistics.Entries = fieldEntries + fieldEntries, _ := UnmarshalListOfNetworkStatisticsEntry(tmp.Entries) + networkStatistics.Entries = fieldEntries - return nil + return nil } // Contains auto-download settings type AutoDownloadSettings struct { - 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 int64 `json:"max_video_file_size"` - // The maximum size of other file types to be auto-downloaded, in bytes - MaxOtherFileSize int64 `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"` + 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 int64 `json:"max_video_file_size"` + // The maximum size of other file types to be auto-downloaded, in bytes + MaxOtherFileSize int64 `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 stories needs to be preloaded + PreloadStories bool `json:"preload_stories"` + // True, if "use less data for calls" option needs to be enabled + UseLessDataForCalls bool `json:"use_less_data_for_calls"` } func (entity *AutoDownloadSettings) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub AutoDownloadSettings + type stub AutoDownloadSettings - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*AutoDownloadSettings) GetClass() string { - return ClassAutoDownloadSettings + return ClassAutoDownloadSettings } func (*AutoDownloadSettings) GetType() string { - return TypeAutoDownloadSettings + return TypeAutoDownloadSettings } // Contains auto-download settings presets for the current user type AutoDownloadSettingsPresets struct { - 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"` + 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"` } func (entity *AutoDownloadSettingsPresets) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub AutoDownloadSettingsPresets + type stub AutoDownloadSettingsPresets - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*AutoDownloadSettingsPresets) GetClass() string { - return ClassAutoDownloadSettingsPresets + return ClassAutoDownloadSettingsPresets } func (*AutoDownloadSettingsPresets) GetType() string { - return TypeAutoDownloadSettingsPresets + return TypeAutoDownloadSettingsPresets } -// Currently waiting for the network to become available. Use setNetworkType to change the available network type -type ConnectionStateWaitingForNetwork struct { - meta +// Autosave settings applied to all private chats without chat-specific settings +type AutosaveSettingsScopePrivateChats struct{ + meta +} + +func (entity *AutosaveSettingsScopePrivateChats) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub AutosaveSettingsScopePrivateChats + + return json.Marshal((*stub)(entity)) +} + +func (*AutosaveSettingsScopePrivateChats) GetClass() string { + return ClassAutosaveSettingsScope +} + +func (*AutosaveSettingsScopePrivateChats) GetType() string { + return TypeAutosaveSettingsScopePrivateChats +} + +func (*AutosaveSettingsScopePrivateChats) AutosaveSettingsScopeType() string { + return TypeAutosaveSettingsScopePrivateChats +} + +// Autosave settings applied to all basic group and supergroup chats without chat-specific settings +type AutosaveSettingsScopeGroupChats struct{ + meta +} + +func (entity *AutosaveSettingsScopeGroupChats) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub AutosaveSettingsScopeGroupChats + + return json.Marshal((*stub)(entity)) +} + +func (*AutosaveSettingsScopeGroupChats) GetClass() string { + return ClassAutosaveSettingsScope +} + +func (*AutosaveSettingsScopeGroupChats) GetType() string { + return TypeAutosaveSettingsScopeGroupChats +} + +func (*AutosaveSettingsScopeGroupChats) AutosaveSettingsScopeType() string { + return TypeAutosaveSettingsScopeGroupChats +} + +// Autosave settings applied to all channel chats without chat-specific settings +type AutosaveSettingsScopeChannelChats struct{ + meta +} + +func (entity *AutosaveSettingsScopeChannelChats) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub AutosaveSettingsScopeChannelChats + + return json.Marshal((*stub)(entity)) +} + +func (*AutosaveSettingsScopeChannelChats) GetClass() string { + return ClassAutosaveSettingsScope +} + +func (*AutosaveSettingsScopeChannelChats) GetType() string { + return TypeAutosaveSettingsScopeChannelChats +} + +func (*AutosaveSettingsScopeChannelChats) AutosaveSettingsScopeType() string { + return TypeAutosaveSettingsScopeChannelChats +} + +// Autosave settings applied to a chat +type AutosaveSettingsScopeChat struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` +} + +func (entity *AutosaveSettingsScopeChat) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub AutosaveSettingsScopeChat + + return json.Marshal((*stub)(entity)) +} + +func (*AutosaveSettingsScopeChat) GetClass() string { + return ClassAutosaveSettingsScope +} + +func (*AutosaveSettingsScopeChat) GetType() string { + return TypeAutosaveSettingsScopeChat +} + +func (*AutosaveSettingsScopeChat) AutosaveSettingsScopeType() string { + return TypeAutosaveSettingsScopeChat +} + +// Contains autosave settings for an autosave settings scope +type ScopeAutosaveSettings struct { + meta + // True, if photo autosave is enabled + AutosavePhotos bool `json:"autosave_photos"` + // True, if video autosave is enabled + AutosaveVideos bool `json:"autosave_videos"` + // The maximum size of a video file to be autosaved, in bytes; 512 KB - 4000 MB + MaxVideoFileSize int64 `json:"max_video_file_size"` +} + +func (entity *ScopeAutosaveSettings) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ScopeAutosaveSettings + + return json.Marshal((*stub)(entity)) +} + +func (*ScopeAutosaveSettings) GetClass() string { + return ClassScopeAutosaveSettings +} + +func (*ScopeAutosaveSettings) GetType() string { + return TypeScopeAutosaveSettings +} + +// Contains autosave settings for a chat, which overrides default settings for the corresponding scope +type AutosaveSettingsException struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // Autosave settings for the chat + Settings *ScopeAutosaveSettings `json:"settings"` +} + +func (entity *AutosaveSettingsException) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub AutosaveSettingsException + + return json.Marshal((*stub)(entity)) +} + +func (*AutosaveSettingsException) GetClass() string { + return ClassAutosaveSettingsException +} + +func (*AutosaveSettingsException) GetType() string { + return TypeAutosaveSettingsException +} + +// Describes autosave settings +type AutosaveSettings struct { + meta + // Default autosave settings for private chats + PrivateChatSettings *ScopeAutosaveSettings `json:"private_chat_settings"` + // Default autosave settings for basic group and supergroup chats + GroupSettings *ScopeAutosaveSettings `json:"group_settings"` + // Default autosave settings for channel chats + ChannelSettings *ScopeAutosaveSettings `json:"channel_settings"` + // Autosave settings for specific chats + Exceptions []*AutosaveSettingsException `json:"exceptions"` +} + +func (entity *AutosaveSettings) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub AutosaveSettings + + return json.Marshal((*stub)(entity)) +} + +func (*AutosaveSettings) GetClass() string { + return ClassAutosaveSettings +} + +func (*AutosaveSettings) GetType() string { + return TypeAutosaveSettings +} + +// Waiting for the network to become available. Use setNetworkType to change the available network type +type ConnectionStateWaitingForNetwork struct{ + meta } func (entity *ConnectionStateWaitingForNetwork) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub ConnectionStateWaitingForNetwork + type stub ConnectionStateWaitingForNetwork - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*ConnectionStateWaitingForNetwork) GetClass() string { - return ClassConnectionState + return ClassConnectionState } func (*ConnectionStateWaitingForNetwork) GetType() string { - return TypeConnectionStateWaitingForNetwork + return TypeConnectionStateWaitingForNetwork } func (*ConnectionStateWaitingForNetwork) ConnectionStateType() string { - return TypeConnectionStateWaitingForNetwork + return TypeConnectionStateWaitingForNetwork } -// Currently establishing a connection with a proxy server -type ConnectionStateConnectingToProxy struct { - meta +// Establishing a connection with a proxy server +type ConnectionStateConnectingToProxy struct{ + meta } func (entity *ConnectionStateConnectingToProxy) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub ConnectionStateConnectingToProxy + type stub ConnectionStateConnectingToProxy - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*ConnectionStateConnectingToProxy) GetClass() string { - return ClassConnectionState + return ClassConnectionState } func (*ConnectionStateConnectingToProxy) GetType() string { - return TypeConnectionStateConnectingToProxy + return TypeConnectionStateConnectingToProxy } func (*ConnectionStateConnectingToProxy) ConnectionStateType() string { - return TypeConnectionStateConnectingToProxy + return TypeConnectionStateConnectingToProxy } -// Currently establishing a connection to the Telegram servers -type ConnectionStateConnecting struct { - meta +// Establishing a connection to the Telegram servers +type ConnectionStateConnecting struct{ + meta } func (entity *ConnectionStateConnecting) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub ConnectionStateConnecting + type stub ConnectionStateConnecting - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*ConnectionStateConnecting) GetClass() string { - return ClassConnectionState + return ClassConnectionState } func (*ConnectionStateConnecting) GetType() string { - return TypeConnectionStateConnecting + return TypeConnectionStateConnecting } func (*ConnectionStateConnecting) ConnectionStateType() string { - return TypeConnectionStateConnecting + return TypeConnectionStateConnecting } -// Downloading data received while the application was offline -type ConnectionStateUpdating struct { - meta +// Downloading data supposed to be received while the application was offline +type ConnectionStateUpdating struct{ + meta } func (entity *ConnectionStateUpdating) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub ConnectionStateUpdating + type stub ConnectionStateUpdating - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*ConnectionStateUpdating) GetClass() string { - return ClassConnectionState + return ClassConnectionState } func (*ConnectionStateUpdating) GetType() string { - return TypeConnectionStateUpdating + return TypeConnectionStateUpdating } func (*ConnectionStateUpdating) ConnectionStateType() string { - return TypeConnectionStateUpdating + return TypeConnectionStateUpdating } // There is a working connection to the Telegram servers -type ConnectionStateReady struct { - meta +type ConnectionStateReady struct{ + meta } func (entity *ConnectionStateReady) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub ConnectionStateReady + type stub ConnectionStateReady - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*ConnectionStateReady) GetClass() string { - return ClassConnectionState + return ClassConnectionState } func (*ConnectionStateReady) GetType() string { - return TypeConnectionStateReady + return TypeConnectionStateReady } func (*ConnectionStateReady) ConnectionStateType() string { - return TypeConnectionStateReady + return TypeConnectionStateReady } // A category containing frequently used private chats with non-bot users -type TopChatCategoryUsers struct { - meta +type TopChatCategoryUsers struct{ + meta } func (entity *TopChatCategoryUsers) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub TopChatCategoryUsers + type stub TopChatCategoryUsers - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*TopChatCategoryUsers) GetClass() string { - return ClassTopChatCategory + return ClassTopChatCategory } func (*TopChatCategoryUsers) GetType() string { - return TypeTopChatCategoryUsers + return TypeTopChatCategoryUsers } func (*TopChatCategoryUsers) TopChatCategoryType() string { - return TypeTopChatCategoryUsers + return TypeTopChatCategoryUsers } // A category containing frequently used private chats with bot users -type TopChatCategoryBots struct { - meta +type TopChatCategoryBots struct{ + meta } func (entity *TopChatCategoryBots) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub TopChatCategoryBots + type stub TopChatCategoryBots - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*TopChatCategoryBots) GetClass() string { - return ClassTopChatCategory + return ClassTopChatCategory } func (*TopChatCategoryBots) GetType() string { - return TypeTopChatCategoryBots + return TypeTopChatCategoryBots } func (*TopChatCategoryBots) TopChatCategoryType() string { - return TypeTopChatCategoryBots + return TypeTopChatCategoryBots } // A category containing frequently used basic groups and supergroups -type TopChatCategoryGroups struct { - meta +type TopChatCategoryGroups struct{ + meta } func (entity *TopChatCategoryGroups) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub TopChatCategoryGroups + type stub TopChatCategoryGroups - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*TopChatCategoryGroups) GetClass() string { - return ClassTopChatCategory + return ClassTopChatCategory } func (*TopChatCategoryGroups) GetType() string { - return TypeTopChatCategoryGroups + return TypeTopChatCategoryGroups } func (*TopChatCategoryGroups) TopChatCategoryType() string { - return TypeTopChatCategoryGroups + return TypeTopChatCategoryGroups } // A category containing frequently used channels -type TopChatCategoryChannels struct { - meta +type TopChatCategoryChannels struct{ + meta } func (entity *TopChatCategoryChannels) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub TopChatCategoryChannels + type stub TopChatCategoryChannels - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*TopChatCategoryChannels) GetClass() string { - return ClassTopChatCategory + return ClassTopChatCategory } func (*TopChatCategoryChannels) GetType() string { - return TypeTopChatCategoryChannels + return TypeTopChatCategoryChannels } func (*TopChatCategoryChannels) TopChatCategoryType() string { - return TypeTopChatCategoryChannels + return TypeTopChatCategoryChannels } // A category containing frequently used chats with inline bots sorted by their usage in inline mode -type TopChatCategoryInlineBots struct { - meta +type TopChatCategoryInlineBots struct{ + meta } func (entity *TopChatCategoryInlineBots) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub TopChatCategoryInlineBots + type stub TopChatCategoryInlineBots - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*TopChatCategoryInlineBots) GetClass() string { - return ClassTopChatCategory + return ClassTopChatCategory } func (*TopChatCategoryInlineBots) GetType() string { - return TypeTopChatCategoryInlineBots + return TypeTopChatCategoryInlineBots } func (*TopChatCategoryInlineBots) TopChatCategoryType() string { - return TypeTopChatCategoryInlineBots + return TypeTopChatCategoryInlineBots } // A category containing frequently used chats used for calls -type TopChatCategoryCalls struct { - meta +type TopChatCategoryCalls struct{ + meta } func (entity *TopChatCategoryCalls) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub TopChatCategoryCalls + type stub TopChatCategoryCalls - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*TopChatCategoryCalls) GetClass() string { - return ClassTopChatCategory + return ClassTopChatCategory } func (*TopChatCategoryCalls) GetType() string { - return TypeTopChatCategoryCalls + return TypeTopChatCategoryCalls } func (*TopChatCategoryCalls) TopChatCategoryType() string { - return TypeTopChatCategoryCalls + return TypeTopChatCategoryCalls } // A category containing frequently used chats used to forward messages -type TopChatCategoryForwardChats struct { - meta +type TopChatCategoryForwardChats struct{ + meta } func (entity *TopChatCategoryForwardChats) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub TopChatCategoryForwardChats + type stub TopChatCategoryForwardChats - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*TopChatCategoryForwardChats) GetClass() string { - return ClassTopChatCategory + return ClassTopChatCategory } func (*TopChatCategoryForwardChats) GetType() string { - return TypeTopChatCategoryForwardChats + return TypeTopChatCategoryForwardChats } func (*TopChatCategoryForwardChats) TopChatCategoryType() string { - return TypeTopChatCategoryForwardChats + return TypeTopChatCategoryForwardChats +} + +// Contains 0-based match position +type FoundPosition struct { + meta + // The position of the match + Position int32 `json:"position"` +} + +func (entity *FoundPosition) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub FoundPosition + + return json.Marshal((*stub)(entity)) +} + +func (*FoundPosition) GetClass() string { + return ClassFoundPosition +} + +func (*FoundPosition) GetType() string { + return TypeFoundPosition +} + +// Contains 0-based positions of matched objects +type FoundPositions struct { + meta + // Total number of matched objects + TotalCount int32 `json:"total_count"` + // The positions of the matched objects + Positions []int32 `json:"positions"` +} + +func (entity *FoundPositions) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub FoundPositions + + return json.Marshal((*stub)(entity)) +} + +func (*FoundPositions) GetClass() string { + return ClassFoundPositions +} + +func (*FoundPositions) GetType() string { + return TypeFoundPositions } // A URL linking to a user type TMeUrlTypeUser struct { - meta - // Identifier of the user - UserId int64 `json:"user_id"` + meta + // Identifier of the user + UserId int64 `json:"user_id"` } func (entity *TMeUrlTypeUser) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub TMeUrlTypeUser + type stub TMeUrlTypeUser - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*TMeUrlTypeUser) GetClass() string { - return ClassTMeUrlType + return ClassTMeUrlType } func (*TMeUrlTypeUser) GetType() string { - return TypeTMeUrlTypeUser + return TypeTMeUrlTypeUser } func (*TMeUrlTypeUser) TMeUrlTypeType() string { - return TypeTMeUrlTypeUser + return TypeTMeUrlTypeUser } // A URL linking to a public supergroup or channel type TMeUrlTypeSupergroup struct { - meta - // Identifier of the supergroup or channel - SupergroupId int64 `json:"supergroup_id"` + meta + // Identifier of the supergroup or channel + SupergroupId int64 `json:"supergroup_id"` } func (entity *TMeUrlTypeSupergroup) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub TMeUrlTypeSupergroup + type stub TMeUrlTypeSupergroup - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*TMeUrlTypeSupergroup) GetClass() string { - return ClassTMeUrlType + return ClassTMeUrlType } func (*TMeUrlTypeSupergroup) GetType() string { - return TypeTMeUrlTypeSupergroup + return TypeTMeUrlTypeSupergroup } func (*TMeUrlTypeSupergroup) TMeUrlTypeType() string { - return TypeTMeUrlTypeSupergroup + return TypeTMeUrlTypeSupergroup } // A chat invite link type TMeUrlTypeChatInvite struct { - meta - // Information about the chat invite link - Info *ChatInviteLinkInfo `json:"info"` + meta + // Information about the chat invite link + Info *ChatInviteLinkInfo `json:"info"` } func (entity *TMeUrlTypeChatInvite) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub TMeUrlTypeChatInvite + type stub TMeUrlTypeChatInvite - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*TMeUrlTypeChatInvite) GetClass() string { - return ClassTMeUrlType + return ClassTMeUrlType } func (*TMeUrlTypeChatInvite) GetType() string { - return TypeTMeUrlTypeChatInvite + return TypeTMeUrlTypeChatInvite } func (*TMeUrlTypeChatInvite) TMeUrlTypeType() string { - return TypeTMeUrlTypeChatInvite + return TypeTMeUrlTypeChatInvite } // A URL linking to a sticker set type TMeUrlTypeStickerSet struct { - meta - // Identifier of the sticker set - StickerSetId JsonInt64 `json:"sticker_set_id"` + meta + // Identifier of the sticker set + StickerSetId JsonInt64 `json:"sticker_set_id"` } func (entity *TMeUrlTypeStickerSet) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub TMeUrlTypeStickerSet + type stub TMeUrlTypeStickerSet - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*TMeUrlTypeStickerSet) GetClass() string { - return ClassTMeUrlType + return ClassTMeUrlType } func (*TMeUrlTypeStickerSet) GetType() string { - return TypeTMeUrlTypeStickerSet + return TypeTMeUrlTypeStickerSet } func (*TMeUrlTypeStickerSet) TMeUrlTypeType() string { - return TypeTMeUrlTypeStickerSet + return TypeTMeUrlTypeStickerSet } // Represents a URL linking to an internal Telegram entity type TMeUrl struct { - meta - // URL - Url string `json:"url"` - // Type of the URL - Type TMeUrlType `json:"type"` + meta + // URL + Url string `json:"url"` + // Type of the URL + Type TMeUrlType `json:"type"` } func (entity *TMeUrl) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub TMeUrl + type stub TMeUrl - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*TMeUrl) GetClass() string { - return ClassTMeUrl + return ClassTMeUrl } func (*TMeUrl) GetType() string { - return TypeTMeUrl + return TypeTMeUrl } func (tMeUrl *TMeUrl) UnmarshalJSON(data []byte) error { - var tmp struct { - Url string `json:"url"` - Type json.RawMessage `json:"type"` - } + var tmp struct { + Url string `json:"url"` + Type json.RawMessage `json:"type"` + } - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } - tMeUrl.Url = tmp.Url + tMeUrl.Url = tmp.Url - fieldType, _ := UnmarshalTMeUrlType(tmp.Type) - tMeUrl.Type = fieldType + fieldType, _ := UnmarshalTMeUrlType(tmp.Type) + tMeUrl.Type = fieldType - return nil + return nil } // Contains a list of t.me URLs type TMeUrls struct { - meta - // List of URLs - Urls []*TMeUrl `json:"urls"` + meta + // List of URLs + Urls []*TMeUrl `json:"urls"` } func (entity *TMeUrls) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub TMeUrls + type stub TMeUrls - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*TMeUrls) GetClass() string { - return ClassTMeUrls + return ClassTMeUrls } func (*TMeUrls) GetType() string { - return TypeTMeUrls + return TypeTMeUrls } -// Suggests the user to enable "archive_and_mute_new_chats_from_unknown_users" option -type SuggestedActionEnableArchiveAndMuteNewChats struct { - meta +// Suggests the user to enable archive_and_mute_new_chats_from_unknown_users setting in archiveChatListSettings +type SuggestedActionEnableArchiveAndMuteNewChats struct{ + meta } func (entity *SuggestedActionEnableArchiveAndMuteNewChats) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub SuggestedActionEnableArchiveAndMuteNewChats + type stub SuggestedActionEnableArchiveAndMuteNewChats - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*SuggestedActionEnableArchiveAndMuteNewChats) GetClass() string { - return ClassSuggestedAction + return ClassSuggestedAction } func (*SuggestedActionEnableArchiveAndMuteNewChats) GetType() string { - return TypeSuggestedActionEnableArchiveAndMuteNewChats + return TypeSuggestedActionEnableArchiveAndMuteNewChats } func (*SuggestedActionEnableArchiveAndMuteNewChats) SuggestedActionType() string { - return TypeSuggestedActionEnableArchiveAndMuteNewChats + return TypeSuggestedActionEnableArchiveAndMuteNewChats } // Suggests the user to check whether they still remember their 2-step verification password -type SuggestedActionCheckPassword struct { - meta +type SuggestedActionCheckPassword struct{ + meta } func (entity *SuggestedActionCheckPassword) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub SuggestedActionCheckPassword + type stub SuggestedActionCheckPassword - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*SuggestedActionCheckPassword) GetClass() string { - return ClassSuggestedAction + return ClassSuggestedAction } func (*SuggestedActionCheckPassword) GetType() string { - return TypeSuggestedActionCheckPassword + return TypeSuggestedActionCheckPassword } func (*SuggestedActionCheckPassword) SuggestedActionType() string { - return TypeSuggestedActionCheckPassword + return TypeSuggestedActionCheckPassword } // Suggests the user to check whether authorization phone number is correct and change the phone number if it is inaccessible -type SuggestedActionCheckPhoneNumber struct { - meta +type SuggestedActionCheckPhoneNumber struct{ + meta } func (entity *SuggestedActionCheckPhoneNumber) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub SuggestedActionCheckPhoneNumber + type stub SuggestedActionCheckPhoneNumber - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*SuggestedActionCheckPhoneNumber) GetClass() string { - return ClassSuggestedAction + return ClassSuggestedAction } func (*SuggestedActionCheckPhoneNumber) GetType() string { - return TypeSuggestedActionCheckPhoneNumber + return TypeSuggestedActionCheckPhoneNumber } func (*SuggestedActionCheckPhoneNumber) SuggestedActionType() string { - return TypeSuggestedActionCheckPhoneNumber + return TypeSuggestedActionCheckPhoneNumber } // Suggests the user to view a hint about the meaning of one and two check marks on sent messages -type SuggestedActionViewChecksHint struct { - meta +type SuggestedActionViewChecksHint struct{ + meta } func (entity *SuggestedActionViewChecksHint) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub SuggestedActionViewChecksHint + type stub SuggestedActionViewChecksHint - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*SuggestedActionViewChecksHint) GetClass() string { - return ClassSuggestedAction + return ClassSuggestedAction } func (*SuggestedActionViewChecksHint) GetType() string { - return TypeSuggestedActionViewChecksHint + return TypeSuggestedActionViewChecksHint } func (*SuggestedActionViewChecksHint) SuggestedActionType() string { - return TypeSuggestedActionViewChecksHint + return TypeSuggestedActionViewChecksHint } // Suggests the user to convert specified supergroup to a broadcast group type SuggestedActionConvertToBroadcastGroup struct { - meta - // Supergroup identifier - SupergroupId int64 `json:"supergroup_id"` + meta + // Supergroup identifier + SupergroupId int64 `json:"supergroup_id"` } func (entity *SuggestedActionConvertToBroadcastGroup) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub SuggestedActionConvertToBroadcastGroup + type stub SuggestedActionConvertToBroadcastGroup - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*SuggestedActionConvertToBroadcastGroup) GetClass() string { - return ClassSuggestedAction + return ClassSuggestedAction } func (*SuggestedActionConvertToBroadcastGroup) GetType() string { - return TypeSuggestedActionConvertToBroadcastGroup + return TypeSuggestedActionConvertToBroadcastGroup } func (*SuggestedActionConvertToBroadcastGroup) SuggestedActionType() string { - return TypeSuggestedActionConvertToBroadcastGroup + return TypeSuggestedActionConvertToBroadcastGroup } // Suggests the user to set a 2-step verification password to be able to log in again type SuggestedActionSetPassword struct { - meta - // The number of days to pass between consecutive authorizations if the user declines to set password - AuthorizationDelay int32 `json:"authorization_delay"` + meta + // The number of days to pass between consecutive authorizations if the user declines to set password; if 0, then the user is advised to set the password for security reasons + AuthorizationDelay int32 `json:"authorization_delay"` } func (entity *SuggestedActionSetPassword) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub SuggestedActionSetPassword + type stub SuggestedActionSetPassword - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*SuggestedActionSetPassword) GetClass() string { - return ClassSuggestedAction + return ClassSuggestedAction } func (*SuggestedActionSetPassword) GetType() string { - return TypeSuggestedActionSetPassword + return TypeSuggestedActionSetPassword } func (*SuggestedActionSetPassword) SuggestedActionType() string { - return TypeSuggestedActionSetPassword + return TypeSuggestedActionSetPassword +} + +// Suggests the user to upgrade the Premium subscription from monthly payments to annual payments +type SuggestedActionUpgradePremium struct{ + meta +} + +func (entity *SuggestedActionUpgradePremium) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SuggestedActionUpgradePremium + + return json.Marshal((*stub)(entity)) +} + +func (*SuggestedActionUpgradePremium) GetClass() string { + return ClassSuggestedAction +} + +func (*SuggestedActionUpgradePremium) GetType() string { + return TypeSuggestedActionUpgradePremium +} + +func (*SuggestedActionUpgradePremium) SuggestedActionType() string { + return TypeSuggestedActionUpgradePremium +} + +// Suggests the user to restore a recently expired Premium subscription +type SuggestedActionRestorePremium struct{ + meta +} + +func (entity *SuggestedActionRestorePremium) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SuggestedActionRestorePremium + + return json.Marshal((*stub)(entity)) +} + +func (*SuggestedActionRestorePremium) GetClass() string { + return ClassSuggestedAction +} + +func (*SuggestedActionRestorePremium) GetType() string { + return TypeSuggestedActionRestorePremium +} + +func (*SuggestedActionRestorePremium) SuggestedActionType() string { + return TypeSuggestedActionRestorePremium +} + +// Suggests the user to subscribe to the Premium subscription with annual payments +type SuggestedActionSubscribeToAnnualPremium struct{ + meta +} + +func (entity *SuggestedActionSubscribeToAnnualPremium) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SuggestedActionSubscribeToAnnualPremium + + return json.Marshal((*stub)(entity)) +} + +func (*SuggestedActionSubscribeToAnnualPremium) GetClass() string { + return ClassSuggestedAction +} + +func (*SuggestedActionSubscribeToAnnualPremium) GetType() string { + return TypeSuggestedActionSubscribeToAnnualPremium +} + +func (*SuggestedActionSubscribeToAnnualPremium) SuggestedActionType() string { + return TypeSuggestedActionSubscribeToAnnualPremium +} + +// Suggests the user to gift Telegram Premium to friends for Christmas +type SuggestedActionGiftPremiumForChristmas struct{ + meta +} + +func (entity *SuggestedActionGiftPremiumForChristmas) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SuggestedActionGiftPremiumForChristmas + + return json.Marshal((*stub)(entity)) +} + +func (*SuggestedActionGiftPremiumForChristmas) GetClass() string { + return ClassSuggestedAction +} + +func (*SuggestedActionGiftPremiumForChristmas) GetType() string { + return TypeSuggestedActionGiftPremiumForChristmas +} + +func (*SuggestedActionGiftPremiumForChristmas) SuggestedActionType() string { + return TypeSuggestedActionGiftPremiumForChristmas +} + +// Suggests the user to set birthdate +type SuggestedActionSetBirthdate struct{ + meta +} + +func (entity *SuggestedActionSetBirthdate) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SuggestedActionSetBirthdate + + return json.Marshal((*stub)(entity)) +} + +func (*SuggestedActionSetBirthdate) GetClass() string { + return ClassSuggestedAction +} + +func (*SuggestedActionSetBirthdate) GetType() string { + return TypeSuggestedActionSetBirthdate +} + +func (*SuggestedActionSetBirthdate) SuggestedActionType() string { + return TypeSuggestedActionSetBirthdate } // Contains a counter type Count struct { - meta - // Count - Count int32 `json:"count"` + meta + // Count + Count int32 `json:"count"` } func (entity *Count) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub Count + type stub Count - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*Count) GetClass() string { - return ClassCount + return ClassCount } func (*Count) GetType() string { - return TypeCount + return TypeCount } // Contains some text type Text struct { - meta - // Text - Text string `json:"text"` + meta + // Text + Text string `json:"text"` } func (entity *Text) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub Text + type stub Text - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*Text) GetClass() string { - return ClassText + return ClassText } func (*Text) GetType() string { - return TypeText + return TypeText } // Contains a value representing a number of seconds type Seconds struct { - meta - // Number of seconds - Seconds float64 `json:"seconds"` + meta + // Number of seconds + Seconds float64 `json:"seconds"` } func (entity *Seconds) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub Seconds + type stub Seconds - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*Seconds) GetClass() string { - return ClassSeconds + return ClassSeconds } func (*Seconds) GetType() string { - return TypeSeconds + return TypeSeconds } // Contains size of downloaded prefix of a file type FileDownloadedPrefixSize struct { - meta - // The prefix size, in bytes - Size int64 `json:"size"` + meta + // The prefix size, in bytes + Size int64 `json:"size"` } func (entity *FileDownloadedPrefixSize) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub FileDownloadedPrefixSize + type stub FileDownloadedPrefixSize - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*FileDownloadedPrefixSize) GetClass() string { - return ClassFileDownloadedPrefixSize + return ClassFileDownloadedPrefixSize } func (*FileDownloadedPrefixSize) GetType() string { - return TypeFileDownloadedPrefixSize + return TypeFileDownloadedPrefixSize } // Contains information about a tg: deep link type DeepLinkInfo struct { - 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"` + 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"` } func (entity *DeepLinkInfo) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub DeepLinkInfo + type stub DeepLinkInfo - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*DeepLinkInfo) GetClass() string { - return ClassDeepLinkInfo + return ClassDeepLinkInfo } func (*DeepLinkInfo) GetType() string { - return TypeDeepLinkInfo + return TypeDeepLinkInfo } // The text uses Markdown-style formatting type TextParseModeMarkdown struct { - 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"` + 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"` } func (entity *TextParseModeMarkdown) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub TextParseModeMarkdown + type stub TextParseModeMarkdown - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*TextParseModeMarkdown) GetClass() string { - return ClassTextParseMode + return ClassTextParseMode } func (*TextParseModeMarkdown) GetType() string { - return TypeTextParseModeMarkdown + return TypeTextParseModeMarkdown } func (*TextParseModeMarkdown) TextParseModeType() string { - return TypeTextParseModeMarkdown + return TypeTextParseModeMarkdown } // The text uses HTML-style formatting. The same as Telegram Bot API "HTML" parse mode -type TextParseModeHTML struct { - meta +type TextParseModeHTML struct{ + meta } func (entity *TextParseModeHTML) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub TextParseModeHTML + type stub TextParseModeHTML - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*TextParseModeHTML) GetClass() string { - return ClassTextParseMode + return ClassTextParseMode } func (*TextParseModeHTML) GetType() string { - return TypeTextParseModeHTML + return TypeTextParseModeHTML } func (*TextParseModeHTML) TextParseModeType() string { - return TypeTextParseModeHTML + return TypeTextParseModeHTML } // A SOCKS5 proxy server type ProxyTypeSocks5 struct { - meta - // Username for logging in; may be empty - Username string `json:"username"` - // Password for logging in; may be empty - Password string `json:"password"` + meta + // Username for logging in; may be empty + Username string `json:"username"` + // Password for logging in; may be empty + Password string `json:"password"` } func (entity *ProxyTypeSocks5) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub ProxyTypeSocks5 + type stub ProxyTypeSocks5 - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*ProxyTypeSocks5) GetClass() string { - return ClassProxyType + return ClassProxyType } func (*ProxyTypeSocks5) GetType() string { - return TypeProxyTypeSocks5 + return TypeProxyTypeSocks5 } func (*ProxyTypeSocks5) ProxyTypeType() string { - return TypeProxyTypeSocks5 + return TypeProxyTypeSocks5 } // A HTTP transparent proxy server type ProxyTypeHttp struct { - 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"` + 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"` } func (entity *ProxyTypeHttp) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub ProxyTypeHttp + type stub ProxyTypeHttp - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*ProxyTypeHttp) GetClass() string { - return ClassProxyType + return ClassProxyType } func (*ProxyTypeHttp) GetType() string { - return TypeProxyTypeHttp + return TypeProxyTypeHttp } func (*ProxyTypeHttp) ProxyTypeType() string { - return TypeProxyTypeHttp + return TypeProxyTypeHttp } // An MTProto proxy server type ProxyTypeMtproto struct { - meta - // The proxy's secret in hexadecimal encoding - Secret string `json:"secret"` + meta + // The proxy's secret in hexadecimal encoding + Secret string `json:"secret"` } func (entity *ProxyTypeMtproto) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub ProxyTypeMtproto + type stub ProxyTypeMtproto - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*ProxyTypeMtproto) GetClass() string { - return ClassProxyType + return ClassProxyType } func (*ProxyTypeMtproto) GetType() string { - return TypeProxyTypeMtproto + return TypeProxyTypeMtproto } func (*ProxyTypeMtproto) ProxyTypeType() string { - return TypeProxyTypeMtproto + return TypeProxyTypeMtproto } // Contains information about a proxy server type Proxy struct { - 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"` + meta + // Unique identifier of the proxy + Id int32 `json:"id"` + // Proxy server domain or 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"` } func (entity *Proxy) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub Proxy + type stub Proxy - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*Proxy) GetClass() string { - return ClassProxy + return ClassProxy } func (*Proxy) GetType() string { - return TypeProxy + return TypeProxy } func (proxy *Proxy) UnmarshalJSON(data []byte) error { - 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"` - } + 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"` + } - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } - proxy.Id = tmp.Id - proxy.Server = tmp.Server - proxy.Port = tmp.Port - proxy.LastUsedDate = tmp.LastUsedDate - proxy.IsEnabled = tmp.IsEnabled + proxy.Id = tmp.Id + proxy.Server = tmp.Server + proxy.Port = tmp.Port + proxy.LastUsedDate = tmp.LastUsedDate + proxy.IsEnabled = tmp.IsEnabled - fieldType, _ := UnmarshalProxyType(tmp.Type) - proxy.Type = fieldType + fieldType, _ := UnmarshalProxyType(tmp.Type) + proxy.Type = fieldType - return nil + return nil } // Represents a list of proxy servers type Proxies struct { - meta - // List of proxy servers - Proxies []*Proxy `json:"proxies"` + meta + // List of proxy servers + Proxies []*Proxy `json:"proxies"` } func (entity *Proxies) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub Proxies + type stub Proxies - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*Proxies) GetClass() string { - return ClassProxies + return ClassProxies } func (*Proxies) GetType() string { - return TypeProxies + return TypeProxies } // A sticker to be added to a sticker set type InputSticker struct { - 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 format - Format StickerFormat `json:"format"` - // Position where the mask is placed; pass null if not specified - MaskPosition *MaskPosition `json:"mask_position"` + meta + // File with the sticker; must fit in a 512x512 square. For WEBP stickers the file must be in WEBP or PNG format, which will be converted to WEBP server-side. See https://core.telegram.org/animated_stickers#technical-requirements for technical requirements + Sticker InputFile `json:"sticker"` + // Format of the sticker + Format StickerFormat `json:"format"` + // String with 1-20 emoji corresponding to the sticker + Emojis string `json:"emojis"` + // Position where the mask is placed; pass null if not specified + MaskPosition *MaskPosition `json:"mask_position"` + // List of up to 20 keywords with total length up to 64 characters, which can be used to find the sticker + Keywords []string `json:"keywords"` } func (entity *InputSticker) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub InputSticker + type stub InputSticker - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*InputSticker) GetClass() string { - return ClassInputSticker + return ClassInputSticker } func (*InputSticker) GetType() string { - return TypeInputSticker + return TypeInputSticker } func (inputSticker *InputSticker) UnmarshalJSON(data []byte) error { - var tmp struct { - Sticker json.RawMessage `json:"sticker"` - Emojis string `json:"emojis"` - Format json.RawMessage `json:"format"` - MaskPosition *MaskPosition `json:"mask_position"` - } + var tmp struct { + Sticker json.RawMessage `json:"sticker"` + Format json.RawMessage `json:"format"` + Emojis string `json:"emojis"` + MaskPosition *MaskPosition `json:"mask_position"` + Keywords []string `json:"keywords"` + } - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } - inputSticker.Emojis = tmp.Emojis - inputSticker.MaskPosition = tmp.MaskPosition + inputSticker.Emojis = tmp.Emojis + inputSticker.MaskPosition = tmp.MaskPosition + inputSticker.Keywords = tmp.Keywords - fieldSticker, _ := UnmarshalInputFile(tmp.Sticker) - inputSticker.Sticker = fieldSticker + fieldSticker, _ := UnmarshalInputFile(tmp.Sticker) + inputSticker.Sticker = fieldSticker - fieldFormat, _ := UnmarshalStickerFormat(tmp.Format) - inputSticker.Format = fieldFormat + fieldFormat, _ := UnmarshalStickerFormat(tmp.Format) + inputSticker.Format = fieldFormat - return nil + return nil } // Represents a date range type DateRange struct { - 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"` + 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"` } func (entity *DateRange) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub DateRange + type stub DateRange - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*DateRange) GetClass() string { - return ClassDateRange + return ClassDateRange } func (*DateRange) GetType() string { - return TypeDateRange + return TypeDateRange } // A value with information about its recent changes type StatisticalValue struct { - 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"` + 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"` } func (entity *StatisticalValue) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub StatisticalValue + type stub StatisticalValue - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*StatisticalValue) GetClass() string { - return ClassStatisticalValue + return ClassStatisticalValue } func (*StatisticalValue) GetType() string { - return TypeStatisticalValue + return TypeStatisticalValue } // A graph data type StatisticalGraphData struct { - 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"` + 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"` } func (entity *StatisticalGraphData) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub StatisticalGraphData + type stub StatisticalGraphData - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*StatisticalGraphData) GetClass() string { - return ClassStatisticalGraph + return ClassStatisticalGraph } func (*StatisticalGraphData) GetType() string { - return TypeStatisticalGraphData + return TypeStatisticalGraphData } func (*StatisticalGraphData) StatisticalGraphType() string { - return TypeStatisticalGraphData + return TypeStatisticalGraphData } // The graph data to be asynchronously loaded through getStatisticalGraph type StatisticalGraphAsync struct { - meta - // The token to use for data loading - Token string `json:"token"` + meta + // The token to use for data loading + Token string `json:"token"` } func (entity *StatisticalGraphAsync) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub StatisticalGraphAsync + type stub StatisticalGraphAsync - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*StatisticalGraphAsync) GetClass() string { - return ClassStatisticalGraph + return ClassStatisticalGraph } func (*StatisticalGraphAsync) GetType() string { - return TypeStatisticalGraphAsync + return TypeStatisticalGraphAsync } func (*StatisticalGraphAsync) StatisticalGraphType() string { - return TypeStatisticalGraphAsync + return TypeStatisticalGraphAsync } // An error message to be shown to the user instead of the graph type StatisticalGraphError struct { - meta - // The error message - ErrorMessage string `json:"error_message"` + meta + // The error message + ErrorMessage string `json:"error_message"` } func (entity *StatisticalGraphError) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub StatisticalGraphError + type stub StatisticalGraphError - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*StatisticalGraphError) GetClass() string { - return ClassStatisticalGraph + return ClassStatisticalGraph } func (*StatisticalGraphError) GetType() string { - return TypeStatisticalGraphError + return TypeStatisticalGraphError } func (*StatisticalGraphError) StatisticalGraphType() string { - return TypeStatisticalGraphError + return TypeStatisticalGraphError } -// Contains statistics about interactions with a message -type ChatStatisticsMessageInteractionInfo struct { - 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"` +// Describes a message sent in the chat +type ChatStatisticsObjectTypeMessage struct { + meta + // Message identifier + MessageId int64 `json:"message_id"` } -func (entity *ChatStatisticsMessageInteractionInfo) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() +func (entity *ChatStatisticsObjectTypeMessage) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() - type stub ChatStatisticsMessageInteractionInfo + type stub ChatStatisticsObjectTypeMessage - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } -func (*ChatStatisticsMessageInteractionInfo) GetClass() string { - return ClassChatStatisticsMessageInteractionInfo +func (*ChatStatisticsObjectTypeMessage) GetClass() string { + return ClassChatStatisticsObjectType } -func (*ChatStatisticsMessageInteractionInfo) GetType() string { - return TypeChatStatisticsMessageInteractionInfo +func (*ChatStatisticsObjectTypeMessage) GetType() string { + return TypeChatStatisticsObjectTypeMessage +} + +func (*ChatStatisticsObjectTypeMessage) ChatStatisticsObjectTypeType() string { + return TypeChatStatisticsObjectTypeMessage +} + +// Describes a story sent by the chat +type ChatStatisticsObjectTypeStory struct { + meta + // Story identifier + StoryId int32 `json:"story_id"` +} + +func (entity *ChatStatisticsObjectTypeStory) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatStatisticsObjectTypeStory + + return json.Marshal((*stub)(entity)) +} + +func (*ChatStatisticsObjectTypeStory) GetClass() string { + return ClassChatStatisticsObjectType +} + +func (*ChatStatisticsObjectTypeStory) GetType() string { + return TypeChatStatisticsObjectTypeStory +} + +func (*ChatStatisticsObjectTypeStory) ChatStatisticsObjectTypeType() string { + return TypeChatStatisticsObjectTypeStory +} + +// Contains statistics about interactions with a message sent in the chat or a story sent by the chat +type ChatStatisticsInteractionInfo struct { + meta + // Type of the object + ObjectType ChatStatisticsObjectType `json:"object_type"` + // Number of times the object was viewed + ViewCount int32 `json:"view_count"` + // Number of times the object was forwarded + ForwardCount int32 `json:"forward_count"` + // Number of times reactions were added to the object + ReactionCount int32 `json:"reaction_count"` +} + +func (entity *ChatStatisticsInteractionInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatStatisticsInteractionInfo + + return json.Marshal((*stub)(entity)) +} + +func (*ChatStatisticsInteractionInfo) GetClass() string { + return ClassChatStatisticsInteractionInfo +} + +func (*ChatStatisticsInteractionInfo) GetType() string { + return TypeChatStatisticsInteractionInfo +} + +func (chatStatisticsInteractionInfo *ChatStatisticsInteractionInfo) UnmarshalJSON(data []byte) error { + var tmp struct { + ObjectType json.RawMessage `json:"object_type"` + ViewCount int32 `json:"view_count"` + ForwardCount int32 `json:"forward_count"` + ReactionCount int32 `json:"reaction_count"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + chatStatisticsInteractionInfo.ViewCount = tmp.ViewCount + chatStatisticsInteractionInfo.ForwardCount = tmp.ForwardCount + chatStatisticsInteractionInfo.ReactionCount = tmp.ReactionCount + + fieldObjectType, _ := UnmarshalChatStatisticsObjectType(tmp.ObjectType) + chatStatisticsInteractionInfo.ObjectType = fieldObjectType + + return nil } // Contains statistics about messages sent by a user type ChatStatisticsMessageSenderInfo struct { - 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"` + 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"` } func (entity *ChatStatisticsMessageSenderInfo) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub ChatStatisticsMessageSenderInfo + type stub ChatStatisticsMessageSenderInfo - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*ChatStatisticsMessageSenderInfo) GetClass() string { - return ClassChatStatisticsMessageSenderInfo + return ClassChatStatisticsMessageSenderInfo } func (*ChatStatisticsMessageSenderInfo) GetType() string { - return TypeChatStatisticsMessageSenderInfo + return TypeChatStatisticsMessageSenderInfo } // Contains statistics about administrator actions done by a user type ChatStatisticsAdministratorActionsInfo struct { - 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"` + 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"` } func (entity *ChatStatisticsAdministratorActionsInfo) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub ChatStatisticsAdministratorActionsInfo + type stub ChatStatisticsAdministratorActionsInfo - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*ChatStatisticsAdministratorActionsInfo) GetClass() string { - return ClassChatStatisticsAdministratorActionsInfo + return ClassChatStatisticsAdministratorActionsInfo } func (*ChatStatisticsAdministratorActionsInfo) GetType() string { - return TypeChatStatisticsAdministratorActionsInfo + return TypeChatStatisticsAdministratorActionsInfo } // Contains statistics about number of new members invited by a user type ChatStatisticsInviterInfo struct { - meta - // User identifier - UserId int64 `json:"user_id"` - // Number of new members invited by the user - AddedMemberCount int32 `json:"added_member_count"` + meta + // User identifier + UserId int64 `json:"user_id"` + // Number of new members invited by the user + AddedMemberCount int32 `json:"added_member_count"` } func (entity *ChatStatisticsInviterInfo) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub ChatStatisticsInviterInfo + type stub ChatStatisticsInviterInfo - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*ChatStatisticsInviterInfo) GetClass() string { - return ClassChatStatisticsInviterInfo + return ClassChatStatisticsInviterInfo } func (*ChatStatisticsInviterInfo) GetType() string { - return TypeChatStatisticsInviterInfo + return TypeChatStatisticsInviterInfo } // A detailed statistics about a supergroup chat type ChatStatisticsSupergroup struct { - 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"` + 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"` } func (entity *ChatStatisticsSupergroup) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub ChatStatisticsSupergroup + type stub ChatStatisticsSupergroup - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*ChatStatisticsSupergroup) GetClass() string { - return ClassChatStatistics + return ClassChatStatistics } func (*ChatStatisticsSupergroup) GetType() string { - return TypeChatStatisticsSupergroup + return TypeChatStatisticsSupergroup } func (*ChatStatisticsSupergroup) ChatStatisticsType() string { - return TypeChatStatisticsSupergroup + return TypeChatStatisticsSupergroup } func (chatStatisticsSupergroup *ChatStatisticsSupergroup) UnmarshalJSON(data []byte) error { - 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"` - } + 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 - } + 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 + 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 + fieldMemberCountGraph, _ := UnmarshalStatisticalGraph(tmp.MemberCountGraph) + chatStatisticsSupergroup.MemberCountGraph = fieldMemberCountGraph - fieldJoinGraph, _ := UnmarshalStatisticalGraph(tmp.JoinGraph) - chatStatisticsSupergroup.JoinGraph = fieldJoinGraph + fieldJoinGraph, _ := UnmarshalStatisticalGraph(tmp.JoinGraph) + chatStatisticsSupergroup.JoinGraph = fieldJoinGraph - fieldJoinBySourceGraph, _ := UnmarshalStatisticalGraph(tmp.JoinBySourceGraph) - chatStatisticsSupergroup.JoinBySourceGraph = fieldJoinBySourceGraph + fieldJoinBySourceGraph, _ := UnmarshalStatisticalGraph(tmp.JoinBySourceGraph) + chatStatisticsSupergroup.JoinBySourceGraph = fieldJoinBySourceGraph - fieldLanguageGraph, _ := UnmarshalStatisticalGraph(tmp.LanguageGraph) - chatStatisticsSupergroup.LanguageGraph = fieldLanguageGraph + fieldLanguageGraph, _ := UnmarshalStatisticalGraph(tmp.LanguageGraph) + chatStatisticsSupergroup.LanguageGraph = fieldLanguageGraph - fieldMessageContentGraph, _ := UnmarshalStatisticalGraph(tmp.MessageContentGraph) - chatStatisticsSupergroup.MessageContentGraph = fieldMessageContentGraph + fieldMessageContentGraph, _ := UnmarshalStatisticalGraph(tmp.MessageContentGraph) + chatStatisticsSupergroup.MessageContentGraph = fieldMessageContentGraph - fieldActionGraph, _ := UnmarshalStatisticalGraph(tmp.ActionGraph) - chatStatisticsSupergroup.ActionGraph = fieldActionGraph + fieldActionGraph, _ := UnmarshalStatisticalGraph(tmp.ActionGraph) + chatStatisticsSupergroup.ActionGraph = fieldActionGraph - fieldDayGraph, _ := UnmarshalStatisticalGraph(tmp.DayGraph) - chatStatisticsSupergroup.DayGraph = fieldDayGraph + fieldDayGraph, _ := UnmarshalStatisticalGraph(tmp.DayGraph) + chatStatisticsSupergroup.DayGraph = fieldDayGraph - fieldWeekGraph, _ := UnmarshalStatisticalGraph(tmp.WeekGraph) - chatStatisticsSupergroup.WeekGraph = fieldWeekGraph + fieldWeekGraph, _ := UnmarshalStatisticalGraph(tmp.WeekGraph) + chatStatisticsSupergroup.WeekGraph = fieldWeekGraph - return nil + return nil } // A detailed statistics about a channel chat type ChatStatisticsChannel struct { - 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"` + 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 were viewed + MeanMessageViewCount *StatisticalValue `json:"mean_message_view_count"` + // Mean number of times the recently sent messages were shared + MeanMessageShareCount *StatisticalValue `json:"mean_message_share_count"` + // Mean number of times reactions were added to the recently sent messages + MeanMessageReactionCount *StatisticalValue `json:"mean_message_reaction_count"` + // Mean number of times the recently sent stories were viewed + MeanStoryViewCount *StatisticalValue `json:"mean_story_view_count"` + // Mean number of times the recently sent stories were shared + MeanStoryShareCount *StatisticalValue `json:"mean_story_share_count"` + // Mean number of times reactions were added to the recently sent stories + MeanStoryReactionCount *StatisticalValue `json:"mean_story_reaction_count"` + // A percentage of users with enabled notifications for the chat; 0-100 + 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 reactions on messages + MessageReactionGraph StatisticalGraph `json:"message_reaction_graph"` + // A graph containing number of story views and shares + StoryInteractionGraph StatisticalGraph `json:"story_interaction_graph"` + // A graph containing number of reactions on stories + StoryReactionGraph StatisticalGraph `json:"story_reaction_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 and stories + RecentInteractions []*ChatStatisticsInteractionInfo `json:"recent_interactions"` } func (entity *ChatStatisticsChannel) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub ChatStatisticsChannel + type stub ChatStatisticsChannel - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*ChatStatisticsChannel) GetClass() string { - return ClassChatStatistics + return ClassChatStatistics } func (*ChatStatisticsChannel) GetType() string { - return TypeChatStatisticsChannel + return TypeChatStatisticsChannel } func (*ChatStatisticsChannel) ChatStatisticsType() string { - return TypeChatStatisticsChannel + return TypeChatStatisticsChannel } func (chatStatisticsChannel *ChatStatisticsChannel) UnmarshalJSON(data []byte) error { - 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"` - } + var tmp struct { + Period *DateRange `json:"period"` + MemberCount *StatisticalValue `json:"member_count"` + MeanMessageViewCount *StatisticalValue `json:"mean_message_view_count"` + MeanMessageShareCount *StatisticalValue `json:"mean_message_share_count"` + MeanMessageReactionCount *StatisticalValue `json:"mean_message_reaction_count"` + MeanStoryViewCount *StatisticalValue `json:"mean_story_view_count"` + MeanStoryShareCount *StatisticalValue `json:"mean_story_share_count"` + MeanStoryReactionCount *StatisticalValue `json:"mean_story_reaction_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"` + MessageReactionGraph json.RawMessage `json:"message_reaction_graph"` + StoryInteractionGraph json.RawMessage `json:"story_interaction_graph"` + StoryReactionGraph json.RawMessage `json:"story_reaction_graph"` + InstantViewInteractionGraph json.RawMessage `json:"instant_view_interaction_graph"` + RecentInteractions []*ChatStatisticsInteractionInfo `json:"recent_interactions"` + } - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } + 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 + chatStatisticsChannel.Period = tmp.Period + chatStatisticsChannel.MemberCount = tmp.MemberCount + chatStatisticsChannel.MeanMessageViewCount = tmp.MeanMessageViewCount + chatStatisticsChannel.MeanMessageShareCount = tmp.MeanMessageShareCount + chatStatisticsChannel.MeanMessageReactionCount = tmp.MeanMessageReactionCount + chatStatisticsChannel.MeanStoryViewCount = tmp.MeanStoryViewCount + chatStatisticsChannel.MeanStoryShareCount = tmp.MeanStoryShareCount + chatStatisticsChannel.MeanStoryReactionCount = tmp.MeanStoryReactionCount + chatStatisticsChannel.EnabledNotificationsPercentage = tmp.EnabledNotificationsPercentage + chatStatisticsChannel.RecentInteractions = tmp.RecentInteractions - fieldMemberCountGraph, _ := UnmarshalStatisticalGraph(tmp.MemberCountGraph) - chatStatisticsChannel.MemberCountGraph = fieldMemberCountGraph + fieldMemberCountGraph, _ := UnmarshalStatisticalGraph(tmp.MemberCountGraph) + chatStatisticsChannel.MemberCountGraph = fieldMemberCountGraph - fieldJoinGraph, _ := UnmarshalStatisticalGraph(tmp.JoinGraph) - chatStatisticsChannel.JoinGraph = fieldJoinGraph + fieldJoinGraph, _ := UnmarshalStatisticalGraph(tmp.JoinGraph) + chatStatisticsChannel.JoinGraph = fieldJoinGraph - fieldMuteGraph, _ := UnmarshalStatisticalGraph(tmp.MuteGraph) - chatStatisticsChannel.MuteGraph = fieldMuteGraph + fieldMuteGraph, _ := UnmarshalStatisticalGraph(tmp.MuteGraph) + chatStatisticsChannel.MuteGraph = fieldMuteGraph - fieldViewCountByHourGraph, _ := UnmarshalStatisticalGraph(tmp.ViewCountByHourGraph) - chatStatisticsChannel.ViewCountByHourGraph = fieldViewCountByHourGraph + fieldViewCountByHourGraph, _ := UnmarshalStatisticalGraph(tmp.ViewCountByHourGraph) + chatStatisticsChannel.ViewCountByHourGraph = fieldViewCountByHourGraph - fieldViewCountBySourceGraph, _ := UnmarshalStatisticalGraph(tmp.ViewCountBySourceGraph) - chatStatisticsChannel.ViewCountBySourceGraph = fieldViewCountBySourceGraph + fieldViewCountBySourceGraph, _ := UnmarshalStatisticalGraph(tmp.ViewCountBySourceGraph) + chatStatisticsChannel.ViewCountBySourceGraph = fieldViewCountBySourceGraph - fieldJoinBySourceGraph, _ := UnmarshalStatisticalGraph(tmp.JoinBySourceGraph) - chatStatisticsChannel.JoinBySourceGraph = fieldJoinBySourceGraph + fieldJoinBySourceGraph, _ := UnmarshalStatisticalGraph(tmp.JoinBySourceGraph) + chatStatisticsChannel.JoinBySourceGraph = fieldJoinBySourceGraph - fieldLanguageGraph, _ := UnmarshalStatisticalGraph(tmp.LanguageGraph) - chatStatisticsChannel.LanguageGraph = fieldLanguageGraph + fieldLanguageGraph, _ := UnmarshalStatisticalGraph(tmp.LanguageGraph) + chatStatisticsChannel.LanguageGraph = fieldLanguageGraph - fieldMessageInteractionGraph, _ := UnmarshalStatisticalGraph(tmp.MessageInteractionGraph) - chatStatisticsChannel.MessageInteractionGraph = fieldMessageInteractionGraph + fieldMessageInteractionGraph, _ := UnmarshalStatisticalGraph(tmp.MessageInteractionGraph) + chatStatisticsChannel.MessageInteractionGraph = fieldMessageInteractionGraph - fieldInstantViewInteractionGraph, _ := UnmarshalStatisticalGraph(tmp.InstantViewInteractionGraph) - chatStatisticsChannel.InstantViewInteractionGraph = fieldInstantViewInteractionGraph + fieldMessageReactionGraph, _ := UnmarshalStatisticalGraph(tmp.MessageReactionGraph) + chatStatisticsChannel.MessageReactionGraph = fieldMessageReactionGraph - return nil + fieldStoryInteractionGraph, _ := UnmarshalStatisticalGraph(tmp.StoryInteractionGraph) + chatStatisticsChannel.StoryInteractionGraph = fieldStoryInteractionGraph + + fieldStoryReactionGraph, _ := UnmarshalStatisticalGraph(tmp.StoryReactionGraph) + chatStatisticsChannel.StoryReactionGraph = fieldStoryReactionGraph + + fieldInstantViewInteractionGraph, _ := UnmarshalStatisticalGraph(tmp.InstantViewInteractionGraph) + chatStatisticsChannel.InstantViewInteractionGraph = fieldInstantViewInteractionGraph + + return nil } // A detailed statistics about a message type MessageStatistics struct { - meta - // A graph containing number of message views and shares - MessageInteractionGraph StatisticalGraph `json:"message_interaction_graph"` + meta + // A graph containing number of message views and shares + MessageInteractionGraph StatisticalGraph `json:"message_interaction_graph"` + // A graph containing number of message reactions + MessageReactionGraph StatisticalGraph `json:"message_reaction_graph"` } func (entity *MessageStatistics) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub MessageStatistics + type stub MessageStatistics - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*MessageStatistics) GetClass() string { - return ClassMessageStatistics + return ClassMessageStatistics } func (*MessageStatistics) GetType() string { - return TypeMessageStatistics + return TypeMessageStatistics } func (messageStatistics *MessageStatistics) UnmarshalJSON(data []byte) error { - var tmp struct { - MessageInteractionGraph json.RawMessage `json:"message_interaction_graph"` - } + var tmp struct { + MessageInteractionGraph json.RawMessage `json:"message_interaction_graph"` + MessageReactionGraph json.RawMessage `json:"message_reaction_graph"` + } - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } - fieldMessageInteractionGraph, _ := UnmarshalStatisticalGraph(tmp.MessageInteractionGraph) - messageStatistics.MessageInteractionGraph = fieldMessageInteractionGraph + fieldMessageInteractionGraph, _ := UnmarshalStatisticalGraph(tmp.MessageInteractionGraph) + messageStatistics.MessageInteractionGraph = fieldMessageInteractionGraph - return nil + fieldMessageReactionGraph, _ := UnmarshalStatisticalGraph(tmp.MessageReactionGraph) + messageStatistics.MessageReactionGraph = fieldMessageReactionGraph + + return nil +} + +// A detailed statistics about a story +type StoryStatistics struct { + meta + // A graph containing number of story views and shares + StoryInteractionGraph StatisticalGraph `json:"story_interaction_graph"` + // A graph containing number of story reactions + StoryReactionGraph StatisticalGraph `json:"story_reaction_graph"` +} + +func (entity *StoryStatistics) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryStatistics + + return json.Marshal((*stub)(entity)) +} + +func (*StoryStatistics) GetClass() string { + return ClassStoryStatistics +} + +func (*StoryStatistics) GetType() string { + return TypeStoryStatistics +} + +func (storyStatistics *StoryStatistics) UnmarshalJSON(data []byte) error { + var tmp struct { + StoryInteractionGraph json.RawMessage `json:"story_interaction_graph"` + StoryReactionGraph json.RawMessage `json:"story_reaction_graph"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldStoryInteractionGraph, _ := UnmarshalStatisticalGraph(tmp.StoryInteractionGraph) + storyStatistics.StoryInteractionGraph = fieldStoryInteractionGraph + + fieldStoryReactionGraph, _ := UnmarshalStatisticalGraph(tmp.StoryReactionGraph) + storyStatistics.StoryReactionGraph = fieldStoryReactionGraph + + return nil } // A point on a Cartesian plane type Point struct { - meta - // The point's first coordinate - X float64 `json:"x"` - // The point's second coordinate - Y float64 `json:"y"` + meta + // The point's first coordinate + X float64 `json:"x"` + // The point's second coordinate + Y float64 `json:"y"` } func (entity *Point) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub Point + type stub Point - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*Point) GetClass() string { - return ClassPoint + return ClassPoint } func (*Point) GetType() string { - return TypePoint + return TypePoint } // A straight line to a given point type VectorPathCommandLine struct { - meta - // The end point of the straight line - EndPoint *Point `json:"end_point"` + meta + // The end point of the straight line + EndPoint *Point `json:"end_point"` } func (entity *VectorPathCommandLine) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub VectorPathCommandLine + type stub VectorPathCommandLine - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*VectorPathCommandLine) GetClass() string { - return ClassVectorPathCommand + return ClassVectorPathCommand } func (*VectorPathCommandLine) GetType() string { - return TypeVectorPathCommandLine + return TypeVectorPathCommandLine } func (*VectorPathCommandLine) VectorPathCommandType() string { - return TypeVectorPathCommandLine + return TypeVectorPathCommandLine } // A cubic Bézier curve to a given point type VectorPathCommandCubicBezierCurve struct { - 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"` + 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"` } func (entity *VectorPathCommandCubicBezierCurve) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub VectorPathCommandCubicBezierCurve + type stub VectorPathCommandCubicBezierCurve - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*VectorPathCommandCubicBezierCurve) GetClass() string { - return ClassVectorPathCommand + return ClassVectorPathCommand } func (*VectorPathCommandCubicBezierCurve) GetType() string { - return TypeVectorPathCommandCubicBezierCurve + return TypeVectorPathCommandCubicBezierCurve } func (*VectorPathCommandCubicBezierCurve) VectorPathCommandType() string { - return TypeVectorPathCommandCubicBezierCurve + return TypeVectorPathCommandCubicBezierCurve } // A scope covering all users -type BotCommandScopeDefault struct { - meta +type BotCommandScopeDefault struct{ + meta } func (entity *BotCommandScopeDefault) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub BotCommandScopeDefault + type stub BotCommandScopeDefault - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*BotCommandScopeDefault) GetClass() string { - return ClassBotCommandScope + return ClassBotCommandScope } func (*BotCommandScopeDefault) GetType() string { - return TypeBotCommandScopeDefault + return TypeBotCommandScopeDefault } func (*BotCommandScopeDefault) BotCommandScopeType() string { - return TypeBotCommandScopeDefault + return TypeBotCommandScopeDefault } // A scope covering all private chats -type BotCommandScopeAllPrivateChats struct { - meta +type BotCommandScopeAllPrivateChats struct{ + meta } func (entity *BotCommandScopeAllPrivateChats) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub BotCommandScopeAllPrivateChats + type stub BotCommandScopeAllPrivateChats - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*BotCommandScopeAllPrivateChats) GetClass() string { - return ClassBotCommandScope + return ClassBotCommandScope } func (*BotCommandScopeAllPrivateChats) GetType() string { - return TypeBotCommandScopeAllPrivateChats + return TypeBotCommandScopeAllPrivateChats } func (*BotCommandScopeAllPrivateChats) BotCommandScopeType() string { - return TypeBotCommandScopeAllPrivateChats + return TypeBotCommandScopeAllPrivateChats } // A scope covering all group and supergroup chats -type BotCommandScopeAllGroupChats struct { - meta +type BotCommandScopeAllGroupChats struct{ + meta } func (entity *BotCommandScopeAllGroupChats) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub BotCommandScopeAllGroupChats + type stub BotCommandScopeAllGroupChats - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*BotCommandScopeAllGroupChats) GetClass() string { - return ClassBotCommandScope + return ClassBotCommandScope } func (*BotCommandScopeAllGroupChats) GetType() string { - return TypeBotCommandScopeAllGroupChats + return TypeBotCommandScopeAllGroupChats } func (*BotCommandScopeAllGroupChats) BotCommandScopeType() string { - return TypeBotCommandScopeAllGroupChats + return TypeBotCommandScopeAllGroupChats } // A scope covering all group and supergroup chat administrators -type BotCommandScopeAllChatAdministrators struct { - meta +type BotCommandScopeAllChatAdministrators struct{ + meta } func (entity *BotCommandScopeAllChatAdministrators) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub BotCommandScopeAllChatAdministrators + type stub BotCommandScopeAllChatAdministrators - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*BotCommandScopeAllChatAdministrators) GetClass() string { - return ClassBotCommandScope + return ClassBotCommandScope } func (*BotCommandScopeAllChatAdministrators) GetType() string { - return TypeBotCommandScopeAllChatAdministrators + return TypeBotCommandScopeAllChatAdministrators } func (*BotCommandScopeAllChatAdministrators) BotCommandScopeType() string { - return TypeBotCommandScopeAllChatAdministrators + return TypeBotCommandScopeAllChatAdministrators } // A scope covering all members of a chat type BotCommandScopeChat struct { - meta - // Chat identifier - ChatId int64 `json:"chat_id"` + meta + // Chat identifier + ChatId int64 `json:"chat_id"` } func (entity *BotCommandScopeChat) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub BotCommandScopeChat + type stub BotCommandScopeChat - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*BotCommandScopeChat) GetClass() string { - return ClassBotCommandScope + return ClassBotCommandScope } func (*BotCommandScopeChat) GetType() string { - return TypeBotCommandScopeChat + return TypeBotCommandScopeChat } func (*BotCommandScopeChat) BotCommandScopeType() string { - return TypeBotCommandScopeChat + return TypeBotCommandScopeChat } // A scope covering all administrators of a chat type BotCommandScopeChatAdministrators struct { - meta - // Chat identifier - ChatId int64 `json:"chat_id"` + meta + // Chat identifier + ChatId int64 `json:"chat_id"` } func (entity *BotCommandScopeChatAdministrators) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub BotCommandScopeChatAdministrators + type stub BotCommandScopeChatAdministrators - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*BotCommandScopeChatAdministrators) GetClass() string { - return ClassBotCommandScope + return ClassBotCommandScope } func (*BotCommandScopeChatAdministrators) GetType() string { - return TypeBotCommandScopeChatAdministrators + return TypeBotCommandScopeChatAdministrators } func (*BotCommandScopeChatAdministrators) BotCommandScopeType() string { - return TypeBotCommandScopeChatAdministrators + return TypeBotCommandScopeChatAdministrators } // A scope covering a member of a chat type BotCommandScopeChatMember struct { - meta - // Chat identifier - ChatId int64 `json:"chat_id"` - // User identifier - UserId int64 `json:"user_id"` + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // User identifier + UserId int64 `json:"user_id"` } func (entity *BotCommandScopeChatMember) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub BotCommandScopeChatMember + type stub BotCommandScopeChatMember - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*BotCommandScopeChatMember) GetClass() string { - return ClassBotCommandScope + return ClassBotCommandScope } func (*BotCommandScopeChatMember) GetType() string { - return TypeBotCommandScopeChatMember + return TypeBotCommandScopeChatMember } func (*BotCommandScopeChatMember) BotCommandScopeType() string { - return TypeBotCommandScopeChatMember + return TypeBotCommandScopeChatMember } // The user authorization state has changed type UpdateAuthorizationState struct { - meta - // New authorization state - AuthorizationState AuthorizationState `json:"authorization_state"` + meta + // New authorization state + AuthorizationState AuthorizationState `json:"authorization_state"` } func (entity *UpdateAuthorizationState) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateAuthorizationState + type stub UpdateAuthorizationState - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateAuthorizationState) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateAuthorizationState) GetType() string { - return TypeUpdateAuthorizationState + return TypeUpdateAuthorizationState } func (*UpdateAuthorizationState) UpdateType() string { - return TypeUpdateAuthorizationState + return TypeUpdateAuthorizationState } func (updateAuthorizationState *UpdateAuthorizationState) UnmarshalJSON(data []byte) error { - var tmp struct { - AuthorizationState json.RawMessage `json:"authorization_state"` - } + var tmp struct { + AuthorizationState json.RawMessage `json:"authorization_state"` + } - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } - fieldAuthorizationState, _ := UnmarshalAuthorizationState(tmp.AuthorizationState) - updateAuthorizationState.AuthorizationState = fieldAuthorizationState + fieldAuthorizationState, _ := UnmarshalAuthorizationState(tmp.AuthorizationState) + updateAuthorizationState.AuthorizationState = fieldAuthorizationState - return nil + return nil } // A new message was received; can also be an outgoing message type UpdateNewMessage struct { - meta - // The new message - Message *Message `json:"message"` + meta + // The new message + Message *Message `json:"message"` } func (entity *UpdateNewMessage) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateNewMessage + type stub UpdateNewMessage - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateNewMessage) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateNewMessage) GetType() string { - return TypeUpdateNewMessage + return TypeUpdateNewMessage } func (*UpdateNewMessage) UpdateType() string { - return TypeUpdateNewMessage + return TypeUpdateNewMessage } -// 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 +// A request to send a message has reached the Telegram server. This doesn't mean that the message will be sent successfully. This update is 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 { - meta - // The chat identifier of the sent message - ChatId int64 `json:"chat_id"` - // A temporary message identifier - MessageId int64 `json:"message_id"` + meta + // The chat identifier of the sent message + ChatId int64 `json:"chat_id"` + // A temporary message identifier + MessageId int64 `json:"message_id"` } func (entity *UpdateMessageSendAcknowledged) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateMessageSendAcknowledged + type stub UpdateMessageSendAcknowledged - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateMessageSendAcknowledged) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateMessageSendAcknowledged) GetType() string { - return TypeUpdateMessageSendAcknowledged + return TypeUpdateMessageSendAcknowledged } func (*UpdateMessageSendAcknowledged) UpdateType() string { - return TypeUpdateMessageSendAcknowledged + return TypeUpdateMessageSendAcknowledged } // A message has been successfully sent type UpdateMessageSendSucceeded struct { - 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"` + 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"` } func (entity *UpdateMessageSendSucceeded) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateMessageSendSucceeded + type stub UpdateMessageSendSucceeded - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateMessageSendSucceeded) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateMessageSendSucceeded) GetType() string { - return TypeUpdateMessageSendSucceeded + return TypeUpdateMessageSendSucceeded } func (*UpdateMessageSendSucceeded) UpdateType() string { - return TypeUpdateMessageSendSucceeded + return TypeUpdateMessageSendSucceeded } // 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 { - 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"` + meta + // The failed to send message + Message *Message `json:"message"` + // The previous temporary message identifier + OldMessageId int64 `json:"old_message_id"` + // The cause of the message sending failure + Error *Error `json:"error"` } func (entity *UpdateMessageSendFailed) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateMessageSendFailed + type stub UpdateMessageSendFailed - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateMessageSendFailed) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateMessageSendFailed) GetType() string { - return TypeUpdateMessageSendFailed + return TypeUpdateMessageSendFailed } func (*UpdateMessageSendFailed) UpdateType() string { - return TypeUpdateMessageSendFailed + return TypeUpdateMessageSendFailed } // The message content has changed type UpdateMessageContent struct { - meta - // Chat identifier - ChatId int64 `json:"chat_id"` - // Message identifier - MessageId int64 `json:"message_id"` - // New message content - NewContent MessageContent `json:"new_content"` + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // Message identifier + MessageId int64 `json:"message_id"` + // New message content + NewContent MessageContent `json:"new_content"` } func (entity *UpdateMessageContent) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateMessageContent + type stub UpdateMessageContent - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateMessageContent) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateMessageContent) GetType() string { - return TypeUpdateMessageContent + return TypeUpdateMessageContent } func (*UpdateMessageContent) UpdateType() string { - return TypeUpdateMessageContent + return TypeUpdateMessageContent } func (updateMessageContent *UpdateMessageContent) UnmarshalJSON(data []byte) error { - var tmp struct { - ChatId int64 `json:"chat_id"` - MessageId int64 `json:"message_id"` - NewContent json.RawMessage `json:"new_content"` - } + var tmp struct { + ChatId int64 `json:"chat_id"` + MessageId int64 `json:"message_id"` + NewContent json.RawMessage `json:"new_content"` + } - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } - updateMessageContent.ChatId = tmp.ChatId - updateMessageContent.MessageId = tmp.MessageId + updateMessageContent.ChatId = tmp.ChatId + updateMessageContent.MessageId = tmp.MessageId - fieldNewContent, _ := UnmarshalMessageContent(tmp.NewContent) - updateMessageContent.NewContent = fieldNewContent + fieldNewContent, _ := UnmarshalMessageContent(tmp.NewContent) + updateMessageContent.NewContent = fieldNewContent - return nil + return nil } // A message was edited. Changes in the message content will come in a separate updateMessageContent type UpdateMessageEdited struct { - 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"` + 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"` } func (entity *UpdateMessageEdited) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateMessageEdited + type stub UpdateMessageEdited - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateMessageEdited) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateMessageEdited) GetType() string { - return TypeUpdateMessageEdited + return TypeUpdateMessageEdited } func (*UpdateMessageEdited) UpdateType() string { - return TypeUpdateMessageEdited + return TypeUpdateMessageEdited } func (updateMessageEdited *UpdateMessageEdited) UnmarshalJSON(data []byte) error { - var tmp struct { - ChatId int64 `json:"chat_id"` - MessageId int64 `json:"message_id"` - EditDate int32 `json:"edit_date"` - ReplyMarkup json.RawMessage `json:"reply_markup"` - } + var tmp struct { + ChatId int64 `json:"chat_id"` + MessageId int64 `json:"message_id"` + EditDate int32 `json:"edit_date"` + ReplyMarkup json.RawMessage `json:"reply_markup"` + } - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } - updateMessageEdited.ChatId = tmp.ChatId - updateMessageEdited.MessageId = tmp.MessageId - updateMessageEdited.EditDate = tmp.EditDate + updateMessageEdited.ChatId = tmp.ChatId + updateMessageEdited.MessageId = tmp.MessageId + updateMessageEdited.EditDate = tmp.EditDate - fieldReplyMarkup, _ := UnmarshalReplyMarkup(tmp.ReplyMarkup) - updateMessageEdited.ReplyMarkup = fieldReplyMarkup + fieldReplyMarkup, _ := UnmarshalReplyMarkup(tmp.ReplyMarkup) + updateMessageEdited.ReplyMarkup = fieldReplyMarkup - return nil + return nil } // The message pinned state was changed type UpdateMessageIsPinned struct { - 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"` + 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"` } func (entity *UpdateMessageIsPinned) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateMessageIsPinned + type stub UpdateMessageIsPinned - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateMessageIsPinned) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateMessageIsPinned) GetType() string { - return TypeUpdateMessageIsPinned + return TypeUpdateMessageIsPinned } func (*UpdateMessageIsPinned) UpdateType() string { - return TypeUpdateMessageIsPinned + return TypeUpdateMessageIsPinned } // The information about interactions with a message has changed type UpdateMessageInteractionInfo struct { - 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"` + 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"` } func (entity *UpdateMessageInteractionInfo) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateMessageInteractionInfo + type stub UpdateMessageInteractionInfo - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateMessageInteractionInfo) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateMessageInteractionInfo) GetType() string { - return TypeUpdateMessageInteractionInfo + return TypeUpdateMessageInteractionInfo } func (*UpdateMessageInteractionInfo) UpdateType() string { - return TypeUpdateMessageInteractionInfo + return TypeUpdateMessageInteractionInfo } // The message content was opened. Updates voice note messages to "listened", video note messages to "viewed" and starts the self-destruct timer type UpdateMessageContentOpened struct { - meta - // Chat identifier - ChatId int64 `json:"chat_id"` - // Message identifier - MessageId int64 `json:"message_id"` + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // Message identifier + MessageId int64 `json:"message_id"` } func (entity *UpdateMessageContentOpened) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateMessageContentOpened + type stub UpdateMessageContentOpened - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateMessageContentOpened) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateMessageContentOpened) GetType() string { - return TypeUpdateMessageContentOpened + return TypeUpdateMessageContentOpened } func (*UpdateMessageContentOpened) UpdateType() string { - return TypeUpdateMessageContentOpened + return TypeUpdateMessageContentOpened } // A message with an unread mention was read type UpdateMessageMentionRead struct { - 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"` + 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"` } func (entity *UpdateMessageMentionRead) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateMessageMentionRead + type stub UpdateMessageMentionRead - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateMessageMentionRead) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateMessageMentionRead) GetType() string { - return TypeUpdateMessageMentionRead + return TypeUpdateMessageMentionRead } func (*UpdateMessageMentionRead) UpdateType() string { - return TypeUpdateMessageMentionRead + return TypeUpdateMessageMentionRead } // The list of unread reactions added to a message was changed type UpdateMessageUnreadReactions struct { - 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"` + 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"` } func (entity *UpdateMessageUnreadReactions) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateMessageUnreadReactions + type stub UpdateMessageUnreadReactions - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateMessageUnreadReactions) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateMessageUnreadReactions) GetType() string { - return TypeUpdateMessageUnreadReactions + return TypeUpdateMessageUnreadReactions } func (*UpdateMessageUnreadReactions) UpdateType() string { - return TypeUpdateMessageUnreadReactions + return TypeUpdateMessageUnreadReactions } // A message with a live location was viewed. When the update is received, the application is supposed to update the live location type UpdateMessageLiveLocationViewed struct { - 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"` + 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"` } func (entity *UpdateMessageLiveLocationViewed) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateMessageLiveLocationViewed + type stub UpdateMessageLiveLocationViewed - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateMessageLiveLocationViewed) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateMessageLiveLocationViewed) GetType() string { - return TypeUpdateMessageLiveLocationViewed + return TypeUpdateMessageLiveLocationViewed } func (*UpdateMessageLiveLocationViewed) UpdateType() string { - return TypeUpdateMessageLiveLocationViewed + return TypeUpdateMessageLiveLocationViewed } // 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 type UpdateNewChat struct { - meta - // The chat - Chat *Chat `json:"chat"` + meta + // The chat + Chat *Chat `json:"chat"` } func (entity *UpdateNewChat) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateNewChat + type stub UpdateNewChat - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateNewChat) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateNewChat) GetType() string { - return TypeUpdateNewChat + return TypeUpdateNewChat } func (*UpdateNewChat) UpdateType() string { - return TypeUpdateNewChat + return TypeUpdateNewChat } // The title of a chat was changed type UpdateChatTitle struct { - meta - // Chat identifier - ChatId int64 `json:"chat_id"` - // The new chat title - Title string `json:"title"` + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // The new chat title + Title string `json:"title"` } func (entity *UpdateChatTitle) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateChatTitle + type stub UpdateChatTitle - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateChatTitle) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateChatTitle) GetType() string { - return TypeUpdateChatTitle + return TypeUpdateChatTitle } func (*UpdateChatTitle) UpdateType() string { - return TypeUpdateChatTitle + return TypeUpdateChatTitle } // A chat photo was changed type UpdateChatPhoto struct { - meta - // Chat identifier - ChatId int64 `json:"chat_id"` - // The new chat photo; may be null - Photo *ChatPhotoInfo `json:"photo"` + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // The new chat photo; may be null + Photo *ChatPhotoInfo `json:"photo"` } func (entity *UpdateChatPhoto) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateChatPhoto + type stub UpdateChatPhoto - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateChatPhoto) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateChatPhoto) GetType() string { - return TypeUpdateChatPhoto + return TypeUpdateChatPhoto } func (*UpdateChatPhoto) UpdateType() string { - return TypeUpdateChatPhoto + return TypeUpdateChatPhoto } -// Chat permissions was changed +// Chat accent colors have changed +type UpdateChatAccentColors struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // The new chat accent color identifier + AccentColorId int32 `json:"accent_color_id"` + // The new identifier of a custom emoji to be shown on the reply header and link preview background; 0 if none + BackgroundCustomEmojiId JsonInt64 `json:"background_custom_emoji_id"` + // The new chat profile accent color identifier; -1 if none + ProfileAccentColorId int32 `json:"profile_accent_color_id"` + // The new identifier of a custom emoji to be shown on the profile background; 0 if none + ProfileBackgroundCustomEmojiId JsonInt64 `json:"profile_background_custom_emoji_id"` +} + +func (entity *UpdateChatAccentColors) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateChatAccentColors + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateChatAccentColors) GetClass() string { + return ClassUpdate +} + +func (*UpdateChatAccentColors) GetType() string { + return TypeUpdateChatAccentColors +} + +func (*UpdateChatAccentColors) UpdateType() string { + return TypeUpdateChatAccentColors +} + +// Chat permissions were changed type UpdateChatPermissions struct { - meta - // Chat identifier - ChatId int64 `json:"chat_id"` - // The new chat permissions - Permissions *ChatPermissions `json:"permissions"` + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // The new chat permissions + Permissions *ChatPermissions `json:"permissions"` } func (entity *UpdateChatPermissions) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateChatPermissions + type stub UpdateChatPermissions - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateChatPermissions) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateChatPermissions) GetType() string { - return TypeUpdateChatPermissions + return TypeUpdateChatPermissions } func (*UpdateChatPermissions) UpdateType() string { - return TypeUpdateChatPermissions + return TypeUpdateChatPermissions } -// 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 +// The last message of a chat was changed type UpdateChatLastMessage struct { - 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"` + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // The new last message in the chat; may be null if the last message became unknown. While the last message is unknown, new messages can be added to the chat without corresponding updateNewMessage update + LastMessage *Message `json:"last_message"` + // The new chat positions in the chat lists + Positions []*ChatPosition `json:"positions"` } func (entity *UpdateChatLastMessage) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateChatLastMessage + type stub UpdateChatLastMessage - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateChatLastMessage) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateChatLastMessage) GetType() string { - return TypeUpdateChatLastMessage + return TypeUpdateChatLastMessage } func (*UpdateChatLastMessage) UpdateType() string { - return TypeUpdateChatLastMessage + return TypeUpdateChatLastMessage } -// The position of a chat in a chat list has changed. Instead of this update updateChatLastMessage or updateChatDraftMessage might be sent +// The position of a chat in a chat list has changed. An updateChatLastMessage or updateChatDraftMessage update might be sent instead of the update type UpdateChatPosition struct { - 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"` + 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"` } func (entity *UpdateChatPosition) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateChatPosition + type stub UpdateChatPosition - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateChatPosition) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateChatPosition) GetType() string { - return TypeUpdateChatPosition + return TypeUpdateChatPosition } func (*UpdateChatPosition) UpdateType() string { - return TypeUpdateChatPosition + return TypeUpdateChatPosition +} + +// A chat was added to a chat list +type UpdateChatAddedToList struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // The chat list to which the chat was added + ChatList ChatList `json:"chat_list"` +} + +func (entity *UpdateChatAddedToList) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateChatAddedToList + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateChatAddedToList) GetClass() string { + return ClassUpdate +} + +func (*UpdateChatAddedToList) GetType() string { + return TypeUpdateChatAddedToList +} + +func (*UpdateChatAddedToList) UpdateType() string { + return TypeUpdateChatAddedToList +} + +func (updateChatAddedToList *UpdateChatAddedToList) UnmarshalJSON(data []byte) error { + var tmp struct { + ChatId int64 `json:"chat_id"` + ChatList json.RawMessage `json:"chat_list"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + updateChatAddedToList.ChatId = tmp.ChatId + + fieldChatList, _ := UnmarshalChatList(tmp.ChatList) + updateChatAddedToList.ChatList = fieldChatList + + return nil +} + +// A chat was removed from a chat list +type UpdateChatRemovedFromList struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // The chat list from which the chat was removed + ChatList ChatList `json:"chat_list"` +} + +func (entity *UpdateChatRemovedFromList) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateChatRemovedFromList + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateChatRemovedFromList) GetClass() string { + return ClassUpdate +} + +func (*UpdateChatRemovedFromList) GetType() string { + return TypeUpdateChatRemovedFromList +} + +func (*UpdateChatRemovedFromList) UpdateType() string { + return TypeUpdateChatRemovedFromList +} + +func (updateChatRemovedFromList *UpdateChatRemovedFromList) UnmarshalJSON(data []byte) error { + var tmp struct { + ChatId int64 `json:"chat_id"` + ChatList json.RawMessage `json:"chat_list"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + updateChatRemovedFromList.ChatId = tmp.ChatId + + fieldChatList, _ := UnmarshalChatList(tmp.ChatList) + updateChatRemovedFromList.ChatList = fieldChatList + + return nil } // Incoming messages were read or the number of unread messages has been changed type UpdateChatReadInbox struct { - 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"` + 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"` } func (entity *UpdateChatReadInbox) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateChatReadInbox + type stub UpdateChatReadInbox - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateChatReadInbox) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateChatReadInbox) GetType() string { - return TypeUpdateChatReadInbox + return TypeUpdateChatReadInbox } func (*UpdateChatReadInbox) UpdateType() string { - return TypeUpdateChatReadInbox + return TypeUpdateChatReadInbox } // Outgoing messages were read type UpdateChatReadOutbox struct { - meta - // Chat identifier - ChatId int64 `json:"chat_id"` - // Identifier of last read outgoing message - LastReadOutboxMessageId int64 `json:"last_read_outbox_message_id"` + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // Identifier of last read outgoing message + LastReadOutboxMessageId int64 `json:"last_read_outbox_message_id"` } func (entity *UpdateChatReadOutbox) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateChatReadOutbox + type stub UpdateChatReadOutbox - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateChatReadOutbox) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateChatReadOutbox) GetType() string { - return TypeUpdateChatReadOutbox + return TypeUpdateChatReadOutbox } func (*UpdateChatReadOutbox) UpdateType() string { - return TypeUpdateChatReadOutbox + return TypeUpdateChatReadOutbox } // The chat action bar was changed type UpdateChatActionBar struct { - meta - // Chat identifier - ChatId int64 `json:"chat_id"` - // The new value of the action bar; may be null - ActionBar ChatActionBar `json:"action_bar"` + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // The new value of the action bar; may be null + ActionBar ChatActionBar `json:"action_bar"` } func (entity *UpdateChatActionBar) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateChatActionBar + type stub UpdateChatActionBar - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateChatActionBar) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateChatActionBar) GetType() string { - return TypeUpdateChatActionBar + return TypeUpdateChatActionBar } func (*UpdateChatActionBar) UpdateType() string { - return TypeUpdateChatActionBar + return TypeUpdateChatActionBar } func (updateChatActionBar *UpdateChatActionBar) UnmarshalJSON(data []byte) error { - var tmp struct { - ChatId int64 `json:"chat_id"` - ActionBar json.RawMessage `json:"action_bar"` - } + var tmp struct { + ChatId int64 `json:"chat_id"` + ActionBar json.RawMessage `json:"action_bar"` + } - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } - updateChatActionBar.ChatId = tmp.ChatId + updateChatActionBar.ChatId = tmp.ChatId - fieldActionBar, _ := UnmarshalChatActionBar(tmp.ActionBar) - updateChatActionBar.ActionBar = fieldActionBar + fieldActionBar, _ := UnmarshalChatActionBar(tmp.ActionBar) + updateChatActionBar.ActionBar = fieldActionBar - return nil + return nil } // The chat available reactions were changed type UpdateChatAvailableReactions struct { - meta - // Chat identifier - ChatId int64 `json:"chat_id"` - // The new reactions, available in the chat - AvailableReactions ChatAvailableReactions `json:"available_reactions"` + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // The new reactions, available in the chat + AvailableReactions ChatAvailableReactions `json:"available_reactions"` } func (entity *UpdateChatAvailableReactions) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateChatAvailableReactions + type stub UpdateChatAvailableReactions - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateChatAvailableReactions) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateChatAvailableReactions) GetType() string { - return TypeUpdateChatAvailableReactions + return TypeUpdateChatAvailableReactions } func (*UpdateChatAvailableReactions) UpdateType() string { - return TypeUpdateChatAvailableReactions + return TypeUpdateChatAvailableReactions } func (updateChatAvailableReactions *UpdateChatAvailableReactions) UnmarshalJSON(data []byte) error { - var tmp struct { - ChatId int64 `json:"chat_id"` - AvailableReactions json.RawMessage `json:"available_reactions"` - } + var tmp struct { + ChatId int64 `json:"chat_id"` + AvailableReactions json.RawMessage `json:"available_reactions"` + } - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } - updateChatAvailableReactions.ChatId = tmp.ChatId + updateChatAvailableReactions.ChatId = tmp.ChatId - fieldAvailableReactions, _ := UnmarshalChatAvailableReactions(tmp.AvailableReactions) - updateChatAvailableReactions.AvailableReactions = fieldAvailableReactions + fieldAvailableReactions, _ := UnmarshalChatAvailableReactions(tmp.AvailableReactions) + updateChatAvailableReactions.AvailableReactions = fieldAvailableReactions - return nil + return nil } // 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 { - 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"` + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // The new draft message; may be null if none + DraftMessage *DraftMessage `json:"draft_message"` + // The new chat positions in the chat lists + Positions []*ChatPosition `json:"positions"` } func (entity *UpdateChatDraftMessage) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateChatDraftMessage + type stub UpdateChatDraftMessage - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateChatDraftMessage) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateChatDraftMessage) GetType() string { - return TypeUpdateChatDraftMessage + return TypeUpdateChatDraftMessage } func (*UpdateChatDraftMessage) UpdateType() string { - return TypeUpdateChatDraftMessage + return TypeUpdateChatDraftMessage +} + +// Chat emoji status has changed +type UpdateChatEmojiStatus struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // The new chat emoji status; may be null + EmojiStatus *EmojiStatus `json:"emoji_status"` +} + +func (entity *UpdateChatEmojiStatus) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateChatEmojiStatus + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateChatEmojiStatus) GetClass() string { + return ClassUpdate +} + +func (*UpdateChatEmojiStatus) GetType() string { + return TypeUpdateChatEmojiStatus +} + +func (*UpdateChatEmojiStatus) UpdateType() string { + return TypeUpdateChatEmojiStatus } // The message sender that is selected to send messages in a chat has changed type UpdateChatMessageSender struct { - 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"` + 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"` } func (entity *UpdateChatMessageSender) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateChatMessageSender + type stub UpdateChatMessageSender - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateChatMessageSender) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateChatMessageSender) GetType() string { - return TypeUpdateChatMessageSender + return TypeUpdateChatMessageSender } func (*UpdateChatMessageSender) UpdateType() string { - return TypeUpdateChatMessageSender + return TypeUpdateChatMessageSender } func (updateChatMessageSender *UpdateChatMessageSender) UnmarshalJSON(data []byte) error { - var tmp struct { - ChatId int64 `json:"chat_id"` - MessageSenderId json.RawMessage `json:"message_sender_id"` - } + var tmp struct { + ChatId int64 `json:"chat_id"` + MessageSenderId json.RawMessage `json:"message_sender_id"` + } - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } - updateChatMessageSender.ChatId = tmp.ChatId + updateChatMessageSender.ChatId = tmp.ChatId - fieldMessageSenderId, _ := UnmarshalMessageSender(tmp.MessageSenderId) - updateChatMessageSender.MessageSenderId = fieldMessageSenderId + fieldMessageSenderId, _ := UnmarshalMessageSender(tmp.MessageSenderId) + updateChatMessageSender.MessageSenderId = fieldMessageSenderId - return nil + return nil } // The message auto-delete or self-destruct timer setting for a chat was changed type UpdateChatMessageAutoDeleteTime struct { - meta - // Chat identifier - ChatId int64 `json:"chat_id"` - // New value of message_auto_delete_time - MessageAutoDeleteTime int32 `json:"message_auto_delete_time"` + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // New value of message_auto_delete_time + MessageAutoDeleteTime int32 `json:"message_auto_delete_time"` } func (entity *UpdateChatMessageAutoDeleteTime) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateChatMessageAutoDeleteTime + type stub UpdateChatMessageAutoDeleteTime - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateChatMessageAutoDeleteTime) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateChatMessageAutoDeleteTime) GetType() string { - return TypeUpdateChatMessageAutoDeleteTime + return TypeUpdateChatMessageAutoDeleteTime } func (*UpdateChatMessageAutoDeleteTime) UpdateType() string { - return TypeUpdateChatMessageAutoDeleteTime + return TypeUpdateChatMessageAutoDeleteTime } // Notification settings for a chat were changed type UpdateChatNotificationSettings struct { - meta - // Chat identifier - ChatId int64 `json:"chat_id"` - // The new notification settings - NotificationSettings *ChatNotificationSettings `json:"notification_settings"` + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // The new notification settings + NotificationSettings *ChatNotificationSettings `json:"notification_settings"` } func (entity *UpdateChatNotificationSettings) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateChatNotificationSettings + type stub UpdateChatNotificationSettings - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateChatNotificationSettings) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateChatNotificationSettings) GetType() string { - return TypeUpdateChatNotificationSettings + return TypeUpdateChatNotificationSettings } func (*UpdateChatNotificationSettings) UpdateType() string { - return TypeUpdateChatNotificationSettings + return TypeUpdateChatNotificationSettings } // The chat pending join requests were changed type UpdateChatPendingJoinRequests struct { - meta - // Chat identifier - ChatId int64 `json:"chat_id"` - // The new data about pending join requests; may be null - PendingJoinRequests *ChatJoinRequestsInfo `json:"pending_join_requests"` + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // The new data about pending join requests; may be null + PendingJoinRequests *ChatJoinRequestsInfo `json:"pending_join_requests"` } func (entity *UpdateChatPendingJoinRequests) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateChatPendingJoinRequests + type stub UpdateChatPendingJoinRequests - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateChatPendingJoinRequests) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateChatPendingJoinRequests) GetType() string { - return TypeUpdateChatPendingJoinRequests + return TypeUpdateChatPendingJoinRequests } func (*UpdateChatPendingJoinRequests) UpdateType() string { - return TypeUpdateChatPendingJoinRequests + return TypeUpdateChatPendingJoinRequests } // 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 { - 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"` + 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"` } func (entity *UpdateChatReplyMarkup) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateChatReplyMarkup + type stub UpdateChatReplyMarkup - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateChatReplyMarkup) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateChatReplyMarkup) GetType() string { - return TypeUpdateChatReplyMarkup + return TypeUpdateChatReplyMarkup } func (*UpdateChatReplyMarkup) UpdateType() string { - return TypeUpdateChatReplyMarkup + return TypeUpdateChatReplyMarkup +} + +// The chat background was changed +type UpdateChatBackground struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // The new chat background; may be null if background was reset to default + Background *ChatBackground `json:"background"` +} + +func (entity *UpdateChatBackground) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateChatBackground + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateChatBackground) GetClass() string { + return ClassUpdate +} + +func (*UpdateChatBackground) GetType() string { + return TypeUpdateChatBackground +} + +func (*UpdateChatBackground) UpdateType() string { + return TypeUpdateChatBackground } // The chat theme was changed type UpdateChatTheme struct { - 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"` + 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"` } func (entity *UpdateChatTheme) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateChatTheme + type stub UpdateChatTheme - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateChatTheme) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateChatTheme) GetType() string { - return TypeUpdateChatTheme + return TypeUpdateChatTheme } func (*UpdateChatTheme) UpdateType() string { - return TypeUpdateChatTheme + return TypeUpdateChatTheme } // The chat unread_mention_count has changed type UpdateChatUnreadMentionCount struct { - meta - // Chat identifier - ChatId int64 `json:"chat_id"` - // The number of unread mention messages left in the chat - UnreadMentionCount int32 `json:"unread_mention_count"` + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // The number of unread mention messages left in the chat + UnreadMentionCount int32 `json:"unread_mention_count"` } func (entity *UpdateChatUnreadMentionCount) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateChatUnreadMentionCount + type stub UpdateChatUnreadMentionCount - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateChatUnreadMentionCount) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateChatUnreadMentionCount) GetType() string { - return TypeUpdateChatUnreadMentionCount + return TypeUpdateChatUnreadMentionCount } func (*UpdateChatUnreadMentionCount) UpdateType() string { - return TypeUpdateChatUnreadMentionCount + return TypeUpdateChatUnreadMentionCount } // The chat unread_reaction_count has changed type UpdateChatUnreadReactionCount struct { - 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"` + 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"` } func (entity *UpdateChatUnreadReactionCount) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateChatUnreadReactionCount + type stub UpdateChatUnreadReactionCount - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateChatUnreadReactionCount) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateChatUnreadReactionCount) GetType() string { - return TypeUpdateChatUnreadReactionCount + return TypeUpdateChatUnreadReactionCount } func (*UpdateChatUnreadReactionCount) UpdateType() string { - return TypeUpdateChatUnreadReactionCount + return TypeUpdateChatUnreadReactionCount } // A chat video chat state has changed type UpdateChatVideoChat struct { - meta - // Chat identifier - ChatId int64 `json:"chat_id"` - // New value of video_chat - VideoChat *VideoChat `json:"video_chat"` + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // New value of video_chat + VideoChat *VideoChat `json:"video_chat"` } func (entity *UpdateChatVideoChat) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateChatVideoChat + type stub UpdateChatVideoChat - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateChatVideoChat) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateChatVideoChat) GetType() string { - return TypeUpdateChatVideoChat + return TypeUpdateChatVideoChat } func (*UpdateChatVideoChat) UpdateType() string { - return TypeUpdateChatVideoChat + return TypeUpdateChatVideoChat } // The value of the default disable_notification parameter, used when a message is sent to the chat, was changed type UpdateChatDefaultDisableNotification struct { - meta - // Chat identifier - ChatId int64 `json:"chat_id"` - // The new default_disable_notification value - DefaultDisableNotification bool `json:"default_disable_notification"` + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // The new default_disable_notification value + DefaultDisableNotification bool `json:"default_disable_notification"` } func (entity *UpdateChatDefaultDisableNotification) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateChatDefaultDisableNotification + type stub UpdateChatDefaultDisableNotification - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateChatDefaultDisableNotification) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateChatDefaultDisableNotification) GetType() string { - return TypeUpdateChatDefaultDisableNotification + return TypeUpdateChatDefaultDisableNotification } func (*UpdateChatDefaultDisableNotification) UpdateType() string { - return TypeUpdateChatDefaultDisableNotification + return TypeUpdateChatDefaultDisableNotification } // A chat content was allowed or restricted for saving type UpdateChatHasProtectedContent struct { - meta - // Chat identifier - ChatId int64 `json:"chat_id"` - // New value of has_protected_content - HasProtectedContent bool `json:"has_protected_content"` + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // New value of has_protected_content + HasProtectedContent bool `json:"has_protected_content"` } func (entity *UpdateChatHasProtectedContent) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateChatHasProtectedContent + type stub UpdateChatHasProtectedContent - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateChatHasProtectedContent) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateChatHasProtectedContent) GetType() string { - return TypeUpdateChatHasProtectedContent + return TypeUpdateChatHasProtectedContent } func (*UpdateChatHasProtectedContent) UpdateType() string { - return TypeUpdateChatHasProtectedContent + return TypeUpdateChatHasProtectedContent } -// A chat's has_scheduled_messages field has changed -type UpdateChatHasScheduledMessages struct { - meta - // Chat identifier - ChatId int64 `json:"chat_id"` - // New value of has_scheduled_messages - HasScheduledMessages bool `json:"has_scheduled_messages"` +// Translation of chat messages was enabled or disabled +type UpdateChatIsTranslatable struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // New value of is_translatable + IsTranslatable bool `json:"is_translatable"` } -func (entity *UpdateChatHasScheduledMessages) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() +func (entity *UpdateChatIsTranslatable) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() - type stub UpdateChatHasScheduledMessages + type stub UpdateChatIsTranslatable - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } -func (*UpdateChatHasScheduledMessages) GetClass() string { - return ClassUpdate +func (*UpdateChatIsTranslatable) GetClass() string { + return ClassUpdate } -func (*UpdateChatHasScheduledMessages) GetType() string { - return TypeUpdateChatHasScheduledMessages +func (*UpdateChatIsTranslatable) GetType() string { + return TypeUpdateChatIsTranslatable } -func (*UpdateChatHasScheduledMessages) UpdateType() string { - return TypeUpdateChatHasScheduledMessages -} - -// A chat was blocked or unblocked -type UpdateChatIsBlocked struct { - meta - // Chat identifier - ChatId int64 `json:"chat_id"` - // New value of is_blocked - IsBlocked bool `json:"is_blocked"` -} - -func (entity *UpdateChatIsBlocked) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UpdateChatIsBlocked - - return json.Marshal((*stub)(entity)) -} - -func (*UpdateChatIsBlocked) GetClass() string { - return ClassUpdate -} - -func (*UpdateChatIsBlocked) GetType() string { - return TypeUpdateChatIsBlocked -} - -func (*UpdateChatIsBlocked) UpdateType() string { - return TypeUpdateChatIsBlocked +func (*UpdateChatIsTranslatable) UpdateType() string { + return TypeUpdateChatIsTranslatable } // A chat was marked as unread or was read type UpdateChatIsMarkedAsUnread struct { - meta - // Chat identifier - ChatId int64 `json:"chat_id"` - // New value of is_marked_as_unread - IsMarkedAsUnread bool `json:"is_marked_as_unread"` + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // New value of is_marked_as_unread + IsMarkedAsUnread bool `json:"is_marked_as_unread"` } func (entity *UpdateChatIsMarkedAsUnread) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateChatIsMarkedAsUnread + type stub UpdateChatIsMarkedAsUnread - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateChatIsMarkedAsUnread) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateChatIsMarkedAsUnread) GetType() string { - return TypeUpdateChatIsMarkedAsUnread + return TypeUpdateChatIsMarkedAsUnread } func (*UpdateChatIsMarkedAsUnread) UpdateType() string { - return TypeUpdateChatIsMarkedAsUnread + return TypeUpdateChatIsMarkedAsUnread } -// The list of chat filters or a chat filter has changed -type UpdateChatFilters struct { - meta - // The new list of chat filters - ChatFilters []*ChatFilterInfo `json:"chat_filters"` - // Position of the main chat list among chat filters, 0-based - MainChatListPosition int32 `json:"main_chat_list_position"` +// A chat default appearance has changed +type UpdateChatViewAsTopics struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // New value of view_as_topics + ViewAsTopics bool `json:"view_as_topics"` } -func (entity *UpdateChatFilters) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() +func (entity *UpdateChatViewAsTopics) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() - type stub UpdateChatFilters + type stub UpdateChatViewAsTopics - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } -func (*UpdateChatFilters) GetClass() string { - return ClassUpdate +func (*UpdateChatViewAsTopics) GetClass() string { + return ClassUpdate } -func (*UpdateChatFilters) GetType() string { - return TypeUpdateChatFilters +func (*UpdateChatViewAsTopics) GetType() string { + return TypeUpdateChatViewAsTopics } -func (*UpdateChatFilters) UpdateType() string { - return TypeUpdateChatFilters +func (*UpdateChatViewAsTopics) UpdateType() string { + return TypeUpdateChatViewAsTopics } -// 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 +// A chat was blocked or unblocked +type UpdateChatBlockList struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // Block list to which the chat is added; may be null if none + BlockList BlockList `json:"block_list"` +} + +func (entity *UpdateChatBlockList) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateChatBlockList + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateChatBlockList) GetClass() string { + return ClassUpdate +} + +func (*UpdateChatBlockList) GetType() string { + return TypeUpdateChatBlockList +} + +func (*UpdateChatBlockList) UpdateType() string { + return TypeUpdateChatBlockList +} + +func (updateChatBlockList *UpdateChatBlockList) UnmarshalJSON(data []byte) error { + var tmp struct { + ChatId int64 `json:"chat_id"` + BlockList json.RawMessage `json:"block_list"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + updateChatBlockList.ChatId = tmp.ChatId + + fieldBlockList, _ := UnmarshalBlockList(tmp.BlockList) + updateChatBlockList.BlockList = fieldBlockList + + return nil +} + +// A chat's has_scheduled_messages field has changed +type UpdateChatHasScheduledMessages struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // New value of has_scheduled_messages + HasScheduledMessages bool `json:"has_scheduled_messages"` +} + +func (entity *UpdateChatHasScheduledMessages) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateChatHasScheduledMessages + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateChatHasScheduledMessages) GetClass() string { + return ClassUpdate +} + +func (*UpdateChatHasScheduledMessages) GetType() string { + return TypeUpdateChatHasScheduledMessages +} + +func (*UpdateChatHasScheduledMessages) UpdateType() string { + return TypeUpdateChatHasScheduledMessages +} + +// The list of chat folders or a chat folder has changed +type UpdateChatFolders struct { + meta + // The new list of chat folders + ChatFolders []*ChatFolderInfo `json:"chat_folders"` + // Position of the main chat list among chat folders, 0-based + MainChatListPosition int32 `json:"main_chat_list_position"` + // True, if folder tags are enabled + AreTagsEnabled bool `json:"are_tags_enabled"` +} + +func (entity *UpdateChatFolders) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateChatFolders + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateChatFolders) GetClass() string { + return ClassUpdate +} + +func (*UpdateChatFolders) GetType() string { + return TypeUpdateChatFolders +} + +func (*UpdateChatFolders) UpdateType() string { + return TypeUpdateChatFolders +} + +// 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 is sent just after the number of online users has changed type UpdateChatOnlineMemberCount struct { - 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"` + 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"` } func (entity *UpdateChatOnlineMemberCount) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateChatOnlineMemberCount + type stub UpdateChatOnlineMemberCount - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateChatOnlineMemberCount) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateChatOnlineMemberCount) GetType() string { - return TypeUpdateChatOnlineMemberCount + return TypeUpdateChatOnlineMemberCount } func (*UpdateChatOnlineMemberCount) UpdateType() string { - return TypeUpdateChatOnlineMemberCount + return TypeUpdateChatOnlineMemberCount +} + +// Basic information about a Saved Messages topic has changed. This update is guaranteed to come before the topic identifier is returned to the application +type UpdateSavedMessagesTopic struct { + meta + // New data about the topic + Topic *SavedMessagesTopic `json:"topic"` +} + +func (entity *UpdateSavedMessagesTopic) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateSavedMessagesTopic + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateSavedMessagesTopic) GetClass() string { + return ClassUpdate +} + +func (*UpdateSavedMessagesTopic) GetType() string { + return TypeUpdateSavedMessagesTopic +} + +func (*UpdateSavedMessagesTopic) UpdateType() string { + return TypeUpdateSavedMessagesTopic +} + +// Number of Saved Messages topics has changed +type UpdateSavedMessagesTopicCount struct { + meta + // Approximate total number of Saved Messages topics + TopicCount int32 `json:"topic_count"` +} + +func (entity *UpdateSavedMessagesTopicCount) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateSavedMessagesTopicCount + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateSavedMessagesTopicCount) GetClass() string { + return ClassUpdate +} + +func (*UpdateSavedMessagesTopicCount) GetType() string { + return TypeUpdateSavedMessagesTopicCount +} + +func (*UpdateSavedMessagesTopicCount) UpdateType() string { + return TypeUpdateSavedMessagesTopicCount +} + +// Basic information about a quick reply shortcut has changed. This update is guaranteed to come before the quick shortcut name is returned to the application +type UpdateQuickReplyShortcut struct { + meta + // New data about the shortcut + Shortcut *QuickReplyShortcut `json:"shortcut"` +} + +func (entity *UpdateQuickReplyShortcut) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateQuickReplyShortcut + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateQuickReplyShortcut) GetClass() string { + return ClassUpdate +} + +func (*UpdateQuickReplyShortcut) GetType() string { + return TypeUpdateQuickReplyShortcut +} + +func (*UpdateQuickReplyShortcut) UpdateType() string { + return TypeUpdateQuickReplyShortcut +} + +// A quick reply shortcut and all its messages were deleted +type UpdateQuickReplyShortcutDeleted struct { + meta + // The identifier of the deleted shortcut + ShortcutId int32 `json:"shortcut_id"` +} + +func (entity *UpdateQuickReplyShortcutDeleted) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateQuickReplyShortcutDeleted + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateQuickReplyShortcutDeleted) GetClass() string { + return ClassUpdate +} + +func (*UpdateQuickReplyShortcutDeleted) GetType() string { + return TypeUpdateQuickReplyShortcutDeleted +} + +func (*UpdateQuickReplyShortcutDeleted) UpdateType() string { + return TypeUpdateQuickReplyShortcutDeleted +} + +// The list of quick reply shortcuts has changed +type UpdateQuickReplyShortcuts struct { + meta + // The new list of identifiers of quick reply shortcuts + ShortcutIds []int32 `json:"shortcut_ids"` +} + +func (entity *UpdateQuickReplyShortcuts) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateQuickReplyShortcuts + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateQuickReplyShortcuts) GetClass() string { + return ClassUpdate +} + +func (*UpdateQuickReplyShortcuts) GetType() string { + return TypeUpdateQuickReplyShortcuts +} + +func (*UpdateQuickReplyShortcuts) UpdateType() string { + return TypeUpdateQuickReplyShortcuts +} + +// The list of quick reply shortcut messages has changed +type UpdateQuickReplyShortcutMessages struct { + meta + // The identifier of the shortcut + ShortcutId int32 `json:"shortcut_id"` + // The new list of quick reply messages for the shortcut in order from the first to the last sent + Messages []*QuickReplyMessage `json:"messages"` +} + +func (entity *UpdateQuickReplyShortcutMessages) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateQuickReplyShortcutMessages + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateQuickReplyShortcutMessages) GetClass() string { + return ClassUpdate +} + +func (*UpdateQuickReplyShortcutMessages) GetType() string { + return TypeUpdateQuickReplyShortcutMessages +} + +func (*UpdateQuickReplyShortcutMessages) UpdateType() string { + return TypeUpdateQuickReplyShortcutMessages } // Basic information about a topic in a forum chat was changed type UpdateForumTopicInfo struct { - meta - // Chat identifier - ChatId int64 `json:"chat_id"` - // New information about the topic - Info *ForumTopicInfo `json:"info"` + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // New information about the topic + Info *ForumTopicInfo `json:"info"` } func (entity *UpdateForumTopicInfo) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateForumTopicInfo + type stub UpdateForumTopicInfo - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateForumTopicInfo) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateForumTopicInfo) GetType() string { - return TypeUpdateForumTopicInfo + return TypeUpdateForumTopicInfo } func (*UpdateForumTopicInfo) UpdateType() string { - return TypeUpdateForumTopicInfo + return TypeUpdateForumTopicInfo } // Notification settings for some type of chats were updated type UpdateScopeNotificationSettings struct { - meta - // Types of chats for which notification settings were updated - Scope NotificationSettingsScope `json:"scope"` - // The new notification settings - NotificationSettings *ScopeNotificationSettings `json:"notification_settings"` + meta + // Types of chats for which notification settings were updated + Scope NotificationSettingsScope `json:"scope"` + // The new notification settings + NotificationSettings *ScopeNotificationSettings `json:"notification_settings"` } func (entity *UpdateScopeNotificationSettings) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateScopeNotificationSettings + type stub UpdateScopeNotificationSettings - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateScopeNotificationSettings) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateScopeNotificationSettings) GetType() string { - return TypeUpdateScopeNotificationSettings + return TypeUpdateScopeNotificationSettings } func (*UpdateScopeNotificationSettings) UpdateType() string { - return TypeUpdateScopeNotificationSettings + return TypeUpdateScopeNotificationSettings } func (updateScopeNotificationSettings *UpdateScopeNotificationSettings) UnmarshalJSON(data []byte) error { - var tmp struct { - Scope json.RawMessage `json:"scope"` - NotificationSettings *ScopeNotificationSettings `json:"notification_settings"` - } + var tmp struct { + Scope json.RawMessage `json:"scope"` + NotificationSettings *ScopeNotificationSettings `json:"notification_settings"` + } - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } - updateScopeNotificationSettings.NotificationSettings = tmp.NotificationSettings + updateScopeNotificationSettings.NotificationSettings = tmp.NotificationSettings - fieldScope, _ := UnmarshalNotificationSettingsScope(tmp.Scope) - updateScopeNotificationSettings.Scope = fieldScope + fieldScope, _ := UnmarshalNotificationSettingsScope(tmp.Scope) + updateScopeNotificationSettings.Scope = fieldScope - return nil + return nil } // A notification was changed type UpdateNotification struct { - meta - // Unique notification group identifier - NotificationGroupId int32 `json:"notification_group_id"` - // Changed notification - Notification *Notification `json:"notification"` + meta + // Unique notification group identifier + NotificationGroupId int32 `json:"notification_group_id"` + // Changed notification + Notification *Notification `json:"notification"` } func (entity *UpdateNotification) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateNotification + type stub UpdateNotification - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateNotification) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateNotification) GetType() string { - return TypeUpdateNotification + return TypeUpdateNotification } func (*UpdateNotification) UpdateType() string { - return TypeUpdateNotification + return TypeUpdateNotification } // A list of active notifications in a notification group has changed type UpdateNotificationGroup struct { - 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"` - // Identifier of the notification sound to be played; 0 if sound is disabled - NotificationSoundId JsonInt64 `json:"notification_sound_id"` - // 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"` + 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"` + // Identifier of the notification sound to be played; 0 if sound is disabled + NotificationSoundId JsonInt64 `json:"notification_sound_id"` + // 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 identifier + AddedNotifications []*Notification `json:"added_notifications"` + // Identifiers of removed group notifications, sorted by notification identifier + RemovedNotificationIds []int32 `json:"removed_notification_ids"` } func (entity *UpdateNotificationGroup) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateNotificationGroup + type stub UpdateNotificationGroup - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateNotificationGroup) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateNotificationGroup) GetType() string { - return TypeUpdateNotificationGroup + return TypeUpdateNotificationGroup } func (*UpdateNotificationGroup) UpdateType() string { - return TypeUpdateNotificationGroup + return TypeUpdateNotificationGroup } func (updateNotificationGroup *UpdateNotificationGroup) UnmarshalJSON(data []byte) error { - 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"` - NotificationSoundId JsonInt64 `json:"notification_sound_id"` - TotalCount int32 `json:"total_count"` - AddedNotifications []*Notification `json:"added_notifications"` - RemovedNotificationIds []int32 `json:"removed_notification_ids"` - } + 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"` + NotificationSoundId JsonInt64 `json:"notification_sound_id"` + 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 - } + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } - updateNotificationGroup.NotificationGroupId = tmp.NotificationGroupId - updateNotificationGroup.ChatId = tmp.ChatId - updateNotificationGroup.NotificationSettingsChatId = tmp.NotificationSettingsChatId - updateNotificationGroup.NotificationSoundId = tmp.NotificationSoundId - updateNotificationGroup.TotalCount = tmp.TotalCount - updateNotificationGroup.AddedNotifications = tmp.AddedNotifications - updateNotificationGroup.RemovedNotificationIds = tmp.RemovedNotificationIds + updateNotificationGroup.NotificationGroupId = tmp.NotificationGroupId + updateNotificationGroup.ChatId = tmp.ChatId + updateNotificationGroup.NotificationSettingsChatId = tmp.NotificationSettingsChatId + updateNotificationGroup.NotificationSoundId = tmp.NotificationSoundId + updateNotificationGroup.TotalCount = tmp.TotalCount + updateNotificationGroup.AddedNotifications = tmp.AddedNotifications + updateNotificationGroup.RemovedNotificationIds = tmp.RemovedNotificationIds - fieldType, _ := UnmarshalNotificationGroupType(tmp.Type) - updateNotificationGroup.Type = fieldType + fieldType, _ := UnmarshalNotificationGroupType(tmp.Type) + updateNotificationGroup.Type = fieldType - return nil + return nil } -// 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 +// Contains active notifications that were 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 type UpdateActiveNotifications struct { - meta - // Lists of active notification groups - Groups []*NotificationGroup `json:"groups"` + meta + // Lists of active notification groups + Groups []*NotificationGroup `json:"groups"` } func (entity *UpdateActiveNotifications) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateActiveNotifications + type stub UpdateActiveNotifications - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateActiveNotifications) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateActiveNotifications) GetType() string { - return TypeUpdateActiveNotifications + return TypeUpdateActiveNotifications } func (*UpdateActiveNotifications) UpdateType() string { - return TypeUpdateActiveNotifications + return TypeUpdateActiveNotifications } // Describes whether there are some pending notification updates. Can be used to prevent application from killing, while there are some pending notifications type UpdateHavePendingNotifications struct { - 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"` + 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"` } func (entity *UpdateHavePendingNotifications) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateHavePendingNotifications + type stub UpdateHavePendingNotifications - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateHavePendingNotifications) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateHavePendingNotifications) GetType() string { - return TypeUpdateHavePendingNotifications + return TypeUpdateHavePendingNotifications } func (*UpdateHavePendingNotifications) UpdateType() string { - return TypeUpdateHavePendingNotifications + return TypeUpdateHavePendingNotifications } // Some messages were deleted type UpdateDeleteMessages struct { - 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"` + 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"` } func (entity *UpdateDeleteMessages) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateDeleteMessages + type stub UpdateDeleteMessages - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateDeleteMessages) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateDeleteMessages) GetType() string { - return TypeUpdateDeleteMessages + return TypeUpdateDeleteMessages } func (*UpdateDeleteMessages) UpdateType() string { - return TypeUpdateDeleteMessages + return TypeUpdateDeleteMessages } // A message sender activity in the chat has changed type UpdateChatAction struct { - 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"` + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // If not 0, the 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"` } func (entity *UpdateChatAction) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateChatAction + type stub UpdateChatAction - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateChatAction) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateChatAction) GetType() string { - return TypeUpdateChatAction + return TypeUpdateChatAction } func (*UpdateChatAction) UpdateType() string { - return TypeUpdateChatAction + return TypeUpdateChatAction } func (updateChatAction *UpdateChatAction) UnmarshalJSON(data []byte) error { - 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"` - } + 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"` + } - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } - updateChatAction.ChatId = tmp.ChatId - updateChatAction.MessageThreadId = tmp.MessageThreadId + updateChatAction.ChatId = tmp.ChatId + updateChatAction.MessageThreadId = tmp.MessageThreadId - fieldSenderId, _ := UnmarshalMessageSender(tmp.SenderId) - updateChatAction.SenderId = fieldSenderId + fieldSenderId, _ := UnmarshalMessageSender(tmp.SenderId) + updateChatAction.SenderId = fieldSenderId - fieldAction, _ := UnmarshalChatAction(tmp.Action) - updateChatAction.Action = fieldAction + fieldAction, _ := UnmarshalChatAction(tmp.Action) + updateChatAction.Action = fieldAction - return nil + return nil } // The user went online or offline type UpdateUserStatus struct { - meta - // User identifier - UserId int64 `json:"user_id"` - // New status of the user - Status UserStatus `json:"status"` + meta + // User identifier + UserId int64 `json:"user_id"` + // New status of the user + Status UserStatus `json:"status"` } func (entity *UpdateUserStatus) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateUserStatus + type stub UpdateUserStatus - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateUserStatus) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateUserStatus) GetType() string { - return TypeUpdateUserStatus + return TypeUpdateUserStatus } func (*UpdateUserStatus) UpdateType() string { - return TypeUpdateUserStatus + return TypeUpdateUserStatus } func (updateUserStatus *UpdateUserStatus) UnmarshalJSON(data []byte) error { - var tmp struct { - UserId int64 `json:"user_id"` - Status json.RawMessage `json:"status"` - } + var tmp struct { + UserId int64 `json:"user_id"` + Status json.RawMessage `json:"status"` + } - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } - updateUserStatus.UserId = tmp.UserId + updateUserStatus.UserId = tmp.UserId - fieldStatus, _ := UnmarshalUserStatus(tmp.Status) - updateUserStatus.Status = fieldStatus + fieldStatus, _ := UnmarshalUserStatus(tmp.Status) + updateUserStatus.Status = fieldStatus - return nil + return nil } // Some data of a user has changed. This update is guaranteed to come before the user identifier is returned to the application type UpdateUser struct { - meta - // New data about the user - User *User `json:"user"` + meta + // New data about the user + User *User `json:"user"` } func (entity *UpdateUser) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateUser + type stub UpdateUser - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateUser) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateUser) GetType() string { - return TypeUpdateUser + return TypeUpdateUser } func (*UpdateUser) UpdateType() string { - return TypeUpdateUser + return TypeUpdateUser } // Some data of a basic group has changed. This update is guaranteed to come before the basic group identifier is returned to the application type UpdateBasicGroup struct { - meta - // New data about the group - BasicGroup *BasicGroup `json:"basic_group"` + meta + // New data about the group + BasicGroup *BasicGroup `json:"basic_group"` } func (entity *UpdateBasicGroup) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateBasicGroup + type stub UpdateBasicGroup - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateBasicGroup) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateBasicGroup) GetType() string { - return TypeUpdateBasicGroup + return TypeUpdateBasicGroup } func (*UpdateBasicGroup) UpdateType() string { - return TypeUpdateBasicGroup + return TypeUpdateBasicGroup } // 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 type UpdateSupergroup struct { - meta - // New data about the supergroup - Supergroup *Supergroup `json:"supergroup"` + meta + // New data about the supergroup + Supergroup *Supergroup `json:"supergroup"` } func (entity *UpdateSupergroup) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateSupergroup + type stub UpdateSupergroup - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateSupergroup) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateSupergroup) GetType() string { - return TypeUpdateSupergroup + return TypeUpdateSupergroup } func (*UpdateSupergroup) UpdateType() string { - return TypeUpdateSupergroup + return TypeUpdateSupergroup } // Some data of a secret chat has changed. This update is guaranteed to come before the secret chat identifier is returned to the application type UpdateSecretChat struct { - meta - // New data about the secret chat - SecretChat *SecretChat `json:"secret_chat"` + meta + // New data about the secret chat + SecretChat *SecretChat `json:"secret_chat"` } func (entity *UpdateSecretChat) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateSecretChat + type stub UpdateSecretChat - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateSecretChat) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateSecretChat) GetType() string { - return TypeUpdateSecretChat + return TypeUpdateSecretChat } func (*UpdateSecretChat) UpdateType() string { - return TypeUpdateSecretChat + return TypeUpdateSecretChat } // Some data in userFullInfo has been changed type UpdateUserFullInfo struct { - meta - // User identifier - UserId int64 `json:"user_id"` - // New full information about the user - UserFullInfo *UserFullInfo `json:"user_full_info"` + meta + // User identifier + UserId int64 `json:"user_id"` + // New full information about the user + UserFullInfo *UserFullInfo `json:"user_full_info"` } func (entity *UpdateUserFullInfo) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateUserFullInfo + type stub UpdateUserFullInfo - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateUserFullInfo) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateUserFullInfo) GetType() string { - return TypeUpdateUserFullInfo + return TypeUpdateUserFullInfo } func (*UpdateUserFullInfo) UpdateType() string { - return TypeUpdateUserFullInfo + return TypeUpdateUserFullInfo } // Some data in basicGroupFullInfo has been changed type UpdateBasicGroupFullInfo struct { - 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"` + 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"` } func (entity *UpdateBasicGroupFullInfo) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateBasicGroupFullInfo + type stub UpdateBasicGroupFullInfo - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateBasicGroupFullInfo) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateBasicGroupFullInfo) GetType() string { - return TypeUpdateBasicGroupFullInfo + return TypeUpdateBasicGroupFullInfo } func (*UpdateBasicGroupFullInfo) UpdateType() string { - return TypeUpdateBasicGroupFullInfo + return TypeUpdateBasicGroupFullInfo } // Some data in supergroupFullInfo has been changed type UpdateSupergroupFullInfo struct { - meta - // Identifier of the supergroup or channel - SupergroupId int64 `json:"supergroup_id"` - // New full information about the supergroup - SupergroupFullInfo *SupergroupFullInfo `json:"supergroup_full_info"` + meta + // Identifier of the supergroup or channel + SupergroupId int64 `json:"supergroup_id"` + // New full information about the supergroup + SupergroupFullInfo *SupergroupFullInfo `json:"supergroup_full_info"` } func (entity *UpdateSupergroupFullInfo) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateSupergroupFullInfo + type stub UpdateSupergroupFullInfo - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateSupergroupFullInfo) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateSupergroupFullInfo) GetType() string { - return TypeUpdateSupergroupFullInfo + return TypeUpdateSupergroupFullInfo } func (*UpdateSupergroupFullInfo) UpdateType() string { - return TypeUpdateSupergroupFullInfo + return TypeUpdateSupergroupFullInfo } // A service notification from the server was received. Upon receiving this the application must show a popup with the content of the notification type UpdateServiceNotification struct { - 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"` + 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"` } func (entity *UpdateServiceNotification) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateServiceNotification + type stub UpdateServiceNotification - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateServiceNotification) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateServiceNotification) GetType() string { - return TypeUpdateServiceNotification + return TypeUpdateServiceNotification } func (*UpdateServiceNotification) UpdateType() string { - return TypeUpdateServiceNotification + return TypeUpdateServiceNotification } func (updateServiceNotification *UpdateServiceNotification) UnmarshalJSON(data []byte) error { - var tmp struct { - Type string `json:"type"` - Content json.RawMessage `json:"content"` - } + var tmp struct { + Type string `json:"type"` + Content json.RawMessage `json:"content"` + } - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } - updateServiceNotification.Type = tmp.Type + updateServiceNotification.Type = tmp.Type - fieldContent, _ := UnmarshalMessageContent(tmp.Content) - updateServiceNotification.Content = fieldContent + fieldContent, _ := UnmarshalMessageContent(tmp.Content) + updateServiceNotification.Content = fieldContent - return nil + return nil } // Information about a file was updated type UpdateFile struct { - meta - // New data about the file - File *File `json:"file"` + meta + // New data about the file + File *File `json:"file"` } func (entity *UpdateFile) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateFile + type stub UpdateFile - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateFile) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateFile) GetType() string { - return TypeUpdateFile + return TypeUpdateFile } func (*UpdateFile) UpdateType() string { - return TypeUpdateFile + return TypeUpdateFile } // The file generation process needs to be started by the application type UpdateFileGenerationStart struct { - 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"` + 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"` } func (entity *UpdateFileGenerationStart) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateFileGenerationStart + type stub UpdateFileGenerationStart - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateFileGenerationStart) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateFileGenerationStart) GetType() string { - return TypeUpdateFileGenerationStart + return TypeUpdateFileGenerationStart } func (*UpdateFileGenerationStart) UpdateType() string { - return TypeUpdateFileGenerationStart + return TypeUpdateFileGenerationStart } // File generation is no longer needed type UpdateFileGenerationStop struct { - meta - // Unique identifier for the generation process - GenerationId JsonInt64 `json:"generation_id"` + meta + // Unique identifier for the generation process + GenerationId JsonInt64 `json:"generation_id"` } func (entity *UpdateFileGenerationStop) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateFileGenerationStop + type stub UpdateFileGenerationStop - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateFileGenerationStop) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateFileGenerationStop) GetType() string { - return TypeUpdateFileGenerationStop + return TypeUpdateFileGenerationStop } func (*UpdateFileGenerationStop) UpdateType() string { - return TypeUpdateFileGenerationStop + 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"` + 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() + entity.meta.Type = entity.GetType() - type stub UpdateFileDownloads + type stub UpdateFileDownloads - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateFileDownloads) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateFileDownloads) GetType() string { - return TypeUpdateFileDownloads + return TypeUpdateFileDownloads } func (*UpdateFileDownloads) UpdateType() string { - return TypeUpdateFileDownloads + 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"` + 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() + entity.meta.Type = entity.GetType() - type stub UpdateFileAddedToDownloads + type stub UpdateFileAddedToDownloads - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateFileAddedToDownloads) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateFileAddedToDownloads) GetType() string { - return TypeUpdateFileAddedToDownloads + return TypeUpdateFileAddedToDownloads } func (*UpdateFileAddedToDownloads) UpdateType() string { - return TypeUpdateFileAddedToDownloads + 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"` + 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() + entity.meta.Type = entity.GetType() - type stub UpdateFileDownload + type stub UpdateFileDownload - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateFileDownload) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateFileDownload) GetType() string { - return TypeUpdateFileDownload + return TypeUpdateFileDownload } func (*UpdateFileDownload) UpdateType() string { - return TypeUpdateFileDownload + 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"` + 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() + entity.meta.Type = entity.GetType() - type stub UpdateFileRemovedFromDownloads + type stub UpdateFileRemovedFromDownloads - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateFileRemovedFromDownloads) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateFileRemovedFromDownloads) GetType() string { - return TypeUpdateFileRemovedFromDownloads + return TypeUpdateFileRemovedFromDownloads } func (*UpdateFileRemovedFromDownloads) UpdateType() string { - return TypeUpdateFileRemovedFromDownloads + return TypeUpdateFileRemovedFromDownloads } // New call was created or information about a call was updated type UpdateCall struct { - meta - // New data about a call - Call *Call `json:"call"` + meta + // New data about a call + Call *Call `json:"call"` } func (entity *UpdateCall) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateCall + type stub UpdateCall - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateCall) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateCall) GetType() string { - return TypeUpdateCall + return TypeUpdateCall } func (*UpdateCall) UpdateType() string { - return TypeUpdateCall + return TypeUpdateCall } // Information about a group call was updated type UpdateGroupCall struct { - meta - // New data about a group call - GroupCall *GroupCall `json:"group_call"` + meta + // New data about a group call + GroupCall *GroupCall `json:"group_call"` } func (entity *UpdateGroupCall) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateGroupCall + type stub UpdateGroupCall - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateGroupCall) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateGroupCall) GetType() string { - return TypeUpdateGroupCall + return TypeUpdateGroupCall } func (*UpdateGroupCall) UpdateType() string { - return TypeUpdateGroupCall + return TypeUpdateGroupCall } // 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 { - meta - // Identifier of group call - GroupCallId int32 `json:"group_call_id"` - // New data about a participant - Participant *GroupCallParticipant `json:"participant"` + meta + // Identifier of group call + GroupCallId int32 `json:"group_call_id"` + // New data about a participant + Participant *GroupCallParticipant `json:"participant"` } func (entity *UpdateGroupCallParticipant) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateGroupCallParticipant + type stub UpdateGroupCallParticipant - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateGroupCallParticipant) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateGroupCallParticipant) GetType() string { - return TypeUpdateGroupCallParticipant + return TypeUpdateGroupCallParticipant } func (*UpdateGroupCallParticipant) UpdateType() string { - return TypeUpdateGroupCallParticipant + return TypeUpdateGroupCallParticipant } // New call signaling data arrived type UpdateNewCallSignalingData struct { - meta - // The call identifier - CallId int32 `json:"call_id"` - // The data - Data []byte `json:"data"` + meta + // The call identifier + CallId int32 `json:"call_id"` + // The data + Data []byte `json:"data"` } func (entity *UpdateNewCallSignalingData) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateNewCallSignalingData + type stub UpdateNewCallSignalingData - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateNewCallSignalingData) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateNewCallSignalingData) GetType() string { - return TypeUpdateNewCallSignalingData + return TypeUpdateNewCallSignalingData } func (*UpdateNewCallSignalingData) UpdateType() string { - return TypeUpdateNewCallSignalingData + return TypeUpdateNewCallSignalingData } // Some privacy setting rules have been changed type UpdateUserPrivacySettingRules struct { - meta - // The privacy setting - Setting UserPrivacySetting `json:"setting"` - // New privacy rules - Rules *UserPrivacySettingRules `json:"rules"` + meta + // The privacy setting + Setting UserPrivacySetting `json:"setting"` + // New privacy rules + Rules *UserPrivacySettingRules `json:"rules"` } func (entity *UpdateUserPrivacySettingRules) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateUserPrivacySettingRules + type stub UpdateUserPrivacySettingRules - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateUserPrivacySettingRules) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateUserPrivacySettingRules) GetType() string { - return TypeUpdateUserPrivacySettingRules + return TypeUpdateUserPrivacySettingRules } func (*UpdateUserPrivacySettingRules) UpdateType() string { - return TypeUpdateUserPrivacySettingRules + return TypeUpdateUserPrivacySettingRules } func (updateUserPrivacySettingRules *UpdateUserPrivacySettingRules) UnmarshalJSON(data []byte) error { - var tmp struct { - Setting json.RawMessage `json:"setting"` - Rules *UserPrivacySettingRules `json:"rules"` - } + var tmp struct { + Setting json.RawMessage `json:"setting"` + Rules *UserPrivacySettingRules `json:"rules"` + } - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } - updateUserPrivacySettingRules.Rules = tmp.Rules + updateUserPrivacySettingRules.Rules = tmp.Rules - fieldSetting, _ := UnmarshalUserPrivacySetting(tmp.Setting) - updateUserPrivacySettingRules.Setting = fieldSetting + fieldSetting, _ := UnmarshalUserPrivacySetting(tmp.Setting) + updateUserPrivacySettingRules.Setting = fieldSetting - return nil + return nil } // Number of unread messages in a chat list has changed. This update is sent only if the message database is used type UpdateUnreadMessageCount struct { - 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"` + 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"` } func (entity *UpdateUnreadMessageCount) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateUnreadMessageCount + type stub UpdateUnreadMessageCount - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateUnreadMessageCount) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateUnreadMessageCount) GetType() string { - return TypeUpdateUnreadMessageCount + return TypeUpdateUnreadMessageCount } func (*UpdateUnreadMessageCount) UpdateType() string { - return TypeUpdateUnreadMessageCount + return TypeUpdateUnreadMessageCount } func (updateUnreadMessageCount *UpdateUnreadMessageCount) UnmarshalJSON(data []byte) error { - var tmp struct { - ChatList json.RawMessage `json:"chat_list"` - UnreadCount int32 `json:"unread_count"` - UnreadUnmutedCount int32 `json:"unread_unmuted_count"` - } + var tmp struct { + ChatList json.RawMessage `json:"chat_list"` + UnreadCount int32 `json:"unread_count"` + UnreadUnmutedCount int32 `json:"unread_unmuted_count"` + } - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } - updateUnreadMessageCount.UnreadCount = tmp.UnreadCount - updateUnreadMessageCount.UnreadUnmutedCount = tmp.UnreadUnmutedCount + updateUnreadMessageCount.UnreadCount = tmp.UnreadCount + updateUnreadMessageCount.UnreadUnmutedCount = tmp.UnreadUnmutedCount - fieldChatList, _ := UnmarshalChatList(tmp.ChatList) - updateUnreadMessageCount.ChatList = fieldChatList + fieldChatList, _ := UnmarshalChatList(tmp.ChatList) + updateUnreadMessageCount.ChatList = fieldChatList - return nil + return nil } // 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 type UpdateUnreadChatCount struct { - 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"` + 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"` } func (entity *UpdateUnreadChatCount) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateUnreadChatCount + type stub UpdateUnreadChatCount - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateUnreadChatCount) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateUnreadChatCount) GetType() string { - return TypeUpdateUnreadChatCount + return TypeUpdateUnreadChatCount } func (*UpdateUnreadChatCount) UpdateType() string { - return TypeUpdateUnreadChatCount + return TypeUpdateUnreadChatCount } func (updateUnreadChatCount *UpdateUnreadChatCount) UnmarshalJSON(data []byte) error { - 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"` - } + 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"` + } - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } - updateUnreadChatCount.TotalCount = tmp.TotalCount - updateUnreadChatCount.UnreadCount = tmp.UnreadCount - updateUnreadChatCount.UnreadUnmutedCount = tmp.UnreadUnmutedCount - updateUnreadChatCount.MarkedAsUnreadCount = tmp.MarkedAsUnreadCount - updateUnreadChatCount.MarkedAsUnreadUnmutedCount = tmp.MarkedAsUnreadUnmutedCount + updateUnreadChatCount.TotalCount = tmp.TotalCount + updateUnreadChatCount.UnreadCount = tmp.UnreadCount + updateUnreadChatCount.UnreadUnmutedCount = tmp.UnreadUnmutedCount + updateUnreadChatCount.MarkedAsUnreadCount = tmp.MarkedAsUnreadCount + updateUnreadChatCount.MarkedAsUnreadUnmutedCount = tmp.MarkedAsUnreadUnmutedCount - fieldChatList, _ := UnmarshalChatList(tmp.ChatList) - updateUnreadChatCount.ChatList = fieldChatList + fieldChatList, _ := UnmarshalChatList(tmp.ChatList) + updateUnreadChatCount.ChatList = fieldChatList - return nil + return nil +} + +// A story was changed +type UpdateStory struct { + meta + // The new information about the story + Story *Story `json:"story"` +} + +func (entity *UpdateStory) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateStory + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateStory) GetClass() string { + return ClassUpdate +} + +func (*UpdateStory) GetType() string { + return TypeUpdateStory +} + +func (*UpdateStory) UpdateType() string { + return TypeUpdateStory +} + +// A story became inaccessible +type UpdateStoryDeleted struct { + meta + // Identifier of the chat that posted the story + StorySenderChatId int64 `json:"story_sender_chat_id"` + // Story identifier + StoryId int32 `json:"story_id"` +} + +func (entity *UpdateStoryDeleted) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateStoryDeleted + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateStoryDeleted) GetClass() string { + return ClassUpdate +} + +func (*UpdateStoryDeleted) GetType() string { + return TypeUpdateStoryDeleted +} + +func (*UpdateStoryDeleted) UpdateType() string { + return TypeUpdateStoryDeleted +} + +// A story has been successfully sent +type UpdateStorySendSucceeded struct { + meta + // The sent story + Story *Story `json:"story"` + // The previous temporary story identifier + OldStoryId int32 `json:"old_story_id"` +} + +func (entity *UpdateStorySendSucceeded) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateStorySendSucceeded + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateStorySendSucceeded) GetClass() string { + return ClassUpdate +} + +func (*UpdateStorySendSucceeded) GetType() string { + return TypeUpdateStorySendSucceeded +} + +func (*UpdateStorySendSucceeded) UpdateType() string { + return TypeUpdateStorySendSucceeded +} + +// A story failed to send. If the story sending is canceled, then updateStoryDeleted will be received instead of this update +type UpdateStorySendFailed struct { + meta + // The failed to send story + Story *Story `json:"story"` + // The cause of the story sending failure + Error *Error `json:"error"` + // Type of the error; may be null if unknown + ErrorType CanSendStoryResult `json:"error_type"` +} + +func (entity *UpdateStorySendFailed) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateStorySendFailed + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateStorySendFailed) GetClass() string { + return ClassUpdate +} + +func (*UpdateStorySendFailed) GetType() string { + return TypeUpdateStorySendFailed +} + +func (*UpdateStorySendFailed) UpdateType() string { + return TypeUpdateStorySendFailed +} + +func (updateStorySendFailed *UpdateStorySendFailed) UnmarshalJSON(data []byte) error { + var tmp struct { + Story *Story `json:"story"` + Error *Error `json:"error"` + ErrorType json.RawMessage `json:"error_type"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + updateStorySendFailed.Story = tmp.Story + updateStorySendFailed.Error = tmp.Error + + fieldErrorType, _ := UnmarshalCanSendStoryResult(tmp.ErrorType) + updateStorySendFailed.ErrorType = fieldErrorType + + return nil +} + +// The list of active stories posted by a specific chat has changed +type UpdateChatActiveStories struct { + meta + // The new list of active stories + ActiveStories *ChatActiveStories `json:"active_stories"` +} + +func (entity *UpdateChatActiveStories) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateChatActiveStories + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateChatActiveStories) GetClass() string { + return ClassUpdate +} + +func (*UpdateChatActiveStories) GetType() string { + return TypeUpdateChatActiveStories +} + +func (*UpdateChatActiveStories) UpdateType() string { + return TypeUpdateChatActiveStories +} + +// Number of chats in a story list has changed +type UpdateStoryListChatCount struct { + meta + // The story list + StoryList StoryList `json:"story_list"` + // Approximate total number of chats with active stories in the list + ChatCount int32 `json:"chat_count"` +} + +func (entity *UpdateStoryListChatCount) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateStoryListChatCount + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateStoryListChatCount) GetClass() string { + return ClassUpdate +} + +func (*UpdateStoryListChatCount) GetType() string { + return TypeUpdateStoryListChatCount +} + +func (*UpdateStoryListChatCount) UpdateType() string { + return TypeUpdateStoryListChatCount +} + +func (updateStoryListChatCount *UpdateStoryListChatCount) UnmarshalJSON(data []byte) error { + var tmp struct { + StoryList json.RawMessage `json:"story_list"` + ChatCount int32 `json:"chat_count"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + updateStoryListChatCount.ChatCount = tmp.ChatCount + + fieldStoryList, _ := UnmarshalStoryList(tmp.StoryList) + updateStoryListChatCount.StoryList = fieldStoryList + + return nil +} + +// Story stealth mode settings have changed +type UpdateStoryStealthMode struct { + meta + // Point in time (Unix timestamp) until stealth mode is active; 0 if it is disabled + ActiveUntilDate int32 `json:"active_until_date"` + // Point in time (Unix timestamp) when stealth mode can be enabled again; 0 if there is no active cooldown + CooldownUntilDate int32 `json:"cooldown_until_date"` +} + +func (entity *UpdateStoryStealthMode) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateStoryStealthMode + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateStoryStealthMode) GetClass() string { + return ClassUpdate +} + +func (*UpdateStoryStealthMode) GetType() string { + return TypeUpdateStoryStealthMode +} + +func (*UpdateStoryStealthMode) UpdateType() string { + return TypeUpdateStoryStealthMode } // An option changed its value type UpdateOption struct { - meta - // The option name - Name string `json:"name"` - // The new option value - Value OptionValue `json:"value"` + meta + // The option name + Name string `json:"name"` + // The new option value + Value OptionValue `json:"value"` } func (entity *UpdateOption) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateOption + type stub UpdateOption - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateOption) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateOption) GetType() string { - return TypeUpdateOption + return TypeUpdateOption } func (*UpdateOption) UpdateType() string { - return TypeUpdateOption + return TypeUpdateOption } func (updateOption *UpdateOption) UnmarshalJSON(data []byte) error { - var tmp struct { - Name string `json:"name"` - Value json.RawMessage `json:"value"` - } + var tmp struct { + Name string `json:"name"` + Value json.RawMessage `json:"value"` + } - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } - updateOption.Name = tmp.Name + updateOption.Name = tmp.Name - fieldValue, _ := UnmarshalOptionValue(tmp.Value) - updateOption.Value = fieldValue + fieldValue, _ := UnmarshalOptionValue(tmp.Value) + updateOption.Value = fieldValue - return nil + return nil } // A sticker set has changed type UpdateStickerSet struct { - meta - // The sticker set - StickerSet *StickerSet `json:"sticker_set"` + meta + // The sticker set + StickerSet *StickerSet `json:"sticker_set"` } func (entity *UpdateStickerSet) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateStickerSet + type stub UpdateStickerSet - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateStickerSet) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateStickerSet) GetType() string { - return TypeUpdateStickerSet + return TypeUpdateStickerSet } func (*UpdateStickerSet) UpdateType() string { - return TypeUpdateStickerSet + return TypeUpdateStickerSet } // The list of installed sticker sets was updated type UpdateInstalledStickerSets struct { - meta - // Type of the affected stickers - StickerType StickerType `json:"sticker_type"` - // The new list of installed ordinary sticker sets - StickerSetIds []JsonInt64 `json:"sticker_set_ids"` + meta + // Type of the affected stickers + StickerType StickerType `json:"sticker_type"` + // The new list of installed ordinary sticker sets + StickerSetIds []JsonInt64 `json:"sticker_set_ids"` } func (entity *UpdateInstalledStickerSets) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateInstalledStickerSets + type stub UpdateInstalledStickerSets - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateInstalledStickerSets) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateInstalledStickerSets) GetType() string { - return TypeUpdateInstalledStickerSets + return TypeUpdateInstalledStickerSets } func (*UpdateInstalledStickerSets) UpdateType() string { - return TypeUpdateInstalledStickerSets + return TypeUpdateInstalledStickerSets } func (updateInstalledStickerSets *UpdateInstalledStickerSets) UnmarshalJSON(data []byte) error { - var tmp struct { - StickerType json.RawMessage `json:"sticker_type"` - StickerSetIds []JsonInt64 `json:"sticker_set_ids"` - } + var tmp struct { + StickerType json.RawMessage `json:"sticker_type"` + StickerSetIds []JsonInt64 `json:"sticker_set_ids"` + } - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } - updateInstalledStickerSets.StickerSetIds = tmp.StickerSetIds + updateInstalledStickerSets.StickerSetIds = tmp.StickerSetIds - fieldStickerType, _ := UnmarshalStickerType(tmp.StickerType) - updateInstalledStickerSets.StickerType = fieldStickerType + fieldStickerType, _ := UnmarshalStickerType(tmp.StickerType) + updateInstalledStickerSets.StickerType = fieldStickerType - return nil + return nil } // The list of trending sticker sets was updated or some of them were viewed type UpdateTrendingStickerSets struct { - meta - // Type of the affected stickers - StickerType StickerType `json:"sticker_type"` - // The prefix of the list of trending sticker sets with the newest trending sticker sets - StickerSets *TrendingStickerSets `json:"sticker_sets"` + meta + // Type of the affected stickers + StickerType StickerType `json:"sticker_type"` + // The prefix of the list of trending sticker sets with the newest trending sticker sets + StickerSets *TrendingStickerSets `json:"sticker_sets"` } func (entity *UpdateTrendingStickerSets) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateTrendingStickerSets + type stub UpdateTrendingStickerSets - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateTrendingStickerSets) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateTrendingStickerSets) GetType() string { - return TypeUpdateTrendingStickerSets + return TypeUpdateTrendingStickerSets } func (*UpdateTrendingStickerSets) UpdateType() string { - return TypeUpdateTrendingStickerSets + return TypeUpdateTrendingStickerSets } func (updateTrendingStickerSets *UpdateTrendingStickerSets) UnmarshalJSON(data []byte) error { - var tmp struct { - StickerType json.RawMessage `json:"sticker_type"` - StickerSets *TrendingStickerSets `json:"sticker_sets"` - } + var tmp struct { + StickerType json.RawMessage `json:"sticker_type"` + StickerSets *TrendingStickerSets `json:"sticker_sets"` + } - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } - updateTrendingStickerSets.StickerSets = tmp.StickerSets + updateTrendingStickerSets.StickerSets = tmp.StickerSets - fieldStickerType, _ := UnmarshalStickerType(tmp.StickerType) - updateTrendingStickerSets.StickerType = fieldStickerType + fieldStickerType, _ := UnmarshalStickerType(tmp.StickerType) + updateTrendingStickerSets.StickerType = fieldStickerType - return nil + return nil } // The list of recently used stickers was updated type UpdateRecentStickers struct { - 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"` + 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"` } func (entity *UpdateRecentStickers) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateRecentStickers + type stub UpdateRecentStickers - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateRecentStickers) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateRecentStickers) GetType() string { - return TypeUpdateRecentStickers + return TypeUpdateRecentStickers } func (*UpdateRecentStickers) UpdateType() string { - return TypeUpdateRecentStickers + return TypeUpdateRecentStickers } // The list of favorite stickers was updated type UpdateFavoriteStickers struct { - meta - // The new list of file identifiers of favorite stickers - StickerIds []int32 `json:"sticker_ids"` + meta + // The new list of file identifiers of favorite stickers + StickerIds []int32 `json:"sticker_ids"` } func (entity *UpdateFavoriteStickers) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateFavoriteStickers + type stub UpdateFavoriteStickers - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateFavoriteStickers) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateFavoriteStickers) GetType() string { - return TypeUpdateFavoriteStickers + return TypeUpdateFavoriteStickers } func (*UpdateFavoriteStickers) UpdateType() string { - return TypeUpdateFavoriteStickers + return TypeUpdateFavoriteStickers } // The list of saved animations was updated type UpdateSavedAnimations struct { - meta - // The new list of file identifiers of saved animations - AnimationIds []int32 `json:"animation_ids"` + meta + // The new list of file identifiers of saved animations + AnimationIds []int32 `json:"animation_ids"` } func (entity *UpdateSavedAnimations) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateSavedAnimations + type stub UpdateSavedAnimations - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateSavedAnimations) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateSavedAnimations) GetType() string { - return TypeUpdateSavedAnimations + return TypeUpdateSavedAnimations } func (*UpdateSavedAnimations) UpdateType() string { - return TypeUpdateSavedAnimations + return TypeUpdateSavedAnimations } -// The list of saved notifications sounds was updated. This update may not be sent until information about a notification sound was requested for the first time +// The list of saved notification sounds was updated. This update may not be sent until information about a notification sound was requested for the first time type UpdateSavedNotificationSounds struct { - meta - // The new list of identifiers of saved notification sounds - NotificationSoundIds []JsonInt64 `json:"notification_sound_ids"` + meta + // The new list of identifiers of saved notification sounds + NotificationSoundIds []JsonInt64 `json:"notification_sound_ids"` } func (entity *UpdateSavedNotificationSounds) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateSavedNotificationSounds + type stub UpdateSavedNotificationSounds - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateSavedNotificationSounds) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateSavedNotificationSounds) GetType() string { - return TypeUpdateSavedNotificationSounds + return TypeUpdateSavedNotificationSounds } func (*UpdateSavedNotificationSounds) UpdateType() string { - return TypeUpdateSavedNotificationSounds + return TypeUpdateSavedNotificationSounds } -// The selected background has changed -type UpdateSelectedBackground struct { - 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"` +// The default background has changed +type UpdateDefaultBackground struct { + meta + // True, if default background for dark theme has changed + ForDarkTheme bool `json:"for_dark_theme"` + // The new default background; may be null + Background *Background `json:"background"` } -func (entity *UpdateSelectedBackground) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() +func (entity *UpdateDefaultBackground) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() - type stub UpdateSelectedBackground + type stub UpdateDefaultBackground - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } -func (*UpdateSelectedBackground) GetClass() string { - return ClassUpdate +func (*UpdateDefaultBackground) GetClass() string { + return ClassUpdate } -func (*UpdateSelectedBackground) GetType() string { - return TypeUpdateSelectedBackground +func (*UpdateDefaultBackground) GetType() string { + return TypeUpdateDefaultBackground } -func (*UpdateSelectedBackground) UpdateType() string { - return TypeUpdateSelectedBackground +func (*UpdateDefaultBackground) UpdateType() string { + return TypeUpdateDefaultBackground } // The list of available chat themes has changed type UpdateChatThemes struct { - meta - // The new list of chat themes - ChatThemes []*ChatTheme `json:"chat_themes"` + meta + // The new list of chat themes + ChatThemes []*ChatTheme `json:"chat_themes"` } func (entity *UpdateChatThemes) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateChatThemes + type stub UpdateChatThemes - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateChatThemes) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateChatThemes) GetType() string { - return TypeUpdateChatThemes + return TypeUpdateChatThemes } func (*UpdateChatThemes) UpdateType() string { - return TypeUpdateChatThemes + return TypeUpdateChatThemes +} + +// The list of supported accent colors has changed +type UpdateAccentColors struct { + meta + // Information about supported colors; colors with identifiers 0 (red), 1 (orange), 2 (purple/violet), 3 (green), 4 (cyan), 5 (blue), 6 (pink) must always be supported and aren't included in the list. The exact colors for the accent colors with identifiers 0-6 must be taken from the app theme + Colors []*AccentColor `json:"colors"` + // The list of accent color identifiers, which can be set through setAccentColor and setChatAccentColor. The colors must be shown in the specififed order + AvailableAccentColorIds []int32 `json:"available_accent_color_ids"` +} + +func (entity *UpdateAccentColors) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateAccentColors + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateAccentColors) GetClass() string { + return ClassUpdate +} + +func (*UpdateAccentColors) GetType() string { + return TypeUpdateAccentColors +} + +func (*UpdateAccentColors) UpdateType() string { + return TypeUpdateAccentColors +} + +// The list of supported accent colors for user profiles has changed +type UpdateProfileAccentColors struct { + meta + // Information about supported colors + Colors []*ProfileAccentColor `json:"colors"` + // The list of accent color identifiers, which can be set through setProfileAccentColor and setChatProfileAccentColor. The colors must be shown in the specififed order + AvailableAccentColorIds []int32 `json:"available_accent_color_ids"` +} + +func (entity *UpdateProfileAccentColors) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateProfileAccentColors + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateProfileAccentColors) GetClass() string { + return ClassUpdate +} + +func (*UpdateProfileAccentColors) GetType() string { + return TypeUpdateProfileAccentColors +} + +func (*UpdateProfileAccentColors) UpdateType() string { + return TypeUpdateProfileAccentColors } // Some language pack strings have been updated type UpdateLanguagePackStrings struct { - 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"` + 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; empty if all strings have changed + Strings []*LanguagePackString `json:"strings"` } func (entity *UpdateLanguagePackStrings) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateLanguagePackStrings + type stub UpdateLanguagePackStrings - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateLanguagePackStrings) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateLanguagePackStrings) GetType() string { - return TypeUpdateLanguagePackStrings + return TypeUpdateLanguagePackStrings } func (*UpdateLanguagePackStrings) UpdateType() string { - return TypeUpdateLanguagePackStrings + return TypeUpdateLanguagePackStrings } // The connection state has changed. This update must be used only to show a human-readable description of the connection state type UpdateConnectionState struct { - meta - // The new connection state - State ConnectionState `json:"state"` + meta + // The new connection state + State ConnectionState `json:"state"` } func (entity *UpdateConnectionState) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateConnectionState + type stub UpdateConnectionState - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateConnectionState) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateConnectionState) GetType() string { - return TypeUpdateConnectionState + return TypeUpdateConnectionState } func (*UpdateConnectionState) UpdateType() string { - return TypeUpdateConnectionState + return TypeUpdateConnectionState } func (updateConnectionState *UpdateConnectionState) UnmarshalJSON(data []byte) error { - var tmp struct { - State json.RawMessage `json:"state"` - } + var tmp struct { + State json.RawMessage `json:"state"` + } - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } - fieldState, _ := UnmarshalConnectionState(tmp.State) - updateConnectionState.State = fieldState + fieldState, _ := UnmarshalConnectionState(tmp.State) + updateConnectionState.State = fieldState - return nil + return nil } // 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" type UpdateTermsOfService struct { - 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"` + 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"` } func (entity *UpdateTermsOfService) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateTermsOfService + type stub UpdateTermsOfService - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateTermsOfService) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateTermsOfService) GetType() string { - return TypeUpdateTermsOfService + return TypeUpdateTermsOfService } func (*UpdateTermsOfService) UpdateType() string { - return TypeUpdateTermsOfService + return TypeUpdateTermsOfService } // The list of users nearby has changed. The update is guaranteed to be sent only 60 seconds after a successful searchChatsNearby request type UpdateUsersNearby struct { - meta - // The new list of users nearby - UsersNearby []*ChatNearby `json:"users_nearby"` + meta + // The new list of users nearby + UsersNearby []*ChatNearby `json:"users_nearby"` } func (entity *UpdateUsersNearby) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateUsersNearby + type stub UpdateUsersNearby - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateUsersNearby) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateUsersNearby) GetType() string { - return TypeUpdateUsersNearby + return TypeUpdateUsersNearby } func (*UpdateUsersNearby) UpdateType() string { - return TypeUpdateUsersNearby + return TypeUpdateUsersNearby } -// The list of bots added to attachment menu has changed +// The first unconfirmed session has changed +type UpdateUnconfirmedSession struct { + meta + // The unconfirmed session; may be null if none + Session *UnconfirmedSession `json:"session"` +} + +func (entity *UpdateUnconfirmedSession) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateUnconfirmedSession + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateUnconfirmedSession) GetClass() string { + return ClassUpdate +} + +func (*UpdateUnconfirmedSession) GetType() string { + return TypeUpdateUnconfirmedSession +} + +func (*UpdateUnconfirmedSession) UpdateType() string { + return TypeUpdateUnconfirmedSession +} + +// The list of bots added to attachment or side menu has changed type UpdateAttachmentMenuBots struct { - meta - // The new list of bots added to attachment menu. The bots must not be shown on scheduled messages screen - Bots []*AttachmentMenuBot `json:"bots"` + meta + // The new list of bots. The bots must not be shown on scheduled messages screen + Bots []*AttachmentMenuBot `json:"bots"` } func (entity *UpdateAttachmentMenuBots) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateAttachmentMenuBots + type stub UpdateAttachmentMenuBots - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateAttachmentMenuBots) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateAttachmentMenuBots) GetType() string { - return TypeUpdateAttachmentMenuBots + return TypeUpdateAttachmentMenuBots } func (*UpdateAttachmentMenuBots) UpdateType() string { - return TypeUpdateAttachmentMenuBots + return TypeUpdateAttachmentMenuBots } // A message was sent by an opened Web App, so the Web App needs to be closed type UpdateWebAppMessageSent struct { - meta - // Identifier of Web App launch - WebAppLaunchId JsonInt64 `json:"web_app_launch_id"` + meta + // Identifier of Web App launch + WebAppLaunchId JsonInt64 `json:"web_app_launch_id"` } func (entity *UpdateWebAppMessageSent) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateWebAppMessageSent + type stub UpdateWebAppMessageSent - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateWebAppMessageSent) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateWebAppMessageSent) GetType() string { - return TypeUpdateWebAppMessageSent + return TypeUpdateWebAppMessageSent } func (*UpdateWebAppMessageSent) UpdateType() string { - return TypeUpdateWebAppMessageSent + return TypeUpdateWebAppMessageSent } // The list of active emoji reactions has changed type UpdateActiveEmojiReactions struct { - meta - // The new list of active emoji reactions - Emojis []string `json:"emojis"` + meta + // The new list of active emoji reactions + Emojis []string `json:"emojis"` } func (entity *UpdateActiveEmojiReactions) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateActiveEmojiReactions + type stub UpdateActiveEmojiReactions - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateActiveEmojiReactions) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateActiveEmojiReactions) GetType() string { - return TypeUpdateActiveEmojiReactions + return TypeUpdateActiveEmojiReactions } func (*UpdateActiveEmojiReactions) UpdateType() string { - return TypeUpdateActiveEmojiReactions + return TypeUpdateActiveEmojiReactions } // The type of default reaction has changed type UpdateDefaultReactionType struct { - meta - // The new type of the default reaction - ReactionType ReactionType `json:"reaction_type"` + meta + // The new type of the default reaction + ReactionType ReactionType `json:"reaction_type"` } func (entity *UpdateDefaultReactionType) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateDefaultReactionType + type stub UpdateDefaultReactionType - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateDefaultReactionType) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateDefaultReactionType) GetType() string { - return TypeUpdateDefaultReactionType + return TypeUpdateDefaultReactionType } func (*UpdateDefaultReactionType) UpdateType() string { - return TypeUpdateDefaultReactionType + return TypeUpdateDefaultReactionType } func (updateDefaultReactionType *UpdateDefaultReactionType) UnmarshalJSON(data []byte) error { - var tmp struct { - ReactionType json.RawMessage `json:"reaction_type"` - } + var tmp struct { + ReactionType json.RawMessage `json:"reaction_type"` + } - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } - fieldReactionType, _ := UnmarshalReactionType(tmp.ReactionType) - updateDefaultReactionType.ReactionType = fieldReactionType + fieldReactionType, _ := UnmarshalReactionType(tmp.ReactionType) + updateDefaultReactionType.ReactionType = fieldReactionType - return nil + return nil +} + +// Tags used in Saved Messages or a Saved Messages topic have changed +type UpdateSavedMessagesTags struct { + meta + // Identifier of Saved Messages topic which tags were changed; 0 if tags for the whole chat has changed + SavedMessagesTopicId int64 `json:"saved_messages_topic_id"` + // The new tags + Tags *SavedMessagesTags `json:"tags"` +} + +func (entity *UpdateSavedMessagesTags) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateSavedMessagesTags + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateSavedMessagesTags) GetClass() string { + return ClassUpdate +} + +func (*UpdateSavedMessagesTags) GetType() string { + return TypeUpdateSavedMessagesTags +} + +func (*UpdateSavedMessagesTags) UpdateType() string { + return TypeUpdateSavedMessagesTags +} + +// The parameters of speech recognition without Telegram Premium subscription has changed +type UpdateSpeechRecognitionTrial struct { + meta + // The maximum allowed duration of media for speech recognition without Telegram Premium subscription, in seconds + MaxMediaDuration int32 `json:"max_media_duration"` + // The total number of allowed speech recognitions per week; 0 if none + WeeklyCount int32 `json:"weekly_count"` + // Number of left speech recognition attempts this week + LeftCount int32 `json:"left_count"` + // Point in time (Unix timestamp) when the weekly number of tries will reset; 0 if unknown + NextResetDate int32 `json:"next_reset_date"` +} + +func (entity *UpdateSpeechRecognitionTrial) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateSpeechRecognitionTrial + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateSpeechRecognitionTrial) GetClass() string { + return ClassUpdate +} + +func (*UpdateSpeechRecognitionTrial) GetType() string { + return TypeUpdateSpeechRecognitionTrial +} + +func (*UpdateSpeechRecognitionTrial) UpdateType() string { + return TypeUpdateSpeechRecognitionTrial } // The list of supported dice emojis has changed type UpdateDiceEmojis struct { - meta - // The new list of supported dice emojis - Emojis []string `json:"emojis"` + meta + // The new list of supported dice emojis + Emojis []string `json:"emojis"` } func (entity *UpdateDiceEmojis) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateDiceEmojis + type stub UpdateDiceEmojis - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateDiceEmojis) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateDiceEmojis) GetType() string { - return TypeUpdateDiceEmojis + return TypeUpdateDiceEmojis } func (*UpdateDiceEmojis) UpdateType() string { - return TypeUpdateDiceEmojis + return TypeUpdateDiceEmojis } // 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 { - 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"` + 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"` } func (entity *UpdateAnimatedEmojiMessageClicked) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateAnimatedEmojiMessageClicked + type stub UpdateAnimatedEmojiMessageClicked - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateAnimatedEmojiMessageClicked) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateAnimatedEmojiMessageClicked) GetType() string { - return TypeUpdateAnimatedEmojiMessageClicked + return TypeUpdateAnimatedEmojiMessageClicked } func (*UpdateAnimatedEmojiMessageClicked) UpdateType() string { - return TypeUpdateAnimatedEmojiMessageClicked + return TypeUpdateAnimatedEmojiMessageClicked } // The parameters of animation search through getOption("animation_search_bot_username") bot has changed type UpdateAnimationSearchParameters struct { - meta - // Name of the animation search provider - Provider string `json:"provider"` - // The new list of emojis suggested for searching - Emojis []string `json:"emojis"` + meta + // Name of the animation search provider + Provider string `json:"provider"` + // The new list of emojis suggested for searching + Emojis []string `json:"emojis"` } func (entity *UpdateAnimationSearchParameters) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateAnimationSearchParameters + type stub UpdateAnimationSearchParameters - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateAnimationSearchParameters) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateAnimationSearchParameters) GetType() string { - return TypeUpdateAnimationSearchParameters + return TypeUpdateAnimationSearchParameters } func (*UpdateAnimationSearchParameters) UpdateType() string { - return TypeUpdateAnimationSearchParameters + return TypeUpdateAnimationSearchParameters } // The list of suggested to the user actions has changed type UpdateSuggestedActions struct { - meta - // Added suggested actions - AddedActions []SuggestedAction `json:"added_actions"` - // Removed suggested actions - RemovedActions []SuggestedAction `json:"removed_actions"` + meta + // Added suggested actions + AddedActions []SuggestedAction `json:"added_actions"` + // Removed suggested actions + RemovedActions []SuggestedAction `json:"removed_actions"` } func (entity *UpdateSuggestedActions) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateSuggestedActions + type stub UpdateSuggestedActions - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateSuggestedActions) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateSuggestedActions) GetType() string { - return TypeUpdateSuggestedActions + return TypeUpdateSuggestedActions } func (*UpdateSuggestedActions) UpdateType() string { - return TypeUpdateSuggestedActions + return TypeUpdateSuggestedActions } func (updateSuggestedActions *UpdateSuggestedActions) UnmarshalJSON(data []byte) error { - var tmp struct { - AddedActions []json.RawMessage `json:"added_actions"` - RemovedActions []json.RawMessage `json:"removed_actions"` - } + var tmp struct { + AddedActions []json.RawMessage `json:"added_actions"` + RemovedActions []json.RawMessage `json:"removed_actions"` + } - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } - fieldAddedActions, _ := UnmarshalListOfSuggestedAction(tmp.AddedActions) - updateSuggestedActions.AddedActions = fieldAddedActions + fieldAddedActions, _ := UnmarshalListOfSuggestedAction(tmp.AddedActions) + updateSuggestedActions.AddedActions = fieldAddedActions - fieldRemovedActions, _ := UnmarshalListOfSuggestedAction(tmp.RemovedActions) - updateSuggestedActions.RemovedActions = fieldRemovedActions + fieldRemovedActions, _ := UnmarshalListOfSuggestedAction(tmp.RemovedActions) + updateSuggestedActions.RemovedActions = fieldRemovedActions - return nil + return nil +} + +// The list of contacts that had birthdays recently or will have birthday soon has changed +type UpdateContactCloseBirthdays struct { + meta + // List of contact users with close birthday + CloseBirthdayUsers []*CloseBirthdayUser `json:"close_birthday_users"` +} + +func (entity *UpdateContactCloseBirthdays) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateContactCloseBirthdays + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateContactCloseBirthdays) GetClass() string { + return ClassUpdate +} + +func (*UpdateContactCloseBirthdays) GetType() string { + return TypeUpdateContactCloseBirthdays +} + +func (*UpdateContactCloseBirthdays) UpdateType() string { + return TypeUpdateContactCloseBirthdays +} + +// Adding users to a chat has failed because of their privacy settings. An invite link can be shared with the users if appropriate +type UpdateAddChatMembersPrivacyForbidden struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // Identifiers of users, which weren't added because of their privacy settings + UserIds []int64 `json:"user_ids"` +} + +func (entity *UpdateAddChatMembersPrivacyForbidden) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateAddChatMembersPrivacyForbidden + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateAddChatMembersPrivacyForbidden) GetClass() string { + return ClassUpdate +} + +func (*UpdateAddChatMembersPrivacyForbidden) GetType() string { + return TypeUpdateAddChatMembersPrivacyForbidden +} + +func (*UpdateAddChatMembersPrivacyForbidden) UpdateType() string { + return TypeUpdateAddChatMembersPrivacyForbidden +} + +// Autosave settings for some type of chats were updated +type UpdateAutosaveSettings struct { + meta + // Type of chats for which autosave settings were updated + Scope AutosaveSettingsScope `json:"scope"` + // The new autosave settings; may be null if the settings are reset to default + Settings *ScopeAutosaveSettings `json:"settings"` +} + +func (entity *UpdateAutosaveSettings) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateAutosaveSettings + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateAutosaveSettings) GetClass() string { + return ClassUpdate +} + +func (*UpdateAutosaveSettings) GetType() string { + return TypeUpdateAutosaveSettings +} + +func (*UpdateAutosaveSettings) UpdateType() string { + return TypeUpdateAutosaveSettings +} + +func (updateAutosaveSettings *UpdateAutosaveSettings) UnmarshalJSON(data []byte) error { + var tmp struct { + Scope json.RawMessage `json:"scope"` + Settings *ScopeAutosaveSettings `json:"settings"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + updateAutosaveSettings.Settings = tmp.Settings + + fieldScope, _ := UnmarshalAutosaveSettingsScope(tmp.Scope) + updateAutosaveSettings.Scope = fieldScope + + return nil +} + +// A business connection has changed; for bots only +type UpdateBusinessConnection struct { + meta + // New data about the connection + Connection *BusinessConnection `json:"connection"` +} + +func (entity *UpdateBusinessConnection) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateBusinessConnection + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateBusinessConnection) GetClass() string { + return ClassUpdate +} + +func (*UpdateBusinessConnection) GetType() string { + return TypeUpdateBusinessConnection +} + +func (*UpdateBusinessConnection) UpdateType() string { + return TypeUpdateBusinessConnection +} + +// A new message was added to a business account; for bots only +type UpdateNewBusinessMessage struct { + meta + // Unique identifier of the business connection + ConnectionId string `json:"connection_id"` + // The new message + Message *BusinessMessage `json:"message"` +} + +func (entity *UpdateNewBusinessMessage) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateNewBusinessMessage + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateNewBusinessMessage) GetClass() string { + return ClassUpdate +} + +func (*UpdateNewBusinessMessage) GetType() string { + return TypeUpdateNewBusinessMessage +} + +func (*UpdateNewBusinessMessage) UpdateType() string { + return TypeUpdateNewBusinessMessage +} + +// A message in a business account was edited; for bots only +type UpdateBusinessMessageEdited struct { + meta + // Unique identifier of the business connection + ConnectionId string `json:"connection_id"` + // The edited message + Message *BusinessMessage `json:"message"` +} + +func (entity *UpdateBusinessMessageEdited) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateBusinessMessageEdited + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateBusinessMessageEdited) GetClass() string { + return ClassUpdate +} + +func (*UpdateBusinessMessageEdited) GetType() string { + return TypeUpdateBusinessMessageEdited +} + +func (*UpdateBusinessMessageEdited) UpdateType() string { + return TypeUpdateBusinessMessageEdited +} + +// Messages in a business account were deleted; for bots only +type UpdateBusinessMessagesDeleted struct { + meta + // Unique identifier of the business connection + ConnectionId string `json:"connection_id"` + // Identifier of a chat in the business account in which messages were deleted + ChatId int64 `json:"chat_id"` + // Unique message identifiers of the deleted messages + MessageIds []int64 `json:"message_ids"` +} + +func (entity *UpdateBusinessMessagesDeleted) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateBusinessMessagesDeleted + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateBusinessMessagesDeleted) GetClass() string { + return ClassUpdate +} + +func (*UpdateBusinessMessagesDeleted) GetType() string { + return TypeUpdateBusinessMessagesDeleted +} + +func (*UpdateBusinessMessagesDeleted) UpdateType() string { + return TypeUpdateBusinessMessagesDeleted } // A new incoming inline query; for bots only type UpdateNewInlineQuery struct { - 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"` + 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"` } func (entity *UpdateNewInlineQuery) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateNewInlineQuery + type stub UpdateNewInlineQuery - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateNewInlineQuery) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateNewInlineQuery) GetType() string { - return TypeUpdateNewInlineQuery + return TypeUpdateNewInlineQuery } func (*UpdateNewInlineQuery) UpdateType() string { - return TypeUpdateNewInlineQuery + return TypeUpdateNewInlineQuery } func (updateNewInlineQuery *UpdateNewInlineQuery) UnmarshalJSON(data []byte) error { - 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"` - } + 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"` + } - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } - updateNewInlineQuery.Id = tmp.Id - updateNewInlineQuery.SenderUserId = tmp.SenderUserId - updateNewInlineQuery.UserLocation = tmp.UserLocation - updateNewInlineQuery.Query = tmp.Query - updateNewInlineQuery.Offset = tmp.Offset + updateNewInlineQuery.Id = tmp.Id + updateNewInlineQuery.SenderUserId = tmp.SenderUserId + updateNewInlineQuery.UserLocation = tmp.UserLocation + updateNewInlineQuery.Query = tmp.Query + updateNewInlineQuery.Offset = tmp.Offset - fieldChatType, _ := UnmarshalChatType(tmp.ChatType) - updateNewInlineQuery.ChatType = fieldChatType + fieldChatType, _ := UnmarshalChatType(tmp.ChatType) + updateNewInlineQuery.ChatType = fieldChatType - return nil + return nil } // The user has chosen a result of an inline query; for bots only type UpdateNewChosenInlineResult struct { - 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"` + 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"` } func (entity *UpdateNewChosenInlineResult) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateNewChosenInlineResult + type stub UpdateNewChosenInlineResult - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateNewChosenInlineResult) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateNewChosenInlineResult) GetType() string { - return TypeUpdateNewChosenInlineResult + return TypeUpdateNewChosenInlineResult } func (*UpdateNewChosenInlineResult) UpdateType() string { - return TypeUpdateNewChosenInlineResult + return TypeUpdateNewChosenInlineResult } // A new incoming callback query; for bots only type UpdateNewCallbackQuery struct { - 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"` + 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"` } func (entity *UpdateNewCallbackQuery) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateNewCallbackQuery + type stub UpdateNewCallbackQuery - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateNewCallbackQuery) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateNewCallbackQuery) GetType() string { - return TypeUpdateNewCallbackQuery + return TypeUpdateNewCallbackQuery } func (*UpdateNewCallbackQuery) UpdateType() string { - return TypeUpdateNewCallbackQuery + return TypeUpdateNewCallbackQuery } func (updateNewCallbackQuery *UpdateNewCallbackQuery) UnmarshalJSON(data []byte) error { - 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"` - } + 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"` + } - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } - updateNewCallbackQuery.Id = tmp.Id - updateNewCallbackQuery.SenderUserId = tmp.SenderUserId - updateNewCallbackQuery.ChatId = tmp.ChatId - updateNewCallbackQuery.MessageId = tmp.MessageId - updateNewCallbackQuery.ChatInstance = tmp.ChatInstance + updateNewCallbackQuery.Id = tmp.Id + updateNewCallbackQuery.SenderUserId = tmp.SenderUserId + updateNewCallbackQuery.ChatId = tmp.ChatId + updateNewCallbackQuery.MessageId = tmp.MessageId + updateNewCallbackQuery.ChatInstance = tmp.ChatInstance - fieldPayload, _ := UnmarshalCallbackQueryPayload(tmp.Payload) - updateNewCallbackQuery.Payload = fieldPayload + fieldPayload, _ := UnmarshalCallbackQueryPayload(tmp.Payload) + updateNewCallbackQuery.Payload = fieldPayload - return nil + return nil } // A new incoming callback query from a message sent via a bot; for bots only type UpdateNewInlineCallbackQuery struct { - 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"` + 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"` } func (entity *UpdateNewInlineCallbackQuery) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateNewInlineCallbackQuery + type stub UpdateNewInlineCallbackQuery - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateNewInlineCallbackQuery) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateNewInlineCallbackQuery) GetType() string { - return TypeUpdateNewInlineCallbackQuery + return TypeUpdateNewInlineCallbackQuery } func (*UpdateNewInlineCallbackQuery) UpdateType() string { - return TypeUpdateNewInlineCallbackQuery + return TypeUpdateNewInlineCallbackQuery } func (updateNewInlineCallbackQuery *UpdateNewInlineCallbackQuery) UnmarshalJSON(data []byte) error { - 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"` - } + 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"` + } - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } - updateNewInlineCallbackQuery.Id = tmp.Id - updateNewInlineCallbackQuery.SenderUserId = tmp.SenderUserId - updateNewInlineCallbackQuery.InlineMessageId = tmp.InlineMessageId - updateNewInlineCallbackQuery.ChatInstance = tmp.ChatInstance + updateNewInlineCallbackQuery.Id = tmp.Id + updateNewInlineCallbackQuery.SenderUserId = tmp.SenderUserId + updateNewInlineCallbackQuery.InlineMessageId = tmp.InlineMessageId + updateNewInlineCallbackQuery.ChatInstance = tmp.ChatInstance - fieldPayload, _ := UnmarshalCallbackQueryPayload(tmp.Payload) - updateNewInlineCallbackQuery.Payload = fieldPayload + fieldPayload, _ := UnmarshalCallbackQueryPayload(tmp.Payload) + updateNewInlineCallbackQuery.Payload = fieldPayload - return nil + return nil } // A new incoming shipping query; for bots only. Only for invoices with flexible price type UpdateNewShippingQuery struct { - 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"` + 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"` } func (entity *UpdateNewShippingQuery) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateNewShippingQuery + type stub UpdateNewShippingQuery - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateNewShippingQuery) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateNewShippingQuery) GetType() string { - return TypeUpdateNewShippingQuery + return TypeUpdateNewShippingQuery } func (*UpdateNewShippingQuery) UpdateType() string { - return TypeUpdateNewShippingQuery + return TypeUpdateNewShippingQuery } // A new incoming pre-checkout query; for bots only. Contains full information about a checkout type UpdateNewPreCheckoutQuery struct { - 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"` + 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"` } func (entity *UpdateNewPreCheckoutQuery) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateNewPreCheckoutQuery + type stub UpdateNewPreCheckoutQuery - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateNewPreCheckoutQuery) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateNewPreCheckoutQuery) GetType() string { - return TypeUpdateNewPreCheckoutQuery + return TypeUpdateNewPreCheckoutQuery } func (*UpdateNewPreCheckoutQuery) UpdateType() string { - return TypeUpdateNewPreCheckoutQuery + return TypeUpdateNewPreCheckoutQuery } // A new incoming event; for bots only type UpdateNewCustomEvent struct { - meta - // A JSON-serialized event - Event string `json:"event"` + meta + // A JSON-serialized event + Event string `json:"event"` } func (entity *UpdateNewCustomEvent) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateNewCustomEvent + type stub UpdateNewCustomEvent - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateNewCustomEvent) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateNewCustomEvent) GetType() string { - return TypeUpdateNewCustomEvent + return TypeUpdateNewCustomEvent } func (*UpdateNewCustomEvent) UpdateType() string { - return TypeUpdateNewCustomEvent + return TypeUpdateNewCustomEvent } // A new incoming query; for bots only type UpdateNewCustomQuery struct { - meta - // The query identifier - Id JsonInt64 `json:"id"` - // JSON-serialized query data - Data string `json:"data"` - // Query timeout - Timeout int32 `json:"timeout"` + meta + // The query identifier + Id JsonInt64 `json:"id"` + // JSON-serialized query data + Data string `json:"data"` + // Query timeout + Timeout int32 `json:"timeout"` } func (entity *UpdateNewCustomQuery) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateNewCustomQuery + type stub UpdateNewCustomQuery - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateNewCustomQuery) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateNewCustomQuery) GetType() string { - return TypeUpdateNewCustomQuery + return TypeUpdateNewCustomQuery } func (*UpdateNewCustomQuery) UpdateType() string { - return TypeUpdateNewCustomQuery + return TypeUpdateNewCustomQuery } // A poll was updated; for bots only type UpdatePoll struct { - meta - // New data about the poll - Poll *Poll `json:"poll"` + meta + // New data about the poll + Poll *Poll `json:"poll"` } func (entity *UpdatePoll) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdatePoll + type stub UpdatePoll - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdatePoll) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdatePoll) GetType() string { - return TypeUpdatePoll + return TypeUpdatePoll } func (*UpdatePoll) UpdateType() string { - return TypeUpdatePoll + return TypeUpdatePoll } // A user changed the answer to a poll; for bots only type UpdatePollAnswer struct { - 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"` + meta + // Unique poll identifier + PollId JsonInt64 `json:"poll_id"` + // Identifier of the message sender that changed the answer to the poll + VoterId MessageSender `json:"voter_id"` + // 0-based identifiers of answer options, chosen by the user + OptionIds []int32 `json:"option_ids"` } func (entity *UpdatePollAnswer) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdatePollAnswer + type stub UpdatePollAnswer - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdatePollAnswer) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdatePollAnswer) GetType() string { - return TypeUpdatePollAnswer + return TypeUpdatePollAnswer } func (*UpdatePollAnswer) UpdateType() string { - return TypeUpdatePollAnswer + return TypeUpdatePollAnswer +} + +func (updatePollAnswer *UpdatePollAnswer) UnmarshalJSON(data []byte) error { + var tmp struct { + PollId JsonInt64 `json:"poll_id"` + VoterId json.RawMessage `json:"voter_id"` + OptionIds []int32 `json:"option_ids"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + updatePollAnswer.PollId = tmp.PollId + updatePollAnswer.OptionIds = tmp.OptionIds + + fieldVoterId, _ := UnmarshalMessageSender(tmp.VoterId) + updatePollAnswer.VoterId = fieldVoterId + + return nil } // User rights changed in a chat; for bots only type UpdateChatMember struct { - 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"` + 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 were 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"` + // True, if the user has joined the chat using an invite link for a chat folder + ViaChatFolderInviteLink bool `json:"via_chat_folder_invite_link"` + // Previous chat member + OldChatMember *ChatMember `json:"old_chat_member"` + // New chat member + NewChatMember *ChatMember `json:"new_chat_member"` } func (entity *UpdateChatMember) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateChatMember + type stub UpdateChatMember - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateChatMember) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateChatMember) GetType() string { - return TypeUpdateChatMember + return TypeUpdateChatMember } func (*UpdateChatMember) UpdateType() string { - return TypeUpdateChatMember + return TypeUpdateChatMember } // A user sent a join request to a chat; for bots only type UpdateNewChatJoinRequest struct { - 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"` + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // Join request + Request *ChatJoinRequest `json:"request"` + // Chat identifier of the private chat with the user + UserChatId int64 `json:"user_chat_id"` + // The invite link, which was used to send join request; may be null + InviteLink *ChatInviteLink `json:"invite_link"` } func (entity *UpdateNewChatJoinRequest) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UpdateNewChatJoinRequest + type stub UpdateNewChatJoinRequest - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UpdateNewChatJoinRequest) GetClass() string { - return ClassUpdate + return ClassUpdate } func (*UpdateNewChatJoinRequest) GetType() string { - return TypeUpdateNewChatJoinRequest + return TypeUpdateNewChatJoinRequest } func (*UpdateNewChatJoinRequest) UpdateType() string { - return TypeUpdateNewChatJoinRequest + return TypeUpdateNewChatJoinRequest +} + +// A chat boost has changed; for bots only +type UpdateChatBoost struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // New information about the boost + Boost *ChatBoost `json:"boost"` +} + +func (entity *UpdateChatBoost) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateChatBoost + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateChatBoost) GetClass() string { + return ClassUpdate +} + +func (*UpdateChatBoost) GetType() string { + return TypeUpdateChatBoost +} + +func (*UpdateChatBoost) UpdateType() string { + return TypeUpdateChatBoost +} + +// User changed its reactions on a message with public reactions; for bots only +type UpdateMessageReaction struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // Message identifier + MessageId int64 `json:"message_id"` + // Identifier of the user or chat that changed reactions + ActorId MessageSender `json:"actor_id"` + // Point in time (Unix timestamp) when the reactions were changed + Date int32 `json:"date"` + // Old list of chosen reactions + OldReactionTypes []ReactionType `json:"old_reaction_types"` + // New list of chosen reactions + NewReactionTypes []ReactionType `json:"new_reaction_types"` +} + +func (entity *UpdateMessageReaction) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateMessageReaction + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateMessageReaction) GetClass() string { + return ClassUpdate +} + +func (*UpdateMessageReaction) GetType() string { + return TypeUpdateMessageReaction +} + +func (*UpdateMessageReaction) UpdateType() string { + return TypeUpdateMessageReaction +} + +func (updateMessageReaction *UpdateMessageReaction) UnmarshalJSON(data []byte) error { + var tmp struct { + ChatId int64 `json:"chat_id"` + MessageId int64 `json:"message_id"` + ActorId json.RawMessage `json:"actor_id"` + Date int32 `json:"date"` + OldReactionTypes []json.RawMessage `json:"old_reaction_types"` + NewReactionTypes []json.RawMessage `json:"new_reaction_types"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + updateMessageReaction.ChatId = tmp.ChatId + updateMessageReaction.MessageId = tmp.MessageId + updateMessageReaction.Date = tmp.Date + + fieldActorId, _ := UnmarshalMessageSender(tmp.ActorId) + updateMessageReaction.ActorId = fieldActorId + + fieldOldReactionTypes, _ := UnmarshalListOfReactionType(tmp.OldReactionTypes) + updateMessageReaction.OldReactionTypes = fieldOldReactionTypes + + fieldNewReactionTypes, _ := UnmarshalListOfReactionType(tmp.NewReactionTypes) + updateMessageReaction.NewReactionTypes = fieldNewReactionTypes + + return nil +} + +// Reactions added to a message with anonymous reactions have changed; for bots only +type UpdateMessageReactions struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // Message identifier + MessageId int64 `json:"message_id"` + // Point in time (Unix timestamp) when the reactions were changed + Date int32 `json:"date"` + // The list of reactions added to the message + Reactions []*MessageReaction `json:"reactions"` +} + +func (entity *UpdateMessageReactions) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateMessageReactions + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateMessageReactions) GetClass() string { + return ClassUpdate +} + +func (*UpdateMessageReactions) GetType() string { + return TypeUpdateMessageReactions +} + +func (*UpdateMessageReactions) UpdateType() string { + return TypeUpdateMessageReactions } // Contains a list of updates type Updates struct { - meta - // List of updates - Updates []Update `json:"updates"` + meta + // List of updates + Updates []Update `json:"updates"` } func (entity *Updates) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub Updates + type stub Updates - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*Updates) GetClass() string { - return ClassUpdates + return ClassUpdates } func (*Updates) GetType() string { - return TypeUpdates + return TypeUpdates } func (updates *Updates) UnmarshalJSON(data []byte) error { - var tmp struct { - Updates []json.RawMessage `json:"updates"` - } + var tmp struct { + Updates []json.RawMessage `json:"updates"` + } - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } - fieldUpdates, _ := UnmarshalListOfUpdate(tmp.Updates) - updates.Updates = fieldUpdates + fieldUpdates, _ := UnmarshalListOfUpdate(tmp.Updates) + updates.Updates = fieldUpdates - return nil + return nil } // The log is written to stderr or an OS specific log -type LogStreamDefault struct { - meta +type LogStreamDefault struct{ + meta } func (entity *LogStreamDefault) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub LogStreamDefault + type stub LogStreamDefault - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*LogStreamDefault) GetClass() string { - return ClassLogStream + return ClassLogStream } func (*LogStreamDefault) GetType() string { - return TypeLogStreamDefault + return TypeLogStreamDefault } func (*LogStreamDefault) LogStreamType() string { - return TypeLogStreamDefault + return TypeLogStreamDefault } // The log is written to a file type LogStreamFile struct { - 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"` + 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"` } func (entity *LogStreamFile) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub LogStreamFile + type stub LogStreamFile - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*LogStreamFile) GetClass() string { - return ClassLogStream + return ClassLogStream } func (*LogStreamFile) GetType() string { - return TypeLogStreamFile + return TypeLogStreamFile } func (*LogStreamFile) LogStreamType() string { - return TypeLogStreamFile + return TypeLogStreamFile } // The log is written nowhere -type LogStreamEmpty struct { - meta +type LogStreamEmpty struct{ + meta } func (entity *LogStreamEmpty) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub LogStreamEmpty + type stub LogStreamEmpty - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*LogStreamEmpty) GetClass() string { - return ClassLogStream + return ClassLogStream } func (*LogStreamEmpty) GetType() string { - return TypeLogStreamEmpty + return TypeLogStreamEmpty } func (*LogStreamEmpty) LogStreamType() string { - return TypeLogStreamEmpty + return TypeLogStreamEmpty } // Contains a TDLib internal log verbosity level type LogVerbosityLevel struct { - meta - // Log verbosity level - VerbosityLevel int32 `json:"verbosity_level"` + meta + // Log verbosity level + VerbosityLevel int32 `json:"verbosity_level"` } func (entity *LogVerbosityLevel) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub LogVerbosityLevel + type stub LogVerbosityLevel - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*LogVerbosityLevel) GetClass() string { - return ClassLogVerbosityLevel + return ClassLogVerbosityLevel } func (*LogVerbosityLevel) GetType() string { - return TypeLogVerbosityLevel + return TypeLogVerbosityLevel } // Contains a list of available TDLib internal log tags type LogTags struct { - meta - // List of log tags - Tags []string `json:"tags"` + meta + // List of log tags + Tags []string `json:"tags"` } func (entity *LogTags) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub LogTags + type stub LogTags - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*LogTags) GetClass() string { - return ClassLogTags + return ClassLogTags } func (*LogTags) GetType() string { - return TypeLogTags + return TypeLogTags } // Contains custom information about the user type UserSupportInfo struct { - meta - // Information message - Message *FormattedText `json:"message"` - // Information author - Author string `json:"author"` - // Information change date - Date int32 `json:"date"` + meta + // Information message + Message *FormattedText `json:"message"` + // Information author + Author string `json:"author"` + // Information change date + Date int32 `json:"date"` } func (entity *UserSupportInfo) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub UserSupportInfo + type stub UserSupportInfo - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*UserSupportInfo) GetClass() string { - return ClassUserSupportInfo + return ClassUserSupportInfo } func (*UserSupportInfo) GetType() string { - return TypeUserSupportInfo + return TypeUserSupportInfo } // A simple object containing a number; for testing only type TestInt struct { - meta - // Number - Value int32 `json:"value"` + meta + // Number + Value int32 `json:"value"` } func (entity *TestInt) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub TestInt + type stub TestInt - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*TestInt) GetClass() string { - return ClassTestInt + return ClassTestInt } func (*TestInt) GetType() string { - return TypeTestInt + return TypeTestInt } // A simple object containing a string; for testing only type TestString struct { - meta - // String - Value string `json:"value"` + meta + // String + Value string `json:"value"` } func (entity *TestString) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub TestString + type stub TestString - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*TestString) GetClass() string { - return ClassTestString + return ClassTestString } func (*TestString) GetType() string { - return TypeTestString + return TypeTestString } // A simple object containing a sequence of bytes; for testing only type TestBytes struct { - meta - // Bytes - Value []byte `json:"value"` + meta + // Bytes + Value []byte `json:"value"` } func (entity *TestBytes) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub TestBytes + type stub TestBytes - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*TestBytes) GetClass() string { - return ClassTestBytes + return ClassTestBytes } func (*TestBytes) GetType() string { - return TypeTestBytes + return TypeTestBytes } // A simple object containing a vector of numbers; for testing only type TestVectorInt struct { - meta - // Vector of numbers - Value []int32 `json:"value"` + meta + // Vector of numbers + Value []int32 `json:"value"` } func (entity *TestVectorInt) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub TestVectorInt + type stub TestVectorInt - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*TestVectorInt) GetClass() string { - return ClassTestVectorInt + return ClassTestVectorInt } func (*TestVectorInt) GetType() string { - return TypeTestVectorInt + return TypeTestVectorInt } // A simple object containing a vector of objects that hold a number; for testing only type TestVectorIntObject struct { - meta - // Vector of objects - Value []*TestInt `json:"value"` + meta + // Vector of objects + Value []*TestInt `json:"value"` } func (entity *TestVectorIntObject) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub TestVectorIntObject + type stub TestVectorIntObject - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*TestVectorIntObject) GetClass() string { - return ClassTestVectorIntObject + return ClassTestVectorIntObject } func (*TestVectorIntObject) GetType() string { - return TypeTestVectorIntObject + return TypeTestVectorIntObject } // A simple object containing a vector of strings; for testing only type TestVectorString struct { - meta - // Vector of strings - Value []string `json:"value"` + meta + // Vector of strings + Value []string `json:"value"` } func (entity *TestVectorString) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub TestVectorString + type stub TestVectorString - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*TestVectorString) GetClass() string { - return ClassTestVectorString + return ClassTestVectorString } func (*TestVectorString) GetType() string { - return TypeTestVectorString + return TypeTestVectorString } // A simple object containing a vector of objects that hold a string; for testing only type TestVectorStringObject struct { - meta - // Vector of objects - Value []*TestString `json:"value"` + meta + // Vector of objects + Value []*TestString `json:"value"` } func (entity *TestVectorStringObject) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() + entity.meta.Type = entity.GetType() - type stub TestVectorStringObject + type stub TestVectorStringObject - return json.Marshal((*stub)(entity)) + return json.Marshal((*stub)(entity)) } func (*TestVectorStringObject) GetClass() string { - return ClassTestVectorStringObject + return ClassTestVectorStringObject } func (*TestVectorStringObject) GetType() string { - return TypeTestVectorStringObject + return TypeTestVectorStringObject } + diff --git a/client/unmarshaler.go b/client/unmarshaler.go index 10bec12..0a4883c 100755 --- a/client/unmarshaler.go +++ b/client/unmarshaler.go @@ -3,17879 +3,23295 @@ package client import ( - "encoding/json" - "fmt" + "encoding/json" + "fmt" ) func UnmarshalAuthenticationCodeType(data json.RawMessage) (AuthenticationCodeType, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeAuthenticationCodeTypeTelegramMessage: - return UnmarshalAuthenticationCodeTypeTelegramMessage(data) + switch meta.Type { + case TypeAuthenticationCodeTypeTelegramMessage: + return UnmarshalAuthenticationCodeTypeTelegramMessage(data) - case TypeAuthenticationCodeTypeSms: - return UnmarshalAuthenticationCodeTypeSms(data) + case TypeAuthenticationCodeTypeSms: + return UnmarshalAuthenticationCodeTypeSms(data) - case TypeAuthenticationCodeTypeCall: - return UnmarshalAuthenticationCodeTypeCall(data) + case TypeAuthenticationCodeTypeCall: + return UnmarshalAuthenticationCodeTypeCall(data) - case TypeAuthenticationCodeTypeFlashCall: - return UnmarshalAuthenticationCodeTypeFlashCall(data) + case TypeAuthenticationCodeTypeFlashCall: + return UnmarshalAuthenticationCodeTypeFlashCall(data) - case TypeAuthenticationCodeTypeMissedCall: - return UnmarshalAuthenticationCodeTypeMissedCall(data) + case TypeAuthenticationCodeTypeMissedCall: + return UnmarshalAuthenticationCodeTypeMissedCall(data) - case TypeAuthenticationCodeTypeFragment: - return UnmarshalAuthenticationCodeTypeFragment(data) + case TypeAuthenticationCodeTypeFragment: + return UnmarshalAuthenticationCodeTypeFragment(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + case TypeAuthenticationCodeTypeFirebaseAndroid: + return UnmarshalAuthenticationCodeTypeFirebaseAndroid(data) + + case TypeAuthenticationCodeTypeFirebaseIos: + return UnmarshalAuthenticationCodeTypeFirebaseIos(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfAuthenticationCodeType(dataList []json.RawMessage) ([]AuthenticationCodeType, error) { - list := []AuthenticationCodeType{} + list := []AuthenticationCodeType{} - for _, data := range dataList { - entity, err := UnmarshalAuthenticationCodeType(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalAuthenticationCodeType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalEmailAddressAuthentication(data json.RawMessage) (EmailAddressAuthentication, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeEmailAddressAuthenticationCode: - return UnmarshalEmailAddressAuthenticationCode(data) + switch meta.Type { + case TypeEmailAddressAuthenticationCode: + return UnmarshalEmailAddressAuthenticationCode(data) - case TypeEmailAddressAuthenticationAppleId: - return UnmarshalEmailAddressAuthenticationAppleId(data) + case TypeEmailAddressAuthenticationAppleId: + return UnmarshalEmailAddressAuthenticationAppleId(data) - case TypeEmailAddressAuthenticationGoogleId: - return UnmarshalEmailAddressAuthenticationGoogleId(data) + case TypeEmailAddressAuthenticationGoogleId: + return UnmarshalEmailAddressAuthenticationGoogleId(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfEmailAddressAuthentication(dataList []json.RawMessage) ([]EmailAddressAuthentication, error) { - list := []EmailAddressAuthentication{} + list := []EmailAddressAuthentication{} - for _, data := range dataList { - entity, err := UnmarshalEmailAddressAuthentication(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalEmailAddressAuthentication(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil +} + +func UnmarshalEmailAddressResetState(data json.RawMessage) (EmailAddressResetState, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeEmailAddressResetStateAvailable: + return UnmarshalEmailAddressResetStateAvailable(data) + + case TypeEmailAddressResetStatePending: + return UnmarshalEmailAddressResetStatePending(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfEmailAddressResetState(dataList []json.RawMessage) ([]EmailAddressResetState, error) { + list := []EmailAddressResetState{} + + for _, data := range dataList { + entity, err := UnmarshalEmailAddressResetState(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil } func UnmarshalAuthorizationState(data json.RawMessage) (AuthorizationState, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeAuthorizationStateWaitTdlibParameters: - return UnmarshalAuthorizationStateWaitTdlibParameters(data) + switch meta.Type { + case TypeAuthorizationStateWaitTdlibParameters: + return UnmarshalAuthorizationStateWaitTdlibParameters(data) - case TypeAuthorizationStateWaitPhoneNumber: - return UnmarshalAuthorizationStateWaitPhoneNumber(data) + case TypeAuthorizationStateWaitPhoneNumber: + return UnmarshalAuthorizationStateWaitPhoneNumber(data) - case TypeAuthorizationStateWaitEmailAddress: - return UnmarshalAuthorizationStateWaitEmailAddress(data) + case TypeAuthorizationStateWaitEmailAddress: + return UnmarshalAuthorizationStateWaitEmailAddress(data) - case TypeAuthorizationStateWaitEmailCode: - return UnmarshalAuthorizationStateWaitEmailCode(data) + case TypeAuthorizationStateWaitEmailCode: + return UnmarshalAuthorizationStateWaitEmailCode(data) - case TypeAuthorizationStateWaitCode: - return UnmarshalAuthorizationStateWaitCode(data) + case TypeAuthorizationStateWaitCode: + return UnmarshalAuthorizationStateWaitCode(data) - case TypeAuthorizationStateWaitOtherDeviceConfirmation: - return UnmarshalAuthorizationStateWaitOtherDeviceConfirmation(data) + case TypeAuthorizationStateWaitOtherDeviceConfirmation: + return UnmarshalAuthorizationStateWaitOtherDeviceConfirmation(data) - case TypeAuthorizationStateWaitRegistration: - return UnmarshalAuthorizationStateWaitRegistration(data) + case TypeAuthorizationStateWaitRegistration: + return UnmarshalAuthorizationStateWaitRegistration(data) - case TypeAuthorizationStateWaitPassword: - return UnmarshalAuthorizationStateWaitPassword(data) + case TypeAuthorizationStateWaitPassword: + return UnmarshalAuthorizationStateWaitPassword(data) - case TypeAuthorizationStateReady: - return UnmarshalAuthorizationStateReady(data) + case TypeAuthorizationStateReady: + return UnmarshalAuthorizationStateReady(data) - case TypeAuthorizationStateLoggingOut: - return UnmarshalAuthorizationStateLoggingOut(data) + case TypeAuthorizationStateLoggingOut: + return UnmarshalAuthorizationStateLoggingOut(data) - case TypeAuthorizationStateClosing: - return UnmarshalAuthorizationStateClosing(data) + case TypeAuthorizationStateClosing: + return UnmarshalAuthorizationStateClosing(data) - case TypeAuthorizationStateClosed: - return UnmarshalAuthorizationStateClosed(data) + case TypeAuthorizationStateClosed: + return UnmarshalAuthorizationStateClosed(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfAuthorizationState(dataList []json.RawMessage) ([]AuthorizationState, error) { - list := []AuthorizationState{} + list := []AuthorizationState{} - for _, data := range dataList { - entity, err := UnmarshalAuthorizationState(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalAuthorizationState(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalInputFile(data json.RawMessage) (InputFile, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeInputFileId: - return UnmarshalInputFileId(data) + switch meta.Type { + case TypeInputFileId: + return UnmarshalInputFileId(data) - case TypeInputFileRemote: - return UnmarshalInputFileRemote(data) + case TypeInputFileRemote: + return UnmarshalInputFileRemote(data) - case TypeInputFileLocal: - return UnmarshalInputFileLocal(data) + case TypeInputFileLocal: + return UnmarshalInputFileLocal(data) - case TypeInputFileGenerated: - return UnmarshalInputFileGenerated(data) + case TypeInputFileGenerated: + return UnmarshalInputFileGenerated(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfInputFile(dataList []json.RawMessage) ([]InputFile, error) { - list := []InputFile{} + list := []InputFile{} - for _, data := range dataList { - entity, err := UnmarshalInputFile(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalInputFile(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalThumbnailFormat(data json.RawMessage) (ThumbnailFormat, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeThumbnailFormatJpeg: - return UnmarshalThumbnailFormatJpeg(data) + switch meta.Type { + case TypeThumbnailFormatJpeg: + return UnmarshalThumbnailFormatJpeg(data) - case TypeThumbnailFormatGif: - return UnmarshalThumbnailFormatGif(data) + case TypeThumbnailFormatGif: + return UnmarshalThumbnailFormatGif(data) - case TypeThumbnailFormatMpeg4: - return UnmarshalThumbnailFormatMpeg4(data) + case TypeThumbnailFormatMpeg4: + return UnmarshalThumbnailFormatMpeg4(data) - case TypeThumbnailFormatPng: - return UnmarshalThumbnailFormatPng(data) + case TypeThumbnailFormatPng: + return UnmarshalThumbnailFormatPng(data) - case TypeThumbnailFormatTgs: - return UnmarshalThumbnailFormatTgs(data) + case TypeThumbnailFormatTgs: + return UnmarshalThumbnailFormatTgs(data) - case TypeThumbnailFormatWebm: - return UnmarshalThumbnailFormatWebm(data) + case TypeThumbnailFormatWebm: + return UnmarshalThumbnailFormatWebm(data) - case TypeThumbnailFormatWebp: - return UnmarshalThumbnailFormatWebp(data) + case TypeThumbnailFormatWebp: + return UnmarshalThumbnailFormatWebp(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfThumbnailFormat(dataList []json.RawMessage) ([]ThumbnailFormat, error) { - list := []ThumbnailFormat{} + list := []ThumbnailFormat{} - for _, data := range dataList { - entity, err := UnmarshalThumbnailFormat(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalThumbnailFormat(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalMaskPoint(data json.RawMessage) (MaskPoint, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeMaskPointForehead: - return UnmarshalMaskPointForehead(data) + switch meta.Type { + case TypeMaskPointForehead: + return UnmarshalMaskPointForehead(data) - case TypeMaskPointEyes: - return UnmarshalMaskPointEyes(data) + case TypeMaskPointEyes: + return UnmarshalMaskPointEyes(data) - case TypeMaskPointMouth: - return UnmarshalMaskPointMouth(data) + case TypeMaskPointMouth: + return UnmarshalMaskPointMouth(data) - case TypeMaskPointChin: - return UnmarshalMaskPointChin(data) + case TypeMaskPointChin: + return UnmarshalMaskPointChin(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfMaskPoint(dataList []json.RawMessage) ([]MaskPoint, error) { - list := []MaskPoint{} + list := []MaskPoint{} - for _, data := range dataList { - entity, err := UnmarshalMaskPoint(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalMaskPoint(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalStickerFormat(data json.RawMessage) (StickerFormat, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeStickerFormatWebp: - return UnmarshalStickerFormatWebp(data) + switch meta.Type { + case TypeStickerFormatWebp: + return UnmarshalStickerFormatWebp(data) - case TypeStickerFormatTgs: - return UnmarshalStickerFormatTgs(data) + case TypeStickerFormatTgs: + return UnmarshalStickerFormatTgs(data) - case TypeStickerFormatWebm: - return UnmarshalStickerFormatWebm(data) + case TypeStickerFormatWebm: + return UnmarshalStickerFormatWebm(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfStickerFormat(dataList []json.RawMessage) ([]StickerFormat, error) { - list := []StickerFormat{} + list := []StickerFormat{} - for _, data := range dataList { - entity, err := UnmarshalStickerFormat(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalStickerFormat(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalStickerType(data json.RawMessage) (StickerType, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeStickerTypeRegular: - return UnmarshalStickerTypeRegular(data) + switch meta.Type { + case TypeStickerTypeRegular: + return UnmarshalStickerTypeRegular(data) - case TypeStickerTypeMask: - return UnmarshalStickerTypeMask(data) + case TypeStickerTypeMask: + return UnmarshalStickerTypeMask(data) - case TypeStickerTypeCustomEmoji: - return UnmarshalStickerTypeCustomEmoji(data) + case TypeStickerTypeCustomEmoji: + return UnmarshalStickerTypeCustomEmoji(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfStickerType(dataList []json.RawMessage) ([]StickerType, error) { - list := []StickerType{} + list := []StickerType{} - for _, data := range dataList { - entity, err := UnmarshalStickerType(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalStickerType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalStickerFullType(data json.RawMessage) (StickerFullType, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeStickerFullTypeRegular: - return UnmarshalStickerFullTypeRegular(data) + switch meta.Type { + case TypeStickerFullTypeRegular: + return UnmarshalStickerFullTypeRegular(data) - case TypeStickerFullTypeMask: - return UnmarshalStickerFullTypeMask(data) + case TypeStickerFullTypeMask: + return UnmarshalStickerFullTypeMask(data) - case TypeStickerFullTypeCustomEmoji: - return UnmarshalStickerFullTypeCustomEmoji(data) + case TypeStickerFullTypeCustomEmoji: + return UnmarshalStickerFullTypeCustomEmoji(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfStickerFullType(dataList []json.RawMessage) ([]StickerFullType, error) { - list := []StickerFullType{} + list := []StickerFullType{} - for _, data := range dataList { - entity, err := UnmarshalStickerFullType(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalStickerFullType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalPollType(data json.RawMessage) (PollType, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypePollTypeRegular: - return UnmarshalPollTypeRegular(data) + switch meta.Type { + case TypePollTypeRegular: + return UnmarshalPollTypeRegular(data) - case TypePollTypeQuiz: - return UnmarshalPollTypeQuiz(data) + case TypePollTypeQuiz: + return UnmarshalPollTypeQuiz(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfPollType(dataList []json.RawMessage) ([]PollType, error) { - list := []PollType{} + list := []PollType{} - for _, data := range dataList { - entity, err := UnmarshalPollType(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalPollType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalUserType(data json.RawMessage) (UserType, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeUserTypeRegular: - return UnmarshalUserTypeRegular(data) + switch meta.Type { + case TypeUserTypeRegular: + return UnmarshalUserTypeRegular(data) - case TypeUserTypeDeleted: - return UnmarshalUserTypeDeleted(data) + case TypeUserTypeDeleted: + return UnmarshalUserTypeDeleted(data) - case TypeUserTypeBot: - return UnmarshalUserTypeBot(data) + case TypeUserTypeBot: + return UnmarshalUserTypeBot(data) - case TypeUserTypeUnknown: - return UnmarshalUserTypeUnknown(data) + case TypeUserTypeUnknown: + return UnmarshalUserTypeUnknown(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfUserType(dataList []json.RawMessage) ([]UserType, error) { - list := []UserType{} + list := []UserType{} - for _, data := range dataList { - entity, err := UnmarshalUserType(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalUserType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil +} + +func UnmarshalBusinessAwayMessageSchedule(data json.RawMessage) (BusinessAwayMessageSchedule, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeBusinessAwayMessageScheduleAlways: + return UnmarshalBusinessAwayMessageScheduleAlways(data) + + case TypeBusinessAwayMessageScheduleOutsideOfOpeningHours: + return UnmarshalBusinessAwayMessageScheduleOutsideOfOpeningHours(data) + + case TypeBusinessAwayMessageScheduleCustom: + return UnmarshalBusinessAwayMessageScheduleCustom(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfBusinessAwayMessageSchedule(dataList []json.RawMessage) ([]BusinessAwayMessageSchedule, error) { + list := []BusinessAwayMessageSchedule{} + + for _, data := range dataList { + entity, err := UnmarshalBusinessAwayMessageSchedule(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalChatPhotoStickerType(data json.RawMessage) (ChatPhotoStickerType, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeChatPhotoStickerTypeRegularOrMask: + return UnmarshalChatPhotoStickerTypeRegularOrMask(data) + + case TypeChatPhotoStickerTypeCustomEmoji: + return UnmarshalChatPhotoStickerTypeCustomEmoji(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfChatPhotoStickerType(dataList []json.RawMessage) ([]ChatPhotoStickerType, error) { + list := []ChatPhotoStickerType{} + + for _, data := range dataList { + entity, err := UnmarshalChatPhotoStickerType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil } func UnmarshalInputChatPhoto(data json.RawMessage) (InputChatPhoto, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeInputChatPhotoPrevious: - return UnmarshalInputChatPhotoPrevious(data) + switch meta.Type { + case TypeInputChatPhotoPrevious: + return UnmarshalInputChatPhotoPrevious(data) - case TypeInputChatPhotoStatic: - return UnmarshalInputChatPhotoStatic(data) + case TypeInputChatPhotoStatic: + return UnmarshalInputChatPhotoStatic(data) - case TypeInputChatPhotoAnimation: - return UnmarshalInputChatPhotoAnimation(data) + case TypeInputChatPhotoAnimation: + return UnmarshalInputChatPhotoAnimation(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + case TypeInputChatPhotoSticker: + return UnmarshalInputChatPhotoSticker(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfInputChatPhoto(dataList []json.RawMessage) ([]InputChatPhoto, error) { - list := []InputChatPhoto{} + list := []InputChatPhoto{} - for _, data := range dataList { - entity, err := UnmarshalInputChatPhoto(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalInputChatPhoto(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil +} + +func UnmarshalPremiumGiveawayParticipantStatus(data json.RawMessage) (PremiumGiveawayParticipantStatus, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypePremiumGiveawayParticipantStatusEligible: + return UnmarshalPremiumGiveawayParticipantStatusEligible(data) + + case TypePremiumGiveawayParticipantStatusParticipating: + return UnmarshalPremiumGiveawayParticipantStatusParticipating(data) + + case TypePremiumGiveawayParticipantStatusAlreadyWasMember: + return UnmarshalPremiumGiveawayParticipantStatusAlreadyWasMember(data) + + case TypePremiumGiveawayParticipantStatusAdministrator: + return UnmarshalPremiumGiveawayParticipantStatusAdministrator(data) + + case TypePremiumGiveawayParticipantStatusDisallowedCountry: + return UnmarshalPremiumGiveawayParticipantStatusDisallowedCountry(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfPremiumGiveawayParticipantStatus(dataList []json.RawMessage) ([]PremiumGiveawayParticipantStatus, error) { + list := []PremiumGiveawayParticipantStatus{} + + for _, data := range dataList { + entity, err := UnmarshalPremiumGiveawayParticipantStatus(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalPremiumGiveawayInfo(data json.RawMessage) (PremiumGiveawayInfo, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypePremiumGiveawayInfoOngoing: + return UnmarshalPremiumGiveawayInfoOngoing(data) + + case TypePremiumGiveawayInfoCompleted: + return UnmarshalPremiumGiveawayInfoCompleted(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfPremiumGiveawayInfo(dataList []json.RawMessage) ([]PremiumGiveawayInfo, error) { + list := []PremiumGiveawayInfo{} + + for _, data := range dataList { + entity, err := UnmarshalPremiumGiveawayInfo(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil } func UnmarshalChatMemberStatus(data json.RawMessage) (ChatMemberStatus, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeChatMemberStatusCreator: - return UnmarshalChatMemberStatusCreator(data) + switch meta.Type { + case TypeChatMemberStatusCreator: + return UnmarshalChatMemberStatusCreator(data) - case TypeChatMemberStatusAdministrator: - return UnmarshalChatMemberStatusAdministrator(data) + case TypeChatMemberStatusAdministrator: + return UnmarshalChatMemberStatusAdministrator(data) - case TypeChatMemberStatusMember: - return UnmarshalChatMemberStatusMember(data) + case TypeChatMemberStatusMember: + return UnmarshalChatMemberStatusMember(data) - case TypeChatMemberStatusRestricted: - return UnmarshalChatMemberStatusRestricted(data) + case TypeChatMemberStatusRestricted: + return UnmarshalChatMemberStatusRestricted(data) - case TypeChatMemberStatusLeft: - return UnmarshalChatMemberStatusLeft(data) + case TypeChatMemberStatusLeft: + return UnmarshalChatMemberStatusLeft(data) - case TypeChatMemberStatusBanned: - return UnmarshalChatMemberStatusBanned(data) + case TypeChatMemberStatusBanned: + return UnmarshalChatMemberStatusBanned(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfChatMemberStatus(dataList []json.RawMessage) ([]ChatMemberStatus, error) { - list := []ChatMemberStatus{} + list := []ChatMemberStatus{} - for _, data := range dataList { - entity, err := UnmarshalChatMemberStatus(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalChatMemberStatus(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalChatMembersFilter(data json.RawMessage) (ChatMembersFilter, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeChatMembersFilterContacts: - return UnmarshalChatMembersFilterContacts(data) + switch meta.Type { + case TypeChatMembersFilterContacts: + return UnmarshalChatMembersFilterContacts(data) - case TypeChatMembersFilterAdministrators: - return UnmarshalChatMembersFilterAdministrators(data) + case TypeChatMembersFilterAdministrators: + return UnmarshalChatMembersFilterAdministrators(data) - case TypeChatMembersFilterMembers: - return UnmarshalChatMembersFilterMembers(data) + case TypeChatMembersFilterMembers: + return UnmarshalChatMembersFilterMembers(data) - case TypeChatMembersFilterMention: - return UnmarshalChatMembersFilterMention(data) + case TypeChatMembersFilterMention: + return UnmarshalChatMembersFilterMention(data) - case TypeChatMembersFilterRestricted: - return UnmarshalChatMembersFilterRestricted(data) + case TypeChatMembersFilterRestricted: + return UnmarshalChatMembersFilterRestricted(data) - case TypeChatMembersFilterBanned: - return UnmarshalChatMembersFilterBanned(data) + case TypeChatMembersFilterBanned: + return UnmarshalChatMembersFilterBanned(data) - case TypeChatMembersFilterBots: - return UnmarshalChatMembersFilterBots(data) + case TypeChatMembersFilterBots: + return UnmarshalChatMembersFilterBots(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfChatMembersFilter(dataList []json.RawMessage) ([]ChatMembersFilter, error) { - list := []ChatMembersFilter{} + list := []ChatMembersFilter{} - for _, data := range dataList { - entity, err := UnmarshalChatMembersFilter(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalChatMembersFilter(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalSupergroupMembersFilter(data json.RawMessage) (SupergroupMembersFilter, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeSupergroupMembersFilterRecent: - return UnmarshalSupergroupMembersFilterRecent(data) + switch meta.Type { + case TypeSupergroupMembersFilterRecent: + return UnmarshalSupergroupMembersFilterRecent(data) - case TypeSupergroupMembersFilterContacts: - return UnmarshalSupergroupMembersFilterContacts(data) + case TypeSupergroupMembersFilterContacts: + return UnmarshalSupergroupMembersFilterContacts(data) - case TypeSupergroupMembersFilterAdministrators: - return UnmarshalSupergroupMembersFilterAdministrators(data) + case TypeSupergroupMembersFilterAdministrators: + return UnmarshalSupergroupMembersFilterAdministrators(data) - case TypeSupergroupMembersFilterSearch: - return UnmarshalSupergroupMembersFilterSearch(data) + case TypeSupergroupMembersFilterSearch: + return UnmarshalSupergroupMembersFilterSearch(data) - case TypeSupergroupMembersFilterRestricted: - return UnmarshalSupergroupMembersFilterRestricted(data) + case TypeSupergroupMembersFilterRestricted: + return UnmarshalSupergroupMembersFilterRestricted(data) - case TypeSupergroupMembersFilterBanned: - return UnmarshalSupergroupMembersFilterBanned(data) + case TypeSupergroupMembersFilterBanned: + return UnmarshalSupergroupMembersFilterBanned(data) - case TypeSupergroupMembersFilterMention: - return UnmarshalSupergroupMembersFilterMention(data) + case TypeSupergroupMembersFilterMention: + return UnmarshalSupergroupMembersFilterMention(data) - case TypeSupergroupMembersFilterBots: - return UnmarshalSupergroupMembersFilterBots(data) + case TypeSupergroupMembersFilterBots: + return UnmarshalSupergroupMembersFilterBots(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfSupergroupMembersFilter(dataList []json.RawMessage) ([]SupergroupMembersFilter, error) { - list := []SupergroupMembersFilter{} + list := []SupergroupMembersFilter{} - for _, data := range dataList { - entity, err := UnmarshalSupergroupMembersFilter(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalSupergroupMembersFilter(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil +} + +func UnmarshalInviteLinkChatType(data json.RawMessage) (InviteLinkChatType, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeInviteLinkChatTypeBasicGroup: + return UnmarshalInviteLinkChatTypeBasicGroup(data) + + case TypeInviteLinkChatTypeSupergroup: + return UnmarshalInviteLinkChatTypeSupergroup(data) + + case TypeInviteLinkChatTypeChannel: + return UnmarshalInviteLinkChatTypeChannel(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfInviteLinkChatType(dataList []json.RawMessage) ([]InviteLinkChatType, error) { + list := []InviteLinkChatType{} + + for _, data := range dataList { + entity, err := UnmarshalInviteLinkChatType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil } func UnmarshalSecretChatState(data json.RawMessage) (SecretChatState, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeSecretChatStatePending: - return UnmarshalSecretChatStatePending(data) + switch meta.Type { + case TypeSecretChatStatePending: + return UnmarshalSecretChatStatePending(data) - case TypeSecretChatStateReady: - return UnmarshalSecretChatStateReady(data) + case TypeSecretChatStateReady: + return UnmarshalSecretChatStateReady(data) - case TypeSecretChatStateClosed: - return UnmarshalSecretChatStateClosed(data) + case TypeSecretChatStateClosed: + return UnmarshalSecretChatStateClosed(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfSecretChatState(dataList []json.RawMessage) ([]SecretChatState, error) { - list := []SecretChatState{} + list := []SecretChatState{} - for _, data := range dataList { - entity, err := UnmarshalSecretChatState(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalSecretChatState(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalMessageSender(data json.RawMessage) (MessageSender, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeMessageSenderUser: - return UnmarshalMessageSenderUser(data) + switch meta.Type { + case TypeMessageSenderUser: + return UnmarshalMessageSenderUser(data) - case TypeMessageSenderChat: - return UnmarshalMessageSenderChat(data) + case TypeMessageSenderChat: + return UnmarshalMessageSenderChat(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfMessageSender(dataList []json.RawMessage) ([]MessageSender, error) { - list := []MessageSender{} + list := []MessageSender{} - for _, data := range dataList { - entity, err := UnmarshalMessageSender(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalMessageSender(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } -func UnmarshalMessageForwardOrigin(data json.RawMessage) (MessageForwardOrigin, error) { - var meta meta +func UnmarshalMessageReadDate(data json.RawMessage) (MessageReadDate, error) { + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeMessageForwardOriginUser: - return UnmarshalMessageForwardOriginUser(data) + switch meta.Type { + case TypeMessageReadDateRead: + return UnmarshalMessageReadDateRead(data) - case TypeMessageForwardOriginChat: - return UnmarshalMessageForwardOriginChat(data) + case TypeMessageReadDateUnread: + return UnmarshalMessageReadDateUnread(data) - case TypeMessageForwardOriginHiddenUser: - return UnmarshalMessageForwardOriginHiddenUser(data) + case TypeMessageReadDateTooOld: + return UnmarshalMessageReadDateTooOld(data) - case TypeMessageForwardOriginChannel: - return UnmarshalMessageForwardOriginChannel(data) + case TypeMessageReadDateUserPrivacyRestricted: + return UnmarshalMessageReadDateUserPrivacyRestricted(data) - case TypeMessageForwardOriginMessageImport: - return UnmarshalMessageForwardOriginMessageImport(data) + case TypeMessageReadDateMyPrivacyRestricted: + return UnmarshalMessageReadDateMyPrivacyRestricted(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } -func UnmarshalListOfMessageForwardOrigin(dataList []json.RawMessage) ([]MessageForwardOrigin, error) { - list := []MessageForwardOrigin{} +func UnmarshalListOfMessageReadDate(dataList []json.RawMessage) ([]MessageReadDate, error) { + list := []MessageReadDate{} - for _, data := range dataList { - entity, err := UnmarshalMessageForwardOrigin(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalMessageReadDate(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil +} + +func UnmarshalMessageOrigin(data json.RawMessage) (MessageOrigin, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeMessageOriginUser: + return UnmarshalMessageOriginUser(data) + + case TypeMessageOriginHiddenUser: + return UnmarshalMessageOriginHiddenUser(data) + + case TypeMessageOriginChat: + return UnmarshalMessageOriginChat(data) + + case TypeMessageOriginChannel: + return UnmarshalMessageOriginChannel(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfMessageOrigin(dataList []json.RawMessage) ([]MessageOrigin, error) { + list := []MessageOrigin{} + + for _, data := range dataList { + entity, err := UnmarshalMessageOrigin(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil } func UnmarshalReactionType(data json.RawMessage) (ReactionType, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeReactionTypeEmoji: - return UnmarshalReactionTypeEmoji(data) + switch meta.Type { + case TypeReactionTypeEmoji: + return UnmarshalReactionTypeEmoji(data) - case TypeReactionTypeCustomEmoji: - return UnmarshalReactionTypeCustomEmoji(data) + case TypeReactionTypeCustomEmoji: + return UnmarshalReactionTypeCustomEmoji(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfReactionType(dataList []json.RawMessage) ([]ReactionType, error) { - list := []ReactionType{} + list := []ReactionType{} - for _, data := range dataList { - entity, err := UnmarshalReactionType(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalReactionType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalMessageSendingState(data json.RawMessage) (MessageSendingState, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeMessageSendingStatePending: - return UnmarshalMessageSendingStatePending(data) + switch meta.Type { + case TypeMessageSendingStatePending: + return UnmarshalMessageSendingStatePending(data) - case TypeMessageSendingStateFailed: - return UnmarshalMessageSendingStateFailed(data) + case TypeMessageSendingStateFailed: + return UnmarshalMessageSendingStateFailed(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfMessageSendingState(dataList []json.RawMessage) ([]MessageSendingState, error) { - list := []MessageSendingState{} + list := []MessageSendingState{} - for _, data := range dataList { - entity, err := UnmarshalMessageSendingState(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalMessageSendingState(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil +} + +func UnmarshalMessageReplyTo(data json.RawMessage) (MessageReplyTo, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeMessageReplyToMessage: + return UnmarshalMessageReplyToMessage(data) + + case TypeMessageReplyToStory: + return UnmarshalMessageReplyToStory(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfMessageReplyTo(dataList []json.RawMessage) ([]MessageReplyTo, error) { + list := []MessageReplyTo{} + + for _, data := range dataList { + entity, err := UnmarshalMessageReplyTo(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalInputMessageReplyTo(data json.RawMessage) (InputMessageReplyTo, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeInputMessageReplyToMessage: + return UnmarshalInputMessageReplyToMessage(data) + + case TypeInputMessageReplyToStory: + return UnmarshalInputMessageReplyToStory(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfInputMessageReplyTo(dataList []json.RawMessage) ([]InputMessageReplyTo, error) { + list := []InputMessageReplyTo{} + + for _, data := range dataList { + entity, err := UnmarshalInputMessageReplyTo(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalMessageSource(data json.RawMessage) (MessageSource, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeMessageSourceChatHistory: + return UnmarshalMessageSourceChatHistory(data) + + case TypeMessageSourceMessageThreadHistory: + return UnmarshalMessageSourceMessageThreadHistory(data) + + case TypeMessageSourceForumTopicHistory: + return UnmarshalMessageSourceForumTopicHistory(data) + + case TypeMessageSourceHistoryPreview: + return UnmarshalMessageSourceHistoryPreview(data) + + case TypeMessageSourceChatList: + return UnmarshalMessageSourceChatList(data) + + case TypeMessageSourceSearch: + return UnmarshalMessageSourceSearch(data) + + case TypeMessageSourceChatEventLog: + return UnmarshalMessageSourceChatEventLog(data) + + case TypeMessageSourceNotification: + return UnmarshalMessageSourceNotification(data) + + case TypeMessageSourceScreenshot: + return UnmarshalMessageSourceScreenshot(data) + + case TypeMessageSourceOther: + return UnmarshalMessageSourceOther(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfMessageSource(dataList []json.RawMessage) ([]MessageSource, error) { + list := []MessageSource{} + + for _, data := range dataList { + entity, err := UnmarshalMessageSource(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalMessageSponsorType(data json.RawMessage) (MessageSponsorType, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeMessageSponsorTypeBot: + return UnmarshalMessageSponsorTypeBot(data) + + case TypeMessageSponsorTypeWebApp: + return UnmarshalMessageSponsorTypeWebApp(data) + + case TypeMessageSponsorTypePublicChannel: + return UnmarshalMessageSponsorTypePublicChannel(data) + + case TypeMessageSponsorTypePrivateChannel: + return UnmarshalMessageSponsorTypePrivateChannel(data) + + case TypeMessageSponsorTypeWebsite: + return UnmarshalMessageSponsorTypeWebsite(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfMessageSponsorType(dataList []json.RawMessage) ([]MessageSponsorType, error) { + list := []MessageSponsorType{} + + for _, data := range dataList { + entity, err := UnmarshalMessageSponsorType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalReportChatSponsoredMessageResult(data json.RawMessage) (ReportChatSponsoredMessageResult, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeReportChatSponsoredMessageResultOk: + return UnmarshalReportChatSponsoredMessageResultOk(data) + + case TypeReportChatSponsoredMessageResultFailed: + return UnmarshalReportChatSponsoredMessageResultFailed(data) + + case TypeReportChatSponsoredMessageResultOptionRequired: + return UnmarshalReportChatSponsoredMessageResultOptionRequired(data) + + case TypeReportChatSponsoredMessageResultAdsHidden: + return UnmarshalReportChatSponsoredMessageResultAdsHidden(data) + + case TypeReportChatSponsoredMessageResultPremiumRequired: + return UnmarshalReportChatSponsoredMessageResultPremiumRequired(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfReportChatSponsoredMessageResult(dataList []json.RawMessage) ([]ReportChatSponsoredMessageResult, error) { + list := []ReportChatSponsoredMessageResult{} + + for _, data := range dataList { + entity, err := UnmarshalReportChatSponsoredMessageResult(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil } func UnmarshalNotificationSettingsScope(data json.RawMessage) (NotificationSettingsScope, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeNotificationSettingsScopePrivateChats: - return UnmarshalNotificationSettingsScopePrivateChats(data) + switch meta.Type { + case TypeNotificationSettingsScopePrivateChats: + return UnmarshalNotificationSettingsScopePrivateChats(data) - case TypeNotificationSettingsScopeGroupChats: - return UnmarshalNotificationSettingsScopeGroupChats(data) + case TypeNotificationSettingsScopeGroupChats: + return UnmarshalNotificationSettingsScopeGroupChats(data) - case TypeNotificationSettingsScopeChannelChats: - return UnmarshalNotificationSettingsScopeChannelChats(data) + case TypeNotificationSettingsScopeChannelChats: + return UnmarshalNotificationSettingsScopeChannelChats(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfNotificationSettingsScope(dataList []json.RawMessage) ([]NotificationSettingsScope, error) { - list := []NotificationSettingsScope{} + list := []NotificationSettingsScope{} - for _, data := range dataList { - entity, err := UnmarshalNotificationSettingsScope(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalNotificationSettingsScope(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalChatType(data json.RawMessage) (ChatType, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeChatTypePrivate: - return UnmarshalChatTypePrivate(data) + switch meta.Type { + case TypeChatTypePrivate: + return UnmarshalChatTypePrivate(data) - case TypeChatTypeBasicGroup: - return UnmarshalChatTypeBasicGroup(data) + case TypeChatTypeBasicGroup: + return UnmarshalChatTypeBasicGroup(data) - case TypeChatTypeSupergroup: - return UnmarshalChatTypeSupergroup(data) + case TypeChatTypeSupergroup: + return UnmarshalChatTypeSupergroup(data) - case TypeChatTypeSecret: - return UnmarshalChatTypeSecret(data) + case TypeChatTypeSecret: + return UnmarshalChatTypeSecret(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfChatType(dataList []json.RawMessage) ([]ChatType, error) { - list := []ChatType{} + list := []ChatType{} - for _, data := range dataList { - entity, err := UnmarshalChatType(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalChatType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalChatList(data json.RawMessage) (ChatList, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeChatListMain: - return UnmarshalChatListMain(data) + switch meta.Type { + case TypeChatListMain: + return UnmarshalChatListMain(data) - case TypeChatListArchive: - return UnmarshalChatListArchive(data) + case TypeChatListArchive: + return UnmarshalChatListArchive(data) - case TypeChatListFilter: - return UnmarshalChatListFilter(data) + case TypeChatListFolder: + return UnmarshalChatListFolder(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfChatList(dataList []json.RawMessage) ([]ChatList, error) { - list := []ChatList{} + list := []ChatList{} - for _, data := range dataList { - entity, err := UnmarshalChatList(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalChatList(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalChatSource(data json.RawMessage) (ChatSource, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeChatSourceMtprotoProxy: - return UnmarshalChatSourceMtprotoProxy(data) + switch meta.Type { + case TypeChatSourceMtprotoProxy: + return UnmarshalChatSourceMtprotoProxy(data) - case TypeChatSourcePublicServiceAnnouncement: - return UnmarshalChatSourcePublicServiceAnnouncement(data) + case TypeChatSourcePublicServiceAnnouncement: + return UnmarshalChatSourcePublicServiceAnnouncement(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfChatSource(dataList []json.RawMessage) ([]ChatSource, error) { - list := []ChatSource{} + list := []ChatSource{} - for _, data := range dataList { - entity, err := UnmarshalChatSource(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalChatSource(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalChatAvailableReactions(data json.RawMessage) (ChatAvailableReactions, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeChatAvailableReactionsAll: - return UnmarshalChatAvailableReactionsAll(data) + switch meta.Type { + case TypeChatAvailableReactionsAll: + return UnmarshalChatAvailableReactionsAll(data) - case TypeChatAvailableReactionsSome: - return UnmarshalChatAvailableReactionsSome(data) + case TypeChatAvailableReactionsSome: + return UnmarshalChatAvailableReactionsSome(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfChatAvailableReactions(dataList []json.RawMessage) ([]ChatAvailableReactions, error) { - list := []ChatAvailableReactions{} + list := []ChatAvailableReactions{} - for _, data := range dataList { - entity, err := UnmarshalChatAvailableReactions(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalChatAvailableReactions(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalPublicChatType(data json.RawMessage) (PublicChatType, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypePublicChatTypeHasUsername: - return UnmarshalPublicChatTypeHasUsername(data) + switch meta.Type { + case TypePublicChatTypeHasUsername: + return UnmarshalPublicChatTypeHasUsername(data) - case TypePublicChatTypeIsLocationBased: - return UnmarshalPublicChatTypeIsLocationBased(data) + case TypePublicChatTypeIsLocationBased: + return UnmarshalPublicChatTypeIsLocationBased(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfPublicChatType(dataList []json.RawMessage) ([]PublicChatType, error) { - list := []PublicChatType{} + list := []PublicChatType{} - for _, data := range dataList { - entity, err := UnmarshalPublicChatType(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalPublicChatType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalChatActionBar(data json.RawMessage) (ChatActionBar, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeChatActionBarReportSpam: - return UnmarshalChatActionBarReportSpam(data) + switch meta.Type { + case TypeChatActionBarReportSpam: + return UnmarshalChatActionBarReportSpam(data) - case TypeChatActionBarReportUnrelatedLocation: - return UnmarshalChatActionBarReportUnrelatedLocation(data) + case TypeChatActionBarReportUnrelatedLocation: + return UnmarshalChatActionBarReportUnrelatedLocation(data) - case TypeChatActionBarInviteMembers: - return UnmarshalChatActionBarInviteMembers(data) + case TypeChatActionBarInviteMembers: + return UnmarshalChatActionBarInviteMembers(data) - case TypeChatActionBarReportAddBlock: - return UnmarshalChatActionBarReportAddBlock(data) + case TypeChatActionBarReportAddBlock: + return UnmarshalChatActionBarReportAddBlock(data) - case TypeChatActionBarAddContact: - return UnmarshalChatActionBarAddContact(data) + case TypeChatActionBarAddContact: + return UnmarshalChatActionBarAddContact(data) - case TypeChatActionBarSharePhoneNumber: - return UnmarshalChatActionBarSharePhoneNumber(data) + case TypeChatActionBarSharePhoneNumber: + return UnmarshalChatActionBarSharePhoneNumber(data) - case TypeChatActionBarJoinRequest: - return UnmarshalChatActionBarJoinRequest(data) + case TypeChatActionBarJoinRequest: + return UnmarshalChatActionBarJoinRequest(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfChatActionBar(dataList []json.RawMessage) ([]ChatActionBar, error) { - list := []ChatActionBar{} + list := []ChatActionBar{} - for _, data := range dataList { - entity, err := UnmarshalChatActionBar(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalChatActionBar(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalKeyboardButtonType(data json.RawMessage) (KeyboardButtonType, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeKeyboardButtonTypeText: - return UnmarshalKeyboardButtonTypeText(data) + switch meta.Type { + case TypeKeyboardButtonTypeText: + return UnmarshalKeyboardButtonTypeText(data) - case TypeKeyboardButtonTypeRequestPhoneNumber: - return UnmarshalKeyboardButtonTypeRequestPhoneNumber(data) + case TypeKeyboardButtonTypeRequestPhoneNumber: + return UnmarshalKeyboardButtonTypeRequestPhoneNumber(data) - case TypeKeyboardButtonTypeRequestLocation: - return UnmarshalKeyboardButtonTypeRequestLocation(data) + case TypeKeyboardButtonTypeRequestLocation: + return UnmarshalKeyboardButtonTypeRequestLocation(data) - case TypeKeyboardButtonTypeRequestPoll: - return UnmarshalKeyboardButtonTypeRequestPoll(data) + case TypeKeyboardButtonTypeRequestPoll: + return UnmarshalKeyboardButtonTypeRequestPoll(data) - case TypeKeyboardButtonTypeWebApp: - return UnmarshalKeyboardButtonTypeWebApp(data) + case TypeKeyboardButtonTypeRequestUsers: + return UnmarshalKeyboardButtonTypeRequestUsers(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + case TypeKeyboardButtonTypeRequestChat: + return UnmarshalKeyboardButtonTypeRequestChat(data) + + case TypeKeyboardButtonTypeWebApp: + return UnmarshalKeyboardButtonTypeWebApp(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfKeyboardButtonType(dataList []json.RawMessage) ([]KeyboardButtonType, error) { - list := []KeyboardButtonType{} + list := []KeyboardButtonType{} - for _, data := range dataList { - entity, err := UnmarshalKeyboardButtonType(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalKeyboardButtonType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalInlineKeyboardButtonType(data json.RawMessage) (InlineKeyboardButtonType, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeInlineKeyboardButtonTypeUrl: - return UnmarshalInlineKeyboardButtonTypeUrl(data) + switch meta.Type { + case TypeInlineKeyboardButtonTypeUrl: + return UnmarshalInlineKeyboardButtonTypeUrl(data) - case TypeInlineKeyboardButtonTypeLoginUrl: - return UnmarshalInlineKeyboardButtonTypeLoginUrl(data) + case TypeInlineKeyboardButtonTypeLoginUrl: + return UnmarshalInlineKeyboardButtonTypeLoginUrl(data) - case TypeInlineKeyboardButtonTypeWebApp: - return UnmarshalInlineKeyboardButtonTypeWebApp(data) + case TypeInlineKeyboardButtonTypeWebApp: + return UnmarshalInlineKeyboardButtonTypeWebApp(data) - case TypeInlineKeyboardButtonTypeCallback: - return UnmarshalInlineKeyboardButtonTypeCallback(data) + case TypeInlineKeyboardButtonTypeCallback: + return UnmarshalInlineKeyboardButtonTypeCallback(data) - case TypeInlineKeyboardButtonTypeCallbackWithPassword: - return UnmarshalInlineKeyboardButtonTypeCallbackWithPassword(data) + case TypeInlineKeyboardButtonTypeCallbackWithPassword: + return UnmarshalInlineKeyboardButtonTypeCallbackWithPassword(data) - case TypeInlineKeyboardButtonTypeCallbackGame: - return UnmarshalInlineKeyboardButtonTypeCallbackGame(data) + case TypeInlineKeyboardButtonTypeCallbackGame: + return UnmarshalInlineKeyboardButtonTypeCallbackGame(data) - case TypeInlineKeyboardButtonTypeSwitchInline: - return UnmarshalInlineKeyboardButtonTypeSwitchInline(data) + case TypeInlineKeyboardButtonTypeSwitchInline: + return UnmarshalInlineKeyboardButtonTypeSwitchInline(data) - case TypeInlineKeyboardButtonTypeBuy: - return UnmarshalInlineKeyboardButtonTypeBuy(data) + case TypeInlineKeyboardButtonTypeBuy: + return UnmarshalInlineKeyboardButtonTypeBuy(data) - case TypeInlineKeyboardButtonTypeUser: - return UnmarshalInlineKeyboardButtonTypeUser(data) + case TypeInlineKeyboardButtonTypeUser: + return UnmarshalInlineKeyboardButtonTypeUser(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfInlineKeyboardButtonType(dataList []json.RawMessage) ([]InlineKeyboardButtonType, error) { - list := []InlineKeyboardButtonType{} + list := []InlineKeyboardButtonType{} - for _, data := range dataList { - entity, err := UnmarshalInlineKeyboardButtonType(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalInlineKeyboardButtonType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalReplyMarkup(data json.RawMessage) (ReplyMarkup, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeReplyMarkupRemoveKeyboard: - return UnmarshalReplyMarkupRemoveKeyboard(data) + switch meta.Type { + case TypeReplyMarkupRemoveKeyboard: + return UnmarshalReplyMarkupRemoveKeyboard(data) - case TypeReplyMarkupForceReply: - return UnmarshalReplyMarkupForceReply(data) + case TypeReplyMarkupForceReply: + return UnmarshalReplyMarkupForceReply(data) - case TypeReplyMarkupShowKeyboard: - return UnmarshalReplyMarkupShowKeyboard(data) + case TypeReplyMarkupShowKeyboard: + return UnmarshalReplyMarkupShowKeyboard(data) - case TypeReplyMarkupInlineKeyboard: - return UnmarshalReplyMarkupInlineKeyboard(data) + case TypeReplyMarkupInlineKeyboard: + return UnmarshalReplyMarkupInlineKeyboard(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfReplyMarkup(dataList []json.RawMessage) ([]ReplyMarkup, error) { - list := []ReplyMarkup{} + list := []ReplyMarkup{} - for _, data := range dataList { - entity, err := UnmarshalReplyMarkup(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalReplyMarkup(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalLoginUrlInfo(data json.RawMessage) (LoginUrlInfo, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeLoginUrlInfoOpen: - return UnmarshalLoginUrlInfoOpen(data) + switch meta.Type { + case TypeLoginUrlInfoOpen: + return UnmarshalLoginUrlInfoOpen(data) - case TypeLoginUrlInfoRequestConfirmation: - return UnmarshalLoginUrlInfoRequestConfirmation(data) + case TypeLoginUrlInfoRequestConfirmation: + return UnmarshalLoginUrlInfoRequestConfirmation(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfLoginUrlInfo(dataList []json.RawMessage) ([]LoginUrlInfo, error) { - list := []LoginUrlInfo{} + list := []LoginUrlInfo{} - for _, data := range dataList { - entity, err := UnmarshalLoginUrlInfo(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalLoginUrlInfo(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil +} + +func UnmarshalSavedMessagesTopicType(data json.RawMessage) (SavedMessagesTopicType, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeSavedMessagesTopicTypeMyNotes: + return UnmarshalSavedMessagesTopicTypeMyNotes(data) + + case TypeSavedMessagesTopicTypeAuthorHidden: + return UnmarshalSavedMessagesTopicTypeAuthorHidden(data) + + case TypeSavedMessagesTopicTypeSavedFromChat: + return UnmarshalSavedMessagesTopicTypeSavedFromChat(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfSavedMessagesTopicType(dataList []json.RawMessage) ([]SavedMessagesTopicType, error) { + list := []SavedMessagesTopicType{} + + for _, data := range dataList { + entity, err := UnmarshalSavedMessagesTopicType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil } func UnmarshalRichText(data json.RawMessage) (RichText, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeRichTextPlain: - return UnmarshalRichTextPlain(data) + switch meta.Type { + case TypeRichTextPlain: + return UnmarshalRichTextPlain(data) - case TypeRichTextBold: - return UnmarshalRichTextBold(data) + case TypeRichTextBold: + return UnmarshalRichTextBold(data) - case TypeRichTextItalic: - return UnmarshalRichTextItalic(data) + case TypeRichTextItalic: + return UnmarshalRichTextItalic(data) - case TypeRichTextUnderline: - return UnmarshalRichTextUnderline(data) + case TypeRichTextUnderline: + return UnmarshalRichTextUnderline(data) - case TypeRichTextStrikethrough: - return UnmarshalRichTextStrikethrough(data) + case TypeRichTextStrikethrough: + return UnmarshalRichTextStrikethrough(data) - case TypeRichTextFixed: - return UnmarshalRichTextFixed(data) + case TypeRichTextFixed: + return UnmarshalRichTextFixed(data) - case TypeRichTextUrl: - return UnmarshalRichTextUrl(data) + case TypeRichTextUrl: + return UnmarshalRichTextUrl(data) - case TypeRichTextEmailAddress: - return UnmarshalRichTextEmailAddress(data) + case TypeRichTextEmailAddress: + return UnmarshalRichTextEmailAddress(data) - case TypeRichTextSubscript: - return UnmarshalRichTextSubscript(data) + case TypeRichTextSubscript: + return UnmarshalRichTextSubscript(data) - case TypeRichTextSuperscript: - return UnmarshalRichTextSuperscript(data) + case TypeRichTextSuperscript: + return UnmarshalRichTextSuperscript(data) - case TypeRichTextMarked: - return UnmarshalRichTextMarked(data) + case TypeRichTextMarked: + return UnmarshalRichTextMarked(data) - case TypeRichTextPhoneNumber: - return UnmarshalRichTextPhoneNumber(data) + case TypeRichTextPhoneNumber: + return UnmarshalRichTextPhoneNumber(data) - case TypeRichTextIcon: - return UnmarshalRichTextIcon(data) + case TypeRichTextIcon: + return UnmarshalRichTextIcon(data) - case TypeRichTextReference: - return UnmarshalRichTextReference(data) + case TypeRichTextReference: + return UnmarshalRichTextReference(data) - case TypeRichTextAnchor: - return UnmarshalRichTextAnchor(data) + case TypeRichTextAnchor: + return UnmarshalRichTextAnchor(data) - case TypeRichTextAnchorLink: - return UnmarshalRichTextAnchorLink(data) + case TypeRichTextAnchorLink: + return UnmarshalRichTextAnchorLink(data) - case TypeRichTexts: - return UnmarshalRichTexts(data) + case TypeRichTexts: + return UnmarshalRichTexts(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfRichText(dataList []json.RawMessage) ([]RichText, error) { - list := []RichText{} + list := []RichText{} - for _, data := range dataList { - entity, err := UnmarshalRichText(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalRichText(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalPageBlockHorizontalAlignment(data json.RawMessage) (PageBlockHorizontalAlignment, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypePageBlockHorizontalAlignmentLeft: - return UnmarshalPageBlockHorizontalAlignmentLeft(data) + switch meta.Type { + case TypePageBlockHorizontalAlignmentLeft: + return UnmarshalPageBlockHorizontalAlignmentLeft(data) - case TypePageBlockHorizontalAlignmentCenter: - return UnmarshalPageBlockHorizontalAlignmentCenter(data) + case TypePageBlockHorizontalAlignmentCenter: + return UnmarshalPageBlockHorizontalAlignmentCenter(data) - case TypePageBlockHorizontalAlignmentRight: - return UnmarshalPageBlockHorizontalAlignmentRight(data) + case TypePageBlockHorizontalAlignmentRight: + return UnmarshalPageBlockHorizontalAlignmentRight(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfPageBlockHorizontalAlignment(dataList []json.RawMessage) ([]PageBlockHorizontalAlignment, error) { - list := []PageBlockHorizontalAlignment{} + list := []PageBlockHorizontalAlignment{} - for _, data := range dataList { - entity, err := UnmarshalPageBlockHorizontalAlignment(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalPageBlockHorizontalAlignment(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalPageBlockVerticalAlignment(data json.RawMessage) (PageBlockVerticalAlignment, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypePageBlockVerticalAlignmentTop: - return UnmarshalPageBlockVerticalAlignmentTop(data) + switch meta.Type { + case TypePageBlockVerticalAlignmentTop: + return UnmarshalPageBlockVerticalAlignmentTop(data) - case TypePageBlockVerticalAlignmentMiddle: - return UnmarshalPageBlockVerticalAlignmentMiddle(data) + case TypePageBlockVerticalAlignmentMiddle: + return UnmarshalPageBlockVerticalAlignmentMiddle(data) - case TypePageBlockVerticalAlignmentBottom: - return UnmarshalPageBlockVerticalAlignmentBottom(data) + case TypePageBlockVerticalAlignmentBottom: + return UnmarshalPageBlockVerticalAlignmentBottom(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfPageBlockVerticalAlignment(dataList []json.RawMessage) ([]PageBlockVerticalAlignment, error) { - list := []PageBlockVerticalAlignment{} + list := []PageBlockVerticalAlignment{} - for _, data := range dataList { - entity, err := UnmarshalPageBlockVerticalAlignment(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalPageBlockVerticalAlignment(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalPageBlock(data json.RawMessage) (PageBlock, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypePageBlockTitle: - return UnmarshalPageBlockTitle(data) + switch meta.Type { + case TypePageBlockTitle: + return UnmarshalPageBlockTitle(data) - case TypePageBlockSubtitle: - return UnmarshalPageBlockSubtitle(data) + case TypePageBlockSubtitle: + return UnmarshalPageBlockSubtitle(data) - case TypePageBlockAuthorDate: - return UnmarshalPageBlockAuthorDate(data) + case TypePageBlockAuthorDate: + return UnmarshalPageBlockAuthorDate(data) - case TypePageBlockHeader: - return UnmarshalPageBlockHeader(data) + case TypePageBlockHeader: + return UnmarshalPageBlockHeader(data) - case TypePageBlockSubheader: - return UnmarshalPageBlockSubheader(data) + case TypePageBlockSubheader: + return UnmarshalPageBlockSubheader(data) - case TypePageBlockKicker: - return UnmarshalPageBlockKicker(data) + case TypePageBlockKicker: + return UnmarshalPageBlockKicker(data) - case TypePageBlockParagraph: - return UnmarshalPageBlockParagraph(data) + case TypePageBlockParagraph: + return UnmarshalPageBlockParagraph(data) - case TypePageBlockPreformatted: - return UnmarshalPageBlockPreformatted(data) + case TypePageBlockPreformatted: + return UnmarshalPageBlockPreformatted(data) - case TypePageBlockFooter: - return UnmarshalPageBlockFooter(data) + case TypePageBlockFooter: + return UnmarshalPageBlockFooter(data) - case TypePageBlockDivider: - return UnmarshalPageBlockDivider(data) + case TypePageBlockDivider: + return UnmarshalPageBlockDivider(data) - case TypePageBlockAnchor: - return UnmarshalPageBlockAnchor(data) + case TypePageBlockAnchor: + return UnmarshalPageBlockAnchor(data) - case TypePageBlockList: - return UnmarshalPageBlockList(data) + case TypePageBlockList: + return UnmarshalPageBlockList(data) - case TypePageBlockBlockQuote: - return UnmarshalPageBlockBlockQuote(data) + case TypePageBlockBlockQuote: + return UnmarshalPageBlockBlockQuote(data) - case TypePageBlockPullQuote: - return UnmarshalPageBlockPullQuote(data) + case TypePageBlockPullQuote: + return UnmarshalPageBlockPullQuote(data) - case TypePageBlockAnimation: - return UnmarshalPageBlockAnimation(data) + case TypePageBlockAnimation: + return UnmarshalPageBlockAnimation(data) - case TypePageBlockAudio: - return UnmarshalPageBlockAudio(data) + case TypePageBlockAudio: + return UnmarshalPageBlockAudio(data) - case TypePageBlockPhoto: - return UnmarshalPageBlockPhoto(data) + case TypePageBlockPhoto: + return UnmarshalPageBlockPhoto(data) - case TypePageBlockVideo: - return UnmarshalPageBlockVideo(data) + case TypePageBlockVideo: + return UnmarshalPageBlockVideo(data) - case TypePageBlockVoiceNote: - return UnmarshalPageBlockVoiceNote(data) + case TypePageBlockVoiceNote: + return UnmarshalPageBlockVoiceNote(data) - case TypePageBlockCover: - return UnmarshalPageBlockCover(data) + case TypePageBlockCover: + return UnmarshalPageBlockCover(data) - case TypePageBlockEmbedded: - return UnmarshalPageBlockEmbedded(data) + case TypePageBlockEmbedded: + return UnmarshalPageBlockEmbedded(data) - case TypePageBlockEmbeddedPost: - return UnmarshalPageBlockEmbeddedPost(data) + case TypePageBlockEmbeddedPost: + return UnmarshalPageBlockEmbeddedPost(data) - case TypePageBlockCollage: - return UnmarshalPageBlockCollage(data) + case TypePageBlockCollage: + return UnmarshalPageBlockCollage(data) - case TypePageBlockSlideshow: - return UnmarshalPageBlockSlideshow(data) + case TypePageBlockSlideshow: + return UnmarshalPageBlockSlideshow(data) - case TypePageBlockChatLink: - return UnmarshalPageBlockChatLink(data) + case TypePageBlockChatLink: + return UnmarshalPageBlockChatLink(data) - case TypePageBlockTable: - return UnmarshalPageBlockTable(data) + case TypePageBlockTable: + return UnmarshalPageBlockTable(data) - case TypePageBlockDetails: - return UnmarshalPageBlockDetails(data) + case TypePageBlockDetails: + return UnmarshalPageBlockDetails(data) - case TypePageBlockRelatedArticles: - return UnmarshalPageBlockRelatedArticles(data) + case TypePageBlockRelatedArticles: + return UnmarshalPageBlockRelatedArticles(data) - case TypePageBlockMap: - return UnmarshalPageBlockMap(data) + case TypePageBlockMap: + return UnmarshalPageBlockMap(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfPageBlock(dataList []json.RawMessage) ([]PageBlock, error) { - list := []PageBlock{} + list := []PageBlock{} - for _, data := range dataList { - entity, err := UnmarshalPageBlock(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalPageBlock(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil +} + +func UnmarshalCollectibleItemType(data json.RawMessage) (CollectibleItemType, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeCollectibleItemTypeUsername: + return UnmarshalCollectibleItemTypeUsername(data) + + case TypeCollectibleItemTypePhoneNumber: + return UnmarshalCollectibleItemTypePhoneNumber(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfCollectibleItemType(dataList []json.RawMessage) ([]CollectibleItemType, error) { + list := []CollectibleItemType{} + + for _, data := range dataList { + entity, err := UnmarshalCollectibleItemType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil } func UnmarshalInputCredentials(data json.RawMessage) (InputCredentials, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeInputCredentialsSaved: - return UnmarshalInputCredentialsSaved(data) + switch meta.Type { + case TypeInputCredentialsSaved: + return UnmarshalInputCredentialsSaved(data) - case TypeInputCredentialsNew: - return UnmarshalInputCredentialsNew(data) + case TypeInputCredentialsNew: + return UnmarshalInputCredentialsNew(data) - case TypeInputCredentialsApplePay: - return UnmarshalInputCredentialsApplePay(data) + case TypeInputCredentialsApplePay: + return UnmarshalInputCredentialsApplePay(data) - case TypeInputCredentialsGooglePay: - return UnmarshalInputCredentialsGooglePay(data) + case TypeInputCredentialsGooglePay: + return UnmarshalInputCredentialsGooglePay(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfInputCredentials(dataList []json.RawMessage) ([]InputCredentials, error) { - list := []InputCredentials{} + list := []InputCredentials{} - for _, data := range dataList { - entity, err := UnmarshalInputCredentials(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalInputCredentials(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalPaymentProvider(data json.RawMessage) (PaymentProvider, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypePaymentProviderSmartGlocal: - return UnmarshalPaymentProviderSmartGlocal(data) + switch meta.Type { + case TypePaymentProviderSmartGlocal: + return UnmarshalPaymentProviderSmartGlocal(data) - case TypePaymentProviderStripe: - return UnmarshalPaymentProviderStripe(data) + case TypePaymentProviderStripe: + return UnmarshalPaymentProviderStripe(data) - case TypePaymentProviderOther: - return UnmarshalPaymentProviderOther(data) + case TypePaymentProviderOther: + return UnmarshalPaymentProviderOther(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfPaymentProvider(dataList []json.RawMessage) ([]PaymentProvider, error) { - list := []PaymentProvider{} + list := []PaymentProvider{} - for _, data := range dataList { - entity, err := UnmarshalPaymentProvider(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalPaymentProvider(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalInputInvoice(data json.RawMessage) (InputInvoice, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeInputInvoiceMessage: - return UnmarshalInputInvoiceMessage(data) + switch meta.Type { + case TypeInputInvoiceMessage: + return UnmarshalInputInvoiceMessage(data) - case TypeInputInvoiceName: - return UnmarshalInputInvoiceName(data) + case TypeInputInvoiceName: + return UnmarshalInputInvoiceName(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + case TypeInputInvoiceTelegram: + return UnmarshalInputInvoiceTelegram(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfInputInvoice(dataList []json.RawMessage) ([]InputInvoice, error) { - list := []InputInvoice{} + list := []InputInvoice{} - for _, data := range dataList { - entity, err := UnmarshalInputInvoice(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalInputInvoice(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalMessageExtendedMedia(data json.RawMessage) (MessageExtendedMedia, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeMessageExtendedMediaPreview: - return UnmarshalMessageExtendedMediaPreview(data) + switch meta.Type { + case TypeMessageExtendedMediaPreview: + return UnmarshalMessageExtendedMediaPreview(data) - case TypeMessageExtendedMediaPhoto: - return UnmarshalMessageExtendedMediaPhoto(data) + case TypeMessageExtendedMediaPhoto: + return UnmarshalMessageExtendedMediaPhoto(data) - case TypeMessageExtendedMediaVideo: - return UnmarshalMessageExtendedMediaVideo(data) + case TypeMessageExtendedMediaVideo: + return UnmarshalMessageExtendedMediaVideo(data) - case TypeMessageExtendedMediaUnsupported: - return UnmarshalMessageExtendedMediaUnsupported(data) + case TypeMessageExtendedMediaUnsupported: + return UnmarshalMessageExtendedMediaUnsupported(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfMessageExtendedMedia(dataList []json.RawMessage) ([]MessageExtendedMedia, error) { - list := []MessageExtendedMedia{} + list := []MessageExtendedMedia{} - for _, data := range dataList { - entity, err := UnmarshalMessageExtendedMedia(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalMessageExtendedMedia(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalPassportElementType(data json.RawMessage) (PassportElementType, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypePassportElementTypePersonalDetails: - return UnmarshalPassportElementTypePersonalDetails(data) + switch meta.Type { + case TypePassportElementTypePersonalDetails: + return UnmarshalPassportElementTypePersonalDetails(data) - case TypePassportElementTypePassport: - return UnmarshalPassportElementTypePassport(data) + case TypePassportElementTypePassport: + return UnmarshalPassportElementTypePassport(data) - case TypePassportElementTypeDriverLicense: - return UnmarshalPassportElementTypeDriverLicense(data) + case TypePassportElementTypeDriverLicense: + return UnmarshalPassportElementTypeDriverLicense(data) - case TypePassportElementTypeIdentityCard: - return UnmarshalPassportElementTypeIdentityCard(data) + case TypePassportElementTypeIdentityCard: + return UnmarshalPassportElementTypeIdentityCard(data) - case TypePassportElementTypeInternalPassport: - return UnmarshalPassportElementTypeInternalPassport(data) + case TypePassportElementTypeInternalPassport: + return UnmarshalPassportElementTypeInternalPassport(data) - case TypePassportElementTypeAddress: - return UnmarshalPassportElementTypeAddress(data) + case TypePassportElementTypeAddress: + return UnmarshalPassportElementTypeAddress(data) - case TypePassportElementTypeUtilityBill: - return UnmarshalPassportElementTypeUtilityBill(data) + case TypePassportElementTypeUtilityBill: + return UnmarshalPassportElementTypeUtilityBill(data) - case TypePassportElementTypeBankStatement: - return UnmarshalPassportElementTypeBankStatement(data) + case TypePassportElementTypeBankStatement: + return UnmarshalPassportElementTypeBankStatement(data) - case TypePassportElementTypeRentalAgreement: - return UnmarshalPassportElementTypeRentalAgreement(data) + case TypePassportElementTypeRentalAgreement: + return UnmarshalPassportElementTypeRentalAgreement(data) - case TypePassportElementTypePassportRegistration: - return UnmarshalPassportElementTypePassportRegistration(data) + case TypePassportElementTypePassportRegistration: + return UnmarshalPassportElementTypePassportRegistration(data) - case TypePassportElementTypeTemporaryRegistration: - return UnmarshalPassportElementTypeTemporaryRegistration(data) + case TypePassportElementTypeTemporaryRegistration: + return UnmarshalPassportElementTypeTemporaryRegistration(data) - case TypePassportElementTypePhoneNumber: - return UnmarshalPassportElementTypePhoneNumber(data) + case TypePassportElementTypePhoneNumber: + return UnmarshalPassportElementTypePhoneNumber(data) - case TypePassportElementTypeEmailAddress: - return UnmarshalPassportElementTypeEmailAddress(data) + case TypePassportElementTypeEmailAddress: + return UnmarshalPassportElementTypeEmailAddress(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfPassportElementType(dataList []json.RawMessage) ([]PassportElementType, error) { - list := []PassportElementType{} + list := []PassportElementType{} - for _, data := range dataList { - entity, err := UnmarshalPassportElementType(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalPassportElementType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalPassportElement(data json.RawMessage) (PassportElement, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypePassportElementPersonalDetails: - return UnmarshalPassportElementPersonalDetails(data) + switch meta.Type { + case TypePassportElementPersonalDetails: + return UnmarshalPassportElementPersonalDetails(data) - case TypePassportElementPassport: - return UnmarshalPassportElementPassport(data) + case TypePassportElementPassport: + return UnmarshalPassportElementPassport(data) - case TypePassportElementDriverLicense: - return UnmarshalPassportElementDriverLicense(data) + case TypePassportElementDriverLicense: + return UnmarshalPassportElementDriverLicense(data) - case TypePassportElementIdentityCard: - return UnmarshalPassportElementIdentityCard(data) + case TypePassportElementIdentityCard: + return UnmarshalPassportElementIdentityCard(data) - case TypePassportElementInternalPassport: - return UnmarshalPassportElementInternalPassport(data) + case TypePassportElementInternalPassport: + return UnmarshalPassportElementInternalPassport(data) - case TypePassportElementAddress: - return UnmarshalPassportElementAddress(data) + case TypePassportElementAddress: + return UnmarshalPassportElementAddress(data) - case TypePassportElementUtilityBill: - return UnmarshalPassportElementUtilityBill(data) + case TypePassportElementUtilityBill: + return UnmarshalPassportElementUtilityBill(data) - case TypePassportElementBankStatement: - return UnmarshalPassportElementBankStatement(data) + case TypePassportElementBankStatement: + return UnmarshalPassportElementBankStatement(data) - case TypePassportElementRentalAgreement: - return UnmarshalPassportElementRentalAgreement(data) + case TypePassportElementRentalAgreement: + return UnmarshalPassportElementRentalAgreement(data) - case TypePassportElementPassportRegistration: - return UnmarshalPassportElementPassportRegistration(data) + case TypePassportElementPassportRegistration: + return UnmarshalPassportElementPassportRegistration(data) - case TypePassportElementTemporaryRegistration: - return UnmarshalPassportElementTemporaryRegistration(data) + case TypePassportElementTemporaryRegistration: + return UnmarshalPassportElementTemporaryRegistration(data) - case TypePassportElementPhoneNumber: - return UnmarshalPassportElementPhoneNumber(data) + case TypePassportElementPhoneNumber: + return UnmarshalPassportElementPhoneNumber(data) - case TypePassportElementEmailAddress: - return UnmarshalPassportElementEmailAddress(data) + case TypePassportElementEmailAddress: + return UnmarshalPassportElementEmailAddress(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfPassportElement(dataList []json.RawMessage) ([]PassportElement, error) { - list := []PassportElement{} + list := []PassportElement{} - for _, data := range dataList { - entity, err := UnmarshalPassportElement(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalPassportElement(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalInputPassportElement(data json.RawMessage) (InputPassportElement, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeInputPassportElementPersonalDetails: - return UnmarshalInputPassportElementPersonalDetails(data) + switch meta.Type { + case TypeInputPassportElementPersonalDetails: + return UnmarshalInputPassportElementPersonalDetails(data) - case TypeInputPassportElementPassport: - return UnmarshalInputPassportElementPassport(data) + case TypeInputPassportElementPassport: + return UnmarshalInputPassportElementPassport(data) - case TypeInputPassportElementDriverLicense: - return UnmarshalInputPassportElementDriverLicense(data) + case TypeInputPassportElementDriverLicense: + return UnmarshalInputPassportElementDriverLicense(data) - case TypeInputPassportElementIdentityCard: - return UnmarshalInputPassportElementIdentityCard(data) + case TypeInputPassportElementIdentityCard: + return UnmarshalInputPassportElementIdentityCard(data) - case TypeInputPassportElementInternalPassport: - return UnmarshalInputPassportElementInternalPassport(data) + case TypeInputPassportElementInternalPassport: + return UnmarshalInputPassportElementInternalPassport(data) - case TypeInputPassportElementAddress: - return UnmarshalInputPassportElementAddress(data) + case TypeInputPassportElementAddress: + return UnmarshalInputPassportElementAddress(data) - case TypeInputPassportElementUtilityBill: - return UnmarshalInputPassportElementUtilityBill(data) + case TypeInputPassportElementUtilityBill: + return UnmarshalInputPassportElementUtilityBill(data) - case TypeInputPassportElementBankStatement: - return UnmarshalInputPassportElementBankStatement(data) + case TypeInputPassportElementBankStatement: + return UnmarshalInputPassportElementBankStatement(data) - case TypeInputPassportElementRentalAgreement: - return UnmarshalInputPassportElementRentalAgreement(data) + case TypeInputPassportElementRentalAgreement: + return UnmarshalInputPassportElementRentalAgreement(data) - case TypeInputPassportElementPassportRegistration: - return UnmarshalInputPassportElementPassportRegistration(data) + case TypeInputPassportElementPassportRegistration: + return UnmarshalInputPassportElementPassportRegistration(data) - case TypeInputPassportElementTemporaryRegistration: - return UnmarshalInputPassportElementTemporaryRegistration(data) + case TypeInputPassportElementTemporaryRegistration: + return UnmarshalInputPassportElementTemporaryRegistration(data) - case TypeInputPassportElementPhoneNumber: - return UnmarshalInputPassportElementPhoneNumber(data) + case TypeInputPassportElementPhoneNumber: + return UnmarshalInputPassportElementPhoneNumber(data) - case TypeInputPassportElementEmailAddress: - return UnmarshalInputPassportElementEmailAddress(data) + case TypeInputPassportElementEmailAddress: + return UnmarshalInputPassportElementEmailAddress(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfInputPassportElement(dataList []json.RawMessage) ([]InputPassportElement, error) { - list := []InputPassportElement{} + list := []InputPassportElement{} - for _, data := range dataList { - entity, err := UnmarshalInputPassportElement(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalInputPassportElement(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalPassportElementErrorSource(data json.RawMessage) (PassportElementErrorSource, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypePassportElementErrorSourceUnspecified: - return UnmarshalPassportElementErrorSourceUnspecified(data) + switch meta.Type { + case TypePassportElementErrorSourceUnspecified: + return UnmarshalPassportElementErrorSourceUnspecified(data) - case TypePassportElementErrorSourceDataField: - return UnmarshalPassportElementErrorSourceDataField(data) + case TypePassportElementErrorSourceDataField: + return UnmarshalPassportElementErrorSourceDataField(data) - case TypePassportElementErrorSourceFrontSide: - return UnmarshalPassportElementErrorSourceFrontSide(data) + case TypePassportElementErrorSourceFrontSide: + return UnmarshalPassportElementErrorSourceFrontSide(data) - case TypePassportElementErrorSourceReverseSide: - return UnmarshalPassportElementErrorSourceReverseSide(data) + case TypePassportElementErrorSourceReverseSide: + return UnmarshalPassportElementErrorSourceReverseSide(data) - case TypePassportElementErrorSourceSelfie: - return UnmarshalPassportElementErrorSourceSelfie(data) + case TypePassportElementErrorSourceSelfie: + return UnmarshalPassportElementErrorSourceSelfie(data) - case TypePassportElementErrorSourceTranslationFile: - return UnmarshalPassportElementErrorSourceTranslationFile(data) + case TypePassportElementErrorSourceTranslationFile: + return UnmarshalPassportElementErrorSourceTranslationFile(data) - case TypePassportElementErrorSourceTranslationFiles: - return UnmarshalPassportElementErrorSourceTranslationFiles(data) + case TypePassportElementErrorSourceTranslationFiles: + return UnmarshalPassportElementErrorSourceTranslationFiles(data) - case TypePassportElementErrorSourceFile: - return UnmarshalPassportElementErrorSourceFile(data) + case TypePassportElementErrorSourceFile: + return UnmarshalPassportElementErrorSourceFile(data) - case TypePassportElementErrorSourceFiles: - return UnmarshalPassportElementErrorSourceFiles(data) + case TypePassportElementErrorSourceFiles: + return UnmarshalPassportElementErrorSourceFiles(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfPassportElementErrorSource(dataList []json.RawMessage) ([]PassportElementErrorSource, error) { - list := []PassportElementErrorSource{} + list := []PassportElementErrorSource{} - for _, data := range dataList { - entity, err := UnmarshalPassportElementErrorSource(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalPassportElementErrorSource(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalInputPassportElementErrorSource(data json.RawMessage) (InputPassportElementErrorSource, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeInputPassportElementErrorSourceUnspecified: - return UnmarshalInputPassportElementErrorSourceUnspecified(data) + switch meta.Type { + case TypeInputPassportElementErrorSourceUnspecified: + return UnmarshalInputPassportElementErrorSourceUnspecified(data) - case TypeInputPassportElementErrorSourceDataField: - return UnmarshalInputPassportElementErrorSourceDataField(data) + case TypeInputPassportElementErrorSourceDataField: + return UnmarshalInputPassportElementErrorSourceDataField(data) - case TypeInputPassportElementErrorSourceFrontSide: - return UnmarshalInputPassportElementErrorSourceFrontSide(data) + case TypeInputPassportElementErrorSourceFrontSide: + return UnmarshalInputPassportElementErrorSourceFrontSide(data) - case TypeInputPassportElementErrorSourceReverseSide: - return UnmarshalInputPassportElementErrorSourceReverseSide(data) + case TypeInputPassportElementErrorSourceReverseSide: + return UnmarshalInputPassportElementErrorSourceReverseSide(data) - case TypeInputPassportElementErrorSourceSelfie: - return UnmarshalInputPassportElementErrorSourceSelfie(data) + case TypeInputPassportElementErrorSourceSelfie: + return UnmarshalInputPassportElementErrorSourceSelfie(data) - case TypeInputPassportElementErrorSourceTranslationFile: - return UnmarshalInputPassportElementErrorSourceTranslationFile(data) + case TypeInputPassportElementErrorSourceTranslationFile: + return UnmarshalInputPassportElementErrorSourceTranslationFile(data) - case TypeInputPassportElementErrorSourceTranslationFiles: - return UnmarshalInputPassportElementErrorSourceTranslationFiles(data) + case TypeInputPassportElementErrorSourceTranslationFiles: + return UnmarshalInputPassportElementErrorSourceTranslationFiles(data) - case TypeInputPassportElementErrorSourceFile: - return UnmarshalInputPassportElementErrorSourceFile(data) + case TypeInputPassportElementErrorSourceFile: + return UnmarshalInputPassportElementErrorSourceFile(data) - case TypeInputPassportElementErrorSourceFiles: - return UnmarshalInputPassportElementErrorSourceFiles(data) + case TypeInputPassportElementErrorSourceFiles: + return UnmarshalInputPassportElementErrorSourceFiles(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfInputPassportElementErrorSource(dataList []json.RawMessage) ([]InputPassportElementErrorSource, error) { - list := []InputPassportElementErrorSource{} + list := []InputPassportElementErrorSource{} - for _, data := range dataList { - entity, err := UnmarshalInputPassportElementErrorSource(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalInputPassportElementErrorSource(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalMessageContent(data json.RawMessage) (MessageContent, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeMessageText: - return UnmarshalMessageText(data) + switch meta.Type { + case TypeMessageText: + return UnmarshalMessageText(data) - case TypeMessageAnimation: - return UnmarshalMessageAnimation(data) + case TypeMessageAnimation: + return UnmarshalMessageAnimation(data) - case TypeMessageAudio: - return UnmarshalMessageAudio(data) + case TypeMessageAudio: + return UnmarshalMessageAudio(data) - case TypeMessageDocument: - return UnmarshalMessageDocument(data) + case TypeMessageDocument: + return UnmarshalMessageDocument(data) - case TypeMessagePhoto: - return UnmarshalMessagePhoto(data) + case TypeMessagePhoto: + return UnmarshalMessagePhoto(data) - case TypeMessageExpiredPhoto: - return UnmarshalMessageExpiredPhoto(data) + case TypeMessageSticker: + return UnmarshalMessageSticker(data) - case TypeMessageSticker: - return UnmarshalMessageSticker(data) + case TypeMessageVideo: + return UnmarshalMessageVideo(data) - case TypeMessageVideo: - return UnmarshalMessageVideo(data) + case TypeMessageVideoNote: + return UnmarshalMessageVideoNote(data) - case TypeMessageExpiredVideo: - return UnmarshalMessageExpiredVideo(data) + case TypeMessageVoiceNote: + return UnmarshalMessageVoiceNote(data) - case TypeMessageVideoNote: - return UnmarshalMessageVideoNote(data) + case TypeMessageExpiredPhoto: + return UnmarshalMessageExpiredPhoto(data) - case TypeMessageVoiceNote: - return UnmarshalMessageVoiceNote(data) + case TypeMessageExpiredVideo: + return UnmarshalMessageExpiredVideo(data) - case TypeMessageLocation: - return UnmarshalMessageLocation(data) + case TypeMessageExpiredVideoNote: + return UnmarshalMessageExpiredVideoNote(data) - case TypeMessageVenue: - return UnmarshalMessageVenue(data) + case TypeMessageExpiredVoiceNote: + return UnmarshalMessageExpiredVoiceNote(data) - case TypeMessageContact: - return UnmarshalMessageContact(data) + case TypeMessageLocation: + return UnmarshalMessageLocation(data) - case TypeMessageAnimatedEmoji: - return UnmarshalMessageAnimatedEmoji(data) + case TypeMessageVenue: + return UnmarshalMessageVenue(data) - case TypeMessageDice: - return UnmarshalMessageDice(data) + case TypeMessageContact: + return UnmarshalMessageContact(data) - case TypeMessageGame: - return UnmarshalMessageGame(data) + case TypeMessageAnimatedEmoji: + return UnmarshalMessageAnimatedEmoji(data) - case TypeMessagePoll: - return UnmarshalMessagePoll(data) + case TypeMessageDice: + return UnmarshalMessageDice(data) - case TypeMessageInvoice: - return UnmarshalMessageInvoice(data) + case TypeMessageGame: + return UnmarshalMessageGame(data) - case TypeMessageCall: - return UnmarshalMessageCall(data) + case TypeMessagePoll: + return UnmarshalMessagePoll(data) - case TypeMessageVideoChatScheduled: - return UnmarshalMessageVideoChatScheduled(data) + case TypeMessageStory: + return UnmarshalMessageStory(data) - case TypeMessageVideoChatStarted: - return UnmarshalMessageVideoChatStarted(data) + case TypeMessageInvoice: + return UnmarshalMessageInvoice(data) - case TypeMessageVideoChatEnded: - return UnmarshalMessageVideoChatEnded(data) + case TypeMessageCall: + return UnmarshalMessageCall(data) - case TypeMessageInviteVideoChatParticipants: - return UnmarshalMessageInviteVideoChatParticipants(data) + case TypeMessageVideoChatScheduled: + return UnmarshalMessageVideoChatScheduled(data) - case TypeMessageBasicGroupChatCreate: - return UnmarshalMessageBasicGroupChatCreate(data) + case TypeMessageVideoChatStarted: + return UnmarshalMessageVideoChatStarted(data) - case TypeMessageSupergroupChatCreate: - return UnmarshalMessageSupergroupChatCreate(data) + case TypeMessageVideoChatEnded: + return UnmarshalMessageVideoChatEnded(data) - case TypeMessageChatChangeTitle: - return UnmarshalMessageChatChangeTitle(data) + case TypeMessageInviteVideoChatParticipants: + return UnmarshalMessageInviteVideoChatParticipants(data) - case TypeMessageChatChangePhoto: - return UnmarshalMessageChatChangePhoto(data) + case TypeMessageBasicGroupChatCreate: + return UnmarshalMessageBasicGroupChatCreate(data) - case TypeMessageChatDeletePhoto: - return UnmarshalMessageChatDeletePhoto(data) + case TypeMessageSupergroupChatCreate: + return UnmarshalMessageSupergroupChatCreate(data) - case TypeMessageChatAddMembers: - return UnmarshalMessageChatAddMembers(data) + case TypeMessageChatChangeTitle: + return UnmarshalMessageChatChangeTitle(data) - case TypeMessageChatJoinByLink: - return UnmarshalMessageChatJoinByLink(data) + case TypeMessageChatChangePhoto: + return UnmarshalMessageChatChangePhoto(data) - case TypeMessageChatJoinByRequest: - return UnmarshalMessageChatJoinByRequest(data) + case TypeMessageChatDeletePhoto: + return UnmarshalMessageChatDeletePhoto(data) - case TypeMessageChatDeleteMember: - return UnmarshalMessageChatDeleteMember(data) + case TypeMessageChatAddMembers: + return UnmarshalMessageChatAddMembers(data) - case TypeMessageChatUpgradeTo: - return UnmarshalMessageChatUpgradeTo(data) + case TypeMessageChatJoinByLink: + return UnmarshalMessageChatJoinByLink(data) - case TypeMessageChatUpgradeFrom: - return UnmarshalMessageChatUpgradeFrom(data) + case TypeMessageChatJoinByRequest: + return UnmarshalMessageChatJoinByRequest(data) - case TypeMessagePinMessage: - return UnmarshalMessagePinMessage(data) + case TypeMessageChatDeleteMember: + return UnmarshalMessageChatDeleteMember(data) - case TypeMessageScreenshotTaken: - return UnmarshalMessageScreenshotTaken(data) + case TypeMessageChatUpgradeTo: + return UnmarshalMessageChatUpgradeTo(data) - case TypeMessageChatSetTheme: - return UnmarshalMessageChatSetTheme(data) + case TypeMessageChatUpgradeFrom: + return UnmarshalMessageChatUpgradeFrom(data) - case TypeMessageChatSetMessageAutoDeleteTime: - return UnmarshalMessageChatSetMessageAutoDeleteTime(data) + case TypeMessagePinMessage: + return UnmarshalMessagePinMessage(data) - case TypeMessageForumTopicCreated: - return UnmarshalMessageForumTopicCreated(data) + case TypeMessageScreenshotTaken: + return UnmarshalMessageScreenshotTaken(data) - case TypeMessageForumTopicEdited: - return UnmarshalMessageForumTopicEdited(data) + case TypeMessageChatSetBackground: + return UnmarshalMessageChatSetBackground(data) - case TypeMessageForumTopicIsClosedToggled: - return UnmarshalMessageForumTopicIsClosedToggled(data) + case TypeMessageChatSetTheme: + return UnmarshalMessageChatSetTheme(data) - case TypeMessageForumTopicIsHiddenToggled: - return UnmarshalMessageForumTopicIsHiddenToggled(data) + case TypeMessageChatSetMessageAutoDeleteTime: + return UnmarshalMessageChatSetMessageAutoDeleteTime(data) - case TypeMessageSuggestProfilePhoto: - return UnmarshalMessageSuggestProfilePhoto(data) + case TypeMessageChatBoost: + return UnmarshalMessageChatBoost(data) - case TypeMessageCustomServiceAction: - return UnmarshalMessageCustomServiceAction(data) + case TypeMessageForumTopicCreated: + return UnmarshalMessageForumTopicCreated(data) - case TypeMessageGameScore: - return UnmarshalMessageGameScore(data) + case TypeMessageForumTopicEdited: + return UnmarshalMessageForumTopicEdited(data) - case TypeMessagePaymentSuccessful: - return UnmarshalMessagePaymentSuccessful(data) + case TypeMessageForumTopicIsClosedToggled: + return UnmarshalMessageForumTopicIsClosedToggled(data) - case TypeMessagePaymentSuccessfulBot: - return UnmarshalMessagePaymentSuccessfulBot(data) + case TypeMessageForumTopicIsHiddenToggled: + return UnmarshalMessageForumTopicIsHiddenToggled(data) - case TypeMessageGiftedPremium: - return UnmarshalMessageGiftedPremium(data) + case TypeMessageSuggestProfilePhoto: + return UnmarshalMessageSuggestProfilePhoto(data) - case TypeMessageContactRegistered: - return UnmarshalMessageContactRegistered(data) + case TypeMessageCustomServiceAction: + return UnmarshalMessageCustomServiceAction(data) - case TypeMessageWebsiteConnected: - return UnmarshalMessageWebsiteConnected(data) + case TypeMessageGameScore: + return UnmarshalMessageGameScore(data) - case TypeMessageBotWriteAccessAllowed: - return UnmarshalMessageBotWriteAccessAllowed(data) + case TypeMessagePaymentSuccessful: + return UnmarshalMessagePaymentSuccessful(data) - case TypeMessageWebAppDataSent: - return UnmarshalMessageWebAppDataSent(data) + case TypeMessagePaymentSuccessfulBot: + return UnmarshalMessagePaymentSuccessfulBot(data) - case TypeMessageWebAppDataReceived: - return UnmarshalMessageWebAppDataReceived(data) + case TypeMessageGiftedPremium: + return UnmarshalMessageGiftedPremium(data) - case TypeMessagePassportDataSent: - return UnmarshalMessagePassportDataSent(data) + case TypeMessagePremiumGiftCode: + return UnmarshalMessagePremiumGiftCode(data) - case TypeMessagePassportDataReceived: - return UnmarshalMessagePassportDataReceived(data) + case TypeMessagePremiumGiveawayCreated: + return UnmarshalMessagePremiumGiveawayCreated(data) - case TypeMessageProximityAlertTriggered: - return UnmarshalMessageProximityAlertTriggered(data) + case TypeMessagePremiumGiveaway: + return UnmarshalMessagePremiumGiveaway(data) - case TypeMessageUnsupported: - return UnmarshalMessageUnsupported(data) + case TypeMessagePremiumGiveawayCompleted: + return UnmarshalMessagePremiumGiveawayCompleted(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + case TypeMessagePremiumGiveawayWinners: + return UnmarshalMessagePremiumGiveawayWinners(data) + + case TypeMessageContactRegistered: + return UnmarshalMessageContactRegistered(data) + + case TypeMessageUsersShared: + return UnmarshalMessageUsersShared(data) + + case TypeMessageChatShared: + return UnmarshalMessageChatShared(data) + + case TypeMessageBotWriteAccessAllowed: + return UnmarshalMessageBotWriteAccessAllowed(data) + + case TypeMessageWebAppDataSent: + return UnmarshalMessageWebAppDataSent(data) + + case TypeMessageWebAppDataReceived: + return UnmarshalMessageWebAppDataReceived(data) + + case TypeMessagePassportDataSent: + return UnmarshalMessagePassportDataSent(data) + + case TypeMessagePassportDataReceived: + return UnmarshalMessagePassportDataReceived(data) + + case TypeMessageProximityAlertTriggered: + return UnmarshalMessageProximityAlertTriggered(data) + + case TypeMessageUnsupported: + return UnmarshalMessageUnsupported(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfMessageContent(dataList []json.RawMessage) ([]MessageContent, error) { - list := []MessageContent{} + list := []MessageContent{} - for _, data := range dataList { - entity, err := UnmarshalMessageContent(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalMessageContent(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalTextEntityType(data json.RawMessage) (TextEntityType, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeTextEntityTypeMention: - return UnmarshalTextEntityTypeMention(data) + switch meta.Type { + case TypeTextEntityTypeMention: + return UnmarshalTextEntityTypeMention(data) - case TypeTextEntityTypeHashtag: - return UnmarshalTextEntityTypeHashtag(data) + case TypeTextEntityTypeHashtag: + return UnmarshalTextEntityTypeHashtag(data) - case TypeTextEntityTypeCashtag: - return UnmarshalTextEntityTypeCashtag(data) + case TypeTextEntityTypeCashtag: + return UnmarshalTextEntityTypeCashtag(data) - case TypeTextEntityTypeBotCommand: - return UnmarshalTextEntityTypeBotCommand(data) + case TypeTextEntityTypeBotCommand: + return UnmarshalTextEntityTypeBotCommand(data) - case TypeTextEntityTypeUrl: - return UnmarshalTextEntityTypeUrl(data) + case TypeTextEntityTypeUrl: + return UnmarshalTextEntityTypeUrl(data) - case TypeTextEntityTypeEmailAddress: - return UnmarshalTextEntityTypeEmailAddress(data) + case TypeTextEntityTypeEmailAddress: + return UnmarshalTextEntityTypeEmailAddress(data) - case TypeTextEntityTypePhoneNumber: - return UnmarshalTextEntityTypePhoneNumber(data) + case TypeTextEntityTypePhoneNumber: + return UnmarshalTextEntityTypePhoneNumber(data) - case TypeTextEntityTypeBankCardNumber: - return UnmarshalTextEntityTypeBankCardNumber(data) + case TypeTextEntityTypeBankCardNumber: + return UnmarshalTextEntityTypeBankCardNumber(data) - case TypeTextEntityTypeBold: - return UnmarshalTextEntityTypeBold(data) + case TypeTextEntityTypeBold: + return UnmarshalTextEntityTypeBold(data) - case TypeTextEntityTypeItalic: - return UnmarshalTextEntityTypeItalic(data) + case TypeTextEntityTypeItalic: + return UnmarshalTextEntityTypeItalic(data) - case TypeTextEntityTypeUnderline: - return UnmarshalTextEntityTypeUnderline(data) + case TypeTextEntityTypeUnderline: + return UnmarshalTextEntityTypeUnderline(data) - case TypeTextEntityTypeStrikethrough: - return UnmarshalTextEntityTypeStrikethrough(data) + case TypeTextEntityTypeStrikethrough: + return UnmarshalTextEntityTypeStrikethrough(data) - case TypeTextEntityTypeSpoiler: - return UnmarshalTextEntityTypeSpoiler(data) + case TypeTextEntityTypeSpoiler: + return UnmarshalTextEntityTypeSpoiler(data) - case TypeTextEntityTypeCode: - return UnmarshalTextEntityTypeCode(data) + case TypeTextEntityTypeCode: + return UnmarshalTextEntityTypeCode(data) - case TypeTextEntityTypePre: - return UnmarshalTextEntityTypePre(data) + case TypeTextEntityTypePre: + return UnmarshalTextEntityTypePre(data) - case TypeTextEntityTypePreCode: - return UnmarshalTextEntityTypePreCode(data) + case TypeTextEntityTypePreCode: + return UnmarshalTextEntityTypePreCode(data) - case TypeTextEntityTypeTextUrl: - return UnmarshalTextEntityTypeTextUrl(data) + case TypeTextEntityTypeBlockQuote: + return UnmarshalTextEntityTypeBlockQuote(data) - case TypeTextEntityTypeMentionName: - return UnmarshalTextEntityTypeMentionName(data) + case TypeTextEntityTypeTextUrl: + return UnmarshalTextEntityTypeTextUrl(data) - case TypeTextEntityTypeCustomEmoji: - return UnmarshalTextEntityTypeCustomEmoji(data) + case TypeTextEntityTypeMentionName: + return UnmarshalTextEntityTypeMentionName(data) - case TypeTextEntityTypeMediaTimestamp: - return UnmarshalTextEntityTypeMediaTimestamp(data) + case TypeTextEntityTypeCustomEmoji: + return UnmarshalTextEntityTypeCustomEmoji(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + case TypeTextEntityTypeMediaTimestamp: + return UnmarshalTextEntityTypeMediaTimestamp(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfTextEntityType(dataList []json.RawMessage) ([]TextEntityType, error) { - list := []TextEntityType{} + list := []TextEntityType{} - for _, data := range dataList { - entity, err := UnmarshalTextEntityType(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalTextEntityType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalMessageSchedulingState(data json.RawMessage) (MessageSchedulingState, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeMessageSchedulingStateSendAtDate: - return UnmarshalMessageSchedulingStateSendAtDate(data) + switch meta.Type { + case TypeMessageSchedulingStateSendAtDate: + return UnmarshalMessageSchedulingStateSendAtDate(data) - case TypeMessageSchedulingStateSendWhenOnline: - return UnmarshalMessageSchedulingStateSendWhenOnline(data) + case TypeMessageSchedulingStateSendWhenOnline: + return UnmarshalMessageSchedulingStateSendWhenOnline(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfMessageSchedulingState(dataList []json.RawMessage) ([]MessageSchedulingState, error) { - list := []MessageSchedulingState{} + list := []MessageSchedulingState{} - for _, data := range dataList { - entity, err := UnmarshalMessageSchedulingState(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalMessageSchedulingState(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil +} + +func UnmarshalMessageSelfDestructType(data json.RawMessage) (MessageSelfDestructType, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeMessageSelfDestructTypeTimer: + return UnmarshalMessageSelfDestructTypeTimer(data) + + case TypeMessageSelfDestructTypeImmediately: + return UnmarshalMessageSelfDestructTypeImmediately(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfMessageSelfDestructType(dataList []json.RawMessage) ([]MessageSelfDestructType, error) { + list := []MessageSelfDestructType{} + + for _, data := range dataList { + entity, err := UnmarshalMessageSelfDestructType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil } func UnmarshalInputMessageContent(data json.RawMessage) (InputMessageContent, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeInputMessageText: - return UnmarshalInputMessageText(data) + switch meta.Type { + case TypeInputMessageText: + return UnmarshalInputMessageText(data) - case TypeInputMessageAnimation: - return UnmarshalInputMessageAnimation(data) + case TypeInputMessageAnimation: + return UnmarshalInputMessageAnimation(data) - case TypeInputMessageAudio: - return UnmarshalInputMessageAudio(data) + case TypeInputMessageAudio: + return UnmarshalInputMessageAudio(data) - case TypeInputMessageDocument: - return UnmarshalInputMessageDocument(data) + case TypeInputMessageDocument: + return UnmarshalInputMessageDocument(data) - case TypeInputMessagePhoto: - return UnmarshalInputMessagePhoto(data) + case TypeInputMessagePhoto: + return UnmarshalInputMessagePhoto(data) - case TypeInputMessageSticker: - return UnmarshalInputMessageSticker(data) + case TypeInputMessageSticker: + return UnmarshalInputMessageSticker(data) - case TypeInputMessageVideo: - return UnmarshalInputMessageVideo(data) + case TypeInputMessageVideo: + return UnmarshalInputMessageVideo(data) - case TypeInputMessageVideoNote: - return UnmarshalInputMessageVideoNote(data) + case TypeInputMessageVideoNote: + return UnmarshalInputMessageVideoNote(data) - case TypeInputMessageVoiceNote: - return UnmarshalInputMessageVoiceNote(data) + case TypeInputMessageVoiceNote: + return UnmarshalInputMessageVoiceNote(data) - case TypeInputMessageLocation: - return UnmarshalInputMessageLocation(data) + case TypeInputMessageLocation: + return UnmarshalInputMessageLocation(data) - case TypeInputMessageVenue: - return UnmarshalInputMessageVenue(data) + case TypeInputMessageVenue: + return UnmarshalInputMessageVenue(data) - case TypeInputMessageContact: - return UnmarshalInputMessageContact(data) + case TypeInputMessageContact: + return UnmarshalInputMessageContact(data) - case TypeInputMessageDice: - return UnmarshalInputMessageDice(data) + case TypeInputMessageDice: + return UnmarshalInputMessageDice(data) - case TypeInputMessageGame: - return UnmarshalInputMessageGame(data) + case TypeInputMessageGame: + return UnmarshalInputMessageGame(data) - case TypeInputMessageInvoice: - return UnmarshalInputMessageInvoice(data) + case TypeInputMessageInvoice: + return UnmarshalInputMessageInvoice(data) - case TypeInputMessagePoll: - return UnmarshalInputMessagePoll(data) + case TypeInputMessagePoll: + return UnmarshalInputMessagePoll(data) - case TypeInputMessageForwarded: - return UnmarshalInputMessageForwarded(data) + case TypeInputMessageStory: + return UnmarshalInputMessageStory(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + case TypeInputMessageForwarded: + return UnmarshalInputMessageForwarded(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfInputMessageContent(dataList []json.RawMessage) ([]InputMessageContent, error) { - list := []InputMessageContent{} + list := []InputMessageContent{} - for _, data := range dataList { - entity, err := UnmarshalInputMessageContent(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalInputMessageContent(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalSearchMessagesFilter(data json.RawMessage) (SearchMessagesFilter, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeSearchMessagesFilterEmpty: - return UnmarshalSearchMessagesFilterEmpty(data) + switch meta.Type { + case TypeSearchMessagesFilterEmpty: + return UnmarshalSearchMessagesFilterEmpty(data) - case TypeSearchMessagesFilterAnimation: - return UnmarshalSearchMessagesFilterAnimation(data) + case TypeSearchMessagesFilterAnimation: + return UnmarshalSearchMessagesFilterAnimation(data) - case TypeSearchMessagesFilterAudio: - return UnmarshalSearchMessagesFilterAudio(data) + case TypeSearchMessagesFilterAudio: + return UnmarshalSearchMessagesFilterAudio(data) - case TypeSearchMessagesFilterDocument: - return UnmarshalSearchMessagesFilterDocument(data) + case TypeSearchMessagesFilterDocument: + return UnmarshalSearchMessagesFilterDocument(data) - case TypeSearchMessagesFilterPhoto: - return UnmarshalSearchMessagesFilterPhoto(data) + case TypeSearchMessagesFilterPhoto: + return UnmarshalSearchMessagesFilterPhoto(data) - case TypeSearchMessagesFilterVideo: - return UnmarshalSearchMessagesFilterVideo(data) + case TypeSearchMessagesFilterVideo: + return UnmarshalSearchMessagesFilterVideo(data) - case TypeSearchMessagesFilterVoiceNote: - return UnmarshalSearchMessagesFilterVoiceNote(data) + case TypeSearchMessagesFilterVoiceNote: + return UnmarshalSearchMessagesFilterVoiceNote(data) - case TypeSearchMessagesFilterPhotoAndVideo: - return UnmarshalSearchMessagesFilterPhotoAndVideo(data) + case TypeSearchMessagesFilterPhotoAndVideo: + return UnmarshalSearchMessagesFilterPhotoAndVideo(data) - case TypeSearchMessagesFilterUrl: - return UnmarshalSearchMessagesFilterUrl(data) + case TypeSearchMessagesFilterUrl: + return UnmarshalSearchMessagesFilterUrl(data) - case TypeSearchMessagesFilterChatPhoto: - return UnmarshalSearchMessagesFilterChatPhoto(data) + case TypeSearchMessagesFilterChatPhoto: + return UnmarshalSearchMessagesFilterChatPhoto(data) - case TypeSearchMessagesFilterVideoNote: - return UnmarshalSearchMessagesFilterVideoNote(data) + case TypeSearchMessagesFilterVideoNote: + return UnmarshalSearchMessagesFilterVideoNote(data) - case TypeSearchMessagesFilterVoiceAndVideoNote: - return UnmarshalSearchMessagesFilterVoiceAndVideoNote(data) + case TypeSearchMessagesFilterVoiceAndVideoNote: + return UnmarshalSearchMessagesFilterVoiceAndVideoNote(data) - case TypeSearchMessagesFilterMention: - return UnmarshalSearchMessagesFilterMention(data) + case TypeSearchMessagesFilterMention: + return UnmarshalSearchMessagesFilterMention(data) - case TypeSearchMessagesFilterUnreadMention: - return UnmarshalSearchMessagesFilterUnreadMention(data) + case TypeSearchMessagesFilterUnreadMention: + return UnmarshalSearchMessagesFilterUnreadMention(data) - case TypeSearchMessagesFilterUnreadReaction: - return UnmarshalSearchMessagesFilterUnreadReaction(data) + case TypeSearchMessagesFilterUnreadReaction: + return UnmarshalSearchMessagesFilterUnreadReaction(data) - case TypeSearchMessagesFilterFailedToSend: - return UnmarshalSearchMessagesFilterFailedToSend(data) + case TypeSearchMessagesFilterFailedToSend: + return UnmarshalSearchMessagesFilterFailedToSend(data) - case TypeSearchMessagesFilterPinned: - return UnmarshalSearchMessagesFilterPinned(data) + case TypeSearchMessagesFilterPinned: + return UnmarshalSearchMessagesFilterPinned(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfSearchMessagesFilter(dataList []json.RawMessage) ([]SearchMessagesFilter, error) { - list := []SearchMessagesFilter{} + list := []SearchMessagesFilter{} - for _, data := range dataList { - entity, err := UnmarshalSearchMessagesFilter(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalSearchMessagesFilter(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalChatAction(data json.RawMessage) (ChatAction, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeChatActionTyping: - return UnmarshalChatActionTyping(data) + switch meta.Type { + case TypeChatActionTyping: + return UnmarshalChatActionTyping(data) - case TypeChatActionRecordingVideo: - return UnmarshalChatActionRecordingVideo(data) + case TypeChatActionRecordingVideo: + return UnmarshalChatActionRecordingVideo(data) - case TypeChatActionUploadingVideo: - return UnmarshalChatActionUploadingVideo(data) + case TypeChatActionUploadingVideo: + return UnmarshalChatActionUploadingVideo(data) - case TypeChatActionRecordingVoiceNote: - return UnmarshalChatActionRecordingVoiceNote(data) + case TypeChatActionRecordingVoiceNote: + return UnmarshalChatActionRecordingVoiceNote(data) - case TypeChatActionUploadingVoiceNote: - return UnmarshalChatActionUploadingVoiceNote(data) + case TypeChatActionUploadingVoiceNote: + return UnmarshalChatActionUploadingVoiceNote(data) - case TypeChatActionUploadingPhoto: - return UnmarshalChatActionUploadingPhoto(data) + case TypeChatActionUploadingPhoto: + return UnmarshalChatActionUploadingPhoto(data) - case TypeChatActionUploadingDocument: - return UnmarshalChatActionUploadingDocument(data) + case TypeChatActionUploadingDocument: + return UnmarshalChatActionUploadingDocument(data) - case TypeChatActionChoosingSticker: - return UnmarshalChatActionChoosingSticker(data) + case TypeChatActionChoosingSticker: + return UnmarshalChatActionChoosingSticker(data) - case TypeChatActionChoosingLocation: - return UnmarshalChatActionChoosingLocation(data) + case TypeChatActionChoosingLocation: + return UnmarshalChatActionChoosingLocation(data) - case TypeChatActionChoosingContact: - return UnmarshalChatActionChoosingContact(data) + case TypeChatActionChoosingContact: + return UnmarshalChatActionChoosingContact(data) - case TypeChatActionStartPlayingGame: - return UnmarshalChatActionStartPlayingGame(data) + case TypeChatActionStartPlayingGame: + return UnmarshalChatActionStartPlayingGame(data) - case TypeChatActionRecordingVideoNote: - return UnmarshalChatActionRecordingVideoNote(data) + case TypeChatActionRecordingVideoNote: + return UnmarshalChatActionRecordingVideoNote(data) - case TypeChatActionUploadingVideoNote: - return UnmarshalChatActionUploadingVideoNote(data) + case TypeChatActionUploadingVideoNote: + return UnmarshalChatActionUploadingVideoNote(data) - case TypeChatActionWatchingAnimations: - return UnmarshalChatActionWatchingAnimations(data) + case TypeChatActionWatchingAnimations: + return UnmarshalChatActionWatchingAnimations(data) - case TypeChatActionCancel: - return UnmarshalChatActionCancel(data) + case TypeChatActionCancel: + return UnmarshalChatActionCancel(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfChatAction(dataList []json.RawMessage) ([]ChatAction, error) { - list := []ChatAction{} + list := []ChatAction{} - for _, data := range dataList { - entity, err := UnmarshalChatAction(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalChatAction(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalUserStatus(data json.RawMessage) (UserStatus, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeUserStatusEmpty: - return UnmarshalUserStatusEmpty(data) + switch meta.Type { + case TypeUserStatusEmpty: + return UnmarshalUserStatusEmpty(data) - case TypeUserStatusOnline: - return UnmarshalUserStatusOnline(data) + case TypeUserStatusOnline: + return UnmarshalUserStatusOnline(data) - case TypeUserStatusOffline: - return UnmarshalUserStatusOffline(data) + case TypeUserStatusOffline: + return UnmarshalUserStatusOffline(data) - case TypeUserStatusRecently: - return UnmarshalUserStatusRecently(data) + case TypeUserStatusRecently: + return UnmarshalUserStatusRecently(data) - case TypeUserStatusLastWeek: - return UnmarshalUserStatusLastWeek(data) + case TypeUserStatusLastWeek: + return UnmarshalUserStatusLastWeek(data) - case TypeUserStatusLastMonth: - return UnmarshalUserStatusLastMonth(data) + case TypeUserStatusLastMonth: + return UnmarshalUserStatusLastMonth(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfUserStatus(dataList []json.RawMessage) ([]UserStatus, error) { - list := []UserStatus{} + list := []UserStatus{} - for _, data := range dataList { - entity, err := UnmarshalUserStatus(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalUserStatus(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil +} + +func UnmarshalEmojiCategoryType(data json.RawMessage) (EmojiCategoryType, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeEmojiCategoryTypeDefault: + return UnmarshalEmojiCategoryTypeDefault(data) + + case TypeEmojiCategoryTypeEmojiStatus: + return UnmarshalEmojiCategoryTypeEmojiStatus(data) + + case TypeEmojiCategoryTypeChatPhoto: + return UnmarshalEmojiCategoryTypeChatPhoto(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfEmojiCategoryType(dataList []json.RawMessage) ([]EmojiCategoryType, error) { + list := []EmojiCategoryType{} + + for _, data := range dataList { + entity, err := UnmarshalEmojiCategoryType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalStoryAreaType(data json.RawMessage) (StoryAreaType, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeStoryAreaTypeLocation: + return UnmarshalStoryAreaTypeLocation(data) + + case TypeStoryAreaTypeVenue: + return UnmarshalStoryAreaTypeVenue(data) + + case TypeStoryAreaTypeSuggestedReaction: + return UnmarshalStoryAreaTypeSuggestedReaction(data) + + case TypeStoryAreaTypeMessage: + return UnmarshalStoryAreaTypeMessage(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfStoryAreaType(dataList []json.RawMessage) ([]StoryAreaType, error) { + list := []StoryAreaType{} + + for _, data := range dataList { + entity, err := UnmarshalStoryAreaType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalInputStoryAreaType(data json.RawMessage) (InputStoryAreaType, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeInputStoryAreaTypeLocation: + return UnmarshalInputStoryAreaTypeLocation(data) + + case TypeInputStoryAreaTypeFoundVenue: + return UnmarshalInputStoryAreaTypeFoundVenue(data) + + case TypeInputStoryAreaTypePreviousVenue: + return UnmarshalInputStoryAreaTypePreviousVenue(data) + + case TypeInputStoryAreaTypeSuggestedReaction: + return UnmarshalInputStoryAreaTypeSuggestedReaction(data) + + case TypeInputStoryAreaTypeMessage: + return UnmarshalInputStoryAreaTypeMessage(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfInputStoryAreaType(dataList []json.RawMessage) ([]InputStoryAreaType, error) { + list := []InputStoryAreaType{} + + for _, data := range dataList { + entity, err := UnmarshalInputStoryAreaType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalStoryContent(data json.RawMessage) (StoryContent, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeStoryContentPhoto: + return UnmarshalStoryContentPhoto(data) + + case TypeStoryContentVideo: + return UnmarshalStoryContentVideo(data) + + case TypeStoryContentUnsupported: + return UnmarshalStoryContentUnsupported(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfStoryContent(dataList []json.RawMessage) ([]StoryContent, error) { + list := []StoryContent{} + + for _, data := range dataList { + entity, err := UnmarshalStoryContent(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalInputStoryContent(data json.RawMessage) (InputStoryContent, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeInputStoryContentPhoto: + return UnmarshalInputStoryContentPhoto(data) + + case TypeInputStoryContentVideo: + return UnmarshalInputStoryContentVideo(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfInputStoryContent(dataList []json.RawMessage) ([]InputStoryContent, error) { + list := []InputStoryContent{} + + for _, data := range dataList { + entity, err := UnmarshalInputStoryContent(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalStoryList(data json.RawMessage) (StoryList, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeStoryListMain: + return UnmarshalStoryListMain(data) + + case TypeStoryListArchive: + return UnmarshalStoryListArchive(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfStoryList(dataList []json.RawMessage) ([]StoryList, error) { + list := []StoryList{} + + for _, data := range dataList { + entity, err := UnmarshalStoryList(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalStoryOrigin(data json.RawMessage) (StoryOrigin, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeStoryOriginPublicStory: + return UnmarshalStoryOriginPublicStory(data) + + case TypeStoryOriginHiddenUser: + return UnmarshalStoryOriginHiddenUser(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfStoryOrigin(dataList []json.RawMessage) ([]StoryOrigin, error) { + list := []StoryOrigin{} + + for _, data := range dataList { + entity, err := UnmarshalStoryOrigin(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalStoryInteractionType(data json.RawMessage) (StoryInteractionType, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeStoryInteractionTypeView: + return UnmarshalStoryInteractionTypeView(data) + + case TypeStoryInteractionTypeForward: + return UnmarshalStoryInteractionTypeForward(data) + + case TypeStoryInteractionTypeRepost: + return UnmarshalStoryInteractionTypeRepost(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfStoryInteractionType(dataList []json.RawMessage) ([]StoryInteractionType, error) { + list := []StoryInteractionType{} + + for _, data := range dataList { + entity, err := UnmarshalStoryInteractionType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalPublicForward(data json.RawMessage) (PublicForward, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypePublicForwardMessage: + return UnmarshalPublicForwardMessage(data) + + case TypePublicForwardStory: + return UnmarshalPublicForwardStory(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfPublicForward(dataList []json.RawMessage) ([]PublicForward, error) { + list := []PublicForward{} + + for _, data := range dataList { + entity, err := UnmarshalPublicForward(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalChatBoostSource(data json.RawMessage) (ChatBoostSource, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeChatBoostSourceGiftCode: + return UnmarshalChatBoostSourceGiftCode(data) + + case TypeChatBoostSourceGiveaway: + return UnmarshalChatBoostSourceGiveaway(data) + + case TypeChatBoostSourcePremium: + return UnmarshalChatBoostSourcePremium(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfChatBoostSource(dataList []json.RawMessage) ([]ChatBoostSource, error) { + list := []ChatBoostSource{} + + for _, data := range dataList { + entity, err := UnmarshalChatBoostSource(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil } func UnmarshalCallDiscardReason(data json.RawMessage) (CallDiscardReason, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeCallDiscardReasonEmpty: - return UnmarshalCallDiscardReasonEmpty(data) + switch meta.Type { + case TypeCallDiscardReasonEmpty: + return UnmarshalCallDiscardReasonEmpty(data) - case TypeCallDiscardReasonMissed: - return UnmarshalCallDiscardReasonMissed(data) + case TypeCallDiscardReasonMissed: + return UnmarshalCallDiscardReasonMissed(data) - case TypeCallDiscardReasonDeclined: - return UnmarshalCallDiscardReasonDeclined(data) + case TypeCallDiscardReasonDeclined: + return UnmarshalCallDiscardReasonDeclined(data) - case TypeCallDiscardReasonDisconnected: - return UnmarshalCallDiscardReasonDisconnected(data) + case TypeCallDiscardReasonDisconnected: + return UnmarshalCallDiscardReasonDisconnected(data) - case TypeCallDiscardReasonHungUp: - return UnmarshalCallDiscardReasonHungUp(data) + case TypeCallDiscardReasonHungUp: + return UnmarshalCallDiscardReasonHungUp(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfCallDiscardReason(dataList []json.RawMessage) ([]CallDiscardReason, error) { - list := []CallDiscardReason{} + list := []CallDiscardReason{} - for _, data := range dataList { - entity, err := UnmarshalCallDiscardReason(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalCallDiscardReason(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalCallServerType(data json.RawMessage) (CallServerType, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeCallServerTypeTelegramReflector: - return UnmarshalCallServerTypeTelegramReflector(data) + switch meta.Type { + case TypeCallServerTypeTelegramReflector: + return UnmarshalCallServerTypeTelegramReflector(data) - case TypeCallServerTypeWebrtc: - return UnmarshalCallServerTypeWebrtc(data) + case TypeCallServerTypeWebrtc: + return UnmarshalCallServerTypeWebrtc(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfCallServerType(dataList []json.RawMessage) ([]CallServerType, error) { - list := []CallServerType{} + list := []CallServerType{} - for _, data := range dataList { - entity, err := UnmarshalCallServerType(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalCallServerType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalCallState(data json.RawMessage) (CallState, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeCallStatePending: - return UnmarshalCallStatePending(data) + switch meta.Type { + case TypeCallStatePending: + return UnmarshalCallStatePending(data) - case TypeCallStateExchangingKeys: - return UnmarshalCallStateExchangingKeys(data) + case TypeCallStateExchangingKeys: + return UnmarshalCallStateExchangingKeys(data) - case TypeCallStateReady: - return UnmarshalCallStateReady(data) + case TypeCallStateReady: + return UnmarshalCallStateReady(data) - case TypeCallStateHangingUp: - return UnmarshalCallStateHangingUp(data) + case TypeCallStateHangingUp: + return UnmarshalCallStateHangingUp(data) - case TypeCallStateDiscarded: - return UnmarshalCallStateDiscarded(data) + case TypeCallStateDiscarded: + return UnmarshalCallStateDiscarded(data) - case TypeCallStateError: - return UnmarshalCallStateError(data) + case TypeCallStateError: + return UnmarshalCallStateError(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfCallState(dataList []json.RawMessage) ([]CallState, error) { - list := []CallState{} + list := []CallState{} - for _, data := range dataList { - entity, err := UnmarshalCallState(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalCallState(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalGroupCallVideoQuality(data json.RawMessage) (GroupCallVideoQuality, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeGroupCallVideoQualityThumbnail: - return UnmarshalGroupCallVideoQualityThumbnail(data) + switch meta.Type { + case TypeGroupCallVideoQualityThumbnail: + return UnmarshalGroupCallVideoQualityThumbnail(data) - case TypeGroupCallVideoQualityMedium: - return UnmarshalGroupCallVideoQualityMedium(data) + case TypeGroupCallVideoQualityMedium: + return UnmarshalGroupCallVideoQualityMedium(data) - case TypeGroupCallVideoQualityFull: - return UnmarshalGroupCallVideoQualityFull(data) + case TypeGroupCallVideoQualityFull: + return UnmarshalGroupCallVideoQualityFull(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfGroupCallVideoQuality(dataList []json.RawMessage) ([]GroupCallVideoQuality, error) { - list := []GroupCallVideoQuality{} + list := []GroupCallVideoQuality{} - for _, data := range dataList { - entity, err := UnmarshalGroupCallVideoQuality(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalGroupCallVideoQuality(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalCallProblem(data json.RawMessage) (CallProblem, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeCallProblemEcho: - return UnmarshalCallProblemEcho(data) + switch meta.Type { + case TypeCallProblemEcho: + return UnmarshalCallProblemEcho(data) - case TypeCallProblemNoise: - return UnmarshalCallProblemNoise(data) + case TypeCallProblemNoise: + return UnmarshalCallProblemNoise(data) - case TypeCallProblemInterruptions: - return UnmarshalCallProblemInterruptions(data) + case TypeCallProblemInterruptions: + return UnmarshalCallProblemInterruptions(data) - case TypeCallProblemDistortedSpeech: - return UnmarshalCallProblemDistortedSpeech(data) + case TypeCallProblemDistortedSpeech: + return UnmarshalCallProblemDistortedSpeech(data) - case TypeCallProblemSilentLocal: - return UnmarshalCallProblemSilentLocal(data) + case TypeCallProblemSilentLocal: + return UnmarshalCallProblemSilentLocal(data) - case TypeCallProblemSilentRemote: - return UnmarshalCallProblemSilentRemote(data) + case TypeCallProblemSilentRemote: + return UnmarshalCallProblemSilentRemote(data) - case TypeCallProblemDropped: - return UnmarshalCallProblemDropped(data) + case TypeCallProblemDropped: + return UnmarshalCallProblemDropped(data) - case TypeCallProblemDistortedVideo: - return UnmarshalCallProblemDistortedVideo(data) + case TypeCallProblemDistortedVideo: + return UnmarshalCallProblemDistortedVideo(data) - case TypeCallProblemPixelatedVideo: - return UnmarshalCallProblemPixelatedVideo(data) + case TypeCallProblemPixelatedVideo: + return UnmarshalCallProblemPixelatedVideo(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfCallProblem(dataList []json.RawMessage) ([]CallProblem, error) { - list := []CallProblem{} + list := []CallProblem{} - for _, data := range dataList { - entity, err := UnmarshalCallProblem(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalCallProblem(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil +} + +func UnmarshalFirebaseAuthenticationSettings(data json.RawMessage) (FirebaseAuthenticationSettings, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeFirebaseAuthenticationSettingsAndroid: + return UnmarshalFirebaseAuthenticationSettingsAndroid(data) + + case TypeFirebaseAuthenticationSettingsIos: + return UnmarshalFirebaseAuthenticationSettingsIos(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfFirebaseAuthenticationSettings(dataList []json.RawMessage) ([]FirebaseAuthenticationSettings, error) { + list := []FirebaseAuthenticationSettings{} + + for _, data := range dataList { + entity, err := UnmarshalFirebaseAuthenticationSettings(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalReactionUnavailabilityReason(data json.RawMessage) (ReactionUnavailabilityReason, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeReactionUnavailabilityReasonAnonymousAdministrator: + return UnmarshalReactionUnavailabilityReasonAnonymousAdministrator(data) + + case TypeReactionUnavailabilityReasonGuest: + return UnmarshalReactionUnavailabilityReasonGuest(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfReactionUnavailabilityReason(dataList []json.RawMessage) ([]ReactionUnavailabilityReason, error) { + list := []ReactionUnavailabilityReason{} + + for _, data := range dataList { + entity, err := UnmarshalReactionUnavailabilityReason(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil } func UnmarshalDiceStickers(data json.RawMessage) (DiceStickers, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeDiceStickersRegular: - return UnmarshalDiceStickersRegular(data) + switch meta.Type { + case TypeDiceStickersRegular: + return UnmarshalDiceStickersRegular(data) - case TypeDiceStickersSlotMachine: - return UnmarshalDiceStickersSlotMachine(data) + case TypeDiceStickersSlotMachine: + return UnmarshalDiceStickersSlotMachine(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfDiceStickers(dataList []json.RawMessage) ([]DiceStickers, error) { - list := []DiceStickers{} + list := []DiceStickers{} - for _, data := range dataList { - entity, err := UnmarshalDiceStickers(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalDiceStickers(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalSpeechRecognitionResult(data json.RawMessage) (SpeechRecognitionResult, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeSpeechRecognitionResultPending: - return UnmarshalSpeechRecognitionResultPending(data) + switch meta.Type { + case TypeSpeechRecognitionResultPending: + return UnmarshalSpeechRecognitionResultPending(data) - case TypeSpeechRecognitionResultText: - return UnmarshalSpeechRecognitionResultText(data) + case TypeSpeechRecognitionResultText: + return UnmarshalSpeechRecognitionResultText(data) - case TypeSpeechRecognitionResultError: - return UnmarshalSpeechRecognitionResultError(data) + case TypeSpeechRecognitionResultError: + return UnmarshalSpeechRecognitionResultError(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfSpeechRecognitionResult(dataList []json.RawMessage) ([]SpeechRecognitionResult, error) { - list := []SpeechRecognitionResult{} + list := []SpeechRecognitionResult{} - for _, data := range dataList { - entity, err := UnmarshalSpeechRecognitionResult(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalSpeechRecognitionResult(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil +} + +func UnmarshalBotWriteAccessAllowReason(data json.RawMessage) (BotWriteAccessAllowReason, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeBotWriteAccessAllowReasonConnectedWebsite: + return UnmarshalBotWriteAccessAllowReasonConnectedWebsite(data) + + case TypeBotWriteAccessAllowReasonAddedToAttachmentMenu: + return UnmarshalBotWriteAccessAllowReasonAddedToAttachmentMenu(data) + + case TypeBotWriteAccessAllowReasonLaunchedWebApp: + return UnmarshalBotWriteAccessAllowReasonLaunchedWebApp(data) + + case TypeBotWriteAccessAllowReasonAcceptedRequest: + return UnmarshalBotWriteAccessAllowReasonAcceptedRequest(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfBotWriteAccessAllowReason(dataList []json.RawMessage) ([]BotWriteAccessAllowReason, error) { + list := []BotWriteAccessAllowReason{} + + for _, data := range dataList { + entity, err := UnmarshalBotWriteAccessAllowReason(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil } func UnmarshalInputInlineQueryResult(data json.RawMessage) (InputInlineQueryResult, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeInputInlineQueryResultAnimation: - return UnmarshalInputInlineQueryResultAnimation(data) + switch meta.Type { + case TypeInputInlineQueryResultAnimation: + return UnmarshalInputInlineQueryResultAnimation(data) - case TypeInputInlineQueryResultArticle: - return UnmarshalInputInlineQueryResultArticle(data) + case TypeInputInlineQueryResultArticle: + return UnmarshalInputInlineQueryResultArticle(data) - case TypeInputInlineQueryResultAudio: - return UnmarshalInputInlineQueryResultAudio(data) + case TypeInputInlineQueryResultAudio: + return UnmarshalInputInlineQueryResultAudio(data) - case TypeInputInlineQueryResultContact: - return UnmarshalInputInlineQueryResultContact(data) + case TypeInputInlineQueryResultContact: + return UnmarshalInputInlineQueryResultContact(data) - case TypeInputInlineQueryResultDocument: - return UnmarshalInputInlineQueryResultDocument(data) + case TypeInputInlineQueryResultDocument: + return UnmarshalInputInlineQueryResultDocument(data) - case TypeInputInlineQueryResultGame: - return UnmarshalInputInlineQueryResultGame(data) + case TypeInputInlineQueryResultGame: + return UnmarshalInputInlineQueryResultGame(data) - case TypeInputInlineQueryResultLocation: - return UnmarshalInputInlineQueryResultLocation(data) + case TypeInputInlineQueryResultLocation: + return UnmarshalInputInlineQueryResultLocation(data) - case TypeInputInlineQueryResultPhoto: - return UnmarshalInputInlineQueryResultPhoto(data) + case TypeInputInlineQueryResultPhoto: + return UnmarshalInputInlineQueryResultPhoto(data) - case TypeInputInlineQueryResultSticker: - return UnmarshalInputInlineQueryResultSticker(data) + case TypeInputInlineQueryResultSticker: + return UnmarshalInputInlineQueryResultSticker(data) - case TypeInputInlineQueryResultVenue: - return UnmarshalInputInlineQueryResultVenue(data) + case TypeInputInlineQueryResultVenue: + return UnmarshalInputInlineQueryResultVenue(data) - case TypeInputInlineQueryResultVideo: - return UnmarshalInputInlineQueryResultVideo(data) + case TypeInputInlineQueryResultVideo: + return UnmarshalInputInlineQueryResultVideo(data) - case TypeInputInlineQueryResultVoiceNote: - return UnmarshalInputInlineQueryResultVoiceNote(data) + case TypeInputInlineQueryResultVoiceNote: + return UnmarshalInputInlineQueryResultVoiceNote(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfInputInlineQueryResult(dataList []json.RawMessage) ([]InputInlineQueryResult, error) { - list := []InputInlineQueryResult{} + list := []InputInlineQueryResult{} - for _, data := range dataList { - entity, err := UnmarshalInputInlineQueryResult(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalInputInlineQueryResult(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalInlineQueryResult(data json.RawMessage) (InlineQueryResult, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeInlineQueryResultArticle: - return UnmarshalInlineQueryResultArticle(data) + switch meta.Type { + case TypeInlineQueryResultArticle: + return UnmarshalInlineQueryResultArticle(data) - case TypeInlineQueryResultContact: - return UnmarshalInlineQueryResultContact(data) + case TypeInlineQueryResultContact: + return UnmarshalInlineQueryResultContact(data) - case TypeInlineQueryResultLocation: - return UnmarshalInlineQueryResultLocation(data) + case TypeInlineQueryResultLocation: + return UnmarshalInlineQueryResultLocation(data) - case TypeInlineQueryResultVenue: - return UnmarshalInlineQueryResultVenue(data) + case TypeInlineQueryResultVenue: + return UnmarshalInlineQueryResultVenue(data) - case TypeInlineQueryResultGame: - return UnmarshalInlineQueryResultGame(data) + case TypeInlineQueryResultGame: + return UnmarshalInlineQueryResultGame(data) - case TypeInlineQueryResultAnimation: - return UnmarshalInlineQueryResultAnimation(data) + case TypeInlineQueryResultAnimation: + return UnmarshalInlineQueryResultAnimation(data) - case TypeInlineQueryResultAudio: - return UnmarshalInlineQueryResultAudio(data) + case TypeInlineQueryResultAudio: + return UnmarshalInlineQueryResultAudio(data) - case TypeInlineQueryResultDocument: - return UnmarshalInlineQueryResultDocument(data) + case TypeInlineQueryResultDocument: + return UnmarshalInlineQueryResultDocument(data) - case TypeInlineQueryResultPhoto: - return UnmarshalInlineQueryResultPhoto(data) + case TypeInlineQueryResultPhoto: + return UnmarshalInlineQueryResultPhoto(data) - case TypeInlineQueryResultSticker: - return UnmarshalInlineQueryResultSticker(data) + case TypeInlineQueryResultSticker: + return UnmarshalInlineQueryResultSticker(data) - case TypeInlineQueryResultVideo: - return UnmarshalInlineQueryResultVideo(data) + case TypeInlineQueryResultVideo: + return UnmarshalInlineQueryResultVideo(data) - case TypeInlineQueryResultVoiceNote: - return UnmarshalInlineQueryResultVoiceNote(data) + case TypeInlineQueryResultVoiceNote: + return UnmarshalInlineQueryResultVoiceNote(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfInlineQueryResult(dataList []json.RawMessage) ([]InlineQueryResult, error) { - list := []InlineQueryResult{} + list := []InlineQueryResult{} - for _, data := range dataList { - entity, err := UnmarshalInlineQueryResult(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalInlineQueryResult(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil +} + +func UnmarshalInlineQueryResultsButtonType(data json.RawMessage) (InlineQueryResultsButtonType, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeInlineQueryResultsButtonTypeStartBot: + return UnmarshalInlineQueryResultsButtonTypeStartBot(data) + + case TypeInlineQueryResultsButtonTypeWebApp: + return UnmarshalInlineQueryResultsButtonTypeWebApp(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfInlineQueryResultsButtonType(dataList []json.RawMessage) ([]InlineQueryResultsButtonType, error) { + list := []InlineQueryResultsButtonType{} + + for _, data := range dataList { + entity, err := UnmarshalInlineQueryResultsButtonType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil } func UnmarshalCallbackQueryPayload(data json.RawMessage) (CallbackQueryPayload, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeCallbackQueryPayloadData: - return UnmarshalCallbackQueryPayloadData(data) + switch meta.Type { + case TypeCallbackQueryPayloadData: + return UnmarshalCallbackQueryPayloadData(data) - case TypeCallbackQueryPayloadDataWithPassword: - return UnmarshalCallbackQueryPayloadDataWithPassword(data) + case TypeCallbackQueryPayloadDataWithPassword: + return UnmarshalCallbackQueryPayloadDataWithPassword(data) - case TypeCallbackQueryPayloadGame: - return UnmarshalCallbackQueryPayloadGame(data) + case TypeCallbackQueryPayloadGame: + return UnmarshalCallbackQueryPayloadGame(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfCallbackQueryPayload(dataList []json.RawMessage) ([]CallbackQueryPayload, error) { - list := []CallbackQueryPayload{} + list := []CallbackQueryPayload{} - for _, data := range dataList { - entity, err := UnmarshalCallbackQueryPayload(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalCallbackQueryPayload(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalChatEventAction(data json.RawMessage) (ChatEventAction, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeChatEventMessageEdited: - return UnmarshalChatEventMessageEdited(data) + switch meta.Type { + case TypeChatEventMessageEdited: + return UnmarshalChatEventMessageEdited(data) - case TypeChatEventMessageDeleted: - return UnmarshalChatEventMessageDeleted(data) + case TypeChatEventMessageDeleted: + return UnmarshalChatEventMessageDeleted(data) - case TypeChatEventMessagePinned: - return UnmarshalChatEventMessagePinned(data) + case TypeChatEventMessagePinned: + return UnmarshalChatEventMessagePinned(data) - case TypeChatEventMessageUnpinned: - return UnmarshalChatEventMessageUnpinned(data) + case TypeChatEventMessageUnpinned: + return UnmarshalChatEventMessageUnpinned(data) - case TypeChatEventPollStopped: - return UnmarshalChatEventPollStopped(data) + case TypeChatEventPollStopped: + return UnmarshalChatEventPollStopped(data) - case TypeChatEventMemberJoined: - return UnmarshalChatEventMemberJoined(data) + case TypeChatEventMemberJoined: + return UnmarshalChatEventMemberJoined(data) - case TypeChatEventMemberJoinedByInviteLink: - return UnmarshalChatEventMemberJoinedByInviteLink(data) + case TypeChatEventMemberJoinedByInviteLink: + return UnmarshalChatEventMemberJoinedByInviteLink(data) - case TypeChatEventMemberJoinedByRequest: - return UnmarshalChatEventMemberJoinedByRequest(data) + case TypeChatEventMemberJoinedByRequest: + return UnmarshalChatEventMemberJoinedByRequest(data) - case TypeChatEventMemberInvited: - return UnmarshalChatEventMemberInvited(data) + case TypeChatEventMemberInvited: + return UnmarshalChatEventMemberInvited(data) - case TypeChatEventMemberLeft: - return UnmarshalChatEventMemberLeft(data) + case TypeChatEventMemberLeft: + return UnmarshalChatEventMemberLeft(data) - case TypeChatEventMemberPromoted: - return UnmarshalChatEventMemberPromoted(data) + case TypeChatEventMemberPromoted: + return UnmarshalChatEventMemberPromoted(data) - case TypeChatEventMemberRestricted: - return UnmarshalChatEventMemberRestricted(data) + case TypeChatEventMemberRestricted: + return UnmarshalChatEventMemberRestricted(data) - case TypeChatEventAvailableReactionsChanged: - return UnmarshalChatEventAvailableReactionsChanged(data) + case TypeChatEventAvailableReactionsChanged: + return UnmarshalChatEventAvailableReactionsChanged(data) - case TypeChatEventDescriptionChanged: - return UnmarshalChatEventDescriptionChanged(data) + case TypeChatEventBackgroundChanged: + return UnmarshalChatEventBackgroundChanged(data) - case TypeChatEventLinkedChatChanged: - return UnmarshalChatEventLinkedChatChanged(data) + case TypeChatEventDescriptionChanged: + return UnmarshalChatEventDescriptionChanged(data) - case TypeChatEventLocationChanged: - return UnmarshalChatEventLocationChanged(data) + case TypeChatEventEmojiStatusChanged: + return UnmarshalChatEventEmojiStatusChanged(data) - case TypeChatEventMessageAutoDeleteTimeChanged: - return UnmarshalChatEventMessageAutoDeleteTimeChanged(data) + case TypeChatEventLinkedChatChanged: + return UnmarshalChatEventLinkedChatChanged(data) - case TypeChatEventPermissionsChanged: - return UnmarshalChatEventPermissionsChanged(data) + case TypeChatEventLocationChanged: + return UnmarshalChatEventLocationChanged(data) - case TypeChatEventPhotoChanged: - return UnmarshalChatEventPhotoChanged(data) + case TypeChatEventMessageAutoDeleteTimeChanged: + return UnmarshalChatEventMessageAutoDeleteTimeChanged(data) - case TypeChatEventSlowModeDelayChanged: - return UnmarshalChatEventSlowModeDelayChanged(data) + case TypeChatEventPermissionsChanged: + return UnmarshalChatEventPermissionsChanged(data) - case TypeChatEventStickerSetChanged: - return UnmarshalChatEventStickerSetChanged(data) + case TypeChatEventPhotoChanged: + return UnmarshalChatEventPhotoChanged(data) - case TypeChatEventTitleChanged: - return UnmarshalChatEventTitleChanged(data) + case TypeChatEventSlowModeDelayChanged: + return UnmarshalChatEventSlowModeDelayChanged(data) - case TypeChatEventUsernameChanged: - return UnmarshalChatEventUsernameChanged(data) + case TypeChatEventStickerSetChanged: + return UnmarshalChatEventStickerSetChanged(data) - case TypeChatEventActiveUsernamesChanged: - return UnmarshalChatEventActiveUsernamesChanged(data) + case TypeChatEventCustomEmojiStickerSetChanged: + return UnmarshalChatEventCustomEmojiStickerSetChanged(data) - case TypeChatEventHasProtectedContentToggled: - return UnmarshalChatEventHasProtectedContentToggled(data) + case TypeChatEventTitleChanged: + return UnmarshalChatEventTitleChanged(data) - case TypeChatEventInvitesToggled: - return UnmarshalChatEventInvitesToggled(data) + case TypeChatEventUsernameChanged: + return UnmarshalChatEventUsernameChanged(data) - case TypeChatEventIsAllHistoryAvailableToggled: - return UnmarshalChatEventIsAllHistoryAvailableToggled(data) + case TypeChatEventActiveUsernamesChanged: + return UnmarshalChatEventActiveUsernamesChanged(data) - case TypeChatEventHasAggressiveAntiSpamEnabledToggled: - return UnmarshalChatEventHasAggressiveAntiSpamEnabledToggled(data) + case TypeChatEventAccentColorChanged: + return UnmarshalChatEventAccentColorChanged(data) - case TypeChatEventSignMessagesToggled: - return UnmarshalChatEventSignMessagesToggled(data) + case TypeChatEventProfileAccentColorChanged: + return UnmarshalChatEventProfileAccentColorChanged(data) - case TypeChatEventInviteLinkEdited: - return UnmarshalChatEventInviteLinkEdited(data) + case TypeChatEventHasProtectedContentToggled: + return UnmarshalChatEventHasProtectedContentToggled(data) - case TypeChatEventInviteLinkRevoked: - return UnmarshalChatEventInviteLinkRevoked(data) + case TypeChatEventInvitesToggled: + return UnmarshalChatEventInvitesToggled(data) - case TypeChatEventInviteLinkDeleted: - return UnmarshalChatEventInviteLinkDeleted(data) + case TypeChatEventIsAllHistoryAvailableToggled: + return UnmarshalChatEventIsAllHistoryAvailableToggled(data) - case TypeChatEventVideoChatCreated: - return UnmarshalChatEventVideoChatCreated(data) + case TypeChatEventHasAggressiveAntiSpamEnabledToggled: + return UnmarshalChatEventHasAggressiveAntiSpamEnabledToggled(data) - case TypeChatEventVideoChatEnded: - return UnmarshalChatEventVideoChatEnded(data) + case TypeChatEventSignMessagesToggled: + return UnmarshalChatEventSignMessagesToggled(data) - case TypeChatEventVideoChatMuteNewParticipantsToggled: - return UnmarshalChatEventVideoChatMuteNewParticipantsToggled(data) + case TypeChatEventInviteLinkEdited: + return UnmarshalChatEventInviteLinkEdited(data) - case TypeChatEventVideoChatParticipantIsMutedToggled: - return UnmarshalChatEventVideoChatParticipantIsMutedToggled(data) + case TypeChatEventInviteLinkRevoked: + return UnmarshalChatEventInviteLinkRevoked(data) - case TypeChatEventVideoChatParticipantVolumeLevelChanged: - return UnmarshalChatEventVideoChatParticipantVolumeLevelChanged(data) + case TypeChatEventInviteLinkDeleted: + return UnmarshalChatEventInviteLinkDeleted(data) - case TypeChatEventIsForumToggled: - return UnmarshalChatEventIsForumToggled(data) + case TypeChatEventVideoChatCreated: + return UnmarshalChatEventVideoChatCreated(data) - case TypeChatEventForumTopicCreated: - return UnmarshalChatEventForumTopicCreated(data) + case TypeChatEventVideoChatEnded: + return UnmarshalChatEventVideoChatEnded(data) - case TypeChatEventForumTopicEdited: - return UnmarshalChatEventForumTopicEdited(data) + case TypeChatEventVideoChatMuteNewParticipantsToggled: + return UnmarshalChatEventVideoChatMuteNewParticipantsToggled(data) - case TypeChatEventForumTopicToggleIsClosed: - return UnmarshalChatEventForumTopicToggleIsClosed(data) + case TypeChatEventVideoChatParticipantIsMutedToggled: + return UnmarshalChatEventVideoChatParticipantIsMutedToggled(data) - case TypeChatEventForumTopicToggleIsHidden: - return UnmarshalChatEventForumTopicToggleIsHidden(data) + case TypeChatEventVideoChatParticipantVolumeLevelChanged: + return UnmarshalChatEventVideoChatParticipantVolumeLevelChanged(data) - case TypeChatEventForumTopicDeleted: - return UnmarshalChatEventForumTopicDeleted(data) + case TypeChatEventIsForumToggled: + return UnmarshalChatEventIsForumToggled(data) - case TypeChatEventForumTopicPinned: - return UnmarshalChatEventForumTopicPinned(data) + case TypeChatEventForumTopicCreated: + return UnmarshalChatEventForumTopicCreated(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + case TypeChatEventForumTopicEdited: + return UnmarshalChatEventForumTopicEdited(data) + + case TypeChatEventForumTopicToggleIsClosed: + return UnmarshalChatEventForumTopicToggleIsClosed(data) + + case TypeChatEventForumTopicToggleIsHidden: + return UnmarshalChatEventForumTopicToggleIsHidden(data) + + case TypeChatEventForumTopicDeleted: + return UnmarshalChatEventForumTopicDeleted(data) + + case TypeChatEventForumTopicPinned: + return UnmarshalChatEventForumTopicPinned(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfChatEventAction(dataList []json.RawMessage) ([]ChatEventAction, error) { - list := []ChatEventAction{} + list := []ChatEventAction{} - for _, data := range dataList { - entity, err := UnmarshalChatEventAction(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalChatEventAction(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalLanguagePackStringValue(data json.RawMessage) (LanguagePackStringValue, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeLanguagePackStringValueOrdinary: - return UnmarshalLanguagePackStringValueOrdinary(data) + switch meta.Type { + case TypeLanguagePackStringValueOrdinary: + return UnmarshalLanguagePackStringValueOrdinary(data) - case TypeLanguagePackStringValuePluralized: - return UnmarshalLanguagePackStringValuePluralized(data) + case TypeLanguagePackStringValuePluralized: + return UnmarshalLanguagePackStringValuePluralized(data) - case TypeLanguagePackStringValueDeleted: - return UnmarshalLanguagePackStringValueDeleted(data) + case TypeLanguagePackStringValueDeleted: + return UnmarshalLanguagePackStringValueDeleted(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfLanguagePackStringValue(dataList []json.RawMessage) ([]LanguagePackStringValue, error) { - list := []LanguagePackStringValue{} + list := []LanguagePackStringValue{} - for _, data := range dataList { - entity, err := UnmarshalLanguagePackStringValue(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalLanguagePackStringValue(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalPremiumLimitType(data json.RawMessage) (PremiumLimitType, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypePremiumLimitTypeSupergroupCount: - return UnmarshalPremiumLimitTypeSupergroupCount(data) + switch meta.Type { + case TypePremiumLimitTypeSupergroupCount: + return UnmarshalPremiumLimitTypeSupergroupCount(data) - case TypePremiumLimitTypePinnedChatCount: - return UnmarshalPremiumLimitTypePinnedChatCount(data) + case TypePremiumLimitTypePinnedChatCount: + return UnmarshalPremiumLimitTypePinnedChatCount(data) - case TypePremiumLimitTypeCreatedPublicChatCount: - return UnmarshalPremiumLimitTypeCreatedPublicChatCount(data) + case TypePremiumLimitTypeCreatedPublicChatCount: + return UnmarshalPremiumLimitTypeCreatedPublicChatCount(data) - case TypePremiumLimitTypeSavedAnimationCount: - return UnmarshalPremiumLimitTypeSavedAnimationCount(data) + case TypePremiumLimitTypeSavedAnimationCount: + return UnmarshalPremiumLimitTypeSavedAnimationCount(data) - case TypePremiumLimitTypeFavoriteStickerCount: - return UnmarshalPremiumLimitTypeFavoriteStickerCount(data) + case TypePremiumLimitTypeFavoriteStickerCount: + return UnmarshalPremiumLimitTypeFavoriteStickerCount(data) - case TypePremiumLimitTypeChatFilterCount: - return UnmarshalPremiumLimitTypeChatFilterCount(data) + case TypePremiumLimitTypeChatFolderCount: + return UnmarshalPremiumLimitTypeChatFolderCount(data) - case TypePremiumLimitTypeChatFilterChosenChatCount: - return UnmarshalPremiumLimitTypeChatFilterChosenChatCount(data) + case TypePremiumLimitTypeChatFolderChosenChatCount: + return UnmarshalPremiumLimitTypeChatFolderChosenChatCount(data) - case TypePremiumLimitTypePinnedArchivedChatCount: - return UnmarshalPremiumLimitTypePinnedArchivedChatCount(data) + case TypePremiumLimitTypePinnedArchivedChatCount: + return UnmarshalPremiumLimitTypePinnedArchivedChatCount(data) - case TypePremiumLimitTypeCaptionLength: - return UnmarshalPremiumLimitTypeCaptionLength(data) + case TypePremiumLimitTypePinnedSavedMessagesTopicCount: + return UnmarshalPremiumLimitTypePinnedSavedMessagesTopicCount(data) - case TypePremiumLimitTypeBioLength: - return UnmarshalPremiumLimitTypeBioLength(data) + case TypePremiumLimitTypeCaptionLength: + return UnmarshalPremiumLimitTypeCaptionLength(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + case TypePremiumLimitTypeBioLength: + return UnmarshalPremiumLimitTypeBioLength(data) + + case TypePremiumLimitTypeChatFolderInviteLinkCount: + return UnmarshalPremiumLimitTypeChatFolderInviteLinkCount(data) + + case TypePremiumLimitTypeShareableChatFolderCount: + return UnmarshalPremiumLimitTypeShareableChatFolderCount(data) + + case TypePremiumLimitTypeActiveStoryCount: + return UnmarshalPremiumLimitTypeActiveStoryCount(data) + + case TypePremiumLimitTypeWeeklySentStoryCount: + return UnmarshalPremiumLimitTypeWeeklySentStoryCount(data) + + case TypePremiumLimitTypeMonthlySentStoryCount: + return UnmarshalPremiumLimitTypeMonthlySentStoryCount(data) + + case TypePremiumLimitTypeStoryCaptionLength: + return UnmarshalPremiumLimitTypeStoryCaptionLength(data) + + case TypePremiumLimitTypeStorySuggestedReactionAreaCount: + return UnmarshalPremiumLimitTypeStorySuggestedReactionAreaCount(data) + + case TypePremiumLimitTypeSimilarChatCount: + return UnmarshalPremiumLimitTypeSimilarChatCount(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfPremiumLimitType(dataList []json.RawMessage) ([]PremiumLimitType, error) { - list := []PremiumLimitType{} + list := []PremiumLimitType{} - for _, data := range dataList { - entity, err := UnmarshalPremiumLimitType(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalPremiumLimitType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalPremiumFeature(data json.RawMessage) (PremiumFeature, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypePremiumFeatureIncreasedLimits: - return UnmarshalPremiumFeatureIncreasedLimits(data) + switch meta.Type { + case TypePremiumFeatureIncreasedLimits: + return UnmarshalPremiumFeatureIncreasedLimits(data) - case TypePremiumFeatureIncreasedUploadFileSize: - return UnmarshalPremiumFeatureIncreasedUploadFileSize(data) + case TypePremiumFeatureIncreasedUploadFileSize: + return UnmarshalPremiumFeatureIncreasedUploadFileSize(data) - case TypePremiumFeatureImprovedDownloadSpeed: - return UnmarshalPremiumFeatureImprovedDownloadSpeed(data) + case TypePremiumFeatureImprovedDownloadSpeed: + return UnmarshalPremiumFeatureImprovedDownloadSpeed(data) - case TypePremiumFeatureVoiceRecognition: - return UnmarshalPremiumFeatureVoiceRecognition(data) + case TypePremiumFeatureVoiceRecognition: + return UnmarshalPremiumFeatureVoiceRecognition(data) - case TypePremiumFeatureDisabledAds: - return UnmarshalPremiumFeatureDisabledAds(data) + case TypePremiumFeatureDisabledAds: + return UnmarshalPremiumFeatureDisabledAds(data) - case TypePremiumFeatureUniqueReactions: - return UnmarshalPremiumFeatureUniqueReactions(data) + case TypePremiumFeatureUniqueReactions: + return UnmarshalPremiumFeatureUniqueReactions(data) - case TypePremiumFeatureUniqueStickers: - return UnmarshalPremiumFeatureUniqueStickers(data) + case TypePremiumFeatureUniqueStickers: + return UnmarshalPremiumFeatureUniqueStickers(data) - case TypePremiumFeatureCustomEmoji: - return UnmarshalPremiumFeatureCustomEmoji(data) + case TypePremiumFeatureCustomEmoji: + return UnmarshalPremiumFeatureCustomEmoji(data) - case TypePremiumFeatureAdvancedChatManagement: - return UnmarshalPremiumFeatureAdvancedChatManagement(data) + case TypePremiumFeatureAdvancedChatManagement: + return UnmarshalPremiumFeatureAdvancedChatManagement(data) - case TypePremiumFeatureProfileBadge: - return UnmarshalPremiumFeatureProfileBadge(data) + case TypePremiumFeatureProfileBadge: + return UnmarshalPremiumFeatureProfileBadge(data) - case TypePremiumFeatureEmojiStatus: - return UnmarshalPremiumFeatureEmojiStatus(data) + case TypePremiumFeatureEmojiStatus: + return UnmarshalPremiumFeatureEmojiStatus(data) - case TypePremiumFeatureAnimatedProfilePhoto: - return UnmarshalPremiumFeatureAnimatedProfilePhoto(data) + case TypePremiumFeatureAnimatedProfilePhoto: + return UnmarshalPremiumFeatureAnimatedProfilePhoto(data) - case TypePremiumFeatureForumTopicIcon: - return UnmarshalPremiumFeatureForumTopicIcon(data) + case TypePremiumFeatureForumTopicIcon: + return UnmarshalPremiumFeatureForumTopicIcon(data) - case TypePremiumFeatureAppIcons: - return UnmarshalPremiumFeatureAppIcons(data) + case TypePremiumFeatureAppIcons: + return UnmarshalPremiumFeatureAppIcons(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + case TypePremiumFeatureRealTimeChatTranslation: + return UnmarshalPremiumFeatureRealTimeChatTranslation(data) + + case TypePremiumFeatureUpgradedStories: + return UnmarshalPremiumFeatureUpgradedStories(data) + + case TypePremiumFeatureChatBoost: + return UnmarshalPremiumFeatureChatBoost(data) + + case TypePremiumFeatureAccentColor: + return UnmarshalPremiumFeatureAccentColor(data) + + case TypePremiumFeatureBackgroundForBoth: + return UnmarshalPremiumFeatureBackgroundForBoth(data) + + case TypePremiumFeatureSavedMessagesTags: + return UnmarshalPremiumFeatureSavedMessagesTags(data) + + case TypePremiumFeatureMessagePrivacy: + return UnmarshalPremiumFeatureMessagePrivacy(data) + + case TypePremiumFeatureLastSeenTimes: + return UnmarshalPremiumFeatureLastSeenTimes(data) + + case TypePremiumFeatureBusiness: + return UnmarshalPremiumFeatureBusiness(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfPremiumFeature(dataList []json.RawMessage) ([]PremiumFeature, error) { - list := []PremiumFeature{} + list := []PremiumFeature{} - for _, data := range dataList { - entity, err := UnmarshalPremiumFeature(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalPremiumFeature(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil +} + +func UnmarshalBusinessFeature(data json.RawMessage) (BusinessFeature, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeBusinessFeatureLocation: + return UnmarshalBusinessFeatureLocation(data) + + case TypeBusinessFeatureOpeningHours: + return UnmarshalBusinessFeatureOpeningHours(data) + + case TypeBusinessFeatureQuickReplies: + return UnmarshalBusinessFeatureQuickReplies(data) + + case TypeBusinessFeatureGreetingMessage: + return UnmarshalBusinessFeatureGreetingMessage(data) + + case TypeBusinessFeatureAwayMessage: + return UnmarshalBusinessFeatureAwayMessage(data) + + case TypeBusinessFeatureAccountLinks: + return UnmarshalBusinessFeatureAccountLinks(data) + + case TypeBusinessFeatureIntro: + return UnmarshalBusinessFeatureIntro(data) + + case TypeBusinessFeatureBots: + return UnmarshalBusinessFeatureBots(data) + + case TypeBusinessFeatureEmojiStatus: + return UnmarshalBusinessFeatureEmojiStatus(data) + + case TypeBusinessFeatureChatFolderTags: + return UnmarshalBusinessFeatureChatFolderTags(data) + + case TypeBusinessFeatureUpgradedStories: + return UnmarshalBusinessFeatureUpgradedStories(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfBusinessFeature(dataList []json.RawMessage) ([]BusinessFeature, error) { + list := []BusinessFeature{} + + for _, data := range dataList { + entity, err := UnmarshalBusinessFeature(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalPremiumStoryFeature(data json.RawMessage) (PremiumStoryFeature, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypePremiumStoryFeaturePriorityOrder: + return UnmarshalPremiumStoryFeaturePriorityOrder(data) + + case TypePremiumStoryFeatureStealthMode: + return UnmarshalPremiumStoryFeatureStealthMode(data) + + case TypePremiumStoryFeaturePermanentViewsHistory: + return UnmarshalPremiumStoryFeaturePermanentViewsHistory(data) + + case TypePremiumStoryFeatureCustomExpirationDuration: + return UnmarshalPremiumStoryFeatureCustomExpirationDuration(data) + + case TypePremiumStoryFeatureSaveStories: + return UnmarshalPremiumStoryFeatureSaveStories(data) + + case TypePremiumStoryFeatureLinksAndFormatting: + return UnmarshalPremiumStoryFeatureLinksAndFormatting(data) + + case TypePremiumStoryFeatureVideoQuality: + return UnmarshalPremiumStoryFeatureVideoQuality(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfPremiumStoryFeature(dataList []json.RawMessage) ([]PremiumStoryFeature, error) { + list := []PremiumStoryFeature{} + + for _, data := range dataList { + entity, err := UnmarshalPremiumStoryFeature(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil } func UnmarshalPremiumSource(data json.RawMessage) (PremiumSource, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypePremiumSourceLimitExceeded: - return UnmarshalPremiumSourceLimitExceeded(data) + switch meta.Type { + case TypePremiumSourceLimitExceeded: + return UnmarshalPremiumSourceLimitExceeded(data) - case TypePremiumSourceFeature: - return UnmarshalPremiumSourceFeature(data) + case TypePremiumSourceFeature: + return UnmarshalPremiumSourceFeature(data) - case TypePremiumSourceLink: - return UnmarshalPremiumSourceLink(data) + case TypePremiumSourceBusinessFeature: + return UnmarshalPremiumSourceBusinessFeature(data) - case TypePremiumSourceSettings: - return UnmarshalPremiumSourceSettings(data) + case TypePremiumSourceStoryFeature: + return UnmarshalPremiumSourceStoryFeature(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + case TypePremiumSourceLink: + return UnmarshalPremiumSourceLink(data) + + case TypePremiumSourceSettings: + return UnmarshalPremiumSourceSettings(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfPremiumSource(dataList []json.RawMessage) ([]PremiumSource, error) { - list := []PremiumSource{} + list := []PremiumSource{} - for _, data := range dataList { - entity, err := UnmarshalPremiumSource(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalPremiumSource(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalStorePaymentPurpose(data json.RawMessage) (StorePaymentPurpose, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeStorePaymentPurposePremiumSubscription: - return UnmarshalStorePaymentPurposePremiumSubscription(data) + switch meta.Type { + case TypeStorePaymentPurposePremiumSubscription: + return UnmarshalStorePaymentPurposePremiumSubscription(data) - case TypeStorePaymentPurposeGiftedPremium: - return UnmarshalStorePaymentPurposeGiftedPremium(data) + case TypeStorePaymentPurposeGiftedPremium: + return UnmarshalStorePaymentPurposeGiftedPremium(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + case TypeStorePaymentPurposePremiumGiftCodes: + return UnmarshalStorePaymentPurposePremiumGiftCodes(data) + + case TypeStorePaymentPurposePremiumGiveaway: + return UnmarshalStorePaymentPurposePremiumGiveaway(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfStorePaymentPurpose(dataList []json.RawMessage) ([]StorePaymentPurpose, error) { - list := []StorePaymentPurpose{} + list := []StorePaymentPurpose{} - for _, data := range dataList { - entity, err := UnmarshalStorePaymentPurpose(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalStorePaymentPurpose(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil +} + +func UnmarshalTelegramPaymentPurpose(data json.RawMessage) (TelegramPaymentPurpose, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeTelegramPaymentPurposePremiumGiftCodes: + return UnmarshalTelegramPaymentPurposePremiumGiftCodes(data) + + case TypeTelegramPaymentPurposePremiumGiveaway: + return UnmarshalTelegramPaymentPurposePremiumGiveaway(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfTelegramPaymentPurpose(dataList []json.RawMessage) ([]TelegramPaymentPurpose, error) { + list := []TelegramPaymentPurpose{} + + for _, data := range dataList { + entity, err := UnmarshalTelegramPaymentPurpose(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil } func UnmarshalDeviceToken(data json.RawMessage) (DeviceToken, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeDeviceTokenFirebaseCloudMessaging: - return UnmarshalDeviceTokenFirebaseCloudMessaging(data) + switch meta.Type { + case TypeDeviceTokenFirebaseCloudMessaging: + return UnmarshalDeviceTokenFirebaseCloudMessaging(data) - case TypeDeviceTokenApplePush: - return UnmarshalDeviceTokenApplePush(data) + case TypeDeviceTokenApplePush: + return UnmarshalDeviceTokenApplePush(data) - case TypeDeviceTokenApplePushVoIP: - return UnmarshalDeviceTokenApplePushVoIP(data) + case TypeDeviceTokenApplePushVoIP: + return UnmarshalDeviceTokenApplePushVoIP(data) - case TypeDeviceTokenWindowsPush: - return UnmarshalDeviceTokenWindowsPush(data) + case TypeDeviceTokenWindowsPush: + return UnmarshalDeviceTokenWindowsPush(data) - case TypeDeviceTokenMicrosoftPush: - return UnmarshalDeviceTokenMicrosoftPush(data) + case TypeDeviceTokenMicrosoftPush: + return UnmarshalDeviceTokenMicrosoftPush(data) - case TypeDeviceTokenMicrosoftPushVoIP: - return UnmarshalDeviceTokenMicrosoftPushVoIP(data) + case TypeDeviceTokenMicrosoftPushVoIP: + return UnmarshalDeviceTokenMicrosoftPushVoIP(data) - case TypeDeviceTokenWebPush: - return UnmarshalDeviceTokenWebPush(data) + case TypeDeviceTokenWebPush: + return UnmarshalDeviceTokenWebPush(data) - case TypeDeviceTokenSimplePush: - return UnmarshalDeviceTokenSimplePush(data) + case TypeDeviceTokenSimplePush: + return UnmarshalDeviceTokenSimplePush(data) - case TypeDeviceTokenUbuntuPush: - return UnmarshalDeviceTokenUbuntuPush(data) + case TypeDeviceTokenUbuntuPush: + return UnmarshalDeviceTokenUbuntuPush(data) - case TypeDeviceTokenBlackBerryPush: - return UnmarshalDeviceTokenBlackBerryPush(data) + case TypeDeviceTokenBlackBerryPush: + return UnmarshalDeviceTokenBlackBerryPush(data) - case TypeDeviceTokenTizenPush: - return UnmarshalDeviceTokenTizenPush(data) + case TypeDeviceTokenTizenPush: + return UnmarshalDeviceTokenTizenPush(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + case TypeDeviceTokenHuaweiPush: + return UnmarshalDeviceTokenHuaweiPush(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfDeviceToken(dataList []json.RawMessage) ([]DeviceToken, error) { - list := []DeviceToken{} + list := []DeviceToken{} - for _, data := range dataList { - entity, err := UnmarshalDeviceToken(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalDeviceToken(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalBackgroundFill(data json.RawMessage) (BackgroundFill, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeBackgroundFillSolid: - return UnmarshalBackgroundFillSolid(data) + switch meta.Type { + case TypeBackgroundFillSolid: + return UnmarshalBackgroundFillSolid(data) - case TypeBackgroundFillGradient: - return UnmarshalBackgroundFillGradient(data) + case TypeBackgroundFillGradient: + return UnmarshalBackgroundFillGradient(data) - case TypeBackgroundFillFreeformGradient: - return UnmarshalBackgroundFillFreeformGradient(data) + case TypeBackgroundFillFreeformGradient: + return UnmarshalBackgroundFillFreeformGradient(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfBackgroundFill(dataList []json.RawMessage) ([]BackgroundFill, error) { - list := []BackgroundFill{} + list := []BackgroundFill{} - for _, data := range dataList { - entity, err := UnmarshalBackgroundFill(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalBackgroundFill(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalBackgroundType(data json.RawMessage) (BackgroundType, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeBackgroundTypeWallpaper: - return UnmarshalBackgroundTypeWallpaper(data) + switch meta.Type { + case TypeBackgroundTypeWallpaper: + return UnmarshalBackgroundTypeWallpaper(data) - case TypeBackgroundTypePattern: - return UnmarshalBackgroundTypePattern(data) + case TypeBackgroundTypePattern: + return UnmarshalBackgroundTypePattern(data) - case TypeBackgroundTypeFill: - return UnmarshalBackgroundTypeFill(data) + case TypeBackgroundTypeFill: + return UnmarshalBackgroundTypeFill(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + case TypeBackgroundTypeChatTheme: + return UnmarshalBackgroundTypeChatTheme(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfBackgroundType(dataList []json.RawMessage) ([]BackgroundType, error) { - list := []BackgroundType{} + list := []BackgroundType{} - for _, data := range dataList { - entity, err := UnmarshalBackgroundType(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalBackgroundType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalInputBackground(data json.RawMessage) (InputBackground, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeInputBackgroundLocal: - return UnmarshalInputBackgroundLocal(data) + switch meta.Type { + case TypeInputBackgroundLocal: + return UnmarshalInputBackgroundLocal(data) - case TypeInputBackgroundRemote: - return UnmarshalInputBackgroundRemote(data) + case TypeInputBackgroundRemote: + return UnmarshalInputBackgroundRemote(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + case TypeInputBackgroundPrevious: + return UnmarshalInputBackgroundPrevious(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfInputBackground(dataList []json.RawMessage) ([]InputBackground, error) { - list := []InputBackground{} + list := []InputBackground{} - for _, data := range dataList { - entity, err := UnmarshalInputBackground(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalInputBackground(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil +} + +func UnmarshalCanSendStoryResult(data json.RawMessage) (CanSendStoryResult, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeCanSendStoryResultOk: + return UnmarshalCanSendStoryResultOk(data) + + case TypeCanSendStoryResultPremiumNeeded: + return UnmarshalCanSendStoryResultPremiumNeeded(data) + + case TypeCanSendStoryResultBoostNeeded: + return UnmarshalCanSendStoryResultBoostNeeded(data) + + case TypeCanSendStoryResultActiveStoryLimitExceeded: + return UnmarshalCanSendStoryResultActiveStoryLimitExceeded(data) + + case TypeCanSendStoryResultWeeklyLimitExceeded: + return UnmarshalCanSendStoryResultWeeklyLimitExceeded(data) + + case TypeCanSendStoryResultMonthlyLimitExceeded: + return UnmarshalCanSendStoryResultMonthlyLimitExceeded(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfCanSendStoryResult(dataList []json.RawMessage) ([]CanSendStoryResult, error) { + list := []CanSendStoryResult{} + + for _, data := range dataList { + entity, err := UnmarshalCanSendStoryResult(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil } func UnmarshalCanTransferOwnershipResult(data json.RawMessage) (CanTransferOwnershipResult, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeCanTransferOwnershipResultOk: - return UnmarshalCanTransferOwnershipResultOk(data) + switch meta.Type { + case TypeCanTransferOwnershipResultOk: + return UnmarshalCanTransferOwnershipResultOk(data) - case TypeCanTransferOwnershipResultPasswordNeeded: - return UnmarshalCanTransferOwnershipResultPasswordNeeded(data) + case TypeCanTransferOwnershipResultPasswordNeeded: + return UnmarshalCanTransferOwnershipResultPasswordNeeded(data) - case TypeCanTransferOwnershipResultPasswordTooFresh: - return UnmarshalCanTransferOwnershipResultPasswordTooFresh(data) + case TypeCanTransferOwnershipResultPasswordTooFresh: + return UnmarshalCanTransferOwnershipResultPasswordTooFresh(data) - case TypeCanTransferOwnershipResultSessionTooFresh: - return UnmarshalCanTransferOwnershipResultSessionTooFresh(data) + case TypeCanTransferOwnershipResultSessionTooFresh: + return UnmarshalCanTransferOwnershipResultSessionTooFresh(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfCanTransferOwnershipResult(dataList []json.RawMessage) ([]CanTransferOwnershipResult, error) { - list := []CanTransferOwnershipResult{} + list := []CanTransferOwnershipResult{} - for _, data := range dataList { - entity, err := UnmarshalCanTransferOwnershipResult(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalCanTransferOwnershipResult(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalCheckChatUsernameResult(data json.RawMessage) (CheckChatUsernameResult, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeCheckChatUsernameResultOk: - return UnmarshalCheckChatUsernameResultOk(data) + switch meta.Type { + case TypeCheckChatUsernameResultOk: + return UnmarshalCheckChatUsernameResultOk(data) - case TypeCheckChatUsernameResultUsernameInvalid: - return UnmarshalCheckChatUsernameResultUsernameInvalid(data) + case TypeCheckChatUsernameResultUsernameInvalid: + return UnmarshalCheckChatUsernameResultUsernameInvalid(data) - case TypeCheckChatUsernameResultUsernameOccupied: - return UnmarshalCheckChatUsernameResultUsernameOccupied(data) + case TypeCheckChatUsernameResultUsernameOccupied: + return UnmarshalCheckChatUsernameResultUsernameOccupied(data) - case TypeCheckChatUsernameResultUsernamePurchasable: - return UnmarshalCheckChatUsernameResultUsernamePurchasable(data) + case TypeCheckChatUsernameResultUsernamePurchasable: + return UnmarshalCheckChatUsernameResultUsernamePurchasable(data) - case TypeCheckChatUsernameResultPublicChatsTooMany: - return UnmarshalCheckChatUsernameResultPublicChatsTooMany(data) + case TypeCheckChatUsernameResultPublicChatsTooMany: + return UnmarshalCheckChatUsernameResultPublicChatsTooMany(data) - case TypeCheckChatUsernameResultPublicGroupsUnavailable: - return UnmarshalCheckChatUsernameResultPublicGroupsUnavailable(data) + case TypeCheckChatUsernameResultPublicGroupsUnavailable: + return UnmarshalCheckChatUsernameResultPublicGroupsUnavailable(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfCheckChatUsernameResult(dataList []json.RawMessage) ([]CheckChatUsernameResult, error) { - list := []CheckChatUsernameResult{} + list := []CheckChatUsernameResult{} - for _, data := range dataList { - entity, err := UnmarshalCheckChatUsernameResult(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalCheckChatUsernameResult(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalCheckStickerSetNameResult(data json.RawMessage) (CheckStickerSetNameResult, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeCheckStickerSetNameResultOk: - return UnmarshalCheckStickerSetNameResultOk(data) + switch meta.Type { + case TypeCheckStickerSetNameResultOk: + return UnmarshalCheckStickerSetNameResultOk(data) - case TypeCheckStickerSetNameResultNameInvalid: - return UnmarshalCheckStickerSetNameResultNameInvalid(data) + case TypeCheckStickerSetNameResultNameInvalid: + return UnmarshalCheckStickerSetNameResultNameInvalid(data) - case TypeCheckStickerSetNameResultNameOccupied: - return UnmarshalCheckStickerSetNameResultNameOccupied(data) + case TypeCheckStickerSetNameResultNameOccupied: + return UnmarshalCheckStickerSetNameResultNameOccupied(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfCheckStickerSetNameResult(dataList []json.RawMessage) ([]CheckStickerSetNameResult, error) { - list := []CheckStickerSetNameResult{} + list := []CheckStickerSetNameResult{} - for _, data := range dataList { - entity, err := UnmarshalCheckStickerSetNameResult(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalCheckStickerSetNameResult(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalResetPasswordResult(data json.RawMessage) (ResetPasswordResult, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeResetPasswordResultOk: - return UnmarshalResetPasswordResultOk(data) + switch meta.Type { + case TypeResetPasswordResultOk: + return UnmarshalResetPasswordResultOk(data) - case TypeResetPasswordResultPending: - return UnmarshalResetPasswordResultPending(data) + case TypeResetPasswordResultPending: + return UnmarshalResetPasswordResultPending(data) - case TypeResetPasswordResultDeclined: - return UnmarshalResetPasswordResultDeclined(data) + case TypeResetPasswordResultDeclined: + return UnmarshalResetPasswordResultDeclined(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfResetPasswordResult(dataList []json.RawMessage) ([]ResetPasswordResult, error) { - list := []ResetPasswordResult{} + list := []ResetPasswordResult{} - for _, data := range dataList { - entity, err := UnmarshalResetPasswordResult(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalResetPasswordResult(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalMessageFileType(data json.RawMessage) (MessageFileType, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeMessageFileTypePrivate: - return UnmarshalMessageFileTypePrivate(data) + switch meta.Type { + case TypeMessageFileTypePrivate: + return UnmarshalMessageFileTypePrivate(data) - case TypeMessageFileTypeGroup: - return UnmarshalMessageFileTypeGroup(data) + case TypeMessageFileTypeGroup: + return UnmarshalMessageFileTypeGroup(data) - case TypeMessageFileTypeUnknown: - return UnmarshalMessageFileTypeUnknown(data) + case TypeMessageFileTypeUnknown: + return UnmarshalMessageFileTypeUnknown(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfMessageFileType(dataList []json.RawMessage) ([]MessageFileType, error) { - list := []MessageFileType{} + list := []MessageFileType{} - for _, data := range dataList { - entity, err := UnmarshalMessageFileType(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalMessageFileType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalPushMessageContent(data json.RawMessage) (PushMessageContent, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypePushMessageContentHidden: - return UnmarshalPushMessageContentHidden(data) + switch meta.Type { + case TypePushMessageContentHidden: + return UnmarshalPushMessageContentHidden(data) - case TypePushMessageContentAnimation: - return UnmarshalPushMessageContentAnimation(data) + case TypePushMessageContentAnimation: + return UnmarshalPushMessageContentAnimation(data) - case TypePushMessageContentAudio: - return UnmarshalPushMessageContentAudio(data) + case TypePushMessageContentAudio: + return UnmarshalPushMessageContentAudio(data) - case TypePushMessageContentContact: - return UnmarshalPushMessageContentContact(data) + case TypePushMessageContentContact: + return UnmarshalPushMessageContentContact(data) - case TypePushMessageContentContactRegistered: - return UnmarshalPushMessageContentContactRegistered(data) + case TypePushMessageContentContactRegistered: + return UnmarshalPushMessageContentContactRegistered(data) - case TypePushMessageContentDocument: - return UnmarshalPushMessageContentDocument(data) + case TypePushMessageContentDocument: + return UnmarshalPushMessageContentDocument(data) - case TypePushMessageContentGame: - return UnmarshalPushMessageContentGame(data) + case TypePushMessageContentGame: + return UnmarshalPushMessageContentGame(data) - case TypePushMessageContentGameScore: - return UnmarshalPushMessageContentGameScore(data) + case TypePushMessageContentGameScore: + return UnmarshalPushMessageContentGameScore(data) - case TypePushMessageContentInvoice: - return UnmarshalPushMessageContentInvoice(data) + case TypePushMessageContentInvoice: + return UnmarshalPushMessageContentInvoice(data) - case TypePushMessageContentLocation: - return UnmarshalPushMessageContentLocation(data) + case TypePushMessageContentLocation: + return UnmarshalPushMessageContentLocation(data) - case TypePushMessageContentPhoto: - return UnmarshalPushMessageContentPhoto(data) + case TypePushMessageContentPhoto: + return UnmarshalPushMessageContentPhoto(data) - case TypePushMessageContentPoll: - return UnmarshalPushMessageContentPoll(data) + case TypePushMessageContentPoll: + return UnmarshalPushMessageContentPoll(data) - case TypePushMessageContentScreenshotTaken: - return UnmarshalPushMessageContentScreenshotTaken(data) + case TypePushMessageContentPremiumGiftCode: + return UnmarshalPushMessageContentPremiumGiftCode(data) - case TypePushMessageContentSticker: - return UnmarshalPushMessageContentSticker(data) + case TypePushMessageContentPremiumGiveaway: + return UnmarshalPushMessageContentPremiumGiveaway(data) - case TypePushMessageContentText: - return UnmarshalPushMessageContentText(data) + case TypePushMessageContentScreenshotTaken: + return UnmarshalPushMessageContentScreenshotTaken(data) - case TypePushMessageContentVideo: - return UnmarshalPushMessageContentVideo(data) + case TypePushMessageContentSticker: + return UnmarshalPushMessageContentSticker(data) - case TypePushMessageContentVideoNote: - return UnmarshalPushMessageContentVideoNote(data) + case TypePushMessageContentStory: + return UnmarshalPushMessageContentStory(data) - case TypePushMessageContentVoiceNote: - return UnmarshalPushMessageContentVoiceNote(data) + case TypePushMessageContentText: + return UnmarshalPushMessageContentText(data) - case TypePushMessageContentBasicGroupChatCreate: - return UnmarshalPushMessageContentBasicGroupChatCreate(data) + case TypePushMessageContentVideo: + return UnmarshalPushMessageContentVideo(data) - case TypePushMessageContentChatAddMembers: - return UnmarshalPushMessageContentChatAddMembers(data) + case TypePushMessageContentVideoNote: + return UnmarshalPushMessageContentVideoNote(data) - case TypePushMessageContentChatChangePhoto: - return UnmarshalPushMessageContentChatChangePhoto(data) + case TypePushMessageContentVoiceNote: + return UnmarshalPushMessageContentVoiceNote(data) - case TypePushMessageContentChatChangeTitle: - return UnmarshalPushMessageContentChatChangeTitle(data) + case TypePushMessageContentBasicGroupChatCreate: + return UnmarshalPushMessageContentBasicGroupChatCreate(data) - case TypePushMessageContentChatSetTheme: - return UnmarshalPushMessageContentChatSetTheme(data) + case TypePushMessageContentChatAddMembers: + return UnmarshalPushMessageContentChatAddMembers(data) - case TypePushMessageContentChatDeleteMember: - return UnmarshalPushMessageContentChatDeleteMember(data) + case TypePushMessageContentChatChangePhoto: + return UnmarshalPushMessageContentChatChangePhoto(data) - case TypePushMessageContentChatJoinByLink: - return UnmarshalPushMessageContentChatJoinByLink(data) + case TypePushMessageContentChatChangeTitle: + return UnmarshalPushMessageContentChatChangeTitle(data) - case TypePushMessageContentChatJoinByRequest: - return UnmarshalPushMessageContentChatJoinByRequest(data) + case TypePushMessageContentChatSetBackground: + return UnmarshalPushMessageContentChatSetBackground(data) - case TypePushMessageContentRecurringPayment: - return UnmarshalPushMessageContentRecurringPayment(data) + case TypePushMessageContentChatSetTheme: + return UnmarshalPushMessageContentChatSetTheme(data) - case TypePushMessageContentSuggestProfilePhoto: - return UnmarshalPushMessageContentSuggestProfilePhoto(data) + case TypePushMessageContentChatDeleteMember: + return UnmarshalPushMessageContentChatDeleteMember(data) - case TypePushMessageContentMessageForwards: - return UnmarshalPushMessageContentMessageForwards(data) + case TypePushMessageContentChatJoinByLink: + return UnmarshalPushMessageContentChatJoinByLink(data) - case TypePushMessageContentMediaAlbum: - return UnmarshalPushMessageContentMediaAlbum(data) + case TypePushMessageContentChatJoinByRequest: + return UnmarshalPushMessageContentChatJoinByRequest(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + case TypePushMessageContentRecurringPayment: + return UnmarshalPushMessageContentRecurringPayment(data) + + case TypePushMessageContentSuggestProfilePhoto: + return UnmarshalPushMessageContentSuggestProfilePhoto(data) + + case TypePushMessageContentMessageForwards: + return UnmarshalPushMessageContentMessageForwards(data) + + case TypePushMessageContentMediaAlbum: + return UnmarshalPushMessageContentMediaAlbum(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfPushMessageContent(dataList []json.RawMessage) ([]PushMessageContent, error) { - list := []PushMessageContent{} + list := []PushMessageContent{} - for _, data := range dataList { - entity, err := UnmarshalPushMessageContent(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalPushMessageContent(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalNotificationType(data json.RawMessage) (NotificationType, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeNotificationTypeNewMessage: - return UnmarshalNotificationTypeNewMessage(data) + switch meta.Type { + case TypeNotificationTypeNewMessage: + return UnmarshalNotificationTypeNewMessage(data) - case TypeNotificationTypeNewSecretChat: - return UnmarshalNotificationTypeNewSecretChat(data) + case TypeNotificationTypeNewSecretChat: + return UnmarshalNotificationTypeNewSecretChat(data) - case TypeNotificationTypeNewCall: - return UnmarshalNotificationTypeNewCall(data) + case TypeNotificationTypeNewCall: + return UnmarshalNotificationTypeNewCall(data) - case TypeNotificationTypeNewPushMessage: - return UnmarshalNotificationTypeNewPushMessage(data) + case TypeNotificationTypeNewPushMessage: + return UnmarshalNotificationTypeNewPushMessage(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfNotificationType(dataList []json.RawMessage) ([]NotificationType, error) { - list := []NotificationType{} + list := []NotificationType{} - for _, data := range dataList { - entity, err := UnmarshalNotificationType(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalNotificationType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalNotificationGroupType(data json.RawMessage) (NotificationGroupType, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeNotificationGroupTypeMessages: - return UnmarshalNotificationGroupTypeMessages(data) + switch meta.Type { + case TypeNotificationGroupTypeMessages: + return UnmarshalNotificationGroupTypeMessages(data) - case TypeNotificationGroupTypeMentions: - return UnmarshalNotificationGroupTypeMentions(data) + case TypeNotificationGroupTypeMentions: + return UnmarshalNotificationGroupTypeMentions(data) - case TypeNotificationGroupTypeSecretChat: - return UnmarshalNotificationGroupTypeSecretChat(data) + case TypeNotificationGroupTypeSecretChat: + return UnmarshalNotificationGroupTypeSecretChat(data) - case TypeNotificationGroupTypeCalls: - return UnmarshalNotificationGroupTypeCalls(data) + case TypeNotificationGroupTypeCalls: + return UnmarshalNotificationGroupTypeCalls(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfNotificationGroupType(dataList []json.RawMessage) ([]NotificationGroupType, error) { - list := []NotificationGroupType{} + list := []NotificationGroupType{} - for _, data := range dataList { - entity, err := UnmarshalNotificationGroupType(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalNotificationGroupType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalOptionValue(data json.RawMessage) (OptionValue, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeOptionValueBoolean: - return UnmarshalOptionValueBoolean(data) + switch meta.Type { + case TypeOptionValueBoolean: + return UnmarshalOptionValueBoolean(data) - case TypeOptionValueEmpty: - return UnmarshalOptionValueEmpty(data) + case TypeOptionValueEmpty: + return UnmarshalOptionValueEmpty(data) - case TypeOptionValueInteger: - return UnmarshalOptionValueInteger(data) + case TypeOptionValueInteger: + return UnmarshalOptionValueInteger(data) - case TypeOptionValueString: - return UnmarshalOptionValueString(data) + case TypeOptionValueString: + return UnmarshalOptionValueString(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfOptionValue(dataList []json.RawMessage) ([]OptionValue, error) { - list := []OptionValue{} + list := []OptionValue{} - for _, data := range dataList { - entity, err := UnmarshalOptionValue(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalOptionValue(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalJsonValue(data json.RawMessage) (JsonValue, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeJsonValueNull: - return UnmarshalJsonValueNull(data) + switch meta.Type { + case TypeJsonValueNull: + return UnmarshalJsonValueNull(data) - case TypeJsonValueBoolean: - return UnmarshalJsonValueBoolean(data) + case TypeJsonValueBoolean: + return UnmarshalJsonValueBoolean(data) - case TypeJsonValueNumber: - return UnmarshalJsonValueNumber(data) + case TypeJsonValueNumber: + return UnmarshalJsonValueNumber(data) - case TypeJsonValueString: - return UnmarshalJsonValueString(data) + case TypeJsonValueString: + return UnmarshalJsonValueString(data) - case TypeJsonValueArray: - return UnmarshalJsonValueArray(data) + case TypeJsonValueArray: + return UnmarshalJsonValueArray(data) - case TypeJsonValueObject: - return UnmarshalJsonValueObject(data) + case TypeJsonValueObject: + return UnmarshalJsonValueObject(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfJsonValue(dataList []json.RawMessage) ([]JsonValue, error) { - list := []JsonValue{} + list := []JsonValue{} - for _, data := range dataList { - entity, err := UnmarshalJsonValue(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalJsonValue(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil +} + +func UnmarshalStoryPrivacySettings(data json.RawMessage) (StoryPrivacySettings, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeStoryPrivacySettingsEveryone: + return UnmarshalStoryPrivacySettingsEveryone(data) + + case TypeStoryPrivacySettingsContacts: + return UnmarshalStoryPrivacySettingsContacts(data) + + case TypeStoryPrivacySettingsCloseFriends: + return UnmarshalStoryPrivacySettingsCloseFriends(data) + + case TypeStoryPrivacySettingsSelectedUsers: + return UnmarshalStoryPrivacySettingsSelectedUsers(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfStoryPrivacySettings(dataList []json.RawMessage) ([]StoryPrivacySettings, error) { + list := []StoryPrivacySettings{} + + for _, data := range dataList { + entity, err := UnmarshalStoryPrivacySettings(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil } func UnmarshalUserPrivacySettingRule(data json.RawMessage) (UserPrivacySettingRule, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeUserPrivacySettingRuleAllowAll: - return UnmarshalUserPrivacySettingRuleAllowAll(data) + switch meta.Type { + case TypeUserPrivacySettingRuleAllowAll: + return UnmarshalUserPrivacySettingRuleAllowAll(data) - case TypeUserPrivacySettingRuleAllowContacts: - return UnmarshalUserPrivacySettingRuleAllowContacts(data) + case TypeUserPrivacySettingRuleAllowContacts: + return UnmarshalUserPrivacySettingRuleAllowContacts(data) - case TypeUserPrivacySettingRuleAllowUsers: - return UnmarshalUserPrivacySettingRuleAllowUsers(data) + case TypeUserPrivacySettingRuleAllowPremiumUsers: + return UnmarshalUserPrivacySettingRuleAllowPremiumUsers(data) - case TypeUserPrivacySettingRuleAllowChatMembers: - return UnmarshalUserPrivacySettingRuleAllowChatMembers(data) + case TypeUserPrivacySettingRuleAllowUsers: + return UnmarshalUserPrivacySettingRuleAllowUsers(data) - case TypeUserPrivacySettingRuleRestrictAll: - return UnmarshalUserPrivacySettingRuleRestrictAll(data) + case TypeUserPrivacySettingRuleAllowChatMembers: + return UnmarshalUserPrivacySettingRuleAllowChatMembers(data) - case TypeUserPrivacySettingRuleRestrictContacts: - return UnmarshalUserPrivacySettingRuleRestrictContacts(data) + case TypeUserPrivacySettingRuleRestrictAll: + return UnmarshalUserPrivacySettingRuleRestrictAll(data) - case TypeUserPrivacySettingRuleRestrictUsers: - return UnmarshalUserPrivacySettingRuleRestrictUsers(data) + case TypeUserPrivacySettingRuleRestrictContacts: + return UnmarshalUserPrivacySettingRuleRestrictContacts(data) - case TypeUserPrivacySettingRuleRestrictChatMembers: - return UnmarshalUserPrivacySettingRuleRestrictChatMembers(data) + case TypeUserPrivacySettingRuleRestrictUsers: + return UnmarshalUserPrivacySettingRuleRestrictUsers(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + case TypeUserPrivacySettingRuleRestrictChatMembers: + return UnmarshalUserPrivacySettingRuleRestrictChatMembers(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfUserPrivacySettingRule(dataList []json.RawMessage) ([]UserPrivacySettingRule, error) { - list := []UserPrivacySettingRule{} + list := []UserPrivacySettingRule{} - for _, data := range dataList { - entity, err := UnmarshalUserPrivacySettingRule(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalUserPrivacySettingRule(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalUserPrivacySetting(data json.RawMessage) (UserPrivacySetting, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeUserPrivacySettingShowStatus: - return UnmarshalUserPrivacySettingShowStatus(data) + switch meta.Type { + case TypeUserPrivacySettingShowStatus: + return UnmarshalUserPrivacySettingShowStatus(data) - case TypeUserPrivacySettingShowProfilePhoto: - return UnmarshalUserPrivacySettingShowProfilePhoto(data) + case TypeUserPrivacySettingShowProfilePhoto: + return UnmarshalUserPrivacySettingShowProfilePhoto(data) - case TypeUserPrivacySettingShowLinkInForwardedMessages: - return UnmarshalUserPrivacySettingShowLinkInForwardedMessages(data) + case TypeUserPrivacySettingShowLinkInForwardedMessages: + return UnmarshalUserPrivacySettingShowLinkInForwardedMessages(data) - case TypeUserPrivacySettingShowPhoneNumber: - return UnmarshalUserPrivacySettingShowPhoneNumber(data) + case TypeUserPrivacySettingShowPhoneNumber: + return UnmarshalUserPrivacySettingShowPhoneNumber(data) - case TypeUserPrivacySettingAllowChatInvites: - return UnmarshalUserPrivacySettingAllowChatInvites(data) + case TypeUserPrivacySettingShowBio: + return UnmarshalUserPrivacySettingShowBio(data) - case TypeUserPrivacySettingAllowCalls: - return UnmarshalUserPrivacySettingAllowCalls(data) + case TypeUserPrivacySettingShowBirthdate: + return UnmarshalUserPrivacySettingShowBirthdate(data) - case TypeUserPrivacySettingAllowPeerToPeerCalls: - return UnmarshalUserPrivacySettingAllowPeerToPeerCalls(data) + case TypeUserPrivacySettingAllowChatInvites: + return UnmarshalUserPrivacySettingAllowChatInvites(data) - case TypeUserPrivacySettingAllowFindingByPhoneNumber: - return UnmarshalUserPrivacySettingAllowFindingByPhoneNumber(data) + case TypeUserPrivacySettingAllowCalls: + return UnmarshalUserPrivacySettingAllowCalls(data) - case TypeUserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages: - return UnmarshalUserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages(data) + case TypeUserPrivacySettingAllowPeerToPeerCalls: + return UnmarshalUserPrivacySettingAllowPeerToPeerCalls(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + case TypeUserPrivacySettingAllowFindingByPhoneNumber: + return UnmarshalUserPrivacySettingAllowFindingByPhoneNumber(data) + + case TypeUserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages: + return UnmarshalUserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfUserPrivacySetting(dataList []json.RawMessage) ([]UserPrivacySetting, error) { - list := []UserPrivacySetting{} + list := []UserPrivacySetting{} - for _, data := range dataList { - entity, err := UnmarshalUserPrivacySetting(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalUserPrivacySetting(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil +} + +func UnmarshalCanSendMessageToUserResult(data json.RawMessage) (CanSendMessageToUserResult, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeCanSendMessageToUserResultOk: + return UnmarshalCanSendMessageToUserResultOk(data) + + case TypeCanSendMessageToUserResultUserIsDeleted: + return UnmarshalCanSendMessageToUserResultUserIsDeleted(data) + + case TypeCanSendMessageToUserResultUserRestrictsNewChats: + return UnmarshalCanSendMessageToUserResultUserRestrictsNewChats(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfCanSendMessageToUserResult(dataList []json.RawMessage) ([]CanSendMessageToUserResult, error) { + list := []CanSendMessageToUserResult{} + + for _, data := range dataList { + entity, err := UnmarshalCanSendMessageToUserResult(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil } func UnmarshalSessionType(data json.RawMessage) (SessionType, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeSessionTypeAndroid: - return UnmarshalSessionTypeAndroid(data) + switch meta.Type { + case TypeSessionTypeAndroid: + return UnmarshalSessionTypeAndroid(data) - case TypeSessionTypeApple: - return UnmarshalSessionTypeApple(data) + case TypeSessionTypeApple: + return UnmarshalSessionTypeApple(data) - case TypeSessionTypeBrave: - return UnmarshalSessionTypeBrave(data) + case TypeSessionTypeBrave: + return UnmarshalSessionTypeBrave(data) - case TypeSessionTypeChrome: - return UnmarshalSessionTypeChrome(data) + case TypeSessionTypeChrome: + return UnmarshalSessionTypeChrome(data) - case TypeSessionTypeEdge: - return UnmarshalSessionTypeEdge(data) + case TypeSessionTypeEdge: + return UnmarshalSessionTypeEdge(data) - case TypeSessionTypeFirefox: - return UnmarshalSessionTypeFirefox(data) + case TypeSessionTypeFirefox: + return UnmarshalSessionTypeFirefox(data) - case TypeSessionTypeIpad: - return UnmarshalSessionTypeIpad(data) + case TypeSessionTypeIpad: + return UnmarshalSessionTypeIpad(data) - case TypeSessionTypeIphone: - return UnmarshalSessionTypeIphone(data) + case TypeSessionTypeIphone: + return UnmarshalSessionTypeIphone(data) - case TypeSessionTypeLinux: - return UnmarshalSessionTypeLinux(data) + case TypeSessionTypeLinux: + return UnmarshalSessionTypeLinux(data) - case TypeSessionTypeMac: - return UnmarshalSessionTypeMac(data) + case TypeSessionTypeMac: + return UnmarshalSessionTypeMac(data) - case TypeSessionTypeOpera: - return UnmarshalSessionTypeOpera(data) + case TypeSessionTypeOpera: + return UnmarshalSessionTypeOpera(data) - case TypeSessionTypeSafari: - return UnmarshalSessionTypeSafari(data) + case TypeSessionTypeSafari: + return UnmarshalSessionTypeSafari(data) - case TypeSessionTypeUbuntu: - return UnmarshalSessionTypeUbuntu(data) + case TypeSessionTypeUbuntu: + return UnmarshalSessionTypeUbuntu(data) - case TypeSessionTypeUnknown: - return UnmarshalSessionTypeUnknown(data) + case TypeSessionTypeUnknown: + return UnmarshalSessionTypeUnknown(data) - case TypeSessionTypeVivaldi: - return UnmarshalSessionTypeVivaldi(data) + case TypeSessionTypeVivaldi: + return UnmarshalSessionTypeVivaldi(data) - case TypeSessionTypeWindows: - return UnmarshalSessionTypeWindows(data) + case TypeSessionTypeWindows: + return UnmarshalSessionTypeWindows(data) - case TypeSessionTypeXbox: - return UnmarshalSessionTypeXbox(data) + case TypeSessionTypeXbox: + return UnmarshalSessionTypeXbox(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfSessionType(dataList []json.RawMessage) ([]SessionType, error) { - list := []SessionType{} + list := []SessionType{} - for _, data := range dataList { - entity, err := UnmarshalSessionType(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalSessionType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } -func UnmarshalChatReportReason(data json.RawMessage) (ChatReportReason, error) { - var meta meta +func UnmarshalReportReason(data json.RawMessage) (ReportReason, error) { + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeChatReportReasonSpam: - return UnmarshalChatReportReasonSpam(data) + switch meta.Type { + case TypeReportReasonSpam: + return UnmarshalReportReasonSpam(data) - case TypeChatReportReasonViolence: - return UnmarshalChatReportReasonViolence(data) + case TypeReportReasonViolence: + return UnmarshalReportReasonViolence(data) - case TypeChatReportReasonPornography: - return UnmarshalChatReportReasonPornography(data) + case TypeReportReasonPornography: + return UnmarshalReportReasonPornography(data) - case TypeChatReportReasonChildAbuse: - return UnmarshalChatReportReasonChildAbuse(data) + case TypeReportReasonChildAbuse: + return UnmarshalReportReasonChildAbuse(data) - case TypeChatReportReasonCopyright: - return UnmarshalChatReportReasonCopyright(data) + case TypeReportReasonCopyright: + return UnmarshalReportReasonCopyright(data) - case TypeChatReportReasonUnrelatedLocation: - return UnmarshalChatReportReasonUnrelatedLocation(data) + case TypeReportReasonUnrelatedLocation: + return UnmarshalReportReasonUnrelatedLocation(data) - case TypeChatReportReasonFake: - return UnmarshalChatReportReasonFake(data) + case TypeReportReasonFake: + return UnmarshalReportReasonFake(data) - case TypeChatReportReasonIllegalDrugs: - return UnmarshalChatReportReasonIllegalDrugs(data) + case TypeReportReasonIllegalDrugs: + return UnmarshalReportReasonIllegalDrugs(data) - case TypeChatReportReasonPersonalDetails: - return UnmarshalChatReportReasonPersonalDetails(data) + case TypeReportReasonPersonalDetails: + return UnmarshalReportReasonPersonalDetails(data) - case TypeChatReportReasonCustom: - return UnmarshalChatReportReasonCustom(data) + case TypeReportReasonCustom: + return UnmarshalReportReasonCustom(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } -func UnmarshalListOfChatReportReason(dataList []json.RawMessage) ([]ChatReportReason, error) { - list := []ChatReportReason{} +func UnmarshalListOfReportReason(dataList []json.RawMessage) ([]ReportReason, error) { + list := []ReportReason{} - for _, data := range dataList { - entity, err := UnmarshalChatReportReason(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalReportReason(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalTargetChat(data json.RawMessage) (TargetChat, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeTargetChatCurrent: - return UnmarshalTargetChatCurrent(data) + switch meta.Type { + case TypeTargetChatCurrent: + return UnmarshalTargetChatCurrent(data) - case TypeTargetChatChosen: - return UnmarshalTargetChatChosen(data) + case TypeTargetChatChosen: + return UnmarshalTargetChatChosen(data) - case TypeTargetChatInternalLink: - return UnmarshalTargetChatInternalLink(data) + case TypeTargetChatInternalLink: + return UnmarshalTargetChatInternalLink(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfTargetChat(dataList []json.RawMessage) ([]TargetChat, error) { - list := []TargetChat{} + list := []TargetChat{} - for _, data := range dataList { - entity, err := UnmarshalTargetChat(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalTargetChat(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalInternalLinkType(data json.RawMessage) (InternalLinkType, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeInternalLinkTypeActiveSessions: - return UnmarshalInternalLinkTypeActiveSessions(data) + switch meta.Type { + case TypeInternalLinkTypeActiveSessions: + return UnmarshalInternalLinkTypeActiveSessions(data) - case TypeInternalLinkTypeAttachmentMenuBot: - return UnmarshalInternalLinkTypeAttachmentMenuBot(data) + case TypeInternalLinkTypeAttachmentMenuBot: + return UnmarshalInternalLinkTypeAttachmentMenuBot(data) - case TypeInternalLinkTypeAuthenticationCode: - return UnmarshalInternalLinkTypeAuthenticationCode(data) + case TypeInternalLinkTypeAuthenticationCode: + return UnmarshalInternalLinkTypeAuthenticationCode(data) - case TypeInternalLinkTypeBackground: - return UnmarshalInternalLinkTypeBackground(data) + case TypeInternalLinkTypeBackground: + return UnmarshalInternalLinkTypeBackground(data) - case TypeInternalLinkTypeBotStart: - return UnmarshalInternalLinkTypeBotStart(data) + case TypeInternalLinkTypeBotAddToChannel: + return UnmarshalInternalLinkTypeBotAddToChannel(data) - case TypeInternalLinkTypeBotStartInGroup: - return UnmarshalInternalLinkTypeBotStartInGroup(data) + case TypeInternalLinkTypeBotStart: + return UnmarshalInternalLinkTypeBotStart(data) - case TypeInternalLinkTypeBotAddToChannel: - return UnmarshalInternalLinkTypeBotAddToChannel(data) + case TypeInternalLinkTypeBotStartInGroup: + return UnmarshalInternalLinkTypeBotStartInGroup(data) - case TypeInternalLinkTypeChangePhoneNumber: - return UnmarshalInternalLinkTypeChangePhoneNumber(data) + case TypeInternalLinkTypeChangePhoneNumber: + return UnmarshalInternalLinkTypeChangePhoneNumber(data) - case TypeInternalLinkTypeChatInvite: - return UnmarshalInternalLinkTypeChatInvite(data) + case TypeInternalLinkTypeChatBoost: + return UnmarshalInternalLinkTypeChatBoost(data) - case TypeInternalLinkTypeDefaultMessageAutoDeleteTimerSettings: - return UnmarshalInternalLinkTypeDefaultMessageAutoDeleteTimerSettings(data) + case TypeInternalLinkTypeChatFolderInvite: + return UnmarshalInternalLinkTypeChatFolderInvite(data) - case TypeInternalLinkTypeEditProfileSettings: - return UnmarshalInternalLinkTypeEditProfileSettings(data) + case TypeInternalLinkTypeChatFolderSettings: + return UnmarshalInternalLinkTypeChatFolderSettings(data) - case TypeInternalLinkTypeFilterSettings: - return UnmarshalInternalLinkTypeFilterSettings(data) + case TypeInternalLinkTypeChatInvite: + return UnmarshalInternalLinkTypeChatInvite(data) - case TypeInternalLinkTypeGame: - return UnmarshalInternalLinkTypeGame(data) + case TypeInternalLinkTypeDefaultMessageAutoDeleteTimerSettings: + return UnmarshalInternalLinkTypeDefaultMessageAutoDeleteTimerSettings(data) - case TypeInternalLinkTypeInstantView: - return UnmarshalInternalLinkTypeInstantView(data) + case TypeInternalLinkTypeEditProfileSettings: + return UnmarshalInternalLinkTypeEditProfileSettings(data) - case TypeInternalLinkTypeInvoice: - return UnmarshalInternalLinkTypeInvoice(data) + case TypeInternalLinkTypeGame: + return UnmarshalInternalLinkTypeGame(data) - case TypeInternalLinkTypeLanguagePack: - return UnmarshalInternalLinkTypeLanguagePack(data) + case TypeInternalLinkTypeInstantView: + return UnmarshalInternalLinkTypeInstantView(data) - case TypeInternalLinkTypeLanguageSettings: - return UnmarshalInternalLinkTypeLanguageSettings(data) + case TypeInternalLinkTypeInvoice: + return UnmarshalInternalLinkTypeInvoice(data) - case TypeInternalLinkTypeMessage: - return UnmarshalInternalLinkTypeMessage(data) + case TypeInternalLinkTypeLanguagePack: + return UnmarshalInternalLinkTypeLanguagePack(data) - case TypeInternalLinkTypeMessageDraft: - return UnmarshalInternalLinkTypeMessageDraft(data) + case TypeInternalLinkTypeLanguageSettings: + return UnmarshalInternalLinkTypeLanguageSettings(data) - case TypeInternalLinkTypePassportDataRequest: - return UnmarshalInternalLinkTypePassportDataRequest(data) + case TypeInternalLinkTypeMessage: + return UnmarshalInternalLinkTypeMessage(data) - case TypeInternalLinkTypePhoneNumberConfirmation: - return UnmarshalInternalLinkTypePhoneNumberConfirmation(data) + case TypeInternalLinkTypeMessageDraft: + return UnmarshalInternalLinkTypeMessageDraft(data) - case TypeInternalLinkTypePremiumFeatures: - return UnmarshalInternalLinkTypePremiumFeatures(data) + case TypeInternalLinkTypePassportDataRequest: + return UnmarshalInternalLinkTypePassportDataRequest(data) - case TypeInternalLinkTypePrivacyAndSecuritySettings: - return UnmarshalInternalLinkTypePrivacyAndSecuritySettings(data) + case TypeInternalLinkTypePhoneNumberConfirmation: + return UnmarshalInternalLinkTypePhoneNumberConfirmation(data) - case TypeInternalLinkTypeProxy: - return UnmarshalInternalLinkTypeProxy(data) + case TypeInternalLinkTypePremiumFeatures: + return UnmarshalInternalLinkTypePremiumFeatures(data) - case TypeInternalLinkTypePublicChat: - return UnmarshalInternalLinkTypePublicChat(data) + case TypeInternalLinkTypePremiumGift: + return UnmarshalInternalLinkTypePremiumGift(data) - case TypeInternalLinkTypeQrCodeAuthentication: - return UnmarshalInternalLinkTypeQrCodeAuthentication(data) + case TypeInternalLinkTypePremiumGiftCode: + return UnmarshalInternalLinkTypePremiumGiftCode(data) - case TypeInternalLinkTypeRestorePurchases: - return UnmarshalInternalLinkTypeRestorePurchases(data) + case TypeInternalLinkTypePrivacyAndSecuritySettings: + return UnmarshalInternalLinkTypePrivacyAndSecuritySettings(data) - case TypeInternalLinkTypeSettings: - return UnmarshalInternalLinkTypeSettings(data) + case TypeInternalLinkTypeProxy: + return UnmarshalInternalLinkTypeProxy(data) - case TypeInternalLinkTypeStickerSet: - return UnmarshalInternalLinkTypeStickerSet(data) + case TypeInternalLinkTypePublicChat: + return UnmarshalInternalLinkTypePublicChat(data) - case TypeInternalLinkTypeTheme: - return UnmarshalInternalLinkTypeTheme(data) + case TypeInternalLinkTypeQrCodeAuthentication: + return UnmarshalInternalLinkTypeQrCodeAuthentication(data) - case TypeInternalLinkTypeThemeSettings: - return UnmarshalInternalLinkTypeThemeSettings(data) + case TypeInternalLinkTypeRestorePurchases: + return UnmarshalInternalLinkTypeRestorePurchases(data) - case TypeInternalLinkTypeUnknownDeepLink: - return UnmarshalInternalLinkTypeUnknownDeepLink(data) + case TypeInternalLinkTypeSettings: + return UnmarshalInternalLinkTypeSettings(data) - case TypeInternalLinkTypeUnsupportedProxy: - return UnmarshalInternalLinkTypeUnsupportedProxy(data) + case TypeInternalLinkTypeSideMenuBot: + return UnmarshalInternalLinkTypeSideMenuBot(data) - case TypeInternalLinkTypeUserPhoneNumber: - return UnmarshalInternalLinkTypeUserPhoneNumber(data) + case TypeInternalLinkTypeStickerSet: + return UnmarshalInternalLinkTypeStickerSet(data) - case TypeInternalLinkTypeUserToken: - return UnmarshalInternalLinkTypeUserToken(data) + case TypeInternalLinkTypeStory: + return UnmarshalInternalLinkTypeStory(data) - case TypeInternalLinkTypeVideoChat: - return UnmarshalInternalLinkTypeVideoChat(data) + case TypeInternalLinkTypeTheme: + return UnmarshalInternalLinkTypeTheme(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + case TypeInternalLinkTypeThemeSettings: + return UnmarshalInternalLinkTypeThemeSettings(data) + + case TypeInternalLinkTypeUnknownDeepLink: + return UnmarshalInternalLinkTypeUnknownDeepLink(data) + + case TypeInternalLinkTypeUnsupportedProxy: + return UnmarshalInternalLinkTypeUnsupportedProxy(data) + + case TypeInternalLinkTypeUserPhoneNumber: + return UnmarshalInternalLinkTypeUserPhoneNumber(data) + + case TypeInternalLinkTypeUserToken: + return UnmarshalInternalLinkTypeUserToken(data) + + case TypeInternalLinkTypeVideoChat: + return UnmarshalInternalLinkTypeVideoChat(data) + + case TypeInternalLinkTypeWebApp: + return UnmarshalInternalLinkTypeWebApp(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfInternalLinkType(dataList []json.RawMessage) ([]InternalLinkType, error) { - list := []InternalLinkType{} + list := []InternalLinkType{} - for _, data := range dataList { - entity, err := UnmarshalInternalLinkType(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalInternalLinkType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil +} + +func UnmarshalBlockList(data json.RawMessage) (BlockList, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeBlockListMain: + return UnmarshalBlockListMain(data) + + case TypeBlockListStories: + return UnmarshalBlockListStories(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfBlockList(dataList []json.RawMessage) ([]BlockList, error) { + list := []BlockList{} + + for _, data := range dataList { + entity, err := UnmarshalBlockList(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil } func UnmarshalFileType(data json.RawMessage) (FileType, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeFileTypeNone: - return UnmarshalFileTypeNone(data) + switch meta.Type { + case TypeFileTypeNone: + return UnmarshalFileTypeNone(data) - case TypeFileTypeAnimation: - return UnmarshalFileTypeAnimation(data) + case TypeFileTypeAnimation: + return UnmarshalFileTypeAnimation(data) - case TypeFileTypeAudio: - return UnmarshalFileTypeAudio(data) + case TypeFileTypeAudio: + return UnmarshalFileTypeAudio(data) - case TypeFileTypeDocument: - return UnmarshalFileTypeDocument(data) + case TypeFileTypeDocument: + return UnmarshalFileTypeDocument(data) - case TypeFileTypeNotificationSound: - return UnmarshalFileTypeNotificationSound(data) + case TypeFileTypeNotificationSound: + return UnmarshalFileTypeNotificationSound(data) - case TypeFileTypePhoto: - return UnmarshalFileTypePhoto(data) + case TypeFileTypePhoto: + return UnmarshalFileTypePhoto(data) - case TypeFileTypeProfilePhoto: - return UnmarshalFileTypeProfilePhoto(data) + case TypeFileTypePhotoStory: + return UnmarshalFileTypePhotoStory(data) - case TypeFileTypeSecret: - return UnmarshalFileTypeSecret(data) + case TypeFileTypeProfilePhoto: + return UnmarshalFileTypeProfilePhoto(data) - case TypeFileTypeSecretThumbnail: - return UnmarshalFileTypeSecretThumbnail(data) + case TypeFileTypeSecret: + return UnmarshalFileTypeSecret(data) - case TypeFileTypeSecure: - return UnmarshalFileTypeSecure(data) + case TypeFileTypeSecretThumbnail: + return UnmarshalFileTypeSecretThumbnail(data) - case TypeFileTypeSticker: - return UnmarshalFileTypeSticker(data) + case TypeFileTypeSecure: + return UnmarshalFileTypeSecure(data) - case TypeFileTypeThumbnail: - return UnmarshalFileTypeThumbnail(data) + case TypeFileTypeSticker: + return UnmarshalFileTypeSticker(data) - case TypeFileTypeUnknown: - return UnmarshalFileTypeUnknown(data) + case TypeFileTypeThumbnail: + return UnmarshalFileTypeThumbnail(data) - case TypeFileTypeVideo: - return UnmarshalFileTypeVideo(data) + case TypeFileTypeUnknown: + return UnmarshalFileTypeUnknown(data) - case TypeFileTypeVideoNote: - return UnmarshalFileTypeVideoNote(data) + case TypeFileTypeVideo: + return UnmarshalFileTypeVideo(data) - case TypeFileTypeVoiceNote: - return UnmarshalFileTypeVoiceNote(data) + case TypeFileTypeVideoNote: + return UnmarshalFileTypeVideoNote(data) - case TypeFileTypeWallpaper: - return UnmarshalFileTypeWallpaper(data) + case TypeFileTypeVideoStory: + return UnmarshalFileTypeVideoStory(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + case TypeFileTypeVoiceNote: + return UnmarshalFileTypeVoiceNote(data) + + case TypeFileTypeWallpaper: + return UnmarshalFileTypeWallpaper(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfFileType(dataList []json.RawMessage) ([]FileType, error) { - list := []FileType{} + list := []FileType{} - for _, data := range dataList { - entity, err := UnmarshalFileType(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalFileType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalNetworkType(data json.RawMessage) (NetworkType, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeNetworkTypeNone: - return UnmarshalNetworkTypeNone(data) + switch meta.Type { + case TypeNetworkTypeNone: + return UnmarshalNetworkTypeNone(data) - case TypeNetworkTypeMobile: - return UnmarshalNetworkTypeMobile(data) + case TypeNetworkTypeMobile: + return UnmarshalNetworkTypeMobile(data) - case TypeNetworkTypeMobileRoaming: - return UnmarshalNetworkTypeMobileRoaming(data) + case TypeNetworkTypeMobileRoaming: + return UnmarshalNetworkTypeMobileRoaming(data) - case TypeNetworkTypeWiFi: - return UnmarshalNetworkTypeWiFi(data) + case TypeNetworkTypeWiFi: + return UnmarshalNetworkTypeWiFi(data) - case TypeNetworkTypeOther: - return UnmarshalNetworkTypeOther(data) + case TypeNetworkTypeOther: + return UnmarshalNetworkTypeOther(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfNetworkType(dataList []json.RawMessage) ([]NetworkType, error) { - list := []NetworkType{} + list := []NetworkType{} - for _, data := range dataList { - entity, err := UnmarshalNetworkType(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalNetworkType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalNetworkStatisticsEntry(data json.RawMessage) (NetworkStatisticsEntry, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeNetworkStatisticsEntryFile: - return UnmarshalNetworkStatisticsEntryFile(data) + switch meta.Type { + case TypeNetworkStatisticsEntryFile: + return UnmarshalNetworkStatisticsEntryFile(data) - case TypeNetworkStatisticsEntryCall: - return UnmarshalNetworkStatisticsEntryCall(data) + case TypeNetworkStatisticsEntryCall: + return UnmarshalNetworkStatisticsEntryCall(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfNetworkStatisticsEntry(dataList []json.RawMessage) ([]NetworkStatisticsEntry, error) { - list := []NetworkStatisticsEntry{} + list := []NetworkStatisticsEntry{} - for _, data := range dataList { - entity, err := UnmarshalNetworkStatisticsEntry(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalNetworkStatisticsEntry(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil +} + +func UnmarshalAutosaveSettingsScope(data json.RawMessage) (AutosaveSettingsScope, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeAutosaveSettingsScopePrivateChats: + return UnmarshalAutosaveSettingsScopePrivateChats(data) + + case TypeAutosaveSettingsScopeGroupChats: + return UnmarshalAutosaveSettingsScopeGroupChats(data) + + case TypeAutosaveSettingsScopeChannelChats: + return UnmarshalAutosaveSettingsScopeChannelChats(data) + + case TypeAutosaveSettingsScopeChat: + return UnmarshalAutosaveSettingsScopeChat(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfAutosaveSettingsScope(dataList []json.RawMessage) ([]AutosaveSettingsScope, error) { + list := []AutosaveSettingsScope{} + + for _, data := range dataList { + entity, err := UnmarshalAutosaveSettingsScope(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil } func UnmarshalConnectionState(data json.RawMessage) (ConnectionState, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeConnectionStateWaitingForNetwork: - return UnmarshalConnectionStateWaitingForNetwork(data) + switch meta.Type { + case TypeConnectionStateWaitingForNetwork: + return UnmarshalConnectionStateWaitingForNetwork(data) - case TypeConnectionStateConnectingToProxy: - return UnmarshalConnectionStateConnectingToProxy(data) + case TypeConnectionStateConnectingToProxy: + return UnmarshalConnectionStateConnectingToProxy(data) - case TypeConnectionStateConnecting: - return UnmarshalConnectionStateConnecting(data) + case TypeConnectionStateConnecting: + return UnmarshalConnectionStateConnecting(data) - case TypeConnectionStateUpdating: - return UnmarshalConnectionStateUpdating(data) + case TypeConnectionStateUpdating: + return UnmarshalConnectionStateUpdating(data) - case TypeConnectionStateReady: - return UnmarshalConnectionStateReady(data) + case TypeConnectionStateReady: + return UnmarshalConnectionStateReady(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfConnectionState(dataList []json.RawMessage) ([]ConnectionState, error) { - list := []ConnectionState{} + list := []ConnectionState{} - for _, data := range dataList { - entity, err := UnmarshalConnectionState(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalConnectionState(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalTopChatCategory(data json.RawMessage) (TopChatCategory, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeTopChatCategoryUsers: - return UnmarshalTopChatCategoryUsers(data) + switch meta.Type { + case TypeTopChatCategoryUsers: + return UnmarshalTopChatCategoryUsers(data) - case TypeTopChatCategoryBots: - return UnmarshalTopChatCategoryBots(data) + case TypeTopChatCategoryBots: + return UnmarshalTopChatCategoryBots(data) - case TypeTopChatCategoryGroups: - return UnmarshalTopChatCategoryGroups(data) + case TypeTopChatCategoryGroups: + return UnmarshalTopChatCategoryGroups(data) - case TypeTopChatCategoryChannels: - return UnmarshalTopChatCategoryChannels(data) + case TypeTopChatCategoryChannels: + return UnmarshalTopChatCategoryChannels(data) - case TypeTopChatCategoryInlineBots: - return UnmarshalTopChatCategoryInlineBots(data) + case TypeTopChatCategoryInlineBots: + return UnmarshalTopChatCategoryInlineBots(data) - case TypeTopChatCategoryCalls: - return UnmarshalTopChatCategoryCalls(data) + case TypeTopChatCategoryCalls: + return UnmarshalTopChatCategoryCalls(data) - case TypeTopChatCategoryForwardChats: - return UnmarshalTopChatCategoryForwardChats(data) + case TypeTopChatCategoryForwardChats: + return UnmarshalTopChatCategoryForwardChats(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfTopChatCategory(dataList []json.RawMessage) ([]TopChatCategory, error) { - list := []TopChatCategory{} + list := []TopChatCategory{} - for _, data := range dataList { - entity, err := UnmarshalTopChatCategory(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalTopChatCategory(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalTMeUrlType(data json.RawMessage) (TMeUrlType, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeTMeUrlTypeUser: - return UnmarshalTMeUrlTypeUser(data) + switch meta.Type { + case TypeTMeUrlTypeUser: + return UnmarshalTMeUrlTypeUser(data) - case TypeTMeUrlTypeSupergroup: - return UnmarshalTMeUrlTypeSupergroup(data) + case TypeTMeUrlTypeSupergroup: + return UnmarshalTMeUrlTypeSupergroup(data) - case TypeTMeUrlTypeChatInvite: - return UnmarshalTMeUrlTypeChatInvite(data) + case TypeTMeUrlTypeChatInvite: + return UnmarshalTMeUrlTypeChatInvite(data) - case TypeTMeUrlTypeStickerSet: - return UnmarshalTMeUrlTypeStickerSet(data) + case TypeTMeUrlTypeStickerSet: + return UnmarshalTMeUrlTypeStickerSet(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfTMeUrlType(dataList []json.RawMessage) ([]TMeUrlType, error) { - list := []TMeUrlType{} + list := []TMeUrlType{} - for _, data := range dataList { - entity, err := UnmarshalTMeUrlType(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalTMeUrlType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalSuggestedAction(data json.RawMessage) (SuggestedAction, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeSuggestedActionEnableArchiveAndMuteNewChats: - return UnmarshalSuggestedActionEnableArchiveAndMuteNewChats(data) + switch meta.Type { + case TypeSuggestedActionEnableArchiveAndMuteNewChats: + return UnmarshalSuggestedActionEnableArchiveAndMuteNewChats(data) - case TypeSuggestedActionCheckPassword: - return UnmarshalSuggestedActionCheckPassword(data) + case TypeSuggestedActionCheckPassword: + return UnmarshalSuggestedActionCheckPassword(data) - case TypeSuggestedActionCheckPhoneNumber: - return UnmarshalSuggestedActionCheckPhoneNumber(data) + case TypeSuggestedActionCheckPhoneNumber: + return UnmarshalSuggestedActionCheckPhoneNumber(data) - case TypeSuggestedActionViewChecksHint: - return UnmarshalSuggestedActionViewChecksHint(data) + case TypeSuggestedActionViewChecksHint: + return UnmarshalSuggestedActionViewChecksHint(data) - case TypeSuggestedActionConvertToBroadcastGroup: - return UnmarshalSuggestedActionConvertToBroadcastGroup(data) + case TypeSuggestedActionConvertToBroadcastGroup: + return UnmarshalSuggestedActionConvertToBroadcastGroup(data) - case TypeSuggestedActionSetPassword: - return UnmarshalSuggestedActionSetPassword(data) + case TypeSuggestedActionSetPassword: + return UnmarshalSuggestedActionSetPassword(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + case TypeSuggestedActionUpgradePremium: + return UnmarshalSuggestedActionUpgradePremium(data) + + case TypeSuggestedActionRestorePremium: + return UnmarshalSuggestedActionRestorePremium(data) + + case TypeSuggestedActionSubscribeToAnnualPremium: + return UnmarshalSuggestedActionSubscribeToAnnualPremium(data) + + case TypeSuggestedActionGiftPremiumForChristmas: + return UnmarshalSuggestedActionGiftPremiumForChristmas(data) + + case TypeSuggestedActionSetBirthdate: + return UnmarshalSuggestedActionSetBirthdate(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfSuggestedAction(dataList []json.RawMessage) ([]SuggestedAction, error) { - list := []SuggestedAction{} + list := []SuggestedAction{} - for _, data := range dataList { - entity, err := UnmarshalSuggestedAction(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalSuggestedAction(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalTextParseMode(data json.RawMessage) (TextParseMode, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeTextParseModeMarkdown: - return UnmarshalTextParseModeMarkdown(data) + switch meta.Type { + case TypeTextParseModeMarkdown: + return UnmarshalTextParseModeMarkdown(data) - case TypeTextParseModeHTML: - return UnmarshalTextParseModeHTML(data) + case TypeTextParseModeHTML: + return UnmarshalTextParseModeHTML(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfTextParseMode(dataList []json.RawMessage) ([]TextParseMode, error) { - list := []TextParseMode{} + list := []TextParseMode{} - for _, data := range dataList { - entity, err := UnmarshalTextParseMode(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalTextParseMode(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalProxyType(data json.RawMessage) (ProxyType, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeProxyTypeSocks5: - return UnmarshalProxyTypeSocks5(data) + switch meta.Type { + case TypeProxyTypeSocks5: + return UnmarshalProxyTypeSocks5(data) - case TypeProxyTypeHttp: - return UnmarshalProxyTypeHttp(data) + case TypeProxyTypeHttp: + return UnmarshalProxyTypeHttp(data) - case TypeProxyTypeMtproto: - return UnmarshalProxyTypeMtproto(data) + case TypeProxyTypeMtproto: + return UnmarshalProxyTypeMtproto(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfProxyType(dataList []json.RawMessage) ([]ProxyType, error) { - list := []ProxyType{} + list := []ProxyType{} - for _, data := range dataList { - entity, err := UnmarshalProxyType(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalProxyType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalStatisticalGraph(data json.RawMessage) (StatisticalGraph, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeStatisticalGraphData: - return UnmarshalStatisticalGraphData(data) + switch meta.Type { + case TypeStatisticalGraphData: + return UnmarshalStatisticalGraphData(data) - case TypeStatisticalGraphAsync: - return UnmarshalStatisticalGraphAsync(data) + case TypeStatisticalGraphAsync: + return UnmarshalStatisticalGraphAsync(data) - case TypeStatisticalGraphError: - return UnmarshalStatisticalGraphError(data) + case TypeStatisticalGraphError: + return UnmarshalStatisticalGraphError(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfStatisticalGraph(dataList []json.RawMessage) ([]StatisticalGraph, error) { - list := []StatisticalGraph{} + list := []StatisticalGraph{} - for _, data := range dataList { - entity, err := UnmarshalStatisticalGraph(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalStatisticalGraph(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil +} + +func UnmarshalChatStatisticsObjectType(data json.RawMessage) (ChatStatisticsObjectType, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeChatStatisticsObjectTypeMessage: + return UnmarshalChatStatisticsObjectTypeMessage(data) + + case TypeChatStatisticsObjectTypeStory: + return UnmarshalChatStatisticsObjectTypeStory(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfChatStatisticsObjectType(dataList []json.RawMessage) ([]ChatStatisticsObjectType, error) { + list := []ChatStatisticsObjectType{} + + for _, data := range dataList { + entity, err := UnmarshalChatStatisticsObjectType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil } func UnmarshalChatStatistics(data json.RawMessage) (ChatStatistics, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeChatStatisticsSupergroup: - return UnmarshalChatStatisticsSupergroup(data) + switch meta.Type { + case TypeChatStatisticsSupergroup: + return UnmarshalChatStatisticsSupergroup(data) - case TypeChatStatisticsChannel: - return UnmarshalChatStatisticsChannel(data) + case TypeChatStatisticsChannel: + return UnmarshalChatStatisticsChannel(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfChatStatistics(dataList []json.RawMessage) ([]ChatStatistics, error) { - list := []ChatStatistics{} + list := []ChatStatistics{} - for _, data := range dataList { - entity, err := UnmarshalChatStatistics(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalChatStatistics(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalVectorPathCommand(data json.RawMessage) (VectorPathCommand, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeVectorPathCommandLine: - return UnmarshalVectorPathCommandLine(data) + switch meta.Type { + case TypeVectorPathCommandLine: + return UnmarshalVectorPathCommandLine(data) - case TypeVectorPathCommandCubicBezierCurve: - return UnmarshalVectorPathCommandCubicBezierCurve(data) + case TypeVectorPathCommandCubicBezierCurve: + return UnmarshalVectorPathCommandCubicBezierCurve(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfVectorPathCommand(dataList []json.RawMessage) ([]VectorPathCommand, error) { - list := []VectorPathCommand{} + list := []VectorPathCommand{} - for _, data := range dataList { - entity, err := UnmarshalVectorPathCommand(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalVectorPathCommand(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalBotCommandScope(data json.RawMessage) (BotCommandScope, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeBotCommandScopeDefault: - return UnmarshalBotCommandScopeDefault(data) + switch meta.Type { + case TypeBotCommandScopeDefault: + return UnmarshalBotCommandScopeDefault(data) - case TypeBotCommandScopeAllPrivateChats: - return UnmarshalBotCommandScopeAllPrivateChats(data) + case TypeBotCommandScopeAllPrivateChats: + return UnmarshalBotCommandScopeAllPrivateChats(data) - case TypeBotCommandScopeAllGroupChats: - return UnmarshalBotCommandScopeAllGroupChats(data) + case TypeBotCommandScopeAllGroupChats: + return UnmarshalBotCommandScopeAllGroupChats(data) - case TypeBotCommandScopeAllChatAdministrators: - return UnmarshalBotCommandScopeAllChatAdministrators(data) + case TypeBotCommandScopeAllChatAdministrators: + return UnmarshalBotCommandScopeAllChatAdministrators(data) - case TypeBotCommandScopeChat: - return UnmarshalBotCommandScopeChat(data) + case TypeBotCommandScopeChat: + return UnmarshalBotCommandScopeChat(data) - case TypeBotCommandScopeChatAdministrators: - return UnmarshalBotCommandScopeChatAdministrators(data) + case TypeBotCommandScopeChatAdministrators: + return UnmarshalBotCommandScopeChatAdministrators(data) - case TypeBotCommandScopeChatMember: - return UnmarshalBotCommandScopeChatMember(data) + case TypeBotCommandScopeChatMember: + return UnmarshalBotCommandScopeChatMember(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfBotCommandScope(dataList []json.RawMessage) ([]BotCommandScope, error) { - list := []BotCommandScope{} + list := []BotCommandScope{} - for _, data := range dataList { - entity, err := UnmarshalBotCommandScope(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalBotCommandScope(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalUpdate(data json.RawMessage) (Update, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeUpdateAuthorizationState: - return UnmarshalUpdateAuthorizationState(data) + switch meta.Type { + case TypeUpdateAuthorizationState: + return UnmarshalUpdateAuthorizationState(data) - case TypeUpdateNewMessage: - return UnmarshalUpdateNewMessage(data) + case TypeUpdateNewMessage: + return UnmarshalUpdateNewMessage(data) - case TypeUpdateMessageSendAcknowledged: - return UnmarshalUpdateMessageSendAcknowledged(data) + case TypeUpdateMessageSendAcknowledged: + return UnmarshalUpdateMessageSendAcknowledged(data) - case TypeUpdateMessageSendSucceeded: - return UnmarshalUpdateMessageSendSucceeded(data) + case TypeUpdateMessageSendSucceeded: + return UnmarshalUpdateMessageSendSucceeded(data) - case TypeUpdateMessageSendFailed: - return UnmarshalUpdateMessageSendFailed(data) + case TypeUpdateMessageSendFailed: + return UnmarshalUpdateMessageSendFailed(data) - case TypeUpdateMessageContent: - return UnmarshalUpdateMessageContent(data) + case TypeUpdateMessageContent: + return UnmarshalUpdateMessageContent(data) - case TypeUpdateMessageEdited: - return UnmarshalUpdateMessageEdited(data) + case TypeUpdateMessageEdited: + return UnmarshalUpdateMessageEdited(data) - case TypeUpdateMessageIsPinned: - return UnmarshalUpdateMessageIsPinned(data) + case TypeUpdateMessageIsPinned: + return UnmarshalUpdateMessageIsPinned(data) - case TypeUpdateMessageInteractionInfo: - return UnmarshalUpdateMessageInteractionInfo(data) + case TypeUpdateMessageInteractionInfo: + return UnmarshalUpdateMessageInteractionInfo(data) - case TypeUpdateMessageContentOpened: - return UnmarshalUpdateMessageContentOpened(data) + case TypeUpdateMessageContentOpened: + return UnmarshalUpdateMessageContentOpened(data) - case TypeUpdateMessageMentionRead: - return UnmarshalUpdateMessageMentionRead(data) + case TypeUpdateMessageMentionRead: + return UnmarshalUpdateMessageMentionRead(data) - case TypeUpdateMessageUnreadReactions: - return UnmarshalUpdateMessageUnreadReactions(data) + case TypeUpdateMessageUnreadReactions: + return UnmarshalUpdateMessageUnreadReactions(data) - case TypeUpdateMessageLiveLocationViewed: - return UnmarshalUpdateMessageLiveLocationViewed(data) + case TypeUpdateMessageLiveLocationViewed: + return UnmarshalUpdateMessageLiveLocationViewed(data) - case TypeUpdateNewChat: - return UnmarshalUpdateNewChat(data) + case TypeUpdateNewChat: + return UnmarshalUpdateNewChat(data) - case TypeUpdateChatTitle: - return UnmarshalUpdateChatTitle(data) + case TypeUpdateChatTitle: + return UnmarshalUpdateChatTitle(data) - case TypeUpdateChatPhoto: - return UnmarshalUpdateChatPhoto(data) + case TypeUpdateChatPhoto: + return UnmarshalUpdateChatPhoto(data) - case TypeUpdateChatPermissions: - return UnmarshalUpdateChatPermissions(data) + case TypeUpdateChatAccentColors: + return UnmarshalUpdateChatAccentColors(data) - case TypeUpdateChatLastMessage: - return UnmarshalUpdateChatLastMessage(data) + case TypeUpdateChatPermissions: + return UnmarshalUpdateChatPermissions(data) - case TypeUpdateChatPosition: - return UnmarshalUpdateChatPosition(data) + case TypeUpdateChatLastMessage: + return UnmarshalUpdateChatLastMessage(data) - case TypeUpdateChatReadInbox: - return UnmarshalUpdateChatReadInbox(data) + case TypeUpdateChatPosition: + return UnmarshalUpdateChatPosition(data) - case TypeUpdateChatReadOutbox: - return UnmarshalUpdateChatReadOutbox(data) + case TypeUpdateChatAddedToList: + return UnmarshalUpdateChatAddedToList(data) - case TypeUpdateChatActionBar: - return UnmarshalUpdateChatActionBar(data) + case TypeUpdateChatRemovedFromList: + return UnmarshalUpdateChatRemovedFromList(data) - case TypeUpdateChatAvailableReactions: - return UnmarshalUpdateChatAvailableReactions(data) + case TypeUpdateChatReadInbox: + return UnmarshalUpdateChatReadInbox(data) - case TypeUpdateChatDraftMessage: - return UnmarshalUpdateChatDraftMessage(data) + case TypeUpdateChatReadOutbox: + return UnmarshalUpdateChatReadOutbox(data) - case TypeUpdateChatMessageSender: - return UnmarshalUpdateChatMessageSender(data) + case TypeUpdateChatActionBar: + return UnmarshalUpdateChatActionBar(data) - case TypeUpdateChatMessageAutoDeleteTime: - return UnmarshalUpdateChatMessageAutoDeleteTime(data) + case TypeUpdateChatAvailableReactions: + return UnmarshalUpdateChatAvailableReactions(data) - case TypeUpdateChatNotificationSettings: - return UnmarshalUpdateChatNotificationSettings(data) + case TypeUpdateChatDraftMessage: + return UnmarshalUpdateChatDraftMessage(data) - case TypeUpdateChatPendingJoinRequests: - return UnmarshalUpdateChatPendingJoinRequests(data) + case TypeUpdateChatEmojiStatus: + return UnmarshalUpdateChatEmojiStatus(data) - case TypeUpdateChatReplyMarkup: - return UnmarshalUpdateChatReplyMarkup(data) + case TypeUpdateChatMessageSender: + return UnmarshalUpdateChatMessageSender(data) - case TypeUpdateChatTheme: - return UnmarshalUpdateChatTheme(data) + case TypeUpdateChatMessageAutoDeleteTime: + return UnmarshalUpdateChatMessageAutoDeleteTime(data) - case TypeUpdateChatUnreadMentionCount: - return UnmarshalUpdateChatUnreadMentionCount(data) + case TypeUpdateChatNotificationSettings: + return UnmarshalUpdateChatNotificationSettings(data) - case TypeUpdateChatUnreadReactionCount: - return UnmarshalUpdateChatUnreadReactionCount(data) + case TypeUpdateChatPendingJoinRequests: + return UnmarshalUpdateChatPendingJoinRequests(data) - case TypeUpdateChatVideoChat: - return UnmarshalUpdateChatVideoChat(data) + case TypeUpdateChatReplyMarkup: + return UnmarshalUpdateChatReplyMarkup(data) - case TypeUpdateChatDefaultDisableNotification: - return UnmarshalUpdateChatDefaultDisableNotification(data) + case TypeUpdateChatBackground: + return UnmarshalUpdateChatBackground(data) - case TypeUpdateChatHasProtectedContent: - return UnmarshalUpdateChatHasProtectedContent(data) + case TypeUpdateChatTheme: + return UnmarshalUpdateChatTheme(data) - case TypeUpdateChatHasScheduledMessages: - return UnmarshalUpdateChatHasScheduledMessages(data) + case TypeUpdateChatUnreadMentionCount: + return UnmarshalUpdateChatUnreadMentionCount(data) - case TypeUpdateChatIsBlocked: - return UnmarshalUpdateChatIsBlocked(data) + case TypeUpdateChatUnreadReactionCount: + return UnmarshalUpdateChatUnreadReactionCount(data) - case TypeUpdateChatIsMarkedAsUnread: - return UnmarshalUpdateChatIsMarkedAsUnread(data) + case TypeUpdateChatVideoChat: + return UnmarshalUpdateChatVideoChat(data) - case TypeUpdateChatFilters: - return UnmarshalUpdateChatFilters(data) + case TypeUpdateChatDefaultDisableNotification: + return UnmarshalUpdateChatDefaultDisableNotification(data) - case TypeUpdateChatOnlineMemberCount: - return UnmarshalUpdateChatOnlineMemberCount(data) + case TypeUpdateChatHasProtectedContent: + return UnmarshalUpdateChatHasProtectedContent(data) - case TypeUpdateForumTopicInfo: - return UnmarshalUpdateForumTopicInfo(data) + case TypeUpdateChatIsTranslatable: + return UnmarshalUpdateChatIsTranslatable(data) - case TypeUpdateScopeNotificationSettings: - return UnmarshalUpdateScopeNotificationSettings(data) + case TypeUpdateChatIsMarkedAsUnread: + return UnmarshalUpdateChatIsMarkedAsUnread(data) - case TypeUpdateNotification: - return UnmarshalUpdateNotification(data) + case TypeUpdateChatViewAsTopics: + return UnmarshalUpdateChatViewAsTopics(data) - case TypeUpdateNotificationGroup: - return UnmarshalUpdateNotificationGroup(data) + case TypeUpdateChatBlockList: + return UnmarshalUpdateChatBlockList(data) - case TypeUpdateActiveNotifications: - return UnmarshalUpdateActiveNotifications(data) + case TypeUpdateChatHasScheduledMessages: + return UnmarshalUpdateChatHasScheduledMessages(data) - case TypeUpdateHavePendingNotifications: - return UnmarshalUpdateHavePendingNotifications(data) + case TypeUpdateChatFolders: + return UnmarshalUpdateChatFolders(data) - case TypeUpdateDeleteMessages: - return UnmarshalUpdateDeleteMessages(data) + case TypeUpdateChatOnlineMemberCount: + return UnmarshalUpdateChatOnlineMemberCount(data) - case TypeUpdateChatAction: - return UnmarshalUpdateChatAction(data) + case TypeUpdateSavedMessagesTopic: + return UnmarshalUpdateSavedMessagesTopic(data) - case TypeUpdateUserStatus: - return UnmarshalUpdateUserStatus(data) + case TypeUpdateSavedMessagesTopicCount: + return UnmarshalUpdateSavedMessagesTopicCount(data) - case TypeUpdateUser: - return UnmarshalUpdateUser(data) + case TypeUpdateQuickReplyShortcut: + return UnmarshalUpdateQuickReplyShortcut(data) - case TypeUpdateBasicGroup: - return UnmarshalUpdateBasicGroup(data) + case TypeUpdateQuickReplyShortcutDeleted: + return UnmarshalUpdateQuickReplyShortcutDeleted(data) - case TypeUpdateSupergroup: - return UnmarshalUpdateSupergroup(data) + case TypeUpdateQuickReplyShortcuts: + return UnmarshalUpdateQuickReplyShortcuts(data) - case TypeUpdateSecretChat: - return UnmarshalUpdateSecretChat(data) + case TypeUpdateQuickReplyShortcutMessages: + return UnmarshalUpdateQuickReplyShortcutMessages(data) - case TypeUpdateUserFullInfo: - return UnmarshalUpdateUserFullInfo(data) + case TypeUpdateForumTopicInfo: + return UnmarshalUpdateForumTopicInfo(data) - case TypeUpdateBasicGroupFullInfo: - return UnmarshalUpdateBasicGroupFullInfo(data) + case TypeUpdateScopeNotificationSettings: + return UnmarshalUpdateScopeNotificationSettings(data) - case TypeUpdateSupergroupFullInfo: - return UnmarshalUpdateSupergroupFullInfo(data) + case TypeUpdateNotification: + return UnmarshalUpdateNotification(data) - case TypeUpdateServiceNotification: - return UnmarshalUpdateServiceNotification(data) + case TypeUpdateNotificationGroup: + return UnmarshalUpdateNotificationGroup(data) - case TypeUpdateFile: - return UnmarshalUpdateFile(data) + case TypeUpdateActiveNotifications: + return UnmarshalUpdateActiveNotifications(data) - case TypeUpdateFileGenerationStart: - return UnmarshalUpdateFileGenerationStart(data) + case TypeUpdateHavePendingNotifications: + return UnmarshalUpdateHavePendingNotifications(data) - case TypeUpdateFileGenerationStop: - return UnmarshalUpdateFileGenerationStop(data) + case TypeUpdateDeleteMessages: + return UnmarshalUpdateDeleteMessages(data) - case TypeUpdateFileDownloads: - return UnmarshalUpdateFileDownloads(data) + case TypeUpdateChatAction: + return UnmarshalUpdateChatAction(data) - case TypeUpdateFileAddedToDownloads: - return UnmarshalUpdateFileAddedToDownloads(data) + case TypeUpdateUserStatus: + return UnmarshalUpdateUserStatus(data) - case TypeUpdateFileDownload: - return UnmarshalUpdateFileDownload(data) + case TypeUpdateUser: + return UnmarshalUpdateUser(data) - case TypeUpdateFileRemovedFromDownloads: - return UnmarshalUpdateFileRemovedFromDownloads(data) + case TypeUpdateBasicGroup: + return UnmarshalUpdateBasicGroup(data) - case TypeUpdateCall: - return UnmarshalUpdateCall(data) + case TypeUpdateSupergroup: + return UnmarshalUpdateSupergroup(data) - case TypeUpdateGroupCall: - return UnmarshalUpdateGroupCall(data) + case TypeUpdateSecretChat: + return UnmarshalUpdateSecretChat(data) - case TypeUpdateGroupCallParticipant: - return UnmarshalUpdateGroupCallParticipant(data) + case TypeUpdateUserFullInfo: + return UnmarshalUpdateUserFullInfo(data) - case TypeUpdateNewCallSignalingData: - return UnmarshalUpdateNewCallSignalingData(data) + case TypeUpdateBasicGroupFullInfo: + return UnmarshalUpdateBasicGroupFullInfo(data) - case TypeUpdateUserPrivacySettingRules: - return UnmarshalUpdateUserPrivacySettingRules(data) + case TypeUpdateSupergroupFullInfo: + return UnmarshalUpdateSupergroupFullInfo(data) - case TypeUpdateUnreadMessageCount: - return UnmarshalUpdateUnreadMessageCount(data) + case TypeUpdateServiceNotification: + return UnmarshalUpdateServiceNotification(data) - case TypeUpdateUnreadChatCount: - return UnmarshalUpdateUnreadChatCount(data) + case TypeUpdateFile: + return UnmarshalUpdateFile(data) - case TypeUpdateOption: - return UnmarshalUpdateOption(data) + case TypeUpdateFileGenerationStart: + return UnmarshalUpdateFileGenerationStart(data) - case TypeUpdateStickerSet: - return UnmarshalUpdateStickerSet(data) + case TypeUpdateFileGenerationStop: + return UnmarshalUpdateFileGenerationStop(data) - case TypeUpdateInstalledStickerSets: - return UnmarshalUpdateInstalledStickerSets(data) + case TypeUpdateFileDownloads: + return UnmarshalUpdateFileDownloads(data) - case TypeUpdateTrendingStickerSets: - return UnmarshalUpdateTrendingStickerSets(data) + case TypeUpdateFileAddedToDownloads: + return UnmarshalUpdateFileAddedToDownloads(data) - case TypeUpdateRecentStickers: - return UnmarshalUpdateRecentStickers(data) + case TypeUpdateFileDownload: + return UnmarshalUpdateFileDownload(data) - case TypeUpdateFavoriteStickers: - return UnmarshalUpdateFavoriteStickers(data) + case TypeUpdateFileRemovedFromDownloads: + return UnmarshalUpdateFileRemovedFromDownloads(data) - case TypeUpdateSavedAnimations: - return UnmarshalUpdateSavedAnimations(data) + case TypeUpdateCall: + return UnmarshalUpdateCall(data) - case TypeUpdateSavedNotificationSounds: - return UnmarshalUpdateSavedNotificationSounds(data) + case TypeUpdateGroupCall: + return UnmarshalUpdateGroupCall(data) - case TypeUpdateSelectedBackground: - return UnmarshalUpdateSelectedBackground(data) + case TypeUpdateGroupCallParticipant: + return UnmarshalUpdateGroupCallParticipant(data) - case TypeUpdateChatThemes: - return UnmarshalUpdateChatThemes(data) + case TypeUpdateNewCallSignalingData: + return UnmarshalUpdateNewCallSignalingData(data) - case TypeUpdateLanguagePackStrings: - return UnmarshalUpdateLanguagePackStrings(data) + case TypeUpdateUserPrivacySettingRules: + return UnmarshalUpdateUserPrivacySettingRules(data) - case TypeUpdateConnectionState: - return UnmarshalUpdateConnectionState(data) + case TypeUpdateUnreadMessageCount: + return UnmarshalUpdateUnreadMessageCount(data) - case TypeUpdateTermsOfService: - return UnmarshalUpdateTermsOfService(data) + case TypeUpdateUnreadChatCount: + return UnmarshalUpdateUnreadChatCount(data) - case TypeUpdateUsersNearby: - return UnmarshalUpdateUsersNearby(data) + case TypeUpdateStory: + return UnmarshalUpdateStory(data) - case TypeUpdateAttachmentMenuBots: - return UnmarshalUpdateAttachmentMenuBots(data) + case TypeUpdateStoryDeleted: + return UnmarshalUpdateStoryDeleted(data) - case TypeUpdateWebAppMessageSent: - return UnmarshalUpdateWebAppMessageSent(data) + case TypeUpdateStorySendSucceeded: + return UnmarshalUpdateStorySendSucceeded(data) - case TypeUpdateActiveEmojiReactions: - return UnmarshalUpdateActiveEmojiReactions(data) + case TypeUpdateStorySendFailed: + return UnmarshalUpdateStorySendFailed(data) - case TypeUpdateDefaultReactionType: - return UnmarshalUpdateDefaultReactionType(data) + case TypeUpdateChatActiveStories: + return UnmarshalUpdateChatActiveStories(data) - case TypeUpdateDiceEmojis: - return UnmarshalUpdateDiceEmojis(data) + case TypeUpdateStoryListChatCount: + return UnmarshalUpdateStoryListChatCount(data) - case TypeUpdateAnimatedEmojiMessageClicked: - return UnmarshalUpdateAnimatedEmojiMessageClicked(data) + case TypeUpdateStoryStealthMode: + return UnmarshalUpdateStoryStealthMode(data) - case TypeUpdateAnimationSearchParameters: - return UnmarshalUpdateAnimationSearchParameters(data) + case TypeUpdateOption: + return UnmarshalUpdateOption(data) - case TypeUpdateSuggestedActions: - return UnmarshalUpdateSuggestedActions(data) + case TypeUpdateStickerSet: + return UnmarshalUpdateStickerSet(data) - case TypeUpdateNewInlineQuery: - return UnmarshalUpdateNewInlineQuery(data) + case TypeUpdateInstalledStickerSets: + return UnmarshalUpdateInstalledStickerSets(data) - case TypeUpdateNewChosenInlineResult: - return UnmarshalUpdateNewChosenInlineResult(data) + case TypeUpdateTrendingStickerSets: + return UnmarshalUpdateTrendingStickerSets(data) - case TypeUpdateNewCallbackQuery: - return UnmarshalUpdateNewCallbackQuery(data) + case TypeUpdateRecentStickers: + return UnmarshalUpdateRecentStickers(data) - case TypeUpdateNewInlineCallbackQuery: - return UnmarshalUpdateNewInlineCallbackQuery(data) + case TypeUpdateFavoriteStickers: + return UnmarshalUpdateFavoriteStickers(data) - case TypeUpdateNewShippingQuery: - return UnmarshalUpdateNewShippingQuery(data) + case TypeUpdateSavedAnimations: + return UnmarshalUpdateSavedAnimations(data) - case TypeUpdateNewPreCheckoutQuery: - return UnmarshalUpdateNewPreCheckoutQuery(data) + case TypeUpdateSavedNotificationSounds: + return UnmarshalUpdateSavedNotificationSounds(data) - case TypeUpdateNewCustomEvent: - return UnmarshalUpdateNewCustomEvent(data) + case TypeUpdateDefaultBackground: + return UnmarshalUpdateDefaultBackground(data) - case TypeUpdateNewCustomQuery: - return UnmarshalUpdateNewCustomQuery(data) + case TypeUpdateChatThemes: + return UnmarshalUpdateChatThemes(data) - case TypeUpdatePoll: - return UnmarshalUpdatePoll(data) + case TypeUpdateAccentColors: + return UnmarshalUpdateAccentColors(data) - case TypeUpdatePollAnswer: - return UnmarshalUpdatePollAnswer(data) + case TypeUpdateProfileAccentColors: + return UnmarshalUpdateProfileAccentColors(data) - case TypeUpdateChatMember: - return UnmarshalUpdateChatMember(data) + case TypeUpdateLanguagePackStrings: + return UnmarshalUpdateLanguagePackStrings(data) - case TypeUpdateNewChatJoinRequest: - return UnmarshalUpdateNewChatJoinRequest(data) + case TypeUpdateConnectionState: + return UnmarshalUpdateConnectionState(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + case TypeUpdateTermsOfService: + return UnmarshalUpdateTermsOfService(data) + + case TypeUpdateUsersNearby: + return UnmarshalUpdateUsersNearby(data) + + case TypeUpdateUnconfirmedSession: + return UnmarshalUpdateUnconfirmedSession(data) + + case TypeUpdateAttachmentMenuBots: + return UnmarshalUpdateAttachmentMenuBots(data) + + case TypeUpdateWebAppMessageSent: + return UnmarshalUpdateWebAppMessageSent(data) + + case TypeUpdateActiveEmojiReactions: + return UnmarshalUpdateActiveEmojiReactions(data) + + case TypeUpdateDefaultReactionType: + return UnmarshalUpdateDefaultReactionType(data) + + case TypeUpdateSavedMessagesTags: + return UnmarshalUpdateSavedMessagesTags(data) + + case TypeUpdateSpeechRecognitionTrial: + return UnmarshalUpdateSpeechRecognitionTrial(data) + + case TypeUpdateDiceEmojis: + return UnmarshalUpdateDiceEmojis(data) + + case TypeUpdateAnimatedEmojiMessageClicked: + return UnmarshalUpdateAnimatedEmojiMessageClicked(data) + + case TypeUpdateAnimationSearchParameters: + return UnmarshalUpdateAnimationSearchParameters(data) + + case TypeUpdateSuggestedActions: + return UnmarshalUpdateSuggestedActions(data) + + case TypeUpdateContactCloseBirthdays: + return UnmarshalUpdateContactCloseBirthdays(data) + + case TypeUpdateAddChatMembersPrivacyForbidden: + return UnmarshalUpdateAddChatMembersPrivacyForbidden(data) + + case TypeUpdateAutosaveSettings: + return UnmarshalUpdateAutosaveSettings(data) + + case TypeUpdateBusinessConnection: + return UnmarshalUpdateBusinessConnection(data) + + case TypeUpdateNewBusinessMessage: + return UnmarshalUpdateNewBusinessMessage(data) + + case TypeUpdateBusinessMessageEdited: + return UnmarshalUpdateBusinessMessageEdited(data) + + case TypeUpdateBusinessMessagesDeleted: + return UnmarshalUpdateBusinessMessagesDeleted(data) + + case TypeUpdateNewInlineQuery: + return UnmarshalUpdateNewInlineQuery(data) + + case TypeUpdateNewChosenInlineResult: + return UnmarshalUpdateNewChosenInlineResult(data) + + case TypeUpdateNewCallbackQuery: + return UnmarshalUpdateNewCallbackQuery(data) + + case TypeUpdateNewInlineCallbackQuery: + return UnmarshalUpdateNewInlineCallbackQuery(data) + + case TypeUpdateNewShippingQuery: + return UnmarshalUpdateNewShippingQuery(data) + + case TypeUpdateNewPreCheckoutQuery: + return UnmarshalUpdateNewPreCheckoutQuery(data) + + case TypeUpdateNewCustomEvent: + return UnmarshalUpdateNewCustomEvent(data) + + case TypeUpdateNewCustomQuery: + return UnmarshalUpdateNewCustomQuery(data) + + case TypeUpdatePoll: + return UnmarshalUpdatePoll(data) + + case TypeUpdatePollAnswer: + return UnmarshalUpdatePollAnswer(data) + + case TypeUpdateChatMember: + return UnmarshalUpdateChatMember(data) + + case TypeUpdateNewChatJoinRequest: + return UnmarshalUpdateNewChatJoinRequest(data) + + case TypeUpdateChatBoost: + return UnmarshalUpdateChatBoost(data) + + case TypeUpdateMessageReaction: + return UnmarshalUpdateMessageReaction(data) + + case TypeUpdateMessageReactions: + return UnmarshalUpdateMessageReactions(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfUpdate(dataList []json.RawMessage) ([]Update, error) { - list := []Update{} + list := []Update{} - for _, data := range dataList { - entity, err := UnmarshalUpdate(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalUpdate(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalLogStream(data json.RawMessage) (LogStream, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeLogStreamDefault: - return UnmarshalLogStreamDefault(data) + switch meta.Type { + case TypeLogStreamDefault: + return UnmarshalLogStreamDefault(data) - case TypeLogStreamFile: - return UnmarshalLogStreamFile(data) + case TypeLogStreamFile: + return UnmarshalLogStreamFile(data) - case TypeLogStreamEmpty: - return UnmarshalLogStreamEmpty(data) + case TypeLogStreamEmpty: + return UnmarshalLogStreamEmpty(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } func UnmarshalListOfLogStream(dataList []json.RawMessage) ([]LogStream, error) { - list := []LogStream{} + list := []LogStream{} - for _, data := range dataList { - entity, err := UnmarshalLogStream(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } + for _, data := range dataList { + entity, err := UnmarshalLogStream(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } - return list, nil + return list, nil } func UnmarshalError(data json.RawMessage) (*Error, error) { - var resp Error + var resp Error - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalOk(data json.RawMessage) (*Ok, error) { - var resp Ok + var resp Ok - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalAuthenticationCodeTypeTelegramMessage(data json.RawMessage) (*AuthenticationCodeTypeTelegramMessage, error) { - var resp AuthenticationCodeTypeTelegramMessage + var resp AuthenticationCodeTypeTelegramMessage - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalAuthenticationCodeTypeSms(data json.RawMessage) (*AuthenticationCodeTypeSms, error) { - var resp AuthenticationCodeTypeSms + var resp AuthenticationCodeTypeSms - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalAuthenticationCodeTypeCall(data json.RawMessage) (*AuthenticationCodeTypeCall, error) { - var resp AuthenticationCodeTypeCall + var resp AuthenticationCodeTypeCall - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalAuthenticationCodeTypeFlashCall(data json.RawMessage) (*AuthenticationCodeTypeFlashCall, error) { - var resp AuthenticationCodeTypeFlashCall + var resp AuthenticationCodeTypeFlashCall - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalAuthenticationCodeTypeMissedCall(data json.RawMessage) (*AuthenticationCodeTypeMissedCall, error) { - var resp AuthenticationCodeTypeMissedCall + var resp AuthenticationCodeTypeMissedCall - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalAuthenticationCodeTypeFragment(data json.RawMessage) (*AuthenticationCodeTypeFragment, error) { - var resp AuthenticationCodeTypeFragment + var resp AuthenticationCodeTypeFragment - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err +} + +func UnmarshalAuthenticationCodeTypeFirebaseAndroid(data json.RawMessage) (*AuthenticationCodeTypeFirebaseAndroid, error) { + var resp AuthenticationCodeTypeFirebaseAndroid + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalAuthenticationCodeTypeFirebaseIos(data json.RawMessage) (*AuthenticationCodeTypeFirebaseIos, error) { + var resp AuthenticationCodeTypeFirebaseIos + + err := json.Unmarshal(data, &resp) + + return &resp, err } func UnmarshalAuthenticationCodeInfo(data json.RawMessage) (*AuthenticationCodeInfo, error) { - var resp AuthenticationCodeInfo + var resp AuthenticationCodeInfo - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalEmailAddressAuthenticationCodeInfo(data json.RawMessage) (*EmailAddressAuthenticationCodeInfo, error) { - var resp EmailAddressAuthenticationCodeInfo + var resp EmailAddressAuthenticationCodeInfo - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalEmailAddressAuthenticationCode(data json.RawMessage) (*EmailAddressAuthenticationCode, error) { - var resp EmailAddressAuthenticationCode + var resp EmailAddressAuthenticationCode - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalEmailAddressAuthenticationAppleId(data json.RawMessage) (*EmailAddressAuthenticationAppleId, error) { - var resp EmailAddressAuthenticationAppleId + var resp EmailAddressAuthenticationAppleId - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalEmailAddressAuthenticationGoogleId(data json.RawMessage) (*EmailAddressAuthenticationGoogleId, error) { - var resp EmailAddressAuthenticationGoogleId + var resp EmailAddressAuthenticationGoogleId - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err +} + +func UnmarshalEmailAddressResetStateAvailable(data json.RawMessage) (*EmailAddressResetStateAvailable, error) { + var resp EmailAddressResetStateAvailable + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalEmailAddressResetStatePending(data json.RawMessage) (*EmailAddressResetStatePending, error) { + var resp EmailAddressResetStatePending + + err := json.Unmarshal(data, &resp) + + return &resp, err } func UnmarshalTextEntity(data json.RawMessage) (*TextEntity, error) { - var resp TextEntity + var resp TextEntity - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalTextEntities(data json.RawMessage) (*TextEntities, error) { - var resp TextEntities + var resp TextEntities - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalFormattedText(data json.RawMessage) (*FormattedText, error) { - var resp FormattedText + var resp FormattedText - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalTermsOfService(data json.RawMessage) (*TermsOfService, error) { - var resp TermsOfService + var resp TermsOfService - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalAuthorizationStateWaitTdlibParameters(data json.RawMessage) (*AuthorizationStateWaitTdlibParameters, error) { - var resp AuthorizationStateWaitTdlibParameters + var resp AuthorizationStateWaitTdlibParameters - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalAuthorizationStateWaitPhoneNumber(data json.RawMessage) (*AuthorizationStateWaitPhoneNumber, error) { - var resp AuthorizationStateWaitPhoneNumber + var resp AuthorizationStateWaitPhoneNumber - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalAuthorizationStateWaitEmailAddress(data json.RawMessage) (*AuthorizationStateWaitEmailAddress, error) { - var resp AuthorizationStateWaitEmailAddress + var resp AuthorizationStateWaitEmailAddress - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalAuthorizationStateWaitEmailCode(data json.RawMessage) (*AuthorizationStateWaitEmailCode, error) { - var resp AuthorizationStateWaitEmailCode + var resp AuthorizationStateWaitEmailCode - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalAuthorizationStateWaitCode(data json.RawMessage) (*AuthorizationStateWaitCode, error) { - var resp AuthorizationStateWaitCode + var resp AuthorizationStateWaitCode - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalAuthorizationStateWaitOtherDeviceConfirmation(data json.RawMessage) (*AuthorizationStateWaitOtherDeviceConfirmation, error) { - var resp AuthorizationStateWaitOtherDeviceConfirmation + var resp AuthorizationStateWaitOtherDeviceConfirmation - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalAuthorizationStateWaitRegistration(data json.RawMessage) (*AuthorizationStateWaitRegistration, error) { - var resp AuthorizationStateWaitRegistration + var resp AuthorizationStateWaitRegistration - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalAuthorizationStateWaitPassword(data json.RawMessage) (*AuthorizationStateWaitPassword, error) { - var resp AuthorizationStateWaitPassword + var resp AuthorizationStateWaitPassword - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalAuthorizationStateReady(data json.RawMessage) (*AuthorizationStateReady, error) { - var resp AuthorizationStateReady + var resp AuthorizationStateReady - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalAuthorizationStateLoggingOut(data json.RawMessage) (*AuthorizationStateLoggingOut, error) { - var resp AuthorizationStateLoggingOut + var resp AuthorizationStateLoggingOut - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalAuthorizationStateClosing(data json.RawMessage) (*AuthorizationStateClosing, error) { - var resp AuthorizationStateClosing + var resp AuthorizationStateClosing - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalAuthorizationStateClosed(data json.RawMessage) (*AuthorizationStateClosed, error) { - var resp AuthorizationStateClosed + var resp AuthorizationStateClosed - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalPasswordState(data json.RawMessage) (*PasswordState, error) { - var resp PasswordState + var resp PasswordState - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalRecoveryEmailAddress(data json.RawMessage) (*RecoveryEmailAddress, error) { - var resp RecoveryEmailAddress + var resp RecoveryEmailAddress - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalTemporaryPasswordState(data json.RawMessage) (*TemporaryPasswordState, error) { - var resp TemporaryPasswordState + var resp TemporaryPasswordState - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalLocalFile(data json.RawMessage) (*LocalFile, error) { - var resp LocalFile + var resp LocalFile - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalRemoteFile(data json.RawMessage) (*RemoteFile, error) { - var resp RemoteFile + var resp RemoteFile - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalFile(data json.RawMessage) (*File, error) { - var resp File + var resp File - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalInputFileId(data json.RawMessage) (*InputFileId, error) { - var resp InputFileId + var resp InputFileId - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalInputFileRemote(data json.RawMessage) (*InputFileRemote, error) { - var resp InputFileRemote + var resp InputFileRemote - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalInputFileLocal(data json.RawMessage) (*InputFileLocal, error) { - var resp InputFileLocal + var resp InputFileLocal - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalInputFileGenerated(data json.RawMessage) (*InputFileGenerated, error) { - var resp InputFileGenerated + var resp InputFileGenerated - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalPhotoSize(data json.RawMessage) (*PhotoSize, error) { - var resp PhotoSize + var resp PhotoSize - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalMinithumbnail(data json.RawMessage) (*Minithumbnail, error) { - var resp Minithumbnail + var resp Minithumbnail - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalThumbnailFormatJpeg(data json.RawMessage) (*ThumbnailFormatJpeg, error) { - var resp ThumbnailFormatJpeg + var resp ThumbnailFormatJpeg - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalThumbnailFormatGif(data json.RawMessage) (*ThumbnailFormatGif, error) { - var resp ThumbnailFormatGif + var resp ThumbnailFormatGif - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalThumbnailFormatMpeg4(data json.RawMessage) (*ThumbnailFormatMpeg4, error) { - var resp ThumbnailFormatMpeg4 + var resp ThumbnailFormatMpeg4 - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalThumbnailFormatPng(data json.RawMessage) (*ThumbnailFormatPng, error) { - var resp ThumbnailFormatPng + var resp ThumbnailFormatPng - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalThumbnailFormatTgs(data json.RawMessage) (*ThumbnailFormatTgs, error) { - var resp ThumbnailFormatTgs + var resp ThumbnailFormatTgs - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalThumbnailFormatWebm(data json.RawMessage) (*ThumbnailFormatWebm, error) { - var resp ThumbnailFormatWebm + var resp ThumbnailFormatWebm - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalThumbnailFormatWebp(data json.RawMessage) (*ThumbnailFormatWebp, error) { - var resp ThumbnailFormatWebp + var resp ThumbnailFormatWebp - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalThumbnail(data json.RawMessage) (*Thumbnail, error) { - var resp Thumbnail + var resp Thumbnail - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalMaskPointForehead(data json.RawMessage) (*MaskPointForehead, error) { - var resp MaskPointForehead + var resp MaskPointForehead - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalMaskPointEyes(data json.RawMessage) (*MaskPointEyes, error) { - var resp MaskPointEyes + var resp MaskPointEyes - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalMaskPointMouth(data json.RawMessage) (*MaskPointMouth, error) { - var resp MaskPointMouth + var resp MaskPointMouth - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalMaskPointChin(data json.RawMessage) (*MaskPointChin, error) { - var resp MaskPointChin + var resp MaskPointChin - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalMaskPosition(data json.RawMessage) (*MaskPosition, error) { - var resp MaskPosition + var resp MaskPosition - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalStickerFormatWebp(data json.RawMessage) (*StickerFormatWebp, error) { - var resp StickerFormatWebp + var resp StickerFormatWebp - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalStickerFormatTgs(data json.RawMessage) (*StickerFormatTgs, error) { - var resp StickerFormatTgs + var resp StickerFormatTgs - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalStickerFormatWebm(data json.RawMessage) (*StickerFormatWebm, error) { - var resp StickerFormatWebm + var resp StickerFormatWebm - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalStickerTypeRegular(data json.RawMessage) (*StickerTypeRegular, error) { - var resp StickerTypeRegular + var resp StickerTypeRegular - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalStickerTypeMask(data json.RawMessage) (*StickerTypeMask, error) { - var resp StickerTypeMask + var resp StickerTypeMask - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalStickerTypeCustomEmoji(data json.RawMessage) (*StickerTypeCustomEmoji, error) { - var resp StickerTypeCustomEmoji + var resp StickerTypeCustomEmoji - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalStickerFullTypeRegular(data json.RawMessage) (*StickerFullTypeRegular, error) { - var resp StickerFullTypeRegular + var resp StickerFullTypeRegular - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalStickerFullTypeMask(data json.RawMessage) (*StickerFullTypeMask, error) { - var resp StickerFullTypeMask + var resp StickerFullTypeMask - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalStickerFullTypeCustomEmoji(data json.RawMessage) (*StickerFullTypeCustomEmoji, error) { - var resp StickerFullTypeCustomEmoji + var resp StickerFullTypeCustomEmoji - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalClosedVectorPath(data json.RawMessage) (*ClosedVectorPath, error) { - var resp ClosedVectorPath + var resp ClosedVectorPath - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalPollOption(data json.RawMessage) (*PollOption, error) { - var resp PollOption + var resp PollOption - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalPollTypeRegular(data json.RawMessage) (*PollTypeRegular, error) { - var resp PollTypeRegular + var resp PollTypeRegular - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalPollTypeQuiz(data json.RawMessage) (*PollTypeQuiz, error) { - var resp PollTypeQuiz + var resp PollTypeQuiz - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalAnimation(data json.RawMessage) (*Animation, error) { - var resp Animation + var resp Animation - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalAudio(data json.RawMessage) (*Audio, error) { - var resp Audio + var resp Audio - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalDocument(data json.RawMessage) (*Document, error) { - var resp Document + var resp Document - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalPhoto(data json.RawMessage) (*Photo, error) { - var resp Photo + var resp Photo - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalSticker(data json.RawMessage) (*Sticker, error) { - var resp Sticker + var resp Sticker - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalVideo(data json.RawMessage) (*Video, error) { - var resp Video + var resp Video - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalVideoNote(data json.RawMessage) (*VideoNote, error) { - var resp VideoNote + var resp VideoNote - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalVoiceNote(data json.RawMessage) (*VoiceNote, error) { - var resp VoiceNote + var resp VoiceNote - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalAnimatedEmoji(data json.RawMessage) (*AnimatedEmoji, error) { - var resp AnimatedEmoji + var resp AnimatedEmoji - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalContact(data json.RawMessage) (*Contact, error) { - var resp Contact + var resp Contact - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalLocation(data json.RawMessage) (*Location, error) { - var resp Location + var resp Location - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalVenue(data json.RawMessage) (*Venue, error) { - var resp Venue + var resp Venue - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalGame(data json.RawMessage) (*Game, error) { - var resp Game + var resp Game - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err +} + +func UnmarshalWebApp(data json.RawMessage) (*WebApp, error) { + var resp WebApp + + err := json.Unmarshal(data, &resp) + + return &resp, err } func UnmarshalPoll(data json.RawMessage) (*Poll, error) { - var resp Poll + var resp Poll - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err -} - -func UnmarshalProfilePhoto(data json.RawMessage) (*ProfilePhoto, error) { - var resp ProfilePhoto - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatPhotoInfo(data json.RawMessage) (*ChatPhotoInfo, error) { - var resp ChatPhotoInfo - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalUserTypeRegular(data json.RawMessage) (*UserTypeRegular, error) { - var resp UserTypeRegular - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalUserTypeDeleted(data json.RawMessage) (*UserTypeDeleted, error) { - var resp UserTypeDeleted - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalUserTypeBot(data json.RawMessage) (*UserTypeBot, error) { - var resp UserTypeBot - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalUserTypeUnknown(data json.RawMessage) (*UserTypeUnknown, error) { - var resp UserTypeUnknown - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalBotCommand(data json.RawMessage) (*BotCommand, error) { - var resp BotCommand - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalBotCommands(data json.RawMessage) (*BotCommands, error) { - var resp BotCommands - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalBotMenuButton(data json.RawMessage) (*BotMenuButton, error) { - var resp BotMenuButton - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatLocation(data json.RawMessage) (*ChatLocation, error) { - var resp ChatLocation - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalAnimatedChatPhoto(data json.RawMessage) (*AnimatedChatPhoto, error) { - var resp AnimatedChatPhoto - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatPhoto(data json.RawMessage) (*ChatPhoto, error) { - var resp ChatPhoto - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatPhotos(data json.RawMessage) (*ChatPhotos, error) { - var resp ChatPhotos - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputChatPhotoPrevious(data json.RawMessage) (*InputChatPhotoPrevious, error) { - var resp InputChatPhotoPrevious - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputChatPhotoStatic(data json.RawMessage) (*InputChatPhotoStatic, error) { - var resp InputChatPhotoStatic - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputChatPhotoAnimation(data json.RawMessage) (*InputChatPhotoAnimation, error) { - var resp InputChatPhotoAnimation - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatPermissions(data json.RawMessage) (*ChatPermissions, error) { - var resp ChatPermissions - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatAdministratorRights(data json.RawMessage) (*ChatAdministratorRights, error) { - var resp ChatAdministratorRights - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPremiumPaymentOption(data json.RawMessage) (*PremiumPaymentOption, error) { - var resp PremiumPaymentOption - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalEmojiStatus(data json.RawMessage) (*EmojiStatus, error) { - var resp EmojiStatus - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalEmojiStatuses(data json.RawMessage) (*EmojiStatuses, error) { - var resp EmojiStatuses - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalUsernames(data json.RawMessage) (*Usernames, error) { - var resp Usernames - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalUser(data json.RawMessage) (*User, error) { - var resp User - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalBotInfo(data json.RawMessage) (*BotInfo, error) { - var resp BotInfo - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalUserFullInfo(data json.RawMessage) (*UserFullInfo, error) { - var resp UserFullInfo - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalUsers(data json.RawMessage) (*Users, error) { - var resp Users - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatAdministrator(data json.RawMessage) (*ChatAdministrator, error) { - var resp ChatAdministrator - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatAdministrators(data json.RawMessage) (*ChatAdministrators, error) { - var resp ChatAdministrators - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatMemberStatusCreator(data json.RawMessage) (*ChatMemberStatusCreator, error) { - var resp ChatMemberStatusCreator - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatMemberStatusAdministrator(data json.RawMessage) (*ChatMemberStatusAdministrator, error) { - var resp ChatMemberStatusAdministrator - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatMemberStatusMember(data json.RawMessage) (*ChatMemberStatusMember, error) { - var resp ChatMemberStatusMember - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatMemberStatusRestricted(data json.RawMessage) (*ChatMemberStatusRestricted, error) { - var resp ChatMemberStatusRestricted - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatMemberStatusLeft(data json.RawMessage) (*ChatMemberStatusLeft, error) { - var resp ChatMemberStatusLeft - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatMemberStatusBanned(data json.RawMessage) (*ChatMemberStatusBanned, error) { - var resp ChatMemberStatusBanned - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatMember(data json.RawMessage) (*ChatMember, error) { - var resp ChatMember - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatMembers(data json.RawMessage) (*ChatMembers, error) { - var resp ChatMembers - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatMembersFilterContacts(data json.RawMessage) (*ChatMembersFilterContacts, error) { - var resp ChatMembersFilterContacts - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatMembersFilterAdministrators(data json.RawMessage) (*ChatMembersFilterAdministrators, error) { - var resp ChatMembersFilterAdministrators - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatMembersFilterMembers(data json.RawMessage) (*ChatMembersFilterMembers, error) { - var resp ChatMembersFilterMembers - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatMembersFilterMention(data json.RawMessage) (*ChatMembersFilterMention, error) { - var resp ChatMembersFilterMention - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatMembersFilterRestricted(data json.RawMessage) (*ChatMembersFilterRestricted, error) { - var resp ChatMembersFilterRestricted - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatMembersFilterBanned(data json.RawMessage) (*ChatMembersFilterBanned, error) { - var resp ChatMembersFilterBanned - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatMembersFilterBots(data json.RawMessage) (*ChatMembersFilterBots, error) { - var resp ChatMembersFilterBots - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalSupergroupMembersFilterRecent(data json.RawMessage) (*SupergroupMembersFilterRecent, error) { - var resp SupergroupMembersFilterRecent - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalSupergroupMembersFilterContacts(data json.RawMessage) (*SupergroupMembersFilterContacts, error) { - var resp SupergroupMembersFilterContacts - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalSupergroupMembersFilterAdministrators(data json.RawMessage) (*SupergroupMembersFilterAdministrators, error) { - var resp SupergroupMembersFilterAdministrators - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalSupergroupMembersFilterSearch(data json.RawMessage) (*SupergroupMembersFilterSearch, error) { - var resp SupergroupMembersFilterSearch - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalSupergroupMembersFilterRestricted(data json.RawMessage) (*SupergroupMembersFilterRestricted, error) { - var resp SupergroupMembersFilterRestricted - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalSupergroupMembersFilterBanned(data json.RawMessage) (*SupergroupMembersFilterBanned, error) { - var resp SupergroupMembersFilterBanned - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalSupergroupMembersFilterMention(data json.RawMessage) (*SupergroupMembersFilterMention, error) { - var resp SupergroupMembersFilterMention - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalSupergroupMembersFilterBots(data json.RawMessage) (*SupergroupMembersFilterBots, error) { - var resp SupergroupMembersFilterBots - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatInviteLink(data json.RawMessage) (*ChatInviteLink, error) { - var resp ChatInviteLink - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatInviteLinks(data json.RawMessage) (*ChatInviteLinks, error) { - var resp ChatInviteLinks - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatInviteLinkCount(data json.RawMessage) (*ChatInviteLinkCount, error) { - var resp ChatInviteLinkCount - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatInviteLinkCounts(data json.RawMessage) (*ChatInviteLinkCounts, error) { - var resp ChatInviteLinkCounts - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatInviteLinkMember(data json.RawMessage) (*ChatInviteLinkMember, error) { - var resp ChatInviteLinkMember - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatInviteLinkMembers(data json.RawMessage) (*ChatInviteLinkMembers, error) { - var resp ChatInviteLinkMembers - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatInviteLinkInfo(data json.RawMessage) (*ChatInviteLinkInfo, error) { - var resp ChatInviteLinkInfo - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatJoinRequest(data json.RawMessage) (*ChatJoinRequest, error) { - var resp ChatJoinRequest - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatJoinRequests(data json.RawMessage) (*ChatJoinRequests, error) { - var resp ChatJoinRequests - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatJoinRequestsInfo(data json.RawMessage) (*ChatJoinRequestsInfo, error) { - var resp ChatJoinRequestsInfo - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalBasicGroup(data json.RawMessage) (*BasicGroup, error) { - var resp BasicGroup - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalBasicGroupFullInfo(data json.RawMessage) (*BasicGroupFullInfo, error) { - var resp BasicGroupFullInfo - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalSupergroup(data json.RawMessage) (*Supergroup, error) { - var resp Supergroup - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalSupergroupFullInfo(data json.RawMessage) (*SupergroupFullInfo, error) { - var resp SupergroupFullInfo - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalSecretChatStatePending(data json.RawMessage) (*SecretChatStatePending, error) { - var resp SecretChatStatePending - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalSecretChatStateReady(data json.RawMessage) (*SecretChatStateReady, error) { - var resp SecretChatStateReady - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalSecretChatStateClosed(data json.RawMessage) (*SecretChatStateClosed, error) { - var resp SecretChatStateClosed - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalSecretChat(data json.RawMessage) (*SecretChat, error) { - var resp SecretChat - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageSenderUser(data json.RawMessage) (*MessageSenderUser, error) { - var resp MessageSenderUser - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageSenderChat(data json.RawMessage) (*MessageSenderChat, error) { - var resp MessageSenderChat - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageSenders(data json.RawMessage) (*MessageSenders, error) { - var resp MessageSenders - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatMessageSender(data json.RawMessage) (*ChatMessageSender, error) { - var resp ChatMessageSender - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatMessageSenders(data json.RawMessage) (*ChatMessageSenders, error) { - var resp ChatMessageSenders - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageForwardOriginUser(data json.RawMessage) (*MessageForwardOriginUser, error) { - var resp MessageForwardOriginUser - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageForwardOriginChat(data json.RawMessage) (*MessageForwardOriginChat, error) { - var resp MessageForwardOriginChat - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageForwardOriginHiddenUser(data json.RawMessage) (*MessageForwardOriginHiddenUser, error) { - var resp MessageForwardOriginHiddenUser - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageForwardOriginChannel(data json.RawMessage) (*MessageForwardOriginChannel, error) { - var resp MessageForwardOriginChannel - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageForwardOriginMessageImport(data json.RawMessage) (*MessageForwardOriginMessageImport, error) { - var resp MessageForwardOriginMessageImport - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalReactionTypeEmoji(data json.RawMessage) (*ReactionTypeEmoji, error) { - var resp ReactionTypeEmoji - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalReactionTypeCustomEmoji(data json.RawMessage) (*ReactionTypeCustomEmoji, error) { - var resp ReactionTypeCustomEmoji - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageForwardInfo(data json.RawMessage) (*MessageForwardInfo, error) { - var resp MessageForwardInfo - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageReplyInfo(data json.RawMessage) (*MessageReplyInfo, error) { - var resp MessageReplyInfo - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageReaction(data json.RawMessage) (*MessageReaction, error) { - var resp MessageReaction - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageInteractionInfo(data json.RawMessage) (*MessageInteractionInfo, error) { - var resp MessageInteractionInfo - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalUnreadReaction(data json.RawMessage) (*UnreadReaction, error) { - var resp UnreadReaction - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageSendingStatePending(data json.RawMessage) (*MessageSendingStatePending, error) { - var resp MessageSendingStatePending - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageSendingStateFailed(data json.RawMessage) (*MessageSendingStateFailed, error) { - var resp MessageSendingStateFailed - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessage(data json.RawMessage) (*Message, error) { - var resp Message - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessages(data json.RawMessage) (*Messages, error) { - var resp Messages - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalFoundMessages(data json.RawMessage) (*FoundMessages, error) { - var resp FoundMessages - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalFoundChatMessages(data json.RawMessage) (*FoundChatMessages, error) { - var resp FoundChatMessages - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessagePosition(data json.RawMessage) (*MessagePosition, error) { - var resp MessagePosition - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessagePositions(data json.RawMessage) (*MessagePositions, error) { - var resp MessagePositions - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageCalendarDay(data json.RawMessage) (*MessageCalendarDay, error) { - var resp MessageCalendarDay - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageCalendar(data json.RawMessage) (*MessageCalendar, error) { - var resp MessageCalendar - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalSponsoredMessage(data json.RawMessage) (*SponsoredMessage, error) { - var resp SponsoredMessage - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalSponsoredMessages(data json.RawMessage) (*SponsoredMessages, error) { - var resp SponsoredMessages - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalFileDownload(data json.RawMessage) (*FileDownload, error) { - var resp FileDownload - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalDownloadedFileCounts(data json.RawMessage) (*DownloadedFileCounts, error) { - var resp DownloadedFileCounts - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalFoundFileDownloads(data json.RawMessage) (*FoundFileDownloads, error) { - var resp FoundFileDownloads - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalNotificationSettingsScopePrivateChats(data json.RawMessage) (*NotificationSettingsScopePrivateChats, error) { - var resp NotificationSettingsScopePrivateChats - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalNotificationSettingsScopeGroupChats(data json.RawMessage) (*NotificationSettingsScopeGroupChats, error) { - var resp NotificationSettingsScopeGroupChats - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalNotificationSettingsScopeChannelChats(data json.RawMessage) (*NotificationSettingsScopeChannelChats, error) { - var resp NotificationSettingsScopeChannelChats - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatNotificationSettings(data json.RawMessage) (*ChatNotificationSettings, error) { - var resp ChatNotificationSettings - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalScopeNotificationSettings(data json.RawMessage) (*ScopeNotificationSettings, error) { - var resp ScopeNotificationSettings - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalDraftMessage(data json.RawMessage) (*DraftMessage, error) { - var resp DraftMessage - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatTypePrivate(data json.RawMessage) (*ChatTypePrivate, error) { - var resp ChatTypePrivate - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatTypeBasicGroup(data json.RawMessage) (*ChatTypeBasicGroup, error) { - var resp ChatTypeBasicGroup - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatTypeSupergroup(data json.RawMessage) (*ChatTypeSupergroup, error) { - var resp ChatTypeSupergroup - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatTypeSecret(data json.RawMessage) (*ChatTypeSecret, error) { - var resp ChatTypeSecret - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatFilter(data json.RawMessage) (*ChatFilter, error) { - var resp ChatFilter - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatFilterInfo(data json.RawMessage) (*ChatFilterInfo, error) { - var resp ChatFilterInfo - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalRecommendedChatFilter(data json.RawMessage) (*RecommendedChatFilter, error) { - var resp RecommendedChatFilter - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalRecommendedChatFilters(data json.RawMessage) (*RecommendedChatFilters, error) { - var resp RecommendedChatFilters - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatListMain(data json.RawMessage) (*ChatListMain, error) { - var resp ChatListMain - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatListArchive(data json.RawMessage) (*ChatListArchive, error) { - var resp ChatListArchive - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatListFilter(data json.RawMessage) (*ChatListFilter, error) { - var resp ChatListFilter - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatLists(data json.RawMessage) (*ChatLists, error) { - var resp ChatLists - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatSourceMtprotoProxy(data json.RawMessage) (*ChatSourceMtprotoProxy, error) { - var resp ChatSourceMtprotoProxy - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatSourcePublicServiceAnnouncement(data json.RawMessage) (*ChatSourcePublicServiceAnnouncement, error) { - var resp ChatSourcePublicServiceAnnouncement - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatPosition(data json.RawMessage) (*ChatPosition, error) { - var resp ChatPosition - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatAvailableReactionsAll(data json.RawMessage) (*ChatAvailableReactionsAll, error) { - var resp ChatAvailableReactionsAll - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatAvailableReactionsSome(data json.RawMessage) (*ChatAvailableReactionsSome, error) { - var resp ChatAvailableReactionsSome - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalVideoChat(data json.RawMessage) (*VideoChat, error) { - var resp VideoChat - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChat(data json.RawMessage) (*Chat, error) { - var resp Chat - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChats(data json.RawMessage) (*Chats, error) { - var resp Chats - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatNearby(data json.RawMessage) (*ChatNearby, error) { - var resp ChatNearby - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatsNearby(data json.RawMessage) (*ChatsNearby, error) { - var resp ChatsNearby - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPublicChatTypeHasUsername(data json.RawMessage) (*PublicChatTypeHasUsername, error) { - var resp PublicChatTypeHasUsername - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPublicChatTypeIsLocationBased(data json.RawMessage) (*PublicChatTypeIsLocationBased, error) { - var resp PublicChatTypeIsLocationBased - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatActionBarReportSpam(data json.RawMessage) (*ChatActionBarReportSpam, error) { - var resp ChatActionBarReportSpam - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatActionBarReportUnrelatedLocation(data json.RawMessage) (*ChatActionBarReportUnrelatedLocation, error) { - var resp ChatActionBarReportUnrelatedLocation - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatActionBarInviteMembers(data json.RawMessage) (*ChatActionBarInviteMembers, error) { - var resp ChatActionBarInviteMembers - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatActionBarReportAddBlock(data json.RawMessage) (*ChatActionBarReportAddBlock, error) { - var resp ChatActionBarReportAddBlock - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatActionBarAddContact(data json.RawMessage) (*ChatActionBarAddContact, error) { - var resp ChatActionBarAddContact - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatActionBarSharePhoneNumber(data json.RawMessage) (*ChatActionBarSharePhoneNumber, error) { - var resp ChatActionBarSharePhoneNumber - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatActionBarJoinRequest(data json.RawMessage) (*ChatActionBarJoinRequest, error) { - var resp ChatActionBarJoinRequest - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalKeyboardButtonTypeText(data json.RawMessage) (*KeyboardButtonTypeText, error) { - var resp KeyboardButtonTypeText - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalKeyboardButtonTypeRequestPhoneNumber(data json.RawMessage) (*KeyboardButtonTypeRequestPhoneNumber, error) { - var resp KeyboardButtonTypeRequestPhoneNumber - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalKeyboardButtonTypeRequestLocation(data json.RawMessage) (*KeyboardButtonTypeRequestLocation, error) { - var resp KeyboardButtonTypeRequestLocation - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalKeyboardButtonTypeRequestPoll(data json.RawMessage) (*KeyboardButtonTypeRequestPoll, error) { - var resp KeyboardButtonTypeRequestPoll - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalKeyboardButtonTypeWebApp(data json.RawMessage) (*KeyboardButtonTypeWebApp, error) { - var resp KeyboardButtonTypeWebApp - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalKeyboardButton(data json.RawMessage) (*KeyboardButton, error) { - var resp KeyboardButton - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInlineKeyboardButtonTypeUrl(data json.RawMessage) (*InlineKeyboardButtonTypeUrl, error) { - var resp InlineKeyboardButtonTypeUrl - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInlineKeyboardButtonTypeLoginUrl(data json.RawMessage) (*InlineKeyboardButtonTypeLoginUrl, error) { - var resp InlineKeyboardButtonTypeLoginUrl - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInlineKeyboardButtonTypeWebApp(data json.RawMessage) (*InlineKeyboardButtonTypeWebApp, error) { - var resp InlineKeyboardButtonTypeWebApp - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInlineKeyboardButtonTypeCallback(data json.RawMessage) (*InlineKeyboardButtonTypeCallback, error) { - var resp InlineKeyboardButtonTypeCallback - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInlineKeyboardButtonTypeCallbackWithPassword(data json.RawMessage) (*InlineKeyboardButtonTypeCallbackWithPassword, error) { - var resp InlineKeyboardButtonTypeCallbackWithPassword - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInlineKeyboardButtonTypeCallbackGame(data json.RawMessage) (*InlineKeyboardButtonTypeCallbackGame, error) { - var resp InlineKeyboardButtonTypeCallbackGame - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInlineKeyboardButtonTypeSwitchInline(data json.RawMessage) (*InlineKeyboardButtonTypeSwitchInline, error) { - var resp InlineKeyboardButtonTypeSwitchInline - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInlineKeyboardButtonTypeBuy(data json.RawMessage) (*InlineKeyboardButtonTypeBuy, error) { - var resp InlineKeyboardButtonTypeBuy - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInlineKeyboardButtonTypeUser(data json.RawMessage) (*InlineKeyboardButtonTypeUser, error) { - var resp InlineKeyboardButtonTypeUser - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInlineKeyboardButton(data json.RawMessage) (*InlineKeyboardButton, error) { - var resp InlineKeyboardButton - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalReplyMarkupRemoveKeyboard(data json.RawMessage) (*ReplyMarkupRemoveKeyboard, error) { - var resp ReplyMarkupRemoveKeyboard - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalReplyMarkupForceReply(data json.RawMessage) (*ReplyMarkupForceReply, error) { - var resp ReplyMarkupForceReply - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalReplyMarkupShowKeyboard(data json.RawMessage) (*ReplyMarkupShowKeyboard, error) { - var resp ReplyMarkupShowKeyboard - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalReplyMarkupInlineKeyboard(data json.RawMessage) (*ReplyMarkupInlineKeyboard, error) { - var resp ReplyMarkupInlineKeyboard - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalLoginUrlInfoOpen(data json.RawMessage) (*LoginUrlInfoOpen, error) { - var resp LoginUrlInfoOpen - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalLoginUrlInfoRequestConfirmation(data json.RawMessage) (*LoginUrlInfoRequestConfirmation, error) { - var resp LoginUrlInfoRequestConfirmation - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalWebAppInfo(data json.RawMessage) (*WebAppInfo, error) { - var resp WebAppInfo - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageThreadInfo(data json.RawMessage) (*MessageThreadInfo, error) { - var resp MessageThreadInfo - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalForumTopicIcon(data json.RawMessage) (*ForumTopicIcon, error) { - var resp ForumTopicIcon - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalForumTopicInfo(data json.RawMessage) (*ForumTopicInfo, error) { - var resp ForumTopicInfo - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalForumTopic(data json.RawMessage) (*ForumTopic, error) { - var resp ForumTopic - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalForumTopics(data json.RawMessage) (*ForumTopics, error) { - var resp ForumTopics - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalRichTextPlain(data json.RawMessage) (*RichTextPlain, error) { - var resp RichTextPlain - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalRichTextBold(data json.RawMessage) (*RichTextBold, error) { - var resp RichTextBold - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalRichTextItalic(data json.RawMessage) (*RichTextItalic, error) { - var resp RichTextItalic - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalRichTextUnderline(data json.RawMessage) (*RichTextUnderline, error) { - var resp RichTextUnderline - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalRichTextStrikethrough(data json.RawMessage) (*RichTextStrikethrough, error) { - var resp RichTextStrikethrough - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalRichTextFixed(data json.RawMessage) (*RichTextFixed, error) { - var resp RichTextFixed - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalRichTextUrl(data json.RawMessage) (*RichTextUrl, error) { - var resp RichTextUrl - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalRichTextEmailAddress(data json.RawMessage) (*RichTextEmailAddress, error) { - var resp RichTextEmailAddress - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalRichTextSubscript(data json.RawMessage) (*RichTextSubscript, error) { - var resp RichTextSubscript - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalRichTextSuperscript(data json.RawMessage) (*RichTextSuperscript, error) { - var resp RichTextSuperscript - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalRichTextMarked(data json.RawMessage) (*RichTextMarked, error) { - var resp RichTextMarked - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalRichTextPhoneNumber(data json.RawMessage) (*RichTextPhoneNumber, error) { - var resp RichTextPhoneNumber - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalRichTextIcon(data json.RawMessage) (*RichTextIcon, error) { - var resp RichTextIcon - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalRichTextReference(data json.RawMessage) (*RichTextReference, error) { - var resp RichTextReference - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalRichTextAnchor(data json.RawMessage) (*RichTextAnchor, error) { - var resp RichTextAnchor - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalRichTextAnchorLink(data json.RawMessage) (*RichTextAnchorLink, error) { - var resp RichTextAnchorLink - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalRichTexts(data json.RawMessage) (*RichTexts, error) { - var resp RichTexts - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPageBlockCaption(data json.RawMessage) (*PageBlockCaption, error) { - var resp PageBlockCaption - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPageBlockListItem(data json.RawMessage) (*PageBlockListItem, error) { - var resp PageBlockListItem - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPageBlockHorizontalAlignmentLeft(data json.RawMessage) (*PageBlockHorizontalAlignmentLeft, error) { - var resp PageBlockHorizontalAlignmentLeft - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPageBlockHorizontalAlignmentCenter(data json.RawMessage) (*PageBlockHorizontalAlignmentCenter, error) { - var resp PageBlockHorizontalAlignmentCenter - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPageBlockHorizontalAlignmentRight(data json.RawMessage) (*PageBlockHorizontalAlignmentRight, error) { - var resp PageBlockHorizontalAlignmentRight - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPageBlockVerticalAlignmentTop(data json.RawMessage) (*PageBlockVerticalAlignmentTop, error) { - var resp PageBlockVerticalAlignmentTop - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPageBlockVerticalAlignmentMiddle(data json.RawMessage) (*PageBlockVerticalAlignmentMiddle, error) { - var resp PageBlockVerticalAlignmentMiddle - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPageBlockVerticalAlignmentBottom(data json.RawMessage) (*PageBlockVerticalAlignmentBottom, error) { - var resp PageBlockVerticalAlignmentBottom - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPageBlockTableCell(data json.RawMessage) (*PageBlockTableCell, error) { - var resp PageBlockTableCell - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPageBlockRelatedArticle(data json.RawMessage) (*PageBlockRelatedArticle, error) { - var resp PageBlockRelatedArticle - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPageBlockTitle(data json.RawMessage) (*PageBlockTitle, error) { - var resp PageBlockTitle - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPageBlockSubtitle(data json.RawMessage) (*PageBlockSubtitle, error) { - var resp PageBlockSubtitle - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPageBlockAuthorDate(data json.RawMessage) (*PageBlockAuthorDate, error) { - var resp PageBlockAuthorDate - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPageBlockHeader(data json.RawMessage) (*PageBlockHeader, error) { - var resp PageBlockHeader - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPageBlockSubheader(data json.RawMessage) (*PageBlockSubheader, error) { - var resp PageBlockSubheader - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPageBlockKicker(data json.RawMessage) (*PageBlockKicker, error) { - var resp PageBlockKicker - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPageBlockParagraph(data json.RawMessage) (*PageBlockParagraph, error) { - var resp PageBlockParagraph - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPageBlockPreformatted(data json.RawMessage) (*PageBlockPreformatted, error) { - var resp PageBlockPreformatted - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPageBlockFooter(data json.RawMessage) (*PageBlockFooter, error) { - var resp PageBlockFooter - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPageBlockDivider(data json.RawMessage) (*PageBlockDivider, error) { - var resp PageBlockDivider - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPageBlockAnchor(data json.RawMessage) (*PageBlockAnchor, error) { - var resp PageBlockAnchor - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPageBlockList(data json.RawMessage) (*PageBlockList, error) { - var resp PageBlockList - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPageBlockBlockQuote(data json.RawMessage) (*PageBlockBlockQuote, error) { - var resp PageBlockBlockQuote - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPageBlockPullQuote(data json.RawMessage) (*PageBlockPullQuote, error) { - var resp PageBlockPullQuote - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPageBlockAnimation(data json.RawMessage) (*PageBlockAnimation, error) { - var resp PageBlockAnimation - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPageBlockAudio(data json.RawMessage) (*PageBlockAudio, error) { - var resp PageBlockAudio - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPageBlockPhoto(data json.RawMessage) (*PageBlockPhoto, error) { - var resp PageBlockPhoto - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPageBlockVideo(data json.RawMessage) (*PageBlockVideo, error) { - var resp PageBlockVideo - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPageBlockVoiceNote(data json.RawMessage) (*PageBlockVoiceNote, error) { - var resp PageBlockVoiceNote - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPageBlockCover(data json.RawMessage) (*PageBlockCover, error) { - var resp PageBlockCover - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPageBlockEmbedded(data json.RawMessage) (*PageBlockEmbedded, error) { - var resp PageBlockEmbedded - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPageBlockEmbeddedPost(data json.RawMessage) (*PageBlockEmbeddedPost, error) { - var resp PageBlockEmbeddedPost - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPageBlockCollage(data json.RawMessage) (*PageBlockCollage, error) { - var resp PageBlockCollage - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPageBlockSlideshow(data json.RawMessage) (*PageBlockSlideshow, error) { - var resp PageBlockSlideshow - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPageBlockChatLink(data json.RawMessage) (*PageBlockChatLink, error) { - var resp PageBlockChatLink - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPageBlockTable(data json.RawMessage) (*PageBlockTable, error) { - var resp PageBlockTable - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPageBlockDetails(data json.RawMessage) (*PageBlockDetails, error) { - var resp PageBlockDetails - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPageBlockRelatedArticles(data json.RawMessage) (*PageBlockRelatedArticles, error) { - var resp PageBlockRelatedArticles - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPageBlockMap(data json.RawMessage) (*PageBlockMap, error) { - var resp PageBlockMap - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalWebPageInstantView(data json.RawMessage) (*WebPageInstantView, error) { - var resp WebPageInstantView - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalWebPage(data json.RawMessage) (*WebPage, error) { - var resp WebPage - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalCountryInfo(data json.RawMessage) (*CountryInfo, error) { - var resp CountryInfo - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalCountries(data json.RawMessage) (*Countries, error) { - var resp Countries - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPhoneNumberInfo(data json.RawMessage) (*PhoneNumberInfo, error) { - var resp PhoneNumberInfo - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalBankCardActionOpenUrl(data json.RawMessage) (*BankCardActionOpenUrl, error) { - var resp BankCardActionOpenUrl - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalBankCardInfo(data json.RawMessage) (*BankCardInfo, error) { - var resp BankCardInfo - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalAddress(data json.RawMessage) (*Address, error) { - var resp Address - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalThemeParameters(data json.RawMessage) (*ThemeParameters, error) { - var resp ThemeParameters - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalLabeledPricePart(data json.RawMessage) (*LabeledPricePart, error) { - var resp LabeledPricePart - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInvoice(data json.RawMessage) (*Invoice, error) { - var resp Invoice - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalOrderInfo(data json.RawMessage) (*OrderInfo, error) { - var resp OrderInfo - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalShippingOption(data json.RawMessage) (*ShippingOption, error) { - var resp ShippingOption - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalSavedCredentials(data json.RawMessage) (*SavedCredentials, error) { - var resp SavedCredentials - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputCredentialsSaved(data json.RawMessage) (*InputCredentialsSaved, error) { - var resp InputCredentialsSaved - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputCredentialsNew(data json.RawMessage) (*InputCredentialsNew, error) { - var resp InputCredentialsNew - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputCredentialsApplePay(data json.RawMessage) (*InputCredentialsApplePay, error) { - var resp InputCredentialsApplePay - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputCredentialsGooglePay(data json.RawMessage) (*InputCredentialsGooglePay, error) { - var resp InputCredentialsGooglePay - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPaymentProviderSmartGlocal(data json.RawMessage) (*PaymentProviderSmartGlocal, error) { - var resp PaymentProviderSmartGlocal - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPaymentProviderStripe(data json.RawMessage) (*PaymentProviderStripe, error) { - var resp PaymentProviderStripe - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPaymentProviderOther(data json.RawMessage) (*PaymentProviderOther, error) { - var resp PaymentProviderOther - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPaymentOption(data json.RawMessage) (*PaymentOption, error) { - var resp PaymentOption - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPaymentForm(data json.RawMessage) (*PaymentForm, error) { - var resp PaymentForm - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalValidatedOrderInfo(data json.RawMessage) (*ValidatedOrderInfo, error) { - var resp ValidatedOrderInfo - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPaymentResult(data json.RawMessage) (*PaymentResult, error) { - var resp PaymentResult - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPaymentReceipt(data json.RawMessage) (*PaymentReceipt, error) { - var resp PaymentReceipt - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputInvoiceMessage(data json.RawMessage) (*InputInvoiceMessage, error) { - var resp InputInvoiceMessage - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputInvoiceName(data json.RawMessage) (*InputInvoiceName, error) { - var resp InputInvoiceName - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageExtendedMediaPreview(data json.RawMessage) (*MessageExtendedMediaPreview, error) { - var resp MessageExtendedMediaPreview - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageExtendedMediaPhoto(data json.RawMessage) (*MessageExtendedMediaPhoto, error) { - var resp MessageExtendedMediaPhoto - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageExtendedMediaVideo(data json.RawMessage) (*MessageExtendedMediaVideo, error) { - var resp MessageExtendedMediaVideo - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageExtendedMediaUnsupported(data json.RawMessage) (*MessageExtendedMediaUnsupported, error) { - var resp MessageExtendedMediaUnsupported - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalDatedFile(data json.RawMessage) (*DatedFile, error) { - var resp DatedFile - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPassportElementTypePersonalDetails(data json.RawMessage) (*PassportElementTypePersonalDetails, error) { - var resp PassportElementTypePersonalDetails - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPassportElementTypePassport(data json.RawMessage) (*PassportElementTypePassport, error) { - var resp PassportElementTypePassport - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPassportElementTypeDriverLicense(data json.RawMessage) (*PassportElementTypeDriverLicense, error) { - var resp PassportElementTypeDriverLicense - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPassportElementTypeIdentityCard(data json.RawMessage) (*PassportElementTypeIdentityCard, error) { - var resp PassportElementTypeIdentityCard - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPassportElementTypeInternalPassport(data json.RawMessage) (*PassportElementTypeInternalPassport, error) { - var resp PassportElementTypeInternalPassport - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPassportElementTypeAddress(data json.RawMessage) (*PassportElementTypeAddress, error) { - var resp PassportElementTypeAddress - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPassportElementTypeUtilityBill(data json.RawMessage) (*PassportElementTypeUtilityBill, error) { - var resp PassportElementTypeUtilityBill - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPassportElementTypeBankStatement(data json.RawMessage) (*PassportElementTypeBankStatement, error) { - var resp PassportElementTypeBankStatement - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPassportElementTypeRentalAgreement(data json.RawMessage) (*PassportElementTypeRentalAgreement, error) { - var resp PassportElementTypeRentalAgreement - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPassportElementTypePassportRegistration(data json.RawMessage) (*PassportElementTypePassportRegistration, error) { - var resp PassportElementTypePassportRegistration - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPassportElementTypeTemporaryRegistration(data json.RawMessage) (*PassportElementTypeTemporaryRegistration, error) { - var resp PassportElementTypeTemporaryRegistration - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPassportElementTypePhoneNumber(data json.RawMessage) (*PassportElementTypePhoneNumber, error) { - var resp PassportElementTypePhoneNumber - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPassportElementTypeEmailAddress(data json.RawMessage) (*PassportElementTypeEmailAddress, error) { - var resp PassportElementTypeEmailAddress - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalDate(data json.RawMessage) (*Date, error) { - var resp Date - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPersonalDetails(data json.RawMessage) (*PersonalDetails, error) { - var resp PersonalDetails - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalIdentityDocument(data json.RawMessage) (*IdentityDocument, error) { - var resp IdentityDocument - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputIdentityDocument(data json.RawMessage) (*InputIdentityDocument, error) { - var resp InputIdentityDocument - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPersonalDocument(data json.RawMessage) (*PersonalDocument, error) { - var resp PersonalDocument - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputPersonalDocument(data json.RawMessage) (*InputPersonalDocument, error) { - var resp InputPersonalDocument - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPassportElementPersonalDetails(data json.RawMessage) (*PassportElementPersonalDetails, error) { - var resp PassportElementPersonalDetails - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPassportElementPassport(data json.RawMessage) (*PassportElementPassport, error) { - var resp PassportElementPassport - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPassportElementDriverLicense(data json.RawMessage) (*PassportElementDriverLicense, error) { - var resp PassportElementDriverLicense - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPassportElementIdentityCard(data json.RawMessage) (*PassportElementIdentityCard, error) { - var resp PassportElementIdentityCard - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPassportElementInternalPassport(data json.RawMessage) (*PassportElementInternalPassport, error) { - var resp PassportElementInternalPassport - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPassportElementAddress(data json.RawMessage) (*PassportElementAddress, error) { - var resp PassportElementAddress - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPassportElementUtilityBill(data json.RawMessage) (*PassportElementUtilityBill, error) { - var resp PassportElementUtilityBill - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPassportElementBankStatement(data json.RawMessage) (*PassportElementBankStatement, error) { - var resp PassportElementBankStatement - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPassportElementRentalAgreement(data json.RawMessage) (*PassportElementRentalAgreement, error) { - var resp PassportElementRentalAgreement - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPassportElementPassportRegistration(data json.RawMessage) (*PassportElementPassportRegistration, error) { - var resp PassportElementPassportRegistration - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPassportElementTemporaryRegistration(data json.RawMessage) (*PassportElementTemporaryRegistration, error) { - var resp PassportElementTemporaryRegistration - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPassportElementPhoneNumber(data json.RawMessage) (*PassportElementPhoneNumber, error) { - var resp PassportElementPhoneNumber - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPassportElementEmailAddress(data json.RawMessage) (*PassportElementEmailAddress, error) { - var resp PassportElementEmailAddress - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputPassportElementPersonalDetails(data json.RawMessage) (*InputPassportElementPersonalDetails, error) { - var resp InputPassportElementPersonalDetails - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputPassportElementPassport(data json.RawMessage) (*InputPassportElementPassport, error) { - var resp InputPassportElementPassport - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputPassportElementDriverLicense(data json.RawMessage) (*InputPassportElementDriverLicense, error) { - var resp InputPassportElementDriverLicense - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputPassportElementIdentityCard(data json.RawMessage) (*InputPassportElementIdentityCard, error) { - var resp InputPassportElementIdentityCard - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputPassportElementInternalPassport(data json.RawMessage) (*InputPassportElementInternalPassport, error) { - var resp InputPassportElementInternalPassport - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputPassportElementAddress(data json.RawMessage) (*InputPassportElementAddress, error) { - var resp InputPassportElementAddress - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputPassportElementUtilityBill(data json.RawMessage) (*InputPassportElementUtilityBill, error) { - var resp InputPassportElementUtilityBill - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputPassportElementBankStatement(data json.RawMessage) (*InputPassportElementBankStatement, error) { - var resp InputPassportElementBankStatement - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputPassportElementRentalAgreement(data json.RawMessage) (*InputPassportElementRentalAgreement, error) { - var resp InputPassportElementRentalAgreement - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputPassportElementPassportRegistration(data json.RawMessage) (*InputPassportElementPassportRegistration, error) { - var resp InputPassportElementPassportRegistration - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputPassportElementTemporaryRegistration(data json.RawMessage) (*InputPassportElementTemporaryRegistration, error) { - var resp InputPassportElementTemporaryRegistration - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputPassportElementPhoneNumber(data json.RawMessage) (*InputPassportElementPhoneNumber, error) { - var resp InputPassportElementPhoneNumber - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputPassportElementEmailAddress(data json.RawMessage) (*InputPassportElementEmailAddress, error) { - var resp InputPassportElementEmailAddress - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPassportElements(data json.RawMessage) (*PassportElements, error) { - var resp PassportElements - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPassportElementErrorSourceUnspecified(data json.RawMessage) (*PassportElementErrorSourceUnspecified, error) { - var resp PassportElementErrorSourceUnspecified - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPassportElementErrorSourceDataField(data json.RawMessage) (*PassportElementErrorSourceDataField, error) { - var resp PassportElementErrorSourceDataField - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPassportElementErrorSourceFrontSide(data json.RawMessage) (*PassportElementErrorSourceFrontSide, error) { - var resp PassportElementErrorSourceFrontSide - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPassportElementErrorSourceReverseSide(data json.RawMessage) (*PassportElementErrorSourceReverseSide, error) { - var resp PassportElementErrorSourceReverseSide - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPassportElementErrorSourceSelfie(data json.RawMessage) (*PassportElementErrorSourceSelfie, error) { - var resp PassportElementErrorSourceSelfie - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPassportElementErrorSourceTranslationFile(data json.RawMessage) (*PassportElementErrorSourceTranslationFile, error) { - var resp PassportElementErrorSourceTranslationFile - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPassportElementErrorSourceTranslationFiles(data json.RawMessage) (*PassportElementErrorSourceTranslationFiles, error) { - var resp PassportElementErrorSourceTranslationFiles - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPassportElementErrorSourceFile(data json.RawMessage) (*PassportElementErrorSourceFile, error) { - var resp PassportElementErrorSourceFile - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPassportElementErrorSourceFiles(data json.RawMessage) (*PassportElementErrorSourceFiles, error) { - var resp PassportElementErrorSourceFiles - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPassportElementError(data json.RawMessage) (*PassportElementError, error) { - var resp PassportElementError - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPassportSuitableElement(data json.RawMessage) (*PassportSuitableElement, error) { - var resp PassportSuitableElement - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPassportRequiredElement(data json.RawMessage) (*PassportRequiredElement, error) { - var resp PassportRequiredElement - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPassportAuthorizationForm(data json.RawMessage) (*PassportAuthorizationForm, error) { - var resp PassportAuthorizationForm - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPassportElementsWithErrors(data json.RawMessage) (*PassportElementsWithErrors, error) { - var resp PassportElementsWithErrors - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalEncryptedCredentials(data json.RawMessage) (*EncryptedCredentials, error) { - var resp EncryptedCredentials - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalEncryptedPassportElement(data json.RawMessage) (*EncryptedPassportElement, error) { - var resp EncryptedPassportElement - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputPassportElementErrorSourceUnspecified(data json.RawMessage) (*InputPassportElementErrorSourceUnspecified, error) { - var resp InputPassportElementErrorSourceUnspecified - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputPassportElementErrorSourceDataField(data json.RawMessage) (*InputPassportElementErrorSourceDataField, error) { - var resp InputPassportElementErrorSourceDataField - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputPassportElementErrorSourceFrontSide(data json.RawMessage) (*InputPassportElementErrorSourceFrontSide, error) { - var resp InputPassportElementErrorSourceFrontSide - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputPassportElementErrorSourceReverseSide(data json.RawMessage) (*InputPassportElementErrorSourceReverseSide, error) { - var resp InputPassportElementErrorSourceReverseSide - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputPassportElementErrorSourceSelfie(data json.RawMessage) (*InputPassportElementErrorSourceSelfie, error) { - var resp InputPassportElementErrorSourceSelfie - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputPassportElementErrorSourceTranslationFile(data json.RawMessage) (*InputPassportElementErrorSourceTranslationFile, error) { - var resp InputPassportElementErrorSourceTranslationFile - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputPassportElementErrorSourceTranslationFiles(data json.RawMessage) (*InputPassportElementErrorSourceTranslationFiles, error) { - var resp InputPassportElementErrorSourceTranslationFiles - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputPassportElementErrorSourceFile(data json.RawMessage) (*InputPassportElementErrorSourceFile, error) { - var resp InputPassportElementErrorSourceFile - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputPassportElementErrorSourceFiles(data json.RawMessage) (*InputPassportElementErrorSourceFiles, error) { - var resp InputPassportElementErrorSourceFiles - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputPassportElementError(data json.RawMessage) (*InputPassportElementError, error) { - var resp InputPassportElementError - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageText(data json.RawMessage) (*MessageText, error) { - var resp MessageText - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageAnimation(data json.RawMessage) (*MessageAnimation, error) { - var resp MessageAnimation - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageAudio(data json.RawMessage) (*MessageAudio, error) { - var resp MessageAudio - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageDocument(data json.RawMessage) (*MessageDocument, error) { - var resp MessageDocument - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessagePhoto(data json.RawMessage) (*MessagePhoto, error) { - var resp MessagePhoto - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageExpiredPhoto(data json.RawMessage) (*MessageExpiredPhoto, error) { - var resp MessageExpiredPhoto - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageSticker(data json.RawMessage) (*MessageSticker, error) { - var resp MessageSticker - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageVideo(data json.RawMessage) (*MessageVideo, error) { - var resp MessageVideo - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageExpiredVideo(data json.RawMessage) (*MessageExpiredVideo, error) { - var resp MessageExpiredVideo - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageVideoNote(data json.RawMessage) (*MessageVideoNote, error) { - var resp MessageVideoNote - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageVoiceNote(data json.RawMessage) (*MessageVoiceNote, error) { - var resp MessageVoiceNote - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageLocation(data json.RawMessage) (*MessageLocation, error) { - var resp MessageLocation - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageVenue(data json.RawMessage) (*MessageVenue, error) { - var resp MessageVenue - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageContact(data json.RawMessage) (*MessageContact, error) { - var resp MessageContact - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageAnimatedEmoji(data json.RawMessage) (*MessageAnimatedEmoji, error) { - var resp MessageAnimatedEmoji - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageDice(data json.RawMessage) (*MessageDice, error) { - var resp MessageDice - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageGame(data json.RawMessage) (*MessageGame, error) { - var resp MessageGame - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessagePoll(data json.RawMessage) (*MessagePoll, error) { - var resp MessagePoll - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageInvoice(data json.RawMessage) (*MessageInvoice, error) { - var resp MessageInvoice - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageCall(data json.RawMessage) (*MessageCall, error) { - var resp MessageCall - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageVideoChatScheduled(data json.RawMessage) (*MessageVideoChatScheduled, error) { - var resp MessageVideoChatScheduled - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageVideoChatStarted(data json.RawMessage) (*MessageVideoChatStarted, error) { - var resp MessageVideoChatStarted - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageVideoChatEnded(data json.RawMessage) (*MessageVideoChatEnded, error) { - var resp MessageVideoChatEnded - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageInviteVideoChatParticipants(data json.RawMessage) (*MessageInviteVideoChatParticipants, error) { - var resp MessageInviteVideoChatParticipants - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageBasicGroupChatCreate(data json.RawMessage) (*MessageBasicGroupChatCreate, error) { - var resp MessageBasicGroupChatCreate - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageSupergroupChatCreate(data json.RawMessage) (*MessageSupergroupChatCreate, error) { - var resp MessageSupergroupChatCreate - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageChatChangeTitle(data json.RawMessage) (*MessageChatChangeTitle, error) { - var resp MessageChatChangeTitle - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageChatChangePhoto(data json.RawMessage) (*MessageChatChangePhoto, error) { - var resp MessageChatChangePhoto - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageChatDeletePhoto(data json.RawMessage) (*MessageChatDeletePhoto, error) { - var resp MessageChatDeletePhoto - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageChatAddMembers(data json.RawMessage) (*MessageChatAddMembers, error) { - var resp MessageChatAddMembers - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageChatJoinByLink(data json.RawMessage) (*MessageChatJoinByLink, error) { - var resp MessageChatJoinByLink - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageChatJoinByRequest(data json.RawMessage) (*MessageChatJoinByRequest, error) { - var resp MessageChatJoinByRequest - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageChatDeleteMember(data json.RawMessage) (*MessageChatDeleteMember, error) { - var resp MessageChatDeleteMember - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageChatUpgradeTo(data json.RawMessage) (*MessageChatUpgradeTo, error) { - var resp MessageChatUpgradeTo - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageChatUpgradeFrom(data json.RawMessage) (*MessageChatUpgradeFrom, error) { - var resp MessageChatUpgradeFrom - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessagePinMessage(data json.RawMessage) (*MessagePinMessage, error) { - var resp MessagePinMessage - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageScreenshotTaken(data json.RawMessage) (*MessageScreenshotTaken, error) { - var resp MessageScreenshotTaken - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageChatSetTheme(data json.RawMessage) (*MessageChatSetTheme, error) { - var resp MessageChatSetTheme - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageChatSetMessageAutoDeleteTime(data json.RawMessage) (*MessageChatSetMessageAutoDeleteTime, error) { - var resp MessageChatSetMessageAutoDeleteTime - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageForumTopicCreated(data json.RawMessage) (*MessageForumTopicCreated, error) { - var resp MessageForumTopicCreated - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageForumTopicEdited(data json.RawMessage) (*MessageForumTopicEdited, error) { - var resp MessageForumTopicEdited - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageForumTopicIsClosedToggled(data json.RawMessage) (*MessageForumTopicIsClosedToggled, error) { - var resp MessageForumTopicIsClosedToggled - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageForumTopicIsHiddenToggled(data json.RawMessage) (*MessageForumTopicIsHiddenToggled, error) { - var resp MessageForumTopicIsHiddenToggled - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageSuggestProfilePhoto(data json.RawMessage) (*MessageSuggestProfilePhoto, error) { - var resp MessageSuggestProfilePhoto - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageCustomServiceAction(data json.RawMessage) (*MessageCustomServiceAction, error) { - var resp MessageCustomServiceAction - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageGameScore(data json.RawMessage) (*MessageGameScore, error) { - var resp MessageGameScore - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessagePaymentSuccessful(data json.RawMessage) (*MessagePaymentSuccessful, error) { - var resp MessagePaymentSuccessful - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessagePaymentSuccessfulBot(data json.RawMessage) (*MessagePaymentSuccessfulBot, error) { - var resp MessagePaymentSuccessfulBot - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageGiftedPremium(data json.RawMessage) (*MessageGiftedPremium, error) { - var resp MessageGiftedPremium - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageContactRegistered(data json.RawMessage) (*MessageContactRegistered, error) { - var resp MessageContactRegistered - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageWebsiteConnected(data json.RawMessage) (*MessageWebsiteConnected, error) { - var resp MessageWebsiteConnected - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageBotWriteAccessAllowed(data json.RawMessage) (*MessageBotWriteAccessAllowed, error) { - var resp MessageBotWriteAccessAllowed - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageWebAppDataSent(data json.RawMessage) (*MessageWebAppDataSent, error) { - var resp MessageWebAppDataSent - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageWebAppDataReceived(data json.RawMessage) (*MessageWebAppDataReceived, error) { - var resp MessageWebAppDataReceived - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessagePassportDataSent(data json.RawMessage) (*MessagePassportDataSent, error) { - var resp MessagePassportDataSent - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessagePassportDataReceived(data json.RawMessage) (*MessagePassportDataReceived, error) { - var resp MessagePassportDataReceived - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageProximityAlertTriggered(data json.RawMessage) (*MessageProximityAlertTriggered, error) { - var resp MessageProximityAlertTriggered - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageUnsupported(data json.RawMessage) (*MessageUnsupported, error) { - var resp MessageUnsupported - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalTextEntityTypeMention(data json.RawMessage) (*TextEntityTypeMention, error) { - var resp TextEntityTypeMention - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalTextEntityTypeHashtag(data json.RawMessage) (*TextEntityTypeHashtag, error) { - var resp TextEntityTypeHashtag - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalTextEntityTypeCashtag(data json.RawMessage) (*TextEntityTypeCashtag, error) { - var resp TextEntityTypeCashtag - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalTextEntityTypeBotCommand(data json.RawMessage) (*TextEntityTypeBotCommand, error) { - var resp TextEntityTypeBotCommand - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalTextEntityTypeUrl(data json.RawMessage) (*TextEntityTypeUrl, error) { - var resp TextEntityTypeUrl - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalTextEntityTypeEmailAddress(data json.RawMessage) (*TextEntityTypeEmailAddress, error) { - var resp TextEntityTypeEmailAddress - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalTextEntityTypePhoneNumber(data json.RawMessage) (*TextEntityTypePhoneNumber, error) { - var resp TextEntityTypePhoneNumber - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalTextEntityTypeBankCardNumber(data json.RawMessage) (*TextEntityTypeBankCardNumber, error) { - var resp TextEntityTypeBankCardNumber - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalTextEntityTypeBold(data json.RawMessage) (*TextEntityTypeBold, error) { - var resp TextEntityTypeBold - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalTextEntityTypeItalic(data json.RawMessage) (*TextEntityTypeItalic, error) { - var resp TextEntityTypeItalic - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalTextEntityTypeUnderline(data json.RawMessage) (*TextEntityTypeUnderline, error) { - var resp TextEntityTypeUnderline - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalTextEntityTypeStrikethrough(data json.RawMessage) (*TextEntityTypeStrikethrough, error) { - var resp TextEntityTypeStrikethrough - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalTextEntityTypeSpoiler(data json.RawMessage) (*TextEntityTypeSpoiler, error) { - var resp TextEntityTypeSpoiler - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalTextEntityTypeCode(data json.RawMessage) (*TextEntityTypeCode, error) { - var resp TextEntityTypeCode - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalTextEntityTypePre(data json.RawMessage) (*TextEntityTypePre, error) { - var resp TextEntityTypePre - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalTextEntityTypePreCode(data json.RawMessage) (*TextEntityTypePreCode, error) { - var resp TextEntityTypePreCode - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalTextEntityTypeTextUrl(data json.RawMessage) (*TextEntityTypeTextUrl, error) { - var resp TextEntityTypeTextUrl - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalTextEntityTypeMentionName(data json.RawMessage) (*TextEntityTypeMentionName, error) { - var resp TextEntityTypeMentionName - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalTextEntityTypeCustomEmoji(data json.RawMessage) (*TextEntityTypeCustomEmoji, error) { - var resp TextEntityTypeCustomEmoji - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalTextEntityTypeMediaTimestamp(data json.RawMessage) (*TextEntityTypeMediaTimestamp, error) { - var resp TextEntityTypeMediaTimestamp - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputThumbnail(data json.RawMessage) (*InputThumbnail, error) { - var resp InputThumbnail - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageSchedulingStateSendAtDate(data json.RawMessage) (*MessageSchedulingStateSendAtDate, error) { - var resp MessageSchedulingStateSendAtDate - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageSchedulingStateSendWhenOnline(data json.RawMessage) (*MessageSchedulingStateSendWhenOnline, error) { - var resp MessageSchedulingStateSendWhenOnline - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageSendOptions(data json.RawMessage) (*MessageSendOptions, error) { - var resp MessageSendOptions - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageCopyOptions(data json.RawMessage) (*MessageCopyOptions, error) { - var resp MessageCopyOptions - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputMessageText(data json.RawMessage) (*InputMessageText, error) { - var resp InputMessageText - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputMessageAnimation(data json.RawMessage) (*InputMessageAnimation, error) { - var resp InputMessageAnimation - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputMessageAudio(data json.RawMessage) (*InputMessageAudio, error) { - var resp InputMessageAudio - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputMessageDocument(data json.RawMessage) (*InputMessageDocument, error) { - var resp InputMessageDocument - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputMessagePhoto(data json.RawMessage) (*InputMessagePhoto, error) { - var resp InputMessagePhoto - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputMessageSticker(data json.RawMessage) (*InputMessageSticker, error) { - var resp InputMessageSticker - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputMessageVideo(data json.RawMessage) (*InputMessageVideo, error) { - var resp InputMessageVideo - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputMessageVideoNote(data json.RawMessage) (*InputMessageVideoNote, error) { - var resp InputMessageVideoNote - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputMessageVoiceNote(data json.RawMessage) (*InputMessageVoiceNote, error) { - var resp InputMessageVoiceNote - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputMessageLocation(data json.RawMessage) (*InputMessageLocation, error) { - var resp InputMessageLocation - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputMessageVenue(data json.RawMessage) (*InputMessageVenue, error) { - var resp InputMessageVenue - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputMessageContact(data json.RawMessage) (*InputMessageContact, error) { - var resp InputMessageContact - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputMessageDice(data json.RawMessage) (*InputMessageDice, error) { - var resp InputMessageDice - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputMessageGame(data json.RawMessage) (*InputMessageGame, error) { - var resp InputMessageGame - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputMessageInvoice(data json.RawMessage) (*InputMessageInvoice, error) { - var resp InputMessageInvoice - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputMessagePoll(data json.RawMessage) (*InputMessagePoll, error) { - var resp InputMessagePoll - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputMessageForwarded(data json.RawMessage) (*InputMessageForwarded, error) { - var resp InputMessageForwarded - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalSearchMessagesFilterEmpty(data json.RawMessage) (*SearchMessagesFilterEmpty, error) { - var resp SearchMessagesFilterEmpty - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalSearchMessagesFilterAnimation(data json.RawMessage) (*SearchMessagesFilterAnimation, error) { - var resp SearchMessagesFilterAnimation - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalSearchMessagesFilterAudio(data json.RawMessage) (*SearchMessagesFilterAudio, error) { - var resp SearchMessagesFilterAudio - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalSearchMessagesFilterDocument(data json.RawMessage) (*SearchMessagesFilterDocument, error) { - var resp SearchMessagesFilterDocument - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalSearchMessagesFilterPhoto(data json.RawMessage) (*SearchMessagesFilterPhoto, error) { - var resp SearchMessagesFilterPhoto - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalSearchMessagesFilterVideo(data json.RawMessage) (*SearchMessagesFilterVideo, error) { - var resp SearchMessagesFilterVideo - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalSearchMessagesFilterVoiceNote(data json.RawMessage) (*SearchMessagesFilterVoiceNote, error) { - var resp SearchMessagesFilterVoiceNote - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalSearchMessagesFilterPhotoAndVideo(data json.RawMessage) (*SearchMessagesFilterPhotoAndVideo, error) { - var resp SearchMessagesFilterPhotoAndVideo - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalSearchMessagesFilterUrl(data json.RawMessage) (*SearchMessagesFilterUrl, error) { - var resp SearchMessagesFilterUrl - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalSearchMessagesFilterChatPhoto(data json.RawMessage) (*SearchMessagesFilterChatPhoto, error) { - var resp SearchMessagesFilterChatPhoto - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalSearchMessagesFilterVideoNote(data json.RawMessage) (*SearchMessagesFilterVideoNote, error) { - var resp SearchMessagesFilterVideoNote - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalSearchMessagesFilterVoiceAndVideoNote(data json.RawMessage) (*SearchMessagesFilterVoiceAndVideoNote, error) { - var resp SearchMessagesFilterVoiceAndVideoNote - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalSearchMessagesFilterMention(data json.RawMessage) (*SearchMessagesFilterMention, error) { - var resp SearchMessagesFilterMention - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalSearchMessagesFilterUnreadMention(data json.RawMessage) (*SearchMessagesFilterUnreadMention, error) { - var resp SearchMessagesFilterUnreadMention - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalSearchMessagesFilterUnreadReaction(data json.RawMessage) (*SearchMessagesFilterUnreadReaction, error) { - var resp SearchMessagesFilterUnreadReaction - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalSearchMessagesFilterFailedToSend(data json.RawMessage) (*SearchMessagesFilterFailedToSend, error) { - var resp SearchMessagesFilterFailedToSend - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalSearchMessagesFilterPinned(data json.RawMessage) (*SearchMessagesFilterPinned, error) { - var resp SearchMessagesFilterPinned - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatActionTyping(data json.RawMessage) (*ChatActionTyping, error) { - var resp ChatActionTyping - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatActionRecordingVideo(data json.RawMessage) (*ChatActionRecordingVideo, error) { - var resp ChatActionRecordingVideo - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatActionUploadingVideo(data json.RawMessage) (*ChatActionUploadingVideo, error) { - var resp ChatActionUploadingVideo - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatActionRecordingVoiceNote(data json.RawMessage) (*ChatActionRecordingVoiceNote, error) { - var resp ChatActionRecordingVoiceNote - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatActionUploadingVoiceNote(data json.RawMessage) (*ChatActionUploadingVoiceNote, error) { - var resp ChatActionUploadingVoiceNote - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatActionUploadingPhoto(data json.RawMessage) (*ChatActionUploadingPhoto, error) { - var resp ChatActionUploadingPhoto - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatActionUploadingDocument(data json.RawMessage) (*ChatActionUploadingDocument, error) { - var resp ChatActionUploadingDocument - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatActionChoosingSticker(data json.RawMessage) (*ChatActionChoosingSticker, error) { - var resp ChatActionChoosingSticker - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatActionChoosingLocation(data json.RawMessage) (*ChatActionChoosingLocation, error) { - var resp ChatActionChoosingLocation - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatActionChoosingContact(data json.RawMessage) (*ChatActionChoosingContact, error) { - var resp ChatActionChoosingContact - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatActionStartPlayingGame(data json.RawMessage) (*ChatActionStartPlayingGame, error) { - var resp ChatActionStartPlayingGame - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatActionRecordingVideoNote(data json.RawMessage) (*ChatActionRecordingVideoNote, error) { - var resp ChatActionRecordingVideoNote - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatActionUploadingVideoNote(data json.RawMessage) (*ChatActionUploadingVideoNote, error) { - var resp ChatActionUploadingVideoNote - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatActionWatchingAnimations(data json.RawMessage) (*ChatActionWatchingAnimations, error) { - var resp ChatActionWatchingAnimations - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatActionCancel(data json.RawMessage) (*ChatActionCancel, error) { - var resp ChatActionCancel - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalUserStatusEmpty(data json.RawMessage) (*UserStatusEmpty, error) { - var resp UserStatusEmpty - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalUserStatusOnline(data json.RawMessage) (*UserStatusOnline, error) { - var resp UserStatusOnline - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalUserStatusOffline(data json.RawMessage) (*UserStatusOffline, error) { - var resp UserStatusOffline - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalUserStatusRecently(data json.RawMessage) (*UserStatusRecently, error) { - var resp UserStatusRecently - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalUserStatusLastWeek(data json.RawMessage) (*UserStatusLastWeek, error) { - var resp UserStatusLastWeek - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalUserStatusLastMonth(data json.RawMessage) (*UserStatusLastMonth, error) { - var resp UserStatusLastMonth - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalStickers(data json.RawMessage) (*Stickers, error) { - var resp Stickers - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalEmojis(data json.RawMessage) (*Emojis, error) { - var resp Emojis - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalStickerSet(data json.RawMessage) (*StickerSet, error) { - var resp StickerSet - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalStickerSetInfo(data json.RawMessage) (*StickerSetInfo, error) { - var resp StickerSetInfo - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalStickerSets(data json.RawMessage) (*StickerSets, error) { - var resp StickerSets - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalTrendingStickerSets(data json.RawMessage) (*TrendingStickerSets, error) { - var resp TrendingStickerSets - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalCallDiscardReasonEmpty(data json.RawMessage) (*CallDiscardReasonEmpty, error) { - var resp CallDiscardReasonEmpty - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalCallDiscardReasonMissed(data json.RawMessage) (*CallDiscardReasonMissed, error) { - var resp CallDiscardReasonMissed - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalCallDiscardReasonDeclined(data json.RawMessage) (*CallDiscardReasonDeclined, error) { - var resp CallDiscardReasonDeclined - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalCallDiscardReasonDisconnected(data json.RawMessage) (*CallDiscardReasonDisconnected, error) { - var resp CallDiscardReasonDisconnected - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalCallDiscardReasonHungUp(data json.RawMessage) (*CallDiscardReasonHungUp, error) { - var resp CallDiscardReasonHungUp - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalCallProtocol(data json.RawMessage) (*CallProtocol, error) { - var resp CallProtocol - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalCallServerTypeTelegramReflector(data json.RawMessage) (*CallServerTypeTelegramReflector, error) { - var resp CallServerTypeTelegramReflector - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalCallServerTypeWebrtc(data json.RawMessage) (*CallServerTypeWebrtc, error) { - var resp CallServerTypeWebrtc - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalCallServer(data json.RawMessage) (*CallServer, error) { - var resp CallServer - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalCallId(data json.RawMessage) (*CallId, error) { - var resp CallId - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalGroupCallId(data json.RawMessage) (*GroupCallId, error) { - var resp GroupCallId - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalCallStatePending(data json.RawMessage) (*CallStatePending, error) { - var resp CallStatePending - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalCallStateExchangingKeys(data json.RawMessage) (*CallStateExchangingKeys, error) { - var resp CallStateExchangingKeys - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalCallStateReady(data json.RawMessage) (*CallStateReady, error) { - var resp CallStateReady - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalCallStateHangingUp(data json.RawMessage) (*CallStateHangingUp, error) { - var resp CallStateHangingUp - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalCallStateDiscarded(data json.RawMessage) (*CallStateDiscarded, error) { - var resp CallStateDiscarded - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalCallStateError(data json.RawMessage) (*CallStateError, error) { - var resp CallStateError - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalGroupCallVideoQualityThumbnail(data json.RawMessage) (*GroupCallVideoQualityThumbnail, error) { - var resp GroupCallVideoQualityThumbnail - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalGroupCallVideoQualityMedium(data json.RawMessage) (*GroupCallVideoQualityMedium, error) { - var resp GroupCallVideoQualityMedium - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalGroupCallVideoQualityFull(data json.RawMessage) (*GroupCallVideoQualityFull, error) { - var resp GroupCallVideoQualityFull - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalGroupCallStream(data json.RawMessage) (*GroupCallStream, error) { - var resp GroupCallStream - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalGroupCallStreams(data json.RawMessage) (*GroupCallStreams, error) { - var resp GroupCallStreams - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalRtmpUrl(data json.RawMessage) (*RtmpUrl, error) { - var resp RtmpUrl - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalGroupCallRecentSpeaker(data json.RawMessage) (*GroupCallRecentSpeaker, error) { - var resp GroupCallRecentSpeaker - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalGroupCall(data json.RawMessage) (*GroupCall, error) { - var resp GroupCall - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalGroupCallVideoSourceGroup(data json.RawMessage) (*GroupCallVideoSourceGroup, error) { - var resp GroupCallVideoSourceGroup - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalGroupCallParticipantVideoInfo(data json.RawMessage) (*GroupCallParticipantVideoInfo, error) { - var resp GroupCallParticipantVideoInfo - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalGroupCallParticipant(data json.RawMessage) (*GroupCallParticipant, error) { - var resp GroupCallParticipant - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalCallProblemEcho(data json.RawMessage) (*CallProblemEcho, error) { - var resp CallProblemEcho - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalCallProblemNoise(data json.RawMessage) (*CallProblemNoise, error) { - var resp CallProblemNoise - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalCallProblemInterruptions(data json.RawMessage) (*CallProblemInterruptions, error) { - var resp CallProblemInterruptions - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalCallProblemDistortedSpeech(data json.RawMessage) (*CallProblemDistortedSpeech, error) { - var resp CallProblemDistortedSpeech - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalCallProblemSilentLocal(data json.RawMessage) (*CallProblemSilentLocal, error) { - var resp CallProblemSilentLocal - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalCallProblemSilentRemote(data json.RawMessage) (*CallProblemSilentRemote, error) { - var resp CallProblemSilentRemote - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalCallProblemDropped(data json.RawMessage) (*CallProblemDropped, error) { - var resp CallProblemDropped - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalCallProblemDistortedVideo(data json.RawMessage) (*CallProblemDistortedVideo, error) { - var resp CallProblemDistortedVideo - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalCallProblemPixelatedVideo(data json.RawMessage) (*CallProblemPixelatedVideo, error) { - var resp CallProblemPixelatedVideo - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalCall(data json.RawMessage) (*Call, error) { - var resp Call - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPhoneNumberAuthenticationSettings(data json.RawMessage) (*PhoneNumberAuthenticationSettings, error) { - var resp PhoneNumberAuthenticationSettings - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalAddedReaction(data json.RawMessage) (*AddedReaction, error) { - var resp AddedReaction - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalAddedReactions(data json.RawMessage) (*AddedReactions, error) { - var resp AddedReactions - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalAvailableReaction(data json.RawMessage) (*AvailableReaction, error) { - var resp AvailableReaction - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalAvailableReactions(data json.RawMessage) (*AvailableReactions, error) { - var resp AvailableReactions - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalEmojiReaction(data json.RawMessage) (*EmojiReaction, error) { - var resp EmojiReaction - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalAnimations(data json.RawMessage) (*Animations, error) { - var resp Animations - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalDiceStickersRegular(data json.RawMessage) (*DiceStickersRegular, error) { - var resp DiceStickersRegular - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalDiceStickersSlotMachine(data json.RawMessage) (*DiceStickersSlotMachine, error) { - var resp DiceStickersSlotMachine - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalImportedContacts(data json.RawMessage) (*ImportedContacts, error) { - var resp ImportedContacts - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalSpeechRecognitionResultPending(data json.RawMessage) (*SpeechRecognitionResultPending, error) { - var resp SpeechRecognitionResultPending - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalSpeechRecognitionResultText(data json.RawMessage) (*SpeechRecognitionResultText, error) { - var resp SpeechRecognitionResultText - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalSpeechRecognitionResultError(data json.RawMessage) (*SpeechRecognitionResultError, error) { - var resp SpeechRecognitionResultError - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalAttachmentMenuBotColor(data json.RawMessage) (*AttachmentMenuBotColor, error) { - var resp AttachmentMenuBotColor - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalAttachmentMenuBot(data json.RawMessage) (*AttachmentMenuBot, error) { - var resp AttachmentMenuBot - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalSentWebAppMessage(data json.RawMessage) (*SentWebAppMessage, error) { - var resp SentWebAppMessage - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalHttpUrl(data json.RawMessage) (*HttpUrl, error) { - var resp HttpUrl - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalUserLink(data json.RawMessage) (*UserLink, error) { - var resp UserLink - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputInlineQueryResultAnimation(data json.RawMessage) (*InputInlineQueryResultAnimation, error) { - var resp InputInlineQueryResultAnimation - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputInlineQueryResultArticle(data json.RawMessage) (*InputInlineQueryResultArticle, error) { - var resp InputInlineQueryResultArticle - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputInlineQueryResultAudio(data json.RawMessage) (*InputInlineQueryResultAudio, error) { - var resp InputInlineQueryResultAudio - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputInlineQueryResultContact(data json.RawMessage) (*InputInlineQueryResultContact, error) { - var resp InputInlineQueryResultContact - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputInlineQueryResultDocument(data json.RawMessage) (*InputInlineQueryResultDocument, error) { - var resp InputInlineQueryResultDocument - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputInlineQueryResultGame(data json.RawMessage) (*InputInlineQueryResultGame, error) { - var resp InputInlineQueryResultGame - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputInlineQueryResultLocation(data json.RawMessage) (*InputInlineQueryResultLocation, error) { - var resp InputInlineQueryResultLocation - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputInlineQueryResultPhoto(data json.RawMessage) (*InputInlineQueryResultPhoto, error) { - var resp InputInlineQueryResultPhoto - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputInlineQueryResultSticker(data json.RawMessage) (*InputInlineQueryResultSticker, error) { - var resp InputInlineQueryResultSticker - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputInlineQueryResultVenue(data json.RawMessage) (*InputInlineQueryResultVenue, error) { - var resp InputInlineQueryResultVenue - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputInlineQueryResultVideo(data json.RawMessage) (*InputInlineQueryResultVideo, error) { - var resp InputInlineQueryResultVideo - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputInlineQueryResultVoiceNote(data json.RawMessage) (*InputInlineQueryResultVoiceNote, error) { - var resp InputInlineQueryResultVoiceNote - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInlineQueryResultArticle(data json.RawMessage) (*InlineQueryResultArticle, error) { - var resp InlineQueryResultArticle - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInlineQueryResultContact(data json.RawMessage) (*InlineQueryResultContact, error) { - var resp InlineQueryResultContact - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInlineQueryResultLocation(data json.RawMessage) (*InlineQueryResultLocation, error) { - var resp InlineQueryResultLocation - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInlineQueryResultVenue(data json.RawMessage) (*InlineQueryResultVenue, error) { - var resp InlineQueryResultVenue - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInlineQueryResultGame(data json.RawMessage) (*InlineQueryResultGame, error) { - var resp InlineQueryResultGame - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInlineQueryResultAnimation(data json.RawMessage) (*InlineQueryResultAnimation, error) { - var resp InlineQueryResultAnimation - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInlineQueryResultAudio(data json.RawMessage) (*InlineQueryResultAudio, error) { - var resp InlineQueryResultAudio - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInlineQueryResultDocument(data json.RawMessage) (*InlineQueryResultDocument, error) { - var resp InlineQueryResultDocument - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInlineQueryResultPhoto(data json.RawMessage) (*InlineQueryResultPhoto, error) { - var resp InlineQueryResultPhoto - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInlineQueryResultSticker(data json.RawMessage) (*InlineQueryResultSticker, error) { - var resp InlineQueryResultSticker - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInlineQueryResultVideo(data json.RawMessage) (*InlineQueryResultVideo, error) { - var resp InlineQueryResultVideo - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInlineQueryResultVoiceNote(data json.RawMessage) (*InlineQueryResultVoiceNote, error) { - var resp InlineQueryResultVoiceNote - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInlineQueryResults(data json.RawMessage) (*InlineQueryResults, error) { - var resp InlineQueryResults - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalCallbackQueryPayloadData(data json.RawMessage) (*CallbackQueryPayloadData, error) { - var resp CallbackQueryPayloadData - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalCallbackQueryPayloadDataWithPassword(data json.RawMessage) (*CallbackQueryPayloadDataWithPassword, error) { - var resp CallbackQueryPayloadDataWithPassword - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalCallbackQueryPayloadGame(data json.RawMessage) (*CallbackQueryPayloadGame, error) { - var resp CallbackQueryPayloadGame - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalCallbackQueryAnswer(data json.RawMessage) (*CallbackQueryAnswer, error) { - var resp CallbackQueryAnswer - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalCustomRequestResult(data json.RawMessage) (*CustomRequestResult, error) { - var resp CustomRequestResult - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalGameHighScore(data json.RawMessage) (*GameHighScore, error) { - var resp GameHighScore - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalGameHighScores(data json.RawMessage) (*GameHighScores, error) { - var resp GameHighScores - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEventMessageEdited(data json.RawMessage) (*ChatEventMessageEdited, error) { - var resp ChatEventMessageEdited - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEventMessageDeleted(data json.RawMessage) (*ChatEventMessageDeleted, error) { - var resp ChatEventMessageDeleted - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEventMessagePinned(data json.RawMessage) (*ChatEventMessagePinned, error) { - var resp ChatEventMessagePinned - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEventMessageUnpinned(data json.RawMessage) (*ChatEventMessageUnpinned, error) { - var resp ChatEventMessageUnpinned - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEventPollStopped(data json.RawMessage) (*ChatEventPollStopped, error) { - var resp ChatEventPollStopped - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEventMemberJoined(data json.RawMessage) (*ChatEventMemberJoined, error) { - var resp ChatEventMemberJoined - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEventMemberJoinedByInviteLink(data json.RawMessage) (*ChatEventMemberJoinedByInviteLink, error) { - var resp ChatEventMemberJoinedByInviteLink - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEventMemberJoinedByRequest(data json.RawMessage) (*ChatEventMemberJoinedByRequest, error) { - var resp ChatEventMemberJoinedByRequest - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEventMemberInvited(data json.RawMessage) (*ChatEventMemberInvited, error) { - var resp ChatEventMemberInvited - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEventMemberLeft(data json.RawMessage) (*ChatEventMemberLeft, error) { - var resp ChatEventMemberLeft - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEventMemberPromoted(data json.RawMessage) (*ChatEventMemberPromoted, error) { - var resp ChatEventMemberPromoted - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEventMemberRestricted(data json.RawMessage) (*ChatEventMemberRestricted, error) { - var resp ChatEventMemberRestricted - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEventAvailableReactionsChanged(data json.RawMessage) (*ChatEventAvailableReactionsChanged, error) { - var resp ChatEventAvailableReactionsChanged - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEventDescriptionChanged(data json.RawMessage) (*ChatEventDescriptionChanged, error) { - var resp ChatEventDescriptionChanged - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEventLinkedChatChanged(data json.RawMessage) (*ChatEventLinkedChatChanged, error) { - var resp ChatEventLinkedChatChanged - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEventLocationChanged(data json.RawMessage) (*ChatEventLocationChanged, error) { - var resp ChatEventLocationChanged - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEventMessageAutoDeleteTimeChanged(data json.RawMessage) (*ChatEventMessageAutoDeleteTimeChanged, error) { - var resp ChatEventMessageAutoDeleteTimeChanged - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEventPermissionsChanged(data json.RawMessage) (*ChatEventPermissionsChanged, error) { - var resp ChatEventPermissionsChanged - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEventPhotoChanged(data json.RawMessage) (*ChatEventPhotoChanged, error) { - var resp ChatEventPhotoChanged - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEventSlowModeDelayChanged(data json.RawMessage) (*ChatEventSlowModeDelayChanged, error) { - var resp ChatEventSlowModeDelayChanged - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEventStickerSetChanged(data json.RawMessage) (*ChatEventStickerSetChanged, error) { - var resp ChatEventStickerSetChanged - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEventTitleChanged(data json.RawMessage) (*ChatEventTitleChanged, error) { - var resp ChatEventTitleChanged - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEventUsernameChanged(data json.RawMessage) (*ChatEventUsernameChanged, error) { - var resp ChatEventUsernameChanged - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEventActiveUsernamesChanged(data json.RawMessage) (*ChatEventActiveUsernamesChanged, error) { - var resp ChatEventActiveUsernamesChanged - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEventHasProtectedContentToggled(data json.RawMessage) (*ChatEventHasProtectedContentToggled, error) { - var resp ChatEventHasProtectedContentToggled - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEventInvitesToggled(data json.RawMessage) (*ChatEventInvitesToggled, error) { - var resp ChatEventInvitesToggled - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEventIsAllHistoryAvailableToggled(data json.RawMessage) (*ChatEventIsAllHistoryAvailableToggled, error) { - var resp ChatEventIsAllHistoryAvailableToggled - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEventHasAggressiveAntiSpamEnabledToggled(data json.RawMessage) (*ChatEventHasAggressiveAntiSpamEnabledToggled, error) { - var resp ChatEventHasAggressiveAntiSpamEnabledToggled - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEventSignMessagesToggled(data json.RawMessage) (*ChatEventSignMessagesToggled, error) { - var resp ChatEventSignMessagesToggled - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEventInviteLinkEdited(data json.RawMessage) (*ChatEventInviteLinkEdited, error) { - var resp ChatEventInviteLinkEdited - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEventInviteLinkRevoked(data json.RawMessage) (*ChatEventInviteLinkRevoked, error) { - var resp ChatEventInviteLinkRevoked - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEventInviteLinkDeleted(data json.RawMessage) (*ChatEventInviteLinkDeleted, error) { - var resp ChatEventInviteLinkDeleted - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEventVideoChatCreated(data json.RawMessage) (*ChatEventVideoChatCreated, error) { - var resp ChatEventVideoChatCreated - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEventVideoChatEnded(data json.RawMessage) (*ChatEventVideoChatEnded, error) { - var resp ChatEventVideoChatEnded - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEventVideoChatMuteNewParticipantsToggled(data json.RawMessage) (*ChatEventVideoChatMuteNewParticipantsToggled, error) { - var resp ChatEventVideoChatMuteNewParticipantsToggled - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEventVideoChatParticipantIsMutedToggled(data json.RawMessage) (*ChatEventVideoChatParticipantIsMutedToggled, error) { - var resp ChatEventVideoChatParticipantIsMutedToggled - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEventVideoChatParticipantVolumeLevelChanged(data json.RawMessage) (*ChatEventVideoChatParticipantVolumeLevelChanged, error) { - var resp ChatEventVideoChatParticipantVolumeLevelChanged - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEventIsForumToggled(data json.RawMessage) (*ChatEventIsForumToggled, error) { - var resp ChatEventIsForumToggled - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEventForumTopicCreated(data json.RawMessage) (*ChatEventForumTopicCreated, error) { - var resp ChatEventForumTopicCreated - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEventForumTopicEdited(data json.RawMessage) (*ChatEventForumTopicEdited, error) { - var resp ChatEventForumTopicEdited - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEventForumTopicToggleIsClosed(data json.RawMessage) (*ChatEventForumTopicToggleIsClosed, error) { - var resp ChatEventForumTopicToggleIsClosed - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEventForumTopicToggleIsHidden(data json.RawMessage) (*ChatEventForumTopicToggleIsHidden, error) { - var resp ChatEventForumTopicToggleIsHidden - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEventForumTopicDeleted(data json.RawMessage) (*ChatEventForumTopicDeleted, error) { - var resp ChatEventForumTopicDeleted - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEventForumTopicPinned(data json.RawMessage) (*ChatEventForumTopicPinned, error) { - var resp ChatEventForumTopicPinned - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEvent(data json.RawMessage) (*ChatEvent, error) { - var resp ChatEvent - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEvents(data json.RawMessage) (*ChatEvents, error) { - var resp ChatEvents - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatEventLogFilters(data json.RawMessage) (*ChatEventLogFilters, error) { - var resp ChatEventLogFilters - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalLanguagePackStringValueOrdinary(data json.RawMessage) (*LanguagePackStringValueOrdinary, error) { - var resp LanguagePackStringValueOrdinary - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalLanguagePackStringValuePluralized(data json.RawMessage) (*LanguagePackStringValuePluralized, error) { - var resp LanguagePackStringValuePluralized - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalLanguagePackStringValueDeleted(data json.RawMessage) (*LanguagePackStringValueDeleted, error) { - var resp LanguagePackStringValueDeleted - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalLanguagePackString(data json.RawMessage) (*LanguagePackString, error) { - var resp LanguagePackString - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalLanguagePackStrings(data json.RawMessage) (*LanguagePackStrings, error) { - var resp LanguagePackStrings - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalLanguagePackInfo(data json.RawMessage) (*LanguagePackInfo, error) { - var resp LanguagePackInfo - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalLocalizationTargetInfo(data json.RawMessage) (*LocalizationTargetInfo, error) { - var resp LocalizationTargetInfo - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPremiumLimitTypeSupergroupCount(data json.RawMessage) (*PremiumLimitTypeSupergroupCount, error) { - var resp PremiumLimitTypeSupergroupCount - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPremiumLimitTypePinnedChatCount(data json.RawMessage) (*PremiumLimitTypePinnedChatCount, error) { - var resp PremiumLimitTypePinnedChatCount - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPremiumLimitTypeCreatedPublicChatCount(data json.RawMessage) (*PremiumLimitTypeCreatedPublicChatCount, error) { - var resp PremiumLimitTypeCreatedPublicChatCount - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPremiumLimitTypeSavedAnimationCount(data json.RawMessage) (*PremiumLimitTypeSavedAnimationCount, error) { - var resp PremiumLimitTypeSavedAnimationCount - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPremiumLimitTypeFavoriteStickerCount(data json.RawMessage) (*PremiumLimitTypeFavoriteStickerCount, error) { - var resp PremiumLimitTypeFavoriteStickerCount - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPremiumLimitTypeChatFilterCount(data json.RawMessage) (*PremiumLimitTypeChatFilterCount, error) { - var resp PremiumLimitTypeChatFilterCount - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPremiumLimitTypeChatFilterChosenChatCount(data json.RawMessage) (*PremiumLimitTypeChatFilterChosenChatCount, error) { - var resp PremiumLimitTypeChatFilterChosenChatCount - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPremiumLimitTypePinnedArchivedChatCount(data json.RawMessage) (*PremiumLimitTypePinnedArchivedChatCount, error) { - var resp PremiumLimitTypePinnedArchivedChatCount - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPremiumLimitTypeCaptionLength(data json.RawMessage) (*PremiumLimitTypeCaptionLength, error) { - var resp PremiumLimitTypeCaptionLength - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPremiumLimitTypeBioLength(data json.RawMessage) (*PremiumLimitTypeBioLength, error) { - var resp PremiumLimitTypeBioLength - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPremiumFeatureIncreasedLimits(data json.RawMessage) (*PremiumFeatureIncreasedLimits, error) { - var resp PremiumFeatureIncreasedLimits - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPremiumFeatureIncreasedUploadFileSize(data json.RawMessage) (*PremiumFeatureIncreasedUploadFileSize, error) { - var resp PremiumFeatureIncreasedUploadFileSize - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPremiumFeatureImprovedDownloadSpeed(data json.RawMessage) (*PremiumFeatureImprovedDownloadSpeed, error) { - var resp PremiumFeatureImprovedDownloadSpeed - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPremiumFeatureVoiceRecognition(data json.RawMessage) (*PremiumFeatureVoiceRecognition, error) { - var resp PremiumFeatureVoiceRecognition - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPremiumFeatureDisabledAds(data json.RawMessage) (*PremiumFeatureDisabledAds, error) { - var resp PremiumFeatureDisabledAds - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPremiumFeatureUniqueReactions(data json.RawMessage) (*PremiumFeatureUniqueReactions, error) { - var resp PremiumFeatureUniqueReactions - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPremiumFeatureUniqueStickers(data json.RawMessage) (*PremiumFeatureUniqueStickers, error) { - var resp PremiumFeatureUniqueStickers - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPremiumFeatureCustomEmoji(data json.RawMessage) (*PremiumFeatureCustomEmoji, error) { - var resp PremiumFeatureCustomEmoji - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPremiumFeatureAdvancedChatManagement(data json.RawMessage) (*PremiumFeatureAdvancedChatManagement, error) { - var resp PremiumFeatureAdvancedChatManagement - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPremiumFeatureProfileBadge(data json.RawMessage) (*PremiumFeatureProfileBadge, error) { - var resp PremiumFeatureProfileBadge - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPremiumFeatureEmojiStatus(data json.RawMessage) (*PremiumFeatureEmojiStatus, error) { - var resp PremiumFeatureEmojiStatus - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPremiumFeatureAnimatedProfilePhoto(data json.RawMessage) (*PremiumFeatureAnimatedProfilePhoto, error) { - var resp PremiumFeatureAnimatedProfilePhoto - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPremiumFeatureForumTopicIcon(data json.RawMessage) (*PremiumFeatureForumTopicIcon, error) { - var resp PremiumFeatureForumTopicIcon - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPremiumFeatureAppIcons(data json.RawMessage) (*PremiumFeatureAppIcons, error) { - var resp PremiumFeatureAppIcons - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPremiumLimit(data json.RawMessage) (*PremiumLimit, error) { - var resp PremiumLimit - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPremiumFeatures(data json.RawMessage) (*PremiumFeatures, error) { - var resp PremiumFeatures - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPremiumSourceLimitExceeded(data json.RawMessage) (*PremiumSourceLimitExceeded, error) { - var resp PremiumSourceLimitExceeded - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPremiumSourceFeature(data json.RawMessage) (*PremiumSourceFeature, error) { - var resp PremiumSourceFeature - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPremiumSourceLink(data json.RawMessage) (*PremiumSourceLink, error) { - var resp PremiumSourceLink - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPremiumSourceSettings(data json.RawMessage) (*PremiumSourceSettings, error) { - var resp PremiumSourceSettings - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPremiumFeaturePromotionAnimation(data json.RawMessage) (*PremiumFeaturePromotionAnimation, error) { - var resp PremiumFeaturePromotionAnimation - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPremiumState(data json.RawMessage) (*PremiumState, error) { - var resp PremiumState - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalStorePaymentPurposePremiumSubscription(data json.RawMessage) (*StorePaymentPurposePremiumSubscription, error) { - var resp StorePaymentPurposePremiumSubscription - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalStorePaymentPurposeGiftedPremium(data json.RawMessage) (*StorePaymentPurposeGiftedPremium, error) { - var resp StorePaymentPurposeGiftedPremium - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalDeviceTokenFirebaseCloudMessaging(data json.RawMessage) (*DeviceTokenFirebaseCloudMessaging, error) { - var resp DeviceTokenFirebaseCloudMessaging - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalDeviceTokenApplePush(data json.RawMessage) (*DeviceTokenApplePush, error) { - var resp DeviceTokenApplePush - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalDeviceTokenApplePushVoIP(data json.RawMessage) (*DeviceTokenApplePushVoIP, error) { - var resp DeviceTokenApplePushVoIP - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalDeviceTokenWindowsPush(data json.RawMessage) (*DeviceTokenWindowsPush, error) { - var resp DeviceTokenWindowsPush - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalDeviceTokenMicrosoftPush(data json.RawMessage) (*DeviceTokenMicrosoftPush, error) { - var resp DeviceTokenMicrosoftPush - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalDeviceTokenMicrosoftPushVoIP(data json.RawMessage) (*DeviceTokenMicrosoftPushVoIP, error) { - var resp DeviceTokenMicrosoftPushVoIP - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalDeviceTokenWebPush(data json.RawMessage) (*DeviceTokenWebPush, error) { - var resp DeviceTokenWebPush - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalDeviceTokenSimplePush(data json.RawMessage) (*DeviceTokenSimplePush, error) { - var resp DeviceTokenSimplePush - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalDeviceTokenUbuntuPush(data json.RawMessage) (*DeviceTokenUbuntuPush, error) { - var resp DeviceTokenUbuntuPush - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalDeviceTokenBlackBerryPush(data json.RawMessage) (*DeviceTokenBlackBerryPush, error) { - var resp DeviceTokenBlackBerryPush - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalDeviceTokenTizenPush(data json.RawMessage) (*DeviceTokenTizenPush, error) { - var resp DeviceTokenTizenPush - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPushReceiverId(data json.RawMessage) (*PushReceiverId, error) { - var resp PushReceiverId - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalBackgroundFillSolid(data json.RawMessage) (*BackgroundFillSolid, error) { - var resp BackgroundFillSolid - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalBackgroundFillGradient(data json.RawMessage) (*BackgroundFillGradient, error) { - var resp BackgroundFillGradient - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalBackgroundFillFreeformGradient(data json.RawMessage) (*BackgroundFillFreeformGradient, error) { - var resp BackgroundFillFreeformGradient - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalBackgroundTypeWallpaper(data json.RawMessage) (*BackgroundTypeWallpaper, error) { - var resp BackgroundTypeWallpaper - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalBackgroundTypePattern(data json.RawMessage) (*BackgroundTypePattern, error) { - var resp BackgroundTypePattern - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalBackgroundTypeFill(data json.RawMessage) (*BackgroundTypeFill, error) { - var resp BackgroundTypeFill - - err := json.Unmarshal(data, &resp) - - return &resp, err + return &resp, err } func UnmarshalBackground(data json.RawMessage) (*Background, error) { - var resp Background + var resp Background - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalBackgrounds(data json.RawMessage) (*Backgrounds, error) { - var resp Backgrounds + var resp Backgrounds - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err +} + +func UnmarshalChatBackground(data json.RawMessage) (*ChatBackground, error) { + var resp ChatBackground + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalProfilePhoto(data json.RawMessage) (*ProfilePhoto, error) { + var resp ProfilePhoto + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatPhotoInfo(data json.RawMessage) (*ChatPhotoInfo, error) { + var resp ChatPhotoInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUserTypeRegular(data json.RawMessage) (*UserTypeRegular, error) { + var resp UserTypeRegular + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUserTypeDeleted(data json.RawMessage) (*UserTypeDeleted, error) { + var resp UserTypeDeleted + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUserTypeBot(data json.RawMessage) (*UserTypeBot, error) { + var resp UserTypeBot + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUserTypeUnknown(data json.RawMessage) (*UserTypeUnknown, error) { + var resp UserTypeUnknown + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBotCommand(data json.RawMessage) (*BotCommand, error) { + var resp BotCommand + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBotCommands(data json.RawMessage) (*BotCommands, error) { + var resp BotCommands + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBotMenuButton(data json.RawMessage) (*BotMenuButton, error) { + var resp BotMenuButton + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatLocation(data json.RawMessage) (*ChatLocation, error) { + var resp ChatLocation + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBirthdate(data json.RawMessage) (*Birthdate, error) { + var resp Birthdate + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCloseBirthdayUser(data json.RawMessage) (*CloseBirthdayUser, error) { + var resp CloseBirthdayUser + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBusinessAwayMessageScheduleAlways(data json.RawMessage) (*BusinessAwayMessageScheduleAlways, error) { + var resp BusinessAwayMessageScheduleAlways + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBusinessAwayMessageScheduleOutsideOfOpeningHours(data json.RawMessage) (*BusinessAwayMessageScheduleOutsideOfOpeningHours, error) { + var resp BusinessAwayMessageScheduleOutsideOfOpeningHours + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBusinessAwayMessageScheduleCustom(data json.RawMessage) (*BusinessAwayMessageScheduleCustom, error) { + var resp BusinessAwayMessageScheduleCustom + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBusinessLocation(data json.RawMessage) (*BusinessLocation, error) { + var resp BusinessLocation + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBusinessRecipients(data json.RawMessage) (*BusinessRecipients, error) { + var resp BusinessRecipients + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBusinessAwayMessageSettings(data json.RawMessage) (*BusinessAwayMessageSettings, error) { + var resp BusinessAwayMessageSettings + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBusinessGreetingMessageSettings(data json.RawMessage) (*BusinessGreetingMessageSettings, error) { + var resp BusinessGreetingMessageSettings + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBusinessConnectedBot(data json.RawMessage) (*BusinessConnectedBot, error) { + var resp BusinessConnectedBot + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBusinessIntro(data json.RawMessage) (*BusinessIntro, error) { + var resp BusinessIntro + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputBusinessIntro(data json.RawMessage) (*InputBusinessIntro, error) { + var resp InputBusinessIntro + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBusinessOpeningHoursInterval(data json.RawMessage) (*BusinessOpeningHoursInterval, error) { + var resp BusinessOpeningHoursInterval + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBusinessOpeningHours(data json.RawMessage) (*BusinessOpeningHours, error) { + var resp BusinessOpeningHours + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBusinessInfo(data json.RawMessage) (*BusinessInfo, error) { + var resp BusinessInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatPhotoStickerTypeRegularOrMask(data json.RawMessage) (*ChatPhotoStickerTypeRegularOrMask, error) { + var resp ChatPhotoStickerTypeRegularOrMask + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatPhotoStickerTypeCustomEmoji(data json.RawMessage) (*ChatPhotoStickerTypeCustomEmoji, error) { + var resp ChatPhotoStickerTypeCustomEmoji + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatPhotoSticker(data json.RawMessage) (*ChatPhotoSticker, error) { + var resp ChatPhotoSticker + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalAnimatedChatPhoto(data json.RawMessage) (*AnimatedChatPhoto, error) { + var resp AnimatedChatPhoto + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatPhoto(data json.RawMessage) (*ChatPhoto, error) { + var resp ChatPhoto + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatPhotos(data json.RawMessage) (*ChatPhotos, error) { + var resp ChatPhotos + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputChatPhotoPrevious(data json.RawMessage) (*InputChatPhotoPrevious, error) { + var resp InputChatPhotoPrevious + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputChatPhotoStatic(data json.RawMessage) (*InputChatPhotoStatic, error) { + var resp InputChatPhotoStatic + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputChatPhotoAnimation(data json.RawMessage) (*InputChatPhotoAnimation, error) { + var resp InputChatPhotoAnimation + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputChatPhotoSticker(data json.RawMessage) (*InputChatPhotoSticker, error) { + var resp InputChatPhotoSticker + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatPermissions(data json.RawMessage) (*ChatPermissions, error) { + var resp ChatPermissions + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatAdministratorRights(data json.RawMessage) (*ChatAdministratorRights, error) { + var resp ChatAdministratorRights + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumPaymentOption(data json.RawMessage) (*PremiumPaymentOption, error) { + var resp PremiumPaymentOption + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumStatePaymentOption(data json.RawMessage) (*PremiumStatePaymentOption, error) { + var resp PremiumStatePaymentOption + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumGiftCodePaymentOption(data json.RawMessage) (*PremiumGiftCodePaymentOption, error) { + var resp PremiumGiftCodePaymentOption + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumGiftCodePaymentOptions(data json.RawMessage) (*PremiumGiftCodePaymentOptions, error) { + var resp PremiumGiftCodePaymentOptions + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumGiftCodeInfo(data json.RawMessage) (*PremiumGiftCodeInfo, error) { + var resp PremiumGiftCodeInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumGiveawayParticipantStatusEligible(data json.RawMessage) (*PremiumGiveawayParticipantStatusEligible, error) { + var resp PremiumGiveawayParticipantStatusEligible + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumGiveawayParticipantStatusParticipating(data json.RawMessage) (*PremiumGiveawayParticipantStatusParticipating, error) { + var resp PremiumGiveawayParticipantStatusParticipating + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumGiveawayParticipantStatusAlreadyWasMember(data json.RawMessage) (*PremiumGiveawayParticipantStatusAlreadyWasMember, error) { + var resp PremiumGiveawayParticipantStatusAlreadyWasMember + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumGiveawayParticipantStatusAdministrator(data json.RawMessage) (*PremiumGiveawayParticipantStatusAdministrator, error) { + var resp PremiumGiveawayParticipantStatusAdministrator + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumGiveawayParticipantStatusDisallowedCountry(data json.RawMessage) (*PremiumGiveawayParticipantStatusDisallowedCountry, error) { + var resp PremiumGiveawayParticipantStatusDisallowedCountry + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumGiveawayInfoOngoing(data json.RawMessage) (*PremiumGiveawayInfoOngoing, error) { + var resp PremiumGiveawayInfoOngoing + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumGiveawayInfoCompleted(data json.RawMessage) (*PremiumGiveawayInfoCompleted, error) { + var resp PremiumGiveawayInfoCompleted + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalAccentColor(data json.RawMessage) (*AccentColor, error) { + var resp AccentColor + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalProfileAccentColors(data json.RawMessage) (*ProfileAccentColors, error) { + var resp ProfileAccentColors + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalProfileAccentColor(data json.RawMessage) (*ProfileAccentColor, error) { + var resp ProfileAccentColor + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalEmojiStatus(data json.RawMessage) (*EmojiStatus, error) { + var resp EmojiStatus + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalEmojiStatuses(data json.RawMessage) (*EmojiStatuses, error) { + var resp EmojiStatuses + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUsernames(data json.RawMessage) (*Usernames, error) { + var resp Usernames + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUser(data json.RawMessage) (*User, error) { + var resp User + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBotInfo(data json.RawMessage) (*BotInfo, error) { + var resp BotInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUserFullInfo(data json.RawMessage) (*UserFullInfo, error) { + var resp UserFullInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUsers(data json.RawMessage) (*Users, error) { + var resp Users + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatAdministrator(data json.RawMessage) (*ChatAdministrator, error) { + var resp ChatAdministrator + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatAdministrators(data json.RawMessage) (*ChatAdministrators, error) { + var resp ChatAdministrators + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatMemberStatusCreator(data json.RawMessage) (*ChatMemberStatusCreator, error) { + var resp ChatMemberStatusCreator + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatMemberStatusAdministrator(data json.RawMessage) (*ChatMemberStatusAdministrator, error) { + var resp ChatMemberStatusAdministrator + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatMemberStatusMember(data json.RawMessage) (*ChatMemberStatusMember, error) { + var resp ChatMemberStatusMember + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatMemberStatusRestricted(data json.RawMessage) (*ChatMemberStatusRestricted, error) { + var resp ChatMemberStatusRestricted + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatMemberStatusLeft(data json.RawMessage) (*ChatMemberStatusLeft, error) { + var resp ChatMemberStatusLeft + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatMemberStatusBanned(data json.RawMessage) (*ChatMemberStatusBanned, error) { + var resp ChatMemberStatusBanned + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatMember(data json.RawMessage) (*ChatMember, error) { + var resp ChatMember + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatMembers(data json.RawMessage) (*ChatMembers, error) { + var resp ChatMembers + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatMembersFilterContacts(data json.RawMessage) (*ChatMembersFilterContacts, error) { + var resp ChatMembersFilterContacts + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatMembersFilterAdministrators(data json.RawMessage) (*ChatMembersFilterAdministrators, error) { + var resp ChatMembersFilterAdministrators + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatMembersFilterMembers(data json.RawMessage) (*ChatMembersFilterMembers, error) { + var resp ChatMembersFilterMembers + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatMembersFilterMention(data json.RawMessage) (*ChatMembersFilterMention, error) { + var resp ChatMembersFilterMention + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatMembersFilterRestricted(data json.RawMessage) (*ChatMembersFilterRestricted, error) { + var resp ChatMembersFilterRestricted + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatMembersFilterBanned(data json.RawMessage) (*ChatMembersFilterBanned, error) { + var resp ChatMembersFilterBanned + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatMembersFilterBots(data json.RawMessage) (*ChatMembersFilterBots, error) { + var resp ChatMembersFilterBots + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSupergroupMembersFilterRecent(data json.RawMessage) (*SupergroupMembersFilterRecent, error) { + var resp SupergroupMembersFilterRecent + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSupergroupMembersFilterContacts(data json.RawMessage) (*SupergroupMembersFilterContacts, error) { + var resp SupergroupMembersFilterContacts + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSupergroupMembersFilterAdministrators(data json.RawMessage) (*SupergroupMembersFilterAdministrators, error) { + var resp SupergroupMembersFilterAdministrators + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSupergroupMembersFilterSearch(data json.RawMessage) (*SupergroupMembersFilterSearch, error) { + var resp SupergroupMembersFilterSearch + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSupergroupMembersFilterRestricted(data json.RawMessage) (*SupergroupMembersFilterRestricted, error) { + var resp SupergroupMembersFilterRestricted + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSupergroupMembersFilterBanned(data json.RawMessage) (*SupergroupMembersFilterBanned, error) { + var resp SupergroupMembersFilterBanned + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSupergroupMembersFilterMention(data json.RawMessage) (*SupergroupMembersFilterMention, error) { + var resp SupergroupMembersFilterMention + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSupergroupMembersFilterBots(data json.RawMessage) (*SupergroupMembersFilterBots, error) { + var resp SupergroupMembersFilterBots + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatInviteLink(data json.RawMessage) (*ChatInviteLink, error) { + var resp ChatInviteLink + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatInviteLinks(data json.RawMessage) (*ChatInviteLinks, error) { + var resp ChatInviteLinks + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatInviteLinkCount(data json.RawMessage) (*ChatInviteLinkCount, error) { + var resp ChatInviteLinkCount + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatInviteLinkCounts(data json.RawMessage) (*ChatInviteLinkCounts, error) { + var resp ChatInviteLinkCounts + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatInviteLinkMember(data json.RawMessage) (*ChatInviteLinkMember, error) { + var resp ChatInviteLinkMember + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatInviteLinkMembers(data json.RawMessage) (*ChatInviteLinkMembers, error) { + var resp ChatInviteLinkMembers + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInviteLinkChatTypeBasicGroup(data json.RawMessage) (*InviteLinkChatTypeBasicGroup, error) { + var resp InviteLinkChatTypeBasicGroup + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInviteLinkChatTypeSupergroup(data json.RawMessage) (*InviteLinkChatTypeSupergroup, error) { + var resp InviteLinkChatTypeSupergroup + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInviteLinkChatTypeChannel(data json.RawMessage) (*InviteLinkChatTypeChannel, error) { + var resp InviteLinkChatTypeChannel + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatInviteLinkInfo(data json.RawMessage) (*ChatInviteLinkInfo, error) { + var resp ChatInviteLinkInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatJoinRequest(data json.RawMessage) (*ChatJoinRequest, error) { + var resp ChatJoinRequest + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatJoinRequests(data json.RawMessage) (*ChatJoinRequests, error) { + var resp ChatJoinRequests + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatJoinRequestsInfo(data json.RawMessage) (*ChatJoinRequestsInfo, error) { + var resp ChatJoinRequestsInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBasicGroup(data json.RawMessage) (*BasicGroup, error) { + var resp BasicGroup + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBasicGroupFullInfo(data json.RawMessage) (*BasicGroupFullInfo, error) { + var resp BasicGroupFullInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSupergroup(data json.RawMessage) (*Supergroup, error) { + var resp Supergroup + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSupergroupFullInfo(data json.RawMessage) (*SupergroupFullInfo, error) { + var resp SupergroupFullInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSecretChatStatePending(data json.RawMessage) (*SecretChatStatePending, error) { + var resp SecretChatStatePending + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSecretChatStateReady(data json.RawMessage) (*SecretChatStateReady, error) { + var resp SecretChatStateReady + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSecretChatStateClosed(data json.RawMessage) (*SecretChatStateClosed, error) { + var resp SecretChatStateClosed + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSecretChat(data json.RawMessage) (*SecretChat, error) { + var resp SecretChat + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageSenderUser(data json.RawMessage) (*MessageSenderUser, error) { + var resp MessageSenderUser + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageSenderChat(data json.RawMessage) (*MessageSenderChat, error) { + var resp MessageSenderChat + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageSenders(data json.RawMessage) (*MessageSenders, error) { + var resp MessageSenders + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatMessageSender(data json.RawMessage) (*ChatMessageSender, error) { + var resp ChatMessageSender + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatMessageSenders(data json.RawMessage) (*ChatMessageSenders, error) { + var resp ChatMessageSenders + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageReadDateRead(data json.RawMessage) (*MessageReadDateRead, error) { + var resp MessageReadDateRead + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageReadDateUnread(data json.RawMessage) (*MessageReadDateUnread, error) { + var resp MessageReadDateUnread + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageReadDateTooOld(data json.RawMessage) (*MessageReadDateTooOld, error) { + var resp MessageReadDateTooOld + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageReadDateUserPrivacyRestricted(data json.RawMessage) (*MessageReadDateUserPrivacyRestricted, error) { + var resp MessageReadDateUserPrivacyRestricted + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageReadDateMyPrivacyRestricted(data json.RawMessage) (*MessageReadDateMyPrivacyRestricted, error) { + var resp MessageReadDateMyPrivacyRestricted + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageViewer(data json.RawMessage) (*MessageViewer, error) { + var resp MessageViewer + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageViewers(data json.RawMessage) (*MessageViewers, error) { + var resp MessageViewers + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageOriginUser(data json.RawMessage) (*MessageOriginUser, error) { + var resp MessageOriginUser + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageOriginHiddenUser(data json.RawMessage) (*MessageOriginHiddenUser, error) { + var resp MessageOriginHiddenUser + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageOriginChat(data json.RawMessage) (*MessageOriginChat, error) { + var resp MessageOriginChat + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageOriginChannel(data json.RawMessage) (*MessageOriginChannel, error) { + var resp MessageOriginChannel + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalForwardSource(data json.RawMessage) (*ForwardSource, error) { + var resp ForwardSource + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalReactionTypeEmoji(data json.RawMessage) (*ReactionTypeEmoji, error) { + var resp ReactionTypeEmoji + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalReactionTypeCustomEmoji(data json.RawMessage) (*ReactionTypeCustomEmoji, error) { + var resp ReactionTypeCustomEmoji + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageForwardInfo(data json.RawMessage) (*MessageForwardInfo, error) { + var resp MessageForwardInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageImportInfo(data json.RawMessage) (*MessageImportInfo, error) { + var resp MessageImportInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageReplyInfo(data json.RawMessage) (*MessageReplyInfo, error) { + var resp MessageReplyInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageReaction(data json.RawMessage) (*MessageReaction, error) { + var resp MessageReaction + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageReactions(data json.RawMessage) (*MessageReactions, error) { + var resp MessageReactions + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageInteractionInfo(data json.RawMessage) (*MessageInteractionInfo, error) { + var resp MessageInteractionInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUnreadReaction(data json.RawMessage) (*UnreadReaction, error) { + var resp UnreadReaction + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageSendingStatePending(data json.RawMessage) (*MessageSendingStatePending, error) { + var resp MessageSendingStatePending + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageSendingStateFailed(data json.RawMessage) (*MessageSendingStateFailed, error) { + var resp MessageSendingStateFailed + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTextQuote(data json.RawMessage) (*TextQuote, error) { + var resp TextQuote + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputTextQuote(data json.RawMessage) (*InputTextQuote, error) { + var resp InputTextQuote + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageReplyToMessage(data json.RawMessage) (*MessageReplyToMessage, error) { + var resp MessageReplyToMessage + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageReplyToStory(data json.RawMessage) (*MessageReplyToStory, error) { + var resp MessageReplyToStory + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputMessageReplyToMessage(data json.RawMessage) (*InputMessageReplyToMessage, error) { + var resp InputMessageReplyToMessage + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputMessageReplyToStory(data json.RawMessage) (*InputMessageReplyToStory, error) { + var resp InputMessageReplyToStory + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessage(data json.RawMessage) (*Message, error) { + var resp Message + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessages(data json.RawMessage) (*Messages, error) { + var resp Messages + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalFoundMessages(data json.RawMessage) (*FoundMessages, error) { + var resp FoundMessages + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalFoundChatMessages(data json.RawMessage) (*FoundChatMessages, error) { + var resp FoundChatMessages + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessagePosition(data json.RawMessage) (*MessagePosition, error) { + var resp MessagePosition + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessagePositions(data json.RawMessage) (*MessagePositions, error) { + var resp MessagePositions + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageCalendarDay(data json.RawMessage) (*MessageCalendarDay, error) { + var resp MessageCalendarDay + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageCalendar(data json.RawMessage) (*MessageCalendar, error) { + var resp MessageCalendar + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBusinessMessage(data json.RawMessage) (*BusinessMessage, error) { + var resp BusinessMessage + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBusinessMessages(data json.RawMessage) (*BusinessMessages, error) { + var resp BusinessMessages + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageSourceChatHistory(data json.RawMessage) (*MessageSourceChatHistory, error) { + var resp MessageSourceChatHistory + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageSourceMessageThreadHistory(data json.RawMessage) (*MessageSourceMessageThreadHistory, error) { + var resp MessageSourceMessageThreadHistory + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageSourceForumTopicHistory(data json.RawMessage) (*MessageSourceForumTopicHistory, error) { + var resp MessageSourceForumTopicHistory + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageSourceHistoryPreview(data json.RawMessage) (*MessageSourceHistoryPreview, error) { + var resp MessageSourceHistoryPreview + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageSourceChatList(data json.RawMessage) (*MessageSourceChatList, error) { + var resp MessageSourceChatList + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageSourceSearch(data json.RawMessage) (*MessageSourceSearch, error) { + var resp MessageSourceSearch + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageSourceChatEventLog(data json.RawMessage) (*MessageSourceChatEventLog, error) { + var resp MessageSourceChatEventLog + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageSourceNotification(data json.RawMessage) (*MessageSourceNotification, error) { + var resp MessageSourceNotification + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageSourceScreenshot(data json.RawMessage) (*MessageSourceScreenshot, error) { + var resp MessageSourceScreenshot + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageSourceOther(data json.RawMessage) (*MessageSourceOther, error) { + var resp MessageSourceOther + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageSponsorTypeBot(data json.RawMessage) (*MessageSponsorTypeBot, error) { + var resp MessageSponsorTypeBot + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageSponsorTypeWebApp(data json.RawMessage) (*MessageSponsorTypeWebApp, error) { + var resp MessageSponsorTypeWebApp + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageSponsorTypePublicChannel(data json.RawMessage) (*MessageSponsorTypePublicChannel, error) { + var resp MessageSponsorTypePublicChannel + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageSponsorTypePrivateChannel(data json.RawMessage) (*MessageSponsorTypePrivateChannel, error) { + var resp MessageSponsorTypePrivateChannel + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageSponsorTypeWebsite(data json.RawMessage) (*MessageSponsorTypeWebsite, error) { + var resp MessageSponsorTypeWebsite + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageSponsor(data json.RawMessage) (*MessageSponsor, error) { + var resp MessageSponsor + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSponsoredMessage(data json.RawMessage) (*SponsoredMessage, error) { + var resp SponsoredMessage + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSponsoredMessages(data json.RawMessage) (*SponsoredMessages, error) { + var resp SponsoredMessages + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalReportChatSponsoredMessageOption(data json.RawMessage) (*ReportChatSponsoredMessageOption, error) { + var resp ReportChatSponsoredMessageOption + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalReportChatSponsoredMessageResultOk(data json.RawMessage) (*ReportChatSponsoredMessageResultOk, error) { + var resp ReportChatSponsoredMessageResultOk + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalReportChatSponsoredMessageResultFailed(data json.RawMessage) (*ReportChatSponsoredMessageResultFailed, error) { + var resp ReportChatSponsoredMessageResultFailed + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalReportChatSponsoredMessageResultOptionRequired(data json.RawMessage) (*ReportChatSponsoredMessageResultOptionRequired, error) { + var resp ReportChatSponsoredMessageResultOptionRequired + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalReportChatSponsoredMessageResultAdsHidden(data json.RawMessage) (*ReportChatSponsoredMessageResultAdsHidden, error) { + var resp ReportChatSponsoredMessageResultAdsHidden + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalReportChatSponsoredMessageResultPremiumRequired(data json.RawMessage) (*ReportChatSponsoredMessageResultPremiumRequired, error) { + var resp ReportChatSponsoredMessageResultPremiumRequired + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalFileDownload(data json.RawMessage) (*FileDownload, error) { + var resp FileDownload + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalDownloadedFileCounts(data json.RawMessage) (*DownloadedFileCounts, error) { + var resp DownloadedFileCounts + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalFoundFileDownloads(data json.RawMessage) (*FoundFileDownloads, error) { + var resp FoundFileDownloads + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalNotificationSettingsScopePrivateChats(data json.RawMessage) (*NotificationSettingsScopePrivateChats, error) { + var resp NotificationSettingsScopePrivateChats + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalNotificationSettingsScopeGroupChats(data json.RawMessage) (*NotificationSettingsScopeGroupChats, error) { + var resp NotificationSettingsScopeGroupChats + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalNotificationSettingsScopeChannelChats(data json.RawMessage) (*NotificationSettingsScopeChannelChats, error) { + var resp NotificationSettingsScopeChannelChats + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatNotificationSettings(data json.RawMessage) (*ChatNotificationSettings, error) { + var resp ChatNotificationSettings + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalScopeNotificationSettings(data json.RawMessage) (*ScopeNotificationSettings, error) { + var resp ScopeNotificationSettings + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalDraftMessage(data json.RawMessage) (*DraftMessage, error) { + var resp DraftMessage + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatTypePrivate(data json.RawMessage) (*ChatTypePrivate, error) { + var resp ChatTypePrivate + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatTypeBasicGroup(data json.RawMessage) (*ChatTypeBasicGroup, error) { + var resp ChatTypeBasicGroup + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatTypeSupergroup(data json.RawMessage) (*ChatTypeSupergroup, error) { + var resp ChatTypeSupergroup + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatTypeSecret(data json.RawMessage) (*ChatTypeSecret, error) { + var resp ChatTypeSecret + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatFolderIcon(data json.RawMessage) (*ChatFolderIcon, error) { + var resp ChatFolderIcon + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatFolder(data json.RawMessage) (*ChatFolder, error) { + var resp ChatFolder + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatFolderInfo(data json.RawMessage) (*ChatFolderInfo, error) { + var resp ChatFolderInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatFolderInviteLink(data json.RawMessage) (*ChatFolderInviteLink, error) { + var resp ChatFolderInviteLink + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatFolderInviteLinks(data json.RawMessage) (*ChatFolderInviteLinks, error) { + var resp ChatFolderInviteLinks + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatFolderInviteLinkInfo(data json.RawMessage) (*ChatFolderInviteLinkInfo, error) { + var resp ChatFolderInviteLinkInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalRecommendedChatFolder(data json.RawMessage) (*RecommendedChatFolder, error) { + var resp RecommendedChatFolder + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalRecommendedChatFolders(data json.RawMessage) (*RecommendedChatFolders, error) { + var resp RecommendedChatFolders + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalArchiveChatListSettings(data json.RawMessage) (*ArchiveChatListSettings, error) { + var resp ArchiveChatListSettings + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatListMain(data json.RawMessage) (*ChatListMain, error) { + var resp ChatListMain + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatListArchive(data json.RawMessage) (*ChatListArchive, error) { + var resp ChatListArchive + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatListFolder(data json.RawMessage) (*ChatListFolder, error) { + var resp ChatListFolder + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatLists(data json.RawMessage) (*ChatLists, error) { + var resp ChatLists + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatSourceMtprotoProxy(data json.RawMessage) (*ChatSourceMtprotoProxy, error) { + var resp ChatSourceMtprotoProxy + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatSourcePublicServiceAnnouncement(data json.RawMessage) (*ChatSourcePublicServiceAnnouncement, error) { + var resp ChatSourcePublicServiceAnnouncement + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatPosition(data json.RawMessage) (*ChatPosition, error) { + var resp ChatPosition + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatAvailableReactionsAll(data json.RawMessage) (*ChatAvailableReactionsAll, error) { + var resp ChatAvailableReactionsAll + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatAvailableReactionsSome(data json.RawMessage) (*ChatAvailableReactionsSome, error) { + var resp ChatAvailableReactionsSome + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSavedMessagesTag(data json.RawMessage) (*SavedMessagesTag, error) { + var resp SavedMessagesTag + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSavedMessagesTags(data json.RawMessage) (*SavedMessagesTags, error) { + var resp SavedMessagesTags + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalVideoChat(data json.RawMessage) (*VideoChat, error) { + var resp VideoChat + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChat(data json.RawMessage) (*Chat, error) { + var resp Chat + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChats(data json.RawMessage) (*Chats, error) { + var resp Chats + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatNearby(data json.RawMessage) (*ChatNearby, error) { + var resp ChatNearby + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatsNearby(data json.RawMessage) (*ChatsNearby, error) { + var resp ChatsNearby + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPublicChatTypeHasUsername(data json.RawMessage) (*PublicChatTypeHasUsername, error) { + var resp PublicChatTypeHasUsername + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPublicChatTypeIsLocationBased(data json.RawMessage) (*PublicChatTypeIsLocationBased, error) { + var resp PublicChatTypeIsLocationBased + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatActionBarReportSpam(data json.RawMessage) (*ChatActionBarReportSpam, error) { + var resp ChatActionBarReportSpam + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatActionBarReportUnrelatedLocation(data json.RawMessage) (*ChatActionBarReportUnrelatedLocation, error) { + var resp ChatActionBarReportUnrelatedLocation + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatActionBarInviteMembers(data json.RawMessage) (*ChatActionBarInviteMembers, error) { + var resp ChatActionBarInviteMembers + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatActionBarReportAddBlock(data json.RawMessage) (*ChatActionBarReportAddBlock, error) { + var resp ChatActionBarReportAddBlock + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatActionBarAddContact(data json.RawMessage) (*ChatActionBarAddContact, error) { + var resp ChatActionBarAddContact + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatActionBarSharePhoneNumber(data json.RawMessage) (*ChatActionBarSharePhoneNumber, error) { + var resp ChatActionBarSharePhoneNumber + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatActionBarJoinRequest(data json.RawMessage) (*ChatActionBarJoinRequest, error) { + var resp ChatActionBarJoinRequest + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalKeyboardButtonTypeText(data json.RawMessage) (*KeyboardButtonTypeText, error) { + var resp KeyboardButtonTypeText + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalKeyboardButtonTypeRequestPhoneNumber(data json.RawMessage) (*KeyboardButtonTypeRequestPhoneNumber, error) { + var resp KeyboardButtonTypeRequestPhoneNumber + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalKeyboardButtonTypeRequestLocation(data json.RawMessage) (*KeyboardButtonTypeRequestLocation, error) { + var resp KeyboardButtonTypeRequestLocation + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalKeyboardButtonTypeRequestPoll(data json.RawMessage) (*KeyboardButtonTypeRequestPoll, error) { + var resp KeyboardButtonTypeRequestPoll + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalKeyboardButtonTypeRequestUsers(data json.RawMessage) (*KeyboardButtonTypeRequestUsers, error) { + var resp KeyboardButtonTypeRequestUsers + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalKeyboardButtonTypeRequestChat(data json.RawMessage) (*KeyboardButtonTypeRequestChat, error) { + var resp KeyboardButtonTypeRequestChat + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalKeyboardButtonTypeWebApp(data json.RawMessage) (*KeyboardButtonTypeWebApp, error) { + var resp KeyboardButtonTypeWebApp + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalKeyboardButton(data json.RawMessage) (*KeyboardButton, error) { + var resp KeyboardButton + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInlineKeyboardButtonTypeUrl(data json.RawMessage) (*InlineKeyboardButtonTypeUrl, error) { + var resp InlineKeyboardButtonTypeUrl + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInlineKeyboardButtonTypeLoginUrl(data json.RawMessage) (*InlineKeyboardButtonTypeLoginUrl, error) { + var resp InlineKeyboardButtonTypeLoginUrl + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInlineKeyboardButtonTypeWebApp(data json.RawMessage) (*InlineKeyboardButtonTypeWebApp, error) { + var resp InlineKeyboardButtonTypeWebApp + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInlineKeyboardButtonTypeCallback(data json.RawMessage) (*InlineKeyboardButtonTypeCallback, error) { + var resp InlineKeyboardButtonTypeCallback + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInlineKeyboardButtonTypeCallbackWithPassword(data json.RawMessage) (*InlineKeyboardButtonTypeCallbackWithPassword, error) { + var resp InlineKeyboardButtonTypeCallbackWithPassword + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInlineKeyboardButtonTypeCallbackGame(data json.RawMessage) (*InlineKeyboardButtonTypeCallbackGame, error) { + var resp InlineKeyboardButtonTypeCallbackGame + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInlineKeyboardButtonTypeSwitchInline(data json.RawMessage) (*InlineKeyboardButtonTypeSwitchInline, error) { + var resp InlineKeyboardButtonTypeSwitchInline + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInlineKeyboardButtonTypeBuy(data json.RawMessage) (*InlineKeyboardButtonTypeBuy, error) { + var resp InlineKeyboardButtonTypeBuy + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInlineKeyboardButtonTypeUser(data json.RawMessage) (*InlineKeyboardButtonTypeUser, error) { + var resp InlineKeyboardButtonTypeUser + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInlineKeyboardButton(data json.RawMessage) (*InlineKeyboardButton, error) { + var resp InlineKeyboardButton + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalReplyMarkupRemoveKeyboard(data json.RawMessage) (*ReplyMarkupRemoveKeyboard, error) { + var resp ReplyMarkupRemoveKeyboard + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalReplyMarkupForceReply(data json.RawMessage) (*ReplyMarkupForceReply, error) { + var resp ReplyMarkupForceReply + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalReplyMarkupShowKeyboard(data json.RawMessage) (*ReplyMarkupShowKeyboard, error) { + var resp ReplyMarkupShowKeyboard + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalReplyMarkupInlineKeyboard(data json.RawMessage) (*ReplyMarkupInlineKeyboard, error) { + var resp ReplyMarkupInlineKeyboard + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalLoginUrlInfoOpen(data json.RawMessage) (*LoginUrlInfoOpen, error) { + var resp LoginUrlInfoOpen + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalLoginUrlInfoRequestConfirmation(data json.RawMessage) (*LoginUrlInfoRequestConfirmation, error) { + var resp LoginUrlInfoRequestConfirmation + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalFoundWebApp(data json.RawMessage) (*FoundWebApp, error) { + var resp FoundWebApp + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalWebAppInfo(data json.RawMessage) (*WebAppInfo, error) { + var resp WebAppInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageThreadInfo(data json.RawMessage) (*MessageThreadInfo, error) { + var resp MessageThreadInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSavedMessagesTopicTypeMyNotes(data json.RawMessage) (*SavedMessagesTopicTypeMyNotes, error) { + var resp SavedMessagesTopicTypeMyNotes + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSavedMessagesTopicTypeAuthorHidden(data json.RawMessage) (*SavedMessagesTopicTypeAuthorHidden, error) { + var resp SavedMessagesTopicTypeAuthorHidden + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSavedMessagesTopicTypeSavedFromChat(data json.RawMessage) (*SavedMessagesTopicTypeSavedFromChat, error) { + var resp SavedMessagesTopicTypeSavedFromChat + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSavedMessagesTopic(data json.RawMessage) (*SavedMessagesTopic, error) { + var resp SavedMessagesTopic + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalForumTopicIcon(data json.RawMessage) (*ForumTopicIcon, error) { + var resp ForumTopicIcon + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalForumTopicInfo(data json.RawMessage) (*ForumTopicInfo, error) { + var resp ForumTopicInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalForumTopic(data json.RawMessage) (*ForumTopic, error) { + var resp ForumTopic + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalForumTopics(data json.RawMessage) (*ForumTopics, error) { + var resp ForumTopics + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalLinkPreviewOptions(data json.RawMessage) (*LinkPreviewOptions, error) { + var resp LinkPreviewOptions + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSharedUser(data json.RawMessage) (*SharedUser, error) { + var resp SharedUser + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSharedChat(data json.RawMessage) (*SharedChat, error) { + var resp SharedChat + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalRichTextPlain(data json.RawMessage) (*RichTextPlain, error) { + var resp RichTextPlain + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalRichTextBold(data json.RawMessage) (*RichTextBold, error) { + var resp RichTextBold + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalRichTextItalic(data json.RawMessage) (*RichTextItalic, error) { + var resp RichTextItalic + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalRichTextUnderline(data json.RawMessage) (*RichTextUnderline, error) { + var resp RichTextUnderline + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalRichTextStrikethrough(data json.RawMessage) (*RichTextStrikethrough, error) { + var resp RichTextStrikethrough + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalRichTextFixed(data json.RawMessage) (*RichTextFixed, error) { + var resp RichTextFixed + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalRichTextUrl(data json.RawMessage) (*RichTextUrl, error) { + var resp RichTextUrl + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalRichTextEmailAddress(data json.RawMessage) (*RichTextEmailAddress, error) { + var resp RichTextEmailAddress + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalRichTextSubscript(data json.RawMessage) (*RichTextSubscript, error) { + var resp RichTextSubscript + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalRichTextSuperscript(data json.RawMessage) (*RichTextSuperscript, error) { + var resp RichTextSuperscript + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalRichTextMarked(data json.RawMessage) (*RichTextMarked, error) { + var resp RichTextMarked + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalRichTextPhoneNumber(data json.RawMessage) (*RichTextPhoneNumber, error) { + var resp RichTextPhoneNumber + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalRichTextIcon(data json.RawMessage) (*RichTextIcon, error) { + var resp RichTextIcon + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalRichTextReference(data json.RawMessage) (*RichTextReference, error) { + var resp RichTextReference + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalRichTextAnchor(data json.RawMessage) (*RichTextAnchor, error) { + var resp RichTextAnchor + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalRichTextAnchorLink(data json.RawMessage) (*RichTextAnchorLink, error) { + var resp RichTextAnchorLink + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalRichTexts(data json.RawMessage) (*RichTexts, error) { + var resp RichTexts + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPageBlockCaption(data json.RawMessage) (*PageBlockCaption, error) { + var resp PageBlockCaption + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPageBlockListItem(data json.RawMessage) (*PageBlockListItem, error) { + var resp PageBlockListItem + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPageBlockHorizontalAlignmentLeft(data json.RawMessage) (*PageBlockHorizontalAlignmentLeft, error) { + var resp PageBlockHorizontalAlignmentLeft + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPageBlockHorizontalAlignmentCenter(data json.RawMessage) (*PageBlockHorizontalAlignmentCenter, error) { + var resp PageBlockHorizontalAlignmentCenter + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPageBlockHorizontalAlignmentRight(data json.RawMessage) (*PageBlockHorizontalAlignmentRight, error) { + var resp PageBlockHorizontalAlignmentRight + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPageBlockVerticalAlignmentTop(data json.RawMessage) (*PageBlockVerticalAlignmentTop, error) { + var resp PageBlockVerticalAlignmentTop + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPageBlockVerticalAlignmentMiddle(data json.RawMessage) (*PageBlockVerticalAlignmentMiddle, error) { + var resp PageBlockVerticalAlignmentMiddle + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPageBlockVerticalAlignmentBottom(data json.RawMessage) (*PageBlockVerticalAlignmentBottom, error) { + var resp PageBlockVerticalAlignmentBottom + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPageBlockTableCell(data json.RawMessage) (*PageBlockTableCell, error) { + var resp PageBlockTableCell + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPageBlockRelatedArticle(data json.RawMessage) (*PageBlockRelatedArticle, error) { + var resp PageBlockRelatedArticle + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPageBlockTitle(data json.RawMessage) (*PageBlockTitle, error) { + var resp PageBlockTitle + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPageBlockSubtitle(data json.RawMessage) (*PageBlockSubtitle, error) { + var resp PageBlockSubtitle + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPageBlockAuthorDate(data json.RawMessage) (*PageBlockAuthorDate, error) { + var resp PageBlockAuthorDate + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPageBlockHeader(data json.RawMessage) (*PageBlockHeader, error) { + var resp PageBlockHeader + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPageBlockSubheader(data json.RawMessage) (*PageBlockSubheader, error) { + var resp PageBlockSubheader + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPageBlockKicker(data json.RawMessage) (*PageBlockKicker, error) { + var resp PageBlockKicker + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPageBlockParagraph(data json.RawMessage) (*PageBlockParagraph, error) { + var resp PageBlockParagraph + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPageBlockPreformatted(data json.RawMessage) (*PageBlockPreformatted, error) { + var resp PageBlockPreformatted + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPageBlockFooter(data json.RawMessage) (*PageBlockFooter, error) { + var resp PageBlockFooter + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPageBlockDivider(data json.RawMessage) (*PageBlockDivider, error) { + var resp PageBlockDivider + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPageBlockAnchor(data json.RawMessage) (*PageBlockAnchor, error) { + var resp PageBlockAnchor + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPageBlockList(data json.RawMessage) (*PageBlockList, error) { + var resp PageBlockList + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPageBlockBlockQuote(data json.RawMessage) (*PageBlockBlockQuote, error) { + var resp PageBlockBlockQuote + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPageBlockPullQuote(data json.RawMessage) (*PageBlockPullQuote, error) { + var resp PageBlockPullQuote + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPageBlockAnimation(data json.RawMessage) (*PageBlockAnimation, error) { + var resp PageBlockAnimation + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPageBlockAudio(data json.RawMessage) (*PageBlockAudio, error) { + var resp PageBlockAudio + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPageBlockPhoto(data json.RawMessage) (*PageBlockPhoto, error) { + var resp PageBlockPhoto + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPageBlockVideo(data json.RawMessage) (*PageBlockVideo, error) { + var resp PageBlockVideo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPageBlockVoiceNote(data json.RawMessage) (*PageBlockVoiceNote, error) { + var resp PageBlockVoiceNote + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPageBlockCover(data json.RawMessage) (*PageBlockCover, error) { + var resp PageBlockCover + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPageBlockEmbedded(data json.RawMessage) (*PageBlockEmbedded, error) { + var resp PageBlockEmbedded + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPageBlockEmbeddedPost(data json.RawMessage) (*PageBlockEmbeddedPost, error) { + var resp PageBlockEmbeddedPost + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPageBlockCollage(data json.RawMessage) (*PageBlockCollage, error) { + var resp PageBlockCollage + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPageBlockSlideshow(data json.RawMessage) (*PageBlockSlideshow, error) { + var resp PageBlockSlideshow + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPageBlockChatLink(data json.RawMessage) (*PageBlockChatLink, error) { + var resp PageBlockChatLink + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPageBlockTable(data json.RawMessage) (*PageBlockTable, error) { + var resp PageBlockTable + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPageBlockDetails(data json.RawMessage) (*PageBlockDetails, error) { + var resp PageBlockDetails + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPageBlockRelatedArticles(data json.RawMessage) (*PageBlockRelatedArticles, error) { + var resp PageBlockRelatedArticles + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPageBlockMap(data json.RawMessage) (*PageBlockMap, error) { + var resp PageBlockMap + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalWebPageInstantView(data json.RawMessage) (*WebPageInstantView, error) { + var resp WebPageInstantView + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalWebPage(data json.RawMessage) (*WebPage, error) { + var resp WebPage + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCountryInfo(data json.RawMessage) (*CountryInfo, error) { + var resp CountryInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCountries(data json.RawMessage) (*Countries, error) { + var resp Countries + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPhoneNumberInfo(data json.RawMessage) (*PhoneNumberInfo, error) { + var resp PhoneNumberInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCollectibleItemTypeUsername(data json.RawMessage) (*CollectibleItemTypeUsername, error) { + var resp CollectibleItemTypeUsername + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCollectibleItemTypePhoneNumber(data json.RawMessage) (*CollectibleItemTypePhoneNumber, error) { + var resp CollectibleItemTypePhoneNumber + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCollectibleItemInfo(data json.RawMessage) (*CollectibleItemInfo, error) { + var resp CollectibleItemInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBankCardActionOpenUrl(data json.RawMessage) (*BankCardActionOpenUrl, error) { + var resp BankCardActionOpenUrl + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBankCardInfo(data json.RawMessage) (*BankCardInfo, error) { + var resp BankCardInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalAddress(data json.RawMessage) (*Address, error) { + var resp Address + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalThemeParameters(data json.RawMessage) (*ThemeParameters, error) { + var resp ThemeParameters + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalLabeledPricePart(data json.RawMessage) (*LabeledPricePart, error) { + var resp LabeledPricePart + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInvoice(data json.RawMessage) (*Invoice, error) { + var resp Invoice + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalOrderInfo(data json.RawMessage) (*OrderInfo, error) { + var resp OrderInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalShippingOption(data json.RawMessage) (*ShippingOption, error) { + var resp ShippingOption + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSavedCredentials(data json.RawMessage) (*SavedCredentials, error) { + var resp SavedCredentials + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputCredentialsSaved(data json.RawMessage) (*InputCredentialsSaved, error) { + var resp InputCredentialsSaved + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputCredentialsNew(data json.RawMessage) (*InputCredentialsNew, error) { + var resp InputCredentialsNew + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputCredentialsApplePay(data json.RawMessage) (*InputCredentialsApplePay, error) { + var resp InputCredentialsApplePay + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputCredentialsGooglePay(data json.RawMessage) (*InputCredentialsGooglePay, error) { + var resp InputCredentialsGooglePay + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPaymentProviderSmartGlocal(data json.RawMessage) (*PaymentProviderSmartGlocal, error) { + var resp PaymentProviderSmartGlocal + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPaymentProviderStripe(data json.RawMessage) (*PaymentProviderStripe, error) { + var resp PaymentProviderStripe + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPaymentProviderOther(data json.RawMessage) (*PaymentProviderOther, error) { + var resp PaymentProviderOther + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPaymentOption(data json.RawMessage) (*PaymentOption, error) { + var resp PaymentOption + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPaymentForm(data json.RawMessage) (*PaymentForm, error) { + var resp PaymentForm + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalValidatedOrderInfo(data json.RawMessage) (*ValidatedOrderInfo, error) { + var resp ValidatedOrderInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPaymentResult(data json.RawMessage) (*PaymentResult, error) { + var resp PaymentResult + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPaymentReceipt(data json.RawMessage) (*PaymentReceipt, error) { + var resp PaymentReceipt + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputInvoiceMessage(data json.RawMessage) (*InputInvoiceMessage, error) { + var resp InputInvoiceMessage + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputInvoiceName(data json.RawMessage) (*InputInvoiceName, error) { + var resp InputInvoiceName + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputInvoiceTelegram(data json.RawMessage) (*InputInvoiceTelegram, error) { + var resp InputInvoiceTelegram + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageExtendedMediaPreview(data json.RawMessage) (*MessageExtendedMediaPreview, error) { + var resp MessageExtendedMediaPreview + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageExtendedMediaPhoto(data json.RawMessage) (*MessageExtendedMediaPhoto, error) { + var resp MessageExtendedMediaPhoto + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageExtendedMediaVideo(data json.RawMessage) (*MessageExtendedMediaVideo, error) { + var resp MessageExtendedMediaVideo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageExtendedMediaUnsupported(data json.RawMessage) (*MessageExtendedMediaUnsupported, error) { + var resp MessageExtendedMediaUnsupported + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumGiveawayParameters(data json.RawMessage) (*PremiumGiveawayParameters, error) { + var resp PremiumGiveawayParameters + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalDatedFile(data json.RawMessage) (*DatedFile, error) { + var resp DatedFile + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPassportElementTypePersonalDetails(data json.RawMessage) (*PassportElementTypePersonalDetails, error) { + var resp PassportElementTypePersonalDetails + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPassportElementTypePassport(data json.RawMessage) (*PassportElementTypePassport, error) { + var resp PassportElementTypePassport + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPassportElementTypeDriverLicense(data json.RawMessage) (*PassportElementTypeDriverLicense, error) { + var resp PassportElementTypeDriverLicense + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPassportElementTypeIdentityCard(data json.RawMessage) (*PassportElementTypeIdentityCard, error) { + var resp PassportElementTypeIdentityCard + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPassportElementTypeInternalPassport(data json.RawMessage) (*PassportElementTypeInternalPassport, error) { + var resp PassportElementTypeInternalPassport + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPassportElementTypeAddress(data json.RawMessage) (*PassportElementTypeAddress, error) { + var resp PassportElementTypeAddress + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPassportElementTypeUtilityBill(data json.RawMessage) (*PassportElementTypeUtilityBill, error) { + var resp PassportElementTypeUtilityBill + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPassportElementTypeBankStatement(data json.RawMessage) (*PassportElementTypeBankStatement, error) { + var resp PassportElementTypeBankStatement + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPassportElementTypeRentalAgreement(data json.RawMessage) (*PassportElementTypeRentalAgreement, error) { + var resp PassportElementTypeRentalAgreement + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPassportElementTypePassportRegistration(data json.RawMessage) (*PassportElementTypePassportRegistration, error) { + var resp PassportElementTypePassportRegistration + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPassportElementTypeTemporaryRegistration(data json.RawMessage) (*PassportElementTypeTemporaryRegistration, error) { + var resp PassportElementTypeTemporaryRegistration + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPassportElementTypePhoneNumber(data json.RawMessage) (*PassportElementTypePhoneNumber, error) { + var resp PassportElementTypePhoneNumber + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPassportElementTypeEmailAddress(data json.RawMessage) (*PassportElementTypeEmailAddress, error) { + var resp PassportElementTypeEmailAddress + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalDate(data json.RawMessage) (*Date, error) { + var resp Date + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPersonalDetails(data json.RawMessage) (*PersonalDetails, error) { + var resp PersonalDetails + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalIdentityDocument(data json.RawMessage) (*IdentityDocument, error) { + var resp IdentityDocument + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputIdentityDocument(data json.RawMessage) (*InputIdentityDocument, error) { + var resp InputIdentityDocument + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPersonalDocument(data json.RawMessage) (*PersonalDocument, error) { + var resp PersonalDocument + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputPersonalDocument(data json.RawMessage) (*InputPersonalDocument, error) { + var resp InputPersonalDocument + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPassportElementPersonalDetails(data json.RawMessage) (*PassportElementPersonalDetails, error) { + var resp PassportElementPersonalDetails + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPassportElementPassport(data json.RawMessage) (*PassportElementPassport, error) { + var resp PassportElementPassport + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPassportElementDriverLicense(data json.RawMessage) (*PassportElementDriverLicense, error) { + var resp PassportElementDriverLicense + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPassportElementIdentityCard(data json.RawMessage) (*PassportElementIdentityCard, error) { + var resp PassportElementIdentityCard + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPassportElementInternalPassport(data json.RawMessage) (*PassportElementInternalPassport, error) { + var resp PassportElementInternalPassport + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPassportElementAddress(data json.RawMessage) (*PassportElementAddress, error) { + var resp PassportElementAddress + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPassportElementUtilityBill(data json.RawMessage) (*PassportElementUtilityBill, error) { + var resp PassportElementUtilityBill + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPassportElementBankStatement(data json.RawMessage) (*PassportElementBankStatement, error) { + var resp PassportElementBankStatement + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPassportElementRentalAgreement(data json.RawMessage) (*PassportElementRentalAgreement, error) { + var resp PassportElementRentalAgreement + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPassportElementPassportRegistration(data json.RawMessage) (*PassportElementPassportRegistration, error) { + var resp PassportElementPassportRegistration + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPassportElementTemporaryRegistration(data json.RawMessage) (*PassportElementTemporaryRegistration, error) { + var resp PassportElementTemporaryRegistration + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPassportElementPhoneNumber(data json.RawMessage) (*PassportElementPhoneNumber, error) { + var resp PassportElementPhoneNumber + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPassportElementEmailAddress(data json.RawMessage) (*PassportElementEmailAddress, error) { + var resp PassportElementEmailAddress + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputPassportElementPersonalDetails(data json.RawMessage) (*InputPassportElementPersonalDetails, error) { + var resp InputPassportElementPersonalDetails + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputPassportElementPassport(data json.RawMessage) (*InputPassportElementPassport, error) { + var resp InputPassportElementPassport + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputPassportElementDriverLicense(data json.RawMessage) (*InputPassportElementDriverLicense, error) { + var resp InputPassportElementDriverLicense + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputPassportElementIdentityCard(data json.RawMessage) (*InputPassportElementIdentityCard, error) { + var resp InputPassportElementIdentityCard + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputPassportElementInternalPassport(data json.RawMessage) (*InputPassportElementInternalPassport, error) { + var resp InputPassportElementInternalPassport + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputPassportElementAddress(data json.RawMessage) (*InputPassportElementAddress, error) { + var resp InputPassportElementAddress + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputPassportElementUtilityBill(data json.RawMessage) (*InputPassportElementUtilityBill, error) { + var resp InputPassportElementUtilityBill + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputPassportElementBankStatement(data json.RawMessage) (*InputPassportElementBankStatement, error) { + var resp InputPassportElementBankStatement + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputPassportElementRentalAgreement(data json.RawMessage) (*InputPassportElementRentalAgreement, error) { + var resp InputPassportElementRentalAgreement + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputPassportElementPassportRegistration(data json.RawMessage) (*InputPassportElementPassportRegistration, error) { + var resp InputPassportElementPassportRegistration + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputPassportElementTemporaryRegistration(data json.RawMessage) (*InputPassportElementTemporaryRegistration, error) { + var resp InputPassportElementTemporaryRegistration + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputPassportElementPhoneNumber(data json.RawMessage) (*InputPassportElementPhoneNumber, error) { + var resp InputPassportElementPhoneNumber + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputPassportElementEmailAddress(data json.RawMessage) (*InputPassportElementEmailAddress, error) { + var resp InputPassportElementEmailAddress + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPassportElements(data json.RawMessage) (*PassportElements, error) { + var resp PassportElements + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPassportElementErrorSourceUnspecified(data json.RawMessage) (*PassportElementErrorSourceUnspecified, error) { + var resp PassportElementErrorSourceUnspecified + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPassportElementErrorSourceDataField(data json.RawMessage) (*PassportElementErrorSourceDataField, error) { + var resp PassportElementErrorSourceDataField + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPassportElementErrorSourceFrontSide(data json.RawMessage) (*PassportElementErrorSourceFrontSide, error) { + var resp PassportElementErrorSourceFrontSide + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPassportElementErrorSourceReverseSide(data json.RawMessage) (*PassportElementErrorSourceReverseSide, error) { + var resp PassportElementErrorSourceReverseSide + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPassportElementErrorSourceSelfie(data json.RawMessage) (*PassportElementErrorSourceSelfie, error) { + var resp PassportElementErrorSourceSelfie + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPassportElementErrorSourceTranslationFile(data json.RawMessage) (*PassportElementErrorSourceTranslationFile, error) { + var resp PassportElementErrorSourceTranslationFile + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPassportElementErrorSourceTranslationFiles(data json.RawMessage) (*PassportElementErrorSourceTranslationFiles, error) { + var resp PassportElementErrorSourceTranslationFiles + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPassportElementErrorSourceFile(data json.RawMessage) (*PassportElementErrorSourceFile, error) { + var resp PassportElementErrorSourceFile + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPassportElementErrorSourceFiles(data json.RawMessage) (*PassportElementErrorSourceFiles, error) { + var resp PassportElementErrorSourceFiles + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPassportElementError(data json.RawMessage) (*PassportElementError, error) { + var resp PassportElementError + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPassportSuitableElement(data json.RawMessage) (*PassportSuitableElement, error) { + var resp PassportSuitableElement + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPassportRequiredElement(data json.RawMessage) (*PassportRequiredElement, error) { + var resp PassportRequiredElement + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPassportAuthorizationForm(data json.RawMessage) (*PassportAuthorizationForm, error) { + var resp PassportAuthorizationForm + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPassportElementsWithErrors(data json.RawMessage) (*PassportElementsWithErrors, error) { + var resp PassportElementsWithErrors + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalEncryptedCredentials(data json.RawMessage) (*EncryptedCredentials, error) { + var resp EncryptedCredentials + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalEncryptedPassportElement(data json.RawMessage) (*EncryptedPassportElement, error) { + var resp EncryptedPassportElement + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputPassportElementErrorSourceUnspecified(data json.RawMessage) (*InputPassportElementErrorSourceUnspecified, error) { + var resp InputPassportElementErrorSourceUnspecified + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputPassportElementErrorSourceDataField(data json.RawMessage) (*InputPassportElementErrorSourceDataField, error) { + var resp InputPassportElementErrorSourceDataField + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputPassportElementErrorSourceFrontSide(data json.RawMessage) (*InputPassportElementErrorSourceFrontSide, error) { + var resp InputPassportElementErrorSourceFrontSide + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputPassportElementErrorSourceReverseSide(data json.RawMessage) (*InputPassportElementErrorSourceReverseSide, error) { + var resp InputPassportElementErrorSourceReverseSide + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputPassportElementErrorSourceSelfie(data json.RawMessage) (*InputPassportElementErrorSourceSelfie, error) { + var resp InputPassportElementErrorSourceSelfie + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputPassportElementErrorSourceTranslationFile(data json.RawMessage) (*InputPassportElementErrorSourceTranslationFile, error) { + var resp InputPassportElementErrorSourceTranslationFile + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputPassportElementErrorSourceTranslationFiles(data json.RawMessage) (*InputPassportElementErrorSourceTranslationFiles, error) { + var resp InputPassportElementErrorSourceTranslationFiles + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputPassportElementErrorSourceFile(data json.RawMessage) (*InputPassportElementErrorSourceFile, error) { + var resp InputPassportElementErrorSourceFile + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputPassportElementErrorSourceFiles(data json.RawMessage) (*InputPassportElementErrorSourceFiles, error) { + var resp InputPassportElementErrorSourceFiles + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputPassportElementError(data json.RawMessage) (*InputPassportElementError, error) { + var resp InputPassportElementError + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageText(data json.RawMessage) (*MessageText, error) { + var resp MessageText + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageAnimation(data json.RawMessage) (*MessageAnimation, error) { + var resp MessageAnimation + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageAudio(data json.RawMessage) (*MessageAudio, error) { + var resp MessageAudio + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageDocument(data json.RawMessage) (*MessageDocument, error) { + var resp MessageDocument + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessagePhoto(data json.RawMessage) (*MessagePhoto, error) { + var resp MessagePhoto + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageSticker(data json.RawMessage) (*MessageSticker, error) { + var resp MessageSticker + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageVideo(data json.RawMessage) (*MessageVideo, error) { + var resp MessageVideo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageVideoNote(data json.RawMessage) (*MessageVideoNote, error) { + var resp MessageVideoNote + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageVoiceNote(data json.RawMessage) (*MessageVoiceNote, error) { + var resp MessageVoiceNote + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageExpiredPhoto(data json.RawMessage) (*MessageExpiredPhoto, error) { + var resp MessageExpiredPhoto + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageExpiredVideo(data json.RawMessage) (*MessageExpiredVideo, error) { + var resp MessageExpiredVideo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageExpiredVideoNote(data json.RawMessage) (*MessageExpiredVideoNote, error) { + var resp MessageExpiredVideoNote + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageExpiredVoiceNote(data json.RawMessage) (*MessageExpiredVoiceNote, error) { + var resp MessageExpiredVoiceNote + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageLocation(data json.RawMessage) (*MessageLocation, error) { + var resp MessageLocation + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageVenue(data json.RawMessage) (*MessageVenue, error) { + var resp MessageVenue + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageContact(data json.RawMessage) (*MessageContact, error) { + var resp MessageContact + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageAnimatedEmoji(data json.RawMessage) (*MessageAnimatedEmoji, error) { + var resp MessageAnimatedEmoji + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageDice(data json.RawMessage) (*MessageDice, error) { + var resp MessageDice + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageGame(data json.RawMessage) (*MessageGame, error) { + var resp MessageGame + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessagePoll(data json.RawMessage) (*MessagePoll, error) { + var resp MessagePoll + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageStory(data json.RawMessage) (*MessageStory, error) { + var resp MessageStory + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageInvoice(data json.RawMessage) (*MessageInvoice, error) { + var resp MessageInvoice + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageCall(data json.RawMessage) (*MessageCall, error) { + var resp MessageCall + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageVideoChatScheduled(data json.RawMessage) (*MessageVideoChatScheduled, error) { + var resp MessageVideoChatScheduled + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageVideoChatStarted(data json.RawMessage) (*MessageVideoChatStarted, error) { + var resp MessageVideoChatStarted + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageVideoChatEnded(data json.RawMessage) (*MessageVideoChatEnded, error) { + var resp MessageVideoChatEnded + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageInviteVideoChatParticipants(data json.RawMessage) (*MessageInviteVideoChatParticipants, error) { + var resp MessageInviteVideoChatParticipants + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageBasicGroupChatCreate(data json.RawMessage) (*MessageBasicGroupChatCreate, error) { + var resp MessageBasicGroupChatCreate + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageSupergroupChatCreate(data json.RawMessage) (*MessageSupergroupChatCreate, error) { + var resp MessageSupergroupChatCreate + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageChatChangeTitle(data json.RawMessage) (*MessageChatChangeTitle, error) { + var resp MessageChatChangeTitle + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageChatChangePhoto(data json.RawMessage) (*MessageChatChangePhoto, error) { + var resp MessageChatChangePhoto + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageChatDeletePhoto(data json.RawMessage) (*MessageChatDeletePhoto, error) { + var resp MessageChatDeletePhoto + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageChatAddMembers(data json.RawMessage) (*MessageChatAddMembers, error) { + var resp MessageChatAddMembers + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageChatJoinByLink(data json.RawMessage) (*MessageChatJoinByLink, error) { + var resp MessageChatJoinByLink + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageChatJoinByRequest(data json.RawMessage) (*MessageChatJoinByRequest, error) { + var resp MessageChatJoinByRequest + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageChatDeleteMember(data json.RawMessage) (*MessageChatDeleteMember, error) { + var resp MessageChatDeleteMember + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageChatUpgradeTo(data json.RawMessage) (*MessageChatUpgradeTo, error) { + var resp MessageChatUpgradeTo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageChatUpgradeFrom(data json.RawMessage) (*MessageChatUpgradeFrom, error) { + var resp MessageChatUpgradeFrom + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessagePinMessage(data json.RawMessage) (*MessagePinMessage, error) { + var resp MessagePinMessage + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageScreenshotTaken(data json.RawMessage) (*MessageScreenshotTaken, error) { + var resp MessageScreenshotTaken + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageChatSetBackground(data json.RawMessage) (*MessageChatSetBackground, error) { + var resp MessageChatSetBackground + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageChatSetTheme(data json.RawMessage) (*MessageChatSetTheme, error) { + var resp MessageChatSetTheme + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageChatSetMessageAutoDeleteTime(data json.RawMessage) (*MessageChatSetMessageAutoDeleteTime, error) { + var resp MessageChatSetMessageAutoDeleteTime + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageChatBoost(data json.RawMessage) (*MessageChatBoost, error) { + var resp MessageChatBoost + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageForumTopicCreated(data json.RawMessage) (*MessageForumTopicCreated, error) { + var resp MessageForumTopicCreated + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageForumTopicEdited(data json.RawMessage) (*MessageForumTopicEdited, error) { + var resp MessageForumTopicEdited + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageForumTopicIsClosedToggled(data json.RawMessage) (*MessageForumTopicIsClosedToggled, error) { + var resp MessageForumTopicIsClosedToggled + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageForumTopicIsHiddenToggled(data json.RawMessage) (*MessageForumTopicIsHiddenToggled, error) { + var resp MessageForumTopicIsHiddenToggled + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageSuggestProfilePhoto(data json.RawMessage) (*MessageSuggestProfilePhoto, error) { + var resp MessageSuggestProfilePhoto + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageCustomServiceAction(data json.RawMessage) (*MessageCustomServiceAction, error) { + var resp MessageCustomServiceAction + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageGameScore(data json.RawMessage) (*MessageGameScore, error) { + var resp MessageGameScore + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessagePaymentSuccessful(data json.RawMessage) (*MessagePaymentSuccessful, error) { + var resp MessagePaymentSuccessful + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessagePaymentSuccessfulBot(data json.RawMessage) (*MessagePaymentSuccessfulBot, error) { + var resp MessagePaymentSuccessfulBot + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageGiftedPremium(data json.RawMessage) (*MessageGiftedPremium, error) { + var resp MessageGiftedPremium + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessagePremiumGiftCode(data json.RawMessage) (*MessagePremiumGiftCode, error) { + var resp MessagePremiumGiftCode + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessagePremiumGiveawayCreated(data json.RawMessage) (*MessagePremiumGiveawayCreated, error) { + var resp MessagePremiumGiveawayCreated + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessagePremiumGiveaway(data json.RawMessage) (*MessagePremiumGiveaway, error) { + var resp MessagePremiumGiveaway + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessagePremiumGiveawayCompleted(data json.RawMessage) (*MessagePremiumGiveawayCompleted, error) { + var resp MessagePremiumGiveawayCompleted + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessagePremiumGiveawayWinners(data json.RawMessage) (*MessagePremiumGiveawayWinners, error) { + var resp MessagePremiumGiveawayWinners + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageContactRegistered(data json.RawMessage) (*MessageContactRegistered, error) { + var resp MessageContactRegistered + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageUsersShared(data json.RawMessage) (*MessageUsersShared, error) { + var resp MessageUsersShared + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageChatShared(data json.RawMessage) (*MessageChatShared, error) { + var resp MessageChatShared + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageBotWriteAccessAllowed(data json.RawMessage) (*MessageBotWriteAccessAllowed, error) { + var resp MessageBotWriteAccessAllowed + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageWebAppDataSent(data json.RawMessage) (*MessageWebAppDataSent, error) { + var resp MessageWebAppDataSent + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageWebAppDataReceived(data json.RawMessage) (*MessageWebAppDataReceived, error) { + var resp MessageWebAppDataReceived + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessagePassportDataSent(data json.RawMessage) (*MessagePassportDataSent, error) { + var resp MessagePassportDataSent + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessagePassportDataReceived(data json.RawMessage) (*MessagePassportDataReceived, error) { + var resp MessagePassportDataReceived + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageProximityAlertTriggered(data json.RawMessage) (*MessageProximityAlertTriggered, error) { + var resp MessageProximityAlertTriggered + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageUnsupported(data json.RawMessage) (*MessageUnsupported, error) { + var resp MessageUnsupported + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTextEntityTypeMention(data json.RawMessage) (*TextEntityTypeMention, error) { + var resp TextEntityTypeMention + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTextEntityTypeHashtag(data json.RawMessage) (*TextEntityTypeHashtag, error) { + var resp TextEntityTypeHashtag + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTextEntityTypeCashtag(data json.RawMessage) (*TextEntityTypeCashtag, error) { + var resp TextEntityTypeCashtag + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTextEntityTypeBotCommand(data json.RawMessage) (*TextEntityTypeBotCommand, error) { + var resp TextEntityTypeBotCommand + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTextEntityTypeUrl(data json.RawMessage) (*TextEntityTypeUrl, error) { + var resp TextEntityTypeUrl + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTextEntityTypeEmailAddress(data json.RawMessage) (*TextEntityTypeEmailAddress, error) { + var resp TextEntityTypeEmailAddress + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTextEntityTypePhoneNumber(data json.RawMessage) (*TextEntityTypePhoneNumber, error) { + var resp TextEntityTypePhoneNumber + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTextEntityTypeBankCardNumber(data json.RawMessage) (*TextEntityTypeBankCardNumber, error) { + var resp TextEntityTypeBankCardNumber + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTextEntityTypeBold(data json.RawMessage) (*TextEntityTypeBold, error) { + var resp TextEntityTypeBold + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTextEntityTypeItalic(data json.RawMessage) (*TextEntityTypeItalic, error) { + var resp TextEntityTypeItalic + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTextEntityTypeUnderline(data json.RawMessage) (*TextEntityTypeUnderline, error) { + var resp TextEntityTypeUnderline + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTextEntityTypeStrikethrough(data json.RawMessage) (*TextEntityTypeStrikethrough, error) { + var resp TextEntityTypeStrikethrough + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTextEntityTypeSpoiler(data json.RawMessage) (*TextEntityTypeSpoiler, error) { + var resp TextEntityTypeSpoiler + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTextEntityTypeCode(data json.RawMessage) (*TextEntityTypeCode, error) { + var resp TextEntityTypeCode + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTextEntityTypePre(data json.RawMessage) (*TextEntityTypePre, error) { + var resp TextEntityTypePre + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTextEntityTypePreCode(data json.RawMessage) (*TextEntityTypePreCode, error) { + var resp TextEntityTypePreCode + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTextEntityTypeBlockQuote(data json.RawMessage) (*TextEntityTypeBlockQuote, error) { + var resp TextEntityTypeBlockQuote + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTextEntityTypeTextUrl(data json.RawMessage) (*TextEntityTypeTextUrl, error) { + var resp TextEntityTypeTextUrl + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTextEntityTypeMentionName(data json.RawMessage) (*TextEntityTypeMentionName, error) { + var resp TextEntityTypeMentionName + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTextEntityTypeCustomEmoji(data json.RawMessage) (*TextEntityTypeCustomEmoji, error) { + var resp TextEntityTypeCustomEmoji + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTextEntityTypeMediaTimestamp(data json.RawMessage) (*TextEntityTypeMediaTimestamp, error) { + var resp TextEntityTypeMediaTimestamp + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputThumbnail(data json.RawMessage) (*InputThumbnail, error) { + var resp InputThumbnail + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageSchedulingStateSendAtDate(data json.RawMessage) (*MessageSchedulingStateSendAtDate, error) { + var resp MessageSchedulingStateSendAtDate + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageSchedulingStateSendWhenOnline(data json.RawMessage) (*MessageSchedulingStateSendWhenOnline, error) { + var resp MessageSchedulingStateSendWhenOnline + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageSelfDestructTypeTimer(data json.RawMessage) (*MessageSelfDestructTypeTimer, error) { + var resp MessageSelfDestructTypeTimer + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageSelfDestructTypeImmediately(data json.RawMessage) (*MessageSelfDestructTypeImmediately, error) { + var resp MessageSelfDestructTypeImmediately + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageSendOptions(data json.RawMessage) (*MessageSendOptions, error) { + var resp MessageSendOptions + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageCopyOptions(data json.RawMessage) (*MessageCopyOptions, error) { + var resp MessageCopyOptions + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputMessageText(data json.RawMessage) (*InputMessageText, error) { + var resp InputMessageText + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputMessageAnimation(data json.RawMessage) (*InputMessageAnimation, error) { + var resp InputMessageAnimation + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputMessageAudio(data json.RawMessage) (*InputMessageAudio, error) { + var resp InputMessageAudio + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputMessageDocument(data json.RawMessage) (*InputMessageDocument, error) { + var resp InputMessageDocument + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputMessagePhoto(data json.RawMessage) (*InputMessagePhoto, error) { + var resp InputMessagePhoto + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputMessageSticker(data json.RawMessage) (*InputMessageSticker, error) { + var resp InputMessageSticker + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputMessageVideo(data json.RawMessage) (*InputMessageVideo, error) { + var resp InputMessageVideo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputMessageVideoNote(data json.RawMessage) (*InputMessageVideoNote, error) { + var resp InputMessageVideoNote + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputMessageVoiceNote(data json.RawMessage) (*InputMessageVoiceNote, error) { + var resp InputMessageVoiceNote + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputMessageLocation(data json.RawMessage) (*InputMessageLocation, error) { + var resp InputMessageLocation + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputMessageVenue(data json.RawMessage) (*InputMessageVenue, error) { + var resp InputMessageVenue + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputMessageContact(data json.RawMessage) (*InputMessageContact, error) { + var resp InputMessageContact + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputMessageDice(data json.RawMessage) (*InputMessageDice, error) { + var resp InputMessageDice + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputMessageGame(data json.RawMessage) (*InputMessageGame, error) { + var resp InputMessageGame + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputMessageInvoice(data json.RawMessage) (*InputMessageInvoice, error) { + var resp InputMessageInvoice + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputMessagePoll(data json.RawMessage) (*InputMessagePoll, error) { + var resp InputMessagePoll + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputMessageStory(data json.RawMessage) (*InputMessageStory, error) { + var resp InputMessageStory + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputMessageForwarded(data json.RawMessage) (*InputMessageForwarded, error) { + var resp InputMessageForwarded + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSearchMessagesFilterEmpty(data json.RawMessage) (*SearchMessagesFilterEmpty, error) { + var resp SearchMessagesFilterEmpty + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSearchMessagesFilterAnimation(data json.RawMessage) (*SearchMessagesFilterAnimation, error) { + var resp SearchMessagesFilterAnimation + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSearchMessagesFilterAudio(data json.RawMessage) (*SearchMessagesFilterAudio, error) { + var resp SearchMessagesFilterAudio + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSearchMessagesFilterDocument(data json.RawMessage) (*SearchMessagesFilterDocument, error) { + var resp SearchMessagesFilterDocument + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSearchMessagesFilterPhoto(data json.RawMessage) (*SearchMessagesFilterPhoto, error) { + var resp SearchMessagesFilterPhoto + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSearchMessagesFilterVideo(data json.RawMessage) (*SearchMessagesFilterVideo, error) { + var resp SearchMessagesFilterVideo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSearchMessagesFilterVoiceNote(data json.RawMessage) (*SearchMessagesFilterVoiceNote, error) { + var resp SearchMessagesFilterVoiceNote + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSearchMessagesFilterPhotoAndVideo(data json.RawMessage) (*SearchMessagesFilterPhotoAndVideo, error) { + var resp SearchMessagesFilterPhotoAndVideo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSearchMessagesFilterUrl(data json.RawMessage) (*SearchMessagesFilterUrl, error) { + var resp SearchMessagesFilterUrl + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSearchMessagesFilterChatPhoto(data json.RawMessage) (*SearchMessagesFilterChatPhoto, error) { + var resp SearchMessagesFilterChatPhoto + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSearchMessagesFilterVideoNote(data json.RawMessage) (*SearchMessagesFilterVideoNote, error) { + var resp SearchMessagesFilterVideoNote + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSearchMessagesFilterVoiceAndVideoNote(data json.RawMessage) (*SearchMessagesFilterVoiceAndVideoNote, error) { + var resp SearchMessagesFilterVoiceAndVideoNote + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSearchMessagesFilterMention(data json.RawMessage) (*SearchMessagesFilterMention, error) { + var resp SearchMessagesFilterMention + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSearchMessagesFilterUnreadMention(data json.RawMessage) (*SearchMessagesFilterUnreadMention, error) { + var resp SearchMessagesFilterUnreadMention + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSearchMessagesFilterUnreadReaction(data json.RawMessage) (*SearchMessagesFilterUnreadReaction, error) { + var resp SearchMessagesFilterUnreadReaction + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSearchMessagesFilterFailedToSend(data json.RawMessage) (*SearchMessagesFilterFailedToSend, error) { + var resp SearchMessagesFilterFailedToSend + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSearchMessagesFilterPinned(data json.RawMessage) (*SearchMessagesFilterPinned, error) { + var resp SearchMessagesFilterPinned + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatActionTyping(data json.RawMessage) (*ChatActionTyping, error) { + var resp ChatActionTyping + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatActionRecordingVideo(data json.RawMessage) (*ChatActionRecordingVideo, error) { + var resp ChatActionRecordingVideo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatActionUploadingVideo(data json.RawMessage) (*ChatActionUploadingVideo, error) { + var resp ChatActionUploadingVideo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatActionRecordingVoiceNote(data json.RawMessage) (*ChatActionRecordingVoiceNote, error) { + var resp ChatActionRecordingVoiceNote + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatActionUploadingVoiceNote(data json.RawMessage) (*ChatActionUploadingVoiceNote, error) { + var resp ChatActionUploadingVoiceNote + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatActionUploadingPhoto(data json.RawMessage) (*ChatActionUploadingPhoto, error) { + var resp ChatActionUploadingPhoto + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatActionUploadingDocument(data json.RawMessage) (*ChatActionUploadingDocument, error) { + var resp ChatActionUploadingDocument + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatActionChoosingSticker(data json.RawMessage) (*ChatActionChoosingSticker, error) { + var resp ChatActionChoosingSticker + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatActionChoosingLocation(data json.RawMessage) (*ChatActionChoosingLocation, error) { + var resp ChatActionChoosingLocation + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatActionChoosingContact(data json.RawMessage) (*ChatActionChoosingContact, error) { + var resp ChatActionChoosingContact + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatActionStartPlayingGame(data json.RawMessage) (*ChatActionStartPlayingGame, error) { + var resp ChatActionStartPlayingGame + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatActionRecordingVideoNote(data json.RawMessage) (*ChatActionRecordingVideoNote, error) { + var resp ChatActionRecordingVideoNote + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatActionUploadingVideoNote(data json.RawMessage) (*ChatActionUploadingVideoNote, error) { + var resp ChatActionUploadingVideoNote + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatActionWatchingAnimations(data json.RawMessage) (*ChatActionWatchingAnimations, error) { + var resp ChatActionWatchingAnimations + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatActionCancel(data json.RawMessage) (*ChatActionCancel, error) { + var resp ChatActionCancel + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUserStatusEmpty(data json.RawMessage) (*UserStatusEmpty, error) { + var resp UserStatusEmpty + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUserStatusOnline(data json.RawMessage) (*UserStatusOnline, error) { + var resp UserStatusOnline + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUserStatusOffline(data json.RawMessage) (*UserStatusOffline, error) { + var resp UserStatusOffline + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUserStatusRecently(data json.RawMessage) (*UserStatusRecently, error) { + var resp UserStatusRecently + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUserStatusLastWeek(data json.RawMessage) (*UserStatusLastWeek, error) { + var resp UserStatusLastWeek + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUserStatusLastMonth(data json.RawMessage) (*UserStatusLastMonth, error) { + var resp UserStatusLastMonth + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalEmojiKeyword(data json.RawMessage) (*EmojiKeyword, error) { + var resp EmojiKeyword + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalEmojiKeywords(data json.RawMessage) (*EmojiKeywords, error) { + var resp EmojiKeywords + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStickers(data json.RawMessage) (*Stickers, error) { + var resp Stickers + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalEmojis(data json.RawMessage) (*Emojis, error) { + var resp Emojis + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStickerSet(data json.RawMessage) (*StickerSet, error) { + var resp StickerSet + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStickerSetInfo(data json.RawMessage) (*StickerSetInfo, error) { + var resp StickerSetInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStickerSets(data json.RawMessage) (*StickerSets, error) { + var resp StickerSets + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTrendingStickerSets(data json.RawMessage) (*TrendingStickerSets, error) { + var resp TrendingStickerSets + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalEmojiCategory(data json.RawMessage) (*EmojiCategory, error) { + var resp EmojiCategory + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalEmojiCategories(data json.RawMessage) (*EmojiCategories, error) { + var resp EmojiCategories + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalEmojiCategoryTypeDefault(data json.RawMessage) (*EmojiCategoryTypeDefault, error) { + var resp EmojiCategoryTypeDefault + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalEmojiCategoryTypeEmojiStatus(data json.RawMessage) (*EmojiCategoryTypeEmojiStatus, error) { + var resp EmojiCategoryTypeEmojiStatus + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalEmojiCategoryTypeChatPhoto(data json.RawMessage) (*EmojiCategoryTypeChatPhoto, error) { + var resp EmojiCategoryTypeChatPhoto + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStoryAreaPosition(data json.RawMessage) (*StoryAreaPosition, error) { + var resp StoryAreaPosition + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStoryAreaTypeLocation(data json.RawMessage) (*StoryAreaTypeLocation, error) { + var resp StoryAreaTypeLocation + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStoryAreaTypeVenue(data json.RawMessage) (*StoryAreaTypeVenue, error) { + var resp StoryAreaTypeVenue + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStoryAreaTypeSuggestedReaction(data json.RawMessage) (*StoryAreaTypeSuggestedReaction, error) { + var resp StoryAreaTypeSuggestedReaction + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStoryAreaTypeMessage(data json.RawMessage) (*StoryAreaTypeMessage, error) { + var resp StoryAreaTypeMessage + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStoryArea(data json.RawMessage) (*StoryArea, error) { + var resp StoryArea + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputStoryAreaTypeLocation(data json.RawMessage) (*InputStoryAreaTypeLocation, error) { + var resp InputStoryAreaTypeLocation + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputStoryAreaTypeFoundVenue(data json.RawMessage) (*InputStoryAreaTypeFoundVenue, error) { + var resp InputStoryAreaTypeFoundVenue + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputStoryAreaTypePreviousVenue(data json.RawMessage) (*InputStoryAreaTypePreviousVenue, error) { + var resp InputStoryAreaTypePreviousVenue + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputStoryAreaTypeSuggestedReaction(data json.RawMessage) (*InputStoryAreaTypeSuggestedReaction, error) { + var resp InputStoryAreaTypeSuggestedReaction + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputStoryAreaTypeMessage(data json.RawMessage) (*InputStoryAreaTypeMessage, error) { + var resp InputStoryAreaTypeMessage + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputStoryArea(data json.RawMessage) (*InputStoryArea, error) { + var resp InputStoryArea + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputStoryAreas(data json.RawMessage) (*InputStoryAreas, error) { + var resp InputStoryAreas + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStoryVideo(data json.RawMessage) (*StoryVideo, error) { + var resp StoryVideo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStoryContentPhoto(data json.RawMessage) (*StoryContentPhoto, error) { + var resp StoryContentPhoto + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStoryContentVideo(data json.RawMessage) (*StoryContentVideo, error) { + var resp StoryContentVideo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStoryContentUnsupported(data json.RawMessage) (*StoryContentUnsupported, error) { + var resp StoryContentUnsupported + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputStoryContentPhoto(data json.RawMessage) (*InputStoryContentPhoto, error) { + var resp InputStoryContentPhoto + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputStoryContentVideo(data json.RawMessage) (*InputStoryContentVideo, error) { + var resp InputStoryContentVideo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStoryListMain(data json.RawMessage) (*StoryListMain, error) { + var resp StoryListMain + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStoryListArchive(data json.RawMessage) (*StoryListArchive, error) { + var resp StoryListArchive + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStoryOriginPublicStory(data json.RawMessage) (*StoryOriginPublicStory, error) { + var resp StoryOriginPublicStory + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStoryOriginHiddenUser(data json.RawMessage) (*StoryOriginHiddenUser, error) { + var resp StoryOriginHiddenUser + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStoryRepostInfo(data json.RawMessage) (*StoryRepostInfo, error) { + var resp StoryRepostInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStoryInteractionInfo(data json.RawMessage) (*StoryInteractionInfo, error) { + var resp StoryInteractionInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStory(data json.RawMessage) (*Story, error) { + var resp Story + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStories(data json.RawMessage) (*Stories, error) { + var resp Stories + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStoryFullId(data json.RawMessage) (*StoryFullId, error) { + var resp StoryFullId + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStoryInfo(data json.RawMessage) (*StoryInfo, error) { + var resp StoryInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatActiveStories(data json.RawMessage) (*ChatActiveStories, error) { + var resp ChatActiveStories + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStoryInteractionTypeView(data json.RawMessage) (*StoryInteractionTypeView, error) { + var resp StoryInteractionTypeView + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStoryInteractionTypeForward(data json.RawMessage) (*StoryInteractionTypeForward, error) { + var resp StoryInteractionTypeForward + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStoryInteractionTypeRepost(data json.RawMessage) (*StoryInteractionTypeRepost, error) { + var resp StoryInteractionTypeRepost + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStoryInteraction(data json.RawMessage) (*StoryInteraction, error) { + var resp StoryInteraction + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStoryInteractions(data json.RawMessage) (*StoryInteractions, error) { + var resp StoryInteractions + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalQuickReplyMessage(data json.RawMessage) (*QuickReplyMessage, error) { + var resp QuickReplyMessage + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalQuickReplyShortcut(data json.RawMessage) (*QuickReplyShortcut, error) { + var resp QuickReplyShortcut + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPublicForwardMessage(data json.RawMessage) (*PublicForwardMessage, error) { + var resp PublicForwardMessage + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPublicForwardStory(data json.RawMessage) (*PublicForwardStory, error) { + var resp PublicForwardStory + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPublicForwards(data json.RawMessage) (*PublicForwards, error) { + var resp PublicForwards + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatBoostLevelFeatures(data json.RawMessage) (*ChatBoostLevelFeatures, error) { + var resp ChatBoostLevelFeatures + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatBoostFeatures(data json.RawMessage) (*ChatBoostFeatures, error) { + var resp ChatBoostFeatures + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatBoostSourceGiftCode(data json.RawMessage) (*ChatBoostSourceGiftCode, error) { + var resp ChatBoostSourceGiftCode + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatBoostSourceGiveaway(data json.RawMessage) (*ChatBoostSourceGiveaway, error) { + var resp ChatBoostSourceGiveaway + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatBoostSourcePremium(data json.RawMessage) (*ChatBoostSourcePremium, error) { + var resp ChatBoostSourcePremium + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPrepaidPremiumGiveaway(data json.RawMessage) (*PrepaidPremiumGiveaway, error) { + var resp PrepaidPremiumGiveaway + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatBoostStatus(data json.RawMessage) (*ChatBoostStatus, error) { + var resp ChatBoostStatus + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatBoost(data json.RawMessage) (*ChatBoost, error) { + var resp ChatBoost + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalFoundChatBoosts(data json.RawMessage) (*FoundChatBoosts, error) { + var resp FoundChatBoosts + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatBoostSlot(data json.RawMessage) (*ChatBoostSlot, error) { + var resp ChatBoostSlot + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatBoostSlots(data json.RawMessage) (*ChatBoostSlots, error) { + var resp ChatBoostSlots + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCallDiscardReasonEmpty(data json.RawMessage) (*CallDiscardReasonEmpty, error) { + var resp CallDiscardReasonEmpty + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCallDiscardReasonMissed(data json.RawMessage) (*CallDiscardReasonMissed, error) { + var resp CallDiscardReasonMissed + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCallDiscardReasonDeclined(data json.RawMessage) (*CallDiscardReasonDeclined, error) { + var resp CallDiscardReasonDeclined + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCallDiscardReasonDisconnected(data json.RawMessage) (*CallDiscardReasonDisconnected, error) { + var resp CallDiscardReasonDisconnected + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCallDiscardReasonHungUp(data json.RawMessage) (*CallDiscardReasonHungUp, error) { + var resp CallDiscardReasonHungUp + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCallProtocol(data json.RawMessage) (*CallProtocol, error) { + var resp CallProtocol + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCallServerTypeTelegramReflector(data json.RawMessage) (*CallServerTypeTelegramReflector, error) { + var resp CallServerTypeTelegramReflector + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCallServerTypeWebrtc(data json.RawMessage) (*CallServerTypeWebrtc, error) { + var resp CallServerTypeWebrtc + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCallServer(data json.RawMessage) (*CallServer, error) { + var resp CallServer + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCallId(data json.RawMessage) (*CallId, error) { + var resp CallId + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalGroupCallId(data json.RawMessage) (*GroupCallId, error) { + var resp GroupCallId + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCallStatePending(data json.RawMessage) (*CallStatePending, error) { + var resp CallStatePending + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCallStateExchangingKeys(data json.RawMessage) (*CallStateExchangingKeys, error) { + var resp CallStateExchangingKeys + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCallStateReady(data json.RawMessage) (*CallStateReady, error) { + var resp CallStateReady + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCallStateHangingUp(data json.RawMessage) (*CallStateHangingUp, error) { + var resp CallStateHangingUp + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCallStateDiscarded(data json.RawMessage) (*CallStateDiscarded, error) { + var resp CallStateDiscarded + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCallStateError(data json.RawMessage) (*CallStateError, error) { + var resp CallStateError + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalGroupCallVideoQualityThumbnail(data json.RawMessage) (*GroupCallVideoQualityThumbnail, error) { + var resp GroupCallVideoQualityThumbnail + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalGroupCallVideoQualityMedium(data json.RawMessage) (*GroupCallVideoQualityMedium, error) { + var resp GroupCallVideoQualityMedium + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalGroupCallVideoQualityFull(data json.RawMessage) (*GroupCallVideoQualityFull, error) { + var resp GroupCallVideoQualityFull + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalGroupCallStream(data json.RawMessage) (*GroupCallStream, error) { + var resp GroupCallStream + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalGroupCallStreams(data json.RawMessage) (*GroupCallStreams, error) { + var resp GroupCallStreams + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalRtmpUrl(data json.RawMessage) (*RtmpUrl, error) { + var resp RtmpUrl + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalGroupCallRecentSpeaker(data json.RawMessage) (*GroupCallRecentSpeaker, error) { + var resp GroupCallRecentSpeaker + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalGroupCall(data json.RawMessage) (*GroupCall, error) { + var resp GroupCall + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalGroupCallVideoSourceGroup(data json.RawMessage) (*GroupCallVideoSourceGroup, error) { + var resp GroupCallVideoSourceGroup + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalGroupCallParticipantVideoInfo(data json.RawMessage) (*GroupCallParticipantVideoInfo, error) { + var resp GroupCallParticipantVideoInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalGroupCallParticipant(data json.RawMessage) (*GroupCallParticipant, error) { + var resp GroupCallParticipant + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCallProblemEcho(data json.RawMessage) (*CallProblemEcho, error) { + var resp CallProblemEcho + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCallProblemNoise(data json.RawMessage) (*CallProblemNoise, error) { + var resp CallProblemNoise + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCallProblemInterruptions(data json.RawMessage) (*CallProblemInterruptions, error) { + var resp CallProblemInterruptions + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCallProblemDistortedSpeech(data json.RawMessage) (*CallProblemDistortedSpeech, error) { + var resp CallProblemDistortedSpeech + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCallProblemSilentLocal(data json.RawMessage) (*CallProblemSilentLocal, error) { + var resp CallProblemSilentLocal + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCallProblemSilentRemote(data json.RawMessage) (*CallProblemSilentRemote, error) { + var resp CallProblemSilentRemote + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCallProblemDropped(data json.RawMessage) (*CallProblemDropped, error) { + var resp CallProblemDropped + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCallProblemDistortedVideo(data json.RawMessage) (*CallProblemDistortedVideo, error) { + var resp CallProblemDistortedVideo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCallProblemPixelatedVideo(data json.RawMessage) (*CallProblemPixelatedVideo, error) { + var resp CallProblemPixelatedVideo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCall(data json.RawMessage) (*Call, error) { + var resp Call + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalFirebaseAuthenticationSettingsAndroid(data json.RawMessage) (*FirebaseAuthenticationSettingsAndroid, error) { + var resp FirebaseAuthenticationSettingsAndroid + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalFirebaseAuthenticationSettingsIos(data json.RawMessage) (*FirebaseAuthenticationSettingsIos, error) { + var resp FirebaseAuthenticationSettingsIos + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPhoneNumberAuthenticationSettings(data json.RawMessage) (*PhoneNumberAuthenticationSettings, error) { + var resp PhoneNumberAuthenticationSettings + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalAddedReaction(data json.RawMessage) (*AddedReaction, error) { + var resp AddedReaction + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalAddedReactions(data json.RawMessage) (*AddedReactions, error) { + var resp AddedReactions + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalAvailableReaction(data json.RawMessage) (*AvailableReaction, error) { + var resp AvailableReaction + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalAvailableReactions(data json.RawMessage) (*AvailableReactions, error) { + var resp AvailableReactions + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalEmojiReaction(data json.RawMessage) (*EmojiReaction, error) { + var resp EmojiReaction + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalReactionUnavailabilityReasonAnonymousAdministrator(data json.RawMessage) (*ReactionUnavailabilityReasonAnonymousAdministrator, error) { + var resp ReactionUnavailabilityReasonAnonymousAdministrator + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalReactionUnavailabilityReasonGuest(data json.RawMessage) (*ReactionUnavailabilityReasonGuest, error) { + var resp ReactionUnavailabilityReasonGuest + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalAnimations(data json.RawMessage) (*Animations, error) { + var resp Animations + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalDiceStickersRegular(data json.RawMessage) (*DiceStickersRegular, error) { + var resp DiceStickersRegular + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalDiceStickersSlotMachine(data json.RawMessage) (*DiceStickersSlotMachine, error) { + var resp DiceStickersSlotMachine + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalImportedContacts(data json.RawMessage) (*ImportedContacts, error) { + var resp ImportedContacts + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSpeechRecognitionResultPending(data json.RawMessage) (*SpeechRecognitionResultPending, error) { + var resp SpeechRecognitionResultPending + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSpeechRecognitionResultText(data json.RawMessage) (*SpeechRecognitionResultText, error) { + var resp SpeechRecognitionResultText + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSpeechRecognitionResultError(data json.RawMessage) (*SpeechRecognitionResultError, error) { + var resp SpeechRecognitionResultError + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBusinessConnection(data json.RawMessage) (*BusinessConnection, error) { + var resp BusinessConnection + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalAttachmentMenuBotColor(data json.RawMessage) (*AttachmentMenuBotColor, error) { + var resp AttachmentMenuBotColor + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalAttachmentMenuBot(data json.RawMessage) (*AttachmentMenuBot, error) { + var resp AttachmentMenuBot + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSentWebAppMessage(data json.RawMessage) (*SentWebAppMessage, error) { + var resp SentWebAppMessage + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBotWriteAccessAllowReasonConnectedWebsite(data json.RawMessage) (*BotWriteAccessAllowReasonConnectedWebsite, error) { + var resp BotWriteAccessAllowReasonConnectedWebsite + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBotWriteAccessAllowReasonAddedToAttachmentMenu(data json.RawMessage) (*BotWriteAccessAllowReasonAddedToAttachmentMenu, error) { + var resp BotWriteAccessAllowReasonAddedToAttachmentMenu + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBotWriteAccessAllowReasonLaunchedWebApp(data json.RawMessage) (*BotWriteAccessAllowReasonLaunchedWebApp, error) { + var resp BotWriteAccessAllowReasonLaunchedWebApp + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBotWriteAccessAllowReasonAcceptedRequest(data json.RawMessage) (*BotWriteAccessAllowReasonAcceptedRequest, error) { + var resp BotWriteAccessAllowReasonAcceptedRequest + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalHttpUrl(data json.RawMessage) (*HttpUrl, error) { + var resp HttpUrl + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUserLink(data json.RawMessage) (*UserLink, error) { + var resp UserLink + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputInlineQueryResultAnimation(data json.RawMessage) (*InputInlineQueryResultAnimation, error) { + var resp InputInlineQueryResultAnimation + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputInlineQueryResultArticle(data json.RawMessage) (*InputInlineQueryResultArticle, error) { + var resp InputInlineQueryResultArticle + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputInlineQueryResultAudio(data json.RawMessage) (*InputInlineQueryResultAudio, error) { + var resp InputInlineQueryResultAudio + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputInlineQueryResultContact(data json.RawMessage) (*InputInlineQueryResultContact, error) { + var resp InputInlineQueryResultContact + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputInlineQueryResultDocument(data json.RawMessage) (*InputInlineQueryResultDocument, error) { + var resp InputInlineQueryResultDocument + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputInlineQueryResultGame(data json.RawMessage) (*InputInlineQueryResultGame, error) { + var resp InputInlineQueryResultGame + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputInlineQueryResultLocation(data json.RawMessage) (*InputInlineQueryResultLocation, error) { + var resp InputInlineQueryResultLocation + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputInlineQueryResultPhoto(data json.RawMessage) (*InputInlineQueryResultPhoto, error) { + var resp InputInlineQueryResultPhoto + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputInlineQueryResultSticker(data json.RawMessage) (*InputInlineQueryResultSticker, error) { + var resp InputInlineQueryResultSticker + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputInlineQueryResultVenue(data json.RawMessage) (*InputInlineQueryResultVenue, error) { + var resp InputInlineQueryResultVenue + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputInlineQueryResultVideo(data json.RawMessage) (*InputInlineQueryResultVideo, error) { + var resp InputInlineQueryResultVideo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputInlineQueryResultVoiceNote(data json.RawMessage) (*InputInlineQueryResultVoiceNote, error) { + var resp InputInlineQueryResultVoiceNote + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInlineQueryResultArticle(data json.RawMessage) (*InlineQueryResultArticle, error) { + var resp InlineQueryResultArticle + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInlineQueryResultContact(data json.RawMessage) (*InlineQueryResultContact, error) { + var resp InlineQueryResultContact + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInlineQueryResultLocation(data json.RawMessage) (*InlineQueryResultLocation, error) { + var resp InlineQueryResultLocation + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInlineQueryResultVenue(data json.RawMessage) (*InlineQueryResultVenue, error) { + var resp InlineQueryResultVenue + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInlineQueryResultGame(data json.RawMessage) (*InlineQueryResultGame, error) { + var resp InlineQueryResultGame + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInlineQueryResultAnimation(data json.RawMessage) (*InlineQueryResultAnimation, error) { + var resp InlineQueryResultAnimation + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInlineQueryResultAudio(data json.RawMessage) (*InlineQueryResultAudio, error) { + var resp InlineQueryResultAudio + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInlineQueryResultDocument(data json.RawMessage) (*InlineQueryResultDocument, error) { + var resp InlineQueryResultDocument + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInlineQueryResultPhoto(data json.RawMessage) (*InlineQueryResultPhoto, error) { + var resp InlineQueryResultPhoto + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInlineQueryResultSticker(data json.RawMessage) (*InlineQueryResultSticker, error) { + var resp InlineQueryResultSticker + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInlineQueryResultVideo(data json.RawMessage) (*InlineQueryResultVideo, error) { + var resp InlineQueryResultVideo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInlineQueryResultVoiceNote(data json.RawMessage) (*InlineQueryResultVoiceNote, error) { + var resp InlineQueryResultVoiceNote + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInlineQueryResultsButtonTypeStartBot(data json.RawMessage) (*InlineQueryResultsButtonTypeStartBot, error) { + var resp InlineQueryResultsButtonTypeStartBot + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInlineQueryResultsButtonTypeWebApp(data json.RawMessage) (*InlineQueryResultsButtonTypeWebApp, error) { + var resp InlineQueryResultsButtonTypeWebApp + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInlineQueryResultsButton(data json.RawMessage) (*InlineQueryResultsButton, error) { + var resp InlineQueryResultsButton + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInlineQueryResults(data json.RawMessage) (*InlineQueryResults, error) { + var resp InlineQueryResults + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCallbackQueryPayloadData(data json.RawMessage) (*CallbackQueryPayloadData, error) { + var resp CallbackQueryPayloadData + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCallbackQueryPayloadDataWithPassword(data json.RawMessage) (*CallbackQueryPayloadDataWithPassword, error) { + var resp CallbackQueryPayloadDataWithPassword + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCallbackQueryPayloadGame(data json.RawMessage) (*CallbackQueryPayloadGame, error) { + var resp CallbackQueryPayloadGame + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCallbackQueryAnswer(data json.RawMessage) (*CallbackQueryAnswer, error) { + var resp CallbackQueryAnswer + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCustomRequestResult(data json.RawMessage) (*CustomRequestResult, error) { + var resp CustomRequestResult + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalGameHighScore(data json.RawMessage) (*GameHighScore, error) { + var resp GameHighScore + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalGameHighScores(data json.RawMessage) (*GameHighScores, error) { + var resp GameHighScores + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventMessageEdited(data json.RawMessage) (*ChatEventMessageEdited, error) { + var resp ChatEventMessageEdited + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventMessageDeleted(data json.RawMessage) (*ChatEventMessageDeleted, error) { + var resp ChatEventMessageDeleted + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventMessagePinned(data json.RawMessage) (*ChatEventMessagePinned, error) { + var resp ChatEventMessagePinned + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventMessageUnpinned(data json.RawMessage) (*ChatEventMessageUnpinned, error) { + var resp ChatEventMessageUnpinned + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventPollStopped(data json.RawMessage) (*ChatEventPollStopped, error) { + var resp ChatEventPollStopped + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventMemberJoined(data json.RawMessage) (*ChatEventMemberJoined, error) { + var resp ChatEventMemberJoined + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventMemberJoinedByInviteLink(data json.RawMessage) (*ChatEventMemberJoinedByInviteLink, error) { + var resp ChatEventMemberJoinedByInviteLink + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventMemberJoinedByRequest(data json.RawMessage) (*ChatEventMemberJoinedByRequest, error) { + var resp ChatEventMemberJoinedByRequest + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventMemberInvited(data json.RawMessage) (*ChatEventMemberInvited, error) { + var resp ChatEventMemberInvited + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventMemberLeft(data json.RawMessage) (*ChatEventMemberLeft, error) { + var resp ChatEventMemberLeft + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventMemberPromoted(data json.RawMessage) (*ChatEventMemberPromoted, error) { + var resp ChatEventMemberPromoted + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventMemberRestricted(data json.RawMessage) (*ChatEventMemberRestricted, error) { + var resp ChatEventMemberRestricted + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventAvailableReactionsChanged(data json.RawMessage) (*ChatEventAvailableReactionsChanged, error) { + var resp ChatEventAvailableReactionsChanged + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventBackgroundChanged(data json.RawMessage) (*ChatEventBackgroundChanged, error) { + var resp ChatEventBackgroundChanged + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventDescriptionChanged(data json.RawMessage) (*ChatEventDescriptionChanged, error) { + var resp ChatEventDescriptionChanged + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventEmojiStatusChanged(data json.RawMessage) (*ChatEventEmojiStatusChanged, error) { + var resp ChatEventEmojiStatusChanged + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventLinkedChatChanged(data json.RawMessage) (*ChatEventLinkedChatChanged, error) { + var resp ChatEventLinkedChatChanged + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventLocationChanged(data json.RawMessage) (*ChatEventLocationChanged, error) { + var resp ChatEventLocationChanged + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventMessageAutoDeleteTimeChanged(data json.RawMessage) (*ChatEventMessageAutoDeleteTimeChanged, error) { + var resp ChatEventMessageAutoDeleteTimeChanged + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventPermissionsChanged(data json.RawMessage) (*ChatEventPermissionsChanged, error) { + var resp ChatEventPermissionsChanged + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventPhotoChanged(data json.RawMessage) (*ChatEventPhotoChanged, error) { + var resp ChatEventPhotoChanged + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventSlowModeDelayChanged(data json.RawMessage) (*ChatEventSlowModeDelayChanged, error) { + var resp ChatEventSlowModeDelayChanged + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventStickerSetChanged(data json.RawMessage) (*ChatEventStickerSetChanged, error) { + var resp ChatEventStickerSetChanged + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventCustomEmojiStickerSetChanged(data json.RawMessage) (*ChatEventCustomEmojiStickerSetChanged, error) { + var resp ChatEventCustomEmojiStickerSetChanged + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventTitleChanged(data json.RawMessage) (*ChatEventTitleChanged, error) { + var resp ChatEventTitleChanged + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventUsernameChanged(data json.RawMessage) (*ChatEventUsernameChanged, error) { + var resp ChatEventUsernameChanged + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventActiveUsernamesChanged(data json.RawMessage) (*ChatEventActiveUsernamesChanged, error) { + var resp ChatEventActiveUsernamesChanged + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventAccentColorChanged(data json.RawMessage) (*ChatEventAccentColorChanged, error) { + var resp ChatEventAccentColorChanged + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventProfileAccentColorChanged(data json.RawMessage) (*ChatEventProfileAccentColorChanged, error) { + var resp ChatEventProfileAccentColorChanged + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventHasProtectedContentToggled(data json.RawMessage) (*ChatEventHasProtectedContentToggled, error) { + var resp ChatEventHasProtectedContentToggled + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventInvitesToggled(data json.RawMessage) (*ChatEventInvitesToggled, error) { + var resp ChatEventInvitesToggled + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventIsAllHistoryAvailableToggled(data json.RawMessage) (*ChatEventIsAllHistoryAvailableToggled, error) { + var resp ChatEventIsAllHistoryAvailableToggled + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventHasAggressiveAntiSpamEnabledToggled(data json.RawMessage) (*ChatEventHasAggressiveAntiSpamEnabledToggled, error) { + var resp ChatEventHasAggressiveAntiSpamEnabledToggled + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventSignMessagesToggled(data json.RawMessage) (*ChatEventSignMessagesToggled, error) { + var resp ChatEventSignMessagesToggled + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventInviteLinkEdited(data json.RawMessage) (*ChatEventInviteLinkEdited, error) { + var resp ChatEventInviteLinkEdited + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventInviteLinkRevoked(data json.RawMessage) (*ChatEventInviteLinkRevoked, error) { + var resp ChatEventInviteLinkRevoked + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventInviteLinkDeleted(data json.RawMessage) (*ChatEventInviteLinkDeleted, error) { + var resp ChatEventInviteLinkDeleted + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventVideoChatCreated(data json.RawMessage) (*ChatEventVideoChatCreated, error) { + var resp ChatEventVideoChatCreated + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventVideoChatEnded(data json.RawMessage) (*ChatEventVideoChatEnded, error) { + var resp ChatEventVideoChatEnded + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventVideoChatMuteNewParticipantsToggled(data json.RawMessage) (*ChatEventVideoChatMuteNewParticipantsToggled, error) { + var resp ChatEventVideoChatMuteNewParticipantsToggled + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventVideoChatParticipantIsMutedToggled(data json.RawMessage) (*ChatEventVideoChatParticipantIsMutedToggled, error) { + var resp ChatEventVideoChatParticipantIsMutedToggled + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventVideoChatParticipantVolumeLevelChanged(data json.RawMessage) (*ChatEventVideoChatParticipantVolumeLevelChanged, error) { + var resp ChatEventVideoChatParticipantVolumeLevelChanged + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventIsForumToggled(data json.RawMessage) (*ChatEventIsForumToggled, error) { + var resp ChatEventIsForumToggled + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventForumTopicCreated(data json.RawMessage) (*ChatEventForumTopicCreated, error) { + var resp ChatEventForumTopicCreated + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventForumTopicEdited(data json.RawMessage) (*ChatEventForumTopicEdited, error) { + var resp ChatEventForumTopicEdited + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventForumTopicToggleIsClosed(data json.RawMessage) (*ChatEventForumTopicToggleIsClosed, error) { + var resp ChatEventForumTopicToggleIsClosed + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventForumTopicToggleIsHidden(data json.RawMessage) (*ChatEventForumTopicToggleIsHidden, error) { + var resp ChatEventForumTopicToggleIsHidden + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventForumTopicDeleted(data json.RawMessage) (*ChatEventForumTopicDeleted, error) { + var resp ChatEventForumTopicDeleted + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventForumTopicPinned(data json.RawMessage) (*ChatEventForumTopicPinned, error) { + var resp ChatEventForumTopicPinned + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEvent(data json.RawMessage) (*ChatEvent, error) { + var resp ChatEvent + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEvents(data json.RawMessage) (*ChatEvents, error) { + var resp ChatEvents + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventLogFilters(data json.RawMessage) (*ChatEventLogFilters, error) { + var resp ChatEventLogFilters + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalLanguagePackStringValueOrdinary(data json.RawMessage) (*LanguagePackStringValueOrdinary, error) { + var resp LanguagePackStringValueOrdinary + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalLanguagePackStringValuePluralized(data json.RawMessage) (*LanguagePackStringValuePluralized, error) { + var resp LanguagePackStringValuePluralized + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalLanguagePackStringValueDeleted(data json.RawMessage) (*LanguagePackStringValueDeleted, error) { + var resp LanguagePackStringValueDeleted + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalLanguagePackString(data json.RawMessage) (*LanguagePackString, error) { + var resp LanguagePackString + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalLanguagePackStrings(data json.RawMessage) (*LanguagePackStrings, error) { + var resp LanguagePackStrings + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalLanguagePackInfo(data json.RawMessage) (*LanguagePackInfo, error) { + var resp LanguagePackInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalLocalizationTargetInfo(data json.RawMessage) (*LocalizationTargetInfo, error) { + var resp LocalizationTargetInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumLimitTypeSupergroupCount(data json.RawMessage) (*PremiumLimitTypeSupergroupCount, error) { + var resp PremiumLimitTypeSupergroupCount + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumLimitTypePinnedChatCount(data json.RawMessage) (*PremiumLimitTypePinnedChatCount, error) { + var resp PremiumLimitTypePinnedChatCount + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumLimitTypeCreatedPublicChatCount(data json.RawMessage) (*PremiumLimitTypeCreatedPublicChatCount, error) { + var resp PremiumLimitTypeCreatedPublicChatCount + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumLimitTypeSavedAnimationCount(data json.RawMessage) (*PremiumLimitTypeSavedAnimationCount, error) { + var resp PremiumLimitTypeSavedAnimationCount + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumLimitTypeFavoriteStickerCount(data json.RawMessage) (*PremiumLimitTypeFavoriteStickerCount, error) { + var resp PremiumLimitTypeFavoriteStickerCount + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumLimitTypeChatFolderCount(data json.RawMessage) (*PremiumLimitTypeChatFolderCount, error) { + var resp PremiumLimitTypeChatFolderCount + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumLimitTypeChatFolderChosenChatCount(data json.RawMessage) (*PremiumLimitTypeChatFolderChosenChatCount, error) { + var resp PremiumLimitTypeChatFolderChosenChatCount + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumLimitTypePinnedArchivedChatCount(data json.RawMessage) (*PremiumLimitTypePinnedArchivedChatCount, error) { + var resp PremiumLimitTypePinnedArchivedChatCount + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumLimitTypePinnedSavedMessagesTopicCount(data json.RawMessage) (*PremiumLimitTypePinnedSavedMessagesTopicCount, error) { + var resp PremiumLimitTypePinnedSavedMessagesTopicCount + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumLimitTypeCaptionLength(data json.RawMessage) (*PremiumLimitTypeCaptionLength, error) { + var resp PremiumLimitTypeCaptionLength + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumLimitTypeBioLength(data json.RawMessage) (*PremiumLimitTypeBioLength, error) { + var resp PremiumLimitTypeBioLength + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumLimitTypeChatFolderInviteLinkCount(data json.RawMessage) (*PremiumLimitTypeChatFolderInviteLinkCount, error) { + var resp PremiumLimitTypeChatFolderInviteLinkCount + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumLimitTypeShareableChatFolderCount(data json.RawMessage) (*PremiumLimitTypeShareableChatFolderCount, error) { + var resp PremiumLimitTypeShareableChatFolderCount + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumLimitTypeActiveStoryCount(data json.RawMessage) (*PremiumLimitTypeActiveStoryCount, error) { + var resp PremiumLimitTypeActiveStoryCount + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumLimitTypeWeeklySentStoryCount(data json.RawMessage) (*PremiumLimitTypeWeeklySentStoryCount, error) { + var resp PremiumLimitTypeWeeklySentStoryCount + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumLimitTypeMonthlySentStoryCount(data json.RawMessage) (*PremiumLimitTypeMonthlySentStoryCount, error) { + var resp PremiumLimitTypeMonthlySentStoryCount + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumLimitTypeStoryCaptionLength(data json.RawMessage) (*PremiumLimitTypeStoryCaptionLength, error) { + var resp PremiumLimitTypeStoryCaptionLength + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumLimitTypeStorySuggestedReactionAreaCount(data json.RawMessage) (*PremiumLimitTypeStorySuggestedReactionAreaCount, error) { + var resp PremiumLimitTypeStorySuggestedReactionAreaCount + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumLimitTypeSimilarChatCount(data json.RawMessage) (*PremiumLimitTypeSimilarChatCount, error) { + var resp PremiumLimitTypeSimilarChatCount + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumFeatureIncreasedLimits(data json.RawMessage) (*PremiumFeatureIncreasedLimits, error) { + var resp PremiumFeatureIncreasedLimits + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumFeatureIncreasedUploadFileSize(data json.RawMessage) (*PremiumFeatureIncreasedUploadFileSize, error) { + var resp PremiumFeatureIncreasedUploadFileSize + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumFeatureImprovedDownloadSpeed(data json.RawMessage) (*PremiumFeatureImprovedDownloadSpeed, error) { + var resp PremiumFeatureImprovedDownloadSpeed + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumFeatureVoiceRecognition(data json.RawMessage) (*PremiumFeatureVoiceRecognition, error) { + var resp PremiumFeatureVoiceRecognition + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumFeatureDisabledAds(data json.RawMessage) (*PremiumFeatureDisabledAds, error) { + var resp PremiumFeatureDisabledAds + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumFeatureUniqueReactions(data json.RawMessage) (*PremiumFeatureUniqueReactions, error) { + var resp PremiumFeatureUniqueReactions + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumFeatureUniqueStickers(data json.RawMessage) (*PremiumFeatureUniqueStickers, error) { + var resp PremiumFeatureUniqueStickers + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumFeatureCustomEmoji(data json.RawMessage) (*PremiumFeatureCustomEmoji, error) { + var resp PremiumFeatureCustomEmoji + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumFeatureAdvancedChatManagement(data json.RawMessage) (*PremiumFeatureAdvancedChatManagement, error) { + var resp PremiumFeatureAdvancedChatManagement + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumFeatureProfileBadge(data json.RawMessage) (*PremiumFeatureProfileBadge, error) { + var resp PremiumFeatureProfileBadge + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumFeatureEmojiStatus(data json.RawMessage) (*PremiumFeatureEmojiStatus, error) { + var resp PremiumFeatureEmojiStatus + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumFeatureAnimatedProfilePhoto(data json.RawMessage) (*PremiumFeatureAnimatedProfilePhoto, error) { + var resp PremiumFeatureAnimatedProfilePhoto + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumFeatureForumTopicIcon(data json.RawMessage) (*PremiumFeatureForumTopicIcon, error) { + var resp PremiumFeatureForumTopicIcon + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumFeatureAppIcons(data json.RawMessage) (*PremiumFeatureAppIcons, error) { + var resp PremiumFeatureAppIcons + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumFeatureRealTimeChatTranslation(data json.RawMessage) (*PremiumFeatureRealTimeChatTranslation, error) { + var resp PremiumFeatureRealTimeChatTranslation + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumFeatureUpgradedStories(data json.RawMessage) (*PremiumFeatureUpgradedStories, error) { + var resp PremiumFeatureUpgradedStories + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumFeatureChatBoost(data json.RawMessage) (*PremiumFeatureChatBoost, error) { + var resp PremiumFeatureChatBoost + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumFeatureAccentColor(data json.RawMessage) (*PremiumFeatureAccentColor, error) { + var resp PremiumFeatureAccentColor + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumFeatureBackgroundForBoth(data json.RawMessage) (*PremiumFeatureBackgroundForBoth, error) { + var resp PremiumFeatureBackgroundForBoth + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumFeatureSavedMessagesTags(data json.RawMessage) (*PremiumFeatureSavedMessagesTags, error) { + var resp PremiumFeatureSavedMessagesTags + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumFeatureMessagePrivacy(data json.RawMessage) (*PremiumFeatureMessagePrivacy, error) { + var resp PremiumFeatureMessagePrivacy + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumFeatureLastSeenTimes(data json.RawMessage) (*PremiumFeatureLastSeenTimes, error) { + var resp PremiumFeatureLastSeenTimes + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumFeatureBusiness(data json.RawMessage) (*PremiumFeatureBusiness, error) { + var resp PremiumFeatureBusiness + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBusinessFeatureLocation(data json.RawMessage) (*BusinessFeatureLocation, error) { + var resp BusinessFeatureLocation + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBusinessFeatureOpeningHours(data json.RawMessage) (*BusinessFeatureOpeningHours, error) { + var resp BusinessFeatureOpeningHours + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBusinessFeatureQuickReplies(data json.RawMessage) (*BusinessFeatureQuickReplies, error) { + var resp BusinessFeatureQuickReplies + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBusinessFeatureGreetingMessage(data json.RawMessage) (*BusinessFeatureGreetingMessage, error) { + var resp BusinessFeatureGreetingMessage + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBusinessFeatureAwayMessage(data json.RawMessage) (*BusinessFeatureAwayMessage, error) { + var resp BusinessFeatureAwayMessage + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBusinessFeatureAccountLinks(data json.RawMessage) (*BusinessFeatureAccountLinks, error) { + var resp BusinessFeatureAccountLinks + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBusinessFeatureIntro(data json.RawMessage) (*BusinessFeatureIntro, error) { + var resp BusinessFeatureIntro + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBusinessFeatureBots(data json.RawMessage) (*BusinessFeatureBots, error) { + var resp BusinessFeatureBots + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBusinessFeatureEmojiStatus(data json.RawMessage) (*BusinessFeatureEmojiStatus, error) { + var resp BusinessFeatureEmojiStatus + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBusinessFeatureChatFolderTags(data json.RawMessage) (*BusinessFeatureChatFolderTags, error) { + var resp BusinessFeatureChatFolderTags + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBusinessFeatureUpgradedStories(data json.RawMessage) (*BusinessFeatureUpgradedStories, error) { + var resp BusinessFeatureUpgradedStories + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumStoryFeaturePriorityOrder(data json.RawMessage) (*PremiumStoryFeaturePriorityOrder, error) { + var resp PremiumStoryFeaturePriorityOrder + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumStoryFeatureStealthMode(data json.RawMessage) (*PremiumStoryFeatureStealthMode, error) { + var resp PremiumStoryFeatureStealthMode + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumStoryFeaturePermanentViewsHistory(data json.RawMessage) (*PremiumStoryFeaturePermanentViewsHistory, error) { + var resp PremiumStoryFeaturePermanentViewsHistory + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumStoryFeatureCustomExpirationDuration(data json.RawMessage) (*PremiumStoryFeatureCustomExpirationDuration, error) { + var resp PremiumStoryFeatureCustomExpirationDuration + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumStoryFeatureSaveStories(data json.RawMessage) (*PremiumStoryFeatureSaveStories, error) { + var resp PremiumStoryFeatureSaveStories + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumStoryFeatureLinksAndFormatting(data json.RawMessage) (*PremiumStoryFeatureLinksAndFormatting, error) { + var resp PremiumStoryFeatureLinksAndFormatting + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumStoryFeatureVideoQuality(data json.RawMessage) (*PremiumStoryFeatureVideoQuality, error) { + var resp PremiumStoryFeatureVideoQuality + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumLimit(data json.RawMessage) (*PremiumLimit, error) { + var resp PremiumLimit + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumFeatures(data json.RawMessage) (*PremiumFeatures, error) { + var resp PremiumFeatures + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBusinessFeatures(data json.RawMessage) (*BusinessFeatures, error) { + var resp BusinessFeatures + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumSourceLimitExceeded(data json.RawMessage) (*PremiumSourceLimitExceeded, error) { + var resp PremiumSourceLimitExceeded + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumSourceFeature(data json.RawMessage) (*PremiumSourceFeature, error) { + var resp PremiumSourceFeature + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumSourceBusinessFeature(data json.RawMessage) (*PremiumSourceBusinessFeature, error) { + var resp PremiumSourceBusinessFeature + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumSourceStoryFeature(data json.RawMessage) (*PremiumSourceStoryFeature, error) { + var resp PremiumSourceStoryFeature + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumSourceLink(data json.RawMessage) (*PremiumSourceLink, error) { + var resp PremiumSourceLink + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumSourceSettings(data json.RawMessage) (*PremiumSourceSettings, error) { + var resp PremiumSourceSettings + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumFeaturePromotionAnimation(data json.RawMessage) (*PremiumFeaturePromotionAnimation, error) { + var resp PremiumFeaturePromotionAnimation + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBusinessFeaturePromotionAnimation(data json.RawMessage) (*BusinessFeaturePromotionAnimation, error) { + var resp BusinessFeaturePromotionAnimation + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumState(data json.RawMessage) (*PremiumState, error) { + var resp PremiumState + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStorePaymentPurposePremiumSubscription(data json.RawMessage) (*StorePaymentPurposePremiumSubscription, error) { + var resp StorePaymentPurposePremiumSubscription + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStorePaymentPurposeGiftedPremium(data json.RawMessage) (*StorePaymentPurposeGiftedPremium, error) { + var resp StorePaymentPurposeGiftedPremium + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStorePaymentPurposePremiumGiftCodes(data json.RawMessage) (*StorePaymentPurposePremiumGiftCodes, error) { + var resp StorePaymentPurposePremiumGiftCodes + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStorePaymentPurposePremiumGiveaway(data json.RawMessage) (*StorePaymentPurposePremiumGiveaway, error) { + var resp StorePaymentPurposePremiumGiveaway + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTelegramPaymentPurposePremiumGiftCodes(data json.RawMessage) (*TelegramPaymentPurposePremiumGiftCodes, error) { + var resp TelegramPaymentPurposePremiumGiftCodes + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTelegramPaymentPurposePremiumGiveaway(data json.RawMessage) (*TelegramPaymentPurposePremiumGiveaway, error) { + var resp TelegramPaymentPurposePremiumGiveaway + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func Unmarshal//-To(data json.RawMessage) (*//-To, error) { + var resp //-To + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalDeviceTokenFirebaseCloudMessaging(data json.RawMessage) (*DeviceTokenFirebaseCloudMessaging, error) { + var resp DeviceTokenFirebaseCloudMessaging + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalDeviceTokenApplePush(data json.RawMessage) (*DeviceTokenApplePush, error) { + var resp DeviceTokenApplePush + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalDeviceTokenApplePushVoIP(data json.RawMessage) (*DeviceTokenApplePushVoIP, error) { + var resp DeviceTokenApplePushVoIP + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalDeviceTokenWindowsPush(data json.RawMessage) (*DeviceTokenWindowsPush, error) { + var resp DeviceTokenWindowsPush + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalDeviceTokenMicrosoftPush(data json.RawMessage) (*DeviceTokenMicrosoftPush, error) { + var resp DeviceTokenMicrosoftPush + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalDeviceTokenMicrosoftPushVoIP(data json.RawMessage) (*DeviceTokenMicrosoftPushVoIP, error) { + var resp DeviceTokenMicrosoftPushVoIP + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalDeviceTokenWebPush(data json.RawMessage) (*DeviceTokenWebPush, error) { + var resp DeviceTokenWebPush + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalDeviceTokenSimplePush(data json.RawMessage) (*DeviceTokenSimplePush, error) { + var resp DeviceTokenSimplePush + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalDeviceTokenUbuntuPush(data json.RawMessage) (*DeviceTokenUbuntuPush, error) { + var resp DeviceTokenUbuntuPush + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalDeviceTokenBlackBerryPush(data json.RawMessage) (*DeviceTokenBlackBerryPush, error) { + var resp DeviceTokenBlackBerryPush + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalDeviceTokenTizenPush(data json.RawMessage) (*DeviceTokenTizenPush, error) { + var resp DeviceTokenTizenPush + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalDeviceTokenHuaweiPush(data json.RawMessage) (*DeviceTokenHuaweiPush, error) { + var resp DeviceTokenHuaweiPush + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPushReceiverId(data json.RawMessage) (*PushReceiverId, error) { + var resp PushReceiverId + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBackgroundFillSolid(data json.RawMessage) (*BackgroundFillSolid, error) { + var resp BackgroundFillSolid + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBackgroundFillGradient(data json.RawMessage) (*BackgroundFillGradient, error) { + var resp BackgroundFillGradient + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBackgroundFillFreeformGradient(data json.RawMessage) (*BackgroundFillFreeformGradient, error) { + var resp BackgroundFillFreeformGradient + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBackgroundTypeWallpaper(data json.RawMessage) (*BackgroundTypeWallpaper, error) { + var resp BackgroundTypeWallpaper + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBackgroundTypePattern(data json.RawMessage) (*BackgroundTypePattern, error) { + var resp BackgroundTypePattern + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBackgroundTypeFill(data json.RawMessage) (*BackgroundTypeFill, error) { + var resp BackgroundTypeFill + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBackgroundTypeChatTheme(data json.RawMessage) (*BackgroundTypeChatTheme, error) { + var resp BackgroundTypeChatTheme + + err := json.Unmarshal(data, &resp) + + return &resp, err } func UnmarshalInputBackgroundLocal(data json.RawMessage) (*InputBackgroundLocal, error) { - var resp InputBackgroundLocal + var resp InputBackgroundLocal - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalInputBackgroundRemote(data json.RawMessage) (*InputBackgroundRemote, error) { - var resp InputBackgroundRemote + var resp InputBackgroundRemote - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err +} + +func UnmarshalInputBackgroundPrevious(data json.RawMessage) (*InputBackgroundPrevious, error) { + var resp InputBackgroundPrevious + + err := json.Unmarshal(data, &resp) + + return &resp, err } func UnmarshalThemeSettings(data json.RawMessage) (*ThemeSettings, error) { - var resp ThemeSettings + var resp ThemeSettings - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalChatTheme(data json.RawMessage) (*ChatTheme, error) { - var resp ChatTheme + var resp ChatTheme - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err +} + +func UnmarshalTimeZone(data json.RawMessage) (*TimeZone, error) { + var resp TimeZone + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTimeZones(data json.RawMessage) (*TimeZones, error) { + var resp TimeZones + + err := json.Unmarshal(data, &resp) + + return &resp, err } func UnmarshalHashtags(data json.RawMessage) (*Hashtags, error) { - var resp Hashtags + var resp Hashtags - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err +} + +func UnmarshalCanSendStoryResultOk(data json.RawMessage) (*CanSendStoryResultOk, error) { + var resp CanSendStoryResultOk + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCanSendStoryResultPremiumNeeded(data json.RawMessage) (*CanSendStoryResultPremiumNeeded, error) { + var resp CanSendStoryResultPremiumNeeded + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCanSendStoryResultBoostNeeded(data json.RawMessage) (*CanSendStoryResultBoostNeeded, error) { + var resp CanSendStoryResultBoostNeeded + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCanSendStoryResultActiveStoryLimitExceeded(data json.RawMessage) (*CanSendStoryResultActiveStoryLimitExceeded, error) { + var resp CanSendStoryResultActiveStoryLimitExceeded + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCanSendStoryResultWeeklyLimitExceeded(data json.RawMessage) (*CanSendStoryResultWeeklyLimitExceeded, error) { + var resp CanSendStoryResultWeeklyLimitExceeded + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCanSendStoryResultMonthlyLimitExceeded(data json.RawMessage) (*CanSendStoryResultMonthlyLimitExceeded, error) { + var resp CanSendStoryResultMonthlyLimitExceeded + + err := json.Unmarshal(data, &resp) + + return &resp, err } func UnmarshalCanTransferOwnershipResultOk(data json.RawMessage) (*CanTransferOwnershipResultOk, error) { - var resp CanTransferOwnershipResultOk + var resp CanTransferOwnershipResultOk - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalCanTransferOwnershipResultPasswordNeeded(data json.RawMessage) (*CanTransferOwnershipResultPasswordNeeded, error) { - var resp CanTransferOwnershipResultPasswordNeeded + var resp CanTransferOwnershipResultPasswordNeeded - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalCanTransferOwnershipResultPasswordTooFresh(data json.RawMessage) (*CanTransferOwnershipResultPasswordTooFresh, error) { - var resp CanTransferOwnershipResultPasswordTooFresh + var resp CanTransferOwnershipResultPasswordTooFresh - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalCanTransferOwnershipResultSessionTooFresh(data json.RawMessage) (*CanTransferOwnershipResultSessionTooFresh, error) { - var resp CanTransferOwnershipResultSessionTooFresh + var resp CanTransferOwnershipResultSessionTooFresh - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalCheckChatUsernameResultOk(data json.RawMessage) (*CheckChatUsernameResultOk, error) { - var resp CheckChatUsernameResultOk + var resp CheckChatUsernameResultOk - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalCheckChatUsernameResultUsernameInvalid(data json.RawMessage) (*CheckChatUsernameResultUsernameInvalid, error) { - var resp CheckChatUsernameResultUsernameInvalid + var resp CheckChatUsernameResultUsernameInvalid - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalCheckChatUsernameResultUsernameOccupied(data json.RawMessage) (*CheckChatUsernameResultUsernameOccupied, error) { - var resp CheckChatUsernameResultUsernameOccupied + var resp CheckChatUsernameResultUsernameOccupied - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalCheckChatUsernameResultUsernamePurchasable(data json.RawMessage) (*CheckChatUsernameResultUsernamePurchasable, error) { - var resp CheckChatUsernameResultUsernamePurchasable + var resp CheckChatUsernameResultUsernamePurchasable - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalCheckChatUsernameResultPublicChatsTooMany(data json.RawMessage) (*CheckChatUsernameResultPublicChatsTooMany, error) { - var resp CheckChatUsernameResultPublicChatsTooMany + var resp CheckChatUsernameResultPublicChatsTooMany - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalCheckChatUsernameResultPublicGroupsUnavailable(data json.RawMessage) (*CheckChatUsernameResultPublicGroupsUnavailable, error) { - var resp CheckChatUsernameResultPublicGroupsUnavailable + var resp CheckChatUsernameResultPublicGroupsUnavailable - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalCheckStickerSetNameResultOk(data json.RawMessage) (*CheckStickerSetNameResultOk, error) { - var resp CheckStickerSetNameResultOk + var resp CheckStickerSetNameResultOk - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalCheckStickerSetNameResultNameInvalid(data json.RawMessage) (*CheckStickerSetNameResultNameInvalid, error) { - var resp CheckStickerSetNameResultNameInvalid + var resp CheckStickerSetNameResultNameInvalid - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalCheckStickerSetNameResultNameOccupied(data json.RawMessage) (*CheckStickerSetNameResultNameOccupied, error) { - var resp CheckStickerSetNameResultNameOccupied + var resp CheckStickerSetNameResultNameOccupied - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalResetPasswordResultOk(data json.RawMessage) (*ResetPasswordResultOk, error) { - var resp ResetPasswordResultOk + var resp ResetPasswordResultOk - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalResetPasswordResultPending(data json.RawMessage) (*ResetPasswordResultPending, error) { - var resp ResetPasswordResultPending + var resp ResetPasswordResultPending - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalResetPasswordResultDeclined(data json.RawMessage) (*ResetPasswordResultDeclined, error) { - var resp ResetPasswordResultDeclined + var resp ResetPasswordResultDeclined - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalMessageFileTypePrivate(data json.RawMessage) (*MessageFileTypePrivate, error) { - var resp MessageFileTypePrivate + var resp MessageFileTypePrivate - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalMessageFileTypeGroup(data json.RawMessage) (*MessageFileTypeGroup, error) { - var resp MessageFileTypeGroup + var resp MessageFileTypeGroup - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalMessageFileTypeUnknown(data json.RawMessage) (*MessageFileTypeUnknown, error) { - var resp MessageFileTypeUnknown + var resp MessageFileTypeUnknown - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalPushMessageContentHidden(data json.RawMessage) (*PushMessageContentHidden, error) { - var resp PushMessageContentHidden + var resp PushMessageContentHidden - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalPushMessageContentAnimation(data json.RawMessage) (*PushMessageContentAnimation, error) { - var resp PushMessageContentAnimation + var resp PushMessageContentAnimation - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalPushMessageContentAudio(data json.RawMessage) (*PushMessageContentAudio, error) { - var resp PushMessageContentAudio + var resp PushMessageContentAudio - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalPushMessageContentContact(data json.RawMessage) (*PushMessageContentContact, error) { - var resp PushMessageContentContact + var resp PushMessageContentContact - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalPushMessageContentContactRegistered(data json.RawMessage) (*PushMessageContentContactRegistered, error) { - var resp PushMessageContentContactRegistered + var resp PushMessageContentContactRegistered - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalPushMessageContentDocument(data json.RawMessage) (*PushMessageContentDocument, error) { - var resp PushMessageContentDocument + var resp PushMessageContentDocument - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalPushMessageContentGame(data json.RawMessage) (*PushMessageContentGame, error) { - var resp PushMessageContentGame + var resp PushMessageContentGame - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalPushMessageContentGameScore(data json.RawMessage) (*PushMessageContentGameScore, error) { - var resp PushMessageContentGameScore + var resp PushMessageContentGameScore - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalPushMessageContentInvoice(data json.RawMessage) (*PushMessageContentInvoice, error) { - var resp PushMessageContentInvoice + var resp PushMessageContentInvoice - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalPushMessageContentLocation(data json.RawMessage) (*PushMessageContentLocation, error) { - var resp PushMessageContentLocation + var resp PushMessageContentLocation - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalPushMessageContentPhoto(data json.RawMessage) (*PushMessageContentPhoto, error) { - var resp PushMessageContentPhoto + var resp PushMessageContentPhoto - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalPushMessageContentPoll(data json.RawMessage) (*PushMessageContentPoll, error) { - var resp PushMessageContentPoll + var resp PushMessageContentPoll - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err +} + +func UnmarshalPushMessageContentPremiumGiftCode(data json.RawMessage) (*PushMessageContentPremiumGiftCode, error) { + var resp PushMessageContentPremiumGiftCode + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPushMessageContentPremiumGiveaway(data json.RawMessage) (*PushMessageContentPremiumGiveaway, error) { + var resp PushMessageContentPremiumGiveaway + + err := json.Unmarshal(data, &resp) + + return &resp, err } func UnmarshalPushMessageContentScreenshotTaken(data json.RawMessage) (*PushMessageContentScreenshotTaken, error) { - var resp PushMessageContentScreenshotTaken + var resp PushMessageContentScreenshotTaken - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalPushMessageContentSticker(data json.RawMessage) (*PushMessageContentSticker, error) { - var resp PushMessageContentSticker + var resp PushMessageContentSticker - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err +} + +func UnmarshalPushMessageContentStory(data json.RawMessage) (*PushMessageContentStory, error) { + var resp PushMessageContentStory + + err := json.Unmarshal(data, &resp) + + return &resp, err } func UnmarshalPushMessageContentText(data json.RawMessage) (*PushMessageContentText, error) { - var resp PushMessageContentText + var resp PushMessageContentText - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalPushMessageContentVideo(data json.RawMessage) (*PushMessageContentVideo, error) { - var resp PushMessageContentVideo + var resp PushMessageContentVideo - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalPushMessageContentVideoNote(data json.RawMessage) (*PushMessageContentVideoNote, error) { - var resp PushMessageContentVideoNote + var resp PushMessageContentVideoNote - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalPushMessageContentVoiceNote(data json.RawMessage) (*PushMessageContentVoiceNote, error) { - var resp PushMessageContentVoiceNote + var resp PushMessageContentVoiceNote - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalPushMessageContentBasicGroupChatCreate(data json.RawMessage) (*PushMessageContentBasicGroupChatCreate, error) { - var resp PushMessageContentBasicGroupChatCreate + var resp PushMessageContentBasicGroupChatCreate - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalPushMessageContentChatAddMembers(data json.RawMessage) (*PushMessageContentChatAddMembers, error) { - var resp PushMessageContentChatAddMembers + var resp PushMessageContentChatAddMembers - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalPushMessageContentChatChangePhoto(data json.RawMessage) (*PushMessageContentChatChangePhoto, error) { - var resp PushMessageContentChatChangePhoto + var resp PushMessageContentChatChangePhoto - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalPushMessageContentChatChangeTitle(data json.RawMessage) (*PushMessageContentChatChangeTitle, error) { - var resp PushMessageContentChatChangeTitle + var resp PushMessageContentChatChangeTitle - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err +} + +func UnmarshalPushMessageContentChatSetBackground(data json.RawMessage) (*PushMessageContentChatSetBackground, error) { + var resp PushMessageContentChatSetBackground + + err := json.Unmarshal(data, &resp) + + return &resp, err } func UnmarshalPushMessageContentChatSetTheme(data json.RawMessage) (*PushMessageContentChatSetTheme, error) { - var resp PushMessageContentChatSetTheme + var resp PushMessageContentChatSetTheme - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalPushMessageContentChatDeleteMember(data json.RawMessage) (*PushMessageContentChatDeleteMember, error) { - var resp PushMessageContentChatDeleteMember + var resp PushMessageContentChatDeleteMember - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalPushMessageContentChatJoinByLink(data json.RawMessage) (*PushMessageContentChatJoinByLink, error) { - var resp PushMessageContentChatJoinByLink + var resp PushMessageContentChatJoinByLink - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalPushMessageContentChatJoinByRequest(data json.RawMessage) (*PushMessageContentChatJoinByRequest, error) { - var resp PushMessageContentChatJoinByRequest + var resp PushMessageContentChatJoinByRequest - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalPushMessageContentRecurringPayment(data json.RawMessage) (*PushMessageContentRecurringPayment, error) { - var resp PushMessageContentRecurringPayment + var resp PushMessageContentRecurringPayment - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalPushMessageContentSuggestProfilePhoto(data json.RawMessage) (*PushMessageContentSuggestProfilePhoto, error) { - var resp PushMessageContentSuggestProfilePhoto + var resp PushMessageContentSuggestProfilePhoto - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalPushMessageContentMessageForwards(data json.RawMessage) (*PushMessageContentMessageForwards, error) { - var resp PushMessageContentMessageForwards + var resp PushMessageContentMessageForwards - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalPushMessageContentMediaAlbum(data json.RawMessage) (*PushMessageContentMediaAlbum, error) { - var resp PushMessageContentMediaAlbum + var resp PushMessageContentMediaAlbum - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalNotificationTypeNewMessage(data json.RawMessage) (*NotificationTypeNewMessage, error) { - var resp NotificationTypeNewMessage + var resp NotificationTypeNewMessage - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalNotificationTypeNewSecretChat(data json.RawMessage) (*NotificationTypeNewSecretChat, error) { - var resp NotificationTypeNewSecretChat + var resp NotificationTypeNewSecretChat - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalNotificationTypeNewCall(data json.RawMessage) (*NotificationTypeNewCall, error) { - var resp NotificationTypeNewCall + var resp NotificationTypeNewCall - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalNotificationTypeNewPushMessage(data json.RawMessage) (*NotificationTypeNewPushMessage, error) { - var resp NotificationTypeNewPushMessage + var resp NotificationTypeNewPushMessage - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalNotificationGroupTypeMessages(data json.RawMessage) (*NotificationGroupTypeMessages, error) { - var resp NotificationGroupTypeMessages + var resp NotificationGroupTypeMessages - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalNotificationGroupTypeMentions(data json.RawMessage) (*NotificationGroupTypeMentions, error) { - var resp NotificationGroupTypeMentions + var resp NotificationGroupTypeMentions - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalNotificationGroupTypeSecretChat(data json.RawMessage) (*NotificationGroupTypeSecretChat, error) { - var resp NotificationGroupTypeSecretChat + var resp NotificationGroupTypeSecretChat - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalNotificationGroupTypeCalls(data json.RawMessage) (*NotificationGroupTypeCalls, error) { - var resp NotificationGroupTypeCalls + var resp NotificationGroupTypeCalls - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalNotificationSound(data json.RawMessage) (*NotificationSound, error) { - var resp NotificationSound + var resp NotificationSound - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalNotificationSounds(data json.RawMessage) (*NotificationSounds, error) { - var resp NotificationSounds + var resp NotificationSounds - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalNotification(data json.RawMessage) (*Notification, error) { - var resp Notification + var resp Notification - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalNotificationGroup(data json.RawMessage) (*NotificationGroup, error) { - var resp NotificationGroup + var resp NotificationGroup - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalOptionValueBoolean(data json.RawMessage) (*OptionValueBoolean, error) { - var resp OptionValueBoolean + var resp OptionValueBoolean - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalOptionValueEmpty(data json.RawMessage) (*OptionValueEmpty, error) { - var resp OptionValueEmpty + var resp OptionValueEmpty - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalOptionValueInteger(data json.RawMessage) (*OptionValueInteger, error) { - var resp OptionValueInteger + var resp OptionValueInteger - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalOptionValueString(data json.RawMessage) (*OptionValueString, error) { - var resp OptionValueString + var resp OptionValueString - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalJsonObjectMember(data json.RawMessage) (*JsonObjectMember, error) { - var resp JsonObjectMember + var resp JsonObjectMember - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalJsonValueNull(data json.RawMessage) (*JsonValueNull, error) { - var resp JsonValueNull + var resp JsonValueNull - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalJsonValueBoolean(data json.RawMessage) (*JsonValueBoolean, error) { - var resp JsonValueBoolean + var resp JsonValueBoolean - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalJsonValueNumber(data json.RawMessage) (*JsonValueNumber, error) { - var resp JsonValueNumber + var resp JsonValueNumber - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalJsonValueString(data json.RawMessage) (*JsonValueString, error) { - var resp JsonValueString + var resp JsonValueString - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalJsonValueArray(data json.RawMessage) (*JsonValueArray, error) { - var resp JsonValueArray + var resp JsonValueArray - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalJsonValueObject(data json.RawMessage) (*JsonValueObject, error) { - var resp JsonValueObject + var resp JsonValueObject - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err +} + +func UnmarshalStoryPrivacySettingsEveryone(data json.RawMessage) (*StoryPrivacySettingsEveryone, error) { + var resp StoryPrivacySettingsEveryone + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStoryPrivacySettingsContacts(data json.RawMessage) (*StoryPrivacySettingsContacts, error) { + var resp StoryPrivacySettingsContacts + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStoryPrivacySettingsCloseFriends(data json.RawMessage) (*StoryPrivacySettingsCloseFriends, error) { + var resp StoryPrivacySettingsCloseFriends + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStoryPrivacySettingsSelectedUsers(data json.RawMessage) (*StoryPrivacySettingsSelectedUsers, error) { + var resp StoryPrivacySettingsSelectedUsers + + err := json.Unmarshal(data, &resp) + + return &resp, err } func UnmarshalUserPrivacySettingRuleAllowAll(data json.RawMessage) (*UserPrivacySettingRuleAllowAll, error) { - var resp UserPrivacySettingRuleAllowAll + var resp UserPrivacySettingRuleAllowAll - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUserPrivacySettingRuleAllowContacts(data json.RawMessage) (*UserPrivacySettingRuleAllowContacts, error) { - var resp UserPrivacySettingRuleAllowContacts + var resp UserPrivacySettingRuleAllowContacts - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err +} + +func UnmarshalUserPrivacySettingRuleAllowPremiumUsers(data json.RawMessage) (*UserPrivacySettingRuleAllowPremiumUsers, error) { + var resp UserPrivacySettingRuleAllowPremiumUsers + + err := json.Unmarshal(data, &resp) + + return &resp, err } func UnmarshalUserPrivacySettingRuleAllowUsers(data json.RawMessage) (*UserPrivacySettingRuleAllowUsers, error) { - var resp UserPrivacySettingRuleAllowUsers + var resp UserPrivacySettingRuleAllowUsers - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUserPrivacySettingRuleAllowChatMembers(data json.RawMessage) (*UserPrivacySettingRuleAllowChatMembers, error) { - var resp UserPrivacySettingRuleAllowChatMembers + var resp UserPrivacySettingRuleAllowChatMembers - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUserPrivacySettingRuleRestrictAll(data json.RawMessage) (*UserPrivacySettingRuleRestrictAll, error) { - var resp UserPrivacySettingRuleRestrictAll + var resp UserPrivacySettingRuleRestrictAll - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUserPrivacySettingRuleRestrictContacts(data json.RawMessage) (*UserPrivacySettingRuleRestrictContacts, error) { - var resp UserPrivacySettingRuleRestrictContacts + var resp UserPrivacySettingRuleRestrictContacts - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUserPrivacySettingRuleRestrictUsers(data json.RawMessage) (*UserPrivacySettingRuleRestrictUsers, error) { - var resp UserPrivacySettingRuleRestrictUsers + var resp UserPrivacySettingRuleRestrictUsers - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUserPrivacySettingRuleRestrictChatMembers(data json.RawMessage) (*UserPrivacySettingRuleRestrictChatMembers, error) { - var resp UserPrivacySettingRuleRestrictChatMembers + var resp UserPrivacySettingRuleRestrictChatMembers - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUserPrivacySettingRules(data json.RawMessage) (*UserPrivacySettingRules, error) { - var resp UserPrivacySettingRules + var resp UserPrivacySettingRules - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUserPrivacySettingShowStatus(data json.RawMessage) (*UserPrivacySettingShowStatus, error) { - var resp UserPrivacySettingShowStatus + var resp UserPrivacySettingShowStatus - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUserPrivacySettingShowProfilePhoto(data json.RawMessage) (*UserPrivacySettingShowProfilePhoto, error) { - var resp UserPrivacySettingShowProfilePhoto + var resp UserPrivacySettingShowProfilePhoto - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUserPrivacySettingShowLinkInForwardedMessages(data json.RawMessage) (*UserPrivacySettingShowLinkInForwardedMessages, error) { - var resp UserPrivacySettingShowLinkInForwardedMessages + var resp UserPrivacySettingShowLinkInForwardedMessages - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUserPrivacySettingShowPhoneNumber(data json.RawMessage) (*UserPrivacySettingShowPhoneNumber, error) { - var resp UserPrivacySettingShowPhoneNumber + var resp UserPrivacySettingShowPhoneNumber - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err +} + +func UnmarshalUserPrivacySettingShowBio(data json.RawMessage) (*UserPrivacySettingShowBio, error) { + var resp UserPrivacySettingShowBio + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUserPrivacySettingShowBirthdate(data json.RawMessage) (*UserPrivacySettingShowBirthdate, error) { + var resp UserPrivacySettingShowBirthdate + + err := json.Unmarshal(data, &resp) + + return &resp, err } func UnmarshalUserPrivacySettingAllowChatInvites(data json.RawMessage) (*UserPrivacySettingAllowChatInvites, error) { - var resp UserPrivacySettingAllowChatInvites + var resp UserPrivacySettingAllowChatInvites - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUserPrivacySettingAllowCalls(data json.RawMessage) (*UserPrivacySettingAllowCalls, error) { - var resp UserPrivacySettingAllowCalls + var resp UserPrivacySettingAllowCalls - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUserPrivacySettingAllowPeerToPeerCalls(data json.RawMessage) (*UserPrivacySettingAllowPeerToPeerCalls, error) { - var resp UserPrivacySettingAllowPeerToPeerCalls + var resp UserPrivacySettingAllowPeerToPeerCalls - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUserPrivacySettingAllowFindingByPhoneNumber(data json.RawMessage) (*UserPrivacySettingAllowFindingByPhoneNumber, error) { - var resp UserPrivacySettingAllowFindingByPhoneNumber + var resp UserPrivacySettingAllowFindingByPhoneNumber - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages(data json.RawMessage) (*UserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages, error) { - var resp UserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages + var resp UserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err +} + +func UnmarshalReadDatePrivacySettings(data json.RawMessage) (*ReadDatePrivacySettings, error) { + var resp ReadDatePrivacySettings + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalNewChatPrivacySettings(data json.RawMessage) (*NewChatPrivacySettings, error) { + var resp NewChatPrivacySettings + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCanSendMessageToUserResultOk(data json.RawMessage) (*CanSendMessageToUserResultOk, error) { + var resp CanSendMessageToUserResultOk + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCanSendMessageToUserResultUserIsDeleted(data json.RawMessage) (*CanSendMessageToUserResultUserIsDeleted, error) { + var resp CanSendMessageToUserResultUserIsDeleted + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCanSendMessageToUserResultUserRestrictsNewChats(data json.RawMessage) (*CanSendMessageToUserResultUserRestrictsNewChats, error) { + var resp CanSendMessageToUserResultUserRestrictsNewChats + + err := json.Unmarshal(data, &resp) + + return &resp, err } func UnmarshalAccountTtl(data json.RawMessage) (*AccountTtl, error) { - var resp AccountTtl + var resp AccountTtl - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalMessageAutoDeleteTime(data json.RawMessage) (*MessageAutoDeleteTime, error) { - var resp MessageAutoDeleteTime + var resp MessageAutoDeleteTime - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalSessionTypeAndroid(data json.RawMessage) (*SessionTypeAndroid, error) { - var resp SessionTypeAndroid + var resp SessionTypeAndroid - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalSessionTypeApple(data json.RawMessage) (*SessionTypeApple, error) { - var resp SessionTypeApple + var resp SessionTypeApple - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalSessionTypeBrave(data json.RawMessage) (*SessionTypeBrave, error) { - var resp SessionTypeBrave + var resp SessionTypeBrave - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalSessionTypeChrome(data json.RawMessage) (*SessionTypeChrome, error) { - var resp SessionTypeChrome + var resp SessionTypeChrome - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalSessionTypeEdge(data json.RawMessage) (*SessionTypeEdge, error) { - var resp SessionTypeEdge + var resp SessionTypeEdge - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalSessionTypeFirefox(data json.RawMessage) (*SessionTypeFirefox, error) { - var resp SessionTypeFirefox + var resp SessionTypeFirefox - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalSessionTypeIpad(data json.RawMessage) (*SessionTypeIpad, error) { - var resp SessionTypeIpad + var resp SessionTypeIpad - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalSessionTypeIphone(data json.RawMessage) (*SessionTypeIphone, error) { - var resp SessionTypeIphone + var resp SessionTypeIphone - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalSessionTypeLinux(data json.RawMessage) (*SessionTypeLinux, error) { - var resp SessionTypeLinux + var resp SessionTypeLinux - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalSessionTypeMac(data json.RawMessage) (*SessionTypeMac, error) { - var resp SessionTypeMac + var resp SessionTypeMac - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalSessionTypeOpera(data json.RawMessage) (*SessionTypeOpera, error) { - var resp SessionTypeOpera + var resp SessionTypeOpera - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalSessionTypeSafari(data json.RawMessage) (*SessionTypeSafari, error) { - var resp SessionTypeSafari + var resp SessionTypeSafari - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalSessionTypeUbuntu(data json.RawMessage) (*SessionTypeUbuntu, error) { - var resp SessionTypeUbuntu + var resp SessionTypeUbuntu - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalSessionTypeUnknown(data json.RawMessage) (*SessionTypeUnknown, error) { - var resp SessionTypeUnknown + var resp SessionTypeUnknown - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalSessionTypeVivaldi(data json.RawMessage) (*SessionTypeVivaldi, error) { - var resp SessionTypeVivaldi + var resp SessionTypeVivaldi - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalSessionTypeWindows(data json.RawMessage) (*SessionTypeWindows, error) { - var resp SessionTypeWindows + var resp SessionTypeWindows - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalSessionTypeXbox(data json.RawMessage) (*SessionTypeXbox, error) { - var resp SessionTypeXbox + var resp SessionTypeXbox - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalSession(data json.RawMessage) (*Session, error) { - var resp Session + var resp Session - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalSessions(data json.RawMessage) (*Sessions, error) { - var resp Sessions + var resp Sessions - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err +} + +func UnmarshalUnconfirmedSession(data json.RawMessage) (*UnconfirmedSession, error) { + var resp UnconfirmedSession + + err := json.Unmarshal(data, &resp) + + return &resp, err } func UnmarshalConnectedWebsite(data json.RawMessage) (*ConnectedWebsite, error) { - var resp ConnectedWebsite + var resp ConnectedWebsite - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalConnectedWebsites(data json.RawMessage) (*ConnectedWebsites, error) { - var resp ConnectedWebsites + var resp ConnectedWebsites - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } -func UnmarshalChatReportReasonSpam(data json.RawMessage) (*ChatReportReasonSpam, error) { - var resp ChatReportReasonSpam +func UnmarshalReportReasonSpam(data json.RawMessage) (*ReportReasonSpam, error) { + var resp ReportReasonSpam - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } -func UnmarshalChatReportReasonViolence(data json.RawMessage) (*ChatReportReasonViolence, error) { - var resp ChatReportReasonViolence +func UnmarshalReportReasonViolence(data json.RawMessage) (*ReportReasonViolence, error) { + var resp ReportReasonViolence - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } -func UnmarshalChatReportReasonPornography(data json.RawMessage) (*ChatReportReasonPornography, error) { - var resp ChatReportReasonPornography +func UnmarshalReportReasonPornography(data json.RawMessage) (*ReportReasonPornography, error) { + var resp ReportReasonPornography - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } -func UnmarshalChatReportReasonChildAbuse(data json.RawMessage) (*ChatReportReasonChildAbuse, error) { - var resp ChatReportReasonChildAbuse +func UnmarshalReportReasonChildAbuse(data json.RawMessage) (*ReportReasonChildAbuse, error) { + var resp ReportReasonChildAbuse - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } -func UnmarshalChatReportReasonCopyright(data json.RawMessage) (*ChatReportReasonCopyright, error) { - var resp ChatReportReasonCopyright +func UnmarshalReportReasonCopyright(data json.RawMessage) (*ReportReasonCopyright, error) { + var resp ReportReasonCopyright - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } -func UnmarshalChatReportReasonUnrelatedLocation(data json.RawMessage) (*ChatReportReasonUnrelatedLocation, error) { - var resp ChatReportReasonUnrelatedLocation +func UnmarshalReportReasonUnrelatedLocation(data json.RawMessage) (*ReportReasonUnrelatedLocation, error) { + var resp ReportReasonUnrelatedLocation - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } -func UnmarshalChatReportReasonFake(data json.RawMessage) (*ChatReportReasonFake, error) { - var resp ChatReportReasonFake +func UnmarshalReportReasonFake(data json.RawMessage) (*ReportReasonFake, error) { + var resp ReportReasonFake - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } -func UnmarshalChatReportReasonIllegalDrugs(data json.RawMessage) (*ChatReportReasonIllegalDrugs, error) { - var resp ChatReportReasonIllegalDrugs +func UnmarshalReportReasonIllegalDrugs(data json.RawMessage) (*ReportReasonIllegalDrugs, error) { + var resp ReportReasonIllegalDrugs - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } -func UnmarshalChatReportReasonPersonalDetails(data json.RawMessage) (*ChatReportReasonPersonalDetails, error) { - var resp ChatReportReasonPersonalDetails +func UnmarshalReportReasonPersonalDetails(data json.RawMessage) (*ReportReasonPersonalDetails, error) { + var resp ReportReasonPersonalDetails - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } -func UnmarshalChatReportReasonCustom(data json.RawMessage) (*ChatReportReasonCustom, error) { - var resp ChatReportReasonCustom +func UnmarshalReportReasonCustom(data json.RawMessage) (*ReportReasonCustom, error) { + var resp ReportReasonCustom - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalTargetChatCurrent(data json.RawMessage) (*TargetChatCurrent, error) { - var resp TargetChatCurrent + var resp TargetChatCurrent - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalTargetChatChosen(data json.RawMessage) (*TargetChatChosen, error) { - var resp TargetChatChosen + var resp TargetChatChosen - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalTargetChatInternalLink(data json.RawMessage) (*TargetChatInternalLink, error) { - var resp TargetChatInternalLink + var resp TargetChatInternalLink - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalInternalLinkTypeActiveSessions(data json.RawMessage) (*InternalLinkTypeActiveSessions, error) { - var resp InternalLinkTypeActiveSessions + var resp InternalLinkTypeActiveSessions - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalInternalLinkTypeAttachmentMenuBot(data json.RawMessage) (*InternalLinkTypeAttachmentMenuBot, error) { - var resp InternalLinkTypeAttachmentMenuBot + var resp InternalLinkTypeAttachmentMenuBot - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalInternalLinkTypeAuthenticationCode(data json.RawMessage) (*InternalLinkTypeAuthenticationCode, error) { - var resp InternalLinkTypeAuthenticationCode + var resp InternalLinkTypeAuthenticationCode - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalInternalLinkTypeBackground(data json.RawMessage) (*InternalLinkTypeBackground, error) { - var resp InternalLinkTypeBackground + var resp InternalLinkTypeBackground - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err -} - -func UnmarshalInternalLinkTypeBotStart(data json.RawMessage) (*InternalLinkTypeBotStart, error) { - var resp InternalLinkTypeBotStart - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInternalLinkTypeBotStartInGroup(data json.RawMessage) (*InternalLinkTypeBotStartInGroup, error) { - var resp InternalLinkTypeBotStartInGroup - - err := json.Unmarshal(data, &resp) - - return &resp, err + return &resp, err } func UnmarshalInternalLinkTypeBotAddToChannel(data json.RawMessage) (*InternalLinkTypeBotAddToChannel, error) { - var resp InternalLinkTypeBotAddToChannel + var resp InternalLinkTypeBotAddToChannel - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err +} + +func UnmarshalInternalLinkTypeBotStart(data json.RawMessage) (*InternalLinkTypeBotStart, error) { + var resp InternalLinkTypeBotStart + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInternalLinkTypeBotStartInGroup(data json.RawMessage) (*InternalLinkTypeBotStartInGroup, error) { + var resp InternalLinkTypeBotStartInGroup + + err := json.Unmarshal(data, &resp) + + return &resp, err } func UnmarshalInternalLinkTypeChangePhoneNumber(data json.RawMessage) (*InternalLinkTypeChangePhoneNumber, error) { - var resp InternalLinkTypeChangePhoneNumber + var resp InternalLinkTypeChangePhoneNumber - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err +} + +func UnmarshalInternalLinkTypeChatBoost(data json.RawMessage) (*InternalLinkTypeChatBoost, error) { + var resp InternalLinkTypeChatBoost + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInternalLinkTypeChatFolderInvite(data json.RawMessage) (*InternalLinkTypeChatFolderInvite, error) { + var resp InternalLinkTypeChatFolderInvite + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInternalLinkTypeChatFolderSettings(data json.RawMessage) (*InternalLinkTypeChatFolderSettings, error) { + var resp InternalLinkTypeChatFolderSettings + + err := json.Unmarshal(data, &resp) + + return &resp, err } func UnmarshalInternalLinkTypeChatInvite(data json.RawMessage) (*InternalLinkTypeChatInvite, error) { - var resp InternalLinkTypeChatInvite + var resp InternalLinkTypeChatInvite - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalInternalLinkTypeDefaultMessageAutoDeleteTimerSettings(data json.RawMessage) (*InternalLinkTypeDefaultMessageAutoDeleteTimerSettings, error) { - var resp InternalLinkTypeDefaultMessageAutoDeleteTimerSettings + var resp InternalLinkTypeDefaultMessageAutoDeleteTimerSettings - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalInternalLinkTypeEditProfileSettings(data json.RawMessage) (*InternalLinkTypeEditProfileSettings, error) { - var resp InternalLinkTypeEditProfileSettings + var resp InternalLinkTypeEditProfileSettings - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err -} - -func UnmarshalInternalLinkTypeFilterSettings(data json.RawMessage) (*InternalLinkTypeFilterSettings, error) { - var resp InternalLinkTypeFilterSettings - - err := json.Unmarshal(data, &resp) - - return &resp, err + return &resp, err } func UnmarshalInternalLinkTypeGame(data json.RawMessage) (*InternalLinkTypeGame, error) { - var resp InternalLinkTypeGame + var resp InternalLinkTypeGame - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalInternalLinkTypeInstantView(data json.RawMessage) (*InternalLinkTypeInstantView, error) { - var resp InternalLinkTypeInstantView + var resp InternalLinkTypeInstantView - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalInternalLinkTypeInvoice(data json.RawMessage) (*InternalLinkTypeInvoice, error) { - var resp InternalLinkTypeInvoice + var resp InternalLinkTypeInvoice - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalInternalLinkTypeLanguagePack(data json.RawMessage) (*InternalLinkTypeLanguagePack, error) { - var resp InternalLinkTypeLanguagePack + var resp InternalLinkTypeLanguagePack - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalInternalLinkTypeLanguageSettings(data json.RawMessage) (*InternalLinkTypeLanguageSettings, error) { - var resp InternalLinkTypeLanguageSettings + var resp InternalLinkTypeLanguageSettings - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalInternalLinkTypeMessage(data json.RawMessage) (*InternalLinkTypeMessage, error) { - var resp InternalLinkTypeMessage + var resp InternalLinkTypeMessage - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalInternalLinkTypeMessageDraft(data json.RawMessage) (*InternalLinkTypeMessageDraft, error) { - var resp InternalLinkTypeMessageDraft + var resp InternalLinkTypeMessageDraft - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalInternalLinkTypePassportDataRequest(data json.RawMessage) (*InternalLinkTypePassportDataRequest, error) { - var resp InternalLinkTypePassportDataRequest + var resp InternalLinkTypePassportDataRequest - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalInternalLinkTypePhoneNumberConfirmation(data json.RawMessage) (*InternalLinkTypePhoneNumberConfirmation, error) { - var resp InternalLinkTypePhoneNumberConfirmation + var resp InternalLinkTypePhoneNumberConfirmation - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalInternalLinkTypePremiumFeatures(data json.RawMessage) (*InternalLinkTypePremiumFeatures, error) { - var resp InternalLinkTypePremiumFeatures + var resp InternalLinkTypePremiumFeatures - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err +} + +func UnmarshalInternalLinkTypePremiumGift(data json.RawMessage) (*InternalLinkTypePremiumGift, error) { + var resp InternalLinkTypePremiumGift + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInternalLinkTypePremiumGiftCode(data json.RawMessage) (*InternalLinkTypePremiumGiftCode, error) { + var resp InternalLinkTypePremiumGiftCode + + err := json.Unmarshal(data, &resp) + + return &resp, err } func UnmarshalInternalLinkTypePrivacyAndSecuritySettings(data json.RawMessage) (*InternalLinkTypePrivacyAndSecuritySettings, error) { - var resp InternalLinkTypePrivacyAndSecuritySettings + var resp InternalLinkTypePrivacyAndSecuritySettings - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalInternalLinkTypeProxy(data json.RawMessage) (*InternalLinkTypeProxy, error) { - var resp InternalLinkTypeProxy + var resp InternalLinkTypeProxy - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalInternalLinkTypePublicChat(data json.RawMessage) (*InternalLinkTypePublicChat, error) { - var resp InternalLinkTypePublicChat + var resp InternalLinkTypePublicChat - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalInternalLinkTypeQrCodeAuthentication(data json.RawMessage) (*InternalLinkTypeQrCodeAuthentication, error) { - var resp InternalLinkTypeQrCodeAuthentication + var resp InternalLinkTypeQrCodeAuthentication - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalInternalLinkTypeRestorePurchases(data json.RawMessage) (*InternalLinkTypeRestorePurchases, error) { - var resp InternalLinkTypeRestorePurchases + var resp InternalLinkTypeRestorePurchases - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalInternalLinkTypeSettings(data json.RawMessage) (*InternalLinkTypeSettings, error) { - var resp InternalLinkTypeSettings + var resp InternalLinkTypeSettings - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err +} + +func UnmarshalInternalLinkTypeSideMenuBot(data json.RawMessage) (*InternalLinkTypeSideMenuBot, error) { + var resp InternalLinkTypeSideMenuBot + + err := json.Unmarshal(data, &resp) + + return &resp, err } func UnmarshalInternalLinkTypeStickerSet(data json.RawMessage) (*InternalLinkTypeStickerSet, error) { - var resp InternalLinkTypeStickerSet + var resp InternalLinkTypeStickerSet - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err +} + +func UnmarshalInternalLinkTypeStory(data json.RawMessage) (*InternalLinkTypeStory, error) { + var resp InternalLinkTypeStory + + err := json.Unmarshal(data, &resp) + + return &resp, err } func UnmarshalInternalLinkTypeTheme(data json.RawMessage) (*InternalLinkTypeTheme, error) { - var resp InternalLinkTypeTheme + var resp InternalLinkTypeTheme - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalInternalLinkTypeThemeSettings(data json.RawMessage) (*InternalLinkTypeThemeSettings, error) { - var resp InternalLinkTypeThemeSettings + var resp InternalLinkTypeThemeSettings - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalInternalLinkTypeUnknownDeepLink(data json.RawMessage) (*InternalLinkTypeUnknownDeepLink, error) { - var resp InternalLinkTypeUnknownDeepLink + var resp InternalLinkTypeUnknownDeepLink - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalInternalLinkTypeUnsupportedProxy(data json.RawMessage) (*InternalLinkTypeUnsupportedProxy, error) { - var resp InternalLinkTypeUnsupportedProxy + var resp InternalLinkTypeUnsupportedProxy - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalInternalLinkTypeUserPhoneNumber(data json.RawMessage) (*InternalLinkTypeUserPhoneNumber, error) { - var resp InternalLinkTypeUserPhoneNumber + var resp InternalLinkTypeUserPhoneNumber - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalInternalLinkTypeUserToken(data json.RawMessage) (*InternalLinkTypeUserToken, error) { - var resp InternalLinkTypeUserToken + var resp InternalLinkTypeUserToken - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalInternalLinkTypeVideoChat(data json.RawMessage) (*InternalLinkTypeVideoChat, error) { - var resp InternalLinkTypeVideoChat + var resp InternalLinkTypeVideoChat - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err +} + +func UnmarshalInternalLinkTypeWebApp(data json.RawMessage) (*InternalLinkTypeWebApp, error) { + var resp InternalLinkTypeWebApp + + err := json.Unmarshal(data, &resp) + + return &resp, err } func UnmarshalMessageLink(data json.RawMessage) (*MessageLink, error) { - var resp MessageLink + var resp MessageLink - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalMessageLinkInfo(data json.RawMessage) (*MessageLinkInfo, error) { - var resp MessageLinkInfo + var resp MessageLinkInfo - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err +} + +func UnmarshalChatBoostLink(data json.RawMessage) (*ChatBoostLink, error) { + var resp ChatBoostLink + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatBoostLinkInfo(data json.RawMessage) (*ChatBoostLinkInfo, error) { + var resp ChatBoostLinkInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBlockListMain(data json.RawMessage) (*BlockListMain, error) { + var resp BlockListMain + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBlockListStories(data json.RawMessage) (*BlockListStories, error) { + var resp BlockListStories + + err := json.Unmarshal(data, &resp) + + return &resp, err } func UnmarshalFilePart(data json.RawMessage) (*FilePart, error) { - var resp FilePart + var resp FilePart - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalFileTypeNone(data json.RawMessage) (*FileTypeNone, error) { - var resp FileTypeNone + var resp FileTypeNone - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalFileTypeAnimation(data json.RawMessage) (*FileTypeAnimation, error) { - var resp FileTypeAnimation + var resp FileTypeAnimation - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalFileTypeAudio(data json.RawMessage) (*FileTypeAudio, error) { - var resp FileTypeAudio + var resp FileTypeAudio - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalFileTypeDocument(data json.RawMessage) (*FileTypeDocument, error) { - var resp FileTypeDocument + var resp FileTypeDocument - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalFileTypeNotificationSound(data json.RawMessage) (*FileTypeNotificationSound, error) { - var resp FileTypeNotificationSound + var resp FileTypeNotificationSound - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalFileTypePhoto(data json.RawMessage) (*FileTypePhoto, error) { - var resp FileTypePhoto + var resp FileTypePhoto - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err +} + +func UnmarshalFileTypePhotoStory(data json.RawMessage) (*FileTypePhotoStory, error) { + var resp FileTypePhotoStory + + err := json.Unmarshal(data, &resp) + + return &resp, err } func UnmarshalFileTypeProfilePhoto(data json.RawMessage) (*FileTypeProfilePhoto, error) { - var resp FileTypeProfilePhoto + var resp FileTypeProfilePhoto - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalFileTypeSecret(data json.RawMessage) (*FileTypeSecret, error) { - var resp FileTypeSecret + var resp FileTypeSecret - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalFileTypeSecretThumbnail(data json.RawMessage) (*FileTypeSecretThumbnail, error) { - var resp FileTypeSecretThumbnail + var resp FileTypeSecretThumbnail - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalFileTypeSecure(data json.RawMessage) (*FileTypeSecure, error) { - var resp FileTypeSecure + var resp FileTypeSecure - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalFileTypeSticker(data json.RawMessage) (*FileTypeSticker, error) { - var resp FileTypeSticker + var resp FileTypeSticker - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalFileTypeThumbnail(data json.RawMessage) (*FileTypeThumbnail, error) { - var resp FileTypeThumbnail + var resp FileTypeThumbnail - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalFileTypeUnknown(data json.RawMessage) (*FileTypeUnknown, error) { - var resp FileTypeUnknown + var resp FileTypeUnknown - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalFileTypeVideo(data json.RawMessage) (*FileTypeVideo, error) { - var resp FileTypeVideo + var resp FileTypeVideo - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalFileTypeVideoNote(data json.RawMessage) (*FileTypeVideoNote, error) { - var resp FileTypeVideoNote + var resp FileTypeVideoNote - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err +} + +func UnmarshalFileTypeVideoStory(data json.RawMessage) (*FileTypeVideoStory, error) { + var resp FileTypeVideoStory + + err := json.Unmarshal(data, &resp) + + return &resp, err } func UnmarshalFileTypeVoiceNote(data json.RawMessage) (*FileTypeVoiceNote, error) { - var resp FileTypeVoiceNote + var resp FileTypeVoiceNote - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalFileTypeWallpaper(data json.RawMessage) (*FileTypeWallpaper, error) { - var resp FileTypeWallpaper + var resp FileTypeWallpaper - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalStorageStatisticsByFileType(data json.RawMessage) (*StorageStatisticsByFileType, error) { - var resp StorageStatisticsByFileType + var resp StorageStatisticsByFileType - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalStorageStatisticsByChat(data json.RawMessage) (*StorageStatisticsByChat, error) { - var resp StorageStatisticsByChat + var resp StorageStatisticsByChat - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalStorageStatistics(data json.RawMessage) (*StorageStatistics, error) { - var resp StorageStatistics + var resp StorageStatistics - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalStorageStatisticsFast(data json.RawMessage) (*StorageStatisticsFast, error) { - var resp StorageStatisticsFast + var resp StorageStatisticsFast - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalDatabaseStatistics(data json.RawMessage) (*DatabaseStatistics, error) { - var resp DatabaseStatistics + var resp DatabaseStatistics - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalNetworkTypeNone(data json.RawMessage) (*NetworkTypeNone, error) { - var resp NetworkTypeNone + var resp NetworkTypeNone - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalNetworkTypeMobile(data json.RawMessage) (*NetworkTypeMobile, error) { - var resp NetworkTypeMobile + var resp NetworkTypeMobile - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalNetworkTypeMobileRoaming(data json.RawMessage) (*NetworkTypeMobileRoaming, error) { - var resp NetworkTypeMobileRoaming + var resp NetworkTypeMobileRoaming - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalNetworkTypeWiFi(data json.RawMessage) (*NetworkTypeWiFi, error) { - var resp NetworkTypeWiFi + var resp NetworkTypeWiFi - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalNetworkTypeOther(data json.RawMessage) (*NetworkTypeOther, error) { - var resp NetworkTypeOther + var resp NetworkTypeOther - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalNetworkStatisticsEntryFile(data json.RawMessage) (*NetworkStatisticsEntryFile, error) { - var resp NetworkStatisticsEntryFile + var resp NetworkStatisticsEntryFile - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalNetworkStatisticsEntryCall(data json.RawMessage) (*NetworkStatisticsEntryCall, error) { - var resp NetworkStatisticsEntryCall + var resp NetworkStatisticsEntryCall - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalNetworkStatistics(data json.RawMessage) (*NetworkStatistics, error) { - var resp NetworkStatistics + var resp NetworkStatistics - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalAutoDownloadSettings(data json.RawMessage) (*AutoDownloadSettings, error) { - var resp AutoDownloadSettings + var resp AutoDownloadSettings - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalAutoDownloadSettingsPresets(data json.RawMessage) (*AutoDownloadSettingsPresets, error) { - var resp AutoDownloadSettingsPresets + var resp AutoDownloadSettingsPresets - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err +} + +func UnmarshalAutosaveSettingsScopePrivateChats(data json.RawMessage) (*AutosaveSettingsScopePrivateChats, error) { + var resp AutosaveSettingsScopePrivateChats + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalAutosaveSettingsScopeGroupChats(data json.RawMessage) (*AutosaveSettingsScopeGroupChats, error) { + var resp AutosaveSettingsScopeGroupChats + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalAutosaveSettingsScopeChannelChats(data json.RawMessage) (*AutosaveSettingsScopeChannelChats, error) { + var resp AutosaveSettingsScopeChannelChats + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalAutosaveSettingsScopeChat(data json.RawMessage) (*AutosaveSettingsScopeChat, error) { + var resp AutosaveSettingsScopeChat + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalScopeAutosaveSettings(data json.RawMessage) (*ScopeAutosaveSettings, error) { + var resp ScopeAutosaveSettings + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalAutosaveSettingsException(data json.RawMessage) (*AutosaveSettingsException, error) { + var resp AutosaveSettingsException + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalAutosaveSettings(data json.RawMessage) (*AutosaveSettings, error) { + var resp AutosaveSettings + + err := json.Unmarshal(data, &resp) + + return &resp, err } func UnmarshalConnectionStateWaitingForNetwork(data json.RawMessage) (*ConnectionStateWaitingForNetwork, error) { - var resp ConnectionStateWaitingForNetwork + var resp ConnectionStateWaitingForNetwork - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalConnectionStateConnectingToProxy(data json.RawMessage) (*ConnectionStateConnectingToProxy, error) { - var resp ConnectionStateConnectingToProxy + var resp ConnectionStateConnectingToProxy - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalConnectionStateConnecting(data json.RawMessage) (*ConnectionStateConnecting, error) { - var resp ConnectionStateConnecting + var resp ConnectionStateConnecting - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalConnectionStateUpdating(data json.RawMessage) (*ConnectionStateUpdating, error) { - var resp ConnectionStateUpdating + var resp ConnectionStateUpdating - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalConnectionStateReady(data json.RawMessage) (*ConnectionStateReady, error) { - var resp ConnectionStateReady + var resp ConnectionStateReady - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalTopChatCategoryUsers(data json.RawMessage) (*TopChatCategoryUsers, error) { - var resp TopChatCategoryUsers + var resp TopChatCategoryUsers - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalTopChatCategoryBots(data json.RawMessage) (*TopChatCategoryBots, error) { - var resp TopChatCategoryBots + var resp TopChatCategoryBots - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalTopChatCategoryGroups(data json.RawMessage) (*TopChatCategoryGroups, error) { - var resp TopChatCategoryGroups + var resp TopChatCategoryGroups - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalTopChatCategoryChannels(data json.RawMessage) (*TopChatCategoryChannels, error) { - var resp TopChatCategoryChannels + var resp TopChatCategoryChannels - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalTopChatCategoryInlineBots(data json.RawMessage) (*TopChatCategoryInlineBots, error) { - var resp TopChatCategoryInlineBots + var resp TopChatCategoryInlineBots - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalTopChatCategoryCalls(data json.RawMessage) (*TopChatCategoryCalls, error) { - var resp TopChatCategoryCalls + var resp TopChatCategoryCalls - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalTopChatCategoryForwardChats(data json.RawMessage) (*TopChatCategoryForwardChats, error) { - var resp TopChatCategoryForwardChats + var resp TopChatCategoryForwardChats - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err +} + +func UnmarshalFoundPosition(data json.RawMessage) (*FoundPosition, error) { + var resp FoundPosition + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalFoundPositions(data json.RawMessage) (*FoundPositions, error) { + var resp FoundPositions + + err := json.Unmarshal(data, &resp) + + return &resp, err } func UnmarshalTMeUrlTypeUser(data json.RawMessage) (*TMeUrlTypeUser, error) { - var resp TMeUrlTypeUser + var resp TMeUrlTypeUser - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalTMeUrlTypeSupergroup(data json.RawMessage) (*TMeUrlTypeSupergroup, error) { - var resp TMeUrlTypeSupergroup + var resp TMeUrlTypeSupergroup - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalTMeUrlTypeChatInvite(data json.RawMessage) (*TMeUrlTypeChatInvite, error) { - var resp TMeUrlTypeChatInvite + var resp TMeUrlTypeChatInvite - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalTMeUrlTypeStickerSet(data json.RawMessage) (*TMeUrlTypeStickerSet, error) { - var resp TMeUrlTypeStickerSet + var resp TMeUrlTypeStickerSet - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalTMeUrl(data json.RawMessage) (*TMeUrl, error) { - var resp TMeUrl + var resp TMeUrl - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalTMeUrls(data json.RawMessage) (*TMeUrls, error) { - var resp TMeUrls + var resp TMeUrls - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalSuggestedActionEnableArchiveAndMuteNewChats(data json.RawMessage) (*SuggestedActionEnableArchiveAndMuteNewChats, error) { - var resp SuggestedActionEnableArchiveAndMuteNewChats + var resp SuggestedActionEnableArchiveAndMuteNewChats - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalSuggestedActionCheckPassword(data json.RawMessage) (*SuggestedActionCheckPassword, error) { - var resp SuggestedActionCheckPassword + var resp SuggestedActionCheckPassword - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalSuggestedActionCheckPhoneNumber(data json.RawMessage) (*SuggestedActionCheckPhoneNumber, error) { - var resp SuggestedActionCheckPhoneNumber + var resp SuggestedActionCheckPhoneNumber - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalSuggestedActionViewChecksHint(data json.RawMessage) (*SuggestedActionViewChecksHint, error) { - var resp SuggestedActionViewChecksHint + var resp SuggestedActionViewChecksHint - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalSuggestedActionConvertToBroadcastGroup(data json.RawMessage) (*SuggestedActionConvertToBroadcastGroup, error) { - var resp SuggestedActionConvertToBroadcastGroup + var resp SuggestedActionConvertToBroadcastGroup - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalSuggestedActionSetPassword(data json.RawMessage) (*SuggestedActionSetPassword, error) { - var resp SuggestedActionSetPassword + var resp SuggestedActionSetPassword - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err +} + +func UnmarshalSuggestedActionUpgradePremium(data json.RawMessage) (*SuggestedActionUpgradePremium, error) { + var resp SuggestedActionUpgradePremium + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSuggestedActionRestorePremium(data json.RawMessage) (*SuggestedActionRestorePremium, error) { + var resp SuggestedActionRestorePremium + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSuggestedActionSubscribeToAnnualPremium(data json.RawMessage) (*SuggestedActionSubscribeToAnnualPremium, error) { + var resp SuggestedActionSubscribeToAnnualPremium + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSuggestedActionGiftPremiumForChristmas(data json.RawMessage) (*SuggestedActionGiftPremiumForChristmas, error) { + var resp SuggestedActionGiftPremiumForChristmas + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSuggestedActionSetBirthdate(data json.RawMessage) (*SuggestedActionSetBirthdate, error) { + var resp SuggestedActionSetBirthdate + + err := json.Unmarshal(data, &resp) + + return &resp, err } func UnmarshalCount(data json.RawMessage) (*Count, error) { - var resp Count + var resp Count - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalText(data json.RawMessage) (*Text, error) { - var resp Text + var resp Text - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalSeconds(data json.RawMessage) (*Seconds, error) { - var resp Seconds + var resp Seconds - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalFileDownloadedPrefixSize(data json.RawMessage) (*FileDownloadedPrefixSize, error) { - var resp FileDownloadedPrefixSize + var resp FileDownloadedPrefixSize - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalDeepLinkInfo(data json.RawMessage) (*DeepLinkInfo, error) { - var resp DeepLinkInfo + var resp DeepLinkInfo - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalTextParseModeMarkdown(data json.RawMessage) (*TextParseModeMarkdown, error) { - var resp TextParseModeMarkdown + var resp TextParseModeMarkdown - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalTextParseModeHTML(data json.RawMessage) (*TextParseModeHTML, error) { - var resp TextParseModeHTML + var resp TextParseModeHTML - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalProxyTypeSocks5(data json.RawMessage) (*ProxyTypeSocks5, error) { - var resp ProxyTypeSocks5 + var resp ProxyTypeSocks5 - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalProxyTypeHttp(data json.RawMessage) (*ProxyTypeHttp, error) { - var resp ProxyTypeHttp + var resp ProxyTypeHttp - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalProxyTypeMtproto(data json.RawMessage) (*ProxyTypeMtproto, error) { - var resp ProxyTypeMtproto + var resp ProxyTypeMtproto - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalProxy(data json.RawMessage) (*Proxy, error) { - var resp Proxy + var resp Proxy - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalProxies(data json.RawMessage) (*Proxies, error) { - var resp Proxies + var resp Proxies - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalInputSticker(data json.RawMessage) (*InputSticker, error) { - var resp InputSticker + var resp InputSticker - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalDateRange(data json.RawMessage) (*DateRange, error) { - var resp DateRange + var resp DateRange - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalStatisticalValue(data json.RawMessage) (*StatisticalValue, error) { - var resp StatisticalValue + var resp StatisticalValue - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalStatisticalGraphData(data json.RawMessage) (*StatisticalGraphData, error) { - var resp StatisticalGraphData + var resp StatisticalGraphData - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalStatisticalGraphAsync(data json.RawMessage) (*StatisticalGraphAsync, error) { - var resp StatisticalGraphAsync + var resp StatisticalGraphAsync - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalStatisticalGraphError(data json.RawMessage) (*StatisticalGraphError, error) { - var resp StatisticalGraphError + var resp StatisticalGraphError - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } -func UnmarshalChatStatisticsMessageInteractionInfo(data json.RawMessage) (*ChatStatisticsMessageInteractionInfo, error) { - var resp ChatStatisticsMessageInteractionInfo +func UnmarshalChatStatisticsObjectTypeMessage(data json.RawMessage) (*ChatStatisticsObjectTypeMessage, error) { + var resp ChatStatisticsObjectTypeMessage - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err +} + +func UnmarshalChatStatisticsObjectTypeStory(data json.RawMessage) (*ChatStatisticsObjectTypeStory, error) { + var resp ChatStatisticsObjectTypeStory + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatStatisticsInteractionInfo(data json.RawMessage) (*ChatStatisticsInteractionInfo, error) { + var resp ChatStatisticsInteractionInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err } func UnmarshalChatStatisticsMessageSenderInfo(data json.RawMessage) (*ChatStatisticsMessageSenderInfo, error) { - var resp ChatStatisticsMessageSenderInfo + var resp ChatStatisticsMessageSenderInfo - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalChatStatisticsAdministratorActionsInfo(data json.RawMessage) (*ChatStatisticsAdministratorActionsInfo, error) { - var resp ChatStatisticsAdministratorActionsInfo + var resp ChatStatisticsAdministratorActionsInfo - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalChatStatisticsInviterInfo(data json.RawMessage) (*ChatStatisticsInviterInfo, error) { - var resp ChatStatisticsInviterInfo + var resp ChatStatisticsInviterInfo - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalChatStatisticsSupergroup(data json.RawMessage) (*ChatStatisticsSupergroup, error) { - var resp ChatStatisticsSupergroup + var resp ChatStatisticsSupergroup - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalChatStatisticsChannel(data json.RawMessage) (*ChatStatisticsChannel, error) { - var resp ChatStatisticsChannel + var resp ChatStatisticsChannel - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalMessageStatistics(data json.RawMessage) (*MessageStatistics, error) { - var resp MessageStatistics + var resp MessageStatistics - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err +} + +func UnmarshalStoryStatistics(data json.RawMessage) (*StoryStatistics, error) { + var resp StoryStatistics + + err := json.Unmarshal(data, &resp) + + return &resp, err } func UnmarshalPoint(data json.RawMessage) (*Point, error) { - var resp Point + var resp Point - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalVectorPathCommandLine(data json.RawMessage) (*VectorPathCommandLine, error) { - var resp VectorPathCommandLine + var resp VectorPathCommandLine - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalVectorPathCommandCubicBezierCurve(data json.RawMessage) (*VectorPathCommandCubicBezierCurve, error) { - var resp VectorPathCommandCubicBezierCurve + var resp VectorPathCommandCubicBezierCurve - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalBotCommandScopeDefault(data json.RawMessage) (*BotCommandScopeDefault, error) { - var resp BotCommandScopeDefault + var resp BotCommandScopeDefault - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalBotCommandScopeAllPrivateChats(data json.RawMessage) (*BotCommandScopeAllPrivateChats, error) { - var resp BotCommandScopeAllPrivateChats + var resp BotCommandScopeAllPrivateChats - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalBotCommandScopeAllGroupChats(data json.RawMessage) (*BotCommandScopeAllGroupChats, error) { - var resp BotCommandScopeAllGroupChats + var resp BotCommandScopeAllGroupChats - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalBotCommandScopeAllChatAdministrators(data json.RawMessage) (*BotCommandScopeAllChatAdministrators, error) { - var resp BotCommandScopeAllChatAdministrators + var resp BotCommandScopeAllChatAdministrators - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalBotCommandScopeChat(data json.RawMessage) (*BotCommandScopeChat, error) { - var resp BotCommandScopeChat + var resp BotCommandScopeChat - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalBotCommandScopeChatAdministrators(data json.RawMessage) (*BotCommandScopeChatAdministrators, error) { - var resp BotCommandScopeChatAdministrators + var resp BotCommandScopeChatAdministrators - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalBotCommandScopeChatMember(data json.RawMessage) (*BotCommandScopeChatMember, error) { - var resp BotCommandScopeChatMember + var resp BotCommandScopeChatMember - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateAuthorizationState(data json.RawMessage) (*UpdateAuthorizationState, error) { - var resp UpdateAuthorizationState + var resp UpdateAuthorizationState - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateNewMessage(data json.RawMessage) (*UpdateNewMessage, error) { - var resp UpdateNewMessage + var resp UpdateNewMessage - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateMessageSendAcknowledged(data json.RawMessage) (*UpdateMessageSendAcknowledged, error) { - var resp UpdateMessageSendAcknowledged + var resp UpdateMessageSendAcknowledged - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateMessageSendSucceeded(data json.RawMessage) (*UpdateMessageSendSucceeded, error) { - var resp UpdateMessageSendSucceeded + var resp UpdateMessageSendSucceeded - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateMessageSendFailed(data json.RawMessage) (*UpdateMessageSendFailed, error) { - var resp UpdateMessageSendFailed + var resp UpdateMessageSendFailed - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateMessageContent(data json.RawMessage) (*UpdateMessageContent, error) { - var resp UpdateMessageContent + var resp UpdateMessageContent - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateMessageEdited(data json.RawMessage) (*UpdateMessageEdited, error) { - var resp UpdateMessageEdited + var resp UpdateMessageEdited - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateMessageIsPinned(data json.RawMessage) (*UpdateMessageIsPinned, error) { - var resp UpdateMessageIsPinned + var resp UpdateMessageIsPinned - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateMessageInteractionInfo(data json.RawMessage) (*UpdateMessageInteractionInfo, error) { - var resp UpdateMessageInteractionInfo + var resp UpdateMessageInteractionInfo - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateMessageContentOpened(data json.RawMessage) (*UpdateMessageContentOpened, error) { - var resp UpdateMessageContentOpened + var resp UpdateMessageContentOpened - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateMessageMentionRead(data json.RawMessage) (*UpdateMessageMentionRead, error) { - var resp UpdateMessageMentionRead + var resp UpdateMessageMentionRead - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateMessageUnreadReactions(data json.RawMessage) (*UpdateMessageUnreadReactions, error) { - var resp UpdateMessageUnreadReactions + var resp UpdateMessageUnreadReactions - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateMessageLiveLocationViewed(data json.RawMessage) (*UpdateMessageLiveLocationViewed, error) { - var resp UpdateMessageLiveLocationViewed + var resp UpdateMessageLiveLocationViewed - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateNewChat(data json.RawMessage) (*UpdateNewChat, error) { - var resp UpdateNewChat + var resp UpdateNewChat - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateChatTitle(data json.RawMessage) (*UpdateChatTitle, error) { - var resp UpdateChatTitle + var resp UpdateChatTitle - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateChatPhoto(data json.RawMessage) (*UpdateChatPhoto, error) { - var resp UpdateChatPhoto + var resp UpdateChatPhoto - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err +} + +func UnmarshalUpdateChatAccentColors(data json.RawMessage) (*UpdateChatAccentColors, error) { + var resp UpdateChatAccentColors + + err := json.Unmarshal(data, &resp) + + return &resp, err } func UnmarshalUpdateChatPermissions(data json.RawMessage) (*UpdateChatPermissions, error) { - var resp UpdateChatPermissions + var resp UpdateChatPermissions - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateChatLastMessage(data json.RawMessage) (*UpdateChatLastMessage, error) { - var resp UpdateChatLastMessage + var resp UpdateChatLastMessage - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateChatPosition(data json.RawMessage) (*UpdateChatPosition, error) { - var resp UpdateChatPosition + var resp UpdateChatPosition - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err +} + +func UnmarshalUpdateChatAddedToList(data json.RawMessage) (*UpdateChatAddedToList, error) { + var resp UpdateChatAddedToList + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateChatRemovedFromList(data json.RawMessage) (*UpdateChatRemovedFromList, error) { + var resp UpdateChatRemovedFromList + + err := json.Unmarshal(data, &resp) + + return &resp, err } func UnmarshalUpdateChatReadInbox(data json.RawMessage) (*UpdateChatReadInbox, error) { - var resp UpdateChatReadInbox + var resp UpdateChatReadInbox - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateChatReadOutbox(data json.RawMessage) (*UpdateChatReadOutbox, error) { - var resp UpdateChatReadOutbox + var resp UpdateChatReadOutbox - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateChatActionBar(data json.RawMessage) (*UpdateChatActionBar, error) { - var resp UpdateChatActionBar + var resp UpdateChatActionBar - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateChatAvailableReactions(data json.RawMessage) (*UpdateChatAvailableReactions, error) { - var resp UpdateChatAvailableReactions + var resp UpdateChatAvailableReactions - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateChatDraftMessage(data json.RawMessage) (*UpdateChatDraftMessage, error) { - var resp UpdateChatDraftMessage + var resp UpdateChatDraftMessage - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err +} + +func UnmarshalUpdateChatEmojiStatus(data json.RawMessage) (*UpdateChatEmojiStatus, error) { + var resp UpdateChatEmojiStatus + + err := json.Unmarshal(data, &resp) + + return &resp, err } func UnmarshalUpdateChatMessageSender(data json.RawMessage) (*UpdateChatMessageSender, error) { - var resp UpdateChatMessageSender + var resp UpdateChatMessageSender - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateChatMessageAutoDeleteTime(data json.RawMessage) (*UpdateChatMessageAutoDeleteTime, error) { - var resp UpdateChatMessageAutoDeleteTime + var resp UpdateChatMessageAutoDeleteTime - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateChatNotificationSettings(data json.RawMessage) (*UpdateChatNotificationSettings, error) { - var resp UpdateChatNotificationSettings + var resp UpdateChatNotificationSettings - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateChatPendingJoinRequests(data json.RawMessage) (*UpdateChatPendingJoinRequests, error) { - var resp UpdateChatPendingJoinRequests + var resp UpdateChatPendingJoinRequests - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateChatReplyMarkup(data json.RawMessage) (*UpdateChatReplyMarkup, error) { - var resp UpdateChatReplyMarkup + var resp UpdateChatReplyMarkup - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err +} + +func UnmarshalUpdateChatBackground(data json.RawMessage) (*UpdateChatBackground, error) { + var resp UpdateChatBackground + + err := json.Unmarshal(data, &resp) + + return &resp, err } func UnmarshalUpdateChatTheme(data json.RawMessage) (*UpdateChatTheme, error) { - var resp UpdateChatTheme + var resp UpdateChatTheme - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateChatUnreadMentionCount(data json.RawMessage) (*UpdateChatUnreadMentionCount, error) { - var resp UpdateChatUnreadMentionCount + var resp UpdateChatUnreadMentionCount - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateChatUnreadReactionCount(data json.RawMessage) (*UpdateChatUnreadReactionCount, error) { - var resp UpdateChatUnreadReactionCount + var resp UpdateChatUnreadReactionCount - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateChatVideoChat(data json.RawMessage) (*UpdateChatVideoChat, error) { - var resp UpdateChatVideoChat + var resp UpdateChatVideoChat - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateChatDefaultDisableNotification(data json.RawMessage) (*UpdateChatDefaultDisableNotification, error) { - var resp UpdateChatDefaultDisableNotification + var resp UpdateChatDefaultDisableNotification - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateChatHasProtectedContent(data json.RawMessage) (*UpdateChatHasProtectedContent, error) { - var resp UpdateChatHasProtectedContent + var resp UpdateChatHasProtectedContent - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } -func UnmarshalUpdateChatHasScheduledMessages(data json.RawMessage) (*UpdateChatHasScheduledMessages, error) { - var resp UpdateChatHasScheduledMessages +func UnmarshalUpdateChatIsTranslatable(data json.RawMessage) (*UpdateChatIsTranslatable, error) { + var resp UpdateChatIsTranslatable - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err -} - -func UnmarshalUpdateChatIsBlocked(data json.RawMessage) (*UpdateChatIsBlocked, error) { - var resp UpdateChatIsBlocked - - err := json.Unmarshal(data, &resp) - - return &resp, err + return &resp, err } func UnmarshalUpdateChatIsMarkedAsUnread(data json.RawMessage) (*UpdateChatIsMarkedAsUnread, error) { - var resp UpdateChatIsMarkedAsUnread + var resp UpdateChatIsMarkedAsUnread - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } -func UnmarshalUpdateChatFilters(data json.RawMessage) (*UpdateChatFilters, error) { - var resp UpdateChatFilters +func UnmarshalUpdateChatViewAsTopics(data json.RawMessage) (*UpdateChatViewAsTopics, error) { + var resp UpdateChatViewAsTopics - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err +} + +func UnmarshalUpdateChatBlockList(data json.RawMessage) (*UpdateChatBlockList, error) { + var resp UpdateChatBlockList + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateChatHasScheduledMessages(data json.RawMessage) (*UpdateChatHasScheduledMessages, error) { + var resp UpdateChatHasScheduledMessages + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateChatFolders(data json.RawMessage) (*UpdateChatFolders, error) { + var resp UpdateChatFolders + + err := json.Unmarshal(data, &resp) + + return &resp, err } func UnmarshalUpdateChatOnlineMemberCount(data json.RawMessage) (*UpdateChatOnlineMemberCount, error) { - var resp UpdateChatOnlineMemberCount + var resp UpdateChatOnlineMemberCount - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err +} + +func UnmarshalUpdateSavedMessagesTopic(data json.RawMessage) (*UpdateSavedMessagesTopic, error) { + var resp UpdateSavedMessagesTopic + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateSavedMessagesTopicCount(data json.RawMessage) (*UpdateSavedMessagesTopicCount, error) { + var resp UpdateSavedMessagesTopicCount + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateQuickReplyShortcut(data json.RawMessage) (*UpdateQuickReplyShortcut, error) { + var resp UpdateQuickReplyShortcut + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateQuickReplyShortcutDeleted(data json.RawMessage) (*UpdateQuickReplyShortcutDeleted, error) { + var resp UpdateQuickReplyShortcutDeleted + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateQuickReplyShortcuts(data json.RawMessage) (*UpdateQuickReplyShortcuts, error) { + var resp UpdateQuickReplyShortcuts + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateQuickReplyShortcutMessages(data json.RawMessage) (*UpdateQuickReplyShortcutMessages, error) { + var resp UpdateQuickReplyShortcutMessages + + err := json.Unmarshal(data, &resp) + + return &resp, err } func UnmarshalUpdateForumTopicInfo(data json.RawMessage) (*UpdateForumTopicInfo, error) { - var resp UpdateForumTopicInfo + var resp UpdateForumTopicInfo - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateScopeNotificationSettings(data json.RawMessage) (*UpdateScopeNotificationSettings, error) { - var resp UpdateScopeNotificationSettings + var resp UpdateScopeNotificationSettings - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateNotification(data json.RawMessage) (*UpdateNotification, error) { - var resp UpdateNotification + var resp UpdateNotification - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateNotificationGroup(data json.RawMessage) (*UpdateNotificationGroup, error) { - var resp UpdateNotificationGroup + var resp UpdateNotificationGroup - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateActiveNotifications(data json.RawMessage) (*UpdateActiveNotifications, error) { - var resp UpdateActiveNotifications + var resp UpdateActiveNotifications - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateHavePendingNotifications(data json.RawMessage) (*UpdateHavePendingNotifications, error) { - var resp UpdateHavePendingNotifications + var resp UpdateHavePendingNotifications - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateDeleteMessages(data json.RawMessage) (*UpdateDeleteMessages, error) { - var resp UpdateDeleteMessages + var resp UpdateDeleteMessages - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateChatAction(data json.RawMessage) (*UpdateChatAction, error) { - var resp UpdateChatAction + var resp UpdateChatAction - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateUserStatus(data json.RawMessage) (*UpdateUserStatus, error) { - var resp UpdateUserStatus + var resp UpdateUserStatus - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateUser(data json.RawMessage) (*UpdateUser, error) { - var resp UpdateUser + var resp UpdateUser - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateBasicGroup(data json.RawMessage) (*UpdateBasicGroup, error) { - var resp UpdateBasicGroup + var resp UpdateBasicGroup - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateSupergroup(data json.RawMessage) (*UpdateSupergroup, error) { - var resp UpdateSupergroup + var resp UpdateSupergroup - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateSecretChat(data json.RawMessage) (*UpdateSecretChat, error) { - var resp UpdateSecretChat + var resp UpdateSecretChat - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateUserFullInfo(data json.RawMessage) (*UpdateUserFullInfo, error) { - var resp UpdateUserFullInfo + var resp UpdateUserFullInfo - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateBasicGroupFullInfo(data json.RawMessage) (*UpdateBasicGroupFullInfo, error) { - var resp UpdateBasicGroupFullInfo + var resp UpdateBasicGroupFullInfo - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateSupergroupFullInfo(data json.RawMessage) (*UpdateSupergroupFullInfo, error) { - var resp UpdateSupergroupFullInfo + var resp UpdateSupergroupFullInfo - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateServiceNotification(data json.RawMessage) (*UpdateServiceNotification, error) { - var resp UpdateServiceNotification + var resp UpdateServiceNotification - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateFile(data json.RawMessage) (*UpdateFile, error) { - var resp UpdateFile + var resp UpdateFile - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateFileGenerationStart(data json.RawMessage) (*UpdateFileGenerationStart, error) { - var resp UpdateFileGenerationStart + var resp UpdateFileGenerationStart - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateFileGenerationStop(data json.RawMessage) (*UpdateFileGenerationStop, error) { - var resp UpdateFileGenerationStop + var resp UpdateFileGenerationStop - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateFileDownloads(data json.RawMessage) (*UpdateFileDownloads, error) { - var resp UpdateFileDownloads + var resp UpdateFileDownloads - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateFileAddedToDownloads(data json.RawMessage) (*UpdateFileAddedToDownloads, error) { - var resp UpdateFileAddedToDownloads + var resp UpdateFileAddedToDownloads - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateFileDownload(data json.RawMessage) (*UpdateFileDownload, error) { - var resp UpdateFileDownload + var resp UpdateFileDownload - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateFileRemovedFromDownloads(data json.RawMessage) (*UpdateFileRemovedFromDownloads, error) { - var resp UpdateFileRemovedFromDownloads + var resp UpdateFileRemovedFromDownloads - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateCall(data json.RawMessage) (*UpdateCall, error) { - var resp UpdateCall + var resp UpdateCall - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateGroupCall(data json.RawMessage) (*UpdateGroupCall, error) { - var resp UpdateGroupCall + var resp UpdateGroupCall - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateGroupCallParticipant(data json.RawMessage) (*UpdateGroupCallParticipant, error) { - var resp UpdateGroupCallParticipant + var resp UpdateGroupCallParticipant - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateNewCallSignalingData(data json.RawMessage) (*UpdateNewCallSignalingData, error) { - var resp UpdateNewCallSignalingData + var resp UpdateNewCallSignalingData - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateUserPrivacySettingRules(data json.RawMessage) (*UpdateUserPrivacySettingRules, error) { - var resp UpdateUserPrivacySettingRules + var resp UpdateUserPrivacySettingRules - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateUnreadMessageCount(data json.RawMessage) (*UpdateUnreadMessageCount, error) { - var resp UpdateUnreadMessageCount + var resp UpdateUnreadMessageCount - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateUnreadChatCount(data json.RawMessage) (*UpdateUnreadChatCount, error) { - var resp UpdateUnreadChatCount + var resp UpdateUnreadChatCount - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err +} + +func UnmarshalUpdateStory(data json.RawMessage) (*UpdateStory, error) { + var resp UpdateStory + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateStoryDeleted(data json.RawMessage) (*UpdateStoryDeleted, error) { + var resp UpdateStoryDeleted + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateStorySendSucceeded(data json.RawMessage) (*UpdateStorySendSucceeded, error) { + var resp UpdateStorySendSucceeded + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateStorySendFailed(data json.RawMessage) (*UpdateStorySendFailed, error) { + var resp UpdateStorySendFailed + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateChatActiveStories(data json.RawMessage) (*UpdateChatActiveStories, error) { + var resp UpdateChatActiveStories + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateStoryListChatCount(data json.RawMessage) (*UpdateStoryListChatCount, error) { + var resp UpdateStoryListChatCount + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateStoryStealthMode(data json.RawMessage) (*UpdateStoryStealthMode, error) { + var resp UpdateStoryStealthMode + + err := json.Unmarshal(data, &resp) + + return &resp, err } func UnmarshalUpdateOption(data json.RawMessage) (*UpdateOption, error) { - var resp UpdateOption + var resp UpdateOption - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateStickerSet(data json.RawMessage) (*UpdateStickerSet, error) { - var resp UpdateStickerSet + var resp UpdateStickerSet - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateInstalledStickerSets(data json.RawMessage) (*UpdateInstalledStickerSets, error) { - var resp UpdateInstalledStickerSets + var resp UpdateInstalledStickerSets - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateTrendingStickerSets(data json.RawMessage) (*UpdateTrendingStickerSets, error) { - var resp UpdateTrendingStickerSets + var resp UpdateTrendingStickerSets - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateRecentStickers(data json.RawMessage) (*UpdateRecentStickers, error) { - var resp UpdateRecentStickers + var resp UpdateRecentStickers - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateFavoriteStickers(data json.RawMessage) (*UpdateFavoriteStickers, error) { - var resp UpdateFavoriteStickers + var resp UpdateFavoriteStickers - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateSavedAnimations(data json.RawMessage) (*UpdateSavedAnimations, error) { - var resp UpdateSavedAnimations + var resp UpdateSavedAnimations - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateSavedNotificationSounds(data json.RawMessage) (*UpdateSavedNotificationSounds, error) { - var resp UpdateSavedNotificationSounds + var resp UpdateSavedNotificationSounds - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } -func UnmarshalUpdateSelectedBackground(data json.RawMessage) (*UpdateSelectedBackground, error) { - var resp UpdateSelectedBackground +func UnmarshalUpdateDefaultBackground(data json.RawMessage) (*UpdateDefaultBackground, error) { + var resp UpdateDefaultBackground - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateChatThemes(data json.RawMessage) (*UpdateChatThemes, error) { - var resp UpdateChatThemes + var resp UpdateChatThemes - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err +} + +func UnmarshalUpdateAccentColors(data json.RawMessage) (*UpdateAccentColors, error) { + var resp UpdateAccentColors + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateProfileAccentColors(data json.RawMessage) (*UpdateProfileAccentColors, error) { + var resp UpdateProfileAccentColors + + err := json.Unmarshal(data, &resp) + + return &resp, err } func UnmarshalUpdateLanguagePackStrings(data json.RawMessage) (*UpdateLanguagePackStrings, error) { - var resp UpdateLanguagePackStrings + var resp UpdateLanguagePackStrings - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateConnectionState(data json.RawMessage) (*UpdateConnectionState, error) { - var resp UpdateConnectionState + var resp UpdateConnectionState - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateTermsOfService(data json.RawMessage) (*UpdateTermsOfService, error) { - var resp UpdateTermsOfService + var resp UpdateTermsOfService - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateUsersNearby(data json.RawMessage) (*UpdateUsersNearby, error) { - var resp UpdateUsersNearby + var resp UpdateUsersNearby - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err +} + +func UnmarshalUpdateUnconfirmedSession(data json.RawMessage) (*UpdateUnconfirmedSession, error) { + var resp UpdateUnconfirmedSession + + err := json.Unmarshal(data, &resp) + + return &resp, err } func UnmarshalUpdateAttachmentMenuBots(data json.RawMessage) (*UpdateAttachmentMenuBots, error) { - var resp UpdateAttachmentMenuBots + var resp UpdateAttachmentMenuBots - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateWebAppMessageSent(data json.RawMessage) (*UpdateWebAppMessageSent, error) { - var resp UpdateWebAppMessageSent + var resp UpdateWebAppMessageSent - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateActiveEmojiReactions(data json.RawMessage) (*UpdateActiveEmojiReactions, error) { - var resp UpdateActiveEmojiReactions + var resp UpdateActiveEmojiReactions - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateDefaultReactionType(data json.RawMessage) (*UpdateDefaultReactionType, error) { - var resp UpdateDefaultReactionType + var resp UpdateDefaultReactionType - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err +} + +func UnmarshalUpdateSavedMessagesTags(data json.RawMessage) (*UpdateSavedMessagesTags, error) { + var resp UpdateSavedMessagesTags + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateSpeechRecognitionTrial(data json.RawMessage) (*UpdateSpeechRecognitionTrial, error) { + var resp UpdateSpeechRecognitionTrial + + err := json.Unmarshal(data, &resp) + + return &resp, err } func UnmarshalUpdateDiceEmojis(data json.RawMessage) (*UpdateDiceEmojis, error) { - var resp UpdateDiceEmojis + var resp UpdateDiceEmojis - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateAnimatedEmojiMessageClicked(data json.RawMessage) (*UpdateAnimatedEmojiMessageClicked, error) { - var resp UpdateAnimatedEmojiMessageClicked + var resp UpdateAnimatedEmojiMessageClicked - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateAnimationSearchParameters(data json.RawMessage) (*UpdateAnimationSearchParameters, error) { - var resp UpdateAnimationSearchParameters + var resp UpdateAnimationSearchParameters - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateSuggestedActions(data json.RawMessage) (*UpdateSuggestedActions, error) { - var resp UpdateSuggestedActions + var resp UpdateSuggestedActions - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err +} + +func UnmarshalUpdateContactCloseBirthdays(data json.RawMessage) (*UpdateContactCloseBirthdays, error) { + var resp UpdateContactCloseBirthdays + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateAddChatMembersPrivacyForbidden(data json.RawMessage) (*UpdateAddChatMembersPrivacyForbidden, error) { + var resp UpdateAddChatMembersPrivacyForbidden + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateAutosaveSettings(data json.RawMessage) (*UpdateAutosaveSettings, error) { + var resp UpdateAutosaveSettings + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateBusinessConnection(data json.RawMessage) (*UpdateBusinessConnection, error) { + var resp UpdateBusinessConnection + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateNewBusinessMessage(data json.RawMessage) (*UpdateNewBusinessMessage, error) { + var resp UpdateNewBusinessMessage + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateBusinessMessageEdited(data json.RawMessage) (*UpdateBusinessMessageEdited, error) { + var resp UpdateBusinessMessageEdited + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateBusinessMessagesDeleted(data json.RawMessage) (*UpdateBusinessMessagesDeleted, error) { + var resp UpdateBusinessMessagesDeleted + + err := json.Unmarshal(data, &resp) + + return &resp, err } func UnmarshalUpdateNewInlineQuery(data json.RawMessage) (*UpdateNewInlineQuery, error) { - var resp UpdateNewInlineQuery + var resp UpdateNewInlineQuery - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateNewChosenInlineResult(data json.RawMessage) (*UpdateNewChosenInlineResult, error) { - var resp UpdateNewChosenInlineResult + var resp UpdateNewChosenInlineResult - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateNewCallbackQuery(data json.RawMessage) (*UpdateNewCallbackQuery, error) { - var resp UpdateNewCallbackQuery + var resp UpdateNewCallbackQuery - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateNewInlineCallbackQuery(data json.RawMessage) (*UpdateNewInlineCallbackQuery, error) { - var resp UpdateNewInlineCallbackQuery + var resp UpdateNewInlineCallbackQuery - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateNewShippingQuery(data json.RawMessage) (*UpdateNewShippingQuery, error) { - var resp UpdateNewShippingQuery + var resp UpdateNewShippingQuery - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateNewPreCheckoutQuery(data json.RawMessage) (*UpdateNewPreCheckoutQuery, error) { - var resp UpdateNewPreCheckoutQuery + var resp UpdateNewPreCheckoutQuery - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateNewCustomEvent(data json.RawMessage) (*UpdateNewCustomEvent, error) { - var resp UpdateNewCustomEvent + var resp UpdateNewCustomEvent - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateNewCustomQuery(data json.RawMessage) (*UpdateNewCustomQuery, error) { - var resp UpdateNewCustomQuery + var resp UpdateNewCustomQuery - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdatePoll(data json.RawMessage) (*UpdatePoll, error) { - var resp UpdatePoll + var resp UpdatePoll - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdatePollAnswer(data json.RawMessage) (*UpdatePollAnswer, error) { - var resp UpdatePollAnswer + var resp UpdatePollAnswer - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateChatMember(data json.RawMessage) (*UpdateChatMember, error) { - var resp UpdateChatMember + var resp UpdateChatMember - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUpdateNewChatJoinRequest(data json.RawMessage) (*UpdateNewChatJoinRequest, error) { - var resp UpdateNewChatJoinRequest + var resp UpdateNewChatJoinRequest - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err +} + +func UnmarshalUpdateChatBoost(data json.RawMessage) (*UpdateChatBoost, error) { + var resp UpdateChatBoost + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateMessageReaction(data json.RawMessage) (*UpdateMessageReaction, error) { + var resp UpdateMessageReaction + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateMessageReactions(data json.RawMessage) (*UpdateMessageReactions, error) { + var resp UpdateMessageReactions + + err := json.Unmarshal(data, &resp) + + return &resp, err } func UnmarshalUpdates(data json.RawMessage) (*Updates, error) { - var resp Updates + var resp Updates - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalLogStreamDefault(data json.RawMessage) (*LogStreamDefault, error) { - var resp LogStreamDefault + var resp LogStreamDefault - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalLogStreamFile(data json.RawMessage) (*LogStreamFile, error) { - var resp LogStreamFile + var resp LogStreamFile - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalLogStreamEmpty(data json.RawMessage) (*LogStreamEmpty, error) { - var resp LogStreamEmpty + var resp LogStreamEmpty - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalLogVerbosityLevel(data json.RawMessage) (*LogVerbosityLevel, error) { - var resp LogVerbosityLevel + var resp LogVerbosityLevel - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalLogTags(data json.RawMessage) (*LogTags, error) { - var resp LogTags + var resp LogTags - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalUserSupportInfo(data json.RawMessage) (*UserSupportInfo, error) { - var resp UserSupportInfo + var resp UserSupportInfo - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalTestInt(data json.RawMessage) (*TestInt, error) { - var resp TestInt + var resp TestInt - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalTestString(data json.RawMessage) (*TestString, error) { - var resp TestString + var resp TestString - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalTestBytes(data json.RawMessage) (*TestBytes, error) { - var resp TestBytes + var resp TestBytes - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalTestVectorInt(data json.RawMessage) (*TestVectorInt, error) { - var resp TestVectorInt + var resp TestVectorInt - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalTestVectorIntObject(data json.RawMessage) (*TestVectorIntObject, error) { - var resp TestVectorIntObject + var resp TestVectorIntObject - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalTestVectorString(data json.RawMessage) (*TestVectorString, error) { - var resp TestVectorString + var resp TestVectorString - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalTestVectorStringObject(data json.RawMessage) (*TestVectorStringObject, error) { - var resp TestVectorStringObject + var resp TestVectorStringObject - err := json.Unmarshal(data, &resp) + err := json.Unmarshal(data, &resp) - return &resp, err + return &resp, err } func UnmarshalType(data json.RawMessage) (Type, error) { - var meta meta + var meta meta - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } - switch meta.Type { - case TypeError: - return UnmarshalError(data) + switch meta.Type { + case TypeError: + return UnmarshalError(data) - case TypeOk: - return UnmarshalOk(data) + case TypeOk: + return UnmarshalOk(data) - case TypeAuthenticationCodeTypeTelegramMessage: - return UnmarshalAuthenticationCodeTypeTelegramMessage(data) + case TypeAuthenticationCodeTypeTelegramMessage: + return UnmarshalAuthenticationCodeTypeTelegramMessage(data) - case TypeAuthenticationCodeTypeSms: - return UnmarshalAuthenticationCodeTypeSms(data) + case TypeAuthenticationCodeTypeSms: + return UnmarshalAuthenticationCodeTypeSms(data) - case TypeAuthenticationCodeTypeCall: - return UnmarshalAuthenticationCodeTypeCall(data) + case TypeAuthenticationCodeTypeCall: + return UnmarshalAuthenticationCodeTypeCall(data) - case TypeAuthenticationCodeTypeFlashCall: - return UnmarshalAuthenticationCodeTypeFlashCall(data) + case TypeAuthenticationCodeTypeFlashCall: + return UnmarshalAuthenticationCodeTypeFlashCall(data) - case TypeAuthenticationCodeTypeMissedCall: - return UnmarshalAuthenticationCodeTypeMissedCall(data) + case TypeAuthenticationCodeTypeMissedCall: + return UnmarshalAuthenticationCodeTypeMissedCall(data) - case TypeAuthenticationCodeTypeFragment: - return UnmarshalAuthenticationCodeTypeFragment(data) + case TypeAuthenticationCodeTypeFragment: + return UnmarshalAuthenticationCodeTypeFragment(data) - case TypeAuthenticationCodeInfo: - return UnmarshalAuthenticationCodeInfo(data) + case TypeAuthenticationCodeTypeFirebaseAndroid: + return UnmarshalAuthenticationCodeTypeFirebaseAndroid(data) - case TypeEmailAddressAuthenticationCodeInfo: - return UnmarshalEmailAddressAuthenticationCodeInfo(data) + case TypeAuthenticationCodeTypeFirebaseIos: + return UnmarshalAuthenticationCodeTypeFirebaseIos(data) - case TypeEmailAddressAuthenticationCode: - return UnmarshalEmailAddressAuthenticationCode(data) + case TypeAuthenticationCodeInfo: + return UnmarshalAuthenticationCodeInfo(data) - case TypeEmailAddressAuthenticationAppleId: - return UnmarshalEmailAddressAuthenticationAppleId(data) + case TypeEmailAddressAuthenticationCodeInfo: + return UnmarshalEmailAddressAuthenticationCodeInfo(data) - case TypeEmailAddressAuthenticationGoogleId: - return UnmarshalEmailAddressAuthenticationGoogleId(data) + case TypeEmailAddressAuthenticationCode: + return UnmarshalEmailAddressAuthenticationCode(data) - case TypeTextEntity: - return UnmarshalTextEntity(data) + case TypeEmailAddressAuthenticationAppleId: + return UnmarshalEmailAddressAuthenticationAppleId(data) - case TypeTextEntities: - return UnmarshalTextEntities(data) + case TypeEmailAddressAuthenticationGoogleId: + return UnmarshalEmailAddressAuthenticationGoogleId(data) - case TypeFormattedText: - return UnmarshalFormattedText(data) + case TypeEmailAddressResetStateAvailable: + return UnmarshalEmailAddressResetStateAvailable(data) - case TypeTermsOfService: - return UnmarshalTermsOfService(data) + case TypeEmailAddressResetStatePending: + return UnmarshalEmailAddressResetStatePending(data) - case TypeAuthorizationStateWaitTdlibParameters: - return UnmarshalAuthorizationStateWaitTdlibParameters(data) + case TypeTextEntity: + return UnmarshalTextEntity(data) - case TypeAuthorizationStateWaitPhoneNumber: - return UnmarshalAuthorizationStateWaitPhoneNumber(data) + case TypeTextEntities: + return UnmarshalTextEntities(data) - case TypeAuthorizationStateWaitEmailAddress: - return UnmarshalAuthorizationStateWaitEmailAddress(data) + case TypeFormattedText: + return UnmarshalFormattedText(data) - case TypeAuthorizationStateWaitEmailCode: - return UnmarshalAuthorizationStateWaitEmailCode(data) + case TypeTermsOfService: + return UnmarshalTermsOfService(data) - case TypeAuthorizationStateWaitCode: - return UnmarshalAuthorizationStateWaitCode(data) + case TypeAuthorizationStateWaitTdlibParameters: + return UnmarshalAuthorizationStateWaitTdlibParameters(data) - case TypeAuthorizationStateWaitOtherDeviceConfirmation: - return UnmarshalAuthorizationStateWaitOtherDeviceConfirmation(data) + case TypeAuthorizationStateWaitPhoneNumber: + return UnmarshalAuthorizationStateWaitPhoneNumber(data) - case TypeAuthorizationStateWaitRegistration: - return UnmarshalAuthorizationStateWaitRegistration(data) + case TypeAuthorizationStateWaitEmailAddress: + return UnmarshalAuthorizationStateWaitEmailAddress(data) - case TypeAuthorizationStateWaitPassword: - return UnmarshalAuthorizationStateWaitPassword(data) + case TypeAuthorizationStateWaitEmailCode: + return UnmarshalAuthorizationStateWaitEmailCode(data) - case TypeAuthorizationStateReady: - return UnmarshalAuthorizationStateReady(data) + case TypeAuthorizationStateWaitCode: + return UnmarshalAuthorizationStateWaitCode(data) - case TypeAuthorizationStateLoggingOut: - return UnmarshalAuthorizationStateLoggingOut(data) + case TypeAuthorizationStateWaitOtherDeviceConfirmation: + return UnmarshalAuthorizationStateWaitOtherDeviceConfirmation(data) - case TypeAuthorizationStateClosing: - return UnmarshalAuthorizationStateClosing(data) + case TypeAuthorizationStateWaitRegistration: + return UnmarshalAuthorizationStateWaitRegistration(data) - case TypeAuthorizationStateClosed: - return UnmarshalAuthorizationStateClosed(data) + case TypeAuthorizationStateWaitPassword: + return UnmarshalAuthorizationStateWaitPassword(data) - case TypePasswordState: - return UnmarshalPasswordState(data) + case TypeAuthorizationStateReady: + return UnmarshalAuthorizationStateReady(data) - case TypeRecoveryEmailAddress: - return UnmarshalRecoveryEmailAddress(data) + case TypeAuthorizationStateLoggingOut: + return UnmarshalAuthorizationStateLoggingOut(data) - case TypeTemporaryPasswordState: - return UnmarshalTemporaryPasswordState(data) + case TypeAuthorizationStateClosing: + return UnmarshalAuthorizationStateClosing(data) - case TypeLocalFile: - return UnmarshalLocalFile(data) + case TypeAuthorizationStateClosed: + return UnmarshalAuthorizationStateClosed(data) - case TypeRemoteFile: - return UnmarshalRemoteFile(data) + case TypePasswordState: + return UnmarshalPasswordState(data) - case TypeFile: - return UnmarshalFile(data) + case TypeRecoveryEmailAddress: + return UnmarshalRecoveryEmailAddress(data) - case TypeInputFileId: - return UnmarshalInputFileId(data) + case TypeTemporaryPasswordState: + return UnmarshalTemporaryPasswordState(data) - case TypeInputFileRemote: - return UnmarshalInputFileRemote(data) + case TypeLocalFile: + return UnmarshalLocalFile(data) - case TypeInputFileLocal: - return UnmarshalInputFileLocal(data) + case TypeRemoteFile: + return UnmarshalRemoteFile(data) - case TypeInputFileGenerated: - return UnmarshalInputFileGenerated(data) + case TypeFile: + return UnmarshalFile(data) - case TypePhotoSize: - return UnmarshalPhotoSize(data) + case TypeInputFileId: + return UnmarshalInputFileId(data) - case TypeMinithumbnail: - return UnmarshalMinithumbnail(data) + case TypeInputFileRemote: + return UnmarshalInputFileRemote(data) - case TypeThumbnailFormatJpeg: - return UnmarshalThumbnailFormatJpeg(data) + case TypeInputFileLocal: + return UnmarshalInputFileLocal(data) - case TypeThumbnailFormatGif: - return UnmarshalThumbnailFormatGif(data) + case TypeInputFileGenerated: + return UnmarshalInputFileGenerated(data) - case TypeThumbnailFormatMpeg4: - return UnmarshalThumbnailFormatMpeg4(data) + case TypePhotoSize: + return UnmarshalPhotoSize(data) - case TypeThumbnailFormatPng: - return UnmarshalThumbnailFormatPng(data) + case TypeMinithumbnail: + return UnmarshalMinithumbnail(data) - case TypeThumbnailFormatTgs: - return UnmarshalThumbnailFormatTgs(data) + case TypeThumbnailFormatJpeg: + return UnmarshalThumbnailFormatJpeg(data) - case TypeThumbnailFormatWebm: - return UnmarshalThumbnailFormatWebm(data) + case TypeThumbnailFormatGif: + return UnmarshalThumbnailFormatGif(data) - case TypeThumbnailFormatWebp: - return UnmarshalThumbnailFormatWebp(data) + case TypeThumbnailFormatMpeg4: + return UnmarshalThumbnailFormatMpeg4(data) - case TypeThumbnail: - return UnmarshalThumbnail(data) + case TypeThumbnailFormatPng: + return UnmarshalThumbnailFormatPng(data) - case TypeMaskPointForehead: - return UnmarshalMaskPointForehead(data) + case TypeThumbnailFormatTgs: + return UnmarshalThumbnailFormatTgs(data) - case TypeMaskPointEyes: - return UnmarshalMaskPointEyes(data) + case TypeThumbnailFormatWebm: + return UnmarshalThumbnailFormatWebm(data) - case TypeMaskPointMouth: - return UnmarshalMaskPointMouth(data) + case TypeThumbnailFormatWebp: + return UnmarshalThumbnailFormatWebp(data) - case TypeMaskPointChin: - return UnmarshalMaskPointChin(data) + case TypeThumbnail: + return UnmarshalThumbnail(data) - case TypeMaskPosition: - return UnmarshalMaskPosition(data) + case TypeMaskPointForehead: + return UnmarshalMaskPointForehead(data) - case TypeStickerFormatWebp: - return UnmarshalStickerFormatWebp(data) + case TypeMaskPointEyes: + return UnmarshalMaskPointEyes(data) - case TypeStickerFormatTgs: - return UnmarshalStickerFormatTgs(data) + case TypeMaskPointMouth: + return UnmarshalMaskPointMouth(data) - case TypeStickerFormatWebm: - return UnmarshalStickerFormatWebm(data) + case TypeMaskPointChin: + return UnmarshalMaskPointChin(data) - case TypeStickerTypeRegular: - return UnmarshalStickerTypeRegular(data) + case TypeMaskPosition: + return UnmarshalMaskPosition(data) - case TypeStickerTypeMask: - return UnmarshalStickerTypeMask(data) + case TypeStickerFormatWebp: + return UnmarshalStickerFormatWebp(data) - case TypeStickerTypeCustomEmoji: - return UnmarshalStickerTypeCustomEmoji(data) + case TypeStickerFormatTgs: + return UnmarshalStickerFormatTgs(data) - case TypeStickerFullTypeRegular: - return UnmarshalStickerFullTypeRegular(data) + case TypeStickerFormatWebm: + return UnmarshalStickerFormatWebm(data) - case TypeStickerFullTypeMask: - return UnmarshalStickerFullTypeMask(data) + case TypeStickerTypeRegular: + return UnmarshalStickerTypeRegular(data) - case TypeStickerFullTypeCustomEmoji: - return UnmarshalStickerFullTypeCustomEmoji(data) + case TypeStickerTypeMask: + return UnmarshalStickerTypeMask(data) - case TypeClosedVectorPath: - return UnmarshalClosedVectorPath(data) + case TypeStickerTypeCustomEmoji: + return UnmarshalStickerTypeCustomEmoji(data) - case TypePollOption: - return UnmarshalPollOption(data) + case TypeStickerFullTypeRegular: + return UnmarshalStickerFullTypeRegular(data) - case TypePollTypeRegular: - return UnmarshalPollTypeRegular(data) + case TypeStickerFullTypeMask: + return UnmarshalStickerFullTypeMask(data) - case TypePollTypeQuiz: - return UnmarshalPollTypeQuiz(data) + case TypeStickerFullTypeCustomEmoji: + return UnmarshalStickerFullTypeCustomEmoji(data) - case TypeAnimation: - return UnmarshalAnimation(data) + case TypeClosedVectorPath: + return UnmarshalClosedVectorPath(data) - case TypeAudio: - return UnmarshalAudio(data) + case TypePollOption: + return UnmarshalPollOption(data) - case TypeDocument: - return UnmarshalDocument(data) + case TypePollTypeRegular: + return UnmarshalPollTypeRegular(data) - case TypePhoto: - return UnmarshalPhoto(data) + case TypePollTypeQuiz: + return UnmarshalPollTypeQuiz(data) - case TypeSticker: - return UnmarshalSticker(data) + case TypeAnimation: + return UnmarshalAnimation(data) - case TypeVideo: - return UnmarshalVideo(data) + case TypeAudio: + return UnmarshalAudio(data) - case TypeVideoNote: - return UnmarshalVideoNote(data) + case TypeDocument: + return UnmarshalDocument(data) - case TypeVoiceNote: - return UnmarshalVoiceNote(data) + case TypePhoto: + return UnmarshalPhoto(data) - case TypeAnimatedEmoji: - return UnmarshalAnimatedEmoji(data) + case TypeSticker: + return UnmarshalSticker(data) - case TypeContact: - return UnmarshalContact(data) + case TypeVideo: + return UnmarshalVideo(data) - case TypeLocation: - return UnmarshalLocation(data) + case TypeVideoNote: + return UnmarshalVideoNote(data) - case TypeVenue: - return UnmarshalVenue(data) + case TypeVoiceNote: + return UnmarshalVoiceNote(data) - case TypeGame: - return UnmarshalGame(data) + case TypeAnimatedEmoji: + return UnmarshalAnimatedEmoji(data) - case TypePoll: - return UnmarshalPoll(data) + case TypeContact: + return UnmarshalContact(data) - case TypeProfilePhoto: - return UnmarshalProfilePhoto(data) + case TypeLocation: + return UnmarshalLocation(data) - case TypeChatPhotoInfo: - return UnmarshalChatPhotoInfo(data) + case TypeVenue: + return UnmarshalVenue(data) - case TypeUserTypeRegular: - return UnmarshalUserTypeRegular(data) + case TypeGame: + return UnmarshalGame(data) - case TypeUserTypeDeleted: - return UnmarshalUserTypeDeleted(data) + case TypeWebApp: + return UnmarshalWebApp(data) - case TypeUserTypeBot: - return UnmarshalUserTypeBot(data) + case TypePoll: + return UnmarshalPoll(data) - case TypeUserTypeUnknown: - return UnmarshalUserTypeUnknown(data) + case TypeBackground: + return UnmarshalBackground(data) - case TypeBotCommand: - return UnmarshalBotCommand(data) + case TypeBackgrounds: + return UnmarshalBackgrounds(data) - case TypeBotCommands: - return UnmarshalBotCommands(data) + case TypeChatBackground: + return UnmarshalChatBackground(data) - case TypeBotMenuButton: - return UnmarshalBotMenuButton(data) + case TypeProfilePhoto: + return UnmarshalProfilePhoto(data) - case TypeChatLocation: - return UnmarshalChatLocation(data) + case TypeChatPhotoInfo: + return UnmarshalChatPhotoInfo(data) - case TypeAnimatedChatPhoto: - return UnmarshalAnimatedChatPhoto(data) + case TypeUserTypeRegular: + return UnmarshalUserTypeRegular(data) - case TypeChatPhoto: - return UnmarshalChatPhoto(data) + case TypeUserTypeDeleted: + return UnmarshalUserTypeDeleted(data) - case TypeChatPhotos: - return UnmarshalChatPhotos(data) + case TypeUserTypeBot: + return UnmarshalUserTypeBot(data) - case TypeInputChatPhotoPrevious: - return UnmarshalInputChatPhotoPrevious(data) + case TypeUserTypeUnknown: + return UnmarshalUserTypeUnknown(data) - case TypeInputChatPhotoStatic: - return UnmarshalInputChatPhotoStatic(data) + case TypeBotCommand: + return UnmarshalBotCommand(data) - case TypeInputChatPhotoAnimation: - return UnmarshalInputChatPhotoAnimation(data) + case TypeBotCommands: + return UnmarshalBotCommands(data) - case TypeChatPermissions: - return UnmarshalChatPermissions(data) + case TypeBotMenuButton: + return UnmarshalBotMenuButton(data) - case TypeChatAdministratorRights: - return UnmarshalChatAdministratorRights(data) + case TypeChatLocation: + return UnmarshalChatLocation(data) - case TypePremiumPaymentOption: - return UnmarshalPremiumPaymentOption(data) + case TypeBirthdate: + return UnmarshalBirthdate(data) - case TypeEmojiStatus: - return UnmarshalEmojiStatus(data) + case TypeCloseBirthdayUser: + return UnmarshalCloseBirthdayUser(data) - case TypeEmojiStatuses: - return UnmarshalEmojiStatuses(data) + case TypeBusinessAwayMessageScheduleAlways: + return UnmarshalBusinessAwayMessageScheduleAlways(data) - case TypeUsernames: - return UnmarshalUsernames(data) + case TypeBusinessAwayMessageScheduleOutsideOfOpeningHours: + return UnmarshalBusinessAwayMessageScheduleOutsideOfOpeningHours(data) - case TypeUser: - return UnmarshalUser(data) + case TypeBusinessAwayMessageScheduleCustom: + return UnmarshalBusinessAwayMessageScheduleCustom(data) - case TypeBotInfo: - return UnmarshalBotInfo(data) + case TypeBusinessLocation: + return UnmarshalBusinessLocation(data) - case TypeUserFullInfo: - return UnmarshalUserFullInfo(data) + case TypeBusinessRecipients: + return UnmarshalBusinessRecipients(data) - case TypeUsers: - return UnmarshalUsers(data) + case TypeBusinessAwayMessageSettings: + return UnmarshalBusinessAwayMessageSettings(data) - case TypeChatAdministrator: - return UnmarshalChatAdministrator(data) + case TypeBusinessGreetingMessageSettings: + return UnmarshalBusinessGreetingMessageSettings(data) - case TypeChatAdministrators: - return UnmarshalChatAdministrators(data) + case TypeBusinessConnectedBot: + return UnmarshalBusinessConnectedBot(data) - case TypeChatMemberStatusCreator: - return UnmarshalChatMemberStatusCreator(data) + case TypeBusinessIntro: + return UnmarshalBusinessIntro(data) - case TypeChatMemberStatusAdministrator: - return UnmarshalChatMemberStatusAdministrator(data) + case TypeInputBusinessIntro: + return UnmarshalInputBusinessIntro(data) - case TypeChatMemberStatusMember: - return UnmarshalChatMemberStatusMember(data) + case TypeBusinessOpeningHoursInterval: + return UnmarshalBusinessOpeningHoursInterval(data) - case TypeChatMemberStatusRestricted: - return UnmarshalChatMemberStatusRestricted(data) + case TypeBusinessOpeningHours: + return UnmarshalBusinessOpeningHours(data) - case TypeChatMemberStatusLeft: - return UnmarshalChatMemberStatusLeft(data) + case TypeBusinessInfo: + return UnmarshalBusinessInfo(data) - case TypeChatMemberStatusBanned: - return UnmarshalChatMemberStatusBanned(data) + case TypeChatPhotoStickerTypeRegularOrMask: + return UnmarshalChatPhotoStickerTypeRegularOrMask(data) - case TypeChatMember: - return UnmarshalChatMember(data) + case TypeChatPhotoStickerTypeCustomEmoji: + return UnmarshalChatPhotoStickerTypeCustomEmoji(data) - case TypeChatMembers: - return UnmarshalChatMembers(data) + case TypeChatPhotoSticker: + return UnmarshalChatPhotoSticker(data) - case TypeChatMembersFilterContacts: - return UnmarshalChatMembersFilterContacts(data) + case TypeAnimatedChatPhoto: + return UnmarshalAnimatedChatPhoto(data) - case TypeChatMembersFilterAdministrators: - return UnmarshalChatMembersFilterAdministrators(data) + case TypeChatPhoto: + return UnmarshalChatPhoto(data) - case TypeChatMembersFilterMembers: - return UnmarshalChatMembersFilterMembers(data) + case TypeChatPhotos: + return UnmarshalChatPhotos(data) - case TypeChatMembersFilterMention: - return UnmarshalChatMembersFilterMention(data) + case TypeInputChatPhotoPrevious: + return UnmarshalInputChatPhotoPrevious(data) - case TypeChatMembersFilterRestricted: - return UnmarshalChatMembersFilterRestricted(data) + case TypeInputChatPhotoStatic: + return UnmarshalInputChatPhotoStatic(data) - case TypeChatMembersFilterBanned: - return UnmarshalChatMembersFilterBanned(data) + case TypeInputChatPhotoAnimation: + return UnmarshalInputChatPhotoAnimation(data) - case TypeChatMembersFilterBots: - return UnmarshalChatMembersFilterBots(data) + case TypeInputChatPhotoSticker: + return UnmarshalInputChatPhotoSticker(data) - case TypeSupergroupMembersFilterRecent: - return UnmarshalSupergroupMembersFilterRecent(data) + case TypeChatPermissions: + return UnmarshalChatPermissions(data) - case TypeSupergroupMembersFilterContacts: - return UnmarshalSupergroupMembersFilterContacts(data) + case TypeChatAdministratorRights: + return UnmarshalChatAdministratorRights(data) - case TypeSupergroupMembersFilterAdministrators: - return UnmarshalSupergroupMembersFilterAdministrators(data) + case TypePremiumPaymentOption: + return UnmarshalPremiumPaymentOption(data) - case TypeSupergroupMembersFilterSearch: - return UnmarshalSupergroupMembersFilterSearch(data) + case TypePremiumStatePaymentOption: + return UnmarshalPremiumStatePaymentOption(data) - case TypeSupergroupMembersFilterRestricted: - return UnmarshalSupergroupMembersFilterRestricted(data) + case TypePremiumGiftCodePaymentOption: + return UnmarshalPremiumGiftCodePaymentOption(data) - case TypeSupergroupMembersFilterBanned: - return UnmarshalSupergroupMembersFilterBanned(data) + case TypePremiumGiftCodePaymentOptions: + return UnmarshalPremiumGiftCodePaymentOptions(data) - case TypeSupergroupMembersFilterMention: - return UnmarshalSupergroupMembersFilterMention(data) + case TypePremiumGiftCodeInfo: + return UnmarshalPremiumGiftCodeInfo(data) - case TypeSupergroupMembersFilterBots: - return UnmarshalSupergroupMembersFilterBots(data) + case TypePremiumGiveawayParticipantStatusEligible: + return UnmarshalPremiumGiveawayParticipantStatusEligible(data) - case TypeChatInviteLink: - return UnmarshalChatInviteLink(data) + case TypePremiumGiveawayParticipantStatusParticipating: + return UnmarshalPremiumGiveawayParticipantStatusParticipating(data) - case TypeChatInviteLinks: - return UnmarshalChatInviteLinks(data) + case TypePremiumGiveawayParticipantStatusAlreadyWasMember: + return UnmarshalPremiumGiveawayParticipantStatusAlreadyWasMember(data) - case TypeChatInviteLinkCount: - return UnmarshalChatInviteLinkCount(data) + case TypePremiumGiveawayParticipantStatusAdministrator: + return UnmarshalPremiumGiveawayParticipantStatusAdministrator(data) - case TypeChatInviteLinkCounts: - return UnmarshalChatInviteLinkCounts(data) + case TypePremiumGiveawayParticipantStatusDisallowedCountry: + return UnmarshalPremiumGiveawayParticipantStatusDisallowedCountry(data) - case TypeChatInviteLinkMember: - return UnmarshalChatInviteLinkMember(data) + case TypePremiumGiveawayInfoOngoing: + return UnmarshalPremiumGiveawayInfoOngoing(data) - case TypeChatInviteLinkMembers: - return UnmarshalChatInviteLinkMembers(data) + case TypePremiumGiveawayInfoCompleted: + return UnmarshalPremiumGiveawayInfoCompleted(data) - case TypeChatInviteLinkInfo: - return UnmarshalChatInviteLinkInfo(data) + case TypeAccentColor: + return UnmarshalAccentColor(data) - case TypeChatJoinRequest: - return UnmarshalChatJoinRequest(data) + case TypeProfileAccentColors: + return UnmarshalProfileAccentColors(data) - case TypeChatJoinRequests: - return UnmarshalChatJoinRequests(data) + case TypeProfileAccentColor: + return UnmarshalProfileAccentColor(data) - case TypeChatJoinRequestsInfo: - return UnmarshalChatJoinRequestsInfo(data) + case TypeEmojiStatus: + return UnmarshalEmojiStatus(data) - case TypeBasicGroup: - return UnmarshalBasicGroup(data) + case TypeEmojiStatuses: + return UnmarshalEmojiStatuses(data) - case TypeBasicGroupFullInfo: - return UnmarshalBasicGroupFullInfo(data) + case TypeUsernames: + return UnmarshalUsernames(data) - case TypeSupergroup: - return UnmarshalSupergroup(data) + case TypeUser: + return UnmarshalUser(data) - case TypeSupergroupFullInfo: - return UnmarshalSupergroupFullInfo(data) + case TypeBotInfo: + return UnmarshalBotInfo(data) - case TypeSecretChatStatePending: - return UnmarshalSecretChatStatePending(data) + case TypeUserFullInfo: + return UnmarshalUserFullInfo(data) - case TypeSecretChatStateReady: - return UnmarshalSecretChatStateReady(data) + case TypeUsers: + return UnmarshalUsers(data) - case TypeSecretChatStateClosed: - return UnmarshalSecretChatStateClosed(data) + case TypeChatAdministrator: + return UnmarshalChatAdministrator(data) - case TypeSecretChat: - return UnmarshalSecretChat(data) + case TypeChatAdministrators: + return UnmarshalChatAdministrators(data) - case TypeMessageSenderUser: - return UnmarshalMessageSenderUser(data) + case TypeChatMemberStatusCreator: + return UnmarshalChatMemberStatusCreator(data) - case TypeMessageSenderChat: - return UnmarshalMessageSenderChat(data) + case TypeChatMemberStatusAdministrator: + return UnmarshalChatMemberStatusAdministrator(data) - case TypeMessageSenders: - return UnmarshalMessageSenders(data) + case TypeChatMemberStatusMember: + return UnmarshalChatMemberStatusMember(data) - case TypeChatMessageSender: - return UnmarshalChatMessageSender(data) + case TypeChatMemberStatusRestricted: + return UnmarshalChatMemberStatusRestricted(data) - case TypeChatMessageSenders: - return UnmarshalChatMessageSenders(data) + case TypeChatMemberStatusLeft: + return UnmarshalChatMemberStatusLeft(data) - case TypeMessageForwardOriginUser: - return UnmarshalMessageForwardOriginUser(data) + case TypeChatMemberStatusBanned: + return UnmarshalChatMemberStatusBanned(data) - case TypeMessageForwardOriginChat: - return UnmarshalMessageForwardOriginChat(data) + case TypeChatMember: + return UnmarshalChatMember(data) - case TypeMessageForwardOriginHiddenUser: - return UnmarshalMessageForwardOriginHiddenUser(data) + case TypeChatMembers: + return UnmarshalChatMembers(data) - case TypeMessageForwardOriginChannel: - return UnmarshalMessageForwardOriginChannel(data) + case TypeChatMembersFilterContacts: + return UnmarshalChatMembersFilterContacts(data) - case TypeMessageForwardOriginMessageImport: - return UnmarshalMessageForwardOriginMessageImport(data) + case TypeChatMembersFilterAdministrators: + return UnmarshalChatMembersFilterAdministrators(data) - case TypeReactionTypeEmoji: - return UnmarshalReactionTypeEmoji(data) + case TypeChatMembersFilterMembers: + return UnmarshalChatMembersFilterMembers(data) - case TypeReactionTypeCustomEmoji: - return UnmarshalReactionTypeCustomEmoji(data) + case TypeChatMembersFilterMention: + return UnmarshalChatMembersFilterMention(data) - case TypeMessageForwardInfo: - return UnmarshalMessageForwardInfo(data) + case TypeChatMembersFilterRestricted: + return UnmarshalChatMembersFilterRestricted(data) - case TypeMessageReplyInfo: - return UnmarshalMessageReplyInfo(data) + case TypeChatMembersFilterBanned: + return UnmarshalChatMembersFilterBanned(data) - case TypeMessageReaction: - return UnmarshalMessageReaction(data) + case TypeChatMembersFilterBots: + return UnmarshalChatMembersFilterBots(data) - case TypeMessageInteractionInfo: - return UnmarshalMessageInteractionInfo(data) + case TypeSupergroupMembersFilterRecent: + return UnmarshalSupergroupMembersFilterRecent(data) - case TypeUnreadReaction: - return UnmarshalUnreadReaction(data) + case TypeSupergroupMembersFilterContacts: + return UnmarshalSupergroupMembersFilterContacts(data) - case TypeMessageSendingStatePending: - return UnmarshalMessageSendingStatePending(data) + case TypeSupergroupMembersFilterAdministrators: + return UnmarshalSupergroupMembersFilterAdministrators(data) - case TypeMessageSendingStateFailed: - return UnmarshalMessageSendingStateFailed(data) + case TypeSupergroupMembersFilterSearch: + return UnmarshalSupergroupMembersFilterSearch(data) - case TypeMessage: - return UnmarshalMessage(data) + case TypeSupergroupMembersFilterRestricted: + return UnmarshalSupergroupMembersFilterRestricted(data) - case TypeMessages: - return UnmarshalMessages(data) + case TypeSupergroupMembersFilterBanned: + return UnmarshalSupergroupMembersFilterBanned(data) - case TypeFoundMessages: - return UnmarshalFoundMessages(data) + case TypeSupergroupMembersFilterMention: + return UnmarshalSupergroupMembersFilterMention(data) - case TypeFoundChatMessages: - return UnmarshalFoundChatMessages(data) + case TypeSupergroupMembersFilterBots: + return UnmarshalSupergroupMembersFilterBots(data) - case TypeMessagePosition: - return UnmarshalMessagePosition(data) + case TypeChatInviteLink: + return UnmarshalChatInviteLink(data) - case TypeMessagePositions: - return UnmarshalMessagePositions(data) + case TypeChatInviteLinks: + return UnmarshalChatInviteLinks(data) - case TypeMessageCalendarDay: - return UnmarshalMessageCalendarDay(data) + case TypeChatInviteLinkCount: + return UnmarshalChatInviteLinkCount(data) - case TypeMessageCalendar: - return UnmarshalMessageCalendar(data) + case TypeChatInviteLinkCounts: + return UnmarshalChatInviteLinkCounts(data) - case TypeSponsoredMessage: - return UnmarshalSponsoredMessage(data) + case TypeChatInviteLinkMember: + return UnmarshalChatInviteLinkMember(data) - case TypeSponsoredMessages: - return UnmarshalSponsoredMessages(data) + case TypeChatInviteLinkMembers: + return UnmarshalChatInviteLinkMembers(data) - case TypeFileDownload: - return UnmarshalFileDownload(data) + case TypeInviteLinkChatTypeBasicGroup: + return UnmarshalInviteLinkChatTypeBasicGroup(data) - case TypeDownloadedFileCounts: - return UnmarshalDownloadedFileCounts(data) + case TypeInviteLinkChatTypeSupergroup: + return UnmarshalInviteLinkChatTypeSupergroup(data) - case TypeFoundFileDownloads: - return UnmarshalFoundFileDownloads(data) + case TypeInviteLinkChatTypeChannel: + return UnmarshalInviteLinkChatTypeChannel(data) - case TypeNotificationSettingsScopePrivateChats: - return UnmarshalNotificationSettingsScopePrivateChats(data) + case TypeChatInviteLinkInfo: + return UnmarshalChatInviteLinkInfo(data) - case TypeNotificationSettingsScopeGroupChats: - return UnmarshalNotificationSettingsScopeGroupChats(data) + case TypeChatJoinRequest: + return UnmarshalChatJoinRequest(data) - case TypeNotificationSettingsScopeChannelChats: - return UnmarshalNotificationSettingsScopeChannelChats(data) + case TypeChatJoinRequests: + return UnmarshalChatJoinRequests(data) - case TypeChatNotificationSettings: - return UnmarshalChatNotificationSettings(data) + case TypeChatJoinRequestsInfo: + return UnmarshalChatJoinRequestsInfo(data) - case TypeScopeNotificationSettings: - return UnmarshalScopeNotificationSettings(data) + case TypeBasicGroup: + return UnmarshalBasicGroup(data) - case TypeDraftMessage: - return UnmarshalDraftMessage(data) + case TypeBasicGroupFullInfo: + return UnmarshalBasicGroupFullInfo(data) - case TypeChatTypePrivate: - return UnmarshalChatTypePrivate(data) + case TypeSupergroup: + return UnmarshalSupergroup(data) - case TypeChatTypeBasicGroup: - return UnmarshalChatTypeBasicGroup(data) + case TypeSupergroupFullInfo: + return UnmarshalSupergroupFullInfo(data) - case TypeChatTypeSupergroup: - return UnmarshalChatTypeSupergroup(data) + case TypeSecretChatStatePending: + return UnmarshalSecretChatStatePending(data) - case TypeChatTypeSecret: - return UnmarshalChatTypeSecret(data) + case TypeSecretChatStateReady: + return UnmarshalSecretChatStateReady(data) - case TypeChatFilter: - return UnmarshalChatFilter(data) + case TypeSecretChatStateClosed: + return UnmarshalSecretChatStateClosed(data) - case TypeChatFilterInfo: - return UnmarshalChatFilterInfo(data) + case TypeSecretChat: + return UnmarshalSecretChat(data) - case TypeRecommendedChatFilter: - return UnmarshalRecommendedChatFilter(data) + case TypeMessageSenderUser: + return UnmarshalMessageSenderUser(data) - case TypeRecommendedChatFilters: - return UnmarshalRecommendedChatFilters(data) + case TypeMessageSenderChat: + return UnmarshalMessageSenderChat(data) - case TypeChatListMain: - return UnmarshalChatListMain(data) + case TypeMessageSenders: + return UnmarshalMessageSenders(data) - case TypeChatListArchive: - return UnmarshalChatListArchive(data) + case TypeChatMessageSender: + return UnmarshalChatMessageSender(data) - case TypeChatListFilter: - return UnmarshalChatListFilter(data) + case TypeChatMessageSenders: + return UnmarshalChatMessageSenders(data) - case TypeChatLists: - return UnmarshalChatLists(data) + case TypeMessageReadDateRead: + return UnmarshalMessageReadDateRead(data) - case TypeChatSourceMtprotoProxy: - return UnmarshalChatSourceMtprotoProxy(data) + case TypeMessageReadDateUnread: + return UnmarshalMessageReadDateUnread(data) - case TypeChatSourcePublicServiceAnnouncement: - return UnmarshalChatSourcePublicServiceAnnouncement(data) + case TypeMessageReadDateTooOld: + return UnmarshalMessageReadDateTooOld(data) - case TypeChatPosition: - return UnmarshalChatPosition(data) + case TypeMessageReadDateUserPrivacyRestricted: + return UnmarshalMessageReadDateUserPrivacyRestricted(data) - case TypeChatAvailableReactionsAll: - return UnmarshalChatAvailableReactionsAll(data) + case TypeMessageReadDateMyPrivacyRestricted: + return UnmarshalMessageReadDateMyPrivacyRestricted(data) - case TypeChatAvailableReactionsSome: - return UnmarshalChatAvailableReactionsSome(data) + case TypeMessageViewer: + return UnmarshalMessageViewer(data) - case TypeVideoChat: - return UnmarshalVideoChat(data) + case TypeMessageViewers: + return UnmarshalMessageViewers(data) - case TypeChat: - return UnmarshalChat(data) + case TypeMessageOriginUser: + return UnmarshalMessageOriginUser(data) - case TypeChats: - return UnmarshalChats(data) + case TypeMessageOriginHiddenUser: + return UnmarshalMessageOriginHiddenUser(data) - case TypeChatNearby: - return UnmarshalChatNearby(data) + case TypeMessageOriginChat: + return UnmarshalMessageOriginChat(data) - case TypeChatsNearby: - return UnmarshalChatsNearby(data) + case TypeMessageOriginChannel: + return UnmarshalMessageOriginChannel(data) - case TypePublicChatTypeHasUsername: - return UnmarshalPublicChatTypeHasUsername(data) + case TypeForwardSource: + return UnmarshalForwardSource(data) - case TypePublicChatTypeIsLocationBased: - return UnmarshalPublicChatTypeIsLocationBased(data) + case TypeReactionTypeEmoji: + return UnmarshalReactionTypeEmoji(data) - case TypeChatActionBarReportSpam: - return UnmarshalChatActionBarReportSpam(data) + case TypeReactionTypeCustomEmoji: + return UnmarshalReactionTypeCustomEmoji(data) - case TypeChatActionBarReportUnrelatedLocation: - return UnmarshalChatActionBarReportUnrelatedLocation(data) + case TypeMessageForwardInfo: + return UnmarshalMessageForwardInfo(data) - case TypeChatActionBarInviteMembers: - return UnmarshalChatActionBarInviteMembers(data) + case TypeMessageImportInfo: + return UnmarshalMessageImportInfo(data) - case TypeChatActionBarReportAddBlock: - return UnmarshalChatActionBarReportAddBlock(data) + case TypeMessageReplyInfo: + return UnmarshalMessageReplyInfo(data) - case TypeChatActionBarAddContact: - return UnmarshalChatActionBarAddContact(data) + case TypeMessageReaction: + return UnmarshalMessageReaction(data) - case TypeChatActionBarSharePhoneNumber: - return UnmarshalChatActionBarSharePhoneNumber(data) + case TypeMessageReactions: + return UnmarshalMessageReactions(data) - case TypeChatActionBarJoinRequest: - return UnmarshalChatActionBarJoinRequest(data) + case TypeMessageInteractionInfo: + return UnmarshalMessageInteractionInfo(data) - case TypeKeyboardButtonTypeText: - return UnmarshalKeyboardButtonTypeText(data) + case TypeUnreadReaction: + return UnmarshalUnreadReaction(data) - case TypeKeyboardButtonTypeRequestPhoneNumber: - return UnmarshalKeyboardButtonTypeRequestPhoneNumber(data) + case TypeMessageSendingStatePending: + return UnmarshalMessageSendingStatePending(data) - case TypeKeyboardButtonTypeRequestLocation: - return UnmarshalKeyboardButtonTypeRequestLocation(data) + case TypeMessageSendingStateFailed: + return UnmarshalMessageSendingStateFailed(data) - case TypeKeyboardButtonTypeRequestPoll: - return UnmarshalKeyboardButtonTypeRequestPoll(data) + case TypeTextQuote: + return UnmarshalTextQuote(data) - case TypeKeyboardButtonTypeWebApp: - return UnmarshalKeyboardButtonTypeWebApp(data) + case TypeInputTextQuote: + return UnmarshalInputTextQuote(data) - case TypeKeyboardButton: - return UnmarshalKeyboardButton(data) + case TypeMessageReplyToMessage: + return UnmarshalMessageReplyToMessage(data) - case TypeInlineKeyboardButtonTypeUrl: - return UnmarshalInlineKeyboardButtonTypeUrl(data) + case TypeMessageReplyToStory: + return UnmarshalMessageReplyToStory(data) - case TypeInlineKeyboardButtonTypeLoginUrl: - return UnmarshalInlineKeyboardButtonTypeLoginUrl(data) + case TypeInputMessageReplyToMessage: + return UnmarshalInputMessageReplyToMessage(data) - case TypeInlineKeyboardButtonTypeWebApp: - return UnmarshalInlineKeyboardButtonTypeWebApp(data) + case TypeInputMessageReplyToStory: + return UnmarshalInputMessageReplyToStory(data) - case TypeInlineKeyboardButtonTypeCallback: - return UnmarshalInlineKeyboardButtonTypeCallback(data) + case TypeMessage: + return UnmarshalMessage(data) - case TypeInlineKeyboardButtonTypeCallbackWithPassword: - return UnmarshalInlineKeyboardButtonTypeCallbackWithPassword(data) + case TypeMessages: + return UnmarshalMessages(data) - case TypeInlineKeyboardButtonTypeCallbackGame: - return UnmarshalInlineKeyboardButtonTypeCallbackGame(data) + case TypeFoundMessages: + return UnmarshalFoundMessages(data) - case TypeInlineKeyboardButtonTypeSwitchInline: - return UnmarshalInlineKeyboardButtonTypeSwitchInline(data) + case TypeFoundChatMessages: + return UnmarshalFoundChatMessages(data) - case TypeInlineKeyboardButtonTypeBuy: - return UnmarshalInlineKeyboardButtonTypeBuy(data) + case TypeMessagePosition: + return UnmarshalMessagePosition(data) - case TypeInlineKeyboardButtonTypeUser: - return UnmarshalInlineKeyboardButtonTypeUser(data) + case TypeMessagePositions: + return UnmarshalMessagePositions(data) - case TypeInlineKeyboardButton: - return UnmarshalInlineKeyboardButton(data) + case TypeMessageCalendarDay: + return UnmarshalMessageCalendarDay(data) - case TypeReplyMarkupRemoveKeyboard: - return UnmarshalReplyMarkupRemoveKeyboard(data) + case TypeMessageCalendar: + return UnmarshalMessageCalendar(data) - case TypeReplyMarkupForceReply: - return UnmarshalReplyMarkupForceReply(data) + case TypeBusinessMessage: + return UnmarshalBusinessMessage(data) - case TypeReplyMarkupShowKeyboard: - return UnmarshalReplyMarkupShowKeyboard(data) + case TypeBusinessMessages: + return UnmarshalBusinessMessages(data) - case TypeReplyMarkupInlineKeyboard: - return UnmarshalReplyMarkupInlineKeyboard(data) + case TypeMessageSourceChatHistory: + return UnmarshalMessageSourceChatHistory(data) - case TypeLoginUrlInfoOpen: - return UnmarshalLoginUrlInfoOpen(data) + case TypeMessageSourceMessageThreadHistory: + return UnmarshalMessageSourceMessageThreadHistory(data) - case TypeLoginUrlInfoRequestConfirmation: - return UnmarshalLoginUrlInfoRequestConfirmation(data) + case TypeMessageSourceForumTopicHistory: + return UnmarshalMessageSourceForumTopicHistory(data) - case TypeWebAppInfo: - return UnmarshalWebAppInfo(data) + case TypeMessageSourceHistoryPreview: + return UnmarshalMessageSourceHistoryPreview(data) - case TypeMessageThreadInfo: - return UnmarshalMessageThreadInfo(data) + case TypeMessageSourceChatList: + return UnmarshalMessageSourceChatList(data) - case TypeForumTopicIcon: - return UnmarshalForumTopicIcon(data) + case TypeMessageSourceSearch: + return UnmarshalMessageSourceSearch(data) - case TypeForumTopicInfo: - return UnmarshalForumTopicInfo(data) + case TypeMessageSourceChatEventLog: + return UnmarshalMessageSourceChatEventLog(data) - case TypeForumTopic: - return UnmarshalForumTopic(data) + case TypeMessageSourceNotification: + return UnmarshalMessageSourceNotification(data) - case TypeForumTopics: - return UnmarshalForumTopics(data) + case TypeMessageSourceScreenshot: + return UnmarshalMessageSourceScreenshot(data) - case TypeRichTextPlain: - return UnmarshalRichTextPlain(data) + case TypeMessageSourceOther: + return UnmarshalMessageSourceOther(data) - case TypeRichTextBold: - return UnmarshalRichTextBold(data) + case TypeMessageSponsorTypeBot: + return UnmarshalMessageSponsorTypeBot(data) - case TypeRichTextItalic: - return UnmarshalRichTextItalic(data) + case TypeMessageSponsorTypeWebApp: + return UnmarshalMessageSponsorTypeWebApp(data) - case TypeRichTextUnderline: - return UnmarshalRichTextUnderline(data) + case TypeMessageSponsorTypePublicChannel: + return UnmarshalMessageSponsorTypePublicChannel(data) - case TypeRichTextStrikethrough: - return UnmarshalRichTextStrikethrough(data) + case TypeMessageSponsorTypePrivateChannel: + return UnmarshalMessageSponsorTypePrivateChannel(data) - case TypeRichTextFixed: - return UnmarshalRichTextFixed(data) + case TypeMessageSponsorTypeWebsite: + return UnmarshalMessageSponsorTypeWebsite(data) - case TypeRichTextUrl: - return UnmarshalRichTextUrl(data) + case TypeMessageSponsor: + return UnmarshalMessageSponsor(data) - case TypeRichTextEmailAddress: - return UnmarshalRichTextEmailAddress(data) + case TypeSponsoredMessage: + return UnmarshalSponsoredMessage(data) - case TypeRichTextSubscript: - return UnmarshalRichTextSubscript(data) + case TypeSponsoredMessages: + return UnmarshalSponsoredMessages(data) - case TypeRichTextSuperscript: - return UnmarshalRichTextSuperscript(data) + case TypeReportChatSponsoredMessageOption: + return UnmarshalReportChatSponsoredMessageOption(data) - case TypeRichTextMarked: - return UnmarshalRichTextMarked(data) + case TypeReportChatSponsoredMessageResultOk: + return UnmarshalReportChatSponsoredMessageResultOk(data) - case TypeRichTextPhoneNumber: - return UnmarshalRichTextPhoneNumber(data) + case TypeReportChatSponsoredMessageResultFailed: + return UnmarshalReportChatSponsoredMessageResultFailed(data) - case TypeRichTextIcon: - return UnmarshalRichTextIcon(data) + case TypeReportChatSponsoredMessageResultOptionRequired: + return UnmarshalReportChatSponsoredMessageResultOptionRequired(data) - case TypeRichTextReference: - return UnmarshalRichTextReference(data) + case TypeReportChatSponsoredMessageResultAdsHidden: + return UnmarshalReportChatSponsoredMessageResultAdsHidden(data) - case TypeRichTextAnchor: - return UnmarshalRichTextAnchor(data) + case TypeReportChatSponsoredMessageResultPremiumRequired: + return UnmarshalReportChatSponsoredMessageResultPremiumRequired(data) - case TypeRichTextAnchorLink: - return UnmarshalRichTextAnchorLink(data) + case TypeFileDownload: + return UnmarshalFileDownload(data) - case TypeRichTexts: - return UnmarshalRichTexts(data) + case TypeDownloadedFileCounts: + return UnmarshalDownloadedFileCounts(data) - case TypePageBlockCaption: - return UnmarshalPageBlockCaption(data) + case TypeFoundFileDownloads: + return UnmarshalFoundFileDownloads(data) - case TypePageBlockListItem: - return UnmarshalPageBlockListItem(data) + case TypeNotificationSettingsScopePrivateChats: + return UnmarshalNotificationSettingsScopePrivateChats(data) - case TypePageBlockHorizontalAlignmentLeft: - return UnmarshalPageBlockHorizontalAlignmentLeft(data) + case TypeNotificationSettingsScopeGroupChats: + return UnmarshalNotificationSettingsScopeGroupChats(data) - case TypePageBlockHorizontalAlignmentCenter: - return UnmarshalPageBlockHorizontalAlignmentCenter(data) + case TypeNotificationSettingsScopeChannelChats: + return UnmarshalNotificationSettingsScopeChannelChats(data) - case TypePageBlockHorizontalAlignmentRight: - return UnmarshalPageBlockHorizontalAlignmentRight(data) + case TypeChatNotificationSettings: + return UnmarshalChatNotificationSettings(data) - case TypePageBlockVerticalAlignmentTop: - return UnmarshalPageBlockVerticalAlignmentTop(data) + case TypeScopeNotificationSettings: + return UnmarshalScopeNotificationSettings(data) - case TypePageBlockVerticalAlignmentMiddle: - return UnmarshalPageBlockVerticalAlignmentMiddle(data) + case TypeDraftMessage: + return UnmarshalDraftMessage(data) - case TypePageBlockVerticalAlignmentBottom: - return UnmarshalPageBlockVerticalAlignmentBottom(data) + case TypeChatTypePrivate: + return UnmarshalChatTypePrivate(data) - case TypePageBlockTableCell: - return UnmarshalPageBlockTableCell(data) + case TypeChatTypeBasicGroup: + return UnmarshalChatTypeBasicGroup(data) - case TypePageBlockRelatedArticle: - return UnmarshalPageBlockRelatedArticle(data) + case TypeChatTypeSupergroup: + return UnmarshalChatTypeSupergroup(data) - case TypePageBlockTitle: - return UnmarshalPageBlockTitle(data) + case TypeChatTypeSecret: + return UnmarshalChatTypeSecret(data) - case TypePageBlockSubtitle: - return UnmarshalPageBlockSubtitle(data) + case TypeChatFolderIcon: + return UnmarshalChatFolderIcon(data) - case TypePageBlockAuthorDate: - return UnmarshalPageBlockAuthorDate(data) + case TypeChatFolder: + return UnmarshalChatFolder(data) - case TypePageBlockHeader: - return UnmarshalPageBlockHeader(data) + case TypeChatFolderInfo: + return UnmarshalChatFolderInfo(data) - case TypePageBlockSubheader: - return UnmarshalPageBlockSubheader(data) + case TypeChatFolderInviteLink: + return UnmarshalChatFolderInviteLink(data) - case TypePageBlockKicker: - return UnmarshalPageBlockKicker(data) + case TypeChatFolderInviteLinks: + return UnmarshalChatFolderInviteLinks(data) - case TypePageBlockParagraph: - return UnmarshalPageBlockParagraph(data) + case TypeChatFolderInviteLinkInfo: + return UnmarshalChatFolderInviteLinkInfo(data) - case TypePageBlockPreformatted: - return UnmarshalPageBlockPreformatted(data) + case TypeRecommendedChatFolder: + return UnmarshalRecommendedChatFolder(data) - case TypePageBlockFooter: - return UnmarshalPageBlockFooter(data) + case TypeRecommendedChatFolders: + return UnmarshalRecommendedChatFolders(data) - case TypePageBlockDivider: - return UnmarshalPageBlockDivider(data) + case TypeArchiveChatListSettings: + return UnmarshalArchiveChatListSettings(data) - case TypePageBlockAnchor: - return UnmarshalPageBlockAnchor(data) + case TypeChatListMain: + return UnmarshalChatListMain(data) - case TypePageBlockList: - return UnmarshalPageBlockList(data) + case TypeChatListArchive: + return UnmarshalChatListArchive(data) - case TypePageBlockBlockQuote: - return UnmarshalPageBlockBlockQuote(data) + case TypeChatListFolder: + return UnmarshalChatListFolder(data) - case TypePageBlockPullQuote: - return UnmarshalPageBlockPullQuote(data) + case TypeChatLists: + return UnmarshalChatLists(data) - case TypePageBlockAnimation: - return UnmarshalPageBlockAnimation(data) + case TypeChatSourceMtprotoProxy: + return UnmarshalChatSourceMtprotoProxy(data) - case TypePageBlockAudio: - return UnmarshalPageBlockAudio(data) + case TypeChatSourcePublicServiceAnnouncement: + return UnmarshalChatSourcePublicServiceAnnouncement(data) - case TypePageBlockPhoto: - return UnmarshalPageBlockPhoto(data) + case TypeChatPosition: + return UnmarshalChatPosition(data) - case TypePageBlockVideo: - return UnmarshalPageBlockVideo(data) + case TypeChatAvailableReactionsAll: + return UnmarshalChatAvailableReactionsAll(data) - case TypePageBlockVoiceNote: - return UnmarshalPageBlockVoiceNote(data) + case TypeChatAvailableReactionsSome: + return UnmarshalChatAvailableReactionsSome(data) - case TypePageBlockCover: - return UnmarshalPageBlockCover(data) + case TypeSavedMessagesTag: + return UnmarshalSavedMessagesTag(data) - case TypePageBlockEmbedded: - return UnmarshalPageBlockEmbedded(data) + case TypeSavedMessagesTags: + return UnmarshalSavedMessagesTags(data) - case TypePageBlockEmbeddedPost: - return UnmarshalPageBlockEmbeddedPost(data) + case TypeVideoChat: + return UnmarshalVideoChat(data) - case TypePageBlockCollage: - return UnmarshalPageBlockCollage(data) + case TypeChat: + return UnmarshalChat(data) - case TypePageBlockSlideshow: - return UnmarshalPageBlockSlideshow(data) + case TypeChats: + return UnmarshalChats(data) - case TypePageBlockChatLink: - return UnmarshalPageBlockChatLink(data) + case TypeChatNearby: + return UnmarshalChatNearby(data) - case TypePageBlockTable: - return UnmarshalPageBlockTable(data) + case TypeChatsNearby: + return UnmarshalChatsNearby(data) - case TypePageBlockDetails: - return UnmarshalPageBlockDetails(data) + case TypePublicChatTypeHasUsername: + return UnmarshalPublicChatTypeHasUsername(data) - case TypePageBlockRelatedArticles: - return UnmarshalPageBlockRelatedArticles(data) + case TypePublicChatTypeIsLocationBased: + return UnmarshalPublicChatTypeIsLocationBased(data) - case TypePageBlockMap: - return UnmarshalPageBlockMap(data) + case TypeChatActionBarReportSpam: + return UnmarshalChatActionBarReportSpam(data) - case TypeWebPageInstantView: - return UnmarshalWebPageInstantView(data) + case TypeChatActionBarReportUnrelatedLocation: + return UnmarshalChatActionBarReportUnrelatedLocation(data) - case TypeWebPage: - return UnmarshalWebPage(data) + case TypeChatActionBarInviteMembers: + return UnmarshalChatActionBarInviteMembers(data) - case TypeCountryInfo: - return UnmarshalCountryInfo(data) + case TypeChatActionBarReportAddBlock: + return UnmarshalChatActionBarReportAddBlock(data) - case TypeCountries: - return UnmarshalCountries(data) + case TypeChatActionBarAddContact: + return UnmarshalChatActionBarAddContact(data) - case TypePhoneNumberInfo: - return UnmarshalPhoneNumberInfo(data) + case TypeChatActionBarSharePhoneNumber: + return UnmarshalChatActionBarSharePhoneNumber(data) - case TypeBankCardActionOpenUrl: - return UnmarshalBankCardActionOpenUrl(data) + case TypeChatActionBarJoinRequest: + return UnmarshalChatActionBarJoinRequest(data) - case TypeBankCardInfo: - return UnmarshalBankCardInfo(data) + case TypeKeyboardButtonTypeText: + return UnmarshalKeyboardButtonTypeText(data) - case TypeAddress: - return UnmarshalAddress(data) + case TypeKeyboardButtonTypeRequestPhoneNumber: + return UnmarshalKeyboardButtonTypeRequestPhoneNumber(data) - case TypeThemeParameters: - return UnmarshalThemeParameters(data) + case TypeKeyboardButtonTypeRequestLocation: + return UnmarshalKeyboardButtonTypeRequestLocation(data) - case TypeLabeledPricePart: - return UnmarshalLabeledPricePart(data) + case TypeKeyboardButtonTypeRequestPoll: + return UnmarshalKeyboardButtonTypeRequestPoll(data) - case TypeInvoice: - return UnmarshalInvoice(data) + case TypeKeyboardButtonTypeRequestUsers: + return UnmarshalKeyboardButtonTypeRequestUsers(data) - case TypeOrderInfo: - return UnmarshalOrderInfo(data) + case TypeKeyboardButtonTypeRequestChat: + return UnmarshalKeyboardButtonTypeRequestChat(data) - case TypeShippingOption: - return UnmarshalShippingOption(data) + case TypeKeyboardButtonTypeWebApp: + return UnmarshalKeyboardButtonTypeWebApp(data) - case TypeSavedCredentials: - return UnmarshalSavedCredentials(data) + case TypeKeyboardButton: + return UnmarshalKeyboardButton(data) - case TypeInputCredentialsSaved: - return UnmarshalInputCredentialsSaved(data) + case TypeInlineKeyboardButtonTypeUrl: + return UnmarshalInlineKeyboardButtonTypeUrl(data) - case TypeInputCredentialsNew: - return UnmarshalInputCredentialsNew(data) + case TypeInlineKeyboardButtonTypeLoginUrl: + return UnmarshalInlineKeyboardButtonTypeLoginUrl(data) - case TypeInputCredentialsApplePay: - return UnmarshalInputCredentialsApplePay(data) + case TypeInlineKeyboardButtonTypeWebApp: + return UnmarshalInlineKeyboardButtonTypeWebApp(data) - case TypeInputCredentialsGooglePay: - return UnmarshalInputCredentialsGooglePay(data) + case TypeInlineKeyboardButtonTypeCallback: + return UnmarshalInlineKeyboardButtonTypeCallback(data) - case TypePaymentProviderSmartGlocal: - return UnmarshalPaymentProviderSmartGlocal(data) + case TypeInlineKeyboardButtonTypeCallbackWithPassword: + return UnmarshalInlineKeyboardButtonTypeCallbackWithPassword(data) - case TypePaymentProviderStripe: - return UnmarshalPaymentProviderStripe(data) + case TypeInlineKeyboardButtonTypeCallbackGame: + return UnmarshalInlineKeyboardButtonTypeCallbackGame(data) - case TypePaymentProviderOther: - return UnmarshalPaymentProviderOther(data) + case TypeInlineKeyboardButtonTypeSwitchInline: + return UnmarshalInlineKeyboardButtonTypeSwitchInline(data) - case TypePaymentOption: - return UnmarshalPaymentOption(data) + case TypeInlineKeyboardButtonTypeBuy: + return UnmarshalInlineKeyboardButtonTypeBuy(data) - case TypePaymentForm: - return UnmarshalPaymentForm(data) + case TypeInlineKeyboardButtonTypeUser: + return UnmarshalInlineKeyboardButtonTypeUser(data) - case TypeValidatedOrderInfo: - return UnmarshalValidatedOrderInfo(data) + case TypeInlineKeyboardButton: + return UnmarshalInlineKeyboardButton(data) - case TypePaymentResult: - return UnmarshalPaymentResult(data) + case TypeReplyMarkupRemoveKeyboard: + return UnmarshalReplyMarkupRemoveKeyboard(data) - case TypePaymentReceipt: - return UnmarshalPaymentReceipt(data) + case TypeReplyMarkupForceReply: + return UnmarshalReplyMarkupForceReply(data) - case TypeInputInvoiceMessage: - return UnmarshalInputInvoiceMessage(data) + case TypeReplyMarkupShowKeyboard: + return UnmarshalReplyMarkupShowKeyboard(data) - case TypeInputInvoiceName: - return UnmarshalInputInvoiceName(data) + case TypeReplyMarkupInlineKeyboard: + return UnmarshalReplyMarkupInlineKeyboard(data) - case TypeMessageExtendedMediaPreview: - return UnmarshalMessageExtendedMediaPreview(data) + case TypeLoginUrlInfoOpen: + return UnmarshalLoginUrlInfoOpen(data) - case TypeMessageExtendedMediaPhoto: - return UnmarshalMessageExtendedMediaPhoto(data) + case TypeLoginUrlInfoRequestConfirmation: + return UnmarshalLoginUrlInfoRequestConfirmation(data) - case TypeMessageExtendedMediaVideo: - return UnmarshalMessageExtendedMediaVideo(data) + case TypeFoundWebApp: + return UnmarshalFoundWebApp(data) - case TypeMessageExtendedMediaUnsupported: - return UnmarshalMessageExtendedMediaUnsupported(data) + case TypeWebAppInfo: + return UnmarshalWebAppInfo(data) - case TypeDatedFile: - return UnmarshalDatedFile(data) + case TypeMessageThreadInfo: + return UnmarshalMessageThreadInfo(data) - case TypePassportElementTypePersonalDetails: - return UnmarshalPassportElementTypePersonalDetails(data) + case TypeSavedMessagesTopicTypeMyNotes: + return UnmarshalSavedMessagesTopicTypeMyNotes(data) - case TypePassportElementTypePassport: - return UnmarshalPassportElementTypePassport(data) + case TypeSavedMessagesTopicTypeAuthorHidden: + return UnmarshalSavedMessagesTopicTypeAuthorHidden(data) - case TypePassportElementTypeDriverLicense: - return UnmarshalPassportElementTypeDriverLicense(data) + case TypeSavedMessagesTopicTypeSavedFromChat: + return UnmarshalSavedMessagesTopicTypeSavedFromChat(data) - case TypePassportElementTypeIdentityCard: - return UnmarshalPassportElementTypeIdentityCard(data) + case TypeSavedMessagesTopic: + return UnmarshalSavedMessagesTopic(data) - case TypePassportElementTypeInternalPassport: - return UnmarshalPassportElementTypeInternalPassport(data) + case TypeForumTopicIcon: + return UnmarshalForumTopicIcon(data) - case TypePassportElementTypeAddress: - return UnmarshalPassportElementTypeAddress(data) + case TypeForumTopicInfo: + return UnmarshalForumTopicInfo(data) - case TypePassportElementTypeUtilityBill: - return UnmarshalPassportElementTypeUtilityBill(data) + case TypeForumTopic: + return UnmarshalForumTopic(data) - case TypePassportElementTypeBankStatement: - return UnmarshalPassportElementTypeBankStatement(data) + case TypeForumTopics: + return UnmarshalForumTopics(data) - case TypePassportElementTypeRentalAgreement: - return UnmarshalPassportElementTypeRentalAgreement(data) + case TypeLinkPreviewOptions: + return UnmarshalLinkPreviewOptions(data) - case TypePassportElementTypePassportRegistration: - return UnmarshalPassportElementTypePassportRegistration(data) + case TypeSharedUser: + return UnmarshalSharedUser(data) - case TypePassportElementTypeTemporaryRegistration: - return UnmarshalPassportElementTypeTemporaryRegistration(data) + case TypeSharedChat: + return UnmarshalSharedChat(data) - case TypePassportElementTypePhoneNumber: - return UnmarshalPassportElementTypePhoneNumber(data) + case TypeRichTextPlain: + return UnmarshalRichTextPlain(data) - case TypePassportElementTypeEmailAddress: - return UnmarshalPassportElementTypeEmailAddress(data) + case TypeRichTextBold: + return UnmarshalRichTextBold(data) - case TypeDate: - return UnmarshalDate(data) + case TypeRichTextItalic: + return UnmarshalRichTextItalic(data) - case TypePersonalDetails: - return UnmarshalPersonalDetails(data) + case TypeRichTextUnderline: + return UnmarshalRichTextUnderline(data) - case TypeIdentityDocument: - return UnmarshalIdentityDocument(data) + case TypeRichTextStrikethrough: + return UnmarshalRichTextStrikethrough(data) - case TypeInputIdentityDocument: - return UnmarshalInputIdentityDocument(data) + case TypeRichTextFixed: + return UnmarshalRichTextFixed(data) - case TypePersonalDocument: - return UnmarshalPersonalDocument(data) + case TypeRichTextUrl: + return UnmarshalRichTextUrl(data) - case TypeInputPersonalDocument: - return UnmarshalInputPersonalDocument(data) + case TypeRichTextEmailAddress: + return UnmarshalRichTextEmailAddress(data) - case TypePassportElementPersonalDetails: - return UnmarshalPassportElementPersonalDetails(data) + case TypeRichTextSubscript: + return UnmarshalRichTextSubscript(data) - case TypePassportElementPassport: - return UnmarshalPassportElementPassport(data) + case TypeRichTextSuperscript: + return UnmarshalRichTextSuperscript(data) - case TypePassportElementDriverLicense: - return UnmarshalPassportElementDriverLicense(data) + case TypeRichTextMarked: + return UnmarshalRichTextMarked(data) - case TypePassportElementIdentityCard: - return UnmarshalPassportElementIdentityCard(data) + case TypeRichTextPhoneNumber: + return UnmarshalRichTextPhoneNumber(data) - case TypePassportElementInternalPassport: - return UnmarshalPassportElementInternalPassport(data) + case TypeRichTextIcon: + return UnmarshalRichTextIcon(data) - case TypePassportElementAddress: - return UnmarshalPassportElementAddress(data) + case TypeRichTextReference: + return UnmarshalRichTextReference(data) - case TypePassportElementUtilityBill: - return UnmarshalPassportElementUtilityBill(data) + case TypeRichTextAnchor: + return UnmarshalRichTextAnchor(data) - case TypePassportElementBankStatement: - return UnmarshalPassportElementBankStatement(data) + case TypeRichTextAnchorLink: + return UnmarshalRichTextAnchorLink(data) - case TypePassportElementRentalAgreement: - return UnmarshalPassportElementRentalAgreement(data) + case TypeRichTexts: + return UnmarshalRichTexts(data) - case TypePassportElementPassportRegistration: - return UnmarshalPassportElementPassportRegistration(data) + case TypePageBlockCaption: + return UnmarshalPageBlockCaption(data) - case TypePassportElementTemporaryRegistration: - return UnmarshalPassportElementTemporaryRegistration(data) + case TypePageBlockListItem: + return UnmarshalPageBlockListItem(data) - case TypePassportElementPhoneNumber: - return UnmarshalPassportElementPhoneNumber(data) + case TypePageBlockHorizontalAlignmentLeft: + return UnmarshalPageBlockHorizontalAlignmentLeft(data) - case TypePassportElementEmailAddress: - return UnmarshalPassportElementEmailAddress(data) + case TypePageBlockHorizontalAlignmentCenter: + return UnmarshalPageBlockHorizontalAlignmentCenter(data) - case TypeInputPassportElementPersonalDetails: - return UnmarshalInputPassportElementPersonalDetails(data) + case TypePageBlockHorizontalAlignmentRight: + return UnmarshalPageBlockHorizontalAlignmentRight(data) - case TypeInputPassportElementPassport: - return UnmarshalInputPassportElementPassport(data) + case TypePageBlockVerticalAlignmentTop: + return UnmarshalPageBlockVerticalAlignmentTop(data) - case TypeInputPassportElementDriverLicense: - return UnmarshalInputPassportElementDriverLicense(data) + case TypePageBlockVerticalAlignmentMiddle: + return UnmarshalPageBlockVerticalAlignmentMiddle(data) - case TypeInputPassportElementIdentityCard: - return UnmarshalInputPassportElementIdentityCard(data) + case TypePageBlockVerticalAlignmentBottom: + return UnmarshalPageBlockVerticalAlignmentBottom(data) - case TypeInputPassportElementInternalPassport: - return UnmarshalInputPassportElementInternalPassport(data) + case TypePageBlockTableCell: + return UnmarshalPageBlockTableCell(data) - case TypeInputPassportElementAddress: - return UnmarshalInputPassportElementAddress(data) + case TypePageBlockRelatedArticle: + return UnmarshalPageBlockRelatedArticle(data) - case TypeInputPassportElementUtilityBill: - return UnmarshalInputPassportElementUtilityBill(data) + case TypePageBlockTitle: + return UnmarshalPageBlockTitle(data) - case TypeInputPassportElementBankStatement: - return UnmarshalInputPassportElementBankStatement(data) + case TypePageBlockSubtitle: + return UnmarshalPageBlockSubtitle(data) - case TypeInputPassportElementRentalAgreement: - return UnmarshalInputPassportElementRentalAgreement(data) + case TypePageBlockAuthorDate: + return UnmarshalPageBlockAuthorDate(data) - case TypeInputPassportElementPassportRegistration: - return UnmarshalInputPassportElementPassportRegistration(data) + case TypePageBlockHeader: + return UnmarshalPageBlockHeader(data) - case TypeInputPassportElementTemporaryRegistration: - return UnmarshalInputPassportElementTemporaryRegistration(data) + case TypePageBlockSubheader: + return UnmarshalPageBlockSubheader(data) - case TypeInputPassportElementPhoneNumber: - return UnmarshalInputPassportElementPhoneNumber(data) + case TypePageBlockKicker: + return UnmarshalPageBlockKicker(data) - case TypeInputPassportElementEmailAddress: - return UnmarshalInputPassportElementEmailAddress(data) + case TypePageBlockParagraph: + return UnmarshalPageBlockParagraph(data) - case TypePassportElements: - return UnmarshalPassportElements(data) + case TypePageBlockPreformatted: + return UnmarshalPageBlockPreformatted(data) - case TypePassportElementErrorSourceUnspecified: - return UnmarshalPassportElementErrorSourceUnspecified(data) + case TypePageBlockFooter: + return UnmarshalPageBlockFooter(data) - case TypePassportElementErrorSourceDataField: - return UnmarshalPassportElementErrorSourceDataField(data) + case TypePageBlockDivider: + return UnmarshalPageBlockDivider(data) - case TypePassportElementErrorSourceFrontSide: - return UnmarshalPassportElementErrorSourceFrontSide(data) + case TypePageBlockAnchor: + return UnmarshalPageBlockAnchor(data) - case TypePassportElementErrorSourceReverseSide: - return UnmarshalPassportElementErrorSourceReverseSide(data) + case TypePageBlockList: + return UnmarshalPageBlockList(data) - case TypePassportElementErrorSourceSelfie: - return UnmarshalPassportElementErrorSourceSelfie(data) + case TypePageBlockBlockQuote: + return UnmarshalPageBlockBlockQuote(data) - case TypePassportElementErrorSourceTranslationFile: - return UnmarshalPassportElementErrorSourceTranslationFile(data) + case TypePageBlockPullQuote: + return UnmarshalPageBlockPullQuote(data) - case TypePassportElementErrorSourceTranslationFiles: - return UnmarshalPassportElementErrorSourceTranslationFiles(data) + case TypePageBlockAnimation: + return UnmarshalPageBlockAnimation(data) - case TypePassportElementErrorSourceFile: - return UnmarshalPassportElementErrorSourceFile(data) + case TypePageBlockAudio: + return UnmarshalPageBlockAudio(data) - case TypePassportElementErrorSourceFiles: - return UnmarshalPassportElementErrorSourceFiles(data) + case TypePageBlockPhoto: + return UnmarshalPageBlockPhoto(data) - case TypePassportElementError: - return UnmarshalPassportElementError(data) + case TypePageBlockVideo: + return UnmarshalPageBlockVideo(data) - case TypePassportSuitableElement: - return UnmarshalPassportSuitableElement(data) + case TypePageBlockVoiceNote: + return UnmarshalPageBlockVoiceNote(data) - case TypePassportRequiredElement: - return UnmarshalPassportRequiredElement(data) + case TypePageBlockCover: + return UnmarshalPageBlockCover(data) - case TypePassportAuthorizationForm: - return UnmarshalPassportAuthorizationForm(data) + case TypePageBlockEmbedded: + return UnmarshalPageBlockEmbedded(data) - case TypePassportElementsWithErrors: - return UnmarshalPassportElementsWithErrors(data) + case TypePageBlockEmbeddedPost: + return UnmarshalPageBlockEmbeddedPost(data) - case TypeEncryptedCredentials: - return UnmarshalEncryptedCredentials(data) + case TypePageBlockCollage: + return UnmarshalPageBlockCollage(data) - case TypeEncryptedPassportElement: - return UnmarshalEncryptedPassportElement(data) + case TypePageBlockSlideshow: + return UnmarshalPageBlockSlideshow(data) - case TypeInputPassportElementErrorSourceUnspecified: - return UnmarshalInputPassportElementErrorSourceUnspecified(data) + case TypePageBlockChatLink: + return UnmarshalPageBlockChatLink(data) - case TypeInputPassportElementErrorSourceDataField: - return UnmarshalInputPassportElementErrorSourceDataField(data) + case TypePageBlockTable: + return UnmarshalPageBlockTable(data) - case TypeInputPassportElementErrorSourceFrontSide: - return UnmarshalInputPassportElementErrorSourceFrontSide(data) + case TypePageBlockDetails: + return UnmarshalPageBlockDetails(data) - case TypeInputPassportElementErrorSourceReverseSide: - return UnmarshalInputPassportElementErrorSourceReverseSide(data) + case TypePageBlockRelatedArticles: + return UnmarshalPageBlockRelatedArticles(data) - case TypeInputPassportElementErrorSourceSelfie: - return UnmarshalInputPassportElementErrorSourceSelfie(data) + case TypePageBlockMap: + return UnmarshalPageBlockMap(data) - case TypeInputPassportElementErrorSourceTranslationFile: - return UnmarshalInputPassportElementErrorSourceTranslationFile(data) + case TypeWebPageInstantView: + return UnmarshalWebPageInstantView(data) - case TypeInputPassportElementErrorSourceTranslationFiles: - return UnmarshalInputPassportElementErrorSourceTranslationFiles(data) + case TypeWebPage: + return UnmarshalWebPage(data) - case TypeInputPassportElementErrorSourceFile: - return UnmarshalInputPassportElementErrorSourceFile(data) + case TypeCountryInfo: + return UnmarshalCountryInfo(data) - case TypeInputPassportElementErrorSourceFiles: - return UnmarshalInputPassportElementErrorSourceFiles(data) + case TypeCountries: + return UnmarshalCountries(data) - case TypeInputPassportElementError: - return UnmarshalInputPassportElementError(data) + case TypePhoneNumberInfo: + return UnmarshalPhoneNumberInfo(data) - case TypeMessageText: - return UnmarshalMessageText(data) + case TypeCollectibleItemTypeUsername: + return UnmarshalCollectibleItemTypeUsername(data) - case TypeMessageAnimation: - return UnmarshalMessageAnimation(data) + case TypeCollectibleItemTypePhoneNumber: + return UnmarshalCollectibleItemTypePhoneNumber(data) - case TypeMessageAudio: - return UnmarshalMessageAudio(data) + case TypeCollectibleItemInfo: + return UnmarshalCollectibleItemInfo(data) - case TypeMessageDocument: - return UnmarshalMessageDocument(data) + case TypeBankCardActionOpenUrl: + return UnmarshalBankCardActionOpenUrl(data) - case TypeMessagePhoto: - return UnmarshalMessagePhoto(data) + case TypeBankCardInfo: + return UnmarshalBankCardInfo(data) - case TypeMessageExpiredPhoto: - return UnmarshalMessageExpiredPhoto(data) + case TypeAddress: + return UnmarshalAddress(data) - case TypeMessageSticker: - return UnmarshalMessageSticker(data) + case TypeThemeParameters: + return UnmarshalThemeParameters(data) - case TypeMessageVideo: - return UnmarshalMessageVideo(data) + case TypeLabeledPricePart: + return UnmarshalLabeledPricePart(data) - case TypeMessageExpiredVideo: - return UnmarshalMessageExpiredVideo(data) + case TypeInvoice: + return UnmarshalInvoice(data) - case TypeMessageVideoNote: - return UnmarshalMessageVideoNote(data) + case TypeOrderInfo: + return UnmarshalOrderInfo(data) - case TypeMessageVoiceNote: - return UnmarshalMessageVoiceNote(data) + case TypeShippingOption: + return UnmarshalShippingOption(data) - case TypeMessageLocation: - return UnmarshalMessageLocation(data) + case TypeSavedCredentials: + return UnmarshalSavedCredentials(data) - case TypeMessageVenue: - return UnmarshalMessageVenue(data) + case TypeInputCredentialsSaved: + return UnmarshalInputCredentialsSaved(data) - case TypeMessageContact: - return UnmarshalMessageContact(data) + case TypeInputCredentialsNew: + return UnmarshalInputCredentialsNew(data) - case TypeMessageAnimatedEmoji: - return UnmarshalMessageAnimatedEmoji(data) + case TypeInputCredentialsApplePay: + return UnmarshalInputCredentialsApplePay(data) - case TypeMessageDice: - return UnmarshalMessageDice(data) + case TypeInputCredentialsGooglePay: + return UnmarshalInputCredentialsGooglePay(data) - case TypeMessageGame: - return UnmarshalMessageGame(data) + case TypePaymentProviderSmartGlocal: + return UnmarshalPaymentProviderSmartGlocal(data) - case TypeMessagePoll: - return UnmarshalMessagePoll(data) + case TypePaymentProviderStripe: + return UnmarshalPaymentProviderStripe(data) - case TypeMessageInvoice: - return UnmarshalMessageInvoice(data) + case TypePaymentProviderOther: + return UnmarshalPaymentProviderOther(data) - case TypeMessageCall: - return UnmarshalMessageCall(data) + case TypePaymentOption: + return UnmarshalPaymentOption(data) - case TypeMessageVideoChatScheduled: - return UnmarshalMessageVideoChatScheduled(data) + case TypePaymentForm: + return UnmarshalPaymentForm(data) - case TypeMessageVideoChatStarted: - return UnmarshalMessageVideoChatStarted(data) + case TypeValidatedOrderInfo: + return UnmarshalValidatedOrderInfo(data) - case TypeMessageVideoChatEnded: - return UnmarshalMessageVideoChatEnded(data) + case TypePaymentResult: + return UnmarshalPaymentResult(data) - case TypeMessageInviteVideoChatParticipants: - return UnmarshalMessageInviteVideoChatParticipants(data) + case TypePaymentReceipt: + return UnmarshalPaymentReceipt(data) - case TypeMessageBasicGroupChatCreate: - return UnmarshalMessageBasicGroupChatCreate(data) + case TypeInputInvoiceMessage: + return UnmarshalInputInvoiceMessage(data) - case TypeMessageSupergroupChatCreate: - return UnmarshalMessageSupergroupChatCreate(data) + case TypeInputInvoiceName: + return UnmarshalInputInvoiceName(data) - case TypeMessageChatChangeTitle: - return UnmarshalMessageChatChangeTitle(data) + case TypeInputInvoiceTelegram: + return UnmarshalInputInvoiceTelegram(data) - case TypeMessageChatChangePhoto: - return UnmarshalMessageChatChangePhoto(data) + case TypeMessageExtendedMediaPreview: + return UnmarshalMessageExtendedMediaPreview(data) - case TypeMessageChatDeletePhoto: - return UnmarshalMessageChatDeletePhoto(data) + case TypeMessageExtendedMediaPhoto: + return UnmarshalMessageExtendedMediaPhoto(data) - case TypeMessageChatAddMembers: - return UnmarshalMessageChatAddMembers(data) + case TypeMessageExtendedMediaVideo: + return UnmarshalMessageExtendedMediaVideo(data) - case TypeMessageChatJoinByLink: - return UnmarshalMessageChatJoinByLink(data) + case TypeMessageExtendedMediaUnsupported: + return UnmarshalMessageExtendedMediaUnsupported(data) - case TypeMessageChatJoinByRequest: - return UnmarshalMessageChatJoinByRequest(data) + case TypePremiumGiveawayParameters: + return UnmarshalPremiumGiveawayParameters(data) - case TypeMessageChatDeleteMember: - return UnmarshalMessageChatDeleteMember(data) + case TypeDatedFile: + return UnmarshalDatedFile(data) - case TypeMessageChatUpgradeTo: - return UnmarshalMessageChatUpgradeTo(data) + case TypePassportElementTypePersonalDetails: + return UnmarshalPassportElementTypePersonalDetails(data) - case TypeMessageChatUpgradeFrom: - return UnmarshalMessageChatUpgradeFrom(data) + case TypePassportElementTypePassport: + return UnmarshalPassportElementTypePassport(data) - case TypeMessagePinMessage: - return UnmarshalMessagePinMessage(data) + case TypePassportElementTypeDriverLicense: + return UnmarshalPassportElementTypeDriverLicense(data) - case TypeMessageScreenshotTaken: - return UnmarshalMessageScreenshotTaken(data) + case TypePassportElementTypeIdentityCard: + return UnmarshalPassportElementTypeIdentityCard(data) - case TypeMessageChatSetTheme: - return UnmarshalMessageChatSetTheme(data) + case TypePassportElementTypeInternalPassport: + return UnmarshalPassportElementTypeInternalPassport(data) - case TypeMessageChatSetMessageAutoDeleteTime: - return UnmarshalMessageChatSetMessageAutoDeleteTime(data) + case TypePassportElementTypeAddress: + return UnmarshalPassportElementTypeAddress(data) - case TypeMessageForumTopicCreated: - return UnmarshalMessageForumTopicCreated(data) + case TypePassportElementTypeUtilityBill: + return UnmarshalPassportElementTypeUtilityBill(data) - case TypeMessageForumTopicEdited: - return UnmarshalMessageForumTopicEdited(data) + case TypePassportElementTypeBankStatement: + return UnmarshalPassportElementTypeBankStatement(data) - case TypeMessageForumTopicIsClosedToggled: - return UnmarshalMessageForumTopicIsClosedToggled(data) + case TypePassportElementTypeRentalAgreement: + return UnmarshalPassportElementTypeRentalAgreement(data) - case TypeMessageForumTopicIsHiddenToggled: - return UnmarshalMessageForumTopicIsHiddenToggled(data) + case TypePassportElementTypePassportRegistration: + return UnmarshalPassportElementTypePassportRegistration(data) - case TypeMessageSuggestProfilePhoto: - return UnmarshalMessageSuggestProfilePhoto(data) + case TypePassportElementTypeTemporaryRegistration: + return UnmarshalPassportElementTypeTemporaryRegistration(data) - case TypeMessageCustomServiceAction: - return UnmarshalMessageCustomServiceAction(data) + case TypePassportElementTypePhoneNumber: + return UnmarshalPassportElementTypePhoneNumber(data) - case TypeMessageGameScore: - return UnmarshalMessageGameScore(data) + case TypePassportElementTypeEmailAddress: + return UnmarshalPassportElementTypeEmailAddress(data) - case TypeMessagePaymentSuccessful: - return UnmarshalMessagePaymentSuccessful(data) + case TypeDate: + return UnmarshalDate(data) - case TypeMessagePaymentSuccessfulBot: - return UnmarshalMessagePaymentSuccessfulBot(data) + case TypePersonalDetails: + return UnmarshalPersonalDetails(data) - case TypeMessageGiftedPremium: - return UnmarshalMessageGiftedPremium(data) + case TypeIdentityDocument: + return UnmarshalIdentityDocument(data) - case TypeMessageContactRegistered: - return UnmarshalMessageContactRegistered(data) + case TypeInputIdentityDocument: + return UnmarshalInputIdentityDocument(data) - case TypeMessageWebsiteConnected: - return UnmarshalMessageWebsiteConnected(data) + case TypePersonalDocument: + return UnmarshalPersonalDocument(data) - case TypeMessageBotWriteAccessAllowed: - return UnmarshalMessageBotWriteAccessAllowed(data) + case TypeInputPersonalDocument: + return UnmarshalInputPersonalDocument(data) - case TypeMessageWebAppDataSent: - return UnmarshalMessageWebAppDataSent(data) + case TypePassportElementPersonalDetails: + return UnmarshalPassportElementPersonalDetails(data) - case TypeMessageWebAppDataReceived: - return UnmarshalMessageWebAppDataReceived(data) + case TypePassportElementPassport: + return UnmarshalPassportElementPassport(data) - case TypeMessagePassportDataSent: - return UnmarshalMessagePassportDataSent(data) + case TypePassportElementDriverLicense: + return UnmarshalPassportElementDriverLicense(data) - case TypeMessagePassportDataReceived: - return UnmarshalMessagePassportDataReceived(data) + case TypePassportElementIdentityCard: + return UnmarshalPassportElementIdentityCard(data) - case TypeMessageProximityAlertTriggered: - return UnmarshalMessageProximityAlertTriggered(data) + case TypePassportElementInternalPassport: + return UnmarshalPassportElementInternalPassport(data) - case TypeMessageUnsupported: - return UnmarshalMessageUnsupported(data) + case TypePassportElementAddress: + return UnmarshalPassportElementAddress(data) - case TypeTextEntityTypeMention: - return UnmarshalTextEntityTypeMention(data) + case TypePassportElementUtilityBill: + return UnmarshalPassportElementUtilityBill(data) - case TypeTextEntityTypeHashtag: - return UnmarshalTextEntityTypeHashtag(data) + case TypePassportElementBankStatement: + return UnmarshalPassportElementBankStatement(data) - case TypeTextEntityTypeCashtag: - return UnmarshalTextEntityTypeCashtag(data) + case TypePassportElementRentalAgreement: + return UnmarshalPassportElementRentalAgreement(data) - case TypeTextEntityTypeBotCommand: - return UnmarshalTextEntityTypeBotCommand(data) + case TypePassportElementPassportRegistration: + return UnmarshalPassportElementPassportRegistration(data) - case TypeTextEntityTypeUrl: - return UnmarshalTextEntityTypeUrl(data) + case TypePassportElementTemporaryRegistration: + return UnmarshalPassportElementTemporaryRegistration(data) - case TypeTextEntityTypeEmailAddress: - return UnmarshalTextEntityTypeEmailAddress(data) + case TypePassportElementPhoneNumber: + return UnmarshalPassportElementPhoneNumber(data) - case TypeTextEntityTypePhoneNumber: - return UnmarshalTextEntityTypePhoneNumber(data) + case TypePassportElementEmailAddress: + return UnmarshalPassportElementEmailAddress(data) - case TypeTextEntityTypeBankCardNumber: - return UnmarshalTextEntityTypeBankCardNumber(data) + case TypeInputPassportElementPersonalDetails: + return UnmarshalInputPassportElementPersonalDetails(data) - case TypeTextEntityTypeBold: - return UnmarshalTextEntityTypeBold(data) + case TypeInputPassportElementPassport: + return UnmarshalInputPassportElementPassport(data) - case TypeTextEntityTypeItalic: - return UnmarshalTextEntityTypeItalic(data) + case TypeInputPassportElementDriverLicense: + return UnmarshalInputPassportElementDriverLicense(data) - case TypeTextEntityTypeUnderline: - return UnmarshalTextEntityTypeUnderline(data) + case TypeInputPassportElementIdentityCard: + return UnmarshalInputPassportElementIdentityCard(data) - case TypeTextEntityTypeStrikethrough: - return UnmarshalTextEntityTypeStrikethrough(data) + case TypeInputPassportElementInternalPassport: + return UnmarshalInputPassportElementInternalPassport(data) - case TypeTextEntityTypeSpoiler: - return UnmarshalTextEntityTypeSpoiler(data) + case TypeInputPassportElementAddress: + return UnmarshalInputPassportElementAddress(data) - case TypeTextEntityTypeCode: - return UnmarshalTextEntityTypeCode(data) + case TypeInputPassportElementUtilityBill: + return UnmarshalInputPassportElementUtilityBill(data) - case TypeTextEntityTypePre: - return UnmarshalTextEntityTypePre(data) + case TypeInputPassportElementBankStatement: + return UnmarshalInputPassportElementBankStatement(data) - case TypeTextEntityTypePreCode: - return UnmarshalTextEntityTypePreCode(data) + case TypeInputPassportElementRentalAgreement: + return UnmarshalInputPassportElementRentalAgreement(data) - case TypeTextEntityTypeTextUrl: - return UnmarshalTextEntityTypeTextUrl(data) + case TypeInputPassportElementPassportRegistration: + return UnmarshalInputPassportElementPassportRegistration(data) - case TypeTextEntityTypeMentionName: - return UnmarshalTextEntityTypeMentionName(data) + case TypeInputPassportElementTemporaryRegistration: + return UnmarshalInputPassportElementTemporaryRegistration(data) - case TypeTextEntityTypeCustomEmoji: - return UnmarshalTextEntityTypeCustomEmoji(data) + case TypeInputPassportElementPhoneNumber: + return UnmarshalInputPassportElementPhoneNumber(data) - case TypeTextEntityTypeMediaTimestamp: - return UnmarshalTextEntityTypeMediaTimestamp(data) + case TypeInputPassportElementEmailAddress: + return UnmarshalInputPassportElementEmailAddress(data) - case TypeInputThumbnail: - return UnmarshalInputThumbnail(data) + case TypePassportElements: + return UnmarshalPassportElements(data) - case TypeMessageSchedulingStateSendAtDate: - return UnmarshalMessageSchedulingStateSendAtDate(data) + case TypePassportElementErrorSourceUnspecified: + return UnmarshalPassportElementErrorSourceUnspecified(data) - case TypeMessageSchedulingStateSendWhenOnline: - return UnmarshalMessageSchedulingStateSendWhenOnline(data) + case TypePassportElementErrorSourceDataField: + return UnmarshalPassportElementErrorSourceDataField(data) - case TypeMessageSendOptions: - return UnmarshalMessageSendOptions(data) + case TypePassportElementErrorSourceFrontSide: + return UnmarshalPassportElementErrorSourceFrontSide(data) - case TypeMessageCopyOptions: - return UnmarshalMessageCopyOptions(data) + case TypePassportElementErrorSourceReverseSide: + return UnmarshalPassportElementErrorSourceReverseSide(data) - case TypeInputMessageText: - return UnmarshalInputMessageText(data) + case TypePassportElementErrorSourceSelfie: + return UnmarshalPassportElementErrorSourceSelfie(data) - case TypeInputMessageAnimation: - return UnmarshalInputMessageAnimation(data) + case TypePassportElementErrorSourceTranslationFile: + return UnmarshalPassportElementErrorSourceTranslationFile(data) - case TypeInputMessageAudio: - return UnmarshalInputMessageAudio(data) + case TypePassportElementErrorSourceTranslationFiles: + return UnmarshalPassportElementErrorSourceTranslationFiles(data) - case TypeInputMessageDocument: - return UnmarshalInputMessageDocument(data) + case TypePassportElementErrorSourceFile: + return UnmarshalPassportElementErrorSourceFile(data) - case TypeInputMessagePhoto: - return UnmarshalInputMessagePhoto(data) + case TypePassportElementErrorSourceFiles: + return UnmarshalPassportElementErrorSourceFiles(data) - case TypeInputMessageSticker: - return UnmarshalInputMessageSticker(data) + case TypePassportElementError: + return UnmarshalPassportElementError(data) - case TypeInputMessageVideo: - return UnmarshalInputMessageVideo(data) + case TypePassportSuitableElement: + return UnmarshalPassportSuitableElement(data) - case TypeInputMessageVideoNote: - return UnmarshalInputMessageVideoNote(data) + case TypePassportRequiredElement: + return UnmarshalPassportRequiredElement(data) - case TypeInputMessageVoiceNote: - return UnmarshalInputMessageVoiceNote(data) + case TypePassportAuthorizationForm: + return UnmarshalPassportAuthorizationForm(data) - case TypeInputMessageLocation: - return UnmarshalInputMessageLocation(data) + case TypePassportElementsWithErrors: + return UnmarshalPassportElementsWithErrors(data) - case TypeInputMessageVenue: - return UnmarshalInputMessageVenue(data) + case TypeEncryptedCredentials: + return UnmarshalEncryptedCredentials(data) - case TypeInputMessageContact: - return UnmarshalInputMessageContact(data) + case TypeEncryptedPassportElement: + return UnmarshalEncryptedPassportElement(data) - case TypeInputMessageDice: - return UnmarshalInputMessageDice(data) + case TypeInputPassportElementErrorSourceUnspecified: + return UnmarshalInputPassportElementErrorSourceUnspecified(data) - case TypeInputMessageGame: - return UnmarshalInputMessageGame(data) + case TypeInputPassportElementErrorSourceDataField: + return UnmarshalInputPassportElementErrorSourceDataField(data) - case TypeInputMessageInvoice: - return UnmarshalInputMessageInvoice(data) + case TypeInputPassportElementErrorSourceFrontSide: + return UnmarshalInputPassportElementErrorSourceFrontSide(data) - case TypeInputMessagePoll: - return UnmarshalInputMessagePoll(data) + case TypeInputPassportElementErrorSourceReverseSide: + return UnmarshalInputPassportElementErrorSourceReverseSide(data) - case TypeInputMessageForwarded: - return UnmarshalInputMessageForwarded(data) + case TypeInputPassportElementErrorSourceSelfie: + return UnmarshalInputPassportElementErrorSourceSelfie(data) - case TypeSearchMessagesFilterEmpty: - return UnmarshalSearchMessagesFilterEmpty(data) + case TypeInputPassportElementErrorSourceTranslationFile: + return UnmarshalInputPassportElementErrorSourceTranslationFile(data) - case TypeSearchMessagesFilterAnimation: - return UnmarshalSearchMessagesFilterAnimation(data) + case TypeInputPassportElementErrorSourceTranslationFiles: + return UnmarshalInputPassportElementErrorSourceTranslationFiles(data) - case TypeSearchMessagesFilterAudio: - return UnmarshalSearchMessagesFilterAudio(data) + case TypeInputPassportElementErrorSourceFile: + return UnmarshalInputPassportElementErrorSourceFile(data) - case TypeSearchMessagesFilterDocument: - return UnmarshalSearchMessagesFilterDocument(data) + case TypeInputPassportElementErrorSourceFiles: + return UnmarshalInputPassportElementErrorSourceFiles(data) - case TypeSearchMessagesFilterPhoto: - return UnmarshalSearchMessagesFilterPhoto(data) + case TypeInputPassportElementError: + return UnmarshalInputPassportElementError(data) - case TypeSearchMessagesFilterVideo: - return UnmarshalSearchMessagesFilterVideo(data) + case TypeMessageText: + return UnmarshalMessageText(data) - case TypeSearchMessagesFilterVoiceNote: - return UnmarshalSearchMessagesFilterVoiceNote(data) + case TypeMessageAnimation: + return UnmarshalMessageAnimation(data) - case TypeSearchMessagesFilterPhotoAndVideo: - return UnmarshalSearchMessagesFilterPhotoAndVideo(data) + case TypeMessageAudio: + return UnmarshalMessageAudio(data) - case TypeSearchMessagesFilterUrl: - return UnmarshalSearchMessagesFilterUrl(data) + case TypeMessageDocument: + return UnmarshalMessageDocument(data) - case TypeSearchMessagesFilterChatPhoto: - return UnmarshalSearchMessagesFilterChatPhoto(data) + case TypeMessagePhoto: + return UnmarshalMessagePhoto(data) - case TypeSearchMessagesFilterVideoNote: - return UnmarshalSearchMessagesFilterVideoNote(data) + case TypeMessageSticker: + return UnmarshalMessageSticker(data) - case TypeSearchMessagesFilterVoiceAndVideoNote: - return UnmarshalSearchMessagesFilterVoiceAndVideoNote(data) + case TypeMessageVideo: + return UnmarshalMessageVideo(data) - case TypeSearchMessagesFilterMention: - return UnmarshalSearchMessagesFilterMention(data) + case TypeMessageVideoNote: + return UnmarshalMessageVideoNote(data) - case TypeSearchMessagesFilterUnreadMention: - return UnmarshalSearchMessagesFilterUnreadMention(data) + case TypeMessageVoiceNote: + return UnmarshalMessageVoiceNote(data) - case TypeSearchMessagesFilterUnreadReaction: - return UnmarshalSearchMessagesFilterUnreadReaction(data) + case TypeMessageExpiredPhoto: + return UnmarshalMessageExpiredPhoto(data) - case TypeSearchMessagesFilterFailedToSend: - return UnmarshalSearchMessagesFilterFailedToSend(data) + case TypeMessageExpiredVideo: + return UnmarshalMessageExpiredVideo(data) - case TypeSearchMessagesFilterPinned: - return UnmarshalSearchMessagesFilterPinned(data) + case TypeMessageExpiredVideoNote: + return UnmarshalMessageExpiredVideoNote(data) - case TypeChatActionTyping: - return UnmarshalChatActionTyping(data) + case TypeMessageExpiredVoiceNote: + return UnmarshalMessageExpiredVoiceNote(data) - case TypeChatActionRecordingVideo: - return UnmarshalChatActionRecordingVideo(data) + case TypeMessageLocation: + return UnmarshalMessageLocation(data) - case TypeChatActionUploadingVideo: - return UnmarshalChatActionUploadingVideo(data) + case TypeMessageVenue: + return UnmarshalMessageVenue(data) - case TypeChatActionRecordingVoiceNote: - return UnmarshalChatActionRecordingVoiceNote(data) + case TypeMessageContact: + return UnmarshalMessageContact(data) - case TypeChatActionUploadingVoiceNote: - return UnmarshalChatActionUploadingVoiceNote(data) + case TypeMessageAnimatedEmoji: + return UnmarshalMessageAnimatedEmoji(data) - case TypeChatActionUploadingPhoto: - return UnmarshalChatActionUploadingPhoto(data) + case TypeMessageDice: + return UnmarshalMessageDice(data) - case TypeChatActionUploadingDocument: - return UnmarshalChatActionUploadingDocument(data) + case TypeMessageGame: + return UnmarshalMessageGame(data) - case TypeChatActionChoosingSticker: - return UnmarshalChatActionChoosingSticker(data) + case TypeMessagePoll: + return UnmarshalMessagePoll(data) - case TypeChatActionChoosingLocation: - return UnmarshalChatActionChoosingLocation(data) + case TypeMessageStory: + return UnmarshalMessageStory(data) - case TypeChatActionChoosingContact: - return UnmarshalChatActionChoosingContact(data) + case TypeMessageInvoice: + return UnmarshalMessageInvoice(data) - case TypeChatActionStartPlayingGame: - return UnmarshalChatActionStartPlayingGame(data) + case TypeMessageCall: + return UnmarshalMessageCall(data) - case TypeChatActionRecordingVideoNote: - return UnmarshalChatActionRecordingVideoNote(data) + case TypeMessageVideoChatScheduled: + return UnmarshalMessageVideoChatScheduled(data) - case TypeChatActionUploadingVideoNote: - return UnmarshalChatActionUploadingVideoNote(data) + case TypeMessageVideoChatStarted: + return UnmarshalMessageVideoChatStarted(data) - case TypeChatActionWatchingAnimations: - return UnmarshalChatActionWatchingAnimations(data) + case TypeMessageVideoChatEnded: + return UnmarshalMessageVideoChatEnded(data) - case TypeChatActionCancel: - return UnmarshalChatActionCancel(data) + case TypeMessageInviteVideoChatParticipants: + return UnmarshalMessageInviteVideoChatParticipants(data) - case TypeUserStatusEmpty: - return UnmarshalUserStatusEmpty(data) + case TypeMessageBasicGroupChatCreate: + return UnmarshalMessageBasicGroupChatCreate(data) - case TypeUserStatusOnline: - return UnmarshalUserStatusOnline(data) + case TypeMessageSupergroupChatCreate: + return UnmarshalMessageSupergroupChatCreate(data) - case TypeUserStatusOffline: - return UnmarshalUserStatusOffline(data) + case TypeMessageChatChangeTitle: + return UnmarshalMessageChatChangeTitle(data) - case TypeUserStatusRecently: - return UnmarshalUserStatusRecently(data) + case TypeMessageChatChangePhoto: + return UnmarshalMessageChatChangePhoto(data) - case TypeUserStatusLastWeek: - return UnmarshalUserStatusLastWeek(data) + case TypeMessageChatDeletePhoto: + return UnmarshalMessageChatDeletePhoto(data) - case TypeUserStatusLastMonth: - return UnmarshalUserStatusLastMonth(data) + case TypeMessageChatAddMembers: + return UnmarshalMessageChatAddMembers(data) - case TypeStickers: - return UnmarshalStickers(data) + case TypeMessageChatJoinByLink: + return UnmarshalMessageChatJoinByLink(data) - case TypeEmojis: - return UnmarshalEmojis(data) + case TypeMessageChatJoinByRequest: + return UnmarshalMessageChatJoinByRequest(data) - case TypeStickerSet: - return UnmarshalStickerSet(data) + case TypeMessageChatDeleteMember: + return UnmarshalMessageChatDeleteMember(data) - case TypeStickerSetInfo: - return UnmarshalStickerSetInfo(data) + case TypeMessageChatUpgradeTo: + return UnmarshalMessageChatUpgradeTo(data) - case TypeStickerSets: - return UnmarshalStickerSets(data) + case TypeMessageChatUpgradeFrom: + return UnmarshalMessageChatUpgradeFrom(data) - case TypeTrendingStickerSets: - return UnmarshalTrendingStickerSets(data) + case TypeMessagePinMessage: + return UnmarshalMessagePinMessage(data) - case TypeCallDiscardReasonEmpty: - return UnmarshalCallDiscardReasonEmpty(data) + case TypeMessageScreenshotTaken: + return UnmarshalMessageScreenshotTaken(data) - case TypeCallDiscardReasonMissed: - return UnmarshalCallDiscardReasonMissed(data) + case TypeMessageChatSetBackground: + return UnmarshalMessageChatSetBackground(data) - case TypeCallDiscardReasonDeclined: - return UnmarshalCallDiscardReasonDeclined(data) + case TypeMessageChatSetTheme: + return UnmarshalMessageChatSetTheme(data) - case TypeCallDiscardReasonDisconnected: - return UnmarshalCallDiscardReasonDisconnected(data) + case TypeMessageChatSetMessageAutoDeleteTime: + return UnmarshalMessageChatSetMessageAutoDeleteTime(data) - case TypeCallDiscardReasonHungUp: - return UnmarshalCallDiscardReasonHungUp(data) + case TypeMessageChatBoost: + return UnmarshalMessageChatBoost(data) - case TypeCallProtocol: - return UnmarshalCallProtocol(data) + case TypeMessageForumTopicCreated: + return UnmarshalMessageForumTopicCreated(data) - case TypeCallServerTypeTelegramReflector: - return UnmarshalCallServerTypeTelegramReflector(data) + case TypeMessageForumTopicEdited: + return UnmarshalMessageForumTopicEdited(data) - case TypeCallServerTypeWebrtc: - return UnmarshalCallServerTypeWebrtc(data) + case TypeMessageForumTopicIsClosedToggled: + return UnmarshalMessageForumTopicIsClosedToggled(data) - case TypeCallServer: - return UnmarshalCallServer(data) + case TypeMessageForumTopicIsHiddenToggled: + return UnmarshalMessageForumTopicIsHiddenToggled(data) - case TypeCallId: - return UnmarshalCallId(data) + case TypeMessageSuggestProfilePhoto: + return UnmarshalMessageSuggestProfilePhoto(data) - case TypeGroupCallId: - return UnmarshalGroupCallId(data) + case TypeMessageCustomServiceAction: + return UnmarshalMessageCustomServiceAction(data) - case TypeCallStatePending: - return UnmarshalCallStatePending(data) + case TypeMessageGameScore: + return UnmarshalMessageGameScore(data) - case TypeCallStateExchangingKeys: - return UnmarshalCallStateExchangingKeys(data) + case TypeMessagePaymentSuccessful: + return UnmarshalMessagePaymentSuccessful(data) - case TypeCallStateReady: - return UnmarshalCallStateReady(data) + case TypeMessagePaymentSuccessfulBot: + return UnmarshalMessagePaymentSuccessfulBot(data) - case TypeCallStateHangingUp: - return UnmarshalCallStateHangingUp(data) + case TypeMessageGiftedPremium: + return UnmarshalMessageGiftedPremium(data) - case TypeCallStateDiscarded: - return UnmarshalCallStateDiscarded(data) + case TypeMessagePremiumGiftCode: + return UnmarshalMessagePremiumGiftCode(data) - case TypeCallStateError: - return UnmarshalCallStateError(data) + case TypeMessagePremiumGiveawayCreated: + return UnmarshalMessagePremiumGiveawayCreated(data) - case TypeGroupCallVideoQualityThumbnail: - return UnmarshalGroupCallVideoQualityThumbnail(data) + case TypeMessagePremiumGiveaway: + return UnmarshalMessagePremiumGiveaway(data) - case TypeGroupCallVideoQualityMedium: - return UnmarshalGroupCallVideoQualityMedium(data) + case TypeMessagePremiumGiveawayCompleted: + return UnmarshalMessagePremiumGiveawayCompleted(data) - case TypeGroupCallVideoQualityFull: - return UnmarshalGroupCallVideoQualityFull(data) + case TypeMessagePremiumGiveawayWinners: + return UnmarshalMessagePremiumGiveawayWinners(data) - case TypeGroupCallStream: - return UnmarshalGroupCallStream(data) + case TypeMessageContactRegistered: + return UnmarshalMessageContactRegistered(data) - case TypeGroupCallStreams: - return UnmarshalGroupCallStreams(data) + case TypeMessageUsersShared: + return UnmarshalMessageUsersShared(data) - case TypeRtmpUrl: - return UnmarshalRtmpUrl(data) + case TypeMessageChatShared: + return UnmarshalMessageChatShared(data) - case TypeGroupCallRecentSpeaker: - return UnmarshalGroupCallRecentSpeaker(data) + case TypeMessageBotWriteAccessAllowed: + return UnmarshalMessageBotWriteAccessAllowed(data) - case TypeGroupCall: - return UnmarshalGroupCall(data) + case TypeMessageWebAppDataSent: + return UnmarshalMessageWebAppDataSent(data) - case TypeGroupCallVideoSourceGroup: - return UnmarshalGroupCallVideoSourceGroup(data) + case TypeMessageWebAppDataReceived: + return UnmarshalMessageWebAppDataReceived(data) - case TypeGroupCallParticipantVideoInfo: - return UnmarshalGroupCallParticipantVideoInfo(data) + case TypeMessagePassportDataSent: + return UnmarshalMessagePassportDataSent(data) - case TypeGroupCallParticipant: - return UnmarshalGroupCallParticipant(data) + case TypeMessagePassportDataReceived: + return UnmarshalMessagePassportDataReceived(data) - case TypeCallProblemEcho: - return UnmarshalCallProblemEcho(data) + case TypeMessageProximityAlertTriggered: + return UnmarshalMessageProximityAlertTriggered(data) - case TypeCallProblemNoise: - return UnmarshalCallProblemNoise(data) + case TypeMessageUnsupported: + return UnmarshalMessageUnsupported(data) - case TypeCallProblemInterruptions: - return UnmarshalCallProblemInterruptions(data) + case TypeTextEntityTypeMention: + return UnmarshalTextEntityTypeMention(data) - case TypeCallProblemDistortedSpeech: - return UnmarshalCallProblemDistortedSpeech(data) + case TypeTextEntityTypeHashtag: + return UnmarshalTextEntityTypeHashtag(data) - case TypeCallProblemSilentLocal: - return UnmarshalCallProblemSilentLocal(data) + case TypeTextEntityTypeCashtag: + return UnmarshalTextEntityTypeCashtag(data) - case TypeCallProblemSilentRemote: - return UnmarshalCallProblemSilentRemote(data) + case TypeTextEntityTypeBotCommand: + return UnmarshalTextEntityTypeBotCommand(data) - case TypeCallProblemDropped: - return UnmarshalCallProblemDropped(data) + case TypeTextEntityTypeUrl: + return UnmarshalTextEntityTypeUrl(data) - case TypeCallProblemDistortedVideo: - return UnmarshalCallProblemDistortedVideo(data) + case TypeTextEntityTypeEmailAddress: + return UnmarshalTextEntityTypeEmailAddress(data) - case TypeCallProblemPixelatedVideo: - return UnmarshalCallProblemPixelatedVideo(data) + case TypeTextEntityTypePhoneNumber: + return UnmarshalTextEntityTypePhoneNumber(data) - case TypeCall: - return UnmarshalCall(data) + case TypeTextEntityTypeBankCardNumber: + return UnmarshalTextEntityTypeBankCardNumber(data) - case TypePhoneNumberAuthenticationSettings: - return UnmarshalPhoneNumberAuthenticationSettings(data) + case TypeTextEntityTypeBold: + return UnmarshalTextEntityTypeBold(data) - case TypeAddedReaction: - return UnmarshalAddedReaction(data) + case TypeTextEntityTypeItalic: + return UnmarshalTextEntityTypeItalic(data) - case TypeAddedReactions: - return UnmarshalAddedReactions(data) + case TypeTextEntityTypeUnderline: + return UnmarshalTextEntityTypeUnderline(data) - case TypeAvailableReaction: - return UnmarshalAvailableReaction(data) + case TypeTextEntityTypeStrikethrough: + return UnmarshalTextEntityTypeStrikethrough(data) - case TypeAvailableReactions: - return UnmarshalAvailableReactions(data) + case TypeTextEntityTypeSpoiler: + return UnmarshalTextEntityTypeSpoiler(data) - case TypeEmojiReaction: - return UnmarshalEmojiReaction(data) + case TypeTextEntityTypeCode: + return UnmarshalTextEntityTypeCode(data) - case TypeAnimations: - return UnmarshalAnimations(data) + case TypeTextEntityTypePre: + return UnmarshalTextEntityTypePre(data) - case TypeDiceStickersRegular: - return UnmarshalDiceStickersRegular(data) + case TypeTextEntityTypePreCode: + return UnmarshalTextEntityTypePreCode(data) - case TypeDiceStickersSlotMachine: - return UnmarshalDiceStickersSlotMachine(data) + case TypeTextEntityTypeBlockQuote: + return UnmarshalTextEntityTypeBlockQuote(data) - case TypeImportedContacts: - return UnmarshalImportedContacts(data) + case TypeTextEntityTypeTextUrl: + return UnmarshalTextEntityTypeTextUrl(data) - case TypeSpeechRecognitionResultPending: - return UnmarshalSpeechRecognitionResultPending(data) + case TypeTextEntityTypeMentionName: + return UnmarshalTextEntityTypeMentionName(data) - case TypeSpeechRecognitionResultText: - return UnmarshalSpeechRecognitionResultText(data) + case TypeTextEntityTypeCustomEmoji: + return UnmarshalTextEntityTypeCustomEmoji(data) - case TypeSpeechRecognitionResultError: - return UnmarshalSpeechRecognitionResultError(data) + case TypeTextEntityTypeMediaTimestamp: + return UnmarshalTextEntityTypeMediaTimestamp(data) - case TypeAttachmentMenuBotColor: - return UnmarshalAttachmentMenuBotColor(data) + case TypeInputThumbnail: + return UnmarshalInputThumbnail(data) - case TypeAttachmentMenuBot: - return UnmarshalAttachmentMenuBot(data) + case TypeMessageSchedulingStateSendAtDate: + return UnmarshalMessageSchedulingStateSendAtDate(data) - case TypeSentWebAppMessage: - return UnmarshalSentWebAppMessage(data) + case TypeMessageSchedulingStateSendWhenOnline: + return UnmarshalMessageSchedulingStateSendWhenOnline(data) - case TypeHttpUrl: - return UnmarshalHttpUrl(data) + case TypeMessageSelfDestructTypeTimer: + return UnmarshalMessageSelfDestructTypeTimer(data) - case TypeUserLink: - return UnmarshalUserLink(data) + case TypeMessageSelfDestructTypeImmediately: + return UnmarshalMessageSelfDestructTypeImmediately(data) - case TypeInputInlineQueryResultAnimation: - return UnmarshalInputInlineQueryResultAnimation(data) + case TypeMessageSendOptions: + return UnmarshalMessageSendOptions(data) - case TypeInputInlineQueryResultArticle: - return UnmarshalInputInlineQueryResultArticle(data) + case TypeMessageCopyOptions: + return UnmarshalMessageCopyOptions(data) - case TypeInputInlineQueryResultAudio: - return UnmarshalInputInlineQueryResultAudio(data) + case TypeInputMessageText: + return UnmarshalInputMessageText(data) - case TypeInputInlineQueryResultContact: - return UnmarshalInputInlineQueryResultContact(data) + case TypeInputMessageAnimation: + return UnmarshalInputMessageAnimation(data) - case TypeInputInlineQueryResultDocument: - return UnmarshalInputInlineQueryResultDocument(data) + case TypeInputMessageAudio: + return UnmarshalInputMessageAudio(data) - case TypeInputInlineQueryResultGame: - return UnmarshalInputInlineQueryResultGame(data) + case TypeInputMessageDocument: + return UnmarshalInputMessageDocument(data) - case TypeInputInlineQueryResultLocation: - return UnmarshalInputInlineQueryResultLocation(data) + case TypeInputMessagePhoto: + return UnmarshalInputMessagePhoto(data) - case TypeInputInlineQueryResultPhoto: - return UnmarshalInputInlineQueryResultPhoto(data) + case TypeInputMessageSticker: + return UnmarshalInputMessageSticker(data) - case TypeInputInlineQueryResultSticker: - return UnmarshalInputInlineQueryResultSticker(data) + case TypeInputMessageVideo: + return UnmarshalInputMessageVideo(data) - case TypeInputInlineQueryResultVenue: - return UnmarshalInputInlineQueryResultVenue(data) + case TypeInputMessageVideoNote: + return UnmarshalInputMessageVideoNote(data) - case TypeInputInlineQueryResultVideo: - return UnmarshalInputInlineQueryResultVideo(data) + case TypeInputMessageVoiceNote: + return UnmarshalInputMessageVoiceNote(data) - case TypeInputInlineQueryResultVoiceNote: - return UnmarshalInputInlineQueryResultVoiceNote(data) + case TypeInputMessageLocation: + return UnmarshalInputMessageLocation(data) - case TypeInlineQueryResultArticle: - return UnmarshalInlineQueryResultArticle(data) + case TypeInputMessageVenue: + return UnmarshalInputMessageVenue(data) - case TypeInlineQueryResultContact: - return UnmarshalInlineQueryResultContact(data) + case TypeInputMessageContact: + return UnmarshalInputMessageContact(data) - case TypeInlineQueryResultLocation: - return UnmarshalInlineQueryResultLocation(data) + case TypeInputMessageDice: + return UnmarshalInputMessageDice(data) - case TypeInlineQueryResultVenue: - return UnmarshalInlineQueryResultVenue(data) + case TypeInputMessageGame: + return UnmarshalInputMessageGame(data) - case TypeInlineQueryResultGame: - return UnmarshalInlineQueryResultGame(data) + case TypeInputMessageInvoice: + return UnmarshalInputMessageInvoice(data) - case TypeInlineQueryResultAnimation: - return UnmarshalInlineQueryResultAnimation(data) + case TypeInputMessagePoll: + return UnmarshalInputMessagePoll(data) - case TypeInlineQueryResultAudio: - return UnmarshalInlineQueryResultAudio(data) + case TypeInputMessageStory: + return UnmarshalInputMessageStory(data) - case TypeInlineQueryResultDocument: - return UnmarshalInlineQueryResultDocument(data) + case TypeInputMessageForwarded: + return UnmarshalInputMessageForwarded(data) - case TypeInlineQueryResultPhoto: - return UnmarshalInlineQueryResultPhoto(data) + case TypeSearchMessagesFilterEmpty: + return UnmarshalSearchMessagesFilterEmpty(data) - case TypeInlineQueryResultSticker: - return UnmarshalInlineQueryResultSticker(data) + case TypeSearchMessagesFilterAnimation: + return UnmarshalSearchMessagesFilterAnimation(data) - case TypeInlineQueryResultVideo: - return UnmarshalInlineQueryResultVideo(data) + case TypeSearchMessagesFilterAudio: + return UnmarshalSearchMessagesFilterAudio(data) - case TypeInlineQueryResultVoiceNote: - return UnmarshalInlineQueryResultVoiceNote(data) + case TypeSearchMessagesFilterDocument: + return UnmarshalSearchMessagesFilterDocument(data) - case TypeInlineQueryResults: - return UnmarshalInlineQueryResults(data) + case TypeSearchMessagesFilterPhoto: + return UnmarshalSearchMessagesFilterPhoto(data) - case TypeCallbackQueryPayloadData: - return UnmarshalCallbackQueryPayloadData(data) + case TypeSearchMessagesFilterVideo: + return UnmarshalSearchMessagesFilterVideo(data) - case TypeCallbackQueryPayloadDataWithPassword: - return UnmarshalCallbackQueryPayloadDataWithPassword(data) + case TypeSearchMessagesFilterVoiceNote: + return UnmarshalSearchMessagesFilterVoiceNote(data) - case TypeCallbackQueryPayloadGame: - return UnmarshalCallbackQueryPayloadGame(data) + case TypeSearchMessagesFilterPhotoAndVideo: + return UnmarshalSearchMessagesFilterPhotoAndVideo(data) - case TypeCallbackQueryAnswer: - return UnmarshalCallbackQueryAnswer(data) + case TypeSearchMessagesFilterUrl: + return UnmarshalSearchMessagesFilterUrl(data) - case TypeCustomRequestResult: - return UnmarshalCustomRequestResult(data) + case TypeSearchMessagesFilterChatPhoto: + return UnmarshalSearchMessagesFilterChatPhoto(data) - case TypeGameHighScore: - return UnmarshalGameHighScore(data) + case TypeSearchMessagesFilterVideoNote: + return UnmarshalSearchMessagesFilterVideoNote(data) - case TypeGameHighScores: - return UnmarshalGameHighScores(data) + case TypeSearchMessagesFilterVoiceAndVideoNote: + return UnmarshalSearchMessagesFilterVoiceAndVideoNote(data) - case TypeChatEventMessageEdited: - return UnmarshalChatEventMessageEdited(data) + case TypeSearchMessagesFilterMention: + return UnmarshalSearchMessagesFilterMention(data) - case TypeChatEventMessageDeleted: - return UnmarshalChatEventMessageDeleted(data) + case TypeSearchMessagesFilterUnreadMention: + return UnmarshalSearchMessagesFilterUnreadMention(data) - case TypeChatEventMessagePinned: - return UnmarshalChatEventMessagePinned(data) + case TypeSearchMessagesFilterUnreadReaction: + return UnmarshalSearchMessagesFilterUnreadReaction(data) - case TypeChatEventMessageUnpinned: - return UnmarshalChatEventMessageUnpinned(data) + case TypeSearchMessagesFilterFailedToSend: + return UnmarshalSearchMessagesFilterFailedToSend(data) - case TypeChatEventPollStopped: - return UnmarshalChatEventPollStopped(data) + case TypeSearchMessagesFilterPinned: + return UnmarshalSearchMessagesFilterPinned(data) - case TypeChatEventMemberJoined: - return UnmarshalChatEventMemberJoined(data) + case TypeChatActionTyping: + return UnmarshalChatActionTyping(data) - case TypeChatEventMemberJoinedByInviteLink: - return UnmarshalChatEventMemberJoinedByInviteLink(data) + case TypeChatActionRecordingVideo: + return UnmarshalChatActionRecordingVideo(data) - case TypeChatEventMemberJoinedByRequest: - return UnmarshalChatEventMemberJoinedByRequest(data) + case TypeChatActionUploadingVideo: + return UnmarshalChatActionUploadingVideo(data) - case TypeChatEventMemberInvited: - return UnmarshalChatEventMemberInvited(data) + case TypeChatActionRecordingVoiceNote: + return UnmarshalChatActionRecordingVoiceNote(data) - case TypeChatEventMemberLeft: - return UnmarshalChatEventMemberLeft(data) + case TypeChatActionUploadingVoiceNote: + return UnmarshalChatActionUploadingVoiceNote(data) - case TypeChatEventMemberPromoted: - return UnmarshalChatEventMemberPromoted(data) + case TypeChatActionUploadingPhoto: + return UnmarshalChatActionUploadingPhoto(data) - case TypeChatEventMemberRestricted: - return UnmarshalChatEventMemberRestricted(data) + case TypeChatActionUploadingDocument: + return UnmarshalChatActionUploadingDocument(data) - case TypeChatEventAvailableReactionsChanged: - return UnmarshalChatEventAvailableReactionsChanged(data) + case TypeChatActionChoosingSticker: + return UnmarshalChatActionChoosingSticker(data) - case TypeChatEventDescriptionChanged: - return UnmarshalChatEventDescriptionChanged(data) + case TypeChatActionChoosingLocation: + return UnmarshalChatActionChoosingLocation(data) - case TypeChatEventLinkedChatChanged: - return UnmarshalChatEventLinkedChatChanged(data) + case TypeChatActionChoosingContact: + return UnmarshalChatActionChoosingContact(data) - case TypeChatEventLocationChanged: - return UnmarshalChatEventLocationChanged(data) + case TypeChatActionStartPlayingGame: + return UnmarshalChatActionStartPlayingGame(data) - case TypeChatEventMessageAutoDeleteTimeChanged: - return UnmarshalChatEventMessageAutoDeleteTimeChanged(data) + case TypeChatActionRecordingVideoNote: + return UnmarshalChatActionRecordingVideoNote(data) - case TypeChatEventPermissionsChanged: - return UnmarshalChatEventPermissionsChanged(data) + case TypeChatActionUploadingVideoNote: + return UnmarshalChatActionUploadingVideoNote(data) - case TypeChatEventPhotoChanged: - return UnmarshalChatEventPhotoChanged(data) + case TypeChatActionWatchingAnimations: + return UnmarshalChatActionWatchingAnimations(data) - case TypeChatEventSlowModeDelayChanged: - return UnmarshalChatEventSlowModeDelayChanged(data) + case TypeChatActionCancel: + return UnmarshalChatActionCancel(data) - case TypeChatEventStickerSetChanged: - return UnmarshalChatEventStickerSetChanged(data) + case TypeUserStatusEmpty: + return UnmarshalUserStatusEmpty(data) - case TypeChatEventTitleChanged: - return UnmarshalChatEventTitleChanged(data) + case TypeUserStatusOnline: + return UnmarshalUserStatusOnline(data) - case TypeChatEventUsernameChanged: - return UnmarshalChatEventUsernameChanged(data) + case TypeUserStatusOffline: + return UnmarshalUserStatusOffline(data) - case TypeChatEventActiveUsernamesChanged: - return UnmarshalChatEventActiveUsernamesChanged(data) + case TypeUserStatusRecently: + return UnmarshalUserStatusRecently(data) - case TypeChatEventHasProtectedContentToggled: - return UnmarshalChatEventHasProtectedContentToggled(data) + case TypeUserStatusLastWeek: + return UnmarshalUserStatusLastWeek(data) - case TypeChatEventInvitesToggled: - return UnmarshalChatEventInvitesToggled(data) + case TypeUserStatusLastMonth: + return UnmarshalUserStatusLastMonth(data) - case TypeChatEventIsAllHistoryAvailableToggled: - return UnmarshalChatEventIsAllHistoryAvailableToggled(data) + case TypeEmojiKeyword: + return UnmarshalEmojiKeyword(data) - case TypeChatEventHasAggressiveAntiSpamEnabledToggled: - return UnmarshalChatEventHasAggressiveAntiSpamEnabledToggled(data) + case TypeEmojiKeywords: + return UnmarshalEmojiKeywords(data) - case TypeChatEventSignMessagesToggled: - return UnmarshalChatEventSignMessagesToggled(data) + case TypeStickers: + return UnmarshalStickers(data) - case TypeChatEventInviteLinkEdited: - return UnmarshalChatEventInviteLinkEdited(data) + case TypeEmojis: + return UnmarshalEmojis(data) - case TypeChatEventInviteLinkRevoked: - return UnmarshalChatEventInviteLinkRevoked(data) + case TypeStickerSet: + return UnmarshalStickerSet(data) - case TypeChatEventInviteLinkDeleted: - return UnmarshalChatEventInviteLinkDeleted(data) + case TypeStickerSetInfo: + return UnmarshalStickerSetInfo(data) - case TypeChatEventVideoChatCreated: - return UnmarshalChatEventVideoChatCreated(data) + case TypeStickerSets: + return UnmarshalStickerSets(data) - case TypeChatEventVideoChatEnded: - return UnmarshalChatEventVideoChatEnded(data) + case TypeTrendingStickerSets: + return UnmarshalTrendingStickerSets(data) - case TypeChatEventVideoChatMuteNewParticipantsToggled: - return UnmarshalChatEventVideoChatMuteNewParticipantsToggled(data) + case TypeEmojiCategory: + return UnmarshalEmojiCategory(data) - case TypeChatEventVideoChatParticipantIsMutedToggled: - return UnmarshalChatEventVideoChatParticipantIsMutedToggled(data) + case TypeEmojiCategories: + return UnmarshalEmojiCategories(data) - case TypeChatEventVideoChatParticipantVolumeLevelChanged: - return UnmarshalChatEventVideoChatParticipantVolumeLevelChanged(data) + case TypeEmojiCategoryTypeDefault: + return UnmarshalEmojiCategoryTypeDefault(data) - case TypeChatEventIsForumToggled: - return UnmarshalChatEventIsForumToggled(data) + case TypeEmojiCategoryTypeEmojiStatus: + return UnmarshalEmojiCategoryTypeEmojiStatus(data) - case TypeChatEventForumTopicCreated: - return UnmarshalChatEventForumTopicCreated(data) + case TypeEmojiCategoryTypeChatPhoto: + return UnmarshalEmojiCategoryTypeChatPhoto(data) - case TypeChatEventForumTopicEdited: - return UnmarshalChatEventForumTopicEdited(data) + case TypeStoryAreaPosition: + return UnmarshalStoryAreaPosition(data) - case TypeChatEventForumTopicToggleIsClosed: - return UnmarshalChatEventForumTopicToggleIsClosed(data) + case TypeStoryAreaTypeLocation: + return UnmarshalStoryAreaTypeLocation(data) - case TypeChatEventForumTopicToggleIsHidden: - return UnmarshalChatEventForumTopicToggleIsHidden(data) + case TypeStoryAreaTypeVenue: + return UnmarshalStoryAreaTypeVenue(data) - case TypeChatEventForumTopicDeleted: - return UnmarshalChatEventForumTopicDeleted(data) + case TypeStoryAreaTypeSuggestedReaction: + return UnmarshalStoryAreaTypeSuggestedReaction(data) - case TypeChatEventForumTopicPinned: - return UnmarshalChatEventForumTopicPinned(data) + case TypeStoryAreaTypeMessage: + return UnmarshalStoryAreaTypeMessage(data) - case TypeChatEvent: - return UnmarshalChatEvent(data) + case TypeStoryArea: + return UnmarshalStoryArea(data) - case TypeChatEvents: - return UnmarshalChatEvents(data) + case TypeInputStoryAreaTypeLocation: + return UnmarshalInputStoryAreaTypeLocation(data) - case TypeChatEventLogFilters: - return UnmarshalChatEventLogFilters(data) + case TypeInputStoryAreaTypeFoundVenue: + return UnmarshalInputStoryAreaTypeFoundVenue(data) - case TypeLanguagePackStringValueOrdinary: - return UnmarshalLanguagePackStringValueOrdinary(data) + case TypeInputStoryAreaTypePreviousVenue: + return UnmarshalInputStoryAreaTypePreviousVenue(data) - case TypeLanguagePackStringValuePluralized: - return UnmarshalLanguagePackStringValuePluralized(data) + case TypeInputStoryAreaTypeSuggestedReaction: + return UnmarshalInputStoryAreaTypeSuggestedReaction(data) - case TypeLanguagePackStringValueDeleted: - return UnmarshalLanguagePackStringValueDeleted(data) + case TypeInputStoryAreaTypeMessage: + return UnmarshalInputStoryAreaTypeMessage(data) - case TypeLanguagePackString: - return UnmarshalLanguagePackString(data) + case TypeInputStoryArea: + return UnmarshalInputStoryArea(data) - case TypeLanguagePackStrings: - return UnmarshalLanguagePackStrings(data) + case TypeInputStoryAreas: + return UnmarshalInputStoryAreas(data) - case TypeLanguagePackInfo: - return UnmarshalLanguagePackInfo(data) + case TypeStoryVideo: + return UnmarshalStoryVideo(data) - case TypeLocalizationTargetInfo: - return UnmarshalLocalizationTargetInfo(data) + case TypeStoryContentPhoto: + return UnmarshalStoryContentPhoto(data) - case TypePremiumLimitTypeSupergroupCount: - return UnmarshalPremiumLimitTypeSupergroupCount(data) + case TypeStoryContentVideo: + return UnmarshalStoryContentVideo(data) - case TypePremiumLimitTypePinnedChatCount: - return UnmarshalPremiumLimitTypePinnedChatCount(data) + case TypeStoryContentUnsupported: + return UnmarshalStoryContentUnsupported(data) - case TypePremiumLimitTypeCreatedPublicChatCount: - return UnmarshalPremiumLimitTypeCreatedPublicChatCount(data) + case TypeInputStoryContentPhoto: + return UnmarshalInputStoryContentPhoto(data) - case TypePremiumLimitTypeSavedAnimationCount: - return UnmarshalPremiumLimitTypeSavedAnimationCount(data) + case TypeInputStoryContentVideo: + return UnmarshalInputStoryContentVideo(data) - case TypePremiumLimitTypeFavoriteStickerCount: - return UnmarshalPremiumLimitTypeFavoriteStickerCount(data) + case TypeStoryListMain: + return UnmarshalStoryListMain(data) - case TypePremiumLimitTypeChatFilterCount: - return UnmarshalPremiumLimitTypeChatFilterCount(data) + case TypeStoryListArchive: + return UnmarshalStoryListArchive(data) - case TypePremiumLimitTypeChatFilterChosenChatCount: - return UnmarshalPremiumLimitTypeChatFilterChosenChatCount(data) + case TypeStoryOriginPublicStory: + return UnmarshalStoryOriginPublicStory(data) - case TypePremiumLimitTypePinnedArchivedChatCount: - return UnmarshalPremiumLimitTypePinnedArchivedChatCount(data) + case TypeStoryOriginHiddenUser: + return UnmarshalStoryOriginHiddenUser(data) - case TypePremiumLimitTypeCaptionLength: - return UnmarshalPremiumLimitTypeCaptionLength(data) + case TypeStoryRepostInfo: + return UnmarshalStoryRepostInfo(data) - case TypePremiumLimitTypeBioLength: - return UnmarshalPremiumLimitTypeBioLength(data) + case TypeStoryInteractionInfo: + return UnmarshalStoryInteractionInfo(data) - case TypePremiumFeatureIncreasedLimits: - return UnmarshalPremiumFeatureIncreasedLimits(data) + case TypeStory: + return UnmarshalStory(data) - case TypePremiumFeatureIncreasedUploadFileSize: - return UnmarshalPremiumFeatureIncreasedUploadFileSize(data) + case TypeStories: + return UnmarshalStories(data) - case TypePremiumFeatureImprovedDownloadSpeed: - return UnmarshalPremiumFeatureImprovedDownloadSpeed(data) + case TypeStoryFullId: + return UnmarshalStoryFullId(data) - case TypePremiumFeatureVoiceRecognition: - return UnmarshalPremiumFeatureVoiceRecognition(data) + case TypeStoryInfo: + return UnmarshalStoryInfo(data) - case TypePremiumFeatureDisabledAds: - return UnmarshalPremiumFeatureDisabledAds(data) + case TypeChatActiveStories: + return UnmarshalChatActiveStories(data) - case TypePremiumFeatureUniqueReactions: - return UnmarshalPremiumFeatureUniqueReactions(data) + case TypeStoryInteractionTypeView: + return UnmarshalStoryInteractionTypeView(data) - case TypePremiumFeatureUniqueStickers: - return UnmarshalPremiumFeatureUniqueStickers(data) + case TypeStoryInteractionTypeForward: + return UnmarshalStoryInteractionTypeForward(data) - case TypePremiumFeatureCustomEmoji: - return UnmarshalPremiumFeatureCustomEmoji(data) + case TypeStoryInteractionTypeRepost: + return UnmarshalStoryInteractionTypeRepost(data) - case TypePremiumFeatureAdvancedChatManagement: - return UnmarshalPremiumFeatureAdvancedChatManagement(data) + case TypeStoryInteraction: + return UnmarshalStoryInteraction(data) - case TypePremiumFeatureProfileBadge: - return UnmarshalPremiumFeatureProfileBadge(data) + case TypeStoryInteractions: + return UnmarshalStoryInteractions(data) - case TypePremiumFeatureEmojiStatus: - return UnmarshalPremiumFeatureEmojiStatus(data) + case TypeQuickReplyMessage: + return UnmarshalQuickReplyMessage(data) - case TypePremiumFeatureAnimatedProfilePhoto: - return UnmarshalPremiumFeatureAnimatedProfilePhoto(data) + case TypeQuickReplyShortcut: + return UnmarshalQuickReplyShortcut(data) - case TypePremiumFeatureForumTopicIcon: - return UnmarshalPremiumFeatureForumTopicIcon(data) + case TypePublicForwardMessage: + return UnmarshalPublicForwardMessage(data) - case TypePremiumFeatureAppIcons: - return UnmarshalPremiumFeatureAppIcons(data) + case TypePublicForwardStory: + return UnmarshalPublicForwardStory(data) - case TypePremiumLimit: - return UnmarshalPremiumLimit(data) + case TypePublicForwards: + return UnmarshalPublicForwards(data) - case TypePremiumFeatures: - return UnmarshalPremiumFeatures(data) + case TypeChatBoostLevelFeatures: + return UnmarshalChatBoostLevelFeatures(data) - case TypePremiumSourceLimitExceeded: - return UnmarshalPremiumSourceLimitExceeded(data) + case TypeChatBoostFeatures: + return UnmarshalChatBoostFeatures(data) - case TypePremiumSourceFeature: - return UnmarshalPremiumSourceFeature(data) + case TypeChatBoostSourceGiftCode: + return UnmarshalChatBoostSourceGiftCode(data) - case TypePremiumSourceLink: - return UnmarshalPremiumSourceLink(data) + case TypeChatBoostSourceGiveaway: + return UnmarshalChatBoostSourceGiveaway(data) - case TypePremiumSourceSettings: - return UnmarshalPremiumSourceSettings(data) + case TypeChatBoostSourcePremium: + return UnmarshalChatBoostSourcePremium(data) - case TypePremiumFeaturePromotionAnimation: - return UnmarshalPremiumFeaturePromotionAnimation(data) + case TypePrepaidPremiumGiveaway: + return UnmarshalPrepaidPremiumGiveaway(data) - case TypePremiumState: - return UnmarshalPremiumState(data) + case TypeChatBoostStatus: + return UnmarshalChatBoostStatus(data) - case TypeStorePaymentPurposePremiumSubscription: - return UnmarshalStorePaymentPurposePremiumSubscription(data) + case TypeChatBoost: + return UnmarshalChatBoost(data) - case TypeStorePaymentPurposeGiftedPremium: - return UnmarshalStorePaymentPurposeGiftedPremium(data) + case TypeFoundChatBoosts: + return UnmarshalFoundChatBoosts(data) - case TypeDeviceTokenFirebaseCloudMessaging: - return UnmarshalDeviceTokenFirebaseCloudMessaging(data) + case TypeChatBoostSlot: + return UnmarshalChatBoostSlot(data) - case TypeDeviceTokenApplePush: - return UnmarshalDeviceTokenApplePush(data) + case TypeChatBoostSlots: + return UnmarshalChatBoostSlots(data) - case TypeDeviceTokenApplePushVoIP: - return UnmarshalDeviceTokenApplePushVoIP(data) + case TypeCallDiscardReasonEmpty: + return UnmarshalCallDiscardReasonEmpty(data) - case TypeDeviceTokenWindowsPush: - return UnmarshalDeviceTokenWindowsPush(data) + case TypeCallDiscardReasonMissed: + return UnmarshalCallDiscardReasonMissed(data) - case TypeDeviceTokenMicrosoftPush: - return UnmarshalDeviceTokenMicrosoftPush(data) + case TypeCallDiscardReasonDeclined: + return UnmarshalCallDiscardReasonDeclined(data) - case TypeDeviceTokenMicrosoftPushVoIP: - return UnmarshalDeviceTokenMicrosoftPushVoIP(data) + case TypeCallDiscardReasonDisconnected: + return UnmarshalCallDiscardReasonDisconnected(data) - case TypeDeviceTokenWebPush: - return UnmarshalDeviceTokenWebPush(data) + case TypeCallDiscardReasonHungUp: + return UnmarshalCallDiscardReasonHungUp(data) - case TypeDeviceTokenSimplePush: - return UnmarshalDeviceTokenSimplePush(data) + case TypeCallProtocol: + return UnmarshalCallProtocol(data) - case TypeDeviceTokenUbuntuPush: - return UnmarshalDeviceTokenUbuntuPush(data) + case TypeCallServerTypeTelegramReflector: + return UnmarshalCallServerTypeTelegramReflector(data) - case TypeDeviceTokenBlackBerryPush: - return UnmarshalDeviceTokenBlackBerryPush(data) + case TypeCallServerTypeWebrtc: + return UnmarshalCallServerTypeWebrtc(data) - case TypeDeviceTokenTizenPush: - return UnmarshalDeviceTokenTizenPush(data) + case TypeCallServer: + return UnmarshalCallServer(data) - case TypePushReceiverId: - return UnmarshalPushReceiverId(data) + case TypeCallId: + return UnmarshalCallId(data) - case TypeBackgroundFillSolid: - return UnmarshalBackgroundFillSolid(data) + case TypeGroupCallId: + return UnmarshalGroupCallId(data) - case TypeBackgroundFillGradient: - return UnmarshalBackgroundFillGradient(data) + case TypeCallStatePending: + return UnmarshalCallStatePending(data) - case TypeBackgroundFillFreeformGradient: - return UnmarshalBackgroundFillFreeformGradient(data) + case TypeCallStateExchangingKeys: + return UnmarshalCallStateExchangingKeys(data) - case TypeBackgroundTypeWallpaper: - return UnmarshalBackgroundTypeWallpaper(data) + case TypeCallStateReady: + return UnmarshalCallStateReady(data) - case TypeBackgroundTypePattern: - return UnmarshalBackgroundTypePattern(data) + case TypeCallStateHangingUp: + return UnmarshalCallStateHangingUp(data) - case TypeBackgroundTypeFill: - return UnmarshalBackgroundTypeFill(data) + case TypeCallStateDiscarded: + return UnmarshalCallStateDiscarded(data) - case TypeBackground: - return UnmarshalBackground(data) + case TypeCallStateError: + return UnmarshalCallStateError(data) - case TypeBackgrounds: - return UnmarshalBackgrounds(data) + case TypeGroupCallVideoQualityThumbnail: + return UnmarshalGroupCallVideoQualityThumbnail(data) - case TypeInputBackgroundLocal: - return UnmarshalInputBackgroundLocal(data) + case TypeGroupCallVideoQualityMedium: + return UnmarshalGroupCallVideoQualityMedium(data) - case TypeInputBackgroundRemote: - return UnmarshalInputBackgroundRemote(data) + case TypeGroupCallVideoQualityFull: + return UnmarshalGroupCallVideoQualityFull(data) - case TypeThemeSettings: - return UnmarshalThemeSettings(data) + case TypeGroupCallStream: + return UnmarshalGroupCallStream(data) - case TypeChatTheme: - return UnmarshalChatTheme(data) + case TypeGroupCallStreams: + return UnmarshalGroupCallStreams(data) - case TypeHashtags: - return UnmarshalHashtags(data) + case TypeRtmpUrl: + return UnmarshalRtmpUrl(data) - case TypeCanTransferOwnershipResultOk: - return UnmarshalCanTransferOwnershipResultOk(data) + case TypeGroupCallRecentSpeaker: + return UnmarshalGroupCallRecentSpeaker(data) - case TypeCanTransferOwnershipResultPasswordNeeded: - return UnmarshalCanTransferOwnershipResultPasswordNeeded(data) + case TypeGroupCall: + return UnmarshalGroupCall(data) - case TypeCanTransferOwnershipResultPasswordTooFresh: - return UnmarshalCanTransferOwnershipResultPasswordTooFresh(data) + case TypeGroupCallVideoSourceGroup: + return UnmarshalGroupCallVideoSourceGroup(data) - case TypeCanTransferOwnershipResultSessionTooFresh: - return UnmarshalCanTransferOwnershipResultSessionTooFresh(data) + case TypeGroupCallParticipantVideoInfo: + return UnmarshalGroupCallParticipantVideoInfo(data) - case TypeCheckChatUsernameResultOk: - return UnmarshalCheckChatUsernameResultOk(data) + case TypeGroupCallParticipant: + return UnmarshalGroupCallParticipant(data) - case TypeCheckChatUsernameResultUsernameInvalid: - return UnmarshalCheckChatUsernameResultUsernameInvalid(data) + case TypeCallProblemEcho: + return UnmarshalCallProblemEcho(data) - case TypeCheckChatUsernameResultUsernameOccupied: - return UnmarshalCheckChatUsernameResultUsernameOccupied(data) + case TypeCallProblemNoise: + return UnmarshalCallProblemNoise(data) - case TypeCheckChatUsernameResultUsernamePurchasable: - return UnmarshalCheckChatUsernameResultUsernamePurchasable(data) + case TypeCallProblemInterruptions: + return UnmarshalCallProblemInterruptions(data) - case TypeCheckChatUsernameResultPublicChatsTooMany: - return UnmarshalCheckChatUsernameResultPublicChatsTooMany(data) + case TypeCallProblemDistortedSpeech: + return UnmarshalCallProblemDistortedSpeech(data) - case TypeCheckChatUsernameResultPublicGroupsUnavailable: - return UnmarshalCheckChatUsernameResultPublicGroupsUnavailable(data) + case TypeCallProblemSilentLocal: + return UnmarshalCallProblemSilentLocal(data) - case TypeCheckStickerSetNameResultOk: - return UnmarshalCheckStickerSetNameResultOk(data) + case TypeCallProblemSilentRemote: + return UnmarshalCallProblemSilentRemote(data) - case TypeCheckStickerSetNameResultNameInvalid: - return UnmarshalCheckStickerSetNameResultNameInvalid(data) + case TypeCallProblemDropped: + return UnmarshalCallProblemDropped(data) - case TypeCheckStickerSetNameResultNameOccupied: - return UnmarshalCheckStickerSetNameResultNameOccupied(data) + case TypeCallProblemDistortedVideo: + return UnmarshalCallProblemDistortedVideo(data) - case TypeResetPasswordResultOk: - return UnmarshalResetPasswordResultOk(data) + case TypeCallProblemPixelatedVideo: + return UnmarshalCallProblemPixelatedVideo(data) - case TypeResetPasswordResultPending: - return UnmarshalResetPasswordResultPending(data) + case TypeCall: + return UnmarshalCall(data) - case TypeResetPasswordResultDeclined: - return UnmarshalResetPasswordResultDeclined(data) + case TypeFirebaseAuthenticationSettingsAndroid: + return UnmarshalFirebaseAuthenticationSettingsAndroid(data) - case TypeMessageFileTypePrivate: - return UnmarshalMessageFileTypePrivate(data) + case TypeFirebaseAuthenticationSettingsIos: + return UnmarshalFirebaseAuthenticationSettingsIos(data) - case TypeMessageFileTypeGroup: - return UnmarshalMessageFileTypeGroup(data) + case TypePhoneNumberAuthenticationSettings: + return UnmarshalPhoneNumberAuthenticationSettings(data) - case TypeMessageFileTypeUnknown: - return UnmarshalMessageFileTypeUnknown(data) + case TypeAddedReaction: + return UnmarshalAddedReaction(data) - case TypePushMessageContentHidden: - return UnmarshalPushMessageContentHidden(data) + case TypeAddedReactions: + return UnmarshalAddedReactions(data) - case TypePushMessageContentAnimation: - return UnmarshalPushMessageContentAnimation(data) + case TypeAvailableReaction: + return UnmarshalAvailableReaction(data) - case TypePushMessageContentAudio: - return UnmarshalPushMessageContentAudio(data) + case TypeAvailableReactions: + return UnmarshalAvailableReactions(data) - case TypePushMessageContentContact: - return UnmarshalPushMessageContentContact(data) + case TypeEmojiReaction: + return UnmarshalEmojiReaction(data) - case TypePushMessageContentContactRegistered: - return UnmarshalPushMessageContentContactRegistered(data) + case TypeReactionUnavailabilityReasonAnonymousAdministrator: + return UnmarshalReactionUnavailabilityReasonAnonymousAdministrator(data) - case TypePushMessageContentDocument: - return UnmarshalPushMessageContentDocument(data) + case TypeReactionUnavailabilityReasonGuest: + return UnmarshalReactionUnavailabilityReasonGuest(data) - case TypePushMessageContentGame: - return UnmarshalPushMessageContentGame(data) + case TypeAnimations: + return UnmarshalAnimations(data) - case TypePushMessageContentGameScore: - return UnmarshalPushMessageContentGameScore(data) + case TypeDiceStickersRegular: + return UnmarshalDiceStickersRegular(data) - case TypePushMessageContentInvoice: - return UnmarshalPushMessageContentInvoice(data) + case TypeDiceStickersSlotMachine: + return UnmarshalDiceStickersSlotMachine(data) - case TypePushMessageContentLocation: - return UnmarshalPushMessageContentLocation(data) + case TypeImportedContacts: + return UnmarshalImportedContacts(data) - case TypePushMessageContentPhoto: - return UnmarshalPushMessageContentPhoto(data) + case TypeSpeechRecognitionResultPending: + return UnmarshalSpeechRecognitionResultPending(data) - case TypePushMessageContentPoll: - return UnmarshalPushMessageContentPoll(data) + case TypeSpeechRecognitionResultText: + return UnmarshalSpeechRecognitionResultText(data) - case TypePushMessageContentScreenshotTaken: - return UnmarshalPushMessageContentScreenshotTaken(data) + case TypeSpeechRecognitionResultError: + return UnmarshalSpeechRecognitionResultError(data) - case TypePushMessageContentSticker: - return UnmarshalPushMessageContentSticker(data) + case TypeBusinessConnection: + return UnmarshalBusinessConnection(data) - case TypePushMessageContentText: - return UnmarshalPushMessageContentText(data) + case TypeAttachmentMenuBotColor: + return UnmarshalAttachmentMenuBotColor(data) - case TypePushMessageContentVideo: - return UnmarshalPushMessageContentVideo(data) + case TypeAttachmentMenuBot: + return UnmarshalAttachmentMenuBot(data) - case TypePushMessageContentVideoNote: - return UnmarshalPushMessageContentVideoNote(data) + case TypeSentWebAppMessage: + return UnmarshalSentWebAppMessage(data) - case TypePushMessageContentVoiceNote: - return UnmarshalPushMessageContentVoiceNote(data) + case TypeBotWriteAccessAllowReasonConnectedWebsite: + return UnmarshalBotWriteAccessAllowReasonConnectedWebsite(data) - case TypePushMessageContentBasicGroupChatCreate: - return UnmarshalPushMessageContentBasicGroupChatCreate(data) + case TypeBotWriteAccessAllowReasonAddedToAttachmentMenu: + return UnmarshalBotWriteAccessAllowReasonAddedToAttachmentMenu(data) - case TypePushMessageContentChatAddMembers: - return UnmarshalPushMessageContentChatAddMembers(data) + case TypeBotWriteAccessAllowReasonLaunchedWebApp: + return UnmarshalBotWriteAccessAllowReasonLaunchedWebApp(data) - case TypePushMessageContentChatChangePhoto: - return UnmarshalPushMessageContentChatChangePhoto(data) + case TypeBotWriteAccessAllowReasonAcceptedRequest: + return UnmarshalBotWriteAccessAllowReasonAcceptedRequest(data) - case TypePushMessageContentChatChangeTitle: - return UnmarshalPushMessageContentChatChangeTitle(data) + case TypeHttpUrl: + return UnmarshalHttpUrl(data) - case TypePushMessageContentChatSetTheme: - return UnmarshalPushMessageContentChatSetTheme(data) + case TypeUserLink: + return UnmarshalUserLink(data) - case TypePushMessageContentChatDeleteMember: - return UnmarshalPushMessageContentChatDeleteMember(data) + case TypeInputInlineQueryResultAnimation: + return UnmarshalInputInlineQueryResultAnimation(data) - case TypePushMessageContentChatJoinByLink: - return UnmarshalPushMessageContentChatJoinByLink(data) + case TypeInputInlineQueryResultArticle: + return UnmarshalInputInlineQueryResultArticle(data) - case TypePushMessageContentChatJoinByRequest: - return UnmarshalPushMessageContentChatJoinByRequest(data) + case TypeInputInlineQueryResultAudio: + return UnmarshalInputInlineQueryResultAudio(data) - case TypePushMessageContentRecurringPayment: - return UnmarshalPushMessageContentRecurringPayment(data) + case TypeInputInlineQueryResultContact: + return UnmarshalInputInlineQueryResultContact(data) - case TypePushMessageContentSuggestProfilePhoto: - return UnmarshalPushMessageContentSuggestProfilePhoto(data) + case TypeInputInlineQueryResultDocument: + return UnmarshalInputInlineQueryResultDocument(data) - case TypePushMessageContentMessageForwards: - return UnmarshalPushMessageContentMessageForwards(data) + case TypeInputInlineQueryResultGame: + return UnmarshalInputInlineQueryResultGame(data) - case TypePushMessageContentMediaAlbum: - return UnmarshalPushMessageContentMediaAlbum(data) + case TypeInputInlineQueryResultLocation: + return UnmarshalInputInlineQueryResultLocation(data) - case TypeNotificationTypeNewMessage: - return UnmarshalNotificationTypeNewMessage(data) + case TypeInputInlineQueryResultPhoto: + return UnmarshalInputInlineQueryResultPhoto(data) - case TypeNotificationTypeNewSecretChat: - return UnmarshalNotificationTypeNewSecretChat(data) + case TypeInputInlineQueryResultSticker: + return UnmarshalInputInlineQueryResultSticker(data) - case TypeNotificationTypeNewCall: - return UnmarshalNotificationTypeNewCall(data) + case TypeInputInlineQueryResultVenue: + return UnmarshalInputInlineQueryResultVenue(data) - case TypeNotificationTypeNewPushMessage: - return UnmarshalNotificationTypeNewPushMessage(data) + case TypeInputInlineQueryResultVideo: + return UnmarshalInputInlineQueryResultVideo(data) - case TypeNotificationGroupTypeMessages: - return UnmarshalNotificationGroupTypeMessages(data) + case TypeInputInlineQueryResultVoiceNote: + return UnmarshalInputInlineQueryResultVoiceNote(data) - case TypeNotificationGroupTypeMentions: - return UnmarshalNotificationGroupTypeMentions(data) + case TypeInlineQueryResultArticle: + return UnmarshalInlineQueryResultArticle(data) - case TypeNotificationGroupTypeSecretChat: - return UnmarshalNotificationGroupTypeSecretChat(data) + case TypeInlineQueryResultContact: + return UnmarshalInlineQueryResultContact(data) - case TypeNotificationGroupTypeCalls: - return UnmarshalNotificationGroupTypeCalls(data) + case TypeInlineQueryResultLocation: + return UnmarshalInlineQueryResultLocation(data) - case TypeNotificationSound: - return UnmarshalNotificationSound(data) + case TypeInlineQueryResultVenue: + return UnmarshalInlineQueryResultVenue(data) - case TypeNotificationSounds: - return UnmarshalNotificationSounds(data) + case TypeInlineQueryResultGame: + return UnmarshalInlineQueryResultGame(data) - case TypeNotification: - return UnmarshalNotification(data) + case TypeInlineQueryResultAnimation: + return UnmarshalInlineQueryResultAnimation(data) - case TypeNotificationGroup: - return UnmarshalNotificationGroup(data) + case TypeInlineQueryResultAudio: + return UnmarshalInlineQueryResultAudio(data) - case TypeOptionValueBoolean: - return UnmarshalOptionValueBoolean(data) + case TypeInlineQueryResultDocument: + return UnmarshalInlineQueryResultDocument(data) - case TypeOptionValueEmpty: - return UnmarshalOptionValueEmpty(data) + case TypeInlineQueryResultPhoto: + return UnmarshalInlineQueryResultPhoto(data) - case TypeOptionValueInteger: - return UnmarshalOptionValueInteger(data) + case TypeInlineQueryResultSticker: + return UnmarshalInlineQueryResultSticker(data) - case TypeOptionValueString: - return UnmarshalOptionValueString(data) + case TypeInlineQueryResultVideo: + return UnmarshalInlineQueryResultVideo(data) - case TypeJsonObjectMember: - return UnmarshalJsonObjectMember(data) + case TypeInlineQueryResultVoiceNote: + return UnmarshalInlineQueryResultVoiceNote(data) - case TypeJsonValueNull: - return UnmarshalJsonValueNull(data) + case TypeInlineQueryResultsButtonTypeStartBot: + return UnmarshalInlineQueryResultsButtonTypeStartBot(data) - case TypeJsonValueBoolean: - return UnmarshalJsonValueBoolean(data) + case TypeInlineQueryResultsButtonTypeWebApp: + return UnmarshalInlineQueryResultsButtonTypeWebApp(data) - case TypeJsonValueNumber: - return UnmarshalJsonValueNumber(data) + case TypeInlineQueryResultsButton: + return UnmarshalInlineQueryResultsButton(data) - case TypeJsonValueString: - return UnmarshalJsonValueString(data) + case TypeInlineQueryResults: + return UnmarshalInlineQueryResults(data) - case TypeJsonValueArray: - return UnmarshalJsonValueArray(data) + case TypeCallbackQueryPayloadData: + return UnmarshalCallbackQueryPayloadData(data) - case TypeJsonValueObject: - return UnmarshalJsonValueObject(data) + case TypeCallbackQueryPayloadDataWithPassword: + return UnmarshalCallbackQueryPayloadDataWithPassword(data) - case TypeUserPrivacySettingRuleAllowAll: - return UnmarshalUserPrivacySettingRuleAllowAll(data) + case TypeCallbackQueryPayloadGame: + return UnmarshalCallbackQueryPayloadGame(data) - case TypeUserPrivacySettingRuleAllowContacts: - return UnmarshalUserPrivacySettingRuleAllowContacts(data) + case TypeCallbackQueryAnswer: + return UnmarshalCallbackQueryAnswer(data) - case TypeUserPrivacySettingRuleAllowUsers: - return UnmarshalUserPrivacySettingRuleAllowUsers(data) + case TypeCustomRequestResult: + return UnmarshalCustomRequestResult(data) - case TypeUserPrivacySettingRuleAllowChatMembers: - return UnmarshalUserPrivacySettingRuleAllowChatMembers(data) + case TypeGameHighScore: + return UnmarshalGameHighScore(data) - case TypeUserPrivacySettingRuleRestrictAll: - return UnmarshalUserPrivacySettingRuleRestrictAll(data) + case TypeGameHighScores: + return UnmarshalGameHighScores(data) - case TypeUserPrivacySettingRuleRestrictContacts: - return UnmarshalUserPrivacySettingRuleRestrictContacts(data) + case TypeChatEventMessageEdited: + return UnmarshalChatEventMessageEdited(data) - case TypeUserPrivacySettingRuleRestrictUsers: - return UnmarshalUserPrivacySettingRuleRestrictUsers(data) + case TypeChatEventMessageDeleted: + return UnmarshalChatEventMessageDeleted(data) - case TypeUserPrivacySettingRuleRestrictChatMembers: - return UnmarshalUserPrivacySettingRuleRestrictChatMembers(data) + case TypeChatEventMessagePinned: + return UnmarshalChatEventMessagePinned(data) - case TypeUserPrivacySettingRules: - return UnmarshalUserPrivacySettingRules(data) + case TypeChatEventMessageUnpinned: + return UnmarshalChatEventMessageUnpinned(data) - case TypeUserPrivacySettingShowStatus: - return UnmarshalUserPrivacySettingShowStatus(data) + case TypeChatEventPollStopped: + return UnmarshalChatEventPollStopped(data) - case TypeUserPrivacySettingShowProfilePhoto: - return UnmarshalUserPrivacySettingShowProfilePhoto(data) + case TypeChatEventMemberJoined: + return UnmarshalChatEventMemberJoined(data) - case TypeUserPrivacySettingShowLinkInForwardedMessages: - return UnmarshalUserPrivacySettingShowLinkInForwardedMessages(data) + case TypeChatEventMemberJoinedByInviteLink: + return UnmarshalChatEventMemberJoinedByInviteLink(data) - case TypeUserPrivacySettingShowPhoneNumber: - return UnmarshalUserPrivacySettingShowPhoneNumber(data) + case TypeChatEventMemberJoinedByRequest: + return UnmarshalChatEventMemberJoinedByRequest(data) - case TypeUserPrivacySettingAllowChatInvites: - return UnmarshalUserPrivacySettingAllowChatInvites(data) + case TypeChatEventMemberInvited: + return UnmarshalChatEventMemberInvited(data) - case TypeUserPrivacySettingAllowCalls: - return UnmarshalUserPrivacySettingAllowCalls(data) + case TypeChatEventMemberLeft: + return UnmarshalChatEventMemberLeft(data) - case TypeUserPrivacySettingAllowPeerToPeerCalls: - return UnmarshalUserPrivacySettingAllowPeerToPeerCalls(data) + case TypeChatEventMemberPromoted: + return UnmarshalChatEventMemberPromoted(data) - case TypeUserPrivacySettingAllowFindingByPhoneNumber: - return UnmarshalUserPrivacySettingAllowFindingByPhoneNumber(data) + case TypeChatEventMemberRestricted: + return UnmarshalChatEventMemberRestricted(data) - case TypeUserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages: - return UnmarshalUserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages(data) + case TypeChatEventAvailableReactionsChanged: + return UnmarshalChatEventAvailableReactionsChanged(data) - case TypeAccountTtl: - return UnmarshalAccountTtl(data) + case TypeChatEventBackgroundChanged: + return UnmarshalChatEventBackgroundChanged(data) - case TypeMessageAutoDeleteTime: - return UnmarshalMessageAutoDeleteTime(data) + case TypeChatEventDescriptionChanged: + return UnmarshalChatEventDescriptionChanged(data) - case TypeSessionTypeAndroid: - return UnmarshalSessionTypeAndroid(data) + case TypeChatEventEmojiStatusChanged: + return UnmarshalChatEventEmojiStatusChanged(data) - case TypeSessionTypeApple: - return UnmarshalSessionTypeApple(data) + case TypeChatEventLinkedChatChanged: + return UnmarshalChatEventLinkedChatChanged(data) - case TypeSessionTypeBrave: - return UnmarshalSessionTypeBrave(data) + case TypeChatEventLocationChanged: + return UnmarshalChatEventLocationChanged(data) - case TypeSessionTypeChrome: - return UnmarshalSessionTypeChrome(data) + case TypeChatEventMessageAutoDeleteTimeChanged: + return UnmarshalChatEventMessageAutoDeleteTimeChanged(data) - case TypeSessionTypeEdge: - return UnmarshalSessionTypeEdge(data) + case TypeChatEventPermissionsChanged: + return UnmarshalChatEventPermissionsChanged(data) - case TypeSessionTypeFirefox: - return UnmarshalSessionTypeFirefox(data) + case TypeChatEventPhotoChanged: + return UnmarshalChatEventPhotoChanged(data) - case TypeSessionTypeIpad: - return UnmarshalSessionTypeIpad(data) + case TypeChatEventSlowModeDelayChanged: + return UnmarshalChatEventSlowModeDelayChanged(data) - case TypeSessionTypeIphone: - return UnmarshalSessionTypeIphone(data) + case TypeChatEventStickerSetChanged: + return UnmarshalChatEventStickerSetChanged(data) - case TypeSessionTypeLinux: - return UnmarshalSessionTypeLinux(data) + case TypeChatEventCustomEmojiStickerSetChanged: + return UnmarshalChatEventCustomEmojiStickerSetChanged(data) - case TypeSessionTypeMac: - return UnmarshalSessionTypeMac(data) + case TypeChatEventTitleChanged: + return UnmarshalChatEventTitleChanged(data) - case TypeSessionTypeOpera: - return UnmarshalSessionTypeOpera(data) + case TypeChatEventUsernameChanged: + return UnmarshalChatEventUsernameChanged(data) - case TypeSessionTypeSafari: - return UnmarshalSessionTypeSafari(data) + case TypeChatEventActiveUsernamesChanged: + return UnmarshalChatEventActiveUsernamesChanged(data) - case TypeSessionTypeUbuntu: - return UnmarshalSessionTypeUbuntu(data) + case TypeChatEventAccentColorChanged: + return UnmarshalChatEventAccentColorChanged(data) - case TypeSessionTypeUnknown: - return UnmarshalSessionTypeUnknown(data) + case TypeChatEventProfileAccentColorChanged: + return UnmarshalChatEventProfileAccentColorChanged(data) - case TypeSessionTypeVivaldi: - return UnmarshalSessionTypeVivaldi(data) + case TypeChatEventHasProtectedContentToggled: + return UnmarshalChatEventHasProtectedContentToggled(data) - case TypeSessionTypeWindows: - return UnmarshalSessionTypeWindows(data) + case TypeChatEventInvitesToggled: + return UnmarshalChatEventInvitesToggled(data) - case TypeSessionTypeXbox: - return UnmarshalSessionTypeXbox(data) + case TypeChatEventIsAllHistoryAvailableToggled: + return UnmarshalChatEventIsAllHistoryAvailableToggled(data) - case TypeSession: - return UnmarshalSession(data) + case TypeChatEventHasAggressiveAntiSpamEnabledToggled: + return UnmarshalChatEventHasAggressiveAntiSpamEnabledToggled(data) - case TypeSessions: - return UnmarshalSessions(data) + case TypeChatEventSignMessagesToggled: + return UnmarshalChatEventSignMessagesToggled(data) - case TypeConnectedWebsite: - return UnmarshalConnectedWebsite(data) + case TypeChatEventInviteLinkEdited: + return UnmarshalChatEventInviteLinkEdited(data) - case TypeConnectedWebsites: - return UnmarshalConnectedWebsites(data) + case TypeChatEventInviteLinkRevoked: + return UnmarshalChatEventInviteLinkRevoked(data) - case TypeChatReportReasonSpam: - return UnmarshalChatReportReasonSpam(data) + case TypeChatEventInviteLinkDeleted: + return UnmarshalChatEventInviteLinkDeleted(data) - case TypeChatReportReasonViolence: - return UnmarshalChatReportReasonViolence(data) + case TypeChatEventVideoChatCreated: + return UnmarshalChatEventVideoChatCreated(data) - case TypeChatReportReasonPornography: - return UnmarshalChatReportReasonPornography(data) + case TypeChatEventVideoChatEnded: + return UnmarshalChatEventVideoChatEnded(data) - case TypeChatReportReasonChildAbuse: - return UnmarshalChatReportReasonChildAbuse(data) + case TypeChatEventVideoChatMuteNewParticipantsToggled: + return UnmarshalChatEventVideoChatMuteNewParticipantsToggled(data) - case TypeChatReportReasonCopyright: - return UnmarshalChatReportReasonCopyright(data) + case TypeChatEventVideoChatParticipantIsMutedToggled: + return UnmarshalChatEventVideoChatParticipantIsMutedToggled(data) - case TypeChatReportReasonUnrelatedLocation: - return UnmarshalChatReportReasonUnrelatedLocation(data) + case TypeChatEventVideoChatParticipantVolumeLevelChanged: + return UnmarshalChatEventVideoChatParticipantVolumeLevelChanged(data) - case TypeChatReportReasonFake: - return UnmarshalChatReportReasonFake(data) + case TypeChatEventIsForumToggled: + return UnmarshalChatEventIsForumToggled(data) - case TypeChatReportReasonIllegalDrugs: - return UnmarshalChatReportReasonIllegalDrugs(data) + case TypeChatEventForumTopicCreated: + return UnmarshalChatEventForumTopicCreated(data) - case TypeChatReportReasonPersonalDetails: - return UnmarshalChatReportReasonPersonalDetails(data) + case TypeChatEventForumTopicEdited: + return UnmarshalChatEventForumTopicEdited(data) - case TypeChatReportReasonCustom: - return UnmarshalChatReportReasonCustom(data) + case TypeChatEventForumTopicToggleIsClosed: + return UnmarshalChatEventForumTopicToggleIsClosed(data) - case TypeTargetChatCurrent: - return UnmarshalTargetChatCurrent(data) + case TypeChatEventForumTopicToggleIsHidden: + return UnmarshalChatEventForumTopicToggleIsHidden(data) - case TypeTargetChatChosen: - return UnmarshalTargetChatChosen(data) + case TypeChatEventForumTopicDeleted: + return UnmarshalChatEventForumTopicDeleted(data) - case TypeTargetChatInternalLink: - return UnmarshalTargetChatInternalLink(data) + case TypeChatEventForumTopicPinned: + return UnmarshalChatEventForumTopicPinned(data) - case TypeInternalLinkTypeActiveSessions: - return UnmarshalInternalLinkTypeActiveSessions(data) + case TypeChatEvent: + return UnmarshalChatEvent(data) - case TypeInternalLinkTypeAttachmentMenuBot: - return UnmarshalInternalLinkTypeAttachmentMenuBot(data) + case TypeChatEvents: + return UnmarshalChatEvents(data) - case TypeInternalLinkTypeAuthenticationCode: - return UnmarshalInternalLinkTypeAuthenticationCode(data) + case TypeChatEventLogFilters: + return UnmarshalChatEventLogFilters(data) - case TypeInternalLinkTypeBackground: - return UnmarshalInternalLinkTypeBackground(data) + case TypeLanguagePackStringValueOrdinary: + return UnmarshalLanguagePackStringValueOrdinary(data) - case TypeInternalLinkTypeBotStart: - return UnmarshalInternalLinkTypeBotStart(data) + case TypeLanguagePackStringValuePluralized: + return UnmarshalLanguagePackStringValuePluralized(data) - case TypeInternalLinkTypeBotStartInGroup: - return UnmarshalInternalLinkTypeBotStartInGroup(data) + case TypeLanguagePackStringValueDeleted: + return UnmarshalLanguagePackStringValueDeleted(data) - case TypeInternalLinkTypeBotAddToChannel: - return UnmarshalInternalLinkTypeBotAddToChannel(data) + case TypeLanguagePackString: + return UnmarshalLanguagePackString(data) - case TypeInternalLinkTypeChangePhoneNumber: - return UnmarshalInternalLinkTypeChangePhoneNumber(data) + case TypeLanguagePackStrings: + return UnmarshalLanguagePackStrings(data) - case TypeInternalLinkTypeChatInvite: - return UnmarshalInternalLinkTypeChatInvite(data) + case TypeLanguagePackInfo: + return UnmarshalLanguagePackInfo(data) - case TypeInternalLinkTypeDefaultMessageAutoDeleteTimerSettings: - return UnmarshalInternalLinkTypeDefaultMessageAutoDeleteTimerSettings(data) + case TypeLocalizationTargetInfo: + return UnmarshalLocalizationTargetInfo(data) - case TypeInternalLinkTypeEditProfileSettings: - return UnmarshalInternalLinkTypeEditProfileSettings(data) + case TypePremiumLimitTypeSupergroupCount: + return UnmarshalPremiumLimitTypeSupergroupCount(data) - case TypeInternalLinkTypeFilterSettings: - return UnmarshalInternalLinkTypeFilterSettings(data) + case TypePremiumLimitTypePinnedChatCount: + return UnmarshalPremiumLimitTypePinnedChatCount(data) - case TypeInternalLinkTypeGame: - return UnmarshalInternalLinkTypeGame(data) + case TypePremiumLimitTypeCreatedPublicChatCount: + return UnmarshalPremiumLimitTypeCreatedPublicChatCount(data) - case TypeInternalLinkTypeInstantView: - return UnmarshalInternalLinkTypeInstantView(data) + case TypePremiumLimitTypeSavedAnimationCount: + return UnmarshalPremiumLimitTypeSavedAnimationCount(data) - case TypeInternalLinkTypeInvoice: - return UnmarshalInternalLinkTypeInvoice(data) + case TypePremiumLimitTypeFavoriteStickerCount: + return UnmarshalPremiumLimitTypeFavoriteStickerCount(data) - case TypeInternalLinkTypeLanguagePack: - return UnmarshalInternalLinkTypeLanguagePack(data) + case TypePremiumLimitTypeChatFolderCount: + return UnmarshalPremiumLimitTypeChatFolderCount(data) - case TypeInternalLinkTypeLanguageSettings: - return UnmarshalInternalLinkTypeLanguageSettings(data) + case TypePremiumLimitTypeChatFolderChosenChatCount: + return UnmarshalPremiumLimitTypeChatFolderChosenChatCount(data) - case TypeInternalLinkTypeMessage: - return UnmarshalInternalLinkTypeMessage(data) + case TypePremiumLimitTypePinnedArchivedChatCount: + return UnmarshalPremiumLimitTypePinnedArchivedChatCount(data) - case TypeInternalLinkTypeMessageDraft: - return UnmarshalInternalLinkTypeMessageDraft(data) + case TypePremiumLimitTypePinnedSavedMessagesTopicCount: + return UnmarshalPremiumLimitTypePinnedSavedMessagesTopicCount(data) - case TypeInternalLinkTypePassportDataRequest: - return UnmarshalInternalLinkTypePassportDataRequest(data) + case TypePremiumLimitTypeCaptionLength: + return UnmarshalPremiumLimitTypeCaptionLength(data) - case TypeInternalLinkTypePhoneNumberConfirmation: - return UnmarshalInternalLinkTypePhoneNumberConfirmation(data) + case TypePremiumLimitTypeBioLength: + return UnmarshalPremiumLimitTypeBioLength(data) - case TypeInternalLinkTypePremiumFeatures: - return UnmarshalInternalLinkTypePremiumFeatures(data) + case TypePremiumLimitTypeChatFolderInviteLinkCount: + return UnmarshalPremiumLimitTypeChatFolderInviteLinkCount(data) - case TypeInternalLinkTypePrivacyAndSecuritySettings: - return UnmarshalInternalLinkTypePrivacyAndSecuritySettings(data) + case TypePremiumLimitTypeShareableChatFolderCount: + return UnmarshalPremiumLimitTypeShareableChatFolderCount(data) - case TypeInternalLinkTypeProxy: - return UnmarshalInternalLinkTypeProxy(data) + case TypePremiumLimitTypeActiveStoryCount: + return UnmarshalPremiumLimitTypeActiveStoryCount(data) - case TypeInternalLinkTypePublicChat: - return UnmarshalInternalLinkTypePublicChat(data) + case TypePremiumLimitTypeWeeklySentStoryCount: + return UnmarshalPremiumLimitTypeWeeklySentStoryCount(data) - case TypeInternalLinkTypeQrCodeAuthentication: - return UnmarshalInternalLinkTypeQrCodeAuthentication(data) + case TypePremiumLimitTypeMonthlySentStoryCount: + return UnmarshalPremiumLimitTypeMonthlySentStoryCount(data) - case TypeInternalLinkTypeRestorePurchases: - return UnmarshalInternalLinkTypeRestorePurchases(data) + case TypePremiumLimitTypeStoryCaptionLength: + return UnmarshalPremiumLimitTypeStoryCaptionLength(data) - case TypeInternalLinkTypeSettings: - return UnmarshalInternalLinkTypeSettings(data) + case TypePremiumLimitTypeStorySuggestedReactionAreaCount: + return UnmarshalPremiumLimitTypeStorySuggestedReactionAreaCount(data) - case TypeInternalLinkTypeStickerSet: - return UnmarshalInternalLinkTypeStickerSet(data) + case TypePremiumLimitTypeSimilarChatCount: + return UnmarshalPremiumLimitTypeSimilarChatCount(data) - case TypeInternalLinkTypeTheme: - return UnmarshalInternalLinkTypeTheme(data) + case TypePremiumFeatureIncreasedLimits: + return UnmarshalPremiumFeatureIncreasedLimits(data) - case TypeInternalLinkTypeThemeSettings: - return UnmarshalInternalLinkTypeThemeSettings(data) + case TypePremiumFeatureIncreasedUploadFileSize: + return UnmarshalPremiumFeatureIncreasedUploadFileSize(data) - case TypeInternalLinkTypeUnknownDeepLink: - return UnmarshalInternalLinkTypeUnknownDeepLink(data) + case TypePremiumFeatureImprovedDownloadSpeed: + return UnmarshalPremiumFeatureImprovedDownloadSpeed(data) - case TypeInternalLinkTypeUnsupportedProxy: - return UnmarshalInternalLinkTypeUnsupportedProxy(data) + case TypePremiumFeatureVoiceRecognition: + return UnmarshalPremiumFeatureVoiceRecognition(data) - case TypeInternalLinkTypeUserPhoneNumber: - return UnmarshalInternalLinkTypeUserPhoneNumber(data) + case TypePremiumFeatureDisabledAds: + return UnmarshalPremiumFeatureDisabledAds(data) - case TypeInternalLinkTypeUserToken: - return UnmarshalInternalLinkTypeUserToken(data) + case TypePremiumFeatureUniqueReactions: + return UnmarshalPremiumFeatureUniqueReactions(data) - case TypeInternalLinkTypeVideoChat: - return UnmarshalInternalLinkTypeVideoChat(data) + case TypePremiumFeatureUniqueStickers: + return UnmarshalPremiumFeatureUniqueStickers(data) - case TypeMessageLink: - return UnmarshalMessageLink(data) + case TypePremiumFeatureCustomEmoji: + return UnmarshalPremiumFeatureCustomEmoji(data) - case TypeMessageLinkInfo: - return UnmarshalMessageLinkInfo(data) + case TypePremiumFeatureAdvancedChatManagement: + return UnmarshalPremiumFeatureAdvancedChatManagement(data) - case TypeFilePart: - return UnmarshalFilePart(data) + case TypePremiumFeatureProfileBadge: + return UnmarshalPremiumFeatureProfileBadge(data) - case TypeFileTypeNone: - return UnmarshalFileTypeNone(data) + case TypePremiumFeatureEmojiStatus: + return UnmarshalPremiumFeatureEmojiStatus(data) - case TypeFileTypeAnimation: - return UnmarshalFileTypeAnimation(data) + case TypePremiumFeatureAnimatedProfilePhoto: + return UnmarshalPremiumFeatureAnimatedProfilePhoto(data) - case TypeFileTypeAudio: - return UnmarshalFileTypeAudio(data) + case TypePremiumFeatureForumTopicIcon: + return UnmarshalPremiumFeatureForumTopicIcon(data) - case TypeFileTypeDocument: - return UnmarshalFileTypeDocument(data) + case TypePremiumFeatureAppIcons: + return UnmarshalPremiumFeatureAppIcons(data) - case TypeFileTypeNotificationSound: - return UnmarshalFileTypeNotificationSound(data) + case TypePremiumFeatureRealTimeChatTranslation: + return UnmarshalPremiumFeatureRealTimeChatTranslation(data) - case TypeFileTypePhoto: - return UnmarshalFileTypePhoto(data) + case TypePremiumFeatureUpgradedStories: + return UnmarshalPremiumFeatureUpgradedStories(data) - case TypeFileTypeProfilePhoto: - return UnmarshalFileTypeProfilePhoto(data) + case TypePremiumFeatureChatBoost: + return UnmarshalPremiumFeatureChatBoost(data) - case TypeFileTypeSecret: - return UnmarshalFileTypeSecret(data) + case TypePremiumFeatureAccentColor: + return UnmarshalPremiumFeatureAccentColor(data) - case TypeFileTypeSecretThumbnail: - return UnmarshalFileTypeSecretThumbnail(data) + case TypePremiumFeatureBackgroundForBoth: + return UnmarshalPremiumFeatureBackgroundForBoth(data) - case TypeFileTypeSecure: - return UnmarshalFileTypeSecure(data) + case TypePremiumFeatureSavedMessagesTags: + return UnmarshalPremiumFeatureSavedMessagesTags(data) - case TypeFileTypeSticker: - return UnmarshalFileTypeSticker(data) + case TypePremiumFeatureMessagePrivacy: + return UnmarshalPremiumFeatureMessagePrivacy(data) - case TypeFileTypeThumbnail: - return UnmarshalFileTypeThumbnail(data) + case TypePremiumFeatureLastSeenTimes: + return UnmarshalPremiumFeatureLastSeenTimes(data) - case TypeFileTypeUnknown: - return UnmarshalFileTypeUnknown(data) + case TypePremiumFeatureBusiness: + return UnmarshalPremiumFeatureBusiness(data) - case TypeFileTypeVideo: - return UnmarshalFileTypeVideo(data) + case TypeBusinessFeatureLocation: + return UnmarshalBusinessFeatureLocation(data) - case TypeFileTypeVideoNote: - return UnmarshalFileTypeVideoNote(data) + case TypeBusinessFeatureOpeningHours: + return UnmarshalBusinessFeatureOpeningHours(data) - case TypeFileTypeVoiceNote: - return UnmarshalFileTypeVoiceNote(data) + case TypeBusinessFeatureQuickReplies: + return UnmarshalBusinessFeatureQuickReplies(data) - case TypeFileTypeWallpaper: - return UnmarshalFileTypeWallpaper(data) + case TypeBusinessFeatureGreetingMessage: + return UnmarshalBusinessFeatureGreetingMessage(data) - case TypeStorageStatisticsByFileType: - return UnmarshalStorageStatisticsByFileType(data) + case TypeBusinessFeatureAwayMessage: + return UnmarshalBusinessFeatureAwayMessage(data) - case TypeStorageStatisticsByChat: - return UnmarshalStorageStatisticsByChat(data) + case TypeBusinessFeatureAccountLinks: + return UnmarshalBusinessFeatureAccountLinks(data) - case TypeStorageStatistics: - return UnmarshalStorageStatistics(data) + case TypeBusinessFeatureIntro: + return UnmarshalBusinessFeatureIntro(data) - case TypeStorageStatisticsFast: - return UnmarshalStorageStatisticsFast(data) + case TypeBusinessFeatureBots: + return UnmarshalBusinessFeatureBots(data) - case TypeDatabaseStatistics: - return UnmarshalDatabaseStatistics(data) + case TypeBusinessFeatureEmojiStatus: + return UnmarshalBusinessFeatureEmojiStatus(data) - case TypeNetworkTypeNone: - return UnmarshalNetworkTypeNone(data) + case TypeBusinessFeatureChatFolderTags: + return UnmarshalBusinessFeatureChatFolderTags(data) - case TypeNetworkTypeMobile: - return UnmarshalNetworkTypeMobile(data) + case TypeBusinessFeatureUpgradedStories: + return UnmarshalBusinessFeatureUpgradedStories(data) - case TypeNetworkTypeMobileRoaming: - return UnmarshalNetworkTypeMobileRoaming(data) + case TypePremiumStoryFeaturePriorityOrder: + return UnmarshalPremiumStoryFeaturePriorityOrder(data) - case TypeNetworkTypeWiFi: - return UnmarshalNetworkTypeWiFi(data) + case TypePremiumStoryFeatureStealthMode: + return UnmarshalPremiumStoryFeatureStealthMode(data) - case TypeNetworkTypeOther: - return UnmarshalNetworkTypeOther(data) + case TypePremiumStoryFeaturePermanentViewsHistory: + return UnmarshalPremiumStoryFeaturePermanentViewsHistory(data) - case TypeNetworkStatisticsEntryFile: - return UnmarshalNetworkStatisticsEntryFile(data) + case TypePremiumStoryFeatureCustomExpirationDuration: + return UnmarshalPremiumStoryFeatureCustomExpirationDuration(data) - case TypeNetworkStatisticsEntryCall: - return UnmarshalNetworkStatisticsEntryCall(data) + case TypePremiumStoryFeatureSaveStories: + return UnmarshalPremiumStoryFeatureSaveStories(data) - case TypeNetworkStatistics: - return UnmarshalNetworkStatistics(data) + case TypePremiumStoryFeatureLinksAndFormatting: + return UnmarshalPremiumStoryFeatureLinksAndFormatting(data) - case TypeAutoDownloadSettings: - return UnmarshalAutoDownloadSettings(data) + case TypePremiumStoryFeatureVideoQuality: + return UnmarshalPremiumStoryFeatureVideoQuality(data) - case TypeAutoDownloadSettingsPresets: - return UnmarshalAutoDownloadSettingsPresets(data) + case TypePremiumLimit: + return UnmarshalPremiumLimit(data) - case TypeConnectionStateWaitingForNetwork: - return UnmarshalConnectionStateWaitingForNetwork(data) + case TypePremiumFeatures: + return UnmarshalPremiumFeatures(data) - case TypeConnectionStateConnectingToProxy: - return UnmarshalConnectionStateConnectingToProxy(data) + case TypeBusinessFeatures: + return UnmarshalBusinessFeatures(data) - case TypeConnectionStateConnecting: - return UnmarshalConnectionStateConnecting(data) + case TypePremiumSourceLimitExceeded: + return UnmarshalPremiumSourceLimitExceeded(data) - case TypeConnectionStateUpdating: - return UnmarshalConnectionStateUpdating(data) + case TypePremiumSourceFeature: + return UnmarshalPremiumSourceFeature(data) - case TypeConnectionStateReady: - return UnmarshalConnectionStateReady(data) + case TypePremiumSourceBusinessFeature: + return UnmarshalPremiumSourceBusinessFeature(data) - case TypeTopChatCategoryUsers: - return UnmarshalTopChatCategoryUsers(data) + case TypePremiumSourceStoryFeature: + return UnmarshalPremiumSourceStoryFeature(data) - case TypeTopChatCategoryBots: - return UnmarshalTopChatCategoryBots(data) + case TypePremiumSourceLink: + return UnmarshalPremiumSourceLink(data) - case TypeTopChatCategoryGroups: - return UnmarshalTopChatCategoryGroups(data) + case TypePremiumSourceSettings: + return UnmarshalPremiumSourceSettings(data) - case TypeTopChatCategoryChannels: - return UnmarshalTopChatCategoryChannels(data) + case TypePremiumFeaturePromotionAnimation: + return UnmarshalPremiumFeaturePromotionAnimation(data) - case TypeTopChatCategoryInlineBots: - return UnmarshalTopChatCategoryInlineBots(data) + case TypeBusinessFeaturePromotionAnimation: + return UnmarshalBusinessFeaturePromotionAnimation(data) - case TypeTopChatCategoryCalls: - return UnmarshalTopChatCategoryCalls(data) + case TypePremiumState: + return UnmarshalPremiumState(data) - case TypeTopChatCategoryForwardChats: - return UnmarshalTopChatCategoryForwardChats(data) + case TypeStorePaymentPurposePremiumSubscription: + return UnmarshalStorePaymentPurposePremiumSubscription(data) - case TypeTMeUrlTypeUser: - return UnmarshalTMeUrlTypeUser(data) + case TypeStorePaymentPurposeGiftedPremium: + return UnmarshalStorePaymentPurposeGiftedPremium(data) - case TypeTMeUrlTypeSupergroup: - return UnmarshalTMeUrlTypeSupergroup(data) + case TypeStorePaymentPurposePremiumGiftCodes: + return UnmarshalStorePaymentPurposePremiumGiftCodes(data) - case TypeTMeUrlTypeChatInvite: - return UnmarshalTMeUrlTypeChatInvite(data) + case TypeStorePaymentPurposePremiumGiveaway: + return UnmarshalStorePaymentPurposePremiumGiveaway(data) - case TypeTMeUrlTypeStickerSet: - return UnmarshalTMeUrlTypeStickerSet(data) + case TypeTelegramPaymentPurposePremiumGiftCodes: + return UnmarshalTelegramPaymentPurposePremiumGiftCodes(data) - case TypeTMeUrl: - return UnmarshalTMeUrl(data) + case TypeTelegramPaymentPurposePremiumGiveaway: + return UnmarshalTelegramPaymentPurposePremiumGiveaway(data) - case TypeTMeUrls: - return UnmarshalTMeUrls(data) + case Type//-To: + return Unmarshal//-To(data) - case TypeSuggestedActionEnableArchiveAndMuteNewChats: - return UnmarshalSuggestedActionEnableArchiveAndMuteNewChats(data) + case TypeDeviceTokenFirebaseCloudMessaging: + return UnmarshalDeviceTokenFirebaseCloudMessaging(data) - case TypeSuggestedActionCheckPassword: - return UnmarshalSuggestedActionCheckPassword(data) + case TypeDeviceTokenApplePush: + return UnmarshalDeviceTokenApplePush(data) - case TypeSuggestedActionCheckPhoneNumber: - return UnmarshalSuggestedActionCheckPhoneNumber(data) + case TypeDeviceTokenApplePushVoIP: + return UnmarshalDeviceTokenApplePushVoIP(data) - case TypeSuggestedActionViewChecksHint: - return UnmarshalSuggestedActionViewChecksHint(data) + case TypeDeviceTokenWindowsPush: + return UnmarshalDeviceTokenWindowsPush(data) - case TypeSuggestedActionConvertToBroadcastGroup: - return UnmarshalSuggestedActionConvertToBroadcastGroup(data) + case TypeDeviceTokenMicrosoftPush: + return UnmarshalDeviceTokenMicrosoftPush(data) - case TypeSuggestedActionSetPassword: - return UnmarshalSuggestedActionSetPassword(data) + case TypeDeviceTokenMicrosoftPushVoIP: + return UnmarshalDeviceTokenMicrosoftPushVoIP(data) - case TypeCount: - return UnmarshalCount(data) + case TypeDeviceTokenWebPush: + return UnmarshalDeviceTokenWebPush(data) - case TypeText: - return UnmarshalText(data) + case TypeDeviceTokenSimplePush: + return UnmarshalDeviceTokenSimplePush(data) - case TypeSeconds: - return UnmarshalSeconds(data) + case TypeDeviceTokenUbuntuPush: + return UnmarshalDeviceTokenUbuntuPush(data) - case TypeFileDownloadedPrefixSize: - return UnmarshalFileDownloadedPrefixSize(data) + case TypeDeviceTokenBlackBerryPush: + return UnmarshalDeviceTokenBlackBerryPush(data) - case TypeDeepLinkInfo: - return UnmarshalDeepLinkInfo(data) + case TypeDeviceTokenTizenPush: + return UnmarshalDeviceTokenTizenPush(data) - case TypeTextParseModeMarkdown: - return UnmarshalTextParseModeMarkdown(data) + case TypeDeviceTokenHuaweiPush: + return UnmarshalDeviceTokenHuaweiPush(data) - case TypeTextParseModeHTML: - return UnmarshalTextParseModeHTML(data) + case TypePushReceiverId: + return UnmarshalPushReceiverId(data) - case TypeProxyTypeSocks5: - return UnmarshalProxyTypeSocks5(data) + case TypeBackgroundFillSolid: + return UnmarshalBackgroundFillSolid(data) - case TypeProxyTypeHttp: - return UnmarshalProxyTypeHttp(data) + case TypeBackgroundFillGradient: + return UnmarshalBackgroundFillGradient(data) - case TypeProxyTypeMtproto: - return UnmarshalProxyTypeMtproto(data) + case TypeBackgroundFillFreeformGradient: + return UnmarshalBackgroundFillFreeformGradient(data) - case TypeProxy: - return UnmarshalProxy(data) + case TypeBackgroundTypeWallpaper: + return UnmarshalBackgroundTypeWallpaper(data) - case TypeProxies: - return UnmarshalProxies(data) + case TypeBackgroundTypePattern: + return UnmarshalBackgroundTypePattern(data) - case TypeInputSticker: - return UnmarshalInputSticker(data) + case TypeBackgroundTypeFill: + return UnmarshalBackgroundTypeFill(data) - case TypeDateRange: - return UnmarshalDateRange(data) + case TypeBackgroundTypeChatTheme: + return UnmarshalBackgroundTypeChatTheme(data) - case TypeStatisticalValue: - return UnmarshalStatisticalValue(data) + case TypeInputBackgroundLocal: + return UnmarshalInputBackgroundLocal(data) - case TypeStatisticalGraphData: - return UnmarshalStatisticalGraphData(data) + case TypeInputBackgroundRemote: + return UnmarshalInputBackgroundRemote(data) - case TypeStatisticalGraphAsync: - return UnmarshalStatisticalGraphAsync(data) + case TypeInputBackgroundPrevious: + return UnmarshalInputBackgroundPrevious(data) - case TypeStatisticalGraphError: - return UnmarshalStatisticalGraphError(data) + case TypeThemeSettings: + return UnmarshalThemeSettings(data) - case TypeChatStatisticsMessageInteractionInfo: - return UnmarshalChatStatisticsMessageInteractionInfo(data) + case TypeChatTheme: + return UnmarshalChatTheme(data) - case TypeChatStatisticsMessageSenderInfo: - return UnmarshalChatStatisticsMessageSenderInfo(data) + case TypeTimeZone: + return UnmarshalTimeZone(data) - case TypeChatStatisticsAdministratorActionsInfo: - return UnmarshalChatStatisticsAdministratorActionsInfo(data) + case TypeTimeZones: + return UnmarshalTimeZones(data) - case TypeChatStatisticsInviterInfo: - return UnmarshalChatStatisticsInviterInfo(data) + case TypeHashtags: + return UnmarshalHashtags(data) - case TypeChatStatisticsSupergroup: - return UnmarshalChatStatisticsSupergroup(data) + case TypeCanSendStoryResultOk: + return UnmarshalCanSendStoryResultOk(data) - case TypeChatStatisticsChannel: - return UnmarshalChatStatisticsChannel(data) + case TypeCanSendStoryResultPremiumNeeded: + return UnmarshalCanSendStoryResultPremiumNeeded(data) - case TypeMessageStatistics: - return UnmarshalMessageStatistics(data) + case TypeCanSendStoryResultBoostNeeded: + return UnmarshalCanSendStoryResultBoostNeeded(data) - case TypePoint: - return UnmarshalPoint(data) + case TypeCanSendStoryResultActiveStoryLimitExceeded: + return UnmarshalCanSendStoryResultActiveStoryLimitExceeded(data) - case TypeVectorPathCommandLine: - return UnmarshalVectorPathCommandLine(data) + case TypeCanSendStoryResultWeeklyLimitExceeded: + return UnmarshalCanSendStoryResultWeeklyLimitExceeded(data) - case TypeVectorPathCommandCubicBezierCurve: - return UnmarshalVectorPathCommandCubicBezierCurve(data) + case TypeCanSendStoryResultMonthlyLimitExceeded: + return UnmarshalCanSendStoryResultMonthlyLimitExceeded(data) - case TypeBotCommandScopeDefault: - return UnmarshalBotCommandScopeDefault(data) + case TypeCanTransferOwnershipResultOk: + return UnmarshalCanTransferOwnershipResultOk(data) - case TypeBotCommandScopeAllPrivateChats: - return UnmarshalBotCommandScopeAllPrivateChats(data) + case TypeCanTransferOwnershipResultPasswordNeeded: + return UnmarshalCanTransferOwnershipResultPasswordNeeded(data) - case TypeBotCommandScopeAllGroupChats: - return UnmarshalBotCommandScopeAllGroupChats(data) + case TypeCanTransferOwnershipResultPasswordTooFresh: + return UnmarshalCanTransferOwnershipResultPasswordTooFresh(data) - case TypeBotCommandScopeAllChatAdministrators: - return UnmarshalBotCommandScopeAllChatAdministrators(data) + case TypeCanTransferOwnershipResultSessionTooFresh: + return UnmarshalCanTransferOwnershipResultSessionTooFresh(data) - case TypeBotCommandScopeChat: - return UnmarshalBotCommandScopeChat(data) + case TypeCheckChatUsernameResultOk: + return UnmarshalCheckChatUsernameResultOk(data) - case TypeBotCommandScopeChatAdministrators: - return UnmarshalBotCommandScopeChatAdministrators(data) + case TypeCheckChatUsernameResultUsernameInvalid: + return UnmarshalCheckChatUsernameResultUsernameInvalid(data) - case TypeBotCommandScopeChatMember: - return UnmarshalBotCommandScopeChatMember(data) + case TypeCheckChatUsernameResultUsernameOccupied: + return UnmarshalCheckChatUsernameResultUsernameOccupied(data) - case TypeUpdateAuthorizationState: - return UnmarshalUpdateAuthorizationState(data) + case TypeCheckChatUsernameResultUsernamePurchasable: + return UnmarshalCheckChatUsernameResultUsernamePurchasable(data) - case TypeUpdateNewMessage: - return UnmarshalUpdateNewMessage(data) + case TypeCheckChatUsernameResultPublicChatsTooMany: + return UnmarshalCheckChatUsernameResultPublicChatsTooMany(data) - case TypeUpdateMessageSendAcknowledged: - return UnmarshalUpdateMessageSendAcknowledged(data) + case TypeCheckChatUsernameResultPublicGroupsUnavailable: + return UnmarshalCheckChatUsernameResultPublicGroupsUnavailable(data) - case TypeUpdateMessageSendSucceeded: - return UnmarshalUpdateMessageSendSucceeded(data) + case TypeCheckStickerSetNameResultOk: + return UnmarshalCheckStickerSetNameResultOk(data) - case TypeUpdateMessageSendFailed: - return UnmarshalUpdateMessageSendFailed(data) + case TypeCheckStickerSetNameResultNameInvalid: + return UnmarshalCheckStickerSetNameResultNameInvalid(data) - case TypeUpdateMessageContent: - return UnmarshalUpdateMessageContent(data) + case TypeCheckStickerSetNameResultNameOccupied: + return UnmarshalCheckStickerSetNameResultNameOccupied(data) - case TypeUpdateMessageEdited: - return UnmarshalUpdateMessageEdited(data) + case TypeResetPasswordResultOk: + return UnmarshalResetPasswordResultOk(data) - case TypeUpdateMessageIsPinned: - return UnmarshalUpdateMessageIsPinned(data) + case TypeResetPasswordResultPending: + return UnmarshalResetPasswordResultPending(data) - case TypeUpdateMessageInteractionInfo: - return UnmarshalUpdateMessageInteractionInfo(data) + case TypeResetPasswordResultDeclined: + return UnmarshalResetPasswordResultDeclined(data) - case TypeUpdateMessageContentOpened: - return UnmarshalUpdateMessageContentOpened(data) + case TypeMessageFileTypePrivate: + return UnmarshalMessageFileTypePrivate(data) - case TypeUpdateMessageMentionRead: - return UnmarshalUpdateMessageMentionRead(data) + case TypeMessageFileTypeGroup: + return UnmarshalMessageFileTypeGroup(data) - case TypeUpdateMessageUnreadReactions: - return UnmarshalUpdateMessageUnreadReactions(data) + case TypeMessageFileTypeUnknown: + return UnmarshalMessageFileTypeUnknown(data) - case TypeUpdateMessageLiveLocationViewed: - return UnmarshalUpdateMessageLiveLocationViewed(data) + case TypePushMessageContentHidden: + return UnmarshalPushMessageContentHidden(data) - case TypeUpdateNewChat: - return UnmarshalUpdateNewChat(data) + case TypePushMessageContentAnimation: + return UnmarshalPushMessageContentAnimation(data) - case TypeUpdateChatTitle: - return UnmarshalUpdateChatTitle(data) + case TypePushMessageContentAudio: + return UnmarshalPushMessageContentAudio(data) - case TypeUpdateChatPhoto: - return UnmarshalUpdateChatPhoto(data) + case TypePushMessageContentContact: + return UnmarshalPushMessageContentContact(data) - case TypeUpdateChatPermissions: - return UnmarshalUpdateChatPermissions(data) + case TypePushMessageContentContactRegistered: + return UnmarshalPushMessageContentContactRegistered(data) - case TypeUpdateChatLastMessage: - return UnmarshalUpdateChatLastMessage(data) + case TypePushMessageContentDocument: + return UnmarshalPushMessageContentDocument(data) - case TypeUpdateChatPosition: - return UnmarshalUpdateChatPosition(data) + case TypePushMessageContentGame: + return UnmarshalPushMessageContentGame(data) - case TypeUpdateChatReadInbox: - return UnmarshalUpdateChatReadInbox(data) + case TypePushMessageContentGameScore: + return UnmarshalPushMessageContentGameScore(data) - case TypeUpdateChatReadOutbox: - return UnmarshalUpdateChatReadOutbox(data) + case TypePushMessageContentInvoice: + return UnmarshalPushMessageContentInvoice(data) - case TypeUpdateChatActionBar: - return UnmarshalUpdateChatActionBar(data) + case TypePushMessageContentLocation: + return UnmarshalPushMessageContentLocation(data) - case TypeUpdateChatAvailableReactions: - return UnmarshalUpdateChatAvailableReactions(data) + case TypePushMessageContentPhoto: + return UnmarshalPushMessageContentPhoto(data) - case TypeUpdateChatDraftMessage: - return UnmarshalUpdateChatDraftMessage(data) + case TypePushMessageContentPoll: + return UnmarshalPushMessageContentPoll(data) - case TypeUpdateChatMessageSender: - return UnmarshalUpdateChatMessageSender(data) + case TypePushMessageContentPremiumGiftCode: + return UnmarshalPushMessageContentPremiumGiftCode(data) - case TypeUpdateChatMessageAutoDeleteTime: - return UnmarshalUpdateChatMessageAutoDeleteTime(data) + case TypePushMessageContentPremiumGiveaway: + return UnmarshalPushMessageContentPremiumGiveaway(data) - case TypeUpdateChatNotificationSettings: - return UnmarshalUpdateChatNotificationSettings(data) + case TypePushMessageContentScreenshotTaken: + return UnmarshalPushMessageContentScreenshotTaken(data) - case TypeUpdateChatPendingJoinRequests: - return UnmarshalUpdateChatPendingJoinRequests(data) + case TypePushMessageContentSticker: + return UnmarshalPushMessageContentSticker(data) - case TypeUpdateChatReplyMarkup: - return UnmarshalUpdateChatReplyMarkup(data) + case TypePushMessageContentStory: + return UnmarshalPushMessageContentStory(data) - case TypeUpdateChatTheme: - return UnmarshalUpdateChatTheme(data) + case TypePushMessageContentText: + return UnmarshalPushMessageContentText(data) - case TypeUpdateChatUnreadMentionCount: - return UnmarshalUpdateChatUnreadMentionCount(data) + case TypePushMessageContentVideo: + return UnmarshalPushMessageContentVideo(data) - case TypeUpdateChatUnreadReactionCount: - return UnmarshalUpdateChatUnreadReactionCount(data) + case TypePushMessageContentVideoNote: + return UnmarshalPushMessageContentVideoNote(data) - case TypeUpdateChatVideoChat: - return UnmarshalUpdateChatVideoChat(data) + case TypePushMessageContentVoiceNote: + return UnmarshalPushMessageContentVoiceNote(data) - case TypeUpdateChatDefaultDisableNotification: - return UnmarshalUpdateChatDefaultDisableNotification(data) + case TypePushMessageContentBasicGroupChatCreate: + return UnmarshalPushMessageContentBasicGroupChatCreate(data) - case TypeUpdateChatHasProtectedContent: - return UnmarshalUpdateChatHasProtectedContent(data) + case TypePushMessageContentChatAddMembers: + return UnmarshalPushMessageContentChatAddMembers(data) - case TypeUpdateChatHasScheduledMessages: - return UnmarshalUpdateChatHasScheduledMessages(data) + case TypePushMessageContentChatChangePhoto: + return UnmarshalPushMessageContentChatChangePhoto(data) - case TypeUpdateChatIsBlocked: - return UnmarshalUpdateChatIsBlocked(data) + case TypePushMessageContentChatChangeTitle: + return UnmarshalPushMessageContentChatChangeTitle(data) - case TypeUpdateChatIsMarkedAsUnread: - return UnmarshalUpdateChatIsMarkedAsUnread(data) + case TypePushMessageContentChatSetBackground: + return UnmarshalPushMessageContentChatSetBackground(data) - case TypeUpdateChatFilters: - return UnmarshalUpdateChatFilters(data) + case TypePushMessageContentChatSetTheme: + return UnmarshalPushMessageContentChatSetTheme(data) - case TypeUpdateChatOnlineMemberCount: - return UnmarshalUpdateChatOnlineMemberCount(data) + case TypePushMessageContentChatDeleteMember: + return UnmarshalPushMessageContentChatDeleteMember(data) - case TypeUpdateForumTopicInfo: - return UnmarshalUpdateForumTopicInfo(data) + case TypePushMessageContentChatJoinByLink: + return UnmarshalPushMessageContentChatJoinByLink(data) - case TypeUpdateScopeNotificationSettings: - return UnmarshalUpdateScopeNotificationSettings(data) + case TypePushMessageContentChatJoinByRequest: + return UnmarshalPushMessageContentChatJoinByRequest(data) - case TypeUpdateNotification: - return UnmarshalUpdateNotification(data) + case TypePushMessageContentRecurringPayment: + return UnmarshalPushMessageContentRecurringPayment(data) - case TypeUpdateNotificationGroup: - return UnmarshalUpdateNotificationGroup(data) + case TypePushMessageContentSuggestProfilePhoto: + return UnmarshalPushMessageContentSuggestProfilePhoto(data) - case TypeUpdateActiveNotifications: - return UnmarshalUpdateActiveNotifications(data) + case TypePushMessageContentMessageForwards: + return UnmarshalPushMessageContentMessageForwards(data) - case TypeUpdateHavePendingNotifications: - return UnmarshalUpdateHavePendingNotifications(data) + case TypePushMessageContentMediaAlbum: + return UnmarshalPushMessageContentMediaAlbum(data) - case TypeUpdateDeleteMessages: - return UnmarshalUpdateDeleteMessages(data) + case TypeNotificationTypeNewMessage: + return UnmarshalNotificationTypeNewMessage(data) - case TypeUpdateChatAction: - return UnmarshalUpdateChatAction(data) + case TypeNotificationTypeNewSecretChat: + return UnmarshalNotificationTypeNewSecretChat(data) - case TypeUpdateUserStatus: - return UnmarshalUpdateUserStatus(data) + case TypeNotificationTypeNewCall: + return UnmarshalNotificationTypeNewCall(data) - case TypeUpdateUser: - return UnmarshalUpdateUser(data) + case TypeNotificationTypeNewPushMessage: + return UnmarshalNotificationTypeNewPushMessage(data) - case TypeUpdateBasicGroup: - return UnmarshalUpdateBasicGroup(data) + case TypeNotificationGroupTypeMessages: + return UnmarshalNotificationGroupTypeMessages(data) - case TypeUpdateSupergroup: - return UnmarshalUpdateSupergroup(data) + case TypeNotificationGroupTypeMentions: + return UnmarshalNotificationGroupTypeMentions(data) - case TypeUpdateSecretChat: - return UnmarshalUpdateSecretChat(data) + case TypeNotificationGroupTypeSecretChat: + return UnmarshalNotificationGroupTypeSecretChat(data) - case TypeUpdateUserFullInfo: - return UnmarshalUpdateUserFullInfo(data) + case TypeNotificationGroupTypeCalls: + return UnmarshalNotificationGroupTypeCalls(data) - case TypeUpdateBasicGroupFullInfo: - return UnmarshalUpdateBasicGroupFullInfo(data) + case TypeNotificationSound: + return UnmarshalNotificationSound(data) - case TypeUpdateSupergroupFullInfo: - return UnmarshalUpdateSupergroupFullInfo(data) + case TypeNotificationSounds: + return UnmarshalNotificationSounds(data) - case TypeUpdateServiceNotification: - return UnmarshalUpdateServiceNotification(data) + case TypeNotification: + return UnmarshalNotification(data) - case TypeUpdateFile: - return UnmarshalUpdateFile(data) + case TypeNotificationGroup: + return UnmarshalNotificationGroup(data) - case TypeUpdateFileGenerationStart: - return UnmarshalUpdateFileGenerationStart(data) + case TypeOptionValueBoolean: + return UnmarshalOptionValueBoolean(data) - case TypeUpdateFileGenerationStop: - return UnmarshalUpdateFileGenerationStop(data) + case TypeOptionValueEmpty: + return UnmarshalOptionValueEmpty(data) - case TypeUpdateFileDownloads: - return UnmarshalUpdateFileDownloads(data) + case TypeOptionValueInteger: + return UnmarshalOptionValueInteger(data) - case TypeUpdateFileAddedToDownloads: - return UnmarshalUpdateFileAddedToDownloads(data) + case TypeOptionValueString: + return UnmarshalOptionValueString(data) - case TypeUpdateFileDownload: - return UnmarshalUpdateFileDownload(data) + case TypeJsonObjectMember: + return UnmarshalJsonObjectMember(data) - case TypeUpdateFileRemovedFromDownloads: - return UnmarshalUpdateFileRemovedFromDownloads(data) + case TypeJsonValueNull: + return UnmarshalJsonValueNull(data) - case TypeUpdateCall: - return UnmarshalUpdateCall(data) + case TypeJsonValueBoolean: + return UnmarshalJsonValueBoolean(data) - case TypeUpdateGroupCall: - return UnmarshalUpdateGroupCall(data) + case TypeJsonValueNumber: + return UnmarshalJsonValueNumber(data) - case TypeUpdateGroupCallParticipant: - return UnmarshalUpdateGroupCallParticipant(data) + case TypeJsonValueString: + return UnmarshalJsonValueString(data) - case TypeUpdateNewCallSignalingData: - return UnmarshalUpdateNewCallSignalingData(data) + case TypeJsonValueArray: + return UnmarshalJsonValueArray(data) - case TypeUpdateUserPrivacySettingRules: - return UnmarshalUpdateUserPrivacySettingRules(data) + case TypeJsonValueObject: + return UnmarshalJsonValueObject(data) - case TypeUpdateUnreadMessageCount: - return UnmarshalUpdateUnreadMessageCount(data) + case TypeStoryPrivacySettingsEveryone: + return UnmarshalStoryPrivacySettingsEveryone(data) - case TypeUpdateUnreadChatCount: - return UnmarshalUpdateUnreadChatCount(data) + case TypeStoryPrivacySettingsContacts: + return UnmarshalStoryPrivacySettingsContacts(data) - case TypeUpdateOption: - return UnmarshalUpdateOption(data) + case TypeStoryPrivacySettingsCloseFriends: + return UnmarshalStoryPrivacySettingsCloseFriends(data) - case TypeUpdateStickerSet: - return UnmarshalUpdateStickerSet(data) + case TypeStoryPrivacySettingsSelectedUsers: + return UnmarshalStoryPrivacySettingsSelectedUsers(data) - case TypeUpdateInstalledStickerSets: - return UnmarshalUpdateInstalledStickerSets(data) + case TypeUserPrivacySettingRuleAllowAll: + return UnmarshalUserPrivacySettingRuleAllowAll(data) - case TypeUpdateTrendingStickerSets: - return UnmarshalUpdateTrendingStickerSets(data) + case TypeUserPrivacySettingRuleAllowContacts: + return UnmarshalUserPrivacySettingRuleAllowContacts(data) - case TypeUpdateRecentStickers: - return UnmarshalUpdateRecentStickers(data) + case TypeUserPrivacySettingRuleAllowPremiumUsers: + return UnmarshalUserPrivacySettingRuleAllowPremiumUsers(data) - case TypeUpdateFavoriteStickers: - return UnmarshalUpdateFavoriteStickers(data) + case TypeUserPrivacySettingRuleAllowUsers: + return UnmarshalUserPrivacySettingRuleAllowUsers(data) - case TypeUpdateSavedAnimations: - return UnmarshalUpdateSavedAnimations(data) + case TypeUserPrivacySettingRuleAllowChatMembers: + return UnmarshalUserPrivacySettingRuleAllowChatMembers(data) - case TypeUpdateSavedNotificationSounds: - return UnmarshalUpdateSavedNotificationSounds(data) + case TypeUserPrivacySettingRuleRestrictAll: + return UnmarshalUserPrivacySettingRuleRestrictAll(data) - case TypeUpdateSelectedBackground: - return UnmarshalUpdateSelectedBackground(data) + case TypeUserPrivacySettingRuleRestrictContacts: + return UnmarshalUserPrivacySettingRuleRestrictContacts(data) - case TypeUpdateChatThemes: - return UnmarshalUpdateChatThemes(data) + case TypeUserPrivacySettingRuleRestrictUsers: + return UnmarshalUserPrivacySettingRuleRestrictUsers(data) - case TypeUpdateLanguagePackStrings: - return UnmarshalUpdateLanguagePackStrings(data) + case TypeUserPrivacySettingRuleRestrictChatMembers: + return UnmarshalUserPrivacySettingRuleRestrictChatMembers(data) - case TypeUpdateConnectionState: - return UnmarshalUpdateConnectionState(data) + case TypeUserPrivacySettingRules: + return UnmarshalUserPrivacySettingRules(data) - case TypeUpdateTermsOfService: - return UnmarshalUpdateTermsOfService(data) + case TypeUserPrivacySettingShowStatus: + return UnmarshalUserPrivacySettingShowStatus(data) - case TypeUpdateUsersNearby: - return UnmarshalUpdateUsersNearby(data) + case TypeUserPrivacySettingShowProfilePhoto: + return UnmarshalUserPrivacySettingShowProfilePhoto(data) - case TypeUpdateAttachmentMenuBots: - return UnmarshalUpdateAttachmentMenuBots(data) + case TypeUserPrivacySettingShowLinkInForwardedMessages: + return UnmarshalUserPrivacySettingShowLinkInForwardedMessages(data) - case TypeUpdateWebAppMessageSent: - return UnmarshalUpdateWebAppMessageSent(data) + case TypeUserPrivacySettingShowPhoneNumber: + return UnmarshalUserPrivacySettingShowPhoneNumber(data) - case TypeUpdateActiveEmojiReactions: - return UnmarshalUpdateActiveEmojiReactions(data) + case TypeUserPrivacySettingShowBio: + return UnmarshalUserPrivacySettingShowBio(data) - case TypeUpdateDefaultReactionType: - return UnmarshalUpdateDefaultReactionType(data) + case TypeUserPrivacySettingShowBirthdate: + return UnmarshalUserPrivacySettingShowBirthdate(data) - case TypeUpdateDiceEmojis: - return UnmarshalUpdateDiceEmojis(data) + case TypeUserPrivacySettingAllowChatInvites: + return UnmarshalUserPrivacySettingAllowChatInvites(data) - case TypeUpdateAnimatedEmojiMessageClicked: - return UnmarshalUpdateAnimatedEmojiMessageClicked(data) + case TypeUserPrivacySettingAllowCalls: + return UnmarshalUserPrivacySettingAllowCalls(data) - case TypeUpdateAnimationSearchParameters: - return UnmarshalUpdateAnimationSearchParameters(data) + case TypeUserPrivacySettingAllowPeerToPeerCalls: + return UnmarshalUserPrivacySettingAllowPeerToPeerCalls(data) - case TypeUpdateSuggestedActions: - return UnmarshalUpdateSuggestedActions(data) + case TypeUserPrivacySettingAllowFindingByPhoneNumber: + return UnmarshalUserPrivacySettingAllowFindingByPhoneNumber(data) - case TypeUpdateNewInlineQuery: - return UnmarshalUpdateNewInlineQuery(data) + case TypeUserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages: + return UnmarshalUserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages(data) - case TypeUpdateNewChosenInlineResult: - return UnmarshalUpdateNewChosenInlineResult(data) + case TypeReadDatePrivacySettings: + return UnmarshalReadDatePrivacySettings(data) - case TypeUpdateNewCallbackQuery: - return UnmarshalUpdateNewCallbackQuery(data) + case TypeNewChatPrivacySettings: + return UnmarshalNewChatPrivacySettings(data) - case TypeUpdateNewInlineCallbackQuery: - return UnmarshalUpdateNewInlineCallbackQuery(data) + case TypeCanSendMessageToUserResultOk: + return UnmarshalCanSendMessageToUserResultOk(data) - case TypeUpdateNewShippingQuery: - return UnmarshalUpdateNewShippingQuery(data) + case TypeCanSendMessageToUserResultUserIsDeleted: + return UnmarshalCanSendMessageToUserResultUserIsDeleted(data) - case TypeUpdateNewPreCheckoutQuery: - return UnmarshalUpdateNewPreCheckoutQuery(data) + case TypeCanSendMessageToUserResultUserRestrictsNewChats: + return UnmarshalCanSendMessageToUserResultUserRestrictsNewChats(data) - case TypeUpdateNewCustomEvent: - return UnmarshalUpdateNewCustomEvent(data) + case TypeAccountTtl: + return UnmarshalAccountTtl(data) - case TypeUpdateNewCustomQuery: - return UnmarshalUpdateNewCustomQuery(data) + case TypeMessageAutoDeleteTime: + return UnmarshalMessageAutoDeleteTime(data) - case TypeUpdatePoll: - return UnmarshalUpdatePoll(data) + case TypeSessionTypeAndroid: + return UnmarshalSessionTypeAndroid(data) - case TypeUpdatePollAnswer: - return UnmarshalUpdatePollAnswer(data) + case TypeSessionTypeApple: + return UnmarshalSessionTypeApple(data) - case TypeUpdateChatMember: - return UnmarshalUpdateChatMember(data) + case TypeSessionTypeBrave: + return UnmarshalSessionTypeBrave(data) - case TypeUpdateNewChatJoinRequest: - return UnmarshalUpdateNewChatJoinRequest(data) + case TypeSessionTypeChrome: + return UnmarshalSessionTypeChrome(data) - case TypeUpdates: - return UnmarshalUpdates(data) + case TypeSessionTypeEdge: + return UnmarshalSessionTypeEdge(data) - case TypeLogStreamDefault: - return UnmarshalLogStreamDefault(data) + case TypeSessionTypeFirefox: + return UnmarshalSessionTypeFirefox(data) - case TypeLogStreamFile: - return UnmarshalLogStreamFile(data) + case TypeSessionTypeIpad: + return UnmarshalSessionTypeIpad(data) - case TypeLogStreamEmpty: - return UnmarshalLogStreamEmpty(data) + case TypeSessionTypeIphone: + return UnmarshalSessionTypeIphone(data) - case TypeLogVerbosityLevel: - return UnmarshalLogVerbosityLevel(data) + case TypeSessionTypeLinux: + return UnmarshalSessionTypeLinux(data) - case TypeLogTags: - return UnmarshalLogTags(data) + case TypeSessionTypeMac: + return UnmarshalSessionTypeMac(data) - case TypeUserSupportInfo: - return UnmarshalUserSupportInfo(data) + case TypeSessionTypeOpera: + return UnmarshalSessionTypeOpera(data) - case TypeTestInt: - return UnmarshalTestInt(data) + case TypeSessionTypeSafari: + return UnmarshalSessionTypeSafari(data) - case TypeTestString: - return UnmarshalTestString(data) + case TypeSessionTypeUbuntu: + return UnmarshalSessionTypeUbuntu(data) - case TypeTestBytes: - return UnmarshalTestBytes(data) + case TypeSessionTypeUnknown: + return UnmarshalSessionTypeUnknown(data) - case TypeTestVectorInt: - return UnmarshalTestVectorInt(data) + case TypeSessionTypeVivaldi: + return UnmarshalSessionTypeVivaldi(data) - case TypeTestVectorIntObject: - return UnmarshalTestVectorIntObject(data) + case TypeSessionTypeWindows: + return UnmarshalSessionTypeWindows(data) - case TypeTestVectorString: - return UnmarshalTestVectorString(data) + case TypeSessionTypeXbox: + return UnmarshalSessionTypeXbox(data) - case TypeTestVectorStringObject: - return UnmarshalTestVectorStringObject(data) + case TypeSession: + return UnmarshalSession(data) - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } + case TypeSessions: + return UnmarshalSessions(data) + + case TypeUnconfirmedSession: + return UnmarshalUnconfirmedSession(data) + + case TypeConnectedWebsite: + return UnmarshalConnectedWebsite(data) + + case TypeConnectedWebsites: + return UnmarshalConnectedWebsites(data) + + case TypeReportReasonSpam: + return UnmarshalReportReasonSpam(data) + + case TypeReportReasonViolence: + return UnmarshalReportReasonViolence(data) + + case TypeReportReasonPornography: + return UnmarshalReportReasonPornography(data) + + case TypeReportReasonChildAbuse: + return UnmarshalReportReasonChildAbuse(data) + + case TypeReportReasonCopyright: + return UnmarshalReportReasonCopyright(data) + + case TypeReportReasonUnrelatedLocation: + return UnmarshalReportReasonUnrelatedLocation(data) + + case TypeReportReasonFake: + return UnmarshalReportReasonFake(data) + + case TypeReportReasonIllegalDrugs: + return UnmarshalReportReasonIllegalDrugs(data) + + case TypeReportReasonPersonalDetails: + return UnmarshalReportReasonPersonalDetails(data) + + case TypeReportReasonCustom: + return UnmarshalReportReasonCustom(data) + + case TypeTargetChatCurrent: + return UnmarshalTargetChatCurrent(data) + + case TypeTargetChatChosen: + return UnmarshalTargetChatChosen(data) + + case TypeTargetChatInternalLink: + return UnmarshalTargetChatInternalLink(data) + + case TypeInternalLinkTypeActiveSessions: + return UnmarshalInternalLinkTypeActiveSessions(data) + + case TypeInternalLinkTypeAttachmentMenuBot: + return UnmarshalInternalLinkTypeAttachmentMenuBot(data) + + case TypeInternalLinkTypeAuthenticationCode: + return UnmarshalInternalLinkTypeAuthenticationCode(data) + + case TypeInternalLinkTypeBackground: + return UnmarshalInternalLinkTypeBackground(data) + + case TypeInternalLinkTypeBotAddToChannel: + return UnmarshalInternalLinkTypeBotAddToChannel(data) + + case TypeInternalLinkTypeBotStart: + return UnmarshalInternalLinkTypeBotStart(data) + + case TypeInternalLinkTypeBotStartInGroup: + return UnmarshalInternalLinkTypeBotStartInGroup(data) + + case TypeInternalLinkTypeChangePhoneNumber: + return UnmarshalInternalLinkTypeChangePhoneNumber(data) + + case TypeInternalLinkTypeChatBoost: + return UnmarshalInternalLinkTypeChatBoost(data) + + case TypeInternalLinkTypeChatFolderInvite: + return UnmarshalInternalLinkTypeChatFolderInvite(data) + + case TypeInternalLinkTypeChatFolderSettings: + return UnmarshalInternalLinkTypeChatFolderSettings(data) + + case TypeInternalLinkTypeChatInvite: + return UnmarshalInternalLinkTypeChatInvite(data) + + case TypeInternalLinkTypeDefaultMessageAutoDeleteTimerSettings: + return UnmarshalInternalLinkTypeDefaultMessageAutoDeleteTimerSettings(data) + + case TypeInternalLinkTypeEditProfileSettings: + return UnmarshalInternalLinkTypeEditProfileSettings(data) + + case TypeInternalLinkTypeGame: + return UnmarshalInternalLinkTypeGame(data) + + case TypeInternalLinkTypeInstantView: + return UnmarshalInternalLinkTypeInstantView(data) + + case TypeInternalLinkTypeInvoice: + return UnmarshalInternalLinkTypeInvoice(data) + + case TypeInternalLinkTypeLanguagePack: + return UnmarshalInternalLinkTypeLanguagePack(data) + + case TypeInternalLinkTypeLanguageSettings: + return UnmarshalInternalLinkTypeLanguageSettings(data) + + case TypeInternalLinkTypeMessage: + return UnmarshalInternalLinkTypeMessage(data) + + case TypeInternalLinkTypeMessageDraft: + return UnmarshalInternalLinkTypeMessageDraft(data) + + case TypeInternalLinkTypePassportDataRequest: + return UnmarshalInternalLinkTypePassportDataRequest(data) + + case TypeInternalLinkTypePhoneNumberConfirmation: + return UnmarshalInternalLinkTypePhoneNumberConfirmation(data) + + case TypeInternalLinkTypePremiumFeatures: + return UnmarshalInternalLinkTypePremiumFeatures(data) + + case TypeInternalLinkTypePremiumGift: + return UnmarshalInternalLinkTypePremiumGift(data) + + case TypeInternalLinkTypePremiumGiftCode: + return UnmarshalInternalLinkTypePremiumGiftCode(data) + + case TypeInternalLinkTypePrivacyAndSecuritySettings: + return UnmarshalInternalLinkTypePrivacyAndSecuritySettings(data) + + case TypeInternalLinkTypeProxy: + return UnmarshalInternalLinkTypeProxy(data) + + case TypeInternalLinkTypePublicChat: + return UnmarshalInternalLinkTypePublicChat(data) + + case TypeInternalLinkTypeQrCodeAuthentication: + return UnmarshalInternalLinkTypeQrCodeAuthentication(data) + + case TypeInternalLinkTypeRestorePurchases: + return UnmarshalInternalLinkTypeRestorePurchases(data) + + case TypeInternalLinkTypeSettings: + return UnmarshalInternalLinkTypeSettings(data) + + case TypeInternalLinkTypeSideMenuBot: + return UnmarshalInternalLinkTypeSideMenuBot(data) + + case TypeInternalLinkTypeStickerSet: + return UnmarshalInternalLinkTypeStickerSet(data) + + case TypeInternalLinkTypeStory: + return UnmarshalInternalLinkTypeStory(data) + + case TypeInternalLinkTypeTheme: + return UnmarshalInternalLinkTypeTheme(data) + + case TypeInternalLinkTypeThemeSettings: + return UnmarshalInternalLinkTypeThemeSettings(data) + + case TypeInternalLinkTypeUnknownDeepLink: + return UnmarshalInternalLinkTypeUnknownDeepLink(data) + + case TypeInternalLinkTypeUnsupportedProxy: + return UnmarshalInternalLinkTypeUnsupportedProxy(data) + + case TypeInternalLinkTypeUserPhoneNumber: + return UnmarshalInternalLinkTypeUserPhoneNumber(data) + + case TypeInternalLinkTypeUserToken: + return UnmarshalInternalLinkTypeUserToken(data) + + case TypeInternalLinkTypeVideoChat: + return UnmarshalInternalLinkTypeVideoChat(data) + + case TypeInternalLinkTypeWebApp: + return UnmarshalInternalLinkTypeWebApp(data) + + case TypeMessageLink: + return UnmarshalMessageLink(data) + + case TypeMessageLinkInfo: + return UnmarshalMessageLinkInfo(data) + + case TypeChatBoostLink: + return UnmarshalChatBoostLink(data) + + case TypeChatBoostLinkInfo: + return UnmarshalChatBoostLinkInfo(data) + + case TypeBlockListMain: + return UnmarshalBlockListMain(data) + + case TypeBlockListStories: + return UnmarshalBlockListStories(data) + + case TypeFilePart: + return UnmarshalFilePart(data) + + case TypeFileTypeNone: + return UnmarshalFileTypeNone(data) + + case TypeFileTypeAnimation: + return UnmarshalFileTypeAnimation(data) + + case TypeFileTypeAudio: + return UnmarshalFileTypeAudio(data) + + case TypeFileTypeDocument: + return UnmarshalFileTypeDocument(data) + + case TypeFileTypeNotificationSound: + return UnmarshalFileTypeNotificationSound(data) + + case TypeFileTypePhoto: + return UnmarshalFileTypePhoto(data) + + case TypeFileTypePhotoStory: + return UnmarshalFileTypePhotoStory(data) + + case TypeFileTypeProfilePhoto: + return UnmarshalFileTypeProfilePhoto(data) + + case TypeFileTypeSecret: + return UnmarshalFileTypeSecret(data) + + case TypeFileTypeSecretThumbnail: + return UnmarshalFileTypeSecretThumbnail(data) + + case TypeFileTypeSecure: + return UnmarshalFileTypeSecure(data) + + case TypeFileTypeSticker: + return UnmarshalFileTypeSticker(data) + + case TypeFileTypeThumbnail: + return UnmarshalFileTypeThumbnail(data) + + case TypeFileTypeUnknown: + return UnmarshalFileTypeUnknown(data) + + case TypeFileTypeVideo: + return UnmarshalFileTypeVideo(data) + + case TypeFileTypeVideoNote: + return UnmarshalFileTypeVideoNote(data) + + case TypeFileTypeVideoStory: + return UnmarshalFileTypeVideoStory(data) + + case TypeFileTypeVoiceNote: + return UnmarshalFileTypeVoiceNote(data) + + case TypeFileTypeWallpaper: + return UnmarshalFileTypeWallpaper(data) + + case TypeStorageStatisticsByFileType: + return UnmarshalStorageStatisticsByFileType(data) + + case TypeStorageStatisticsByChat: + return UnmarshalStorageStatisticsByChat(data) + + case TypeStorageStatistics: + return UnmarshalStorageStatistics(data) + + case TypeStorageStatisticsFast: + return UnmarshalStorageStatisticsFast(data) + + case TypeDatabaseStatistics: + return UnmarshalDatabaseStatistics(data) + + case TypeNetworkTypeNone: + return UnmarshalNetworkTypeNone(data) + + case TypeNetworkTypeMobile: + return UnmarshalNetworkTypeMobile(data) + + case TypeNetworkTypeMobileRoaming: + return UnmarshalNetworkTypeMobileRoaming(data) + + case TypeNetworkTypeWiFi: + return UnmarshalNetworkTypeWiFi(data) + + case TypeNetworkTypeOther: + return UnmarshalNetworkTypeOther(data) + + case TypeNetworkStatisticsEntryFile: + return UnmarshalNetworkStatisticsEntryFile(data) + + case TypeNetworkStatisticsEntryCall: + return UnmarshalNetworkStatisticsEntryCall(data) + + case TypeNetworkStatistics: + return UnmarshalNetworkStatistics(data) + + case TypeAutoDownloadSettings: + return UnmarshalAutoDownloadSettings(data) + + case TypeAutoDownloadSettingsPresets: + return UnmarshalAutoDownloadSettingsPresets(data) + + case TypeAutosaveSettingsScopePrivateChats: + return UnmarshalAutosaveSettingsScopePrivateChats(data) + + case TypeAutosaveSettingsScopeGroupChats: + return UnmarshalAutosaveSettingsScopeGroupChats(data) + + case TypeAutosaveSettingsScopeChannelChats: + return UnmarshalAutosaveSettingsScopeChannelChats(data) + + case TypeAutosaveSettingsScopeChat: + return UnmarshalAutosaveSettingsScopeChat(data) + + case TypeScopeAutosaveSettings: + return UnmarshalScopeAutosaveSettings(data) + + case TypeAutosaveSettingsException: + return UnmarshalAutosaveSettingsException(data) + + case TypeAutosaveSettings: + return UnmarshalAutosaveSettings(data) + + case TypeConnectionStateWaitingForNetwork: + return UnmarshalConnectionStateWaitingForNetwork(data) + + case TypeConnectionStateConnectingToProxy: + return UnmarshalConnectionStateConnectingToProxy(data) + + case TypeConnectionStateConnecting: + return UnmarshalConnectionStateConnecting(data) + + case TypeConnectionStateUpdating: + return UnmarshalConnectionStateUpdating(data) + + case TypeConnectionStateReady: + return UnmarshalConnectionStateReady(data) + + case TypeTopChatCategoryUsers: + return UnmarshalTopChatCategoryUsers(data) + + case TypeTopChatCategoryBots: + return UnmarshalTopChatCategoryBots(data) + + case TypeTopChatCategoryGroups: + return UnmarshalTopChatCategoryGroups(data) + + case TypeTopChatCategoryChannels: + return UnmarshalTopChatCategoryChannels(data) + + case TypeTopChatCategoryInlineBots: + return UnmarshalTopChatCategoryInlineBots(data) + + case TypeTopChatCategoryCalls: + return UnmarshalTopChatCategoryCalls(data) + + case TypeTopChatCategoryForwardChats: + return UnmarshalTopChatCategoryForwardChats(data) + + case TypeFoundPosition: + return UnmarshalFoundPosition(data) + + case TypeFoundPositions: + return UnmarshalFoundPositions(data) + + case TypeTMeUrlTypeUser: + return UnmarshalTMeUrlTypeUser(data) + + case TypeTMeUrlTypeSupergroup: + return UnmarshalTMeUrlTypeSupergroup(data) + + case TypeTMeUrlTypeChatInvite: + return UnmarshalTMeUrlTypeChatInvite(data) + + case TypeTMeUrlTypeStickerSet: + return UnmarshalTMeUrlTypeStickerSet(data) + + case TypeTMeUrl: + return UnmarshalTMeUrl(data) + + case TypeTMeUrls: + return UnmarshalTMeUrls(data) + + case TypeSuggestedActionEnableArchiveAndMuteNewChats: + return UnmarshalSuggestedActionEnableArchiveAndMuteNewChats(data) + + case TypeSuggestedActionCheckPassword: + return UnmarshalSuggestedActionCheckPassword(data) + + case TypeSuggestedActionCheckPhoneNumber: + return UnmarshalSuggestedActionCheckPhoneNumber(data) + + case TypeSuggestedActionViewChecksHint: + return UnmarshalSuggestedActionViewChecksHint(data) + + case TypeSuggestedActionConvertToBroadcastGroup: + return UnmarshalSuggestedActionConvertToBroadcastGroup(data) + + case TypeSuggestedActionSetPassword: + return UnmarshalSuggestedActionSetPassword(data) + + case TypeSuggestedActionUpgradePremium: + return UnmarshalSuggestedActionUpgradePremium(data) + + case TypeSuggestedActionRestorePremium: + return UnmarshalSuggestedActionRestorePremium(data) + + case TypeSuggestedActionSubscribeToAnnualPremium: + return UnmarshalSuggestedActionSubscribeToAnnualPremium(data) + + case TypeSuggestedActionGiftPremiumForChristmas: + return UnmarshalSuggestedActionGiftPremiumForChristmas(data) + + case TypeSuggestedActionSetBirthdate: + return UnmarshalSuggestedActionSetBirthdate(data) + + case TypeCount: + return UnmarshalCount(data) + + case TypeText: + return UnmarshalText(data) + + case TypeSeconds: + return UnmarshalSeconds(data) + + case TypeFileDownloadedPrefixSize: + return UnmarshalFileDownloadedPrefixSize(data) + + case TypeDeepLinkInfo: + return UnmarshalDeepLinkInfo(data) + + case TypeTextParseModeMarkdown: + return UnmarshalTextParseModeMarkdown(data) + + case TypeTextParseModeHTML: + return UnmarshalTextParseModeHTML(data) + + case TypeProxyTypeSocks5: + return UnmarshalProxyTypeSocks5(data) + + case TypeProxyTypeHttp: + return UnmarshalProxyTypeHttp(data) + + case TypeProxyTypeMtproto: + return UnmarshalProxyTypeMtproto(data) + + case TypeProxy: + return UnmarshalProxy(data) + + case TypeProxies: + return UnmarshalProxies(data) + + case TypeInputSticker: + return UnmarshalInputSticker(data) + + case TypeDateRange: + return UnmarshalDateRange(data) + + case TypeStatisticalValue: + return UnmarshalStatisticalValue(data) + + case TypeStatisticalGraphData: + return UnmarshalStatisticalGraphData(data) + + case TypeStatisticalGraphAsync: + return UnmarshalStatisticalGraphAsync(data) + + case TypeStatisticalGraphError: + return UnmarshalStatisticalGraphError(data) + + case TypeChatStatisticsObjectTypeMessage: + return UnmarshalChatStatisticsObjectTypeMessage(data) + + case TypeChatStatisticsObjectTypeStory: + return UnmarshalChatStatisticsObjectTypeStory(data) + + case TypeChatStatisticsInteractionInfo: + return UnmarshalChatStatisticsInteractionInfo(data) + + case TypeChatStatisticsMessageSenderInfo: + return UnmarshalChatStatisticsMessageSenderInfo(data) + + case TypeChatStatisticsAdministratorActionsInfo: + return UnmarshalChatStatisticsAdministratorActionsInfo(data) + + case TypeChatStatisticsInviterInfo: + return UnmarshalChatStatisticsInviterInfo(data) + + case TypeChatStatisticsSupergroup: + return UnmarshalChatStatisticsSupergroup(data) + + case TypeChatStatisticsChannel: + return UnmarshalChatStatisticsChannel(data) + + case TypeMessageStatistics: + return UnmarshalMessageStatistics(data) + + case TypeStoryStatistics: + return UnmarshalStoryStatistics(data) + + case TypePoint: + return UnmarshalPoint(data) + + case TypeVectorPathCommandLine: + return UnmarshalVectorPathCommandLine(data) + + case TypeVectorPathCommandCubicBezierCurve: + return UnmarshalVectorPathCommandCubicBezierCurve(data) + + case TypeBotCommandScopeDefault: + return UnmarshalBotCommandScopeDefault(data) + + case TypeBotCommandScopeAllPrivateChats: + return UnmarshalBotCommandScopeAllPrivateChats(data) + + case TypeBotCommandScopeAllGroupChats: + return UnmarshalBotCommandScopeAllGroupChats(data) + + case TypeBotCommandScopeAllChatAdministrators: + return UnmarshalBotCommandScopeAllChatAdministrators(data) + + case TypeBotCommandScopeChat: + return UnmarshalBotCommandScopeChat(data) + + case TypeBotCommandScopeChatAdministrators: + return UnmarshalBotCommandScopeChatAdministrators(data) + + case TypeBotCommandScopeChatMember: + return UnmarshalBotCommandScopeChatMember(data) + + case TypeUpdateAuthorizationState: + return UnmarshalUpdateAuthorizationState(data) + + case TypeUpdateNewMessage: + return UnmarshalUpdateNewMessage(data) + + case TypeUpdateMessageSendAcknowledged: + return UnmarshalUpdateMessageSendAcknowledged(data) + + case TypeUpdateMessageSendSucceeded: + return UnmarshalUpdateMessageSendSucceeded(data) + + case TypeUpdateMessageSendFailed: + return UnmarshalUpdateMessageSendFailed(data) + + case TypeUpdateMessageContent: + return UnmarshalUpdateMessageContent(data) + + case TypeUpdateMessageEdited: + return UnmarshalUpdateMessageEdited(data) + + case TypeUpdateMessageIsPinned: + return UnmarshalUpdateMessageIsPinned(data) + + case TypeUpdateMessageInteractionInfo: + return UnmarshalUpdateMessageInteractionInfo(data) + + case TypeUpdateMessageContentOpened: + return UnmarshalUpdateMessageContentOpened(data) + + case TypeUpdateMessageMentionRead: + return UnmarshalUpdateMessageMentionRead(data) + + case TypeUpdateMessageUnreadReactions: + return UnmarshalUpdateMessageUnreadReactions(data) + + case TypeUpdateMessageLiveLocationViewed: + return UnmarshalUpdateMessageLiveLocationViewed(data) + + case TypeUpdateNewChat: + return UnmarshalUpdateNewChat(data) + + case TypeUpdateChatTitle: + return UnmarshalUpdateChatTitle(data) + + case TypeUpdateChatPhoto: + return UnmarshalUpdateChatPhoto(data) + + case TypeUpdateChatAccentColors: + return UnmarshalUpdateChatAccentColors(data) + + case TypeUpdateChatPermissions: + return UnmarshalUpdateChatPermissions(data) + + case TypeUpdateChatLastMessage: + return UnmarshalUpdateChatLastMessage(data) + + case TypeUpdateChatPosition: + return UnmarshalUpdateChatPosition(data) + + case TypeUpdateChatAddedToList: + return UnmarshalUpdateChatAddedToList(data) + + case TypeUpdateChatRemovedFromList: + return UnmarshalUpdateChatRemovedFromList(data) + + case TypeUpdateChatReadInbox: + return UnmarshalUpdateChatReadInbox(data) + + case TypeUpdateChatReadOutbox: + return UnmarshalUpdateChatReadOutbox(data) + + case TypeUpdateChatActionBar: + return UnmarshalUpdateChatActionBar(data) + + case TypeUpdateChatAvailableReactions: + return UnmarshalUpdateChatAvailableReactions(data) + + case TypeUpdateChatDraftMessage: + return UnmarshalUpdateChatDraftMessage(data) + + case TypeUpdateChatEmojiStatus: + return UnmarshalUpdateChatEmojiStatus(data) + + case TypeUpdateChatMessageSender: + return UnmarshalUpdateChatMessageSender(data) + + case TypeUpdateChatMessageAutoDeleteTime: + return UnmarshalUpdateChatMessageAutoDeleteTime(data) + + case TypeUpdateChatNotificationSettings: + return UnmarshalUpdateChatNotificationSettings(data) + + case TypeUpdateChatPendingJoinRequests: + return UnmarshalUpdateChatPendingJoinRequests(data) + + case TypeUpdateChatReplyMarkup: + return UnmarshalUpdateChatReplyMarkup(data) + + case TypeUpdateChatBackground: + return UnmarshalUpdateChatBackground(data) + + case TypeUpdateChatTheme: + return UnmarshalUpdateChatTheme(data) + + case TypeUpdateChatUnreadMentionCount: + return UnmarshalUpdateChatUnreadMentionCount(data) + + case TypeUpdateChatUnreadReactionCount: + return UnmarshalUpdateChatUnreadReactionCount(data) + + case TypeUpdateChatVideoChat: + return UnmarshalUpdateChatVideoChat(data) + + case TypeUpdateChatDefaultDisableNotification: + return UnmarshalUpdateChatDefaultDisableNotification(data) + + case TypeUpdateChatHasProtectedContent: + return UnmarshalUpdateChatHasProtectedContent(data) + + case TypeUpdateChatIsTranslatable: + return UnmarshalUpdateChatIsTranslatable(data) + + case TypeUpdateChatIsMarkedAsUnread: + return UnmarshalUpdateChatIsMarkedAsUnread(data) + + case TypeUpdateChatViewAsTopics: + return UnmarshalUpdateChatViewAsTopics(data) + + case TypeUpdateChatBlockList: + return UnmarshalUpdateChatBlockList(data) + + case TypeUpdateChatHasScheduledMessages: + return UnmarshalUpdateChatHasScheduledMessages(data) + + case TypeUpdateChatFolders: + return UnmarshalUpdateChatFolders(data) + + case TypeUpdateChatOnlineMemberCount: + return UnmarshalUpdateChatOnlineMemberCount(data) + + case TypeUpdateSavedMessagesTopic: + return UnmarshalUpdateSavedMessagesTopic(data) + + case TypeUpdateSavedMessagesTopicCount: + return UnmarshalUpdateSavedMessagesTopicCount(data) + + case TypeUpdateQuickReplyShortcut: + return UnmarshalUpdateQuickReplyShortcut(data) + + case TypeUpdateQuickReplyShortcutDeleted: + return UnmarshalUpdateQuickReplyShortcutDeleted(data) + + case TypeUpdateQuickReplyShortcuts: + return UnmarshalUpdateQuickReplyShortcuts(data) + + case TypeUpdateQuickReplyShortcutMessages: + return UnmarshalUpdateQuickReplyShortcutMessages(data) + + case TypeUpdateForumTopicInfo: + return UnmarshalUpdateForumTopicInfo(data) + + case TypeUpdateScopeNotificationSettings: + return UnmarshalUpdateScopeNotificationSettings(data) + + case TypeUpdateNotification: + return UnmarshalUpdateNotification(data) + + case TypeUpdateNotificationGroup: + return UnmarshalUpdateNotificationGroup(data) + + case TypeUpdateActiveNotifications: + return UnmarshalUpdateActiveNotifications(data) + + case TypeUpdateHavePendingNotifications: + return UnmarshalUpdateHavePendingNotifications(data) + + case TypeUpdateDeleteMessages: + return UnmarshalUpdateDeleteMessages(data) + + case TypeUpdateChatAction: + return UnmarshalUpdateChatAction(data) + + case TypeUpdateUserStatus: + return UnmarshalUpdateUserStatus(data) + + case TypeUpdateUser: + return UnmarshalUpdateUser(data) + + case TypeUpdateBasicGroup: + return UnmarshalUpdateBasicGroup(data) + + case TypeUpdateSupergroup: + return UnmarshalUpdateSupergroup(data) + + case TypeUpdateSecretChat: + return UnmarshalUpdateSecretChat(data) + + case TypeUpdateUserFullInfo: + return UnmarshalUpdateUserFullInfo(data) + + case TypeUpdateBasicGroupFullInfo: + return UnmarshalUpdateBasicGroupFullInfo(data) + + case TypeUpdateSupergroupFullInfo: + return UnmarshalUpdateSupergroupFullInfo(data) + + case TypeUpdateServiceNotification: + return UnmarshalUpdateServiceNotification(data) + + case TypeUpdateFile: + return UnmarshalUpdateFile(data) + + case TypeUpdateFileGenerationStart: + return UnmarshalUpdateFileGenerationStart(data) + + case TypeUpdateFileGenerationStop: + return UnmarshalUpdateFileGenerationStop(data) + + case TypeUpdateFileDownloads: + return UnmarshalUpdateFileDownloads(data) + + case TypeUpdateFileAddedToDownloads: + return UnmarshalUpdateFileAddedToDownloads(data) + + case TypeUpdateFileDownload: + return UnmarshalUpdateFileDownload(data) + + case TypeUpdateFileRemovedFromDownloads: + return UnmarshalUpdateFileRemovedFromDownloads(data) + + case TypeUpdateCall: + return UnmarshalUpdateCall(data) + + case TypeUpdateGroupCall: + return UnmarshalUpdateGroupCall(data) + + case TypeUpdateGroupCallParticipant: + return UnmarshalUpdateGroupCallParticipant(data) + + case TypeUpdateNewCallSignalingData: + return UnmarshalUpdateNewCallSignalingData(data) + + case TypeUpdateUserPrivacySettingRules: + return UnmarshalUpdateUserPrivacySettingRules(data) + + case TypeUpdateUnreadMessageCount: + return UnmarshalUpdateUnreadMessageCount(data) + + case TypeUpdateUnreadChatCount: + return UnmarshalUpdateUnreadChatCount(data) + + case TypeUpdateStory: + return UnmarshalUpdateStory(data) + + case TypeUpdateStoryDeleted: + return UnmarshalUpdateStoryDeleted(data) + + case TypeUpdateStorySendSucceeded: + return UnmarshalUpdateStorySendSucceeded(data) + + case TypeUpdateStorySendFailed: + return UnmarshalUpdateStorySendFailed(data) + + case TypeUpdateChatActiveStories: + return UnmarshalUpdateChatActiveStories(data) + + case TypeUpdateStoryListChatCount: + return UnmarshalUpdateStoryListChatCount(data) + + case TypeUpdateStoryStealthMode: + return UnmarshalUpdateStoryStealthMode(data) + + case TypeUpdateOption: + return UnmarshalUpdateOption(data) + + case TypeUpdateStickerSet: + return UnmarshalUpdateStickerSet(data) + + case TypeUpdateInstalledStickerSets: + return UnmarshalUpdateInstalledStickerSets(data) + + case TypeUpdateTrendingStickerSets: + return UnmarshalUpdateTrendingStickerSets(data) + + case TypeUpdateRecentStickers: + return UnmarshalUpdateRecentStickers(data) + + case TypeUpdateFavoriteStickers: + return UnmarshalUpdateFavoriteStickers(data) + + case TypeUpdateSavedAnimations: + return UnmarshalUpdateSavedAnimations(data) + + case TypeUpdateSavedNotificationSounds: + return UnmarshalUpdateSavedNotificationSounds(data) + + case TypeUpdateDefaultBackground: + return UnmarshalUpdateDefaultBackground(data) + + case TypeUpdateChatThemes: + return UnmarshalUpdateChatThemes(data) + + case TypeUpdateAccentColors: + return UnmarshalUpdateAccentColors(data) + + case TypeUpdateProfileAccentColors: + return UnmarshalUpdateProfileAccentColors(data) + + case TypeUpdateLanguagePackStrings: + return UnmarshalUpdateLanguagePackStrings(data) + + case TypeUpdateConnectionState: + return UnmarshalUpdateConnectionState(data) + + case TypeUpdateTermsOfService: + return UnmarshalUpdateTermsOfService(data) + + case TypeUpdateUsersNearby: + return UnmarshalUpdateUsersNearby(data) + + case TypeUpdateUnconfirmedSession: + return UnmarshalUpdateUnconfirmedSession(data) + + case TypeUpdateAttachmentMenuBots: + return UnmarshalUpdateAttachmentMenuBots(data) + + case TypeUpdateWebAppMessageSent: + return UnmarshalUpdateWebAppMessageSent(data) + + case TypeUpdateActiveEmojiReactions: + return UnmarshalUpdateActiveEmojiReactions(data) + + case TypeUpdateDefaultReactionType: + return UnmarshalUpdateDefaultReactionType(data) + + case TypeUpdateSavedMessagesTags: + return UnmarshalUpdateSavedMessagesTags(data) + + case TypeUpdateSpeechRecognitionTrial: + return UnmarshalUpdateSpeechRecognitionTrial(data) + + case TypeUpdateDiceEmojis: + return UnmarshalUpdateDiceEmojis(data) + + case TypeUpdateAnimatedEmojiMessageClicked: + return UnmarshalUpdateAnimatedEmojiMessageClicked(data) + + case TypeUpdateAnimationSearchParameters: + return UnmarshalUpdateAnimationSearchParameters(data) + + case TypeUpdateSuggestedActions: + return UnmarshalUpdateSuggestedActions(data) + + case TypeUpdateContactCloseBirthdays: + return UnmarshalUpdateContactCloseBirthdays(data) + + case TypeUpdateAddChatMembersPrivacyForbidden: + return UnmarshalUpdateAddChatMembersPrivacyForbidden(data) + + case TypeUpdateAutosaveSettings: + return UnmarshalUpdateAutosaveSettings(data) + + case TypeUpdateBusinessConnection: + return UnmarshalUpdateBusinessConnection(data) + + case TypeUpdateNewBusinessMessage: + return UnmarshalUpdateNewBusinessMessage(data) + + case TypeUpdateBusinessMessageEdited: + return UnmarshalUpdateBusinessMessageEdited(data) + + case TypeUpdateBusinessMessagesDeleted: + return UnmarshalUpdateBusinessMessagesDeleted(data) + + case TypeUpdateNewInlineQuery: + return UnmarshalUpdateNewInlineQuery(data) + + case TypeUpdateNewChosenInlineResult: + return UnmarshalUpdateNewChosenInlineResult(data) + + case TypeUpdateNewCallbackQuery: + return UnmarshalUpdateNewCallbackQuery(data) + + case TypeUpdateNewInlineCallbackQuery: + return UnmarshalUpdateNewInlineCallbackQuery(data) + + case TypeUpdateNewShippingQuery: + return UnmarshalUpdateNewShippingQuery(data) + + case TypeUpdateNewPreCheckoutQuery: + return UnmarshalUpdateNewPreCheckoutQuery(data) + + case TypeUpdateNewCustomEvent: + return UnmarshalUpdateNewCustomEvent(data) + + case TypeUpdateNewCustomQuery: + return UnmarshalUpdateNewCustomQuery(data) + + case TypeUpdatePoll: + return UnmarshalUpdatePoll(data) + + case TypeUpdatePollAnswer: + return UnmarshalUpdatePollAnswer(data) + + case TypeUpdateChatMember: + return UnmarshalUpdateChatMember(data) + + case TypeUpdateNewChatJoinRequest: + return UnmarshalUpdateNewChatJoinRequest(data) + + case TypeUpdateChatBoost: + return UnmarshalUpdateChatBoost(data) + + case TypeUpdateMessageReaction: + return UnmarshalUpdateMessageReaction(data) + + case TypeUpdateMessageReactions: + return UnmarshalUpdateMessageReactions(data) + + case TypeUpdates: + return UnmarshalUpdates(data) + + case TypeLogStreamDefault: + return UnmarshalLogStreamDefault(data) + + case TypeLogStreamFile: + return UnmarshalLogStreamFile(data) + + case TypeLogStreamEmpty: + return UnmarshalLogStreamEmpty(data) + + case TypeLogVerbosityLevel: + return UnmarshalLogVerbosityLevel(data) + + case TypeLogTags: + return UnmarshalLogTags(data) + + case TypeUserSupportInfo: + return UnmarshalUserSupportInfo(data) + + case TypeTestInt: + return UnmarshalTestInt(data) + + case TypeTestString: + return UnmarshalTestString(data) + + case TypeTestBytes: + return UnmarshalTestBytes(data) + + case TypeTestVectorInt: + return UnmarshalTestVectorInt(data) + + case TypeTestVectorIntObject: + return UnmarshalTestVectorIntObject(data) + + case TypeTestVectorString: + return UnmarshalTestVectorString(data) + + case TypeTestVectorStringObject: + return UnmarshalTestVectorStringObject(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } } diff --git a/cmd/generate-json.go b/cmd/generate-json.go index 94d077b..da9e6d4 100644 --- a/cmd/generate-json.go +++ b/cmd/generate-json.go @@ -1,7 +1,6 @@ package main import ( - "bufio" "encoding/json" "flag" "log" @@ -25,27 +24,23 @@ func main() { resp, err := http.Get("https://raw.githubusercontent.com/tdlib/td/" + version + "/td/generate/scheme/td_api.tl") if err != nil { log.Fatalf("http.Get error: %s", err) - return } defer resp.Body.Close() schema, err := tlparser.Parse(resp.Body) if err != nil { log.Fatalf("schema parse error: %s", err) - return } resp, err = http.Get("https://raw.githubusercontent.com/tdlib/td/" + version + "/td/telegram/Td.cpp") if err != nil { log.Fatalf("http.Get error: %s", err) - return } defer resp.Body.Close() err = tlparser.ParseCode(resp.Body, schema) if err != nil { log.Fatalf("parse code error: %s", err) - return } err = os.MkdirAll(filepath.Dir(outputFilePath), os.ModePerm) @@ -53,16 +48,17 @@ func main() { log.Fatalf("make dir error: %s", filepath.Dir(outputFilePath)) } - file, err := os.OpenFile(outputFilePath, os.O_CREATE|os.O_RDWR|os.O_TRUNC, os.ModePerm) + file, err := os.Create(outputFilePath) if err != nil { log.Fatalf("open file error: %s", err) - return } + defer file.Close() - data, err := json.MarshalIndent(schema, "", strings.Repeat(" ", 4)) + enc := json.NewEncoder(file) + enc.SetIndent("", strings.Repeat(" ", 4)) + err = enc.Encode(schema) if err != nil { - log.Fatalf("json marshal error: %s", err) - return + log.Fatalf("enc.Encode error: %s", err) + } - bufio.NewWriter(file).Write(data) } diff --git a/data/td_api.json b/data/td_api.json index 94a4212..a58a358 100755 --- a/data/td_api.json +++ b/data/td_api.json @@ -91,7 +91,7 @@ }, { "name": "authenticationCodeTypeSms", - "description": "An authentication code is delivered via an SMS message to the specified phone number", + "description": "An authentication code is delivered via an SMS message to the specified phone number; applications may not receive this type of code", "class": "AuthenticationCodeType", "properties": [ { @@ -159,6 +159,45 @@ } ] }, + { + "name": "authenticationCodeTypeFirebaseAndroid", + "description": "An authentication code is delivered via Firebase Authentication to the official Android application", + "class": "AuthenticationCodeType", + "properties": [ + { + "name": "nonce", + "type": "bytes", + "description": "Nonce to pass to the SafetyNet Attestation API" + }, + { + "name": "length", + "type": "int32", + "description": "Length of the code" + } + ] + }, + { + "name": "authenticationCodeTypeFirebaseIos", + "description": "An authentication code is delivered via Firebase Authentication to the official iOS application", + "class": "AuthenticationCodeType", + "properties": [ + { + "name": "receipt", + "type": "string", + "description": "Receipt of successful application token validation to compare with receipt from push notification" + }, + { + "name": "push_timeout", + "type": "int32", + "description": "Time after the next authentication method is supposed to be used if verification push notification isn't received, in seconds" + }, + { + "name": "length", + "type": "int32", + "description": "Length of the code" + } + ] + }, { "name": "authenticationCodeInfo", "description": "Information about the authentication code that was sent", @@ -239,6 +278,30 @@ } ] }, + { + "name": "emailAddressResetStateAvailable", + "description": "Email address can be reset after the given period. Call resetAuthenticationEmailAddress to reset it and allow the user to authorize with a code sent to the user's phone number", + "class": "EmailAddressResetState", + "properties": [ + { + "name": "wait_period", + "type": "int32", + "description": "Time required to wait before the email address can be reset; 0 if the user is subscribed to Telegram Premium" + } + ] + }, + { + "name": "emailAddressResetStatePending", + "description": "Email address reset has already been requested. Call resetAuthenticationEmailAddress to check whether immediate reset is possible", + "class": "EmailAddressResetState", + "properties": [ + { + "name": "reset_in", + "type": "int32", + "description": "Left time before the email address will be reset, in seconds. updateAuthorizationState is not sent when this field changes" + } + ] + }, { "name": "textEntity", "description": "Represents a part of the text that needs to be formatted in some unusual way", @@ -286,7 +349,7 @@ { "name": "entities", "type": "vector\u003ctextEntity\u003e", - "description": "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 can be part of any other entities. All other entities can't contain each other" + "description": "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. BlockQuote entities can't contain other BlockQuote entities. Bold, Italic, Underline, Strikethrough, and Spoiler entities can contain and can be part of any other entities. All other entities can't contain each other" } ] }, @@ -314,7 +377,7 @@ }, { "name": "authorizationStateWaitTdlibParameters", - "description": "Initializetion parameters are needed. Call setTdlibParameters to provide them", + "description": "Initialization parameters are needed. Call setTdlibParameters to provide them", "class": "AuthorizationState", "properties": [] }, @@ -362,9 +425,9 @@ "description": "Information about the sent authentication code" }, { - "name": "next_phone_number_authorization_date", - "type": "int32", - "description": "Point in time (Unix timestamp) when the user will be able to authorize with a code sent to the user's phone number; 0 if unknown" + "name": "email_address_reset_state", + "type": "EmailAddressResetState", + "description": "Reset state of the email address; may be null if the email address can't be reset" } ] }, @@ -419,6 +482,11 @@ "type": "Bool", "description": "True, if a recovery email address has been set up" }, + { + "name": "has_passport_data", + "type": "Bool", + "description": "True, if some Telegram Passport elements were saved" + }, { "name": "recovery_email_address_pattern", "type": "string", @@ -576,7 +644,7 @@ { "name": "id", "type": "string", - "description": "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" + "description": "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 identifier 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" }, { "name": "unique_id", @@ -634,7 +702,7 @@ }, { "name": "inputFileId", - "description": "A file defined by its unique ID", + "description": "A file defined by its unique identifier", "class": "InputFile", "properties": [ { @@ -646,7 +714,7 @@ }, { "name": "inputFileRemote", - "description": "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", + "description": "A file defined by its remote identifier. The remote identifier 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", "class": "InputFile", "properties": [ { @@ -752,7 +820,7 @@ }, { "name": "thumbnailFormatGif", - "description": "The thumbnail is in static GIF format. It will be used only for some bot inline results", + "description": "The thumbnail is in static GIF format. It will be used only for some bot inline query results", "class": "ThumbnailFormat", "properties": [] }, @@ -770,19 +838,19 @@ }, { "name": "thumbnailFormatTgs", - "description": "The thumbnail is in TGS format. It will be used only for TGS sticker sets", + "description": "The thumbnail is in TGS format. It will be used only for sticker sets", "class": "ThumbnailFormat", "properties": [] }, { "name": "thumbnailFormatWebm", - "description": "The thumbnail is in WEBM format. It will be used only for WEBM sticker sets", + "description": "The thumbnail is in WEBM format. It will be used only for sticker sets", "class": "ThumbnailFormat", "properties": [] }, { "name": "thumbnailFormatWebp", - "description": "The thumbnail is in WEBP format. It will be used only for some stickers", + "description": "The thumbnail is in WEBP format. It will be used only for some stickers and sticker sets", "class": "ThumbnailFormat", "properties": [] }, @@ -937,7 +1005,7 @@ { "name": "needs_repainting", "type": "Bool", - "description": "True, if the sticker must be repainted to a text color in messages, the color of the Telegram Premium badge in emoji status, or another appropriate color in other places" + "description": "True, if the sticker must be repainted to a text color in messages, the color of the Telegram Premium badge in emoji status, white color on chat photos, or another appropriate color in other places" } ] }, @@ -1177,10 +1245,15 @@ "description": "Describes a sticker", "class": "Sticker", "properties": [ + { + "name": "id", + "type": "int64", + "description": "Unique sticker identifier within the set; 0 if none" + }, { "name": "set_id", "type": "int64", - "description": "The identifier of the sticker set to which the sticker belongs; 0 if none" + "description": "Identifier of the sticker set to which the sticker belongs; 0 if none" }, { "name": "width", @@ -1363,7 +1436,7 @@ { "name": "sticker", "type": "sticker", - "description": "Sticker for the emoji; may be null if yet unknown for a custom emoji. If the sticker is a custom emoji, it can have arbitrary format different from stickerFormatTgs" + "description": "Sticker for the emoji; may be null if yet unknown for a custom emoji. If the sticker is a custom emoji, then it can have arbitrary format" }, { "name": "sticker_width", @@ -1415,7 +1488,7 @@ { "name": "user_id", "type": "int53", - "description": "Identifier of the user, if known; otherwise 0" + "description": "Identifier of the user, if known; 0 otherwise" } ] }, @@ -1480,7 +1553,7 @@ }, { "name": "game", - "description": "Describes a game", + "description": "Describes a game. Use getInternalLink with internalLinkTypeGame to share the game", "class": "Game", "properties": [ { @@ -1491,7 +1564,7 @@ { "name": "short_name", "type": "string", - "description": "Game short name. To share a game use the URL https://t.me/{bot_username}?game={game_short_name}" + "description": "Game short name" }, { "name": "title", @@ -1520,6 +1593,38 @@ } ] }, + { + "name": "webApp", + "description": "Describes a Web App. Use getInternalLink with internalLinkTypeWebApp to share the Web App", + "class": "WebApp", + "properties": [ + { + "name": "short_name", + "type": "string", + "description": "Web App short name" + }, + { + "name": "title", + "type": "string", + "description": "Web App title" + }, + { + "name": "description", + "type": "string", + "description": "Web App description" + }, + { + "name": "photo", + "type": "photo", + "description": "Web App photo" + }, + { + "name": "animation", + "type": "animation", + "description": "Web App animation; may be null" + } + ] + }, { "name": "poll", "description": "Describes a poll", @@ -1546,9 +1651,9 @@ "description": "Total number of voters, participating in the poll" }, { - "name": "recent_voter_user_ids", - "type": "vector\u003cint53\u003e", - "description": "User identifiers of recent voters, if the poll is non-anonymous" + "name": "recent_voter_ids", + "type": "vector\u003cMessageSender\u003e", + "description": "Identifiers of recent voters, if the poll is non-anonymous" }, { "name": "is_anonymous", @@ -1577,6 +1682,72 @@ } ] }, + { + "name": "background", + "description": "Describes a chat background", + "class": "Background", + "properties": [ + { + "name": "id", + "type": "int64", + "description": "Unique background identifier" + }, + { + "name": "is_default", + "type": "Bool", + "description": "True, if this is one of default backgrounds" + }, + { + "name": "is_dark", + "type": "Bool", + "description": "True, if the background is dark and is recommended to be used with dark theme" + }, + { + "name": "name", + "type": "string", + "description": "Unique background name" + }, + { + "name": "document", + "type": "document", + "description": "Document with the background; may be null. Null only for filled and chat theme backgrounds" + }, + { + "name": "type", + "type": "BackgroundType", + "description": "Type of the background" + } + ] + }, + { + "name": "backgrounds", + "description": "Contains a list of backgrounds", + "class": "Backgrounds", + "properties": [ + { + "name": "backgrounds", + "type": "vector\u003cbackground\u003e", + "description": "A list of backgrounds" + } + ] + }, + { + "name": "chatBackground", + "description": "Describes a background set for a specific chat", + "class": "ChatBackground", + "properties": [ + { + "name": "background", + "type": "background", + "description": "The background" + }, + { + "name": "dark_theme_dimming", + "type": "int32", + "description": "Dimming of the background in dark themes, as a percentage; 0-100. Applied only to Wallpaper and Fill types of background" + } + ] + }, { "name": "profilePhoto", "description": "Describes a user profile photo", @@ -1663,6 +1834,11 @@ "description": "A bot (see https://core.telegram.org/bots)", "class": "UserType", "properties": [ + { + "name": "can_be_edited", + "type": "Bool", + "description": "True, if the bot is owned by the current user and can be edited using the methods toggleBotUsernameIsActive, reorderBotActiveUsernames, setBotProfilePhoto, setBotName, setBotInfoDescription, and setBotInfoShortDescription" + }, { "name": "can_join_groups", "type": "Bool", @@ -1688,10 +1864,15 @@ "type": "Bool", "description": "True, if the location of the user is expected to be sent with every inline query to this bot" }, + { + "name": "can_connect_to_business", + "type": "Bool", + "description": "True, if the bot supports connection to Telegram Business accounts" + }, { "name": "can_be_added_to_attachment_menu", "type": "Bool", - "description": "True, if the bot can be added to attachment menu" + "description": "True, if the bot can be added to attachment or side menu" } ] }, @@ -1769,6 +1950,360 @@ } ] }, + { + "name": "birthdate", + "description": "Represents a birthdate of a user", + "class": "Birthdate", + "properties": [ + { + "name": "day", + "type": "int32", + "description": "Day of the month; 1-31" + }, + { + "name": "month", + "type": "int32", + "description": "Month of the year; 1-12" + }, + { + "name": "year", + "type": "int32", + "description": "Birth year; 0 if unknown" + } + ] + }, + { + "name": "closeBirthdayUser", + "description": "Describes a user that had or will have a birthday soon", + "class": "CloseBirthdayUser", + "properties": [ + { + "name": "user_id", + "type": "int53", + "description": "User identifier" + }, + { + "name": "birthdate", + "type": "birthdate", + "description": "Birthdate of the user" + } + ] + }, + { + "name": "businessAwayMessageScheduleAlways", + "description": "Send away messages always", + "class": "BusinessAwayMessageSchedule", + "properties": [] + }, + { + "name": "businessAwayMessageScheduleOutsideOfOpeningHours", + "description": "Send away messages outside of the business opening hours", + "class": "BusinessAwayMessageSchedule", + "properties": [] + }, + { + "name": "businessAwayMessageScheduleCustom", + "description": "Send away messages only in the specified time span", + "class": "BusinessAwayMessageSchedule", + "properties": [ + { + "name": "start_date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the away messages will start to be sent" + }, + { + "name": "end_date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the away messages will stop to be sent" + } + ] + }, + { + "name": "businessLocation", + "description": "Represents a location of a business", + "class": "BusinessLocation", + "properties": [ + { + "name": "location", + "type": "location", + "description": "The location; may be null if not specified" + }, + { + "name": "address", + "type": "string", + "description": "Location address; 1-96 characters" + } + ] + }, + { + "name": "businessRecipients", + "description": "Describes private chats chosen for automatic interaction with a business", + "class": "BusinessRecipients", + "properties": [ + { + "name": "chat_ids", + "type": "vector\u003cint53\u003e", + "description": "Identifiers of selected private chats" + }, + { + "name": "excluded_chat_ids", + "type": "vector\u003cint53\u003e", + "description": "Identifiers of private chats that are always excluded; for businessConnectedBot only" + }, + { + "name": "select_existing_chats", + "type": "Bool", + "description": "True, if all existing private chats are selected" + }, + { + "name": "select_new_chats", + "type": "Bool", + "description": "True, if all new private chats are selected" + }, + { + "name": "select_contacts", + "type": "Bool", + "description": "True, if all private chats with contacts are selected" + }, + { + "name": "select_non_contacts", + "type": "Bool", + "description": "True, if all private chats with non-contacts are selected" + }, + { + "name": "exclude_selected", + "type": "Bool", + "description": "If true, then all private chats except the selected are chosen. Otherwise, only the selected chats are chosen" + } + ] + }, + { + "name": "businessAwayMessageSettings", + "description": "Describes settings for messages that are automatically sent by a Telegram Business account when it is away", + "class": "BusinessAwayMessageSettings", + "properties": [ + { + "name": "shortcut_id", + "type": "int32", + "description": "Unique quick reply shortcut identifier for the away messages" + }, + { + "name": "recipients", + "type": "businessRecipients", + "description": "Chosen recipients of the away messages" + }, + { + "name": "schedule", + "type": "BusinessAwayMessageSchedule", + "description": "Settings used to check whether the current user is away" + }, + { + "name": "offline_only", + "type": "Bool", + "description": "True, if the messages must not be sent if the account was online in the last 10 minutes" + } + ] + }, + { + "name": "businessGreetingMessageSettings", + "description": "Describes settings for greeting messages that are automatically sent by a Telegram Business account as response to incoming messages in an inactive private chat", + "class": "BusinessGreetingMessageSettings", + "properties": [ + { + "name": "shortcut_id", + "type": "int32", + "description": "Unique quick reply shortcut identifier for the greeting messages" + }, + { + "name": "recipients", + "type": "businessRecipients", + "description": "Chosen recipients of the greeting messages" + }, + { + "name": "inactivity_days", + "type": "int32", + "description": "The number of days after which a chat will be considered as inactive; currently, must be on of 7, 14, 21, or 28" + } + ] + }, + { + "name": "businessConnectedBot", + "description": "Describes a bot connected to a business account", + "class": "BusinessConnectedBot", + "properties": [ + { + "name": "bot_user_id", + "type": "int53", + "description": "User identifier of the bot" + }, + { + "name": "recipients", + "type": "businessRecipients", + "description": "Private chats that will be accessible to the bot" + }, + { + "name": "can_reply", + "type": "Bool", + "description": "True, if the bot can send messages to the private chats; false otherwise" + } + ] + }, + { + "name": "businessIntro", + "description": "Describes settings for a business account intro", + "class": "BusinessIntro", + "properties": [ + { + "name": "title", + "type": "string", + "description": "Title text of the intro" + }, + { + "name": "message", + "type": "string", + "description": "Message text of the intro" + }, + { + "name": "sticker", + "type": "sticker", + "description": "Greeting sticker of the intro; may be null if none" + } + ] + }, + { + "name": "inputBusinessIntro", + "description": "Describes settings for a business account intro to set", + "class": "InputBusinessIntro", + "properties": [ + { + "name": "title", + "type": "string", + "description": "Title text of the intro; 0-getOption(\"business_intro_title_length_max\") characters" + }, + { + "name": "message", + "type": "string", + "description": "Message text of the intro; 0-getOption(\"business_intro_message_length_max\") characters" + }, + { + "name": "sticker", + "type": "InputFile", + "description": "Greeting sticker of the intro; pass null if none. The sticker must belong to a sticker set and must not be a custom emoji" + } + ] + }, + { + "name": "businessOpeningHoursInterval", + "description": "Describes an interval of time when the business is open", + "class": "BusinessOpeningHoursInterval", + "properties": [ + { + "name": "start_minute", + "type": "int32", + "description": "The first minute of the interval since start of the week; 0-7*24*60" + }, + { + "name": "end_minute", + "type": "int32", + "description": "The first minute after the end of the interval since start of the week; 1-8*24*60" + } + ] + }, + { + "name": "businessOpeningHours", + "description": "Describes opening hours of a business", + "class": "BusinessOpeningHours", + "properties": [ + { + "name": "time_zone_id", + "type": "string", + "description": "Unique time zone identifier" + }, + { + "name": "opening_hours", + "type": "vector\u003cbusinessOpeningHoursInterval\u003e", + "description": "Intervals of the time when the business is open" + } + ] + }, + { + "name": "businessInfo", + "description": "Contains information about a Telegram Business account", + "class": "BusinessInfo", + "properties": [ + { + "name": "location", + "type": "businessLocation", + "description": "Location of the business; may be null if none" + }, + { + "name": "opening_hours", + "type": "businessOpeningHours", + "description": "Opening hours of the business; may be null if none. The hours are guaranteed to be valid and has already been split by week days" + }, + { + "name": "greeting_message_settings", + "type": "businessGreetingMessageSettings", + "description": "The greeting message; may be null if none or the Business account is not of the current user" + }, + { + "name": "away_message_settings", + "type": "businessAwayMessageSettings", + "description": "The away message; may be null if none or the Business account is not of the current user" + }, + { + "name": "intro", + "type": "businessIntro", + "description": "Information about intro of the business; may be null if none" + } + ] + }, + { + "name": "chatPhotoStickerTypeRegularOrMask", + "description": "Information about the sticker, which was used to create the chat photo", + "class": "ChatPhotoStickerType", + "properties": [ + { + "name": "sticker_set_id", + "type": "int64", + "description": "Sticker set identifier" + }, + { + "name": "sticker_id", + "type": "int64", + "description": "Identifier of the sticker in the set" + } + ] + }, + { + "name": "chatPhotoStickerTypeCustomEmoji", + "description": "Information about the custom emoji, which was used to create the chat photo", + "class": "ChatPhotoStickerType", + "properties": [ + { + "name": "custom_emoji_id", + "type": "int64", + "description": "Identifier of the custom emoji" + } + ] + }, + { + "name": "chatPhotoSticker", + "description": "Information about the sticker, which was used to create the chat photo. The sticker is shown at the center of the photo and occupies at most 67% of it", + "class": "ChatPhotoSticker", + "properties": [ + { + "name": "type", + "type": "ChatPhotoStickerType", + "description": "Type of the sticker" + }, + { + "name": "background_fill", + "type": "BackgroundFill", + "description": "The fill to be used as background for the sticker; rotation angle in backgroundFillGradient isn't supported" + } + ] + }, { "name": "animatedChatPhoto", "description": "Animated variant of a chat photo in MPEG4 format", @@ -1819,12 +2354,17 @@ { "name": "animation", "type": "animatedChatPhoto", - "description": "A big (640x640) animated variant of the photo in MPEG4 format; may be null" + "description": "A big (up to 1280x1280) animated variant of the photo in MPEG4 format; may be null" }, { "name": "small_animation", "type": "animatedChatPhoto", "description": "A small (160x160) animated variant of the photo in MPEG4 format; may be null even the big animation is available" + }, + { + "name": "sticker", + "type": "chatPhotoSticker", + "description": "Sticker-based version of the chat photo; may be null" } ] }, @@ -1871,7 +2411,7 @@ }, { "name": "inputChatPhotoAnimation", - "description": "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", + "description": "An animation in MPEG4 format; must be square, at most 10 seconds long, have width between 160 and 1280 and be at most 2MB in size", "class": "InputChatPhoto", "properties": [ { @@ -1886,35 +2426,72 @@ } ] }, + { + "name": "inputChatPhotoSticker", + "description": "A sticker on a custom background", + "class": "InputChatPhoto", + "properties": [ + { + "name": "sticker", + "type": "chatPhotoSticker", + "description": "Information about the sticker" + } + ] + }, { "name": "chatPermissions", "description": "Describes actions that a user is allowed to take in a chat", "class": "ChatPermissions", "properties": [ { - "name": "can_send_messages", + "name": "can_send_basic_messages", "type": "Bool", - "description": "True, if the user can send text messages, contacts, locations, and venues" + "description": "True, if the user can send text messages, contacts, giveaways, giveaway winners, invoices, locations, and venues" }, { - "name": "can_send_media_messages", + "name": "can_send_audios", "type": "Bool", - "description": "True, if the user can send audio files, documents, photos, videos, video notes, and voice notes. Implies can_send_messages permissions" + "description": "True, if the user can send music files" + }, + { + "name": "can_send_documents", + "type": "Bool", + "description": "True, if the user can send documents" + }, + { + "name": "can_send_photos", + "type": "Bool", + "description": "True, if the user can send photos" + }, + { + "name": "can_send_videos", + "type": "Bool", + "description": "True, if the user can send videos" + }, + { + "name": "can_send_video_notes", + "type": "Bool", + "description": "True, if the user can send video notes" + }, + { + "name": "can_send_voice_notes", + "type": "Bool", + "description": "True, if the user can send voice notes" }, { "name": "can_send_polls", "type": "Bool", - "description": "True, if the user can send polls. Implies can_send_messages permissions" + "description": "True, if the user can send polls" }, { "name": "can_send_other_messages", "type": "Bool", - "description": "True, if the user can send animations, games, stickers, and dice and use inline bots. Implies can_send_messages permissions" + "description": "True, if the user can send animations, games, stickers, and dice and use inline bots" }, { "name": "can_add_web_page_previews", "type": "Bool", - "description": "True, if the user may add a web page preview to their messages. Implies can_send_messages permissions" + "description": "True, if the user may add a web page preview to their messages" }, { "name": "can_change_info", @@ -1932,9 +2509,9 @@ "description": "True, if the user can pin messages" }, { - "name": "can_manage_topics", + "name": "can_create_topics", "type": "Bool", - "description": "True, if the user can manage topics" + "description": "True, if the user can create topics" } ] }, @@ -1946,7 +2523,7 @@ { "name": "can_manage_chat", "type": "Bool", - "description": "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" + "description": "True, if the administrator can access the chat event log, get boost list, see hidden supergroup and channel members, report supergroup spam messages and ignore slow mode. Implied by any other privilege; applicable to supergroups and channels only" }, { "name": "can_change_info", @@ -1956,7 +2533,7 @@ { "name": "can_post_messages", "type": "Bool", - "description": "True, if the administrator can create channel posts; applicable to channels only" + "description": "True, if the administrator can create channel posts or view channel statistics; applicable to channels only" }, { "name": "can_edit_messages", @@ -1976,7 +2553,7 @@ { "name": "can_restrict_members", "type": "Bool", - "description": "True, if the administrator can restrict, ban, or unban chat members; always true for channels" + "description": "True, if the administrator can restrict, ban, or unban chat members or view supergroup statistics; always true for channels" }, { "name": "can_pin_messages", @@ -1986,7 +2563,7 @@ { "name": "can_manage_topics", "type": "Bool", - "description": "True, if the administrator can manage topics; applicable to forum supergroups only" + "description": "True, if the administrator can create, rename, close, reopen, hide, and unhide forum topics; applicable to forum supergroups only" }, { "name": "can_promote_members", @@ -1998,6 +2575,21 @@ "type": "Bool", "description": "True, if the administrator can manage video chats" }, + { + "name": "can_post_stories", + "type": "Bool", + "description": "True, if the administrator can create new chat stories, or edit and delete posted stories; applicable to supergroups and channels only" + }, + { + "name": "can_edit_stories", + "type": "Bool", + "description": "True, if the administrator can edit stories posted by other users, pin stories and access story archive; applicable to supergroups and channels only" + }, + { + "name": "can_delete_stories", + "type": "Bool", + "description": "True, if the administrator can delete stories posted by other users; applicable to supergroups and channels only" + }, { "name": "is_anonymous", "type": "Bool", @@ -2028,7 +2620,7 @@ { "name": "month_count", "type": "int32", - "description": "Number of month the Telegram Premium subscription will be active" + "description": "Number of months the Telegram Premium subscription will be active" }, { "name": "store_product_id", @@ -2042,6 +2634,317 @@ } ] }, + { + "name": "premiumStatePaymentOption", + "description": "Describes an option for buying or upgrading Telegram Premium for self", + "class": "PremiumStatePaymentOption", + "properties": [ + { + "name": "payment_option", + "type": "premiumPaymentOption", + "description": "Information about the payment option" + }, + { + "name": "is_current", + "type": "Bool", + "description": "True, if this is the currently used Telegram Premium subscription option" + }, + { + "name": "is_upgrade", + "type": "Bool", + "description": "True, if the payment option can be used to upgrade the existing Telegram Premium subscription" + }, + { + "name": "last_transaction_id", + "type": "string", + "description": "Identifier of the last in-store transaction for the currently used option" + } + ] + }, + { + "name": "premiumGiftCodePaymentOption", + "description": "Describes an option for creating Telegram Premium gift codes", + "class": "PremiumGiftCodePaymentOption", + "properties": [ + { + "name": "currency", + "type": "string", + "description": "ISO 4217 currency code for Telegram Premium gift code payment" + }, + { + "name": "amount", + "type": "int53", + "description": "The amount to pay, in the smallest units of the currency" + }, + { + "name": "user_count", + "type": "int32", + "description": "Number of users which will be able to activate the gift codes" + }, + { + "name": "month_count", + "type": "int32", + "description": "Number of months the Telegram Premium subscription will be active" + }, + { + "name": "store_product_id", + "type": "string", + "description": "Identifier of the store product associated with the option; may be empty if none" + }, + { + "name": "store_product_quantity", + "type": "int32", + "description": "Number of times the store product must be paid" + } + ] + }, + { + "name": "premiumGiftCodePaymentOptions", + "description": "Contains a list of options for creating Telegram Premium gift codes", + "class": "PremiumGiftCodePaymentOptions", + "properties": [ + { + "name": "options", + "type": "vector\u003cpremiumGiftCodePaymentOption\u003e", + "description": "The list of options" + } + ] + }, + { + "name": "premiumGiftCodeInfo", + "description": "Contains information about a Telegram Premium gift code", + "class": "PremiumGiftCodeInfo", + "properties": [ + { + "name": "creator_id", + "type": "MessageSender", + "description": "Identifier of a chat or a user that created the gift code; may be null if unknown. If null and the code is from messagePremiumGiftCode message, then creator_id from the message can be used" + }, + { + "name": "creation_date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the code was created" + }, + { + "name": "is_from_giveaway", + "type": "Bool", + "description": "True, if the gift code was created for a giveaway" + }, + { + "name": "giveaway_message_id", + "type": "int53", + "description": "Identifier of the corresponding giveaway message in the creator_id chat; can be 0 or an identifier of a deleted message" + }, + { + "name": "month_count", + "type": "int32", + "description": "Number of months the Telegram Premium subscription will be active after code activation" + }, + { + "name": "user_id", + "type": "int53", + "description": "Identifier of a user for which the code was created; 0 if none" + }, + { + "name": "use_date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the code was activated; 0 if none" + } + ] + }, + { + "name": "premiumGiveawayParticipantStatusEligible", + "description": "The user is eligible for the giveaway", + "class": "PremiumGiveawayParticipantStatus", + "properties": [] + }, + { + "name": "premiumGiveawayParticipantStatusParticipating", + "description": "The user participates in the giveaway", + "class": "PremiumGiveawayParticipantStatus", + "properties": [] + }, + { + "name": "premiumGiveawayParticipantStatusAlreadyWasMember", + "description": "The user can't participate in the giveaway, because they have already been member of the chat", + "class": "PremiumGiveawayParticipantStatus", + "properties": [ + { + "name": "joined_chat_date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the user joined the chat" + } + ] + }, + { + "name": "premiumGiveawayParticipantStatusAdministrator", + "description": "The user can't participate in the giveaway, because they are an administrator in one of the chats that created the giveaway", + "class": "PremiumGiveawayParticipantStatus", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat administered by the user" + } + ] + }, + { + "name": "premiumGiveawayParticipantStatusDisallowedCountry", + "description": "The user can't participate in the giveaway, because they phone number is from a disallowed country", + "class": "PremiumGiveawayParticipantStatus", + "properties": [ + { + "name": "user_country_code", + "type": "string", + "description": "A two-letter ISO 3166-1 alpha-2 country code of the user's country" + } + ] + }, + { + "name": "premiumGiveawayInfoOngoing", + "description": "Describes an ongoing giveaway", + "class": "PremiumGiveawayInfo", + "properties": [ + { + "name": "creation_date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the giveaway was created" + }, + { + "name": "status", + "type": "PremiumGiveawayParticipantStatus", + "description": "Status of the current user in the giveaway" + }, + { + "name": "is_ended", + "type": "Bool", + "description": "True, if the giveaway has ended and results are being prepared" + } + ] + }, + { + "name": "premiumGiveawayInfoCompleted", + "description": "Describes a completed giveaway", + "class": "PremiumGiveawayInfo", + "properties": [ + { + "name": "creation_date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the giveaway was created" + }, + { + "name": "actual_winners_selection_date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the winners were selected. May be bigger than winners selection date specified in parameters of the giveaway" + }, + { + "name": "was_refunded", + "type": "Bool", + "description": "True, if the giveaway was canceled and was fully refunded" + }, + { + "name": "winner_count", + "type": "int32", + "description": "Number of winners in the giveaway" + }, + { + "name": "activation_count", + "type": "int32", + "description": "Number of winners, which activated their gift codes" + }, + { + "name": "gift_code", + "type": "string", + "description": "Telegram Premium gift code that was received by the current user; empty if the user isn't a winner in the giveaway" + } + ] + }, + { + "name": "accentColor", + "description": "Contains information about supported accent color for user/chat name, background of empty chat photo, replies to messages and link previews", + "class": "AccentColor", + "properties": [ + { + "name": "id", + "type": "int32", + "description": "Accent color identifier" + }, + { + "name": "built_in_accent_color_id", + "type": "int32", + "description": "Identifier of a built-in color to use in places, where only one color is needed; 0-6" + }, + { + "name": "light_theme_colors", + "type": "vector\u003cint32\u003e", + "description": "The list of 1-3 colors in RGB format, describing the accent color, as expected to be shown in light themes" + }, + { + "name": "dark_theme_colors", + "type": "vector\u003cint32\u003e", + "description": "The list of 1-3 colors in RGB format, describing the accent color, as expected to be shown in dark themes" + }, + { + "name": "min_channel_chat_boost_level", + "type": "int32", + "description": "The minimum chat boost level required to use the color in a channel chat" + } + ] + }, + { + "name": "profileAccentColors", + "description": "Contains information about supported accent colors for user profile photo background in RGB format", + "class": "ProfileAccentColors", + "properties": [ + { + "name": "palette_colors", + "type": "vector\u003cint32\u003e", + "description": "The list of 1-2 colors in RGB format, describing the colors, as expected to be shown in the color palette settings" + }, + { + "name": "background_colors", + "type": "vector\u003cint32\u003e", + "description": "The list of 1-2 colors in RGB format, describing the colors, as expected to be used for the profile photo background" + }, + { + "name": "story_colors", + "type": "vector\u003cint32\u003e", + "description": "The list of 2 colors in RGB format, describing the colors of the gradient to be used for the unread active story indicator around profile photo" + } + ] + }, + { + "name": "profileAccentColor", + "description": "Contains information about supported accent color for user profile photo background", + "class": "ProfileAccentColor", + "properties": [ + { + "name": "id", + "type": "int32", + "description": "Profile accent color identifier" + }, + { + "name": "light_theme_colors", + "type": "profileAccentColors", + "description": "Accent colors expected to be used in light themes" + }, + { + "name": "dark_theme_colors", + "type": "profileAccentColors", + "description": "Accent colors expected to be used in dark themes" + }, + { + "name": "min_supergroup_chat_boost_level", + "type": "int32", + "description": "The minimum chat boost level required to use the color in a supergroup chat" + }, + { + "name": "min_channel_chat_boost_level", + "type": "int32", + "description": "The minimum chat boost level required to use the color in a channel chat" + } + ] + }, { "name": "emojiStatus", "description": "Describes a custom emoji to be shown instead of the Telegram Premium badge", @@ -2051,18 +2954,23 @@ "name": "custom_emoji_id", "type": "int64", "description": "Identifier of the custom emoji in stickerFormatTgs format" + }, + { + "name": "expiration_date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the status will expire; 0 if never" } ] }, { "name": "emojiStatuses", - "description": "Contains a list of emoji statuses", + "description": "Contains a list of custom emoji identifiers for emoji statuses", "class": "EmojiStatuses", "properties": [ { - "name": "emoji_statuses", - "type": "vector\u003cemojiStatus\u003e", - "description": "The list of emoji statuses" + "name": "custom_emoji_ids", + "type": "vector\u003cint64\u003e", + "description": "The list of custom emoji identifiers" } ] }, @@ -2074,17 +2982,17 @@ { "name": "active_usernames", "type": "vector\u003cstring\u003e", - "description": "List of active usernames; the first one must be shown as the primary username. The order of active usernames can be changed with reorderActiveUsernames or reorderSupergroupActiveUsernames" + "description": "List of active usernames; the first one must be shown as the primary username. The order of active usernames can be changed with reorderActiveUsernames, reorderBotActiveUsernames or reorderSupergroupActiveUsernames" }, { "name": "disabled_usernames", "type": "vector\u003cstring\u003e", - "description": "List of currently disabled usernames; the username can be activated with toggleUsernameIsActive/toggleSupergroupUsernameIsActive" + "description": "List of currently disabled usernames; the username can be activated with toggleUsernameIsActive, toggleBotUsernameIsActive, or toggleSupergroupUsernameIsActive" }, { "name": "editable_username", "type": "string", - "description": "The active username, which can be changed with setUsername/setSupergroupUsername" + "description": "The active username, which can be changed with setUsername or setSupergroupUsername. Information about other active usernames can be received using getCollectibleItemInfo" } ] }, @@ -2128,6 +3036,26 @@ "type": "profilePhoto", "description": "Profile photo of the user; may be null" }, + { + "name": "accent_color_id", + "type": "int32", + "description": "Identifier of the accent color for name, and backgrounds of profile photo, reply header, and link preview. For Telegram Premium users only" + }, + { + "name": "background_custom_emoji_id", + "type": "int64", + "description": "Identifier of a custom emoji to be shown on the reply header and link preview background; 0 if none. For Telegram Premium users only" + }, + { + "name": "profile_accent_color_id", + "type": "int32", + "description": "Identifier of the accent color for the user's profile; -1 if none. For Telegram Premium users only" + }, + { + "name": "profile_background_custom_emoji_id", + "type": "int64", + "description": "Identifier of a custom emoji to be shown on the background of the user's profile; 0 if none. For Telegram Premium users only" + }, { "name": "emoji_status", "type": "emojiStatus", @@ -2143,6 +3071,11 @@ "type": "Bool", "description": "The user is a contact of the current user and the current user is a contact of the user" }, + { + "name": "is_close_friend", + "type": "Bool", + "description": "The user is a close friend of the current user; implies that the user is a contact" + }, { "name": "is_verified", "type": "Bool", @@ -2173,6 +3106,21 @@ "type": "Bool", "description": "True, if many users reported this user as a fake account" }, + { + "name": "has_active_stories", + "type": "Bool", + "description": "True, if the user has non-expired stories available to the current user" + }, + { + "name": "has_unread_active_stories", + "type": "Bool", + "description": "True, if the user has unread non-expired stories available to the current user" + }, + { + "name": "restricts_new_chats", + "type": "Bool", + "description": "True, if the user may restrict new chats with non-contacts. Use canSendMessageToUser to check whether the current user can message the user or try to create a chat with them" + }, { "name": "have_access", "type": "Bool", @@ -2201,7 +3149,7 @@ "class": "BotInfo", "properties": [ { - "name": "share_text", + "name": "short_description", "type": "string", "description": "The text that is shown on the bot's profile page and is sent together with the link when users share the bot" }, @@ -2239,6 +3187,26 @@ "name": "default_channel_administrator_rights", "type": "chatAdministratorRights", "description": "Default administrator rights for adding the bot to channels; may be null" + }, + { + "name": "edit_commands_link", + "type": "InternalLinkType", + "description": "The internal link, which can be used to edit bot commands; may be null" + }, + { + "name": "edit_description_link", + "type": "InternalLinkType", + "description": "The internal link, which can be used to edit bot description; may be null" + }, + { + "name": "edit_description_media_link", + "type": "InternalLinkType", + "description": "The internal link, which can be used to edit the photo or animation shown in the chat with the bot if the chat is empty; may be null" + }, + { + "name": "edit_settings_link", + "type": "InternalLinkType", + "description": "The internal link, which can be used to edit bot settings; may be null" } ] }, @@ -2250,22 +3218,22 @@ { "name": "personal_photo", "type": "chatPhoto", - "description": "User profile photo set by the current user for the contact; may be null. If null and user.profile_photo is null, then the photo is empty, otherwise unknown. If non-null, then it is the same photo as in user.profile_photo and chat.photo. This photo isn't returned in the list of user photos" + "description": "User profile photo set by the current user for the contact; may be null. If null and user.profile_photo is null, then the photo is empty; otherwise, it is unknown. If non-null, then it is the same photo as in user.profile_photo and chat.photo. This photo isn't returned in the list of user photos" }, { "name": "photo", "type": "chatPhoto", - "description": "User profile photo; may be null. If null and user.profile_photo is null, then the photo is empty, otherwise unknown. If non-null and personal_photo is null, then it is the same photo as in user.profile_photo and chat.photo" + "description": "User profile photo; may be null. If null and user.profile_photo is null, then the photo is empty; otherwise, it is unknown. If non-null and personal_photo is null, then it is the same photo as in user.profile_photo and chat.photo" }, { "name": "public_photo", "type": "chatPhoto", - "description": "User profile photo visible if the main photo is hidden by privacy settings; may be null. If null and user.profile_photo is null, then the photo is empty, otherwise unknown. If non-null and both photo and personal_photo are null, then it is the same photo as in user.profile_photo and chat.photo. This photo isn't returned in the list of user photos" + "description": "User profile photo visible if the main photo is hidden by privacy settings; may be null. If null and user.profile_photo is null, then the photo is empty; otherwise, it is unknown. If non-null and both photo and personal_photo are null, then it is the same photo as in user.profile_photo and chat.photo. This photo isn't returned in the list of user photos" }, { - "name": "is_blocked", - "type": "Bool", - "description": "True, if the user is blocked by the current user" + "name": "block_list", + "type": "BlockList", + "description": "Block list to which the user is added; may be null if none" }, { "name": "can_be_called", @@ -2292,16 +3260,36 @@ "type": "Bool", "description": "True, if voice and video notes can't be sent or forwarded to the user" }, + { + "name": "has_pinned_stories", + "type": "Bool", + "description": "True, if the user has pinned stories" + }, { "name": "need_phone_number_privacy_exception", "type": "Bool", "description": "True, if the current user needs to explicitly allow to share their phone number with the user when the method addContact is used" }, + { + "name": "set_chat_background", + "type": "Bool", + "description": "True, if the user set chat background for both chat users and it wasn't reverted yet" + }, { "name": "bio", "type": "formattedText", "description": "A short user bio; may be null for bots" }, + { + "name": "birthdate", + "type": "birthdate", + "description": "Birthdate of the user; may be null if unknown" + }, + { + "name": "personal_chat_id", + "type": "int53", + "description": "Identifier of the personal chat of the user; 0 if none" + }, { "name": "premium_gift_options", "type": "vector\u003cpremiumPaymentOption\u003e", @@ -2312,10 +3300,15 @@ "type": "int32", "description": "Number of group chats where both the other user and the current user are a member; 0 for the current user" }, + { + "name": "business_info", + "type": "businessInfo", + "description": "Information about business settings for Telegram Business accounts; may be null if none" + }, { "name": "bot_info", "type": "botInfo", - "description": "For bots, information about the bot; may be null" + "description": "For bots, information about the bot; may be null if the user isn't a bot" } ] }, @@ -2768,6 +3761,11 @@ "type": "int32", "description": "Point in time (Unix timestamp) when the user joined the chat" }, + { + "name": "via_chat_folder_invite_link", + "type": "Bool", + "description": "True, if the user has joined the chat using an invite link for a chat folder" + }, { "name": "approver_user_id", "type": "int53", @@ -2792,6 +3790,24 @@ } ] }, + { + "name": "inviteLinkChatTypeBasicGroup", + "description": "The link is an invite link for a basic group", + "class": "InviteLinkChatType", + "properties": [] + }, + { + "name": "inviteLinkChatTypeSupergroup", + "description": "The link is an invite link for a supergroup", + "class": "InviteLinkChatType", + "properties": [] + }, + { + "name": "inviteLinkChatTypeChannel", + "description": "The link is an invite link for a channel", + "class": "InviteLinkChatType", + "properties": [] + }, { "name": "chatInviteLinkInfo", "description": "Contains information about a chat invite link", @@ -2809,7 +3825,7 @@ }, { "name": "type", - "type": "ChatType", + "type": "InviteLinkChatType", "description": "Type of the chat" }, { @@ -2822,6 +3838,11 @@ "type": "chatPhotoInfo", "description": "Chat photo; may be null" }, + { + "name": "accent_color_id", + "type": "int32", + "description": "Identifier of the accent color for chat title and background of chat photo" + }, { "name": "description", "type": "string", @@ -2846,6 +3867,21 @@ "name": "is_public", "type": "Bool", "description": "True, if the chat is a public supergroup or channel, i.e. it has a username or it is a location-based supergroup" + }, + { + "name": "is_verified", + "type": "Bool", + "description": "True, if the chat is verified" + }, + { + "name": "is_scam", + "type": "Bool", + "description": "True, if many users reported this chat as a scam" + }, + { + "name": "is_fake", + "type": "Bool", + "description": "True, if many users reported this chat as a fake account" } ] }, @@ -3012,7 +4048,12 @@ { "name": "member_count", "type": "int32", - "description": "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" + "description": "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 getChatSimilarChats, getChatsToSendStories, getCreatedPublicChats, getGroupsInCommon, getInactiveSupergroupChats, getSuitableDiscussionChats, getUserPrivacySettingRules, getVideoChatAvailableParticipants, searchChatsNearby, searchPublicChats, or in chatFolderInviteLinkInfo.missing_chat_ids, or for public chats in which where sent messages and posted stories from publicForwards, or for public chats in which where sent messages from getMessagePublicForwards response" + }, + { + "name": "boost_level", + "type": "int32", + "description": "Approximate boost level for the chat" }, { "name": "has_linked_chat", @@ -3057,7 +4098,7 @@ { "name": "is_forum", "type": "Bool", - "description": "True, if the supergroup must be shown as a forum by default" + "description": "True, if the supergroup is a forum with topics" }, { "name": "is_verified", @@ -3078,6 +4119,16 @@ "name": "is_fake", "type": "Bool", "description": "True, if many users reported this supergroup or channel as a fake account" + }, + { + "name": "has_active_stories", + "type": "Bool", + "description": "True, if the supergroup or channel has non-expired stories available to the current user" + }, + { + "name": "has_unread_active_stories", + "type": "Bool", + "description": "True, if the supergroup or channel has unread non-expired stories available to the current user" } ] }, @@ -3146,11 +4197,6 @@ "type": "Bool", "description": "True, if non-administrators and non-bots can be hidden in responses to getSupergroupMembers and searchChatMembers for non-administrators" }, - { - "name": "can_set_username", - "type": "Bool", - "description": "True, if the chat username can be changed" - }, { "name": "can_set_sticker_set", "type": "Bool", @@ -3181,15 +4227,35 @@ "type": "Bool", "description": "True, if aggressive anti-spam checks are enabled in the supergroup. The value of this field is only available to chat administrators" }, + { + "name": "has_pinned_stories", + "type": "Bool", + "description": "True, if the supergroup or channel has pinned stories" + }, + { + "name": "my_boost_count", + "type": "int32", + "description": "Number of times the current user boosted the supergroup or channel" + }, + { + "name": "unrestrict_boost_count", + "type": "int32", + "description": "Number of times the supergroup must be boosted by a user to ignore slow mode and chat permission restrictions; 0 if unspecified" + }, { "name": "sticker_set_id", "type": "int64", - "description": "Identifier of the supergroup sticker set; 0 if none" + "description": "Identifier of the supergroup sticker set that must be shown before user sticker sets; 0 if none" + }, + { + "name": "custom_emoji_sticker_set_id", + "type": "int64", + "description": "Identifier of the custom emoji sticker set that can be used in the supergroup without Telegram Premium subscription; 0 if none" }, { "name": "location", "type": "chatLocation", - "description": "Location to which the supergroup is connected; may be null" + "description": "Location to which the supergroup is connected; may be null if none" }, { "name": "invite_link", @@ -3254,7 +4320,7 @@ { "name": "is_outbound", "type": "Bool", - "description": "True, if the chat was created by the current user; otherwise false" + "description": "True, if the chat was created by the current user; false otherwise" }, { "name": "key_hash", @@ -3317,7 +4383,7 @@ { "name": "sender", "type": "MessageSender", - "description": "Available message senders" + "description": "The message sender" }, { "name": "needs_premium", @@ -3339,9 +4405,74 @@ ] }, { - "name": "messageForwardOriginUser", + "name": "messageReadDateRead", + "description": "Contains read date of the message", + "class": "MessageReadDate", + "properties": [ + { + "name": "read_date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the message was read by the other user" + } + ] + }, + { + "name": "messageReadDateUnread", + "description": "The message is unread yet", + "class": "MessageReadDate", + "properties": [] + }, + { + "name": "messageReadDateTooOld", + "description": "The message is too old to get read date", + "class": "MessageReadDate", + "properties": [] + }, + { + "name": "messageReadDateUserPrivacyRestricted", + "description": "The read date is unknown due to privacy settings of the other user", + "class": "MessageReadDate", + "properties": [] + }, + { + "name": "messageReadDateMyPrivacyRestricted", + "description": "The read date is unknown due to privacy settings of the current user, but will be known if the user subscribes to Telegram Premium", + "class": "MessageReadDate", + "properties": [] + }, + { + "name": "messageViewer", + "description": "Represents a viewer of a message", + "class": "MessageViewer", + "properties": [ + { + "name": "user_id", + "type": "int53", + "description": "User identifier of the viewer" + }, + { + "name": "view_date", + "type": "int32", + "description": "Approximate point in time (Unix timestamp) when the message was viewed" + } + ] + }, + { + "name": "messageViewers", + "description": "Represents a list of message viewers", + "class": "MessageViewers", + "properties": [ + { + "name": "viewers", + "type": "vector\u003cmessageViewer\u003e", + "description": "List of message viewers" + } + ] + }, + { + "name": "messageOriginUser", "description": "The message was originally sent by a known user", - "class": "MessageForwardOrigin", + "class": "MessageOrigin", "properties": [ { "name": "sender_user_id", @@ -3351,9 +4482,21 @@ ] }, { - "name": "messageForwardOriginChat", + "name": "messageOriginHiddenUser", + "description": "The message was originally sent by a user, which is hidden by their privacy settings", + "class": "MessageOrigin", + "properties": [ + { + "name": "sender_name", + "type": "string", + "description": "Name of the sender" + } + ] + }, + { + "name": "messageOriginChat", "description": "The message was originally sent on behalf of a chat", - "class": "MessageForwardOrigin", + "class": "MessageOrigin", "properties": [ { "name": "sender_chat_id", @@ -3368,26 +4511,14 @@ ] }, { - "name": "messageForwardOriginHiddenUser", - "description": "The message was originally sent by a user, which is hidden by their privacy settings", - "class": "MessageForwardOrigin", - "properties": [ - { - "name": "sender_name", - "type": "string", - "description": "Name of the sender" - } - ] - }, - { - "name": "messageForwardOriginChannel", + "name": "messageOriginChannel", "description": "The message was originally a post in a channel", - "class": "MessageForwardOrigin", + "class": "MessageOrigin", "properties": [ { "name": "chat_id", "type": "int53", - "description": "Identifier of the chat from which the message was originally forwarded" + "description": "Identifier of the channel chat to which the message was originally sent" }, { "name": "message_id", @@ -3402,14 +4533,39 @@ ] }, { - "name": "messageForwardOriginMessageImport", - "description": "The message was imported from an exported message history", - "class": "MessageForwardOrigin", + "name": "forwardSource", + "description": "Contains information about the last message from which a new message was forwarded last time", + "class": "ForwardSource", "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat to which the message that was forwarded belonged; may be 0 if unknown" + }, + { + "name": "message_id", + "type": "int53", + "description": "Identifier of the message; may be 0 if unknown" + }, + { + "name": "sender_id", + "type": "MessageSender", + "description": "Identifier of the sender of the message; may be null if unknown or the new message was forwarded not to Saved Messages" + }, { "name": "sender_name", "type": "string", - "description": "Name of the sender" + "description": "Name of the sender of the message if the sender is hidden by their privacy settings" + }, + { + "name": "date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the message is sent; 0 if unknown" + }, + { + "name": "is_outgoing", + "type": "Bool", + "description": "True, if the message that was forwarded is outgoing; always false if sender is unknown" } ] }, @@ -3444,28 +4600,40 @@ "properties": [ { "name": "origin", - "type": "MessageForwardOrigin", - "description": "Origin of a forwarded message" + "type": "MessageOrigin", + "description": "Origin of the forwarded message" }, { "name": "date", "type": "int32", "description": "Point in time (Unix timestamp) when the message was originally sent" }, + { + "name": "source", + "type": "forwardSource", + "description": "For messages forwarded to the chat with the current user (Saved Messages), to the Replies bot chat, or to the channel's discussion group, information about the source message from which the message was forwarded last time; may be null for other forwards or if unknown" + }, { "name": "public_service_announcement_type", "type": "string", "description": "The type of a public service announcement for the forwarded message" + } + ] + }, + { + "name": "messageImportInfo", + "description": "Contains information about a message created with importMessages", + "class": "MessageImportInfo", + "properties": [ + { + "name": "sender_name", + "type": "string", + "description": "Name of the original sender" }, { - "name": "from_chat_id", - "type": "int53", - "description": "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" - }, - { - "name": "from_message_id", - "type": "int53", - "description": "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" + "name": "date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the message was originally sent" } ] }, @@ -3521,6 +4689,11 @@ "type": "Bool", "description": "True, if the reaction is chosen by the current user" }, + { + "name": "used_sender_id", + "type": "MessageSender", + "description": "Identifier of the message sender used by the current user to add the reaction; may be null if unknown or the reaction isn't chosen" + }, { "name": "recent_sender_ids", "type": "vector\u003cMessageSender\u003e", @@ -3528,6 +4701,23 @@ } ] }, + { + "name": "messageReactions", + "description": "Contains a list of reactions added to a message", + "class": "MessageReactions", + "properties": [ + { + "name": "reactions", + "type": "vector\u003cmessageReaction\u003e", + "description": "List of added reactions" + }, + { + "name": "are_tags", + "type": "Bool", + "description": "True, if the reactions are tags and Telegram Premium users can filter messages by them" + } + ] + }, { "name": "messageInteractionInfo", "description": "Contains information about interactions with a message", @@ -3550,8 +4740,8 @@ }, { "name": "reactions", - "type": "vector\u003cmessageReaction\u003e", - "description": "The list of reactions added to the message" + "type": "messageReactions", + "description": "The list of reactions or tags added to the message; may be null" } ] }, @@ -3581,7 +4771,13 @@ "name": "messageSendingStatePending", "description": "The message is being sent now, but has not yet been delivered to the server", "class": "MessageSendingState", - "properties": [] + "properties": [ + { + "name": "sending_id", + "type": "int32", + "description": "Non-persistent message sending identifier, specified by the application" + } + ] }, { "name": "messageSendingStateFailed", @@ -3589,14 +4785,9 @@ "class": "MessageSendingState", "properties": [ { - "name": "error_code", - "type": "int32", - "description": "An error code; 0 if unknown" - }, - { - "name": "error_message", - "type": "string", - "description": "Error message" + "name": "error", + "type": "error", + "description": "The cause of the message sending failure" }, { "name": "can_retry", @@ -3608,6 +4799,16 @@ "type": "Bool", "description": "True, if the message can be re-sent only on behalf of a different sender" }, + { + "name": "need_another_reply_quote", + "type": "Bool", + "description": "True, if the message can be re-sent only if another quote is chosen in the message that is replied by the given message" + }, + { + "name": "need_drop_reply", + "type": "Bool", + "description": "True, if the message can be re-sent only if the message to be replied is removed. This will be done automatically by resendMessages" + }, { "name": "retry_after", "type": "double", @@ -3615,6 +4816,138 @@ } ] }, + { + "name": "textQuote", + "description": "Describes manually or automatically chosen quote from another message", + "class": "TextQuote", + "properties": [ + { + "name": "text", + "type": "formattedText", + "description": "Text of the quote. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities can be present in the text" + }, + { + "name": "position", + "type": "int32", + "description": "Approximate quote position in the original message in UTF-16 code units as specified by the message sender" + }, + { + "name": "is_manual", + "type": "Bool", + "description": "True, if the quote was manually chosen by the message sender" + } + ] + }, + { + "name": "inputTextQuote", + "description": "Describes manually chosen quote from another message", + "class": "InputTextQuote", + "properties": [ + { + "name": "text", + "type": "formattedText", + "description": "Text of the quote; 0-getOption(\"message_reply_quote_length_max\") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities are allowed to be kept and must be kept in the quote" + }, + { + "name": "position", + "type": "int32", + "description": "Quote position in the original message in UTF-16 code units" + } + ] + }, + { + "name": "messageReplyToMessage", + "description": "Describes a message replied by a given message", + "class": "MessageReplyTo", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "The identifier of the chat to which the message belongs; may be 0 if the replied message is in unknown chat" + }, + { + "name": "message_id", + "type": "int53", + "description": "The identifier of the message; may be 0 if the replied message is in unknown chat" + }, + { + "name": "quote", + "type": "textQuote", + "description": "Chosen quote from the replied message; may be null if none" + }, + { + "name": "origin", + "type": "MessageOrigin", + "description": "Information about origin of the message if the message was from another chat or topic; may be null for messages from the same chat" + }, + { + "name": "origin_send_date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the message was sent if the message was from another chat or topic; 0 for messages from the same chat" + }, + { + "name": "content", + "type": "MessageContent", + "description": "Media content of the message if the message was from another chat or topic; may be null for messages from the same chat and messages without media. Can be only one of the following types: messageAnimation, messageAudio, messageContact, messageDice, messageDocument, messageGame, messageInvoice, messageLocation, messagePhoto, messagePoll, messagePremiumGiveaway, messagePremiumGiveawayWinners, messageSticker, messageStory, messageText (for link preview), messageVenue, messageVideo, messageVideoNote, or messageVoiceNote" + } + ] + }, + { + "name": "messageReplyToStory", + "description": "Describes a story replied by a given message", + "class": "MessageReplyTo", + "properties": [ + { + "name": "story_sender_chat_id", + "type": "int53", + "description": "The identifier of the sender of the story" + }, + { + "name": "story_id", + "type": "int32", + "description": "The identifier of the story" + } + ] + }, + { + "name": "inputMessageReplyToMessage", + "description": "Describes a message to be replied", + "class": "InputMessageReplyTo", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "The identifier of the chat to which the message to be replied belongs; pass 0 if the message to be replied is in the same chat. Must always be 0 for replies in secret chats. A message can be replied in another chat or topic only if message.can_be_replied_in_another_chat" + }, + { + "name": "message_id", + "type": "int53", + "description": "The identifier of the message to be replied in the same or the specified chat" + }, + { + "name": "quote", + "type": "inputTextQuote", + "description": "Quote from the message to be replied; pass null if none. Must always be null for replies in secret chats" + } + ] + }, + { + "name": "inputMessageReplyToStory", + "description": "Describes a story to be replied", + "class": "InputMessageReplyTo", + "properties": [ + { + "name": "story_sender_chat_id", + "type": "int53", + "description": "The identifier of the sender of the story. Currently, stories can be replied only in the sender's chat and channel stories can't be replied" + }, + { + "name": "story_id", + "type": "int32", + "description": "The identifier of the story" + } + ] + }, { "name": "message", "description": "Describes a message", @@ -3638,12 +4971,12 @@ { "name": "sending_state", "type": "MessageSendingState", - "description": "The sending state of the message; may be null" + "description": "The sending state of the message; may be null if the message isn't being sent and didn't fail to be sent" }, { "name": "scheduling_state", "type": "MessageSchedulingState", - "description": "The scheduling state of the message; may be null" + "description": "The scheduling state of the message; may be null if the message isn't scheduled" }, { "name": "is_outgoing", @@ -3655,6 +4988,11 @@ "type": "Bool", "description": "True, if the message is pinned" }, + { + "name": "is_from_offline", + "type": "Bool", + "description": "True, if the message was sent because of a scheduled action by the message sender, for example, as away, or greeting service message" + }, { "name": "can_be_edited", "type": "Bool", @@ -3665,6 +5003,11 @@ "type": "Bool", "description": "True, if the message can be forwarded" }, + { + "name": "can_be_replied_in_another_chat", + "type": "Bool", + "description": "True, if the message can be replied in another chat or topic" + }, { "name": "can_be_saved", "type": "Bool", @@ -3695,6 +5038,11 @@ "type": "Bool", "description": "True, if information about the message thread is available through getMessageThread and getMessageThreadHistory" }, + { + "name": "can_get_read_date", + "type": "Bool", + "description": "True, if read date of the message can be received through getMessageReadDate" + }, { "name": "can_get_viewers", "type": "Bool", @@ -3743,12 +5091,17 @@ { "name": "forward_info", "type": "messageForwardInfo", - "description": "Information about the initial message sender; may be null" + "description": "Information about the initial message sender; may be null if none or unknown" + }, + { + "name": "import_info", + "type": "messageImportInfo", + "description": "Information about the initial message for messages created with importMessages; may be null if the message isn't imported" }, { "name": "interaction_info", "type": "messageInteractionInfo", - "description": "Information about interactions with the message; may be null" + "description": "Information about interactions with the message; may be null if none" }, { "name": "unread_reactions", @@ -3756,14 +5109,9 @@ "description": "Information about unread reactions added to the message" }, { - "name": "reply_in_chat_id", - "type": "int53", - "description": "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" - }, - { - "name": "reply_to_message_id", - "type": "int53", - "description": "If non-zero, the identifier of the message this message is replying to; can be the identifier of a deleted message" + "name": "reply_to", + "type": "MessageReplyTo", + "description": "Information about the message or the story this message is replying to; may be null if none" }, { "name": "message_thread_id", @@ -3771,24 +5119,39 @@ "description": "If non-zero, the identifier of the message thread the message belongs to; unique within the chat to which the message belongs" }, { - "name": "self_destruct_time", - "type": "int32", - "description": "The message's self-destruct time, in seconds; 0 if none. TDLib will send updateDeleteMessages or updateMessageContent once the time expires" + "name": "saved_messages_topic_id", + "type": "int53", + "description": "Identifier of the Saved Messages topic for the message; 0 for messages not from Saved Messages" + }, + { + "name": "self_destruct_type", + "type": "MessageSelfDestructType", + "description": "The message's self-destruct type; may be null if none" }, { "name": "self_destruct_in", "type": "double", - "description": "Time left before the message self-destruct timer expires, in seconds. If the self-destruct timer isn't started yet, equals to the value of the self_destruct_time field" + "description": "Time left before the message self-destruct timer expires, in seconds; 0 if self-destruction isn't scheduled yet" }, { "name": "auto_delete_in", "type": "double", - "description": "Time left before the message will be automatically deleted by message_auto_delete_time setting of the chat, in seconds; 0 if never. TDLib will send updateDeleteMessages or updateMessageContent once the time expires" + "description": "Time left before the message will be automatically deleted by message_auto_delete_time setting of the chat, in seconds; 0 if never" }, { "name": "via_bot_user_id", "type": "int53", - "description": "If non-zero, the user identifier of the bot through which this message was sent" + "description": "If non-zero, the user identifier of the inline bot through which this message was sent" + }, + { + "name": "sender_business_bot_user_id", + "type": "int53", + "description": "If non-zero, the user identifier of the business bot that sent this message" + }, + { + "name": "sender_boost_count", + "type": "int32", + "description": "Number of times the sender of the message boosted the supergroup at the time the message was sent; 0 if none or unknown. For messages sent by the current user, supergroupFullInfo.my_boost_count must be used instead" }, { "name": "author_signature", @@ -3813,7 +5176,7 @@ { "name": "reply_markup", "type": "ReplyMarkup", - "description": "Reply markup for the message; may be null" + "description": "Reply markup for the message; may be null if none" } ] }, @@ -3852,7 +5215,7 @@ { "name": "next_offset", "type": "string", - "description": "The offset for the next request. If empty, there are no more results" + "description": "The offset for the next request. If empty, then there are no more results" } ] }, @@ -3951,6 +5314,202 @@ } ] }, + { + "name": "businessMessage", + "description": "Describes a message from a business account as received by a bot", + "class": "BusinessMessage", + "properties": [ + { + "name": "message", + "type": "message", + "description": "The message" + }, + { + "name": "reply_to_message", + "type": "message", + "description": "Message that is replied by the message in the same chat; may be null if none" + } + ] + }, + { + "name": "businessMessages", + "description": "Contains a list of messages from a business account as received by a bot", + "class": "BusinessMessages", + "properties": [ + { + "name": "messages", + "type": "vector\u003cbusinessMessage\u003e", + "description": "List of business messages" + } + ] + }, + { + "name": "messageSourceChatHistory", + "description": "The message is from a chat history", + "class": "MessageSource", + "properties": [] + }, + { + "name": "messageSourceMessageThreadHistory", + "description": "The message is from a message thread history", + "class": "MessageSource", + "properties": [] + }, + { + "name": "messageSourceForumTopicHistory", + "description": "The message is from a forum topic history", + "class": "MessageSource", + "properties": [] + }, + { + "name": "messageSourceHistoryPreview", + "description": "The message is from chat, message thread or forum topic history preview", + "class": "MessageSource", + "properties": [] + }, + { + "name": "messageSourceChatList", + "description": "The message is from a chat list or a forum topic list", + "class": "MessageSource", + "properties": [] + }, + { + "name": "messageSourceSearch", + "description": "The message is from search results, including file downloads, local file list, outgoing document messages, calendar", + "class": "MessageSource", + "properties": [] + }, + { + "name": "messageSourceChatEventLog", + "description": "The message is from a chat event log", + "class": "MessageSource", + "properties": [] + }, + { + "name": "messageSourceNotification", + "description": "The message is from a notification", + "class": "MessageSource", + "properties": [] + }, + { + "name": "messageSourceScreenshot", + "description": "The message was screenshotted; the source must be used only if the message content was visible during the screenshot", + "class": "MessageSource", + "properties": [] + }, + { + "name": "messageSourceOther", + "description": "The message is from some other source", + "class": "MessageSource", + "properties": [] + }, + { + "name": "messageSponsorTypeBot", + "description": "The sponsor is a bot", + "class": "MessageSponsorType", + "properties": [ + { + "name": "bot_user_id", + "type": "int53", + "description": "User identifier of the bot" + }, + { + "name": "link", + "type": "InternalLinkType", + "description": "An internal link to be opened when the sponsored message is clicked" + } + ] + }, + { + "name": "messageSponsorTypeWebApp", + "description": "The sponsor is a web app", + "class": "MessageSponsorType", + "properties": [ + { + "name": "web_app_title", + "type": "string", + "description": "Web App title" + }, + { + "name": "link", + "type": "InternalLinkType", + "description": "An internal link to be opened when the sponsored message is clicked" + } + ] + }, + { + "name": "messageSponsorTypePublicChannel", + "description": "The sponsor is a public channel chat", + "class": "MessageSponsorType", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Sponsor chat identifier" + }, + { + "name": "link", + "type": "InternalLinkType", + "description": "An internal link to be opened when the sponsored message is clicked; may be null if the sponsor chat needs to be opened instead" + } + ] + }, + { + "name": "messageSponsorTypePrivateChannel", + "description": "The sponsor is a private channel chat", + "class": "MessageSponsorType", + "properties": [ + { + "name": "title", + "type": "string", + "description": "Title of the chat" + }, + { + "name": "invite_link", + "type": "string", + "description": "Invite link for the channel" + } + ] + }, + { + "name": "messageSponsorTypeWebsite", + "description": "The sponsor is a website", + "class": "MessageSponsorType", + "properties": [ + { + "name": "url", + "type": "string", + "description": "URL of the website" + }, + { + "name": "name", + "type": "string", + "description": "Name of the website" + } + ] + }, + { + "name": "messageSponsor", + "description": "Information about the sponsor of a message", + "class": "MessageSponsor", + "properties": [ + { + "name": "type", + "type": "MessageSponsorType", + "description": "Type of the sponsor" + }, + { + "name": "photo", + "type": "chatPhotoInfo", + "description": "Photo of the sponsor; may be null if must not be shown" + }, + { + "name": "info", + "type": "string", + "description": "Additional optional information about the sponsor to be shown along with the message" + } + ] + }, { "name": "sponsoredMessage", "description": "Describes a sponsored message", @@ -3967,29 +5526,29 @@ "description": "True, if the message needs to be labeled as \"recommended\" instead of \"sponsored\"" }, { - "name": "sponsor_chat_id", - "type": "int53", - "description": "Sponsor chat identifier; 0 if the sponsor chat is accessible through an invite link" - }, - { - "name": "sponsor_chat_info", - "type": "chatInviteLinkInfo", - "description": "Information about the sponsor chat; may be null unless sponsor_chat_id == 0" - }, - { - "name": "show_chat_photo", + "name": "can_be_reported", "type": "Bool", - "description": "True, if the sponsor's chat photo must be shown" - }, - { - "name": "link", - "type": "InternalLinkType", - "description": "An internal link to be opened when the sponsored message is clicked; may be null if the sponsor chat needs to be opened instead" + "description": "True, if the message can be reported to Telegram moderators through reportChatSponsoredMessage" }, { "name": "content", "type": "MessageContent", "description": "Content of the message. Currently, can be only of the type messageText" + }, + { + "name": "sponsor", + "type": "messageSponsor", + "description": "Information about the sponsor of the message" + }, + { + "name": "button_text", + "type": "string", + "description": "If non-empty, text for the message action button" + }, + { + "name": "additional_info", + "type": "string", + "description": "If non-empty, additional information about the sponsored message to be shown along with the message" } ] }, @@ -4010,6 +5569,64 @@ } ] }, + { + "name": "reportChatSponsoredMessageOption", + "description": "Describes an option to report a sponsored message", + "class": "ReportChatSponsoredMessageOption", + "properties": [ + { + "name": "id", + "type": "bytes", + "description": "Unique identifier of the option" + }, + { + "name": "text", + "type": "string", + "description": "Text of the option" + } + ] + }, + { + "name": "reportChatSponsoredMessageResultOk", + "description": "The message was reported successfully", + "class": "ReportChatSponsoredMessageResult", + "properties": [] + }, + { + "name": "reportChatSponsoredMessageResultFailed", + "description": "The sponsored message is too old or not found", + "class": "ReportChatSponsoredMessageResult", + "properties": [] + }, + { + "name": "reportChatSponsoredMessageResultOptionRequired", + "description": "The user must choose an option to report the message and repeat request with the chosen option", + "class": "ReportChatSponsoredMessageResult", + "properties": [ + { + "name": "title", + "type": "string", + "description": "Title for the option choice" + }, + { + "name": "options", + "type": "vector\u003creportChatSponsoredMessageOption\u003e", + "description": "List of available options" + } + ] + }, + { + "name": "reportChatSponsoredMessageResultAdsHidden", + "description": "Sponsored messages were hidden for the user in all chats", + "class": "ReportChatSponsoredMessageResult", + "properties": [] + }, + { + "name": "reportChatSponsoredMessageResultPremiumRequired", + "description": "The user asked to hide sponsored messages, but Telegram Premium is required for this", + "class": "ReportChatSponsoredMessageResult", + "properties": [] + }, { "name": "fileDownload", "description": "Describes a file added to file download list", @@ -4082,7 +5699,7 @@ { "name": "next_offset", "type": "string", - "description": "The offset for the next request. If empty, there are no more results" + "description": "The offset for the next request. If empty, then there are no more results" } ] }, @@ -4106,13 +5723,13 @@ }, { "name": "chatNotificationSettings", - "description": "Contains information about notification settings for a chat or a froum topic", + "description": "Contains information about notification settings for a chat or a forum topic", "class": "ChatNotificationSettings", "properties": [ { "name": "use_default_mute_for", "type": "Bool", - "description": "If true, mute_for is ignored and the value for the relevant type of chat or the forum chat is used instead" + "description": "If true, the value for the relevant type of chat or the forum chat is used instead of mute_for" }, { "name": "mute_for", @@ -4127,22 +5744,52 @@ { "name": "sound_id", "type": "int64", - "description": "Identifier of the notification sound to be played; 0 if sound is disabled" + "description": "Identifier of the notification sound to be played for messages; 0 if sound is disabled" }, { "name": "use_default_show_preview", "type": "Bool", - "description": "If true, show_preview is ignored and the value for the relevant type of chat or the forum chat is used instead" + "description": "If true, the value for the relevant type of chat or the forum chat is used instead of show_preview" }, { "name": "show_preview", "type": "Bool", "description": "True, if message content must be displayed in notifications" }, + { + "name": "use_default_mute_stories", + "type": "Bool", + "description": "If true, the value for the relevant type of chat is used instead of mute_stories" + }, + { + "name": "mute_stories", + "type": "Bool", + "description": "True, if story notifications are disabled for the chat" + }, + { + "name": "use_default_story_sound", + "type": "Bool", + "description": "If true, the value for the relevant type of chat is used instead of story_sound_id" + }, + { + "name": "story_sound_id", + "type": "int64", + "description": "Identifier of the notification sound to be played for stories; 0 if sound is disabled" + }, + { + "name": "use_default_show_story_sender", + "type": "Bool", + "description": "If true, the value for the relevant type of chat is used instead of show_story_sender" + }, + { + "name": "show_story_sender", + "type": "Bool", + "description": "True, if the sender of stories must be displayed in notifications" + }, { "name": "use_default_disable_pinned_message_notifications", "type": "Bool", - "description": "If true, disable_pinned_message_notifications is ignored and the value for the relevant type of chat or the forum chat is used instead" + "description": "If true, the value for the relevant type of chat or the forum chat is used instead of disable_pinned_message_notifications" }, { "name": "disable_pinned_message_notifications", @@ -4152,7 +5799,7 @@ { "name": "use_default_disable_mention_notifications", "type": "Bool", - "description": "If true, disable_mention_notifications is ignored and the value for the relevant type of chat or the forum chat is used instead" + "description": "If true, the value for the relevant type of chat or the forum chat is used instead of disable_mention_notifications" }, { "name": "disable_mention_notifications", @@ -4181,6 +5828,26 @@ "type": "Bool", "description": "True, if message content must be displayed in notifications" }, + { + "name": "use_default_mute_stories", + "type": "Bool", + "description": "If true, story notifications are received only for the first 5 chats from topChatCategoryUsers regardless of the value of mute_stories" + }, + { + "name": "mute_stories", + "type": "Bool", + "description": "True, if story notifications are disabled" + }, + { + "name": "story_sound_id", + "type": "int64", + "description": "Identifier of the notification sound to be played for stories; 0 if sound is disabled" + }, + { + "name": "show_story_sender", + "type": "Bool", + "description": "True, if the sender of stories must be displayed in notifications" + }, { "name": "disable_pinned_message_notifications", "type": "Bool", @@ -4199,9 +5866,9 @@ "class": "DraftMessage", "properties": [ { - "name": "reply_to_message_id", - "type": "int53", - "description": "Identifier of the replied message; 0 if none" + "name": "reply_to", + "type": "InputMessageReplyTo", + "description": "Information about the message to be replied; must be of the type inputMessageReplyToMessage; may be null if none" }, { "name": "date", @@ -4211,7 +5878,7 @@ { "name": "input_message_text", "type": "InputMessageContent", - "description": "Content of the message draft; must be of the type inputMessageText" + "description": "Content of the message draft; must be of the type inputMessageText, inputMessageVideoNote, or inputMessageVoiceNote" } ] }, @@ -4269,39 +5936,61 @@ { "name": "user_id", "type": "int53", - "description": "User identifier of the secret chat peer" + "description": "User identifier of the other user in the secret chat" } ] }, { - "name": "chatFilter", - "description": "Represents a filter of user chats", - "class": "ChatFilter", + "name": "chatFolderIcon", + "description": "Represents an icon for a chat folder", + "class": "ChatFolderIcon", + "properties": [ + { + "name": "name", + "type": "string", + "description": "The chosen icon name for short folder 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\", \"Airplane\", \"Book\", \"Light\", \"Like\", \"Money\", \"Note\", \"Palette\"" + } + ] + }, + { + "name": "chatFolder", + "description": "Represents a folder for user chats", + "class": "ChatFolder", "properties": [ { "name": "title", "type": "string", - "description": "The title of the filter; 1-12 characters without line feeds" + "description": "The title of the folder; 1-12 characters without line feeds" }, { - "name": "icon_name", - "type": "string", - "description": "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\", \"Airplane\", \"Book\", \"Light\", \"Like\", \"Money\", \"Note\", \"Palette\". If empty, use getChatFilterDefaultIconName to get default icon name for the filter" + "name": "icon", + "type": "chatFolderIcon", + "description": "The chosen icon for the chat folder; may be null. If null, use getChatFolderDefaultIconName to get default icon name for the folder" + }, + { + "name": "color_id", + "type": "int32", + "description": "The identifier of the chosen color for the chat folder icon; from -1 to 6. If -1, then color is didabled. Can't be changed if folder tags are disabled or the current user doesn't have Telegram Premium subscription" + }, + { + "name": "is_shareable", + "type": "Bool", + "description": "True, if at least one link has been created for the folder" }, { "name": "pinned_chat_ids", "type": "vector\u003cint53\u003e", - "description": "The chat identifiers of pinned chats in the filtered chat list. There can be up to getOption(\"chat_filter_chosen_chat_count_max\") pinned and always included non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium" + "description": "The chat identifiers of pinned chats in the folder. There can be up to getOption(\"chat_folder_chosen_chat_count_max\") pinned and always included non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium" }, { "name": "included_chat_ids", "type": "vector\u003cint53\u003e", - "description": "The chat identifiers of always included chats in the filtered chat list. There can be up to getOption(\"chat_filter_chosen_chat_count_max\") pinned and always included non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium" + "description": "The chat identifiers of always included chats in the folder. There can be up to getOption(\"chat_folder_chosen_chat_count_max\") pinned and always included non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium" }, { "name": "excluded_chat_ids", "type": "vector\u003cint53\u003e", - "description": "The chat identifiers of always excluded chats in the filtered chat list. There can be up to getOption(\"chat_filter_chosen_chat_count_max\") always excluded non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium" + "description": "The chat identifiers of always excluded chats in the folder. There can be up to getOption(\"chat_folder_chosen_chat_count_max\") always excluded non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium" }, { "name": "exclude_muted", @@ -4346,53 +6035,146 @@ ] }, { - "name": "chatFilterInfo", - "description": "Contains basic information about a chat filter", - "class": "ChatFilterInfo", + "name": "chatFolderInfo", + "description": "Contains basic information about a chat folder", + "class": "ChatFolderInfo", "properties": [ { "name": "id", "type": "int32", - "description": "Unique chat filter identifier" + "description": "Unique chat folder identifier" }, { "name": "title", "type": "string", - "description": "The title of the filter; 1-12 characters without line feeds" + "description": "The title of the folder; 1-12 characters without line feeds" }, { - "name": "icon_name", - "type": "string", - "description": "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\", \"Airplane\", \"Book\", \"Light\", \"Like\", \"Money\", \"Note\", \"Palette\"" + "name": "icon", + "type": "chatFolderIcon", + "description": "The chosen or default icon for the chat folder" + }, + { + "name": "color_id", + "type": "int32", + "description": "The identifier of the chosen color for the chat folder icon; from -1 to 6. If -1, then color is didabled" + }, + { + "name": "is_shareable", + "type": "Bool", + "description": "True, if at least one link has been created for the folder" + }, + { + "name": "has_my_invite_links", + "type": "Bool", + "description": "True, if the chat folder has invite links created by the current user" } ] }, { - "name": "recommendedChatFilter", - "description": "Describes a recommended chat filter", - "class": "RecommendedChatFilter", + "name": "chatFolderInviteLink", + "description": "Contains a chat folder invite link", + "class": "ChatFolderInviteLink", "properties": [ { - "name": "filter", - "type": "chatFilter", - "description": "The chat filter" + "name": "invite_link", + "type": "string", + "description": "The chat folder invite link" + }, + { + "name": "name", + "type": "string", + "description": "Name of the link" + }, + { + "name": "chat_ids", + "type": "vector\u003cint53\u003e", + "description": "Identifiers of chats, included in the link" + } + ] + }, + { + "name": "chatFolderInviteLinks", + "description": "Represents a list of chat folder invite links", + "class": "ChatFolderInviteLinks", + "properties": [ + { + "name": "invite_links", + "type": "vector\u003cchatFolderInviteLink\u003e", + "description": "List of the invite links" + } + ] + }, + { + "name": "chatFolderInviteLinkInfo", + "description": "Contains information about an invite link to a chat folder", + "class": "ChatFolderInviteLinkInfo", + "properties": [ + { + "name": "chat_folder_info", + "type": "chatFolderInfo", + "description": "Basic information about the chat folder; chat folder identifier will be 0 if the user didn't have the chat folder yet" + }, + { + "name": "missing_chat_ids", + "type": "vector\u003cint53\u003e", + "description": "Identifiers of the chats from the link, which aren't added to the folder yet" + }, + { + "name": "added_chat_ids", + "type": "vector\u003cint53\u003e", + "description": "Identifiers of the chats from the link, which are added to the folder already" + } + ] + }, + { + "name": "recommendedChatFolder", + "description": "Describes a recommended chat folder", + "class": "RecommendedChatFolder", + "properties": [ + { + "name": "folder", + "type": "chatFolder", + "description": "The chat folder" }, { "name": "description", "type": "string", - "description": "Chat filter description" + "description": "Chat folder description" } ] }, { - "name": "recommendedChatFilters", - "description": "Contains a list of recommended chat filters", - "class": "RecommendedChatFilters", + "name": "recommendedChatFolders", + "description": "Contains a list of recommended chat folders", + "class": "RecommendedChatFolders", "properties": [ { - "name": "chat_filters", - "type": "vector\u003crecommendedChatFilter\u003e", - "description": "List of recommended chat filters" + "name": "chat_folders", + "type": "vector\u003crecommendedChatFolder\u003e", + "description": "List of recommended chat folders" + } + ] + }, + { + "name": "archiveChatListSettings", + "description": "Contains settings for automatic moving of chats to and from the Archive chat lists", + "class": "ArchiveChatListSettings", + "properties": [ + { + "name": "archive_and_mute_new_chats_from_unknown_users", + "type": "Bool", + "description": "True, if new chats from non-contacts will be automatically archived and muted. Can be set to true only if the option \"can_archive_and_mute_new_chats_from_unknown_users\" is true" + }, + { + "name": "keep_unmuted_chats_archived", + "type": "Bool", + "description": "True, if unmuted chats will be kept in the Archive chat list when they get a new message" + }, + { + "name": "keep_chats_from_folders_archived", + "type": "Bool", + "description": "True, if unmuted chats, that are always included or pinned in a folder, will be kept in the Archive chat list when they get a new message. Ignored if keep_unmuted_chats_archived == true" } ] }, @@ -4409,14 +6191,14 @@ "properties": [] }, { - "name": "chatListFilter", - "description": "A list of chats belonging to a chat filter", + "name": "chatListFolder", + "description": "A list of chats added to a chat folder", "class": "ChatList", "properties": [ { - "name": "chat_filter_id", + "name": "chat_folder_id", "type": "int32", - "description": "Chat filter identifier" + "description": "Chat folder identifier" } ] }, @@ -4500,6 +6282,40 @@ } ] }, + { + "name": "savedMessagesTag", + "description": "Represents a tag used in Saved Messages or a Saved Messages topic", + "class": "SavedMessagesTag", + "properties": [ + { + "name": "tag", + "type": "ReactionType", + "description": "The tag" + }, + { + "name": "label", + "type": "string", + "description": "Label of the tag; 0-12 characters. Always empty if the tag is returned for a Saved Messages topic" + }, + { + "name": "count", + "type": "int32", + "description": "Number of times the tag was used; may be 0 if the tag has non-empty label" + } + ] + }, + { + "name": "savedMessagesTags", + "description": "Contains a list of tags used in Saved Messages", + "class": "SavedMessagesTags", + "properties": [ + { + "name": "tags", + "type": "vector\u003csavedMessagesTag\u003e", + "description": "List of tags" + } + ] + }, { "name": "videoChat", "description": "Describes a video chat", @@ -4547,6 +6363,26 @@ "type": "chatPhotoInfo", "description": "Chat photo; may be null" }, + { + "name": "accent_color_id", + "type": "int32", + "description": "Identifier of the accent color for message sender name, and backgrounds of chat photo, reply header, and link preview" + }, + { + "name": "background_custom_emoji_id", + "type": "int64", + "description": "Identifier of a custom emoji to be shown on the reply header and link preview background for messages sent by the chat; 0 if none" + }, + { + "name": "profile_accent_color_id", + "type": "int32", + "description": "Identifier of the profile accent color for the chat's profile; -1 if none" + }, + { + "name": "profile_background_custom_emoji_id", + "type": "int64", + "description": "Identifier of a custom emoji to be shown on the background of the chat's profile; 0 if none" + }, { "name": "permissions", "type": "chatPermissions", @@ -4555,32 +6391,47 @@ { "name": "last_message", "type": "message", - "description": "Last message in the chat; may be null" + "description": "Last message in the chat; may be null if none or unknown" }, { "name": "positions", "type": "vector\u003cchatPosition\u003e", "description": "Positions of the chat in chat lists" }, + { + "name": "chat_lists", + "type": "vector\u003cChatList\u003e", + "description": "Chat lists to which the chat belongs. A chat can have a non-zero position in a chat list even it doesn't belong to the chat list and have no position in a chat list even it belongs to the chat list" + }, { "name": "message_sender_id", "type": "MessageSender", "description": "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" }, + { + "name": "block_list", + "type": "BlockList", + "description": "Block list to which the chat is added; may be null if none" + }, { "name": "has_protected_content", "type": "Bool", "description": "True, if chat content can't be saved locally, forwarded, or copied" }, + { + "name": "is_translatable", + "type": "Bool", + "description": "True, if translation of all messages in the chat must be suggested to the user" + }, { "name": "is_marked_as_unread", "type": "Bool", "description": "True, if the chat is marked as unread" }, { - "name": "is_blocked", + "name": "view_as_topics", "type": "Bool", - "description": "True, if the chat is blocked by the current user and private messages from the chat can't be received" + "description": "True, if the chat is a forum supergroup that must be shown in the \"View as topics\" mode, or Saved Messages chat that must be shown in the \"View as chats\"" }, { "name": "has_scheduled_messages", @@ -4647,6 +6498,16 @@ "type": "int32", "description": "Current message auto-delete or self-destruct timer setting for the chat, in seconds; 0 if disabled. Self-destruct timer in secret chats starts after the message or its content is viewed. Auto-delete timer in other chats starts from the send date" }, + { + "name": "emoji_status", + "type": "emojiStatus", + "description": "Emoji status to be shown along with chat title; may be null" + }, + { + "name": "background", + "type": "chatBackground", + "description": "Background set for the chat; may be null if none" + }, { "name": "theme_name", "type": "string", @@ -4655,7 +6516,7 @@ { "name": "action_bar", "type": "ChatActionBar", - "description": "Information about actions which must be possible to do through the chat action bar; may be null" + "description": "Information about actions which must be possible to do through the chat action bar; may be null if none" }, { "name": "video_chat", @@ -4665,7 +6526,7 @@ { "name": "pending_join_requests", "type": "chatJoinRequestsInfo", - "description": "Information about pending join requests; may be null" + "description": "Information about pending join requests; may be null if none" }, { "name": "reply_markup_message_id", @@ -4675,7 +6536,7 @@ { "name": "draft_message", "type": "draftMessage", - "description": "A draft of a message in the chat; may be null" + "description": "A draft of a message in the chat; may be null if none" }, { "name": "client_data", @@ -4749,7 +6610,7 @@ }, { "name": "chatActionBarReportSpam", - "description": "The chat can be reported as spam using the method reportChat with the reason chatReportReasonSpam. If the chat is a private chat with a user with an emoji status, then a notice about emoji status usage must be shown", + "description": "The chat can be reported as spam using the method reportChat with the reason reportReasonSpam. If the chat is a private chat with a user with an emoji status, then a notice about emoji status usage must be shown", "class": "ChatActionBar", "properties": [ { @@ -4761,7 +6622,7 @@ }, { "name": "chatActionBarReportUnrelatedLocation", - "description": "The chat is a location-based supergroup, which can be reported as having unrelated location using the method reportChat with the reason chatReportReasonUnrelatedLocation", + "description": "The chat is a location-based supergroup, which can be reported as having unrelated location using the method reportChat with the reason reportReasonUnrelatedLocation", "class": "ChatActionBar", "properties": [] }, @@ -4773,7 +6634,7 @@ }, { "name": "chatActionBarReportAddBlock", - "description": "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. If the chat is a private chat with a user with an emoji status, then a notice about emoji status usage must be shown", + "description": "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 setMessageSenderBlockList, or the other user can be added to the contact list using the method addContact. If the chat is a private chat with a user with an emoji status, then a notice about emoji status usage must be shown", "class": "ChatActionBar", "properties": [ { @@ -4784,7 +6645,7 @@ { "name": "distance", "type": "int32", - "description": "If non-negative, the current user was found by the peer through searchChatsNearby and this is the distance between the users" + "description": "If non-negative, the current user was found by the other user through searchChatsNearby and this is the distance between the users" } ] }, @@ -4857,6 +6718,130 @@ } ] }, + { + "name": "keyboardButtonTypeRequestUsers", + "description": "A button that requests users to be shared by the current user; available only in private chats. Use the method shareUsersWithBot to complete the request", + "class": "KeyboardButtonType", + "properties": [ + { + "name": "id", + "type": "int32", + "description": "Unique button identifier" + }, + { + "name": "restrict_user_is_bot", + "type": "Bool", + "description": "True, if the shared users must or must not be bots" + }, + { + "name": "user_is_bot", + "type": "Bool", + "description": "True, if the shared users must be bots; otherwise, the shared users must not be bots. Ignored if restrict_user_is_bot is false" + }, + { + "name": "restrict_user_is_premium", + "type": "Bool", + "description": "True, if the shared users must or must not be Telegram Premium users" + }, + { + "name": "user_is_premium", + "type": "Bool", + "description": "True, if the shared users must be Telegram Premium users; otherwise, the shared users must not be Telegram Premium users. Ignored if restrict_user_is_premium is false" + }, + { + "name": "max_quantity", + "type": "int32", + "description": "The maximum number of users to share" + }, + { + "name": "request_name", + "type": "Bool", + "description": "Pass true to request name of the users; bots only" + }, + { + "name": "request_username", + "type": "Bool", + "description": "Pass true to request username of the users; bots only" + }, + { + "name": "request_photo", + "type": "Bool", + "description": "Pass true to request photo of the users; bots only" + } + ] + }, + { + "name": "keyboardButtonTypeRequestChat", + "description": "A button that requests a chat to be shared by the current user; available only in private chats. Use the method shareChatWithBot to complete the request", + "class": "KeyboardButtonType", + "properties": [ + { + "name": "id", + "type": "int32", + "description": "Unique button identifier" + }, + { + "name": "chat_is_channel", + "type": "Bool", + "description": "True, if the chat must be a channel; otherwise, a basic group or a supergroup chat is shared" + }, + { + "name": "restrict_chat_is_forum", + "type": "Bool", + "description": "True, if the chat must or must not be a forum supergroup" + }, + { + "name": "chat_is_forum", + "type": "Bool", + "description": "True, if the chat must be a forum supergroup; otherwise, the chat must not be a forum supergroup. Ignored if restrict_chat_is_forum is false" + }, + { + "name": "restrict_chat_has_username", + "type": "Bool", + "description": "True, if the chat must or must not have a username" + }, + { + "name": "chat_has_username", + "type": "Bool", + "description": "True, if the chat must have a username; otherwise, the chat must not have a username. Ignored if restrict_chat_has_username is false" + }, + { + "name": "chat_is_created", + "type": "Bool", + "description": "True, if the chat must be created by the current user" + }, + { + "name": "user_administrator_rights", + "type": "chatAdministratorRights", + "description": "Expected user administrator rights in the chat; may be null if they aren't restricted" + }, + { + "name": "bot_administrator_rights", + "type": "chatAdministratorRights", + "description": "Expected bot administrator rights in the chat; may be null if they aren't restricted" + }, + { + "name": "bot_is_member", + "type": "Bool", + "description": "True, if the bot must be a member of the chat; for basic group and supergroup chats only" + }, + { + "name": "request_title", + "type": "Bool", + "description": "Pass true to request title of the chat; bots only" + }, + { + "name": "request_username", + "type": "Bool", + "description": "Pass true to request username of the chat; bots only" + }, + { + "name": "request_photo", + "type": "Bool", + "description": "Pass true to request photo of the chat; bots only" + } + ] + }, { "name": "keyboardButtonTypeWebApp", "description": "A button that opens a Web App by calling getWebAppUrl", @@ -4973,9 +6958,9 @@ "description": "Inline query to be sent to the bot" }, { - "name": "in_current_chat", - "type": "Bool", - "description": "True, if the inline query must be sent from the current chat" + "name": "target_chat", + "type": "TargetChat", + "description": "Target chat from which to send the inline query" } ] }, @@ -5056,7 +7041,7 @@ { "name": "is_persistent", "type": "Bool", - "description": "True, if the keyboard is supposed to be always shown when the ordinary keyboard is hidden" + "description": "True, if the keyboard is supposed to always be shown when the ordinary keyboard is hidden" }, { "name": "resize_keyboard", @@ -5094,7 +7079,7 @@ }, { "name": "loginUrlInfoOpen", - "description": "An HTTP url needs to be open", + "description": "An HTTP URL needs to be open", "class": "LoginUrlInfo", "properties": [ { @@ -5103,9 +7088,9 @@ "description": "The URL to open" }, { - "name": "skip_confirm", + "name": "skip_confirmation", "type": "Bool", - "description": "True, if there is no need to show an ordinary open URL confirm" + "description": "True, if there is no need to show an ordinary open URL confirmation" } ] }, @@ -5132,7 +7117,29 @@ { "name": "request_write_access", "type": "Bool", - "description": "True, if the user needs to be requested to give the permission to the bot to send them messages" + "description": "True, if the user must be asked for the permission to the bot to send them messages" + } + ] + }, + { + "name": "foundWebApp", + "description": "Contains information about a Web App found by its short name", + "class": "FoundWebApp", + "properties": [ + { + "name": "web_app", + "type": "webApp", + "description": "The Web App" + }, + { + "name": "request_write_access", + "type": "Bool", + "description": "True, if the user must be asked for the permission to the bot to send them messages" + }, + { + "name": "skip_confirmation", + "type": "Bool", + "description": "True, if there is no need to show an ordinary open URL confirmation before opening the Web App. The field must be ignored and confirmation must be shown anyway if the Web App link was hidden" } ] }, @@ -5186,7 +7193,68 @@ { "name": "draft_message", "type": "draftMessage", - "description": "A draft of a message in the message thread; may be null" + "description": "A draft of a message in the message thread; may be null if none" + } + ] + }, + { + "name": "savedMessagesTopicTypeMyNotes", + "description": "Topic containing messages sent by the current user of forwarded from an unknown chat", + "class": "SavedMessagesTopicType", + "properties": [] + }, + { + "name": "savedMessagesTopicTypeAuthorHidden", + "description": "Topic containing messages forwarded from a user with hidden privacy", + "class": "SavedMessagesTopicType", + "properties": [] + }, + { + "name": "savedMessagesTopicTypeSavedFromChat", + "description": "Topic containing messages forwarded from a specific chat", + "class": "SavedMessagesTopicType", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat" + } + ] + }, + { + "name": "savedMessagesTopic", + "description": "Contains information about a Saved Messages topic", + "class": "SavedMessagesTopic", + "properties": [ + { + "name": "id", + "type": "int53", + "description": "Unique topic identifier" + }, + { + "name": "type", + "type": "SavedMessagesTopicType", + "description": "Type of the topic" + }, + { + "name": "is_pinned", + "type": "Bool", + "description": "True, if the topic is pinned" + }, + { + "name": "order", + "type": "int64", + "description": "A parameter used to determine order of the topic in the topic list. Topics must be sorted by the order in descending order" + }, + { + "name": "last_message", + "type": "message", + "description": "Last message in the topic; may be null if none or unknown" + }, + { + "name": "draft_message", + "type": "draftMessage", + "description": "A draft of a message in the topic; may be null if none" } ] }, @@ -5230,7 +7298,7 @@ { "name": "creation_date", "type": "int32", - "description": "Date the topic was created" + "description": "Point in time (Unix timestamp) when the topic was created" }, { "name": "creator_id", @@ -5312,7 +7380,7 @@ { "name": "draft_message", "type": "draftMessage", - "description": "A draft of a message in the topic; may be null" + "description": "A draft of a message in the topic; may be null if none" } ] }, @@ -5348,6 +7416,97 @@ } ] }, + { + "name": "linkPreviewOptions", + "description": "Options to be used for generation of a link preview", + "class": "LinkPreviewOptions", + "properties": [ + { + "name": "is_disabled", + "type": "Bool", + "description": "True, if link preview must be disabled" + }, + { + "name": "url", + "type": "string", + "description": "URL to use for link preview. If empty, then the first URL found in the message text will be used" + }, + { + "name": "force_small_media", + "type": "Bool", + "description": "True, if shown media preview must be small; ignored in secret chats or if the URL isn't explicitly specified" + }, + { + "name": "force_large_media", + "type": "Bool", + "description": "True, if shown media preview must be large; ignored in secret chats or if the URL isn't explicitly specified" + }, + { + "name": "show_above_text", + "type": "Bool", + "description": "True, if link preview must be shown above message text; otherwise, the link preview will be shown below the message text; ignored in secret chats" + } + ] + }, + { + "name": "sharedUser", + "description": "Contains information about a user shared with a bot", + "class": "SharedUser", + "properties": [ + { + "name": "user_id", + "type": "int53", + "description": "User identifier" + }, + { + "name": "first_name", + "type": "string", + "description": "First name of the user; for bots only" + }, + { + "name": "last_name", + "type": "string", + "description": "Last name of the user; for bots only" + }, + { + "name": "username", + "type": "string", + "description": "Username of the user; for bots only" + }, + { + "name": "photo", + "type": "photo", + "description": "Profile photo of the user; for bots only; may be null" + } + ] + }, + { + "name": "sharedChat", + "description": "Contains information about a chat shared with a bot", + "class": "SharedChat", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "title", + "type": "string", + "description": "Title of the chat; for bots only" + }, + { + "name": "username", + "type": "string", + "description": "Username of the chat; for bots only" + }, + { + "name": "photo", + "type": "photo", + "description": "Photo of the chat; for bots only; may be null" + } + ] + }, { "name": "richTextPlain", "description": "A plain text", @@ -6178,6 +8337,11 @@ "type": "chatPhotoInfo", "description": "Chat photo; may be null" }, + { + "name": "accent_color_id", + "type": "int32", + "description": "Identifier of the accent color for chat title and background of chat photo" + }, { "name": "username", "type": "string", @@ -6322,7 +8486,7 @@ }, { "name": "webPage", - "description": "Describes a web page preview", + "description": "Describes a link preview", "class": "WebPage", "properties": [ { @@ -6390,6 +8554,26 @@ "type": "string", "description": "Author of the content" }, + { + "name": "has_large_media", + "type": "Bool", + "description": "True, if size of media in the preview can be changed" + }, + { + "name": "show_large_media", + "type": "Bool", + "description": "True, if large media preview must be shown; otherwise, the media preview must be shown small and only the first frame must be shown for videos" + }, + { + "name": "skip_confirmation", + "type": "Bool", + "description": "True, if there is no need to show an ordinary open URL confirmation, when opening the URL from the preview, because the URL is shown in the message text in clear" + }, + { + "name": "show_above_text", + "type": "Bool", + "description": "True, if the link preview must be shown above message text; otherwise, the link preview must be shown below the message text" + }, { "name": "animation", "type": "animation", @@ -6425,6 +8609,16 @@ "type": "voiceNote", "description": "Preview of the content as a voice note, if available; may be null" }, + { + "name": "story_sender_chat_id", + "type": "int53", + "description": "The identifier of the sender of the previewed story; 0 if none" + }, + { + "name": "story_id", + "type": "int32", + "description": "The identifier of the previewed story; 0 if none" + }, { "name": "instant_view_version", "type": "int32", @@ -6499,7 +8693,68 @@ { "name": "is_anonymous", "type": "Bool", - "description": "True, if the phone number was bought on Fragment and isn't tied to a SIM card" + "description": "True, if the phone number was bought at https://fragment.com and isn't tied to a SIM card. Information about the phone number can be received using getCollectibleItemInfo" + } + ] + }, + { + "name": "collectibleItemTypeUsername", + "description": "A username", + "class": "CollectibleItemType", + "properties": [ + { + "name": "username", + "type": "string", + "description": "The username" + } + ] + }, + { + "name": "collectibleItemTypePhoneNumber", + "description": "A phone number", + "class": "CollectibleItemType", + "properties": [ + { + "name": "phone_number", + "type": "string", + "description": "The phone number" + } + ] + }, + { + "name": "collectibleItemInfo", + "description": "Contains information about a collectible item and its last purchase", + "class": "CollectibleItemInfo", + "properties": [ + { + "name": "purchase_date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the item was purchased" + }, + { + "name": "currency", + "type": "string", + "description": "Currency for the paid amount" + }, + { + "name": "amount", + "type": "int53", + "description": "The paid amount, in the smallest units of the currency" + }, + { + "name": "cryptocurrency", + "type": "string", + "description": "Cryptocurrency used to pay for the item" + }, + { + "name": "cryptocurrency_amount", + "type": "int64", + "description": "The paid amount, in the smallest units of the cryptocurrency" + }, + { + "name": "url", + "type": "string", + "description": "Individual URL for the item on https://fragment.com" } ] }, @@ -6589,11 +8844,41 @@ "type": "int32", "description": "A secondary color for the background in the RGB24 format" }, + { + "name": "header_background_color", + "type": "int32", + "description": "A color of the header background in the RGB24 format" + }, + { + "name": "section_background_color", + "type": "int32", + "description": "A color of the section background in the RGB24 format" + }, { "name": "text_color", "type": "int32", "description": "A color of text in the RGB24 format" }, + { + "name": "accent_text_color", + "type": "int32", + "description": "An accent color of the text in the RGB24 format" + }, + { + "name": "section_header_text_color", + "type": "int32", + "description": "A color of text on the section headers in the RGB24 format" + }, + { + "name": "subtitle_text_color", + "type": "int32", + "description": "A color of the subtitle text in the RGB24 format" + }, + { + "name": "destructive_text_color", + "type": "int32", + "description": "A color of the text for destructive actions in the RGB24 format" + }, { "name": "hint_color", "type": "int32", @@ -6663,6 +8948,11 @@ "type": "string", "description": "An HTTP URL with terms of service for recurring payments. If non-empty, the invoice payment will result in recurring payments and the user must accept the terms of service before allowed to pay" }, + { + "name": "terms_of_service_url", + "type": "string", + "description": "An HTTP URL with terms of service for non-recurring payments. If non-empty, then the user must accept the terms of service before allowed to pay" + }, { "name": "is_test", "type": "Bool", @@ -6833,6 +9123,11 @@ "name": "public_token", "type": "string", "description": "Public payment token" + }, + { + "name": "tokenize_url", + "type": "string", + "description": "URL for sending card tokenization requests" } ] }, @@ -6966,7 +9261,7 @@ }, { "name": "validatedOrderInfo", - "description": "Contains a temporary identifier of validated order information, which is stored for one hour. Also contains the available shipping options", + "description": "Contains a temporary identifier of validated order information, which is stored for one hour, and the available shipping options", "class": "ValidatedOrderInfo", "properties": [ { @@ -6989,7 +9284,7 @@ { "name": "success", "type": "Bool", - "description": "True, if the payment request was successful; otherwise the verification_url will be non-empty" + "description": "True, if the payment request was successful; otherwise, the verification_url will be non-empty" }, { "name": "verification_url", @@ -7089,6 +9384,18 @@ } ] }, + { + "name": "inputInvoiceTelegram", + "description": "An invoice for a payment toward Telegram; must not be used in the in-store apps", + "class": "InputInvoice", + "properties": [ + { + "name": "purpose", + "type": "TelegramPaymentPurpose", + "description": "Transaction purpose" + } + ] + }, { "name": "messageExtendedMediaPreview", "description": "The media is hidden until the invoice is paid", @@ -7107,7 +9414,7 @@ { "name": "duration", "type": "int32", - "description": "Media duration; 0 if unknown" + "description": "Media duration, in seconds; 0 if unknown" }, { "name": "minithumbnail", @@ -7157,7 +9464,7 @@ }, { "name": "messageExtendedMediaUnsupported", - "description": "The media is unuspported", + "description": "The media is unsupported", "class": "MessageExtendedMedia", "properties": [ { @@ -7167,6 +9474,48 @@ } ] }, + { + "name": "premiumGiveawayParameters", + "description": "Describes parameters of a Telegram Premium giveaway", + "class": "PremiumGiveawayParameters", + "properties": [ + { + "name": "boosted_chat_id", + "type": "int53", + "description": "Identifier of the supergroup or channel chat, which will be automatically boosted by the winners of the giveaway for duration of the Premium subscription. If the chat is a channel, then can_post_messages right is required in the channel, otherwise, the user must be an administrator in the supergroup" + }, + { + "name": "additional_chat_ids", + "type": "vector\u003cint53\u003e", + "description": "Identifiers of other supergroup or channel chats that must be subscribed by the users to be eligible for the giveaway. There can be up to getOption(\"giveaway_additional_chat_count_max\") additional chats" + }, + { + "name": "winners_selection_date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the giveaway is expected to be performed; must be 60-getOption(\"giveaway_duration_max\") seconds in the future in scheduled giveaways" + }, + { + "name": "only_new_members", + "type": "Bool", + "description": "True, if only new members of the chats will be eligible for the giveaway" + }, + { + "name": "has_public_winners", + "type": "Bool", + "description": "True, if the list of winners of the giveaway will be available to everyone" + }, + { + "name": "country_codes", + "type": "vector\u003cstring\u003e", + "description": "The list of two-letter ISO 3166-1 alpha-2 codes of countries, users from which will be eligible for the giveaway. If empty, then all users can participate in the giveaway. There can be up to getOption(\"giveaway_country_count_max\") chosen countries. Users with phone number that was bought at https://fragment.com can participate in any giveaway and the country code \"FT\" must not be specified in the list" + }, + { + "name": "prize_description", + "type": "string", + "description": "Additional description of the giveaway prize; 0-128 characters" + } + ] + }, { "name": "datedFile", "description": "File with the date it was uploaded", @@ -7352,9 +9701,9 @@ "description": "Document number; 1-24 characters" }, { - "name": "expiry_date", + "name": "expiration_date", "type": "date", - "description": "Document expiry date; may be null if not applicable" + "description": "Document expiration date; may be null if not applicable" }, { "name": "front_side", @@ -7389,9 +9738,9 @@ "description": "Document number; 1-24 characters" }, { - "name": "expiry_date", + "name": "expiration_date", "type": "date", - "description": "Document expiry date; pass null if not applicable" + "description": "Document expiration date; pass null if not applicable" }, { "name": "front_side", @@ -8167,7 +10516,12 @@ { "name": "web_page", "type": "webPage", - "description": "A preview of the web page that's mentioned in the text; may be null" + "description": "A link preview attached to the message; may be null" + }, + { + "name": "link_preview_options", + "type": "linkPreviewOptions", + "description": "Options which were used for generation of the link preview; may be null if default options were used" } ] }, @@ -8259,12 +10613,6 @@ } ] }, - { - "name": "messageExpiredPhoto", - "description": "A self-destructed photo message", - "class": "MessageContent", - "properties": [] - }, { "name": "messageSticker", "description": "A sticker message", @@ -8309,12 +10657,6 @@ } ] }, - { - "name": "messageExpiredVideo", - "description": "A self-destructed video message", - "class": "MessageContent", - "properties": [] - }, { "name": "messageVideoNote", "description": "A video note message", @@ -8359,6 +10701,30 @@ } ] }, + { + "name": "messageExpiredPhoto", + "description": "A self-destructed photo message", + "class": "MessageContent", + "properties": [] + }, + { + "name": "messageExpiredVideo", + "description": "A self-destructed video message", + "class": "MessageContent", + "properties": [] + }, + { + "name": "messageExpiredVideoNote", + "description": "A self-destructed video note message", + "class": "MessageContent", + "properties": [] + }, + { + "name": "messageExpiredVoiceNote", + "description": "A self-destructed voice note message", + "class": "MessageContent", + "properties": [] + }, { "name": "messageLocation", "description": "A message with a location", @@ -8488,9 +10854,31 @@ } ] }, + { + "name": "messageStory", + "description": "A message with a forwarded story", + "class": "MessageContent", + "properties": [ + { + "name": "story_sender_chat_id", + "type": "int53", + "description": "Identifier of the chat that posted the story" + }, + { + "name": "story_id", + "type": "int32", + "description": "Story identifier" + }, + { + "name": "via_mention", + "type": "Bool", + "description": "True, if the story was automatically forwarded because of a mention of the user" + } + ] + }, { "name": "messageInvoice", - "description": "A message with an invoice from a bot", + "description": "A message with an invoice from a bot. Use getInternalLink with internalLinkTypeBotStart to share the invoice", "class": "MessageContent", "properties": [ { @@ -8521,7 +10909,7 @@ { "name": "start_parameter", "type": "string", - "description": "Unique invoice bot start_parameter. To share an invoice use the URL https://t.me/{bot_username}?start={start_parameter}" + "description": "Unique invoice bot start_parameter to be passed to getInternalLink" }, { "name": "is_test", @@ -8767,6 +11155,28 @@ "class": "MessageContent", "properties": [] }, + { + "name": "messageChatSetBackground", + "description": "A new background was set in the chat", + "class": "MessageContent", + "properties": [ + { + "name": "old_background_message_id", + "type": "int53", + "description": "Identifier of the message with a previously set same background; 0 if none. Can be an identifier of a deleted message" + }, + { + "name": "background", + "type": "chatBackground", + "description": "The new background" + }, + { + "name": "only_for_self", + "type": "Bool", + "description": "True, if the background was set only for self" + } + ] + }, { "name": "messageChatSetTheme", "description": "A theme in the chat has been changed", @@ -8775,7 +11185,7 @@ { "name": "theme_name", "type": "string", - "description": "If non-empty, name of a new theme, set for the chat. Otherwise chat theme was reset to the default one" + "description": "If non-empty, name of a new theme, set for the chat. Otherwise, chat theme was reset to the default one" } ] }, @@ -8796,6 +11206,18 @@ } ] }, + { + "name": "messageChatBoost", + "description": "The chat was boosted by the sender of the message", + "class": "MessageContent", + "properties": [ + { + "name": "boost_count", + "type": "int32", + "description": "Number of times the chat was boosted" + } + ] + }, { "name": "messageForumTopicCreated", "description": "A forum topic has been created", @@ -8843,7 +11265,7 @@ { "name": "is_closed", "type": "Bool", - "description": "True, if the topic was closed, otherwise the topic was reopened" + "description": "True, if the topic was closed; otherwise, the topic was reopened" } ] }, @@ -8855,7 +11277,7 @@ { "name": "is_hidden", "type": "Bool", - "description": "True, if the topic was hidden, otherwise the topic was unhidden" + "description": "True, if the topic was hidden; otherwise, the topic was unhidden" } ] }, @@ -9004,6 +11426,11 @@ "description": "Telegram Premium was gifted to the user", "class": "MessageContent", "properties": [ + { + "name": "gifter_user_id", + "type": "int53", + "description": "The identifier of a user that gifted Telegram Premium; 0 if the gift was anonymous" + }, { "name": "currency", "type": "string", @@ -9014,10 +11441,20 @@ "type": "int53", "description": "The paid amount, in the smallest units of the currency" }, + { + "name": "cryptocurrency", + "type": "string", + "description": "Cryptocurrency used to pay for the gift; may be empty if none" + }, + { + "name": "cryptocurrency_amount", + "type": "int64", + "description": "The paid amount, in the smallest units of the cryptocurrency; 0 if none" + }, { "name": "month_count", "type": "int32", - "description": "Number of month the Telegram Premium subscription will be active" + "description": "Number of months the Telegram Premium subscription will be active" }, { "name": "sticker", @@ -9026,6 +11463,180 @@ } ] }, + { + "name": "messagePremiumGiftCode", + "description": "A Telegram Premium gift code was created for the user", + "class": "MessageContent", + "properties": [ + { + "name": "creator_id", + "type": "MessageSender", + "description": "Identifier of a chat or a user that created the gift code; may be null if unknown" + }, + { + "name": "is_from_giveaway", + "type": "Bool", + "description": "True, if the gift code was created for a giveaway" + }, + { + "name": "is_unclaimed", + "type": "Bool", + "description": "True, if the winner for the corresponding Telegram Premium subscription wasn't chosen" + }, + { + "name": "currency", + "type": "string", + "description": "Currency for the paid amount; empty if unknown" + }, + { + "name": "amount", + "type": "int53", + "description": "The paid amount, in the smallest units of the currency; 0 if unknown" + }, + { + "name": "cryptocurrency", + "type": "string", + "description": "Cryptocurrency used to pay for the gift; may be empty if none or unknown" + }, + { + "name": "cryptocurrency_amount", + "type": "int64", + "description": "The paid amount, in the smallest units of the cryptocurrency; 0 if unknown" + }, + { + "name": "month_count", + "type": "int32", + "description": "Number of months the Telegram Premium subscription will be active after code activation" + }, + { + "name": "sticker", + "type": "sticker", + "description": "A sticker to be shown in the message; may be null if unknown" + }, + { + "name": "code", + "type": "string", + "description": "The gift code" + } + ] + }, + { + "name": "messagePremiumGiveawayCreated", + "description": "A Telegram Premium giveaway was created for the chat", + "class": "MessageContent", + "properties": [] + }, + { + "name": "messagePremiumGiveaway", + "description": "A Telegram Premium giveaway", + "class": "MessageContent", + "properties": [ + { + "name": "parameters", + "type": "premiumGiveawayParameters", + "description": "Giveaway parameters" + }, + { + "name": "winner_count", + "type": "int32", + "description": "Number of users which will receive Telegram Premium subscription gift codes" + }, + { + "name": "month_count", + "type": "int32", + "description": "Number of months the Telegram Premium subscription will be active after code activation" + }, + { + "name": "sticker", + "type": "sticker", + "description": "A sticker to be shown in the message; may be null if unknown" + } + ] + }, + { + "name": "messagePremiumGiveawayCompleted", + "description": "A Telegram Premium giveaway without public winners has been completed for the chat", + "class": "MessageContent", + "properties": [ + { + "name": "giveaway_message_id", + "type": "int53", + "description": "Identifier of the message with the giveaway; can be 0 if the message was deleted" + }, + { + "name": "winner_count", + "type": "int32", + "description": "Number of winners in the giveaway" + }, + { + "name": "unclaimed_prize_count", + "type": "int32", + "description": "Number of undistributed prizes" + } + ] + }, + { + "name": "messagePremiumGiveawayWinners", + "description": "A Telegram Premium giveaway with public winners has been completed for the chat", + "class": "MessageContent", + "properties": [ + { + "name": "boosted_chat_id", + "type": "int53", + "description": "Identifier of the channel chat, which was automatically boosted by the winners of the giveaway for duration of the Premium subscription" + }, + { + "name": "giveaway_message_id", + "type": "int53", + "description": "Identifier of the message with the giveaway in the boosted chat" + }, + { + "name": "additional_chat_count", + "type": "int32", + "description": "Number of other chats that participated in the giveaway" + }, + { + "name": "actual_winners_selection_date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the winners were selected. May be bigger than winners selection date specified in parameters of the giveaway" + }, + { + "name": "only_new_members", + "type": "Bool", + "description": "True, if only new members of the chats were eligible for the giveaway" + }, + { + "name": "was_refunded", + "type": "Bool", + "description": "True, if the giveaway was canceled and was fully refunded" + }, + { + "name": "month_count", + "type": "int32", + "description": "Number of months the Telegram Premium subscription will be active after code activation" + }, + { + "name": "prize_description", + "type": "string", + "description": "Additional description of the giveaway prize" + }, + { + "name": "winner_count", + "type": "int32", + "description": "Total number of winners in the giveaway" + }, + { + "name": "winner_user_ids", + "type": "vector\u003cint53\u003e", + "description": "Up to 100 user identifiers of the winners of the giveaway" + }, + { + "name": "unclaimed_prize_count", + "type": "int32", + "description": "Number of undistributed prizes" + } + ] + }, { "name": "messageContactRegistered", "description": "A contact has registered with Telegram", @@ -9033,14 +11644,36 @@ "properties": [] }, { - "name": "messageWebsiteConnected", - "description": "The current user has connected a website by logging in using Telegram Login Widget on it", + "name": "messageUsersShared", + "description": "The current user shared users, which were requested by the bot", "class": "MessageContent", "properties": [ { - "name": "domain_name", - "type": "string", - "description": "Domain name of the connected website" + "name": "users", + "type": "vector\u003csharedUser\u003e", + "description": "The shared users" + }, + { + "name": "button_id", + "type": "int32", + "description": "Identifier of the keyboard button with the request" + } + ] + }, + { + "name": "messageChatShared", + "description": "The current user shared a chat, which was requested by the bot", + "class": "MessageContent", + "properties": [ + { + "name": "chat", + "type": "sharedChat", + "description": "The shared chat" + }, + { + "name": "button_id", + "type": "int32", + "description": "Identifier of the keyboard button with the request" } ] }, @@ -9048,7 +11681,13 @@ "name": "messageBotWriteAccessAllowed", "description": "The user allowed the bot to send messages", "class": "MessageContent", - "properties": [] + "properties": [ + { + "name": "reason", + "type": "BotWriteAccessAllowReason", + "description": "The reason why the bot was allowed to write messages" + } + ] }, { "name": "messageWebAppDataSent", @@ -9075,7 +11714,7 @@ { "name": "data", "type": "string", - "description": "Received data" + "description": "The data" } ] }, @@ -9132,7 +11771,7 @@ }, { "name": "messageUnsupported", - "description": "Message content that is not supported in the current TDLib version", + "description": "A message content that is not supported in the current TDLib version", "class": "MessageContent", "properties": [] }, @@ -9238,6 +11877,12 @@ } ] }, + { + "name": "textEntityTypeBlockQuote", + "description": "Text that must be formatted as if inside a blockquote HTML tag", + "class": "TextEntityType", + "properties": [] + }, { "name": "textEntityTypeTextUrl", "description": "A text description shown instead of a raw URL", @@ -9282,7 +11927,7 @@ { "name": "media_timestamp", "type": "int32", - "description": "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" + "description": "Timestamp from which a video/audio/video note/voice note/story 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" } ] }, @@ -9316,16 +11961,34 @@ { "name": "send_date", "type": "int32", - "description": "Date the message will be sent. The date must be within 367 days in the future" + "description": "Point in time (Unix timestamp) when the message will be sent. The date must be within 367 days in the future" } ] }, { "name": "messageSchedulingStateSendWhenOnline", - "description": "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", + "description": "The message will be sent when the other user is online. Applicable to private chats only and when the exact online status of the other user is known", "class": "MessageSchedulingState", "properties": [] }, + { + "name": "messageSelfDestructTypeTimer", + "description": "The message will be self-destructed in the specified time after its content was opened", + "class": "MessageSelfDestructType", + "properties": [ + { + "name": "self_destruct_time", + "type": "int32", + "description": "The message's self-destruct time, in seconds; must be between 0 and 60 in private chats" + } + ] + }, + { + "name": "messageSelfDestructTypeImmediately", + "description": "The message can be opened only once and will be self-destructed once closed", + "class": "MessageSelfDestructType", + "properties": [] + }, { "name": "messageSendOptions", "description": "Options to be used when a message is sent", @@ -9355,12 +12018,22 @@ "name": "scheduling_state", "type": "MessageSchedulingState", "description": "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" + }, + { + "name": "sending_id", + "type": "int32", + "description": "Non-persistent identifier, which will be returned back in messageSendingStatePending object and can be used to match sent messages and corresponding updateNewMessage updates" + }, + { + "name": "only_preview", + "type": "Bool", + "description": "Pass true to get a fake message instead of actually sending them" } ] }, { "name": "messageCopyOptions", - "description": "Options to be used when a message content is copied without reference to the original sender. Service messages and messageInvoice can't be copied", + "description": "Options to be used when a message content is copied without reference to the original sender. Service messages, messages with messageInvoice, messagePremiumGiveaway, or messagePremiumGiveawayWinners content can't be copied", "class": "MessageCopyOptions", "properties": [ { @@ -9388,12 +12061,12 @@ { "name": "text", "type": "formattedText", - "description": "Formatted text to be sent; 1-getOption(\"message_text_length_max\") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, Code, Pre, PreCode, TextUrl and MentionName entities are allowed to be specified manually" + "description": "Formatted text to be sent; 0-getOption(\"message_text_length_max\") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, BlockQuote, Code, Pre, PreCode, TextUrl and MentionName entities are allowed to be specified manually" }, { - "name": "disable_web_page_preview", - "type": "Bool", - "description": "True, if rich web page previews for URLs in the message text must be disabled" + "name": "link_preview_options", + "type": "linkPreviewOptions", + "description": "Options to be used for generation of a link preview; may be null if none; pass null to use default link preview options" }, { "name": "clear_draft", @@ -9504,7 +12177,7 @@ { "name": "disable_content_type_detection", "type": "Bool", - "description": "If true, automatic file type detection will be disabled and the document will always be sent as file. Always true for files sent to secret chats" + "description": "Pass true to disable automatic file type detection and send the document as a file. Always true for files sent to secret chats" }, { "name": "caption", @@ -9549,9 +12222,9 @@ "description": "Photo caption; pass null to use an empty caption; 0-getOption(\"message_caption_length_max\") characters" }, { - "name": "self_destruct_time", - "type": "int32", - "description": "Photo self-destruct time, in seconds (0-60). A non-zero self-destruct time can be specified only in private chats" + "name": "self_destruct_type", + "type": "MessageSelfDestructType", + "description": "Photo self-destruct type; pass null if none; private chats only" }, { "name": "has_spoiler", @@ -9638,9 +12311,9 @@ "description": "Video caption; pass null to use an empty caption; 0-getOption(\"message_caption_length_max\") characters" }, { - "name": "self_destruct_time", - "type": "int32", - "description": "Video self-destruct time, in seconds (0-60). A non-zero self-destruct time can be specified only in private chats" + "name": "self_destruct_type", + "type": "MessageSelfDestructType", + "description": "Video self-destruct type; pass null if none; private chats only" }, { "name": "has_spoiler", @@ -9662,17 +12335,22 @@ { "name": "thumbnail", "type": "inputThumbnail", - "description": "Video thumbnail; pass null to skip thumbnail uploading" + "description": "Video thumbnail; may be null if empty; pass null to skip thumbnail uploading" }, { "name": "duration", "type": "int32", - "description": "Duration of the video, in seconds" + "description": "Duration of the video, in seconds; 0-60" }, { "name": "length", "type": "int32", "description": "Video width and height; must be positive and not greater than 640" + }, + { + "name": "self_destruct_type", + "type": "MessageSelfDestructType", + "description": "Video note self-destruct type; may be null if none; pass null if none; private chats only" } ] }, @@ -9699,7 +12377,12 @@ { "name": "caption", "type": "formattedText", - "description": "Voice note caption; pass null to use an empty caption; 0-getOption(\"message_caption_length_max\") characters" + "description": "Voice note caption; may be null if empty; pass null to use an empty caption; 0-getOption(\"message_caption_length_max\") characters" + }, + { + "name": "self_destruct_type", + "type": "MessageSelfDestructType", + "description": "Voice note self-destruct type; may be null if none; pass null if none; private chats only" } ] }, @@ -9897,6 +12580,23 @@ } ] }, + { + "name": "inputMessageStory", + "description": "A message with a forwarded story. Stories can't be sent to secret chats. A story can be forwarded only if story.can_be_forwarded", + "class": "InputMessageContent", + "properties": [ + { + "name": "story_sender_chat_id", + "type": "int53", + "description": "Identifier of the chat that posted the story" + }, + { + "name": "story_id", + "type": "int32", + "description": "Story identifier" + } + ] + }, { "name": "inputMessageForwarded", "description": "A forwarded message", @@ -9910,7 +12610,7 @@ { "name": "message_id", "type": "int53", - "description": "Identifier of the message to forward" + "description": "Identifier of the message to forward. A message can be forwarded only if message.can_be_forwarded" }, { "name": "in_game_share", @@ -10154,7 +12854,7 @@ }, { "name": "userStatusEmpty", - "description": "The user status was never changed", + "description": "The user's status has never been changed", "class": "UserStatus", "properties": [] }, @@ -10186,19 +12886,66 @@ "name": "userStatusRecently", "description": "The user was online recently", "class": "UserStatus", - "properties": [] + "properties": [ + { + "name": "by_my_privacy_settings", + "type": "Bool", + "description": "Exact user's status is hidden because the current user enabled userPrivacySettingShowStatus privacy setting for the user and has no Telegram Premium" + } + ] }, { "name": "userStatusLastWeek", "description": "The user is offline, but was online last week", "class": "UserStatus", - "properties": [] + "properties": [ + { + "name": "by_my_privacy_settings", + "type": "Bool", + "description": "Exact user's status is hidden because the current user enabled userPrivacySettingShowStatus privacy setting for the user and has no Telegram Premium" + } + ] }, { "name": "userStatusLastMonth", "description": "The user is offline, but was online last month", "class": "UserStatus", - "properties": [] + "properties": [ + { + "name": "by_my_privacy_settings", + "type": "Bool", + "description": "Exact user's status is hidden because the current user enabled userPrivacySettingShowStatus privacy setting for the user and has no Telegram Premium" + } + ] + }, + { + "name": "emojiKeyword", + "description": "Represents an emoji with its keyword", + "class": "EmojiKeyword", + "properties": [ + { + "name": "emoji", + "type": "string", + "description": "The emoji" + }, + { + "name": "keyword", + "type": "string", + "description": "The keyword" + } + ] + }, + { + "name": "emojiKeywords", + "description": "Represents a list of emoji with their keywords", + "class": "EmojiKeywords", + "properties": [ + { + "name": "emoji_keywords", + "type": "vector\u003cemojiKeyword\u003e", + "description": "List of emoji with their keywords" + } + ] }, { "name": "stickers", @@ -10254,6 +13001,11 @@ "type": "vector\u003cclosedVectorPath\u003e", "description": "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" }, + { + "name": "is_owned", + "type": "Bool", + "description": "True, if the sticker set is owned by the current user" + }, { "name": "is_installed", "type": "Bool", @@ -10269,16 +13021,21 @@ "type": "Bool", "description": "True, if the sticker set is official" }, - { - "name": "sticker_format", - "type": "StickerFormat", - "description": "Format of the stickers in the set" - }, { "name": "sticker_type", "type": "StickerType", "description": "Type of the stickers in the set" }, + { + "name": "needs_repainting", + "type": "Bool", + "description": "True, if stickers in the sticker set are custom emoji that must be repainted; for custom emoji sticker sets only" + }, + { + "name": "is_allowed_as_chat_emoji_status", + "type": "Bool", + "description": "True, if stickers in the sticker set are custom emoji that can be used as chat emoji status; for custom emoji sticker sets only" + }, { "name": "is_viewed", "type": "Bool", @@ -10319,13 +13076,18 @@ { "name": "thumbnail", "type": "thumbnail", - "description": "Sticker set thumbnail in WEBP, TGS, or WEBM format with width and height 100; may be null" + "description": "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" }, { "name": "thumbnail_outline", "type": "vector\u003cclosedVectorPath\u003e", "description": "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" }, + { + "name": "is_owned", + "type": "Bool", + "description": "True, if the sticker set is owned by the current user" + }, { "name": "is_installed", "type": "Bool", @@ -10341,16 +13103,21 @@ "type": "Bool", "description": "True, if the sticker set is official" }, - { - "name": "sticker_format", - "type": "StickerFormat", - "description": "Format of the stickers in the set" - }, { "name": "sticker_type", "type": "StickerType", "description": "Type of the stickers in the set" }, + { + "name": "needs_repainting", + "type": "Bool", + "description": "True, if stickers in the sticker set are custom emoji that must be repainted; for custom emoji sticker sets only" + }, + { + "name": "is_allowed_as_chat_emoji_status", + "type": "Bool", + "description": "True, if stickers in the sticker set are custom emoji that can be used as chat emoji status; for custom emoji sticker sets only" + }, { "name": "is_viewed", "type": "Bool", @@ -10407,6 +13174,1292 @@ } ] }, + { + "name": "emojiCategory", + "description": "Contains a list of similar emoji to search for in getStickers and searchStickers", + "class": "EmojiCategory", + "properties": [ + { + "name": "name", + "type": "string", + "description": "Name of the category" + }, + { + "name": "icon", + "type": "sticker", + "description": "Custom emoji sticker, which represents icon of the category" + }, + { + "name": "emojis", + "type": "vector\u003cstring\u003e", + "description": "List of emojis in the category" + } + ] + }, + { + "name": "emojiCategories", + "description": "Represents a list of emoji categories", + "class": "EmojiCategories", + "properties": [ + { + "name": "categories", + "type": "vector\u003cemojiCategory\u003e", + "description": "List of categories" + } + ] + }, + { + "name": "emojiCategoryTypeDefault", + "description": "The category must be used by default", + "class": "EmojiCategoryType", + "properties": [] + }, + { + "name": "emojiCategoryTypeEmojiStatus", + "description": "The category must be used for emoji status selection", + "class": "EmojiCategoryType", + "properties": [] + }, + { + "name": "emojiCategoryTypeChatPhoto", + "description": "The category must be used for chat photo emoji selection", + "class": "EmojiCategoryType", + "properties": [] + }, + { + "name": "storyAreaPosition", + "description": "Describes position of a clickable rectangle area on a story media", + "class": "StoryAreaPosition", + "properties": [ + { + "name": "x_percentage", + "type": "double", + "description": "The abscissa of the rectangle's center, as a percentage of the media width" + }, + { + "name": "y_percentage", + "type": "double", + "description": "The ordinate of the rectangle's center, as a percentage of the media height" + }, + { + "name": "width_percentage", + "type": "double", + "description": "The width of the rectangle, as a percentage of the media width" + }, + { + "name": "height_percentage", + "type": "double", + "description": "The height of the rectangle, as a percentage of the media height" + }, + { + "name": "rotation_angle", + "type": "double", + "description": "Clockwise rotation angle of the rectangle, in degrees; 0-360" + } + ] + }, + { + "name": "storyAreaTypeLocation", + "description": "An area pointing to a location", + "class": "StoryAreaType", + "properties": [ + { + "name": "location", + "type": "location", + "description": "The location" + } + ] + }, + { + "name": "storyAreaTypeVenue", + "description": "An area pointing to a venue", + "class": "StoryAreaType", + "properties": [ + { + "name": "venue", + "type": "venue", + "description": "Information about the venue" + } + ] + }, + { + "name": "storyAreaTypeSuggestedReaction", + "description": "An area pointing to a suggested reaction. App needs to show a clickable reaction on the area and call setStoryReaction when the are is clicked", + "class": "StoryAreaType", + "properties": [ + { + "name": "reaction_type", + "type": "ReactionType", + "description": "Type of the reaction" + }, + { + "name": "total_count", + "type": "int32", + "description": "Number of times the reaction was added" + }, + { + "name": "is_dark", + "type": "Bool", + "description": "True, if reaction has a dark background" + }, + { + "name": "is_flipped", + "type": "Bool", + "description": "True, if reaction corner is flipped" + } + ] + }, + { + "name": "storyAreaTypeMessage", + "description": "An area pointing to a message", + "class": "StoryAreaType", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat with the message" + }, + { + "name": "message_id", + "type": "int53", + "description": "Identifier of the message" + } + ] + }, + { + "name": "storyArea", + "description": "Describes a clickable rectangle area on a story media", + "class": "StoryArea", + "properties": [ + { + "name": "position", + "type": "storyAreaPosition", + "description": "Position of the area" + }, + { + "name": "type", + "type": "StoryAreaType", + "description": "Type of the area" + } + ] + }, + { + "name": "inputStoryAreaTypeLocation", + "description": "An area pointing to a location", + "class": "InputStoryAreaType", + "properties": [ + { + "name": "location", + "type": "location", + "description": "The location" + } + ] + }, + { + "name": "inputStoryAreaTypeFoundVenue", + "description": "An area pointing to a venue found by the bot getOption(\"venue_search_bot_username\")", + "class": "InputStoryAreaType", + "properties": [ + { + "name": "query_id", + "type": "int64", + "description": "Identifier of the inline query, used to found the venue" + }, + { + "name": "result_id", + "type": "string", + "description": "Identifier of the inline query result" + } + ] + }, + { + "name": "inputStoryAreaTypePreviousVenue", + "description": "An area pointing to a venue already added to the story", + "class": "InputStoryAreaType", + "properties": [ + { + "name": "venue_provider", + "type": "string", + "description": "Provider of the venue" + }, + { + "name": "venue_id", + "type": "string", + "description": "Identifier of the venue in the provider database" + } + ] + }, + { + "name": "inputStoryAreaTypeSuggestedReaction", + "description": "An area pointing to a suggested reaction", + "class": "InputStoryAreaType", + "properties": [ + { + "name": "reaction_type", + "type": "ReactionType", + "description": "Type of the reaction" + }, + { + "name": "is_dark", + "type": "Bool", + "description": "True, if reaction has a dark background" + }, + { + "name": "is_flipped", + "type": "Bool", + "description": "True, if reaction corner is flipped" + } + ] + }, + { + "name": "inputStoryAreaTypeMessage", + "description": "An area pointing to a message", + "class": "InputStoryAreaType", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat with the message. Currently, the chat must be a supergroup or a channel chat" + }, + { + "name": "message_id", + "type": "int53", + "description": "Identifier of the message. Only successfully sent non-scheduled messages can be specified" + } + ] + }, + { + "name": "inputStoryArea", + "description": "Describes a clickable rectangle area on a story media to be added", + "class": "InputStoryArea", + "properties": [ + { + "name": "position", + "type": "storyAreaPosition", + "description": "Position of the area" + }, + { + "name": "type", + "type": "InputStoryAreaType", + "description": "Type of the area" + } + ] + }, + { + "name": "inputStoryAreas", + "description": "Contains a list of story areas to be added", + "class": "InputStoryAreas", + "properties": [ + { + "name": "areas", + "type": "vector\u003cinputStoryArea\u003e", + "description": "List of input story areas. Currently, a story can have up to 10 inputStoryAreaTypeLocation, inputStoryAreaTypeFoundVenue, and inputStoryAreaTypePreviousVenue areas, up to getOption(\"story_suggested_reaction_area_count_max\") inputStoryAreaTypeSuggestedReaction areas, and up to 1 inputStoryAreaTypeMessage area" + } + ] + }, + { + "name": "storyVideo", + "description": "Describes a video file sent in a story", + "class": "StoryVideo", + "properties": [ + { + "name": "duration", + "type": "double", + "description": "Duration of the video, in seconds" + }, + { + "name": "width", + "type": "int32", + "description": "Video width" + }, + { + "name": "height", + "type": "int32", + "description": "Video height" + }, + { + "name": "has_stickers", + "type": "Bool", + "description": "True, if stickers were added to the video. The list of corresponding sticker sets can be received using getAttachedStickerSets" + }, + { + "name": "is_animation", + "type": "Bool", + "description": "True, if the video has no sound" + }, + { + "name": "minithumbnail", + "type": "minithumbnail", + "description": "Video minithumbnail; may be null" + }, + { + "name": "thumbnail", + "type": "thumbnail", + "description": "Video thumbnail in JPEG or MPEG4 format; may be null" + }, + { + "name": "preload_prefix_size", + "type": "int32", + "description": "Size of file prefix, which is supposed to be preloaded, in bytes" + }, + { + "name": "video", + "type": "file", + "description": "File containing the video" + } + ] + }, + { + "name": "storyContentPhoto", + "description": "A photo story", + "class": "StoryContent", + "properties": [ + { + "name": "photo", + "type": "photo", + "description": "The photo" + } + ] + }, + { + "name": "storyContentVideo", + "description": "A video story", + "class": "StoryContent", + "properties": [ + { + "name": "video", + "type": "storyVideo", + "description": "The video in MPEG4 format" + }, + { + "name": "alternative_video", + "type": "storyVideo", + "description": "Alternative version of the video in MPEG4 format, encoded by x264 codec; may be null" + } + ] + }, + { + "name": "storyContentUnsupported", + "description": "A story content that is not supported in the current TDLib version", + "class": "StoryContent", + "properties": [] + }, + { + "name": "inputStoryContentPhoto", + "description": "A photo story", + "class": "InputStoryContent", + "properties": [ + { + "name": "photo", + "type": "InputFile", + "description": "Photo to send. The photo must be at most 10 MB in size. The photo size must be 1080x1920" + }, + { + "name": "added_sticker_file_ids", + "type": "vector\u003cint32\u003e", + "description": "File identifiers of the stickers added to the photo, if applicable" + } + ] + }, + { + "name": "inputStoryContentVideo", + "description": "A video story", + "class": "InputStoryContent", + "properties": [ + { + "name": "video", + "type": "InputFile", + "description": "Video to be sent. The video size must be 720x1280. The video must be streamable and stored in MPEG4 format, after encoding with x265 codec and key frames added each second" + }, + { + "name": "added_sticker_file_ids", + "type": "vector\u003cint32\u003e", + "description": "File identifiers of the stickers added to the video, if applicable" + }, + { + "name": "duration", + "type": "double", + "description": "Precise duration of the video, in seconds; 0-60" + }, + { + "name": "is_animation", + "type": "Bool", + "description": "True, if the video has no sound" + } + ] + }, + { + "name": "storyListMain", + "description": "The list of stories, shown in the main chat list and folder chat lists", + "class": "StoryList", + "properties": [] + }, + { + "name": "storyListArchive", + "description": "The list of stories, shown in the Arvhive chat list", + "class": "StoryList", + "properties": [] + }, + { + "name": "storyOriginPublicStory", + "description": "The original story was a public story with known sender", + "class": "StoryOrigin", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat that posted original story" + }, + { + "name": "story_id", + "type": "int32", + "description": "Story identifier of the original story" + } + ] + }, + { + "name": "storyOriginHiddenUser", + "description": "The original story was sent by an unknown user", + "class": "StoryOrigin", + "properties": [ + { + "name": "sender_name", + "type": "string", + "description": "Name of the story sender" + } + ] + }, + { + "name": "storyRepostInfo", + "description": "Contains information about original story that was reposted", + "class": "StoryRepostInfo", + "properties": [ + { + "name": "origin", + "type": "StoryOrigin", + "description": "Origin of the story that was reposted" + }, + { + "name": "is_content_modified", + "type": "Bool", + "description": "True, if story content was modified during reposting; otherwise, story wasn't modified" + } + ] + }, + { + "name": "storyInteractionInfo", + "description": "Contains information about interactions with a story", + "class": "StoryInteractionInfo", + "properties": [ + { + "name": "view_count", + "type": "int32", + "description": "Number of times the story was viewed" + }, + { + "name": "forward_count", + "type": "int32", + "description": "Number of times the story was forwarded; 0 if none or unknown" + }, + { + "name": "reaction_count", + "type": "int32", + "description": "Number of reactions added to the story; 0 if none or unknown" + }, + { + "name": "recent_viewer_user_ids", + "type": "vector\u003cint53\u003e", + "description": "Identifiers of at most 3 recent viewers of the story" + } + ] + }, + { + "name": "story", + "description": "Represents a story", + "class": "Story", + "properties": [ + { + "name": "id", + "type": "int32", + "description": "Unique story identifier among stories of the given sender" + }, + { + "name": "sender_chat_id", + "type": "int53", + "description": "Identifier of the chat that posted the story" + }, + { + "name": "sender_id", + "type": "MessageSender", + "description": "Identifier of the sender of the story; may be null if the story is posted on behalf of the sender_chat_id" + }, + { + "name": "date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the story was published" + }, + { + "name": "is_being_sent", + "type": "Bool", + "description": "True, if the story is being sent by the current user" + }, + { + "name": "is_being_edited", + "type": "Bool", + "description": "True, if the story is being edited by the current user" + }, + { + "name": "is_edited", + "type": "Bool", + "description": "True, if the story was edited" + }, + { + "name": "is_pinned", + "type": "Bool", + "description": "True, if the story is saved in the sender's profile and will be available there after expiration" + }, + { + "name": "is_visible_only_for_self", + "type": "Bool", + "description": "True, if the story is visible only for the current user" + }, + { + "name": "can_be_deleted", + "type": "Bool", + "description": "True, if the story can be deleted" + }, + { + "name": "can_be_edited", + "type": "Bool", + "description": "True, if the story can be edited" + }, + { + "name": "can_be_forwarded", + "type": "Bool", + "description": "True, if the story can be forwarded as a message. Otherwise, screenshots and saving of the story content must be also forbidden" + }, + { + "name": "can_be_replied", + "type": "Bool", + "description": "True, if the story can be replied in the chat with the story sender" + }, + { + "name": "can_toggle_is_pinned", + "type": "Bool", + "description": "True, if the story's is_pinned value can be changed" + }, + { + "name": "can_get_statistics", + "type": "Bool", + "description": "True, if the story statistics are available through getStoryStatistics" + }, + { + "name": "can_get_interactions", + "type": "Bool", + "description": "True, if interactions with the story can be received through getStoryInteractions" + }, + { + "name": "has_expired_viewers", + "type": "Bool", + "description": "True, if users viewed the story can't be received, because the story has expired more than getOption(\"story_viewers_expiration_delay\") seconds ago" + }, + { + "name": "repost_info", + "type": "storyRepostInfo", + "description": "Information about the original story; may be null if the story wasn't reposted" + }, + { + "name": "interaction_info", + "type": "storyInteractionInfo", + "description": "Information about interactions with the story; may be null if the story isn't owned or there were no interactions" + }, + { + "name": "chosen_reaction_type", + "type": "ReactionType", + "description": "Type of the chosen reaction; may be null if none" + }, + { + "name": "privacy_settings", + "type": "StoryPrivacySettings", + "description": "Privacy rules affecting story visibility; may be approximate for non-owned stories" + }, + { + "name": "content", + "type": "StoryContent", + "description": "Content of the story" + }, + { + "name": "areas", + "type": "vector\u003cstoryArea\u003e", + "description": "Clickable areas to be shown on the story content" + }, + { + "name": "caption", + "type": "formattedText", + "description": "Caption of the story" + } + ] + }, + { + "name": "stories", + "description": "Represents a list of stories", + "class": "Stories", + "properties": [ + { + "name": "total_count", + "type": "int32", + "description": "Approximate total number of stories found" + }, + { + "name": "stories", + "type": "vector\u003cstory\u003e", + "description": "The list of stories" + } + ] + }, + { + "name": "storyFullId", + "description": "Contains identifier of a story along with identifier of its sender", + "class": "StoryFullId", + "properties": [ + { + "name": "sender_chat_id", + "type": "int53", + "description": "Identifier of the chat that posted the story" + }, + { + "name": "story_id", + "type": "int32", + "description": "Unique story identifier among stories of the given sender" + } + ] + }, + { + "name": "storyInfo", + "description": "Contains basic information about a story", + "class": "StoryInfo", + "properties": [ + { + "name": "story_id", + "type": "int32", + "description": "Unique story identifier among stories of the given sender" + }, + { + "name": "date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the story was published" + }, + { + "name": "is_for_close_friends", + "type": "Bool", + "description": "True, if the story is available only to close friends" + } + ] + }, + { + "name": "chatActiveStories", + "description": "Describes active stories posted by a chat", + "class": "ChatActiveStories", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat that posted the stories" + }, + { + "name": "list", + "type": "StoryList", + "description": "Identifier of the story list in which the stories are shown; may be null if the stories aren't shown in a story list" + }, + { + "name": "order", + "type": "int53", + "description": "A parameter used to determine order of the stories in the story list; 0 if the stories doesn't need to be shown in the story list. Stories must be sorted by the pair (order, story_sender_chat_id) in descending order" + }, + { + "name": "max_read_story_id", + "type": "int32", + "description": "Identifier of the last read active story" + }, + { + "name": "stories", + "type": "vector\u003cstoryInfo\u003e", + "description": "Basic information about the stories; use getStory to get full information about the stories. The stories are in a chronological order (i.e., in order of increasing story identifiers)" + } + ] + }, + { + "name": "storyInteractionTypeView", + "description": "A view of the story", + "class": "StoryInteractionType", + "properties": [ + { + "name": "chosen_reaction_type", + "type": "ReactionType", + "description": "Type of the reaction that was chosen by the viewer; may be null if none" + } + ] + }, + { + "name": "storyInteractionTypeForward", + "description": "A forward of the story as a message", + "class": "StoryInteractionType", + "properties": [ + { + "name": "message", + "type": "message", + "description": "The message with story forward" + } + ] + }, + { + "name": "storyInteractionTypeRepost", + "description": "A repost of the story as a story", + "class": "StoryInteractionType", + "properties": [ + { + "name": "story", + "type": "story", + "description": "The reposted story" + } + ] + }, + { + "name": "storyInteraction", + "description": "Represents interaction with a story", + "class": "StoryInteraction", + "properties": [ + { + "name": "actor_id", + "type": "MessageSender", + "description": "Identifier of the user or chat that made the interaction" + }, + { + "name": "interaction_date", + "type": "int32", + "description": "Approximate point in time (Unix timestamp) when the interaction happened" + }, + { + "name": "block_list", + "type": "BlockList", + "description": "Block list to which the actor is added; may be null if none or for chat stories" + }, + { + "name": "type", + "type": "StoryInteractionType", + "description": "Type of the interaction" + } + ] + }, + { + "name": "storyInteractions", + "description": "Represents a list of interactions with a story", + "class": "StoryInteractions", + "properties": [ + { + "name": "total_count", + "type": "int32", + "description": "Approximate total number of interactions found" + }, + { + "name": "total_forward_count", + "type": "int32", + "description": "Approximate total number of found forwards and reposts; always 0 for chat stories" + }, + { + "name": "total_reaction_count", + "type": "int32", + "description": "Approximate total number of found reactions; always 0 for chat stories" + }, + { + "name": "interactions", + "type": "vector\u003cstoryInteraction\u003e", + "description": "List of story interactions" + }, + { + "name": "next_offset", + "type": "string", + "description": "The offset for the next request. If empty, then there are no more results" + } + ] + }, + { + "name": "quickReplyMessage", + "description": "Describes a message that can be used for quick reply", + "class": "QuickReplyMessage", + "properties": [ + { + "name": "id", + "type": "int53", + "description": "Unique message identifier among all quick replies" + }, + { + "name": "sending_state", + "type": "MessageSendingState", + "description": "The sending state of the message; may be null if the message isn't being sent and didn't fail to be sent" + }, + { + "name": "can_be_edited", + "type": "Bool", + "description": "True, if the message can be edited" + }, + { + "name": "reply_to_message_id", + "type": "int53", + "description": "Information about the identifier of the quick reply message to which the message replies" + }, + { + "name": "via_bot_user_id", + "type": "int53", + "description": "If non-zero, the user identifier of the bot through which this message was sent" + }, + { + "name": "media_album_id", + "type": "int64", + "description": "Unique identifier of an album this message belongs to. Only audios, documents, photos and videos can be grouped together in albums" + }, + { + "name": "content", + "type": "MessageContent", + "description": "Content of the message" + }, + { + "name": "reply_markup", + "type": "ReplyMarkup", + "description": "Inline keyboard reply markup for the message; may be null if none" + } + ] + }, + { + "name": "quickReplyShortcut", + "description": "Describes a shortcut that can be used for a quick reply", + "class": "QuickReplyShortcut", + "properties": [ + { + "name": "id", + "type": "int32", + "description": "Unique shortcut identifier" + }, + { + "name": "name", + "type": "string", + "description": "The name of the shortcut that can be used to use the shortcut" + }, + { + "name": "first_message", + "type": "quickReplyMessage", + "description": "The first shortcut message" + }, + { + "name": "message_count", + "type": "int32", + "description": "The total number of messages in the shortcut" + } + ] + }, + { + "name": "publicForwardMessage", + "description": "Contains a public forward as a message", + "class": "PublicForward", + "properties": [ + { + "name": "message", + "type": "message", + "description": "Information about the message" + } + ] + }, + { + "name": "publicForwardStory", + "description": "Contains a public repost to a story", + "class": "PublicForward", + "properties": [ + { + "name": "story", + "type": "story", + "description": "Information about the story" + } + ] + }, + { + "name": "publicForwards", + "description": "Represents a list of public forwards and reposts as a story of a message or a story", + "class": "PublicForwards", + "properties": [ + { + "name": "total_count", + "type": "int32", + "description": "Approximate total number of messages and stories found" + }, + { + "name": "forwards", + "type": "vector\u003cPublicForward\u003e", + "description": "List of found public forwards and reposts" + }, + { + "name": "next_offset", + "type": "string", + "description": "The offset for the next request. If empty, then there are no more results" + } + ] + }, + { + "name": "chatBoostLevelFeatures", + "description": "Contains a list of features available on a specific chat boost level", + "class": "ChatBoostLevelFeatures", + "properties": [ + { + "name": "level", + "type": "int32", + "description": "Target chat boost level" + }, + { + "name": "story_per_day_count", + "type": "int32", + "description": "Number of stories that the chat can publish daily" + }, + { + "name": "custom_emoji_reaction_count", + "type": "int32", + "description": "Number of custom emoji reactions that can be added to the list of available reactions" + }, + { + "name": "title_color_count", + "type": "int32", + "description": "Number of custom colors for chat title" + }, + { + "name": "profile_accent_color_count", + "type": "int32", + "description": "Number of custom colors for profile photo background" + }, + { + "name": "can_set_profile_background_custom_emoji", + "type": "Bool", + "description": "True, if custom emoji for profile background can be set" + }, + { + "name": "accent_color_count", + "type": "int32", + "description": "Number of custom colors for background of empty chat photo, replies to messages and link previews" + }, + { + "name": "can_set_background_custom_emoji", + "type": "Bool", + "description": "True, if custom emoji for reply header and link preview background can be set" + }, + { + "name": "can_set_emoji_status", + "type": "Bool", + "description": "True, if emoji status can be set" + }, + { + "name": "chat_theme_background_count", + "type": "int32", + "description": "Number of chat theme backgrounds that can be set as chat background" + }, + { + "name": "can_set_custom_background", + "type": "Bool", + "description": "True, if custom background can be set in the chat for all users" + }, + { + "name": "can_set_custom_emoji_sticker_set", + "type": "Bool", + "description": "True, if custom emoji sticker set can be set for the chat" + }, + { + "name": "can_recognize_speech", + "type": "Bool", + "description": "True, if speech recognition can be used for video note and voice note messages by all users" + } + ] + }, + { + "name": "chatBoostFeatures", + "description": "Contains a list of features available on the first chat boost levels", + "class": "ChatBoostFeatures", + "properties": [ + { + "name": "features", + "type": "vector\u003cchatBoostLevelFeatures\u003e", + "description": "The list of features" + }, + { + "name": "min_profile_background_custom_emoji_boost_level", + "type": "int32", + "description": "The minimum boost level required to set custom emoji for profile background" + }, + { + "name": "min_background_custom_emoji_boost_level", + "type": "int32", + "description": "The minimum boost level required to set custom emoji for reply header and link preview background; for channel chats only" + }, + { + "name": "min_emoji_status_boost_level", + "type": "int32", + "description": "The minimum boost level required to set emoji status" + }, + { + "name": "min_chat_theme_background_boost_level", + "type": "int32", + "description": "The minimum boost level required to set a chat theme background as chat background" + }, + { + "name": "min_custom_background_boost_level", + "type": "int32", + "description": "The minimum boost level required to set custom chat background" + }, + { + "name": "min_custom_emoji_sticker_set_boost_level", + "type": "int32", + "description": "The minimum boost level required to set custom emoji sticker set for the chat; for supergroup chats only" + }, + { + "name": "min_speech_recognition_boost_level", + "type": "int32", + "description": "The minimum boost level allowing to recognize speech in video note and voice note messages for non-Premium users; for supergroup chats only" + } + ] + }, + { + "name": "chatBoostSourceGiftCode", + "description": "The chat created a Telegram Premium gift code for a user", + "class": "ChatBoostSource", + "properties": [ + { + "name": "user_id", + "type": "int53", + "description": "Identifier of a user, for which the gift code was created" + }, + { + "name": "gift_code", + "type": "string", + "description": "The created Telegram Premium gift code, which is known only if this is a gift code for the current user, or it has already been claimed" + } + ] + }, + { + "name": "chatBoostSourceGiveaway", + "description": "The chat created a Telegram Premium giveaway", + "class": "ChatBoostSource", + "properties": [ + { + "name": "user_id", + "type": "int53", + "description": "Identifier of a user that won in the giveaway; 0 if none" + }, + { + "name": "gift_code", + "type": "string", + "description": "The created Telegram Premium gift code if it was used by the user or can be claimed by the current user; an empty string otherwise" + }, + { + "name": "giveaway_message_id", + "type": "int53", + "description": "Identifier of the corresponding giveaway message; can be an identifier of a deleted message" + }, + { + "name": "is_unclaimed", + "type": "Bool", + "description": "True, if the winner for the corresponding Telegram Premium subscription wasn't chosen, because there were not enough participants" + } + ] + }, + { + "name": "chatBoostSourcePremium", + "description": "A user with Telegram Premium subscription or gifted Telegram Premium boosted the chat", + "class": "ChatBoostSource", + "properties": [ + { + "name": "user_id", + "type": "int53", + "description": "Identifier of the user" + } + ] + }, + { + "name": "prepaidPremiumGiveaway", + "description": "Describes a prepaid Telegram Premium giveaway", + "class": "PrepaidPremiumGiveaway", + "properties": [ + { + "name": "id", + "type": "int64", + "description": "Unique identifier of the prepaid giveaway" + }, + { + "name": "winner_count", + "type": "int32", + "description": "Number of users which will receive Telegram Premium subscription gift codes" + }, + { + "name": "month_count", + "type": "int32", + "description": "Number of months the Telegram Premium subscription will be active after code activation" + }, + { + "name": "payment_date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the giveaway was paid" + } + ] + }, + { + "name": "chatBoostStatus", + "description": "Describes current boost status of a chat", + "class": "ChatBoostStatus", + "properties": [ + { + "name": "boost_url", + "type": "string", + "description": "An HTTP URL, which can be used to boost the chat" + }, + { + "name": "applied_slot_ids", + "type": "vector\u003cint32\u003e", + "description": "Identifiers of boost slots of the current user applied to the chat" + }, + { + "name": "level", + "type": "int32", + "description": "Current boost level of the chat" + }, + { + "name": "gift_code_boost_count", + "type": "int32", + "description": "The number of boosts received by the chat from created Telegram Premium gift codes and giveaways; always 0 if the current user isn't an administrator in the chat" + }, + { + "name": "boost_count", + "type": "int32", + "description": "The number of boosts received by the chat" + }, + { + "name": "current_level_boost_count", + "type": "int32", + "description": "The number of boosts added to reach the current level" + }, + { + "name": "next_level_boost_count", + "type": "int32", + "description": "The number of boosts needed to reach the next level; 0 if the next level isn't available" + }, + { + "name": "premium_member_count", + "type": "int32", + "description": "Approximate number of Telegram Premium subscribers joined the chat; always 0 if the current user isn't an administrator in the chat" + }, + { + "name": "premium_member_percentage", + "type": "double", + "description": "A percentage of Telegram Premium subscribers joined the chat; always 0 if the current user isn't an administrator in the chat" + }, + { + "name": "prepaid_giveaways", + "type": "vector\u003cprepaidPremiumGiveaway\u003e", + "description": "The list of prepaid giveaways available for the chat; only for chat administrators" + } + ] + }, + { + "name": "chatBoost", + "description": "Describes a boost applied to a chat", + "class": "ChatBoost", + "properties": [ + { + "name": "id", + "type": "string", + "description": "Unique identifier of the boost" + }, + { + "name": "count", + "type": "int32", + "description": "The number of identical boosts applied" + }, + { + "name": "source", + "type": "ChatBoostSource", + "description": "Source of the boost" + }, + { + "name": "start_date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the chat was boosted" + }, + { + "name": "expiration_date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the boost will expire" + } + ] + }, + { + "name": "foundChatBoosts", + "description": "Contains a list of boosts applied to a chat", + "class": "FoundChatBoosts", + "properties": [ + { + "name": "total_count", + "type": "int32", + "description": "Total number of boosts applied to the chat" + }, + { + "name": "boosts", + "type": "vector\u003cchatBoost\u003e", + "description": "List of boosts" + }, + { + "name": "next_offset", + "type": "string", + "description": "The offset for the next request. If empty, then there are no more results" + } + ] + }, + { + "name": "chatBoostSlot", + "description": "Describes a slot for chat boost", + "class": "ChatBoostSlot", + "properties": [ + { + "name": "slot_id", + "type": "int32", + "description": "Unique identifier of the slot" + }, + { + "name": "currently_boosted_chat_id", + "type": "int53", + "description": "Identifier of the currently boosted chat; 0 if none" + }, + { + "name": "start_date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the chat was boosted; 0 if none" + }, + { + "name": "expiration_date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the boost will expire" + }, + { + "name": "cooldown_until_date", + "type": "int32", + "description": "Point in time (Unix timestamp) after which the boost can be used for another chat" + } + ] + }, + { + "name": "chatBoostSlots", + "description": "Contains a list of chat boost slots", + "class": "ChatBoostSlots", + "properties": [ + { + "name": "slots", + "type": "vector\u003cchatBoostSlot\u003e", + "description": "List of boost slots" + } + ] + }, { "name": "callDiscardReasonEmpty", "description": "The call wasn't discarded, or the reason is unknown", @@ -10460,7 +14513,7 @@ { "name": "max_layer", "type": "int32", - "description": "The maximum supported API layer; use 65" + "description": "The maximum supported API layer; use 92" }, { "name": "library_versions", @@ -10600,7 +14653,7 @@ { "name": "protocol", "type": "callProtocol", - "description": "Call protocols supported by the peer" + "description": "Call protocols supported by the other call participant" }, { "name": "servers", @@ -10643,7 +14696,7 @@ { "name": "reason", "type": "CallDiscardReason", - "description": "The reason, why the call has ended" + "description": "The reason why the call has ended" }, { "name": "need_rating", @@ -10728,7 +14781,7 @@ }, { "name": "rtmpUrl", - "description": "Represents an RTMP url", + "description": "Represents an RTMP URL", "class": "RtmpUrl", "properties": [ { @@ -10783,7 +14836,7 @@ { "name": "enabled_start_notification", "type": "Bool", - "description": "True, if the group call is scheduled and the current user will receive a notification when the group call will start" + "description": "True, if the group call is scheduled and the current user will receive a notification when the group call starts" }, { "name": "is_active", @@ -11075,7 +15128,7 @@ { "name": "user_id", "type": "int53", - "description": "Peer user identifier" + "description": "User identifier of the other call participant" }, { "name": "is_outgoing", @@ -11094,6 +15147,29 @@ } ] }, + { + "name": "firebaseAuthenticationSettingsAndroid", + "description": "Settings for Firebase Authentication in the official Android application", + "class": "FirebaseAuthenticationSettings", + "properties": [] + }, + { + "name": "firebaseAuthenticationSettingsIos", + "description": "Settings for Firebase Authentication in the official iOS application", + "class": "FirebaseAuthenticationSettings", + "properties": [ + { + "name": "device_token", + "type": "string", + "description": "Device token from Apple Push Notification service" + }, + { + "name": "is_app_sandbox", + "type": "Bool", + "description": "True, if App Sandbox is enabled" + } + ] + }, { "name": "phoneNumberAuthenticationSettings", "description": "Contains settings for the authentication of the user's phone number", @@ -11119,6 +15195,11 @@ "type": "Bool", "description": "For official applications only. True, if the application can use Android SMS Retriever API (requires Google Play Services \u003e= 10.2) to automatically receive the authentication code from the SMS. See https://developers.google.com/identity/sms-retriever/ for more details" }, + { + "name": "firebase_authentication_settings", + "type": "FirebaseAuthenticationSettings", + "description": "For official Android and iOS applications only; pass null otherwise. Settings for Firebase Authentication" + }, { "name": "authentication_tokens", "type": "vector\u003cstring\u003e", @@ -11140,6 +15221,16 @@ "name": "sender_id", "type": "MessageSender", "description": "Identifier of the chat member, applied the reaction" + }, + { + "name": "is_outgoing", + "type": "Bool", + "description": "True, if the reaction was added by the current user" + }, + { + "name": "date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the reaction was added" } ] }, @@ -11161,7 +15252,7 @@ { "name": "next_offset", "type": "string", - "description": "The offset for the next request. If empty, there are no more results" + "description": "The offset for the next request. If empty, then there are no more results" } ] }, @@ -11205,13 +15296,23 @@ { "name": "allow_custom_emoji", "type": "Bool", - "description": "True, if custom emoji reactions could be added by Telegram Premium subscribers" + "description": "True, if any custom emoji reaction can be added by Telegram Premium subscribers" + }, + { + "name": "are_tags", + "type": "Bool", + "description": "True, if the reactions will be tags and the message can be found by them" + }, + { + "name": "unavailability_reason", + "type": "ReactionUnavailabilityReason", + "description": "The reason why the current user can't add reactions to the message, despite some other users can; may be null if none" } ] }, { "name": "emojiReaction", - "description": "Contains information about a emoji reaction", + "description": "Contains information about an emoji reaction", "class": "EmojiReaction", "properties": [ { @@ -11266,6 +15367,18 @@ } ] }, + { + "name": "reactionUnavailabilityReasonAnonymousAdministrator", + "description": "The user is an anonymous administrator in the supergroup, but isn't a creator of it, so they can't vote on behalf of the supergroup", + "class": "ReactionUnavailabilityReason", + "properties": [] + }, + { + "name": "reactionUnavailabilityReasonGuest", + "description": "The user isn't a member of the supergroup and can't send messages and reactions there without joining", + "class": "ReactionUnavailabilityReason", + "properties": [] + }, { "name": "animations", "description": "Represents a list of animations", @@ -11371,7 +15484,44 @@ { "name": "error", "type": "error", - "description": "Received error" + "description": "Recognition error. An error with a message \"MSG_VOICE_TOO_LONG\" is returned when media duration is too big to be recognized" + } + ] + }, + { + "name": "businessConnection", + "description": "Describes a connection of the bot with a business account", + "class": "BusinessConnection", + "properties": [ + { + "name": "id", + "type": "string", + "description": "Unique identifier of the connection" + }, + { + "name": "user_id", + "type": "int53", + "description": "Identifier of the business user that created the connection" + }, + { + "name": "user_chat_id", + "type": "int53", + "description": "Chat identifier of the private chat with the user" + }, + { + "name": "date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the connection was established" + }, + { + "name": "can_reply", + "type": "Bool", + "description": "True, if the bot can send messages to the connected user; false otherwise" + }, + { + "name": "is_enabled", + "type": "Bool", + "description": "True, if the connection is enabled; false otherwise" } ] }, @@ -11394,13 +15544,13 @@ }, { "name": "attachmentMenuBot", - "description": "Represents a bot, which can be added to attachment menu", + "description": "Represents a bot, which can be added to attachment or side menu", "class": "AttachmentMenuBot", "properties": [ { "name": "bot_user_id", "type": "int53", - "description": "User identifier of the bot added to attachment menu" + "description": "User identifier of the bot" }, { "name": "supports_self_chat", @@ -11427,15 +15577,30 @@ "type": "Bool", "description": "True, if the bot supports opening from attachment menu in channel chats" }, - { - "name": "supports_settings", - "type": "Bool", - "description": "True, if the bot supports \"settings_button_pressed\" event" - }, { "name": "request_write_access", "type": "Bool", - "description": "True, if the user needs to be requested to give the permission to the bot to send them messages" + "description": "True, if the user must be asked for the permission to send messages to the bot" + }, + { + "name": "is_added", + "type": "Bool", + "description": "True, if the bot was explicitly added by the user. If the bot isn't added, then on the first bot launch toggleBotIsAddedToAttachmentMenu must be called and the bot must be added or removed" + }, + { + "name": "show_in_attachment_menu", + "type": "Bool", + "description": "True, if the bot must be shown in the attachment menu" + }, + { + "name": "show_in_side_menu", + "type": "Bool", + "description": "True, if the bot must be shown in the side menu" + }, + { + "name": "show_disclaimer_in_side_menu", + "type": "Bool", + "description": "True, if a disclaimer, why the bot is shown in the side menu, is needed" }, { "name": "name", @@ -11450,27 +15615,42 @@ { "name": "default_icon", "type": "file", - "description": "Default attachment menu icon for the bot in SVG format; may be null" + "description": "Default icon for the bot in SVG format; may be null" }, { "name": "ios_static_icon", "type": "file", - "description": "Attachment menu icon for the bot in SVG format for the official iOS app; may be null" + "description": "Icon for the bot in SVG format for the official iOS app; may be null" }, { "name": "ios_animated_icon", "type": "file", - "description": "Attachment menu icon for the bot in TGS format for the official iOS app; may be null" + "description": "Icon for the bot in TGS format for the official iOS app; may be null" + }, + { + "name": "ios_side_menu_icon", + "type": "file", + "description": "Icon for the bot in PNG format for the official iOS app side menu; may be null" }, { "name": "android_icon", "type": "file", - "description": "Attachment menu icon for the bot in TGS format for the official Android app; may be null" + "description": "Icon for the bot in TGS format for the official Android app; may be null" + }, + { + "name": "android_side_menu_icon", + "type": "file", + "description": "Icon for the bot in SVG format for the official Android app side menu; may be null" }, { "name": "macos_icon", "type": "file", - "description": "Attachment menu icon for the bot in TGS format for the official native macOS app; may be null" + "description": "Icon for the bot in TGS format for the official native macOS app; may be null" + }, + { + "name": "macos_side_menu_icon", + "type": "file", + "description": "Icon for the bot in PNG format for the official macOS app side menu; may be null" }, { "name": "icon_color", @@ -11496,6 +15676,42 @@ } ] }, + { + "name": "botWriteAccessAllowReasonConnectedWebsite", + "description": "The user connected a website by logging in using Telegram Login Widget on it", + "class": "BotWriteAccessAllowReason", + "properties": [ + { + "name": "domain_name", + "type": "string", + "description": "Domain name of the connected website" + } + ] + }, + { + "name": "botWriteAccessAllowReasonAddedToAttachmentMenu", + "description": "The user added the bot to attachment or side menu using toggleBotIsAddedToAttachmentMenu", + "class": "BotWriteAccessAllowReason", + "properties": [] + }, + { + "name": "botWriteAccessAllowReasonLaunchedWebApp", + "description": "The user launched a Web App using getWebAppLinkUrl", + "class": "BotWriteAccessAllowReason", + "properties": [ + { + "name": "web_app", + "type": "webApp", + "description": "Information about the Web App" + } + ] + }, + { + "name": "botWriteAccessAllowReasonAcceptedRequest", + "description": "The user accepted bot's request to send messages with allowBotToSendMessages", + "class": "BotWriteAccessAllowReason", + "properties": [] + }, { "name": "httpUrl", "description": "Contains an HTTP URL", @@ -12378,6 +16594,47 @@ } ] }, + { + "name": "inlineQueryResultsButtonTypeStartBot", + "description": "Describes the button that opens a private chat with the bot and sends a start message to the bot with the given parameter", + "class": "InlineQueryResultsButtonType", + "properties": [ + { + "name": "parameter", + "type": "string", + "description": "The parameter for the bot start message" + } + ] + }, + { + "name": "inlineQueryResultsButtonTypeWebApp", + "description": "Describes the button that opens a Web App by calling getWebAppUrl", + "class": "InlineQueryResultsButtonType", + "properties": [ + { + "name": "url", + "type": "string", + "description": "An HTTP URL to pass to getWebAppUrl" + } + ] + }, + { + "name": "inlineQueryResultsButton", + "description": "Represents a button to be shown above inline query results", + "class": "InlineQueryResultsButton", + "properties": [ + { + "name": "text", + "type": "string", + "description": "The text of the button" + }, + { + "name": "type", + "type": "InlineQueryResultsButtonType", + "description": "Type of the button" + } + ] + }, { "name": "inlineQueryResults", "description": "Represents the results of the inline query. Use sendInlineQueryResultMessage to send the result of the query", @@ -12389,9 +16646,9 @@ "description": "Unique identifier of the inline query" }, { - "name": "next_offset", - "type": "string", - "description": "The offset for the next request. If empty, there are no more results" + "name": "button", + "type": "inlineQueryResultsButton", + "description": "Button to be shown above inline query results; may be null" }, { "name": "results", @@ -12399,14 +16656,9 @@ "description": "Results of the query" }, { - "name": "switch_pm_text", + "name": "next_offset", "type": "string", - "description": "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" - }, - { - "name": "switch_pm_parameter", - "type": "string", - "description": "Parameter for the bot start message" + "description": "The offset for the next request. If empty, then there are no more results" } ] }, @@ -12604,6 +16856,11 @@ "name": "invite_link", "type": "chatInviteLink", "description": "Invite link used to join the chat" + }, + { + "name": "via_chat_folder_invite_link", + "type": "Bool", + "description": "True, if the user has joined the chat using an invite link for a chat folder" } ] }, @@ -12708,6 +16965,23 @@ } ] }, + { + "name": "chatEventBackgroundChanged", + "description": "The chat background was changed", + "class": "ChatEventAction", + "properties": [ + { + "name": "old_background", + "type": "chatBackground", + "description": "Previous background; may be null if none" + }, + { + "name": "new_background", + "type": "chatBackground", + "description": "New background; may be null if none" + } + ] + }, { "name": "chatEventDescriptionChanged", "description": "The chat description was changed", @@ -12725,6 +16999,23 @@ } ] }, + { + "name": "chatEventEmojiStatusChanged", + "description": "The chat emoji status was changed", + "class": "ChatEventAction", + "properties": [ + { + "name": "old_emoji_status", + "type": "emojiStatus", + "description": "Previous emoji status; may be null if none" + }, + { + "name": "new_emoji_status", + "type": "emojiStatus", + "description": "New emoji status; may be null if none" + } + ] + }, { "name": "chatEventLinkedChatChanged", "description": "The linked chat of a supergroup was changed", @@ -12778,7 +17069,7 @@ }, { "name": "chatEventPermissionsChanged", - "description": "The chat permissions was changed", + "description": "The chat permissions were changed", "class": "ChatEventAction", "properties": [ { @@ -12844,6 +17135,23 @@ } ] }, + { + "name": "chatEventCustomEmojiStickerSetChanged", + "description": "The supergroup sticker set with allowed custom emoji was changed", + "class": "ChatEventAction", + "properties": [ + { + "name": "old_sticker_set_id", + "type": "int64", + "description": "Previous identifier of the chat sticker set; 0 if none" + }, + { + "name": "new_sticker_set_id", + "type": "int64", + "description": "New identifier of the chat sticker set; 0 if none" + } + ] + }, { "name": "chatEventTitleChanged", "description": "The chat title was changed", @@ -12895,6 +17203,60 @@ } ] }, + { + "name": "chatEventAccentColorChanged", + "description": "The chat accent color or background custom emoji were changed", + "class": "ChatEventAction", + "properties": [ + { + "name": "old_accent_color_id", + "type": "int32", + "description": "Previous identifier of chat accent color" + }, + { + "name": "old_background_custom_emoji_id", + "type": "int64", + "description": "Previous identifier of the custom emoji; 0 if none" + }, + { + "name": "new_accent_color_id", + "type": "int32", + "description": "New identifier of chat accent color" + }, + { + "name": "new_background_custom_emoji_id", + "type": "int64", + "description": "New identifier of the custom emoji; 0 if none" + } + ] + }, + { + "name": "chatEventProfileAccentColorChanged", + "description": "The chat's profile accent color or profile background custom emoji were changed", + "class": "ChatEventAction", + "properties": [ + { + "name": "old_profile_accent_color_id", + "type": "int32", + "description": "Previous identifier of chat's profile accent color; -1 if none" + }, + { + "name": "old_profile_background_custom_emoji_id", + "type": "int64", + "description": "Previous identifier of the custom emoji; 0 if none" + }, + { + "name": "new_profile_accent_color_id", + "type": "int32", + "description": "New identifier of chat's profile accent color; -1 if none" + }, + { + "name": "new_profile_background_custom_emoji_id", + "type": "int64", + "description": "New identifier of the custom emoji; 0 if none" + } + ] + }, { "name": "chatEventHasProtectedContentToggled", "description": "The has_protected_content setting of a channel was toggled", @@ -13470,14 +17832,14 @@ "properties": [] }, { - "name": "premiumLimitTypeChatFilterCount", - "description": "The maximum number of chat filters", + "name": "premiumLimitTypeChatFolderCount", + "description": "The maximum number of chat folders", "class": "PremiumLimitType", "properties": [] }, { - "name": "premiumLimitTypeChatFilterChosenChatCount", - "description": "The maximum number of pinned and always included, or always excluded chats in a chat filter", + "name": "premiumLimitTypeChatFolderChosenChatCount", + "description": "The maximum number of pinned and always included, or always excluded chats in a chat folder", "class": "PremiumLimitType", "properties": [] }, @@ -13487,6 +17849,12 @@ "class": "PremiumLimitType", "properties": [] }, + { + "name": "premiumLimitTypePinnedSavedMessagesTopicCount", + "description": "The maximum number of pinned Saved Messages topics", + "class": "PremiumLimitType", + "properties": [] + }, { "name": "premiumLimitTypeCaptionLength", "description": "The maximum length of sent media caption", @@ -13499,6 +17867,54 @@ "class": "PremiumLimitType", "properties": [] }, + { + "name": "premiumLimitTypeChatFolderInviteLinkCount", + "description": "The maximum number of invite links for a chat folder", + "class": "PremiumLimitType", + "properties": [] + }, + { + "name": "premiumLimitTypeShareableChatFolderCount", + "description": "The maximum number of added shareable chat folders", + "class": "PremiumLimitType", + "properties": [] + }, + { + "name": "premiumLimitTypeActiveStoryCount", + "description": "The maximum number of active stories", + "class": "PremiumLimitType", + "properties": [] + }, + { + "name": "premiumLimitTypeWeeklySentStoryCount", + "description": "The maximum number of stories sent per week", + "class": "PremiumLimitType", + "properties": [] + }, + { + "name": "premiumLimitTypeMonthlySentStoryCount", + "description": "The maximum number of stories sent per month", + "class": "PremiumLimitType", + "properties": [] + }, + { + "name": "premiumLimitTypeStoryCaptionLength", + "description": "The maximum length of captions of sent stories", + "class": "PremiumLimitType", + "properties": [] + }, + { + "name": "premiumLimitTypeStorySuggestedReactionAreaCount", + "description": "The maximum number of suggested reaction areas on a story", + "class": "PremiumLimitType", + "properties": [] + }, + { + "name": "premiumLimitTypeSimilarChatCount", + "description": "The maximum number of received similar chats", + "class": "PremiumLimitType", + "properties": [] + }, { "name": "premiumFeatureIncreasedLimits", "description": "Increased limits", @@ -13561,7 +17977,7 @@ }, { "name": "premiumFeatureEmojiStatus", - "description": "A emoji status shown along with the user's name", + "description": "The ability to show an emoji status along with the user's name", "class": "PremiumFeature", "properties": [] }, @@ -13579,10 +17995,172 @@ }, { "name": "premiumFeatureAppIcons", - "description": "Allowed to set a premium appllication icons", + "description": "Allowed to set a premium application icons", "class": "PremiumFeature", "properties": [] }, + { + "name": "premiumFeatureRealTimeChatTranslation", + "description": "Allowed to translate chat messages real-time", + "class": "PremiumFeature", + "properties": [] + }, + { + "name": "premiumFeatureUpgradedStories", + "description": "Allowed to use many additional features for stories", + "class": "PremiumFeature", + "properties": [] + }, + { + "name": "premiumFeatureChatBoost", + "description": "The ability to boost chats", + "class": "PremiumFeature", + "properties": [] + }, + { + "name": "premiumFeatureAccentColor", + "description": "The ability to choose accent color for replies and user profile", + "class": "PremiumFeature", + "properties": [] + }, + { + "name": "premiumFeatureBackgroundForBoth", + "description": "The ability to set private chat background for both users", + "class": "PremiumFeature", + "properties": [] + }, + { + "name": "premiumFeatureSavedMessagesTags", + "description": "The ability to use tags in Saved Messages", + "class": "PremiumFeature", + "properties": [] + }, + { + "name": "premiumFeatureMessagePrivacy", + "description": "The ability to disallow incoming voice and video note messages in private chats using setUserPrivacySettingRules with userPrivacySettingAllowPrivateVoiceAndVideoNoteMessages and to restrict incoming messages from non-contacts using setNewChatPrivacySettings", + "class": "PremiumFeature", + "properties": [] + }, + { + "name": "premiumFeatureLastSeenTimes", + "description": "The ability to view last seen and read times of other users even they can't view last seen or read time for the current user", + "class": "PremiumFeature", + "properties": [] + }, + { + "name": "premiumFeatureBusiness", + "description": "The ability to use Business features", + "class": "PremiumFeature", + "properties": [] + }, + { + "name": "businessFeatureLocation", + "description": "The ability to set location", + "class": "BusinessFeature", + "properties": [] + }, + { + "name": "businessFeatureOpeningHours", + "description": "The ability to set opening hours", + "class": "BusinessFeature", + "properties": [] + }, + { + "name": "businessFeatureQuickReplies", + "description": "The ability to use quick replies", + "class": "BusinessFeature", + "properties": [] + }, + { + "name": "businessFeatureGreetingMessage", + "description": "The ability to set up a greeting message", + "class": "BusinessFeature", + "properties": [] + }, + { + "name": "businessFeatureAwayMessage", + "description": "The ability to set up an away message", + "class": "BusinessFeature", + "properties": [] + }, + { + "name": "businessFeatureAccountLinks", + "description": "The ability to create links to the business account with predefined message text", + "class": "BusinessFeature", + "properties": [] + }, + { + "name": "businessFeatureIntro", + "description": "The ability to customize intro", + "class": "BusinessFeature", + "properties": [] + }, + { + "name": "businessFeatureBots", + "description": "The ability to connect a bot to the account", + "class": "BusinessFeature", + "properties": [] + }, + { + "name": "businessFeatureEmojiStatus", + "description": "The ability to show an emoji status along with the business name", + "class": "BusinessFeature", + "properties": [] + }, + { + "name": "businessFeatureChatFolderTags", + "description": "The ability to display folder names for each chat in the chat list", + "class": "BusinessFeature", + "properties": [] + }, + { + "name": "businessFeatureUpgradedStories", + "description": "Allowed to use many additional features for stories", + "class": "BusinessFeature", + "properties": [] + }, + { + "name": "premiumStoryFeaturePriorityOrder", + "description": "Stories of the current user are displayed before stories of non-Premium contacts, supergroups, and channels", + "class": "PremiumStoryFeature", + "properties": [] + }, + { + "name": "premiumStoryFeatureStealthMode", + "description": "The ability to hide the fact that the user viewed other's stories", + "class": "PremiumStoryFeature", + "properties": [] + }, + { + "name": "premiumStoryFeaturePermanentViewsHistory", + "description": "The ability to check who opened the current user's stories after they expire", + "class": "PremiumStoryFeature", + "properties": [] + }, + { + "name": "premiumStoryFeatureCustomExpirationDuration", + "description": "The ability to set custom expiration duration for stories", + "class": "PremiumStoryFeature", + "properties": [] + }, + { + "name": "premiumStoryFeatureSaveStories", + "description": "The ability to save other's unprotected stories", + "class": "PremiumStoryFeature", + "properties": [] + }, + { + "name": "premiumStoryFeatureLinksAndFormatting", + "description": "The ability to use links and formatting in story caption", + "class": "PremiumStoryFeature", + "properties": [] + }, + { + "name": "premiumStoryFeatureVideoQuality", + "description": "The ability to choose better quality for viewed stories", + "class": "PremiumStoryFeature", + "properties": [] + }, { "name": "premiumLimit", "description": "Contains information about a limit, increased for Premium users", @@ -13627,6 +18205,18 @@ } ] }, + { + "name": "businessFeatures", + "description": "Contains information about features, available to Business user accounts", + "class": "BusinessFeatures", + "properties": [ + { + "name": "features", + "type": "vector\u003cBusinessFeature\u003e", + "description": "The list of available business features" + } + ] + }, { "name": "premiumSourceLimitExceeded", "description": "A limit was exceeded", @@ -13651,6 +18241,30 @@ } ] }, + { + "name": "premiumSourceBusinessFeature", + "description": "A user tried to use a Business feature", + "class": "PremiumSource", + "properties": [ + { + "name": "feature", + "type": "BusinessFeature", + "description": "The used feature; pass null if none specific feature was used" + } + ] + }, + { + "name": "premiumSourceStoryFeature", + "description": "A user tried to use a Premium story feature", + "class": "PremiumSource", + "properties": [ + { + "name": "feature", + "type": "PremiumStoryFeature", + "description": "The used feature" + } + ] + }, { "name": "premiumSourceLink", "description": "A user opened an internal link of the type internalLinkTypePremiumFeatures", @@ -13686,6 +18300,23 @@ } ] }, + { + "name": "businessFeaturePromotionAnimation", + "description": "Describes a promotion animation for a Business feature", + "class": "BusinessFeaturePromotionAnimation", + "properties": [ + { + "name": "feature", + "type": "BusinessFeature", + "description": "Business feature" + }, + { + "name": "animation", + "type": "animation", + "description": "Promotion animation for the feature" + } + ] + }, { "name": "premiumState", "description": "Contains state of Telegram Premium subscription and promotion videos for Premium features", @@ -13698,37 +18329,47 @@ }, { "name": "payment_options", - "type": "vector\u003cpremiumPaymentOption\u003e", + "type": "vector\u003cpremiumStatePaymentOption\u003e", "description": "The list of available options for buying Telegram Premium" }, { "name": "animations", "type": "vector\u003cpremiumFeaturePromotionAnimation\u003e", "description": "The list of available promotion animations for Premium features" + }, + { + "name": "business_animations", + "type": "vector\u003cbusinessFeaturePromotionAnimation\u003e", + "description": "The list of available promotion animations for Business features" } ] }, { "name": "storePaymentPurposePremiumSubscription", - "description": "The user subscribed to Telegram Premium", + "description": "The user subscribing to Telegram Premium", "class": "StorePaymentPurpose", "properties": [ { "name": "is_restore", "type": "Bool", "description": "Pass true if this is a restore of a Telegram Premium purchase; only for App Store" + }, + { + "name": "is_upgrade", + "type": "Bool", + "description": "Pass true if this is an upgrade from a monthly subscription to early subscription; only for App Store" } ] }, { "name": "storePaymentPurposeGiftedPremium", - "description": "The user gifted Telegram Premium to another user", + "description": "The user gifting Telegram Premium to another user", "class": "StorePaymentPurpose", "properties": [ { "name": "user_id", "type": "int53", - "description": "Identifier of the user for which Premium was gifted" + "description": "Identifier of the user to which Premium was gifted" }, { "name": "currency", @@ -13742,6 +18383,125 @@ } ] }, + { + "name": "storePaymentPurposePremiumGiftCodes", + "description": "The user creating Telegram Premium gift codes for other users", + "class": "StorePaymentPurpose", + "properties": [ + { + "name": "boosted_chat_id", + "type": "int53", + "description": "Identifier of the supergroup or channel chat, which will be automatically boosted by the users for duration of the Premium subscription and which is administered by the user; 0 if none" + }, + { + "name": "currency", + "type": "string", + "description": "ISO 4217 currency code of the payment currency" + }, + { + "name": "amount", + "type": "int53", + "description": "Paid amount, in the smallest units of the currency" + }, + { + "name": "user_ids", + "type": "vector\u003cint53\u003e", + "description": "Identifiers of the users which can activate the gift codes" + } + ] + }, + { + "name": "storePaymentPurposePremiumGiveaway", + "description": "The user creating a Telegram Premium giveaway", + "class": "StorePaymentPurpose", + "properties": [ + { + "name": "parameters", + "type": "premiumGiveawayParameters", + "description": "Giveaway parameters" + }, + { + "name": "currency", + "type": "string", + "description": "ISO 4217 currency code of the payment currency" + }, + { + "name": "amount", + "type": "int53", + "description": "Paid amount, in the smallest units of the currency" + } + ] + }, + { + "name": "telegramPaymentPurposePremiumGiftCodes", + "description": "The user creating Telegram Premium gift codes for other users", + "class": "TelegramPaymentPurpose", + "properties": [ + { + "name": "boosted_chat_id", + "type": "int53", + "description": "Identifier of the supergroup or channel chat, which will be automatically boosted by the users for duration of the Premium subscription and which is administered by the user; 0 if none" + }, + { + "name": "currency", + "type": "string", + "description": "ISO 4217 currency code of the payment currency" + }, + { + "name": "amount", + "type": "int53", + "description": "Paid amount, in the smallest units of the currency" + }, + { + "name": "user_ids", + "type": "vector\u003cint53\u003e", + "description": "Identifiers of the users which can activate the gift codes" + }, + { + "name": "month_count", + "type": "int32", + "description": "Number of months the Telegram Premium subscription will be active for the users" + } + ] + }, + { + "name": "telegramPaymentPurposePremiumGiveaway", + "description": "The user creating a Telegram Premium giveaway", + "class": "TelegramPaymentPurpose", + "properties": [ + { + "name": "parameters", + "type": "premiumGiveawayParameters", + "description": "Giveaway parameters" + }, + { + "name": "currency", + "type": "string", + "description": "ISO 4217 currency code of the payment currency" + }, + { + "name": "amount", + "type": "int53", + "description": "Paid amount, in the smallest units of the currency" + }, + { + "name": "winner_count", + "type": "int32", + "description": "Number of users which will be able to activate the gift codes" + }, + { + "name": "month_count", + "type": "int32", + "description": "Number of months the Telegram Premium subscription will be active for the users" + } + ] + }, + { + "name": "//-To", + "description": "", + "class": "https://my.telegram.org", + "properties": [] + }, { "name": "deviceTokenFirebaseCloudMessaging", "description": "A token for Firebase Cloud Messaging", @@ -13904,6 +18664,23 @@ } ] }, + { + "name": "deviceTokenHuaweiPush", + "description": "A token for HUAWEI Push Service", + "class": "DeviceToken", + "properties": [ + { + "name": "token", + "type": "string", + "description": "Device registration token; may be empty to deregister a device" + }, + { + "name": "encrypt", + "type": "Bool", + "description": "True, if push notifications must be additionally encrypted" + } + ] + }, { "name": "pushReceiverId", "description": "Contains a globally unique push receiver identifier, which can be used to identify which account has received a push notification", @@ -14019,51 +18796,14 @@ ] }, { - "name": "background", - "description": "Describes a chat background", - "class": "Background", + "name": "backgroundTypeChatTheme", + "description": "A background from a chat theme; can be used only as a chat background in channels", + "class": "BackgroundType", "properties": [ { - "name": "id", - "type": "int64", - "description": "Unique background identifier" - }, - { - "name": "is_default", - "type": "Bool", - "description": "True, if this is one of default backgrounds" - }, - { - "name": "is_dark", - "type": "Bool", - "description": "True, if the background is dark and is recommended to be used with dark theme" - }, - { - "name": "name", + "name": "theme_name", "type": "string", - "description": "Unique background name" - }, - { - "name": "document", - "type": "document", - "description": "Document with the background; may be null. Null only for filled backgrounds" - }, - { - "name": "type", - "type": "BackgroundType", - "description": "Type of the background" - } - ] - }, - { - "name": "backgrounds", - "description": "Contains a list of backgrounds", - "class": "Backgrounds", - "properties": [ - { - "name": "backgrounds", - "type": "vector\u003cbackground\u003e", - "description": "A list of backgrounds" + "description": "Name of the chat theme" } ] }, @@ -14091,6 +18831,18 @@ } ] }, + { + "name": "inputBackgroundPrevious", + "description": "A background previously set in the chat; for chat backgrounds only", + "class": "InputBackground", + "properties": [ + { + "name": "message_id", + "type": "int53", + "description": "Identifier of the message with the background" + } + ] + }, { "name": "themeSettings", "description": "Describes theme settings", @@ -14145,6 +18897,40 @@ } ] }, + { + "name": "timeZone", + "description": "Describes a time zone", + "class": "TimeZone", + "properties": [ + { + "name": "id", + "type": "string", + "description": "Unique time zone identifier" + }, + { + "name": "name", + "type": "string", + "description": "Time zone name" + }, + { + "name": "utc_time_offset", + "type": "int32", + "description": "Current UTC time offset for the time zone" + } + ] + }, + { + "name": "timeZones", + "description": "Contains a list of time zones", + "class": "TimeZones", + "properties": [ + { + "name": "time_zones", + "type": "vector\u003ctimeZone\u003e", + "description": "A list of time zones" + } + ] + }, { "name": "hashtags", "description": "Contains a list of hashtags", @@ -14157,6 +18943,54 @@ } ] }, + { + "name": "canSendStoryResultOk", + "description": "A story can be sent", + "class": "CanSendStoryResult", + "properties": [] + }, + { + "name": "canSendStoryResultPremiumNeeded", + "description": "The user must subscribe to Telegram Premium to be able to post stories", + "class": "CanSendStoryResult", + "properties": [] + }, + { + "name": "canSendStoryResultBoostNeeded", + "description": "The chat must be boosted first by Telegram Premium subscribers to post more stories. Call getChatBoostStatus to get current boost status of the chat", + "class": "CanSendStoryResult", + "properties": [] + }, + { + "name": "canSendStoryResultActiveStoryLimitExceeded", + "description": "The limit for the number of active stories exceeded. The user can buy Telegram Premium, delete an active story, or wait for the oldest story to expire", + "class": "CanSendStoryResult", + "properties": [] + }, + { + "name": "canSendStoryResultWeeklyLimitExceeded", + "description": "The weekly limit for the number of posted stories exceeded. The user needs to buy Telegram Premium or wait specified time", + "class": "CanSendStoryResult", + "properties": [ + { + "name": "retry_after", + "type": "int32", + "description": "Time left before the user can send the next story" + } + ] + }, + { + "name": "canSendStoryResultMonthlyLimitExceeded", + "description": "The monthly limit for the number of posted stories exceeded. The user needs to buy Telegram Premium or wait specified time", + "class": "CanSendStoryResult", + "properties": [ + { + "name": "retry_after", + "type": "int32", + "description": "Time left before the user can send the next story" + } + ] + }, { "name": "canTransferOwnershipResultOk", "description": "The session can be used", @@ -14213,7 +19047,7 @@ }, { "name": "checkChatUsernameResultUsernamePurchasable", - "description": "The username can be purchased at fragment.com", + "description": "The username can be purchased at https://fragment.com. Information about the username can be received using getCollectibleItemInfo", "class": "CheckChatUsernameResult", "properties": [] }, @@ -14279,7 +19113,7 @@ }, { "name": "messageFileTypePrivate", - "description": "The messages was exported from a private chat", + "description": "The messages were exported from a private chat", "class": "MessageFileType", "properties": [ { @@ -14291,7 +19125,7 @@ }, { "name": "messageFileTypeGroup", - "description": "The messages was exported from a group chat", + "description": "The messages were exported from a group chat", "class": "MessageFileType", "properties": [ { @@ -14303,7 +19137,7 @@ }, { "name": "messageFileTypeUnknown", - "description": "The messages was exported from a chat of unknown type", + "description": "The messages were exported from a chat of unknown type", "class": "MessageFileType", "properties": [] }, @@ -14520,6 +19354,40 @@ } ] }, + { + "name": "pushMessageContentPremiumGiftCode", + "description": "A message with a Telegram Premium gift code created for the user", + "class": "PushMessageContent", + "properties": [ + { + "name": "month_count", + "type": "int32", + "description": "Number of months the Telegram Premium subscription will be active after code activation" + } + ] + }, + { + "name": "pushMessageContentPremiumGiveaway", + "description": "A message with a Telegram Premium giveaway", + "class": "PushMessageContent", + "properties": [ + { + "name": "winner_count", + "type": "int32", + "description": "Number of users which will receive Telegram Premium subscription gift codes; 0 for pinned message" + }, + { + "name": "month_count", + "type": "int32", + "description": "Number of months the Telegram Premium subscription will be active after code activation; 0 for pinned message" + }, + { + "name": "is_pinned", + "type": "Bool", + "description": "True, if the message is a pinned message with the specified content" + } + ] + }, { "name": "pushMessageContentScreenshotTaken", "description": "A screenshot of a message in the chat has been taken", @@ -14548,6 +19416,18 @@ } ] }, + { + "name": "pushMessageContentStory", + "description": "A message with a story", + "class": "PushMessageContent", + "properties": [ + { + "name": "is_pinned", + "type": "Bool", + "description": "True, if the message is a pinned message with the specified content" + } + ] + }, { "name": "pushMessageContentText", "description": "A text message", @@ -14672,6 +19552,18 @@ } ] }, + { + "name": "pushMessageContentChatSetBackground", + "description": "A chat background was edited", + "class": "PushMessageContent", + "properties": [ + { + "name": "is_same", + "type": "Bool", + "description": "True, if the set background is the same as the background of the current user" + } + ] + }, { "name": "pushMessageContentChatSetTheme", "description": "A chat theme was edited", @@ -14680,7 +19572,7 @@ { "name": "theme_name", "type": "string", - "description": "If non-empty, name of a new theme, set for the chat. Otherwise chat theme was reset to the default one" + "description": "If non-empty, name of a new theme, set for the chat. Otherwise, the chat theme was reset to the default one" } ] }, @@ -14720,7 +19612,7 @@ }, { "name": "pushMessageContentRecurringPayment", - "description": "A new recurrent payment was made by the current user", + "description": "A new recurring payment was made by the current user", "class": "PushMessageContent", "properties": [ { @@ -14823,7 +19715,7 @@ { "name": "message_id", "type": "int53", - "description": "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" + "description": "The message identifier. The message will not be available in the chat history, but the identifier can be used in viewMessages, or as a message to be replied in the same chat" }, { "name": "sender_id", @@ -15104,6 +19996,48 @@ } ] }, + { + "name": "storyPrivacySettingsEveryone", + "description": "The story can be viewed by everyone", + "class": "StoryPrivacySettings", + "properties": [ + { + "name": "except_user_ids", + "type": "vector\u003cint53\u003e", + "description": "Identifiers of the users that can't see the story; always unknown and empty for non-owned stories" + } + ] + }, + { + "name": "storyPrivacySettingsContacts", + "description": "The story can be viewed by all contacts except chosen users", + "class": "StoryPrivacySettings", + "properties": [ + { + "name": "except_user_ids", + "type": "vector\u003cint53\u003e", + "description": "User identifiers of the contacts that can't see the story; always unknown and empty for non-owned stories" + } + ] + }, + { + "name": "storyPrivacySettingsCloseFriends", + "description": "The story can be viewed by all close friends", + "class": "StoryPrivacySettings", + "properties": [] + }, + { + "name": "storyPrivacySettingsSelectedUsers", + "description": "The story can be viewed by certain specified users", + "class": "StoryPrivacySettings", + "properties": [ + { + "name": "user_ids", + "type": "vector\u003cint53\u003e", + "description": "Identifiers of the users; always unknown and empty for non-owned stories" + } + ] + }, { "name": "userPrivacySettingRuleAllowAll", "description": "A rule to allow all users to do something", @@ -15112,7 +20046,13 @@ }, { "name": "userPrivacySettingRuleAllowContacts", - "description": "A rule to allow all of a user's contacts to do something", + "description": "A rule to allow all contacts of the user to do something", + "class": "UserPrivacySettingRule", + "properties": [] + }, + { + "name": "userPrivacySettingRuleAllowPremiumUsers", + "description": "A rule to allow all Premium Users to do something; currently, allowed only for userPrivacySettingAllowChatInvites", "class": "UserPrivacySettingRule", "properties": [] }, @@ -15148,7 +20088,7 @@ }, { "name": "userPrivacySettingRuleRestrictContacts", - "description": "A rule to restrict all contacts of a user from doing something", + "description": "A rule to restrict all contacts of the user from doing something", "class": "UserPrivacySettingRule", "properties": [] }, @@ -15212,6 +20152,18 @@ "class": "UserPrivacySetting", "properties": [] }, + { + "name": "userPrivacySettingShowBio", + "description": "A privacy setting for managing whether the user's bio is visible", + "class": "UserPrivacySetting", + "properties": [] + }, + { + "name": "userPrivacySettingShowBirthdate", + "description": "A privacy setting for managing whether the user's birthdate is visible", + "class": "UserPrivacySetting", + "properties": [] + }, { "name": "userPrivacySettingAllowChatInvites", "description": "A privacy setting for managing whether the user can be invited to chats", @@ -15238,10 +20190,52 @@ }, { "name": "userPrivacySettingAllowPrivateVoiceAndVideoNoteMessages", - "description": "A privacy setting for managing whether the user can receive voice and video messages in private chats", + "description": "A privacy setting for managing whether the user can receive voice and video messages in private chats; for Telegram Premium users only", "class": "UserPrivacySetting", "properties": [] }, + { + "name": "readDatePrivacySettings", + "description": "Contains privacy settings for message read date in private chats. Read dates are always shown to the users that can see online status of the current user regardless of this setting", + "class": "ReadDatePrivacySettings", + "properties": [ + { + "name": "show_read_date", + "type": "Bool", + "description": "True, if message read date is shown to other users in private chats. If false and the current user isn't a Telegram Premium user, then they will not be able to see other's message read date." + } + ] + }, + { + "name": "newChatPrivacySettings", + "description": "Contains privacy settings for new chats with non-contacts", + "class": "NewChatPrivacySettings", + "properties": [ + { + "name": "allow_new_chats_from_unknown_users", + "type": "Bool", + "description": "True, if non-contacts users are able to write first to the current user. Telegram Premium subscribers are able to write first regardless of this setting" + } + ] + }, + { + "name": "canSendMessageToUserResultOk", + "description": "The user can be messaged", + "class": "CanSendMessageToUserResult", + "properties": [] + }, + { + "name": "canSendMessageToUserResultUserIsDeleted", + "description": "The user can't be messaged, because they are deleted or unknown", + "class": "CanSendMessageToUserResult", + "properties": [] + }, + { + "name": "canSendMessageToUserResultUserRestrictsNewChats", + "description": "The user can't be messaged, because they restrict new chats with non-contacts", + "class": "CanSendMessageToUserResult", + "properties": [] + }, { "name": "accountTtl", "description": "Contains information about the period of inactivity after which the current user's account will automatically be deleted", @@ -15388,6 +20382,11 @@ "type": "Bool", "description": "True, if a 2-step verification password is needed to complete authorization of the session" }, + { + "name": "is_unconfirmed", + "type": "Bool", + "description": "True, if the session wasn't confirmed from another session" + }, { "name": "can_accept_secret_chats", "type": "Bool", @@ -15449,19 +20448,14 @@ "description": "Point in time (Unix timestamp) when the session was last used" }, { - "name": "ip", + "name": "ip_address", "type": "string", "description": "IP address from which the session was created, in human-readable format" }, { - "name": "country", + "name": "location", "type": "string", - "description": "A two-letter country code for the country from which the session was created, based on the IP address" - }, - { - "name": "region", - "type": "string", - "description": "Region code from which the session was created, based on the IP address" + "description": "A human-readable description of the location from which the session was created, based on the IP address" } ] }, @@ -15482,6 +20476,33 @@ } ] }, + { + "name": "unconfirmedSession", + "description": "Contains information about an unconfirmed session", + "class": "UnconfirmedSession", + "properties": [ + { + "name": "id", + "type": "int64", + "description": "Session identifier" + }, + { + "name": "log_in_date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the user has logged in" + }, + { + "name": "device_model", + "type": "string", + "description": "Model of the device that was used for the session creation, as provided by the application" + }, + { + "name": "location", + "type": "string", + "description": "A human-readable description of the location from which the session was created, based on the IP address" + } + ] + }, { "name": "connectedWebsite", "description": "Contains information about one website the current user is logged in with Telegram", @@ -15523,7 +20544,7 @@ "description": "Point in time (Unix timestamp) when obtained authorization was last used" }, { - "name": "ip", + "name": "ip_address", "type": "string", "description": "IP address from which the user was logged in, in human-readable format" }, @@ -15547,63 +20568,63 @@ ] }, { - "name": "chatReportReasonSpam", + "name": "reportReasonSpam", "description": "The chat contains spam messages", - "class": "ChatReportReason", + "class": "ReportReason", "properties": [] }, { - "name": "chatReportReasonViolence", + "name": "reportReasonViolence", "description": "The chat promotes violence", - "class": "ChatReportReason", + "class": "ReportReason", "properties": [] }, { - "name": "chatReportReasonPornography", + "name": "reportReasonPornography", "description": "The chat contains pornographic messages", - "class": "ChatReportReason", + "class": "ReportReason", "properties": [] }, { - "name": "chatReportReasonChildAbuse", + "name": "reportReasonChildAbuse", "description": "The chat has child abuse related content", - "class": "ChatReportReason", + "class": "ReportReason", "properties": [] }, { - "name": "chatReportReasonCopyright", + "name": "reportReasonCopyright", "description": "The chat contains copyrighted content", - "class": "ChatReportReason", + "class": "ReportReason", "properties": [] }, { - "name": "chatReportReasonUnrelatedLocation", + "name": "reportReasonUnrelatedLocation", "description": "The location-based chat is unrelated to its stated location", - "class": "ChatReportReason", + "class": "ReportReason", "properties": [] }, { - "name": "chatReportReasonFake", + "name": "reportReasonFake", "description": "The chat represents a fake account", - "class": "ChatReportReason", + "class": "ReportReason", "properties": [] }, { - "name": "chatReportReasonIllegalDrugs", + "name": "reportReasonIllegalDrugs", "description": "The chat has illegal drugs related content", - "class": "ChatReportReason", + "class": "ReportReason", "properties": [] }, { - "name": "chatReportReasonPersonalDetails", + "name": "reportReasonPersonalDetails", "description": "The chat contains messages with personal details", - "class": "ChatReportReason", + "class": "ReportReason", "properties": [] }, { - "name": "chatReportReasonCustom", + "name": "reportReasonCustom", "description": "A custom reason provided by the user", - "class": "ChatReportReason", + "class": "ReportReason", "properties": [] }, { @@ -15653,13 +20674,13 @@ }, { "name": "internalLinkTypeActiveSessions", - "description": "The link is a link to the active sessions section of the application. Use getActiveSessions to handle the link", + "description": "The link is a link to the Devices section of the application. Use getActiveSessions to get the list of active sessions and show them to the user", "class": "InternalLinkType", "properties": [] }, { "name": "internalLinkTypeAttachmentMenuBot", - "description": "The link is a link to an attachment menu bot to be opened in the specified or a chosen chat. Process given target_chat to open the chat. Then call searchPublicChat with the given bot username, check that the user is a bot and can be added to attachment menu. Then use getAttachmentMenuBot to receive information about the bot. If the bot isn't added to attachment menu, then user needs to confirm adding the bot to attachment menu. If user confirms adding, then use toggleBotIsAddedToAttachmentMenu to add it. If the attachment menu bot can't be used in the opened chat, show an error to the user. If the bot is added to attachment menu and can be used in the chat, then use openWebApp with the given URL", + "description": "The link is a link to an attachment menu bot to be opened in the specified or a chosen chat. Process given target_chat to open the chat. Then, call searchPublicChat with the given bot username, check that the user is a bot and can be added to attachment menu. Then, use getAttachmentMenuBot to receive information about the bot. If the bot isn't added to attachment menu, then show a disclaimer about Mini Apps being a third-party apps, ask the user to accept their Terms of service and confirm adding the bot to side and attachment menu. If the user accept the terms and confirms adding, then use toggleBotIsAddedToAttachmentMenu to add the bot. If the attachment menu bot can't be used in the opened chat, show an error to the user. If the bot is added to attachment menu and can be used in the chat, then use openWebApp with the given URL", "class": "InternalLinkType", "properties": [ { @@ -15693,7 +20714,7 @@ }, { "name": "internalLinkTypeBackground", - "description": "The link is a link to a background. Call searchBackground with the given background name to process the link", + "description": "The link is a link to a background. Call searchBackground with the given background name to process the link If background is found and the user wants to apply it, then call setDefaultBackground", "class": "InternalLinkType", "properties": [ { @@ -15703,6 +20724,23 @@ } ] }, + { + "name": "internalLinkTypeBotAddToChannel", + "description": "The link is a link to a Telegram bot, which is supposed to be added to a channel chat as an administrator. Call searchPublicChat with the given bot username and check that the user is a bot, ask the current user to select a channel chat to add the bot to as an administrator. Then, call getChatMember to receive the current bot rights in the chat and if the bot already is an administrator, check that the current user can edit its administrator rights and combine received rights with the requested administrator rights. Then, show confirmation box to the user, and call setChatMemberStatus with the chosen chat and confirmed rights", + "class": "InternalLinkType", + "properties": [ + { + "name": "bot_username", + "type": "string", + "description": "Username of the bot" + }, + { + "name": "administrator_rights", + "type": "chatAdministratorRights", + "description": "Expected administrator rights for the bot" + } + ] + }, { "name": "internalLinkTypeBotStart", "description": "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", @@ -15727,7 +20765,7 @@ }, { "name": "internalLinkTypeBotStartInGroup", - "description": "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 basic group or a supergroup chat to add the bot to, taking into account that bots can be added to a public supergroup only by administrators of the supergroup. If administrator rights are provided by the link, call getChatMember to receive the current bot rights in the chat and if the bot already is an administrator, check that the current user can edit its administrator rights, combine received rights with the requested administrator rights, show confirmation box to the user, and call setChatMemberStatus with the chosen chat and confirmed administrator rights. Before call to setChatMemberStatus it may be required to upgrade the chosen basic group chat to a supergroup chat. Then if start_parameter isn't empty, call sendBotStartMessage with the given start parameter and the chosen chat, otherwise just send /start message with bot's username added to the chat.", + "description": "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 basic group or a supergroup chat to add the bot to, taking into account that bots can be added to a public supergroup only by administrators of the supergroup. If administrator rights are provided by the link, call getChatMember to receive the current bot rights in the chat and if the bot already is an administrator, check that the current user can edit its administrator rights, combine received rights with the requested administrator rights, show confirmation box to the user, and call setChatMemberStatus with the chosen chat and confirmed administrator rights. Before call to setChatMemberStatus it may be required to upgrade the chosen basic group chat to a supergroup chat. Then, if start_parameter isn't empty, call sendBotStartMessage with the given start parameter and the chosen chat; otherwise, just send /start message with bot's username added to the chat.", "class": "InternalLinkType", "properties": [ { @@ -15747,32 +20785,45 @@ } ] }, - { - "name": "internalLinkTypeBotAddToChannel", - "description": "The link is a link to a Telegram bot, which is supposed to be added to a channel chat as an administrator. Call searchPublicChat with the given bot username and check that the user is a bot, ask the current user to select a channel chat to add the bot to as an administrator. Then call getChatMember to receive the current bot rights in the chat and if the bot already is an administrator, check that the current user can edit its administrator rights and combine received rights with the requested administrator rights. Then show confirmation box to the user, and call setChatMemberStatus with the chosen chat and confirmed rights", - "class": "InternalLinkType", - "properties": [ - { - "name": "bot_username", - "type": "string", - "description": "Username of the bot" - }, - { - "name": "administrator_rights", - "type": "chatAdministratorRights", - "description": "Expected administrator rights for the bot" - } - ] - }, { "name": "internalLinkTypeChangePhoneNumber", "description": "The link is a link to the change phone number section of the app", "class": "InternalLinkType", "properties": [] }, + { + "name": "internalLinkTypeChatBoost", + "description": "The link is a link to boost a Telegram chat. Call getChatBoostLinkInfo with the given URL to process the link. If the chat is found, then call getChatBoostStatus and getAvailableChatBoostSlots to get the current boost status and check whether the chat can be boosted. If the user wants to boost the chat and the chat can be boosted, then call boostChat", + "class": "InternalLinkType", + "properties": [ + { + "name": "url", + "type": "string", + "description": "URL to be passed to getChatBoostLinkInfo" + } + ] + }, + { + "name": "internalLinkTypeChatFolderInvite", + "description": "The link is an invite link to a chat folder. Call checkChatFolderInviteLink with the given invite link to process the link. If the link is valid and the user wants to join the chat folder, then call addChatFolderByInviteLink", + "class": "InternalLinkType", + "properties": [ + { + "name": "invite_link", + "type": "string", + "description": "Internal representation of the invite link" + } + ] + }, + { + "name": "internalLinkTypeChatFolderSettings", + "description": "The link is a link to the folder section of the app settings", + "class": "InternalLinkType", + "properties": [] + }, { "name": "internalLinkTypeChatInvite", - "description": "The link is a chat invite link. Call checkChatInviteLink with the given invite link to process the link", + "description": "The link is a chat invite link. Call checkChatInviteLink with the given invite link to process the link. If the link is valid and the user wants to join the chat, then call joinChatByInviteLink", "class": "InternalLinkType", "properties": [ { @@ -15794,12 +20845,6 @@ "class": "InternalLinkType", "properties": [] }, - { - "name": "internalLinkTypeFilterSettings", - "description": "The link is a link to the filter section of the app settings", - "class": "InternalLinkType", - "properties": [] - }, { "name": "internalLinkTypeGame", "description": "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", @@ -15819,7 +20864,7 @@ }, { "name": "internalLinkTypeInstantView", - "description": "The link must be opened in an Instant View. Call getWebPageInstantView with the given URL to process the link", + "description": "The link must be opened in an Instant View. Call getWebPageInstantView with the given URL to process the link. If Instant View is found, then show it, otherwise, open the fallback URL in an external browser", "class": "InternalLinkType", "properties": [ { @@ -15848,7 +20893,7 @@ }, { "name": "internalLinkTypeLanguagePack", - "description": "The link is a link to a language pack. Call getLanguagePackInfo with the given language pack identifier to process the link", + "description": "The link is a link to a language pack. Call getLanguagePackInfo with the given language pack identifier to process the link. If the language pack is found and the user wants to apply it, then call setOption for the option \"language_pack_id\"", "class": "InternalLinkType", "properties": [ { @@ -15866,7 +20911,7 @@ }, { "name": "internalLinkTypeMessage", - "description": "The link is a link to a Telegram message or a forum topic. Call getMessageLinkInfo with the given URL to process the link", + "description": "The link is a link to a Telegram message or a forum topic. Call getMessageLinkInfo with the given URL to process the link, and then open received forum topic or chat and show the message there", "class": "InternalLinkType", "properties": [ { @@ -15895,13 +20940,13 @@ }, { "name": "internalLinkTypePassportDataRequest", - "description": "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 application, otherwise ignore it", + "description": "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 application; otherwise, ignore it", "class": "InternalLinkType", "properties": [ { "name": "bot_user_id", "type": "int53", - "description": "User identifier of the service's bot" + "description": "User identifier of the service's bot; the corresponding user may be unknown yet" }, { "name": "scope", @@ -15921,13 +20966,13 @@ { "name": "callback_url", "type": "string", - "description": "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" + "description": "An HTTP URL to open once the request is finished, canceled, or failed with the parameters tg_passport=success, tg_passport=cancel, or tg_passport=error\u0026error=... respectively. If empty, then onActivityResult method must be used to return response on Android, or the link tgbot{bot_user_id}://passport/success or tgbot{bot_user_id}://passport/cancel must be opened otherwise" } ] }, { "name": "internalLinkTypePhoneNumberConfirmation", - "description": "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", + "description": "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. If succeeded, call checkPhoneNumberConfirmationCode to check entered by the user code, or resendPhoneNumberConfirmationCode to resend it", "class": "InternalLinkType", "properties": [ { @@ -15944,7 +20989,7 @@ }, { "name": "internalLinkTypePremiumFeatures", - "description": "The link is a link to the Premium features screen of the applcation from which the user can subscribe to Telegram Premium. Call getPremiumFeatures with the given referrer to process the link", + "description": "The link is a link to the Premium features screen of the application from which the user can subscribe to Telegram Premium. Call getPremiumFeatures with the given referrer to process the link", "class": "InternalLinkType", "properties": [ { @@ -15954,6 +20999,30 @@ } ] }, + { + "name": "internalLinkTypePremiumGift", + "description": "The link is a link to the screen for gifting Telegram Premium subscriptions to friends via inputInvoiceTelegram payments or in-store purchases", + "class": "InternalLinkType", + "properties": [ + { + "name": "referrer", + "type": "string", + "description": "Referrer specified in the link" + } + ] + }, + { + "name": "internalLinkTypePremiumGiftCode", + "description": "The link is a link with a Telegram Premium gift code. Call checkPremiumGiftCode with the given code to process the link. If the code is valid and the user wants to apply it, then call applyPremiumGiftCode", + "class": "InternalLinkType", + "properties": [ + { + "name": "code", + "type": "string", + "description": "The Telegram Premium gift code" + } + ] + }, { "name": "internalLinkTypePrivacyAndSecuritySettings", "description": "The link is a link to the privacy and security section of the app settings", @@ -15968,7 +21037,7 @@ { "name": "server", "type": "string", - "description": "Proxy server IP address" + "description": "Proxy server domain or IP address" }, { "name": "port", @@ -15984,7 +21053,7 @@ }, { "name": "internalLinkTypePublicChat", - "description": "The link is a link to a chat by its username. Call searchPublicChat with the given chat username to process the link", + "description": "The link is a link to a chat by its username. Call searchPublicChat with the given chat username to process the link If the chat is found, open its profile information screen or the chat itself", "class": "InternalLinkType", "properties": [ { @@ -16012,9 +21081,26 @@ "class": "InternalLinkType", "properties": [] }, + { + "name": "internalLinkTypeSideMenuBot", + "description": "The link is a link to a bot, which can be installed to the side menu. Call searchPublicChat with the given bot username, check that the user is a bot and can be added to attachment menu. Then, use getAttachmentMenuBot to receive information about the bot. If the bot isn't added to side menu, then show a disclaimer about Mini Apps being a third-party apps, ask the user to accept their Terms of service and confirm adding the bot to side and attachment menu. If the user accept the terms and confirms adding, then use toggleBotIsAddedToAttachmentMenu to add the bot. If the bot is added to side menu, then use getWebAppUrl with the given URL and open the returned URL as a Web App", + "class": "InternalLinkType", + "properties": [ + { + "name": "bot_username", + "type": "string", + "description": "Username of the bot" + }, + { + "name": "url", + "type": "string", + "description": "URL to be passed to getWebAppUrl" + } + ] + }, { "name": "internalLinkTypeStickerSet", - "description": "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", + "description": "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. If the sticker set is found and the user wants to add it, then call changeStickerSet", "class": "InternalLinkType", "properties": [ { @@ -16029,6 +21115,23 @@ } ] }, + { + "name": "internalLinkTypeStory", + "description": "The link is a link to a story. Call searchPublicChat with the given sender username, then call getStory with the received chat identifier and the given story identifier, then show the story if received", + "class": "InternalLinkType", + "properties": [ + { + "name": "story_sender_username", + "type": "string", + "description": "Username of the sender of the story" + }, + { + "name": "story_id", + "type": "int32", + "description": "Story identifier" + } + ] + }, { "name": "internalLinkTypeTheme", "description": "The link is a link to a theme. TDLib has no theme support yet", @@ -16067,7 +21170,7 @@ }, { "name": "internalLinkTypeUserPhoneNumber", - "description": "The link is a link to a user by its phone number. Call searchUserByPhoneNumber with the given phone number to process the link", + "description": "The link is a link to a user by its phone number. Call searchUserByPhoneNumber with the given phone number to process the link. If the user is found, then call createPrivateChat and open the chat", "class": "InternalLinkType", "properties": [ { @@ -16079,7 +21182,7 @@ }, { "name": "internalLinkTypeUserToken", - "description": "The link is a link to a user by a temporary token. Call searchUserByToken with the given token to process the link", + "description": "The link is a link to a user by a temporary token. Call searchUserByToken with the given token to process the link. If the user is found, then call createPrivateChat and open the chat", "class": "InternalLinkType", "properties": [ { @@ -16111,6 +21214,28 @@ } ] }, + { + "name": "internalLinkTypeWebApp", + "description": "The link is a link to a Web App. Call searchPublicChat with the given bot username, check that the user is a bot, then call searchWebApp with the received bot and the given web_app_short_name. Process received foundWebApp by showing a confirmation dialog if needed. If the bot can be added to attachment or side menu, but isn't added yet, then show a disclaimer about Mini Apps being a third-party apps instead of the dialog and ask the user to accept their Terms of service. If the user accept the terms and confirms adding, then use toggleBotIsAddedToAttachmentMenu to add the bot. Then, call getWebAppLinkUrl and open the returned URL as a Web App", + "class": "InternalLinkType", + "properties": [ + { + "name": "bot_username", + "type": "string", + "description": "Username of the bot that owns the Web App" + }, + { + "name": "web_app_short_name", + "type": "string", + "description": "Short name of the Web App" + }, + { + "name": "start_parameter", + "type": "string", + "description": "Start parameter to be passed to getWebAppLinkUrl" + } + ] + }, { "name": "messageLink", "description": "Contains an HTTPS link to a message in a supergroup or channel, or a forum topic", @@ -16156,7 +21281,7 @@ { "name": "media_timestamp", "type": "int32", - "description": "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" + "description": "Timestamp from which the video/audio/video note/voice note/story playing must start, in seconds; 0 if not specified. The media can be in the message content or in its web page preview" }, { "name": "for_album", @@ -16165,6 +21290,52 @@ } ] }, + { + "name": "chatBoostLink", + "description": "Contains an HTTPS link to boost a chat", + "class": "ChatBoostLink", + "properties": [ + { + "name": "link", + "type": "string", + "description": "The link" + }, + { + "name": "is_public", + "type": "Bool", + "description": "True, if the link will work for non-members of the chat" + } + ] + }, + { + "name": "chatBoostLinkInfo", + "description": "Contains information about a link to boost a chat", + "class": "ChatBoostLinkInfo", + "properties": [ + { + "name": "is_public", + "type": "Bool", + "description": "True, if the link will work for non-members of the chat" + }, + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat to which the link points; 0 if the chat isn't found" + } + ] + }, + { + "name": "blockListMain", + "description": "The main block list that disallows writing messages to the current user, receiving their status and photo, viewing of stories, and some other actions", + "class": "BlockList", + "properties": [] + }, + { + "name": "blockListStories", + "description": "The block list that disallows viewing of stories of the current user", + "class": "BlockList", + "properties": [] + }, { "name": "filePart", "description": "Contains a part of a file", @@ -16213,6 +21384,12 @@ "class": "FileType", "properties": [] }, + { + "name": "fileTypePhotoStory", + "description": "The file is a photo published as a story", + "class": "FileType", + "properties": [] + }, { "name": "fileTypeProfilePhoto", "description": "The file is a profile photo", @@ -16267,6 +21444,12 @@ "class": "FileType", "properties": [] }, + { + "name": "fileTypeVideoStory", + "description": "The file is a video published as a story", + "class": "FileType", + "properties": [] + }, { "name": "fileTypeVoiceNote", "description": "The file is a voice note", @@ -16535,6 +21718,11 @@ "type": "Bool", "description": "True, if the next audio track needs to be preloaded while the user is listening to an audio file" }, + { + "name": "preload_stories", + "type": "Bool", + "description": "True, if stories needs to be preloaded" + }, { "name": "use_less_data_for_calls", "type": "Bool", @@ -16564,27 +21752,123 @@ } ] }, + { + "name": "autosaveSettingsScopePrivateChats", + "description": "Autosave settings applied to all private chats without chat-specific settings", + "class": "AutosaveSettingsScope", + "properties": [] + }, + { + "name": "autosaveSettingsScopeGroupChats", + "description": "Autosave settings applied to all basic group and supergroup chats without chat-specific settings", + "class": "AutosaveSettingsScope", + "properties": [] + }, + { + "name": "autosaveSettingsScopeChannelChats", + "description": "Autosave settings applied to all channel chats without chat-specific settings", + "class": "AutosaveSettingsScope", + "properties": [] + }, + { + "name": "autosaveSettingsScopeChat", + "description": "Autosave settings applied to a chat", + "class": "AutosaveSettingsScope", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + } + ] + }, + { + "name": "scopeAutosaveSettings", + "description": "Contains autosave settings for an autosave settings scope", + "class": "ScopeAutosaveSettings", + "properties": [ + { + "name": "autosave_photos", + "type": "Bool", + "description": "True, if photo autosave is enabled" + }, + { + "name": "autosave_videos", + "type": "Bool", + "description": "True, if video autosave is enabled" + }, + { + "name": "max_video_file_size", + "type": "int53", + "description": "The maximum size of a video file to be autosaved, in bytes; 512 KB - 4000 MB" + } + ] + }, + { + "name": "autosaveSettingsException", + "description": "Contains autosave settings for a chat, which overrides default settings for the corresponding scope", + "class": "AutosaveSettingsException", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "settings", + "type": "scopeAutosaveSettings", + "description": "Autosave settings for the chat" + } + ] + }, + { + "name": "autosaveSettings", + "description": "Describes autosave settings", + "class": "AutosaveSettings", + "properties": [ + { + "name": "private_chat_settings", + "type": "scopeAutosaveSettings", + "description": "Default autosave settings for private chats" + }, + { + "name": "group_settings", + "type": "scopeAutosaveSettings", + "description": "Default autosave settings for basic group and supergroup chats" + }, + { + "name": "channel_settings", + "type": "scopeAutosaveSettings", + "description": "Default autosave settings for channel chats" + }, + { + "name": "exceptions", + "type": "vector\u003cautosaveSettingsException\u003e", + "description": "Autosave settings for specific chats" + } + ] + }, { "name": "connectionStateWaitingForNetwork", - "description": "Currently waiting for the network to become available. Use setNetworkType to change the available network type", + "description": "Waiting for the network to become available. Use setNetworkType to change the available network type", "class": "ConnectionState", "properties": [] }, { "name": "connectionStateConnectingToProxy", - "description": "Currently establishing a connection with a proxy server", + "description": "Establishing a connection with a proxy server", "class": "ConnectionState", "properties": [] }, { "name": "connectionStateConnecting", - "description": "Currently establishing a connection to the Telegram servers", + "description": "Establishing a connection to the Telegram servers", "class": "ConnectionState", "properties": [] }, { "name": "connectionStateUpdating", - "description": "Downloading data received while the application was offline", + "description": "Downloading data supposed to be received while the application was offline", "class": "ConnectionState", "properties": [] }, @@ -16636,6 +21920,35 @@ "class": "TopChatCategory", "properties": [] }, + { + "name": "foundPosition", + "description": "Contains 0-based match position", + "class": "FoundPosition", + "properties": [ + { + "name": "position", + "type": "int32", + "description": "The position of the match" + } + ] + }, + { + "name": "foundPositions", + "description": "Contains 0-based positions of matched objects", + "class": "FoundPositions", + "properties": [ + { + "name": "total_count", + "type": "int32", + "description": "Total number of matched objects" + }, + { + "name": "positions", + "type": "vector\u003cint32\u003e", + "description": "The positions of the matched objects" + } + ] + }, { "name": "tMeUrlTypeUser", "description": "A URL linking to a user", @@ -16715,7 +22028,7 @@ }, { "name": "suggestedActionEnableArchiveAndMuteNewChats", - "description": "Suggests the user to enable \"archive_and_mute_new_chats_from_unknown_users\" option", + "description": "Suggests the user to enable archive_and_mute_new_chats_from_unknown_users setting in archiveChatListSettings", "class": "SuggestedAction", "properties": [] }, @@ -16757,10 +22070,40 @@ { "name": "authorization_delay", "type": "int32", - "description": "The number of days to pass between consecutive authorizations if the user declines to set password" + "description": "The number of days to pass between consecutive authorizations if the user declines to set password; if 0, then the user is advised to set the password for security reasons" } ] }, + { + "name": "suggestedActionUpgradePremium", + "description": "Suggests the user to upgrade the Premium subscription from monthly payments to annual payments", + "class": "SuggestedAction", + "properties": [] + }, + { + "name": "suggestedActionRestorePremium", + "description": "Suggests the user to restore a recently expired Premium subscription", + "class": "SuggestedAction", + "properties": [] + }, + { + "name": "suggestedActionSubscribeToAnnualPremium", + "description": "Suggests the user to subscribe to the Premium subscription with annual payments", + "class": "SuggestedAction", + "properties": [] + }, + { + "name": "suggestedActionGiftPremiumForChristmas", + "description": "Suggests the user to gift Telegram Premium to friends for Christmas", + "class": "SuggestedAction", + "properties": [] + }, + { + "name": "suggestedActionSetBirthdate", + "description": "Suggests the user to set birthdate", + "class": "SuggestedAction", + "properties": [] + }, { "name": "count", "description": "Contains a counter", @@ -16908,7 +22251,7 @@ { "name": "server", "type": "string", - "description": "Proxy server IP address" + "description": "Proxy server domain or IP address" }, { "name": "port", @@ -16952,22 +22295,27 @@ { "name": "sticker", "type": "InputFile", - "description": "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" - }, - { - "name": "emojis", - "type": "string", - "description": "Emojis corresponding to the sticker" + "description": "File with the sticker; must fit in a 512x512 square. For WEBP stickers the file must be in WEBP or PNG format, which will be converted to WEBP server-side. See https://core.telegram.org/animated_stickers#technical-requirements for technical requirements" }, { "name": "format", "type": "StickerFormat", - "description": "Sticker format" + "description": "Format of the sticker" + }, + { + "name": "emojis", + "type": "string", + "description": "String with 1-20 emoji corresponding to the sticker" }, { "name": "mask_position", "type": "maskPosition", "description": "Position where the mask is placed; pass null if not specified" + }, + { + "name": "keywords", + "type": "vector\u003cstring\u003e", + "description": "List of up to 20 keywords with total length up to 64 characters, which can be used to find the sticker" } ] }, @@ -17052,24 +22400,53 @@ ] }, { - "name": "chatStatisticsMessageInteractionInfo", - "description": "Contains statistics about interactions with a message", - "class": "ChatStatisticsMessageInteractionInfo", + "name": "chatStatisticsObjectTypeMessage", + "description": "Describes a message sent in the chat", + "class": "ChatStatisticsObjectType", "properties": [ { "name": "message_id", "type": "int53", "description": "Message identifier" + } + ] + }, + { + "name": "chatStatisticsObjectTypeStory", + "description": "Describes a story sent by the chat", + "class": "ChatStatisticsObjectType", + "properties": [ + { + "name": "story_id", + "type": "int32", + "description": "Story identifier" + } + ] + }, + { + "name": "chatStatisticsInteractionInfo", + "description": "Contains statistics about interactions with a message sent in the chat or a story sent by the chat", + "class": "ChatStatisticsInteractionInfo", + "properties": [ + { + "name": "object_type", + "type": "ChatStatisticsObjectType", + "description": "Type of the object" }, { "name": "view_count", "type": "int32", - "description": "Number of times the message was viewed" + "description": "Number of times the object was viewed" }, { "name": "forward_count", "type": "int32", - "description": "Number of times the message was forwarded" + "description": "Number of times the object was forwarded" + }, + { + "name": "reaction_count", + "type": "int32", + "description": "Number of times reactions were added to the object" } ] }, @@ -17242,19 +22619,39 @@ "description": "Number of members in the chat" }, { - "name": "mean_view_count", + "name": "mean_message_view_count", "type": "statisticalValue", - "description": "Mean number of times the recently sent messages was viewed" + "description": "Mean number of times the recently sent messages were viewed" }, { - "name": "mean_share_count", + "name": "mean_message_share_count", "type": "statisticalValue", - "description": "Mean number of times the recently sent messages was shared" + "description": "Mean number of times the recently sent messages were shared" + }, + { + "name": "mean_message_reaction_count", + "type": "statisticalValue", + "description": "Mean number of times reactions were added to the recently sent messages" + }, + { + "name": "mean_story_view_count", + "type": "statisticalValue", + "description": "Mean number of times the recently sent stories were viewed" + }, + { + "name": "mean_story_share_count", + "type": "statisticalValue", + "description": "Mean number of times the recently sent stories were shared" + }, + { + "name": "mean_story_reaction_count", + "type": "statisticalValue", + "description": "Mean number of times reactions were added to the recently sent stories" }, { "name": "enabled_notifications_percentage", "type": "double", - "description": "A percentage of users with enabled notifications for the chat" + "description": "A percentage of users with enabled notifications for the chat; 0-100" }, { "name": "member_count_graph", @@ -17296,15 +22693,30 @@ "type": "StatisticalGraph", "description": "A graph containing number of chat message views and shares" }, + { + "name": "message_reaction_graph", + "type": "StatisticalGraph", + "description": "A graph containing number of reactions on messages" + }, + { + "name": "story_interaction_graph", + "type": "StatisticalGraph", + "description": "A graph containing number of story views and shares" + }, + { + "name": "story_reaction_graph", + "type": "StatisticalGraph", + "description": "A graph containing number of reactions on stories" + }, { "name": "instant_view_interaction_graph", "type": "StatisticalGraph", "description": "A graph containing number of views of associated with the chat instant views" }, { - "name": "recent_message_interactions", - "type": "vector\u003cchatStatisticsMessageInteractionInfo\u003e", - "description": "Detailed statistics about number of views and shares of recently sent messages" + "name": "recent_interactions", + "type": "vector\u003cchatStatisticsInteractionInfo\u003e", + "description": "Detailed statistics about number of views and shares of recently sent messages and stories" } ] }, @@ -17317,6 +22729,28 @@ "name": "message_interaction_graph", "type": "StatisticalGraph", "description": "A graph containing number of message views and shares" + }, + { + "name": "message_reaction_graph", + "type": "StatisticalGraph", + "description": "A graph containing number of message reactions" + } + ] + }, + { + "name": "storyStatistics", + "description": "A detailed statistics about a story", + "class": "StoryStatistics", + "properties": [ + { + "name": "story_interaction_graph", + "type": "StatisticalGraph", + "description": "A graph containing number of story views and shares" + }, + { + "name": "story_reaction_graph", + "type": "StatisticalGraph", + "description": "A graph containing number of story reactions" } ] }, @@ -17462,7 +22896,7 @@ }, { "name": "updateMessageSendAcknowledged", - "description": "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", + "description": "A request to send a message has reached the Telegram server. This doesn't mean that the message will be sent successfully. This update is sent only if the option \"use_quick_ack\" is set to true. This update may be sent multiple times for the same message", "class": "Update", "properties": [ { @@ -17510,14 +22944,9 @@ "description": "The previous temporary message identifier" }, { - "name": "error_code", - "type": "int32", - "description": "An error code" - }, - { - "name": "error_message", - "type": "string", - "description": "Error message" + "name": "error", + "type": "error", + "description": "The cause of the message sending failure" } ] }, @@ -17743,9 +23172,41 @@ } ] }, + { + "name": "updateChatAccentColors", + "description": "Chat accent colors have changed", + "class": "Update", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "accent_color_id", + "type": "int32", + "description": "The new chat accent color identifier" + }, + { + "name": "background_custom_emoji_id", + "type": "int64", + "description": "The new identifier of a custom emoji to be shown on the reply header and link preview background; 0 if none" + }, + { + "name": "profile_accent_color_id", + "type": "int32", + "description": "The new chat profile accent color identifier; -1 if none" + }, + { + "name": "profile_background_custom_emoji_id", + "type": "int64", + "description": "The new identifier of a custom emoji to be shown on the profile background; 0 if none" + } + ] + }, { "name": "updateChatPermissions", - "description": "Chat permissions was changed", + "description": "Chat permissions were changed", "class": "Update", "properties": [ { @@ -17762,7 +23223,7 @@ }, { "name": "updateChatLastMessage", - "description": "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", + "description": "The last message of a chat was changed", "class": "Update", "properties": [ { @@ -17773,7 +23234,7 @@ { "name": "last_message", "type": "message", - "description": "The new last message in the chat; may be null" + "description": "The new last message in the chat; may be null if the last message became unknown. While the last message is unknown, new messages can be added to the chat without corresponding updateNewMessage update" }, { "name": "positions", @@ -17784,7 +23245,7 @@ }, { "name": "updateChatPosition", - "description": "The position of a chat in a chat list has changed. Instead of this update updateChatLastMessage or updateChatDraftMessage might be sent", + "description": "The position of a chat in a chat list has changed. An updateChatLastMessage or updateChatDraftMessage update might be sent instead of the update", "class": "Update", "properties": [ { @@ -17799,6 +23260,40 @@ } ] }, + { + "name": "updateChatAddedToList", + "description": "A chat was added to a chat list", + "class": "Update", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "chat_list", + "type": "ChatList", + "description": "The chat list to which the chat was added" + } + ] + }, + { + "name": "updateChatRemovedFromList", + "description": "A chat was removed from a chat list", + "class": "Update", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "chat_list", + "type": "ChatList", + "description": "The chat list from which the chat was removed" + } + ] + }, { "name": "updateChatReadInbox", "description": "Incoming messages were read or the number of unread messages has been changed", @@ -17885,7 +23380,7 @@ { "name": "draft_message", "type": "draftMessage", - "description": "The new draft message; may be null" + "description": "The new draft message; may be null if none" }, { "name": "positions", @@ -17894,6 +23389,23 @@ } ] }, + { + "name": "updateChatEmojiStatus", + "description": "Chat emoji status has changed", + "class": "Update", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "emoji_status", + "type": "emojiStatus", + "description": "The new chat emoji status; may be null" + } + ] + }, { "name": "updateChatMessageSender", "description": "The message sender that is selected to send messages in a chat has changed", @@ -17979,6 +23491,23 @@ } ] }, + { + "name": "updateChatBackground", + "description": "The chat background was changed", + "class": "Update", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "background", + "type": "chatBackground", + "description": "The new chat background; may be null if background was reset to default" + } + ] + }, { "name": "updateChatTheme", "description": "The chat theme was changed", @@ -18082,8 +23611,8 @@ ] }, { - "name": "updateChatHasScheduledMessages", - "description": "A chat's has_scheduled_messages field has changed", + "name": "updateChatIsTranslatable", + "description": "Translation of chat messages was enabled or disabled", "class": "Update", "properties": [ { @@ -18092,26 +23621,9 @@ "description": "Chat identifier" }, { - "name": "has_scheduled_messages", + "name": "is_translatable", "type": "Bool", - "description": "New value of has_scheduled_messages" - } - ] - }, - { - "name": "updateChatIsBlocked", - "description": "A chat was blocked or unblocked", - "class": "Update", - "properties": [ - { - "name": "chat_id", - "type": "int53", - "description": "Chat identifier" - }, - { - "name": "is_blocked", - "type": "Bool", - "description": "New value of is_blocked" + "description": "New value of is_translatable" } ] }, @@ -18133,25 +23645,81 @@ ] }, { - "name": "updateChatFilters", - "description": "The list of chat filters or a chat filter has changed", + "name": "updateChatViewAsTopics", + "description": "A chat default appearance has changed", "class": "Update", "properties": [ { - "name": "chat_filters", - "type": "vector\u003cchatFilterInfo\u003e", - "description": "The new list of chat filters" + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "view_as_topics", + "type": "Bool", + "description": "New value of view_as_topics" + } + ] + }, + { + "name": "updateChatBlockList", + "description": "A chat was blocked or unblocked", + "class": "Update", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "block_list", + "type": "BlockList", + "description": "Block list to which the chat is added; may be null if none" + } + ] + }, + { + "name": "updateChatHasScheduledMessages", + "description": "A chat's has_scheduled_messages field has changed", + "class": "Update", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "has_scheduled_messages", + "type": "Bool", + "description": "New value of has_scheduled_messages" + } + ] + }, + { + "name": "updateChatFolders", + "description": "The list of chat folders or a chat folder has changed", + "class": "Update", + "properties": [ + { + "name": "chat_folders", + "type": "vector\u003cchatFolderInfo\u003e", + "description": "The new list of chat folders" }, { "name": "main_chat_list_position", "type": "int32", - "description": "Position of the main chat list among chat filters, 0-based" + "description": "Position of the main chat list among chat folders, 0-based" + }, + { + "name": "are_tags_enabled", + "type": "Bool", + "description": "True, if folder tags are enabled" } ] }, { "name": "updateChatOnlineMemberCount", - "description": "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", + "description": "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 is sent just after the number of online users has changed", "class": "Update", "properties": [ { @@ -18166,6 +23734,83 @@ } ] }, + { + "name": "updateSavedMessagesTopic", + "description": "Basic information about a Saved Messages topic has changed. This update is guaranteed to come before the topic identifier is returned to the application", + "class": "Update", + "properties": [ + { + "name": "topic", + "type": "savedMessagesTopic", + "description": "New data about the topic" + } + ] + }, + { + "name": "updateSavedMessagesTopicCount", + "description": "Number of Saved Messages topics has changed", + "class": "Update", + "properties": [ + { + "name": "topic_count", + "type": "int32", + "description": "Approximate total number of Saved Messages topics" + } + ] + }, + { + "name": "updateQuickReplyShortcut", + "description": "Basic information about a quick reply shortcut has changed. This update is guaranteed to come before the quick shortcut name is returned to the application", + "class": "Update", + "properties": [ + { + "name": "shortcut", + "type": "quickReplyShortcut", + "description": "New data about the shortcut" + } + ] + }, + { + "name": "updateQuickReplyShortcutDeleted", + "description": "A quick reply shortcut and all its messages were deleted", + "class": "Update", + "properties": [ + { + "name": "shortcut_id", + "type": "int32", + "description": "The identifier of the deleted shortcut" + } + ] + }, + { + "name": "updateQuickReplyShortcuts", + "description": "The list of quick reply shortcuts has changed", + "class": "Update", + "properties": [ + { + "name": "shortcut_ids", + "type": "vector\u003cint32\u003e", + "description": "The new list of identifiers of quick reply shortcuts" + } + ] + }, + { + "name": "updateQuickReplyShortcutMessages", + "description": "The list of quick reply shortcut messages has changed", + "class": "Update", + "properties": [ + { + "name": "shortcut_id", + "type": "int32", + "description": "The identifier of the shortcut" + }, + { + "name": "messages", + "type": "vector\u003cquickReplyMessage\u003e", + "description": "The new list of quick reply messages for the shortcut in order from the first to the last sent" + } + ] + }, { "name": "updateForumTopicInfo", "description": "Basic information about a topic in a forum chat was changed", @@ -18255,18 +23900,18 @@ { "name": "added_notifications", "type": "vector\u003cnotification\u003e", - "description": "List of added group notifications, sorted by notification ID" + "description": "List of added group notifications, sorted by notification identifier" }, { "name": "removed_notification_ids", "type": "vector\u003cint32\u003e", - "description": "Identifiers of removed group notifications, sorted by notification ID" + "description": "Identifiers of removed group notifications, sorted by notification identifier" } ] }, { "name": "updateActiveNotifications", - "description": "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", + "description": "Contains active notifications that were 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", "class": "Update", "properties": [ { @@ -18333,7 +23978,7 @@ { "name": "message_thread_id", "type": "int53", - "description": "If not 0, a message thread identifier in which the action was performed" + "description": "If not 0, the message thread identifier in which the action was performed" }, { "name": "sender_id", @@ -18748,6 +24393,120 @@ } ] }, + { + "name": "updateStory", + "description": "A story was changed", + "class": "Update", + "properties": [ + { + "name": "story", + "type": "story", + "description": "The new information about the story" + } + ] + }, + { + "name": "updateStoryDeleted", + "description": "A story became inaccessible", + "class": "Update", + "properties": [ + { + "name": "story_sender_chat_id", + "type": "int53", + "description": "Identifier of the chat that posted the story" + }, + { + "name": "story_id", + "type": "int32", + "description": "Story identifier" + } + ] + }, + { + "name": "updateStorySendSucceeded", + "description": "A story has been successfully sent", + "class": "Update", + "properties": [ + { + "name": "story", + "type": "story", + "description": "The sent story" + }, + { + "name": "old_story_id", + "type": "int32", + "description": "The previous temporary story identifier" + } + ] + }, + { + "name": "updateStorySendFailed", + "description": "A story failed to send. If the story sending is canceled, then updateStoryDeleted will be received instead of this update", + "class": "Update", + "properties": [ + { + "name": "story", + "type": "story", + "description": "The failed to send story" + }, + { + "name": "error", + "type": "error", + "description": "The cause of the story sending failure" + }, + { + "name": "error_type", + "type": "CanSendStoryResult", + "description": "Type of the error; may be null if unknown" + } + ] + }, + { + "name": "updateChatActiveStories", + "description": "The list of active stories posted by a specific chat has changed", + "class": "Update", + "properties": [ + { + "name": "active_stories", + "type": "chatActiveStories", + "description": "The new list of active stories" + } + ] + }, + { + "name": "updateStoryListChatCount", + "description": "Number of chats in a story list has changed", + "class": "Update", + "properties": [ + { + "name": "story_list", + "type": "StoryList", + "description": "The story list" + }, + { + "name": "chat_count", + "type": "int32", + "description": "Approximate total number of chats with active stories in the list" + } + ] + }, + { + "name": "updateStoryStealthMode", + "description": "Story stealth mode settings have changed", + "class": "Update", + "properties": [ + { + "name": "active_until_date", + "type": "int32", + "description": "Point in time (Unix timestamp) until stealth mode is active; 0 if it is disabled" + }, + { + "name": "cooldown_until_date", + "type": "int32", + "description": "Point in time (Unix timestamp) when stealth mode can be enabled again; 0 if there is no active cooldown" + } + ] + }, { "name": "updateOption", "description": "An option changed its value", @@ -18819,7 +24578,7 @@ { "name": "is_attached", "type": "Bool", - "description": "True, if the list of stickers attached to photo or video files was updated, otherwise the list of sent stickers is updated" + "description": "True, if the list of stickers attached to photo or video files was updated; otherwise, the list of sent stickers is updated" }, { "name": "sticker_ids", @@ -18854,7 +24613,7 @@ }, { "name": "updateSavedNotificationSounds", - "description": "The list of saved notifications sounds was updated. This update may not be sent until information about a notification sound was requested for the first time", + "description": "The list of saved notification sounds was updated. This update may not be sent until information about a notification sound was requested for the first time", "class": "Update", "properties": [ { @@ -18865,19 +24624,19 @@ ] }, { - "name": "updateSelectedBackground", - "description": "The selected background has changed", + "name": "updateDefaultBackground", + "description": "The default background has changed", "class": "Update", "properties": [ { "name": "for_dark_theme", "type": "Bool", - "description": "True, if background for dark theme has changed" + "description": "True, if default background for dark theme has changed" }, { "name": "background", "type": "background", - "description": "The new selected background; may be null" + "description": "The new default background; may be null" } ] }, @@ -18893,6 +24652,40 @@ } ] }, + { + "name": "updateAccentColors", + "description": "The list of supported accent colors has changed", + "class": "Update", + "properties": [ + { + "name": "colors", + "type": "vector\u003caccentColor\u003e", + "description": "Information about supported colors; colors with identifiers 0 (red), 1 (orange), 2 (purple/violet), 3 (green), 4 (cyan), 5 (blue), 6 (pink) must always be supported and aren't included in the list. The exact colors for the accent colors with identifiers 0-6 must be taken from the app theme" + }, + { + "name": "available_accent_color_ids", + "type": "vector\u003cint32\u003e", + "description": "The list of accent color identifiers, which can be set through setAccentColor and setChatAccentColor. The colors must be shown in the specififed order" + } + ] + }, + { + "name": "updateProfileAccentColors", + "description": "The list of supported accent colors for user profiles has changed", + "class": "Update", + "properties": [ + { + "name": "colors", + "type": "vector\u003cprofileAccentColor\u003e", + "description": "Information about supported colors" + }, + { + "name": "available_accent_color_ids", + "type": "vector\u003cint32\u003e", + "description": "The list of accent color identifiers, which can be set through setProfileAccentColor and setChatProfileAccentColor. The colors must be shown in the specififed order" + } + ] + }, { "name": "updateLanguagePackStrings", "description": "Some language pack strings have been updated", @@ -18911,7 +24704,7 @@ { "name": "strings", "type": "vector\u003clanguagePackString\u003e", - "description": "List of changed language pack strings" + "description": "List of changed language pack strings; empty if all strings have changed" } ] }, @@ -18956,15 +24749,27 @@ } ] }, + { + "name": "updateUnconfirmedSession", + "description": "The first unconfirmed session has changed", + "class": "Update", + "properties": [ + { + "name": "session", + "type": "unconfirmedSession", + "description": "The unconfirmed session; may be null if none" + } + ] + }, { "name": "updateAttachmentMenuBots", - "description": "The list of bots added to attachment menu has changed", + "description": "The list of bots added to attachment or side menu has changed", "class": "Update", "properties": [ { "name": "bots", "type": "vector\u003cattachmentMenuBot\u003e", - "description": "The new list of bots added to attachment menu. The bots must not be shown on scheduled messages screen" + "description": "The new list of bots. The bots must not be shown on scheduled messages screen" } ] }, @@ -19004,6 +24809,50 @@ } ] }, + { + "name": "updateSavedMessagesTags", + "description": "Tags used in Saved Messages or a Saved Messages topic have changed", + "class": "Update", + "properties": [ + { + "name": "saved_messages_topic_id", + "type": "int53", + "description": "Identifier of Saved Messages topic which tags were changed; 0 if tags for the whole chat has changed" + }, + { + "name": "tags", + "type": "savedMessagesTags", + "description": "The new tags" + } + ] + }, + { + "name": "updateSpeechRecognitionTrial", + "description": "The parameters of speech recognition without Telegram Premium subscription has changed", + "class": "Update", + "properties": [ + { + "name": "max_media_duration", + "type": "int32", + "description": "The maximum allowed duration of media for speech recognition without Telegram Premium subscription, in seconds" + }, + { + "name": "weekly_count", + "type": "int32", + "description": "The total number of allowed speech recognitions per week; 0 if none" + }, + { + "name": "left_count", + "type": "int32", + "description": "Number of left speech recognition attempts this week" + }, + { + "name": "next_reset_date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the weekly number of tries will reset; 0 if unknown" + } + ] + }, { "name": "updateDiceEmojis", "description": "The list of supported dice emojis has changed", @@ -19072,6 +24921,120 @@ } ] }, + { + "name": "updateContactCloseBirthdays", + "description": "The list of contacts that had birthdays recently or will have birthday soon has changed", + "class": "Update", + "properties": [ + { + "name": "close_birthday_users", + "type": "vector\u003ccloseBirthdayUser\u003e", + "description": "List of contact users with close birthday" + } + ] + }, + { + "name": "updateAddChatMembersPrivacyForbidden", + "description": "Adding users to a chat has failed because of their privacy settings. An invite link can be shared with the users if appropriate", + "class": "Update", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "user_ids", + "type": "vector\u003cint53\u003e", + "description": "Identifiers of users, which weren't added because of their privacy settings" + } + ] + }, + { + "name": "updateAutosaveSettings", + "description": "Autosave settings for some type of chats were updated", + "class": "Update", + "properties": [ + { + "name": "scope", + "type": "AutosaveSettingsScope", + "description": "Type of chats for which autosave settings were updated" + }, + { + "name": "settings", + "type": "scopeAutosaveSettings", + "description": "The new autosave settings; may be null if the settings are reset to default" + } + ] + }, + { + "name": "updateBusinessConnection", + "description": "A business connection has changed; for bots only", + "class": "Update", + "properties": [ + { + "name": "connection", + "type": "businessConnection", + "description": "New data about the connection" + } + ] + }, + { + "name": "updateNewBusinessMessage", + "description": "A new message was added to a business account; for bots only", + "class": "Update", + "properties": [ + { + "name": "connection_id", + "type": "string", + "description": "Unique identifier of the business connection" + }, + { + "name": "message", + "type": "businessMessage", + "description": "The new message" + } + ] + }, + { + "name": "updateBusinessMessageEdited", + "description": "A message in a business account was edited; for bots only", + "class": "Update", + "properties": [ + { + "name": "connection_id", + "type": "string", + "description": "Unique identifier of the business connection" + }, + { + "name": "message", + "type": "businessMessage", + "description": "The edited message" + } + ] + }, + { + "name": "updateBusinessMessagesDeleted", + "description": "Messages in a business account were deleted; for bots only", + "class": "Update", + "properties": [ + { + "name": "connection_id", + "type": "string", + "description": "Unique identifier of the business connection" + }, + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of a chat in the business account in which messages were deleted" + }, + { + "name": "message_ids", + "type": "vector\u003cint53\u003e", + "description": "Unique message identifiers of the deleted messages" + } + ] + }, { "name": "updateNewInlineQuery", "description": "A new incoming inline query; for bots only", @@ -19336,9 +25299,9 @@ "description": "Unique poll identifier" }, { - "name": "user_id", - "type": "int53", - "description": "The user, who changed the answer to the poll" + "name": "voter_id", + "type": "MessageSender", + "description": "Identifier of the message sender that changed the answer to the poll" }, { "name": "option_ids", @@ -19365,13 +25328,18 @@ { "name": "date", "type": "int32", - "description": "Point in time (Unix timestamp) when the user rights was changed" + "description": "Point in time (Unix timestamp) when the user rights were changed" }, { "name": "invite_link", "type": "chatInviteLink", "description": "If user has joined the chat using an invite link, the invite link; may be null" }, + { + "name": "via_chat_folder_invite_link", + "type": "Bool", + "description": "True, if the user has joined the chat using an invite link for a chat folder" + }, { "name": "old_chat_member", "type": "chatMember", @@ -19399,6 +25367,11 @@ "type": "chatJoinRequest", "description": "Join request" }, + { + "name": "user_chat_id", + "type": "int53", + "description": "Chat identifier of the private chat with the user" + }, { "name": "invite_link", "type": "chatInviteLink", @@ -19406,6 +25379,87 @@ } ] }, + { + "name": "updateChatBoost", + "description": "A chat boost has changed; for bots only", + "class": "Update", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "boost", + "type": "chatBoost", + "description": "New information about the boost" + } + ] + }, + { + "name": "updateMessageReaction", + "description": "User changed its reactions on a message with public reactions; for bots only", + "class": "Update", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "message_id", + "type": "int53", + "description": "Message identifier" + }, + { + "name": "actor_id", + "type": "MessageSender", + "description": "Identifier of the user or chat that changed reactions" + }, + { + "name": "date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the reactions were changed" + }, + { + "name": "old_reaction_types", + "type": "vector\u003cReactionType\u003e", + "description": "Old list of chosen reactions" + }, + { + "name": "new_reaction_types", + "type": "vector\u003cReactionType\u003e", + "description": "New list of chosen reactions" + } + ] + }, + { + "name": "updateMessageReactions", + "description": "Reactions added to a message with anonymous reactions have changed; for bots only", + "class": "Update", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "message_id", + "type": "int53", + "description": "Message identifier" + }, + { + "name": "date", + "type": "int32", + "description": "Point in time (Unix timestamp) when the reactions were changed" + }, + { + "name": "reactions", + "type": "vector\u003cmessageReaction\u003e", + "description": "The list of reactions added to the message" + } + ] + }, { "name": "updates", "description": "Contains a list of updates", @@ -19592,6 +25646,10 @@ "name": "EmailAddressAuthentication", "description": "Contains authentication data for a email address" }, + { + "name": "EmailAddressResetState", + "description": "Describes reset state of a email address" + }, { "name": "AuthorizationState", "description": "Represents the current authorization state of the TDLib client" @@ -19628,10 +25686,26 @@ "name": "UserType", "description": "Represents the type of a user. The following types are possible: regular users, deleted users and bots" }, + { + "name": "BusinessAwayMessageSchedule", + "description": "Describes conditions for sending of away messages by a Telegram Business account" + }, + { + "name": "ChatPhotoStickerType", + "description": "Describes type of a sticker, which was used to create a chat photo" + }, { "name": "InputChatPhoto", "description": "Describes a photo to be set as a user profile or chat photo" }, + { + "name": "PremiumGiveawayParticipantStatus", + "description": "Contains information about status of a user in a Telegram Premium giveaway" + }, + { + "name": "PremiumGiveawayInfo", + "description": "Contains information about Telegram Premium giveaway" + }, { "name": "ChatMemberStatus", "description": "Provides information about the status of a member in a chat" @@ -19644,6 +25718,10 @@ "name": "SupergroupMembersFilter", "description": "Specifies the kind of chat members to return in getSupergroupMembers" }, + { + "name": "InviteLinkChatType", + "description": "Describes the type of a chat to which points an invite link" + }, { "name": "SecretChatState", "description": "Describes the current secret chat state" @@ -19653,8 +25731,12 @@ "description": "Contains information about the sender of a message" }, { - "name": "MessageForwardOrigin", - "description": "Contains information about the origin of a forwarded message" + "name": "MessageReadDate", + "description": "Describes read date of a recent outgoing message in a private chat" + }, + { + "name": "MessageOrigin", + "description": "Contains information about the origin of a message" }, { "name": "ReactionType", @@ -19664,6 +25746,26 @@ "name": "MessageSendingState", "description": "Contains information about the sending state of the message" }, + { + "name": "MessageReplyTo", + "description": "Contains information about the message or the story a message is replying to" + }, + { + "name": "InputMessageReplyTo", + "description": "Contains information about the message or the story to be replied" + }, + { + "name": "MessageSource", + "description": "Describes source of a message" + }, + { + "name": "MessageSponsorType", + "description": "Describes type of a message sponsor" + }, + { + "name": "ReportChatSponsoredMessageResult", + "description": "Describes result of sponsored message report" + }, { "name": "NotificationSettingsScope", "description": "Describes the types of chats to which notification settings are relevant" @@ -19708,6 +25810,10 @@ "name": "LoginUrlInfo", "description": "Contains information about an inline button of type inlineKeyboardButtonTypeLoginUrl" }, + { + "name": "SavedMessagesTopicType", + "description": "Describes type of a Saved Messages topic" + }, { "name": "RichText", "description": "Describes a text object inside an instant-view web page" @@ -19724,6 +25830,10 @@ "name": "PageBlock", "description": "Describes a block of an instant view web page" }, + { + "name": "CollectibleItemType", + "description": "Describes a collectible item that can be purchased at https://fragment.com" + }, { "name": "InputCredentials", "description": "Contains information about the payment method chosen by the user" @@ -19772,6 +25882,10 @@ "name": "MessageSchedulingState", "description": "Contains information about the time when a scheduled message will be sent" }, + { + "name": "MessageSelfDestructType", + "description": "Describes when a message will be self-destructed" + }, { "name": "InputMessageContent", "description": "The content of a message to send" @@ -19788,6 +25902,46 @@ "name": "UserStatus", "description": "Describes the last time the user was online" }, + { + "name": "EmojiCategoryType", + "description": "Describes type of an emoji category" + }, + { + "name": "StoryAreaType", + "description": "Describes type of a clickable rectangle area on a story media" + }, + { + "name": "InputStoryAreaType", + "description": "Describes type of a clickable rectangle area on a story media to be added" + }, + { + "name": "StoryContent", + "description": "Contains the content of a story" + }, + { + "name": "InputStoryContent", + "description": "The content of a story to send" + }, + { + "name": "StoryList", + "description": "Describes a list of stories" + }, + { + "name": "StoryOrigin", + "description": "Contains information about the origin of a story that was reposted" + }, + { + "name": "StoryInteractionType", + "description": "Describes type of interaction with a story" + }, + { + "name": "PublicForward", + "description": "Describes a public forward or repost of a story" + }, + { + "name": "ChatBoostSource", + "description": "Describes source of a chat boost" + }, { "name": "CallDiscardReason", "description": "Describes the reason why a call was discarded" @@ -19808,6 +25962,14 @@ "name": "CallProblem", "description": "Describes the exact type of a problem with a call" }, + { + "name": "FirebaseAuthenticationSettings", + "description": "Contains settings for Firebase Authentication in the official applications" + }, + { + "name": "ReactionUnavailabilityReason", + "description": "Describes why the current user can't add reactions to the message, despite some other users can" + }, { "name": "DiceStickers", "description": "Contains animated stickers which must be used for dice animation rendering" @@ -19816,6 +25978,10 @@ "name": "SpeechRecognitionResult", "description": "Describes result of speech recognition in a voice note" }, + { + "name": "BotWriteAccessAllowReason", + "description": "Describes a reason why a bot was allowed to write messages to the current user" + }, { "name": "InputInlineQueryResult", "description": "Represents a single result of an inline query; for bots only" @@ -19824,6 +25990,10 @@ "name": "InlineQueryResult", "description": "Represents a single result of an inline query" }, + { + "name": "InlineQueryResultsButtonType", + "description": "Represents a type of a button in results of inline query" + }, { "name": "CallbackQueryPayload", "description": "Represents a payload of a callback query" @@ -19844,6 +26014,14 @@ "name": "PremiumFeature", "description": "Describes a feature available to Premium users" }, + { + "name": "BusinessFeature", + "description": "Describes a feature available to Business user accounts" + }, + { + "name": "PremiumStoryFeature", + "description": "Describes a story feature available to Premium users" + }, { "name": "PremiumSource", "description": "Describes a source from which the Premium features screen is opened" @@ -19852,9 +26030,13 @@ "name": "StorePaymentPurpose", "description": "Describes a purpose of an in-store payment" }, + { + "name": "TelegramPaymentPurpose", + "description": "Describes a purpose of a payment toward Telegram" + }, { "name": "DeviceToken", - "description": "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" + "description": "Represents a data needed to subscribe for push notifications through registerDevice method." }, { "name": "BackgroundFill", @@ -19868,6 +26050,10 @@ "name": "InputBackground", "description": "Contains information about background to set" }, + { + "name": "CanSendStoryResult", + "description": "Represents result of checking whether the current user can send a story in the specific chat" + }, { "name": "CanTransferOwnershipResult", "description": "Represents result of checking whether the current session can be used to transfer a chat ownership to another user" @@ -19908,20 +26094,28 @@ "name": "JsonValue", "description": "Represents a JSON value" }, + { + "name": "StoryPrivacySettings", + "description": "Describes privacy settings of a story" + }, { "name": "UserPrivacySettingRule", - "description": "Represents a single rule for managing privacy settings" + "description": "Represents a single rule for managing user privacy settings" }, { "name": "UserPrivacySetting", "description": "Describes available user privacy settings" }, + { + "name": "CanSendMessageToUserResult", + "description": "Describes result of canSendMessageToUser" + }, { "name": "SessionType", "description": "Represents the type of a session" }, { - "name": "ChatReportReason", + "name": "ReportReason", "description": "Describes the reason why a chat is reported" }, { @@ -19932,6 +26126,10 @@ "name": "InternalLinkType", "description": "Describes an internal https://t.me or tg: link, which must be processed by the application in a special way" }, + { + "name": "BlockList", + "description": "Describes a type of a block list" + }, { "name": "FileType", "description": "Represents the type of a file" @@ -19944,6 +26142,10 @@ "name": "NetworkStatisticsEntry", "description": "Contains statistics about network usage" }, + { + "name": "AutosaveSettingsScope", + "description": "Describes scope of autosave settings" + }, { "name": "ConnectionState", "description": "Describes the current state of the connection to Telegram servers" @@ -19972,6 +26174,10 @@ "name": "StatisticalGraph", "description": "Describes a statistical graph" }, + { + "name": "ChatStatisticsObjectType", + "description": "Describes type of an object, for which statistics are provided" + }, { "name": "ChatStatistics", "description": "Contains a detailed statistics about a chat" @@ -20025,7 +26231,7 @@ { "name": "database_encryption_key", "type": "bytes", - "description": "Encryption key for the database" + "description": "Encryption key for the database. If the encryption key is invalid, then an error with code 401 will be returned" }, { "name": "use_file_database", @@ -20076,16 +26282,6 @@ "name": "application_version", "type": "string", "description": "Application version; must be non-empty" - }, - { - "name": "enable_storage_optimizer", - "type": "Bool", - "description": "Pass true to automatically delete old files in background" - }, - { - "name": "ignore_file_names", - "type": "Bool", - "description": "Pass true to ignore original file names for downloaded files. Otherwise, downloaded files are saved under names as close as possible to the original name" } ], "is_synchronous": false, @@ -20093,7 +26289,7 @@ }, { "name": "setAuthenticationPhoneNumber", - "description": "Sets the phone number of the user and sends an authentication code to the user. Works only when the current authorization state is authorizationStateWaitPhoneNumber, or if there is no pending authentication query and the current authorization state is authorizationStateWaitCode, authorizationStateWaitRegistration, or authorizationStateWaitPassword", + "description": "Sets the phone number of the user and sends an authentication code to the user. Works only when the current authorization state is authorizationStateWaitPhoneNumber, or if there is no pending authentication query and the current authorization state is authorizationStateWaitEmailAddress, authorizationStateWaitEmailCode, authorizationStateWaitCode, authorizationStateWaitRegistration, or authorizationStateWaitPassword", "class": "Ok", "properties": [ { @@ -20162,7 +26358,7 @@ }, { "name": "requestQrCodeAuthentication", - "description": "Requests QR code authentication by scanning a QR code on another logged in device. Works only when the current authorization state is authorizationStateWaitPhoneNumber, or if there is no pending authentication query and the current authorization state is authorizationStateWaitCode, authorizationStateWaitRegistration, or authorizationStateWaitPassword", + "description": "Requests QR code authentication by scanning a QR code on another logged in device. Works only when the current authorization state is authorizationStateWaitPhoneNumber, or if there is no pending authentication query and the current authorization state is authorizationStateWaitEmailAddress, authorizationStateWaitEmailCode, authorizationStateWaitCode, authorizationStateWaitRegistration, or authorizationStateWaitPassword", "class": "Ok", "properties": [ { @@ -20188,11 +26384,24 @@ "name": "last_name", "type": "string", "description": "The last name of the user; 0-64 characters" + }, + { + "name": "disable_notification", + "type": "Bool", + "description": "Pass true to disable notification about the current user joining Telegram for other users that added them to contact list" } ], "is_synchronous": false, "type": 1 }, + { + "name": "resetAuthenticationEmailAddress", + "description": "Resets the login email address. May return an error with a message \"TASK_ALREADY_EXISTS\" if reset is still pending. Works only when the current authorization state is authorizationStateWaitEmailCode and authorization_state.can_reset_email_address == true", + "class": "Ok", + "properties": [], + "is_synchronous": false, + "type": 1 + }, { "name": "checkAuthenticationPassword", "description": "Checks the 2-step verification password for correctness. Works only when the current authorization state is authorizationStateWaitPassword", @@ -20253,6 +26462,20 @@ "is_synchronous": false, "type": 1 }, + { + "name": "sendAuthenticationFirebaseSms", + "description": "Sends Firebase Authentication SMS to the phone number of the user. Works only when the current authorization state is authorizationStateWaitCode and the server returned code of the type authenticationCodeTypeFirebaseAndroid or authenticationCodeTypeFirebaseIos", + "class": "Ok", + "properties": [ + { + "name": "token", + "type": "string", + "description": "SafetyNet Attestation API token for the Android application, or secret from push notification for the iOS application" + } + ], + "is_synchronous": false, + "type": 1 + }, { "name": "checkAuthenticationBotToken", "description": "Checks the authentication token of a bot; to log in as a bot. Works only when the current authorization state is authorizationStateWaitPhoneNumber. Can be used instead of setAuthenticationPhoneNumber and checkAuthenticationCode to log in", @@ -20371,7 +26594,7 @@ }, { "name": "setLoginEmailAddress", - "description": "Changes the login email address of the user. The change will not be applied until the new login email address is confirmed with checkLoginEmailAddressCode. To use Apple ID/Google ID instead of a email address, call checkLoginEmailAddressCode directly", + "description": "Changes the login email address of the user. The email address can be changed only if the current user already has login email and passwordState.login_email_address_pattern is non-empty. The change will not be applied until the new login email address is confirmed with checkLoginEmailAddressCode. To use Apple ID/Google ID instead of a email address, call checkLoginEmailAddressCode directly", "class": "EmailAddressAuthenticationCodeInfo", "properties": [ { @@ -20460,6 +26683,14 @@ "is_synchronous": false, "type": 2 }, + { + "name": "cancelRecoveryEmailAddressVerification", + "description": "Cancels verification of the 2-step verification recovery email address", + "class": "PasswordState", + "properties": [], + "is_synchronous": false, + "type": 2 + }, { "name": "requestPasswordRecovery", "description": "Requests to send a 2-step verification password recovery code to an email address that was previously set up", @@ -20657,7 +26888,7 @@ }, { "name": "getChat", - "description": "Returns information about a chat by its identifier, this is an offline request if the current user is not a bot", + "description": "Returns information about a chat by its identifier; this is an offline request if the current user is not a bot", "class": "Chat", "properties": [ { @@ -20709,7 +26940,7 @@ }, { "name": "getRepliedMessage", - "description": "Returns information about a message that is replied by a given message. Also returns the pinned message, the game message, the invoice message, and the topic creation message for messages of the types messagePinMessage, messageGameScore, messagePaymentSuccessful, and topic messages without replied message respectively", + "description": "Returns information about a non-bundled message that is replied by a given message. Also, returns the pinned message, the game message, the invoice message, the message with a previously set same background, the giveaway message, and the topic creation message for messages of the types messagePinMessage, messageGameScore, messagePaymentSuccessful, messageChatSetBackground, messagePremiumGiveawayCompleted and topic messages without non-bundled replied message respectively", "class": "Message", "properties": [ { @@ -20802,10 +27033,29 @@ "is_synchronous": false, "type": 2 }, + { + "name": "getMessageReadDate", + "description": "Returns read date of a recent outgoing message in a private chat. The method can be called if message.can_get_read_date == true and the message is read", + "class": "MessageReadDate", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "message_id", + "type": "int53", + "description": "Identifier of the message" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "getMessageViewers", "description": "Returns viewers of a recent outgoing message in a basic group or a supergroup chat. For video notes and voice notes only users, opened content of the message, are returned. The method can be called if message.can_get_viewers == true", - "class": "Users", + "class": "MessageViewers", "properties": [ { "name": "chat_id", @@ -20837,7 +27087,7 @@ }, { "name": "getRemoteFile", - "description": "Returns information about a file by its remote ID; this is an offline request. Can be used to register a URL as a file for further uploading, or sending as a message. Even the request succeeds, the file can be used only if it is still accessible to the user. 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", + "description": "Returns information about a file by its remote identifier; this is an offline request. Can be used to register a URL as a file for further uploading, or sending as a message. Even the request succeeds, the file can be used only if it is still accessible to the user. 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", "class": "File", "properties": [ { @@ -20894,7 +27144,7 @@ }, { "name": "searchPublicChat", - "description": "Searches a public chat by its username. Currently, only private chats, supergroups and channels can be public. Returns the chat if found; otherwise an error is returned", + "description": "Searches a public chat by its username. Currently, only private chats, supergroups and channels can be public. Returns the chat if found; otherwise, an error is returned", "class": "Chat", "properties": [ { @@ -20922,7 +27172,7 @@ }, { "name": "searchChats", - "description": "Searches for the specified query in the title and username of already known chats, this is an offline request. Returns chats in the order seen in the main chat list", + "description": "Searches for the specified query in the title and username of already known chats; this is an offline request. Returns chats in the order seen in the main chat list", "class": "Chats", "properties": [ { @@ -20972,9 +27222,61 @@ "is_synchronous": false, "type": 2 }, + { + "name": "getChatSimilarChats", + "description": "Returns a list of chats similar to the given chat", + "class": "Chats", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the target chat; must be an identifier of a channel chat" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getChatSimilarChatCount", + "description": "Returns approximate number of chats similar to the given chat", + "class": "Count", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the target chat; must be an identifier of a channel chat" + }, + { + "name": "return_local", + "type": "Bool", + "description": "Pass true to get the number of chats without sending network requests, or -1 if the number of chats is unknown locally" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "openChatSimilarChat", + "description": "Informs TDLib that a chat was opened from the list of similar chats. The method is independent from openChat and closeChat methods", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the original chat, which similar chats were requested" + }, + { + "name": "opened_chat_id", + "type": "int53", + "description": "Identifier of the opened chat" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "getTopChats", - "description": "Returns a list of frequently used chats. Supported only if the chat info database is enabled", + "description": "Returns a list of frequently used chats", "class": "Chats", "properties": [ { @@ -21010,6 +27312,25 @@ "is_synchronous": false, "type": 2 }, + { + "name": "searchRecentlyFoundChats", + "description": "Searches for the specified query in the title and username of up to 50 recently found chats; this is an offline request", + "class": "Chats", + "properties": [ + { + "name": "query", + "type": "string", + "description": "Query to search for" + }, + { + "name": "limit", + "type": "int32", + "description": "The maximum number of chats to be returned" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "addRecentlyFoundChat", "description": "Adds a chat to the list of recently found chats. The chat is added to the beginning of the list. If the chat is already in the list, it will be removed from the list first", @@ -21048,7 +27369,7 @@ }, { "name": "getRecentlyOpenedChats", - "description": "Returns recently opened chats, this is an offline request. Returns chats in the order of last opening", + "description": "Returns recently opened chats; this is an offline request. Returns chats in the order of last opening", "class": "Chats", "properties": [ { @@ -21068,7 +27389,7 @@ { "name": "chat_id", "type": "int53", - "description": "Chat identifier; must be identifier of a supergroup chat, or a channel chat, or a private chat with self, or zero if the chat is being created" + "description": "Chat identifier; must be identifier of a supergroup chat, or a channel chat, or a private chat with self, or 0 if the chat is being created" }, { "name": "username", @@ -21123,6 +27444,147 @@ "is_synchronous": false, "type": 2 }, + { + "name": "getSuitablePersonalChats", + "description": "Returns a list of channel chats, which can be used as a personal chat", + "class": "Chats", + "properties": [], + "is_synchronous": false, + "type": 2 + }, + { + "name": "loadSavedMessagesTopics", + "description": "Loads more Saved Messages topics. The loaded topics will be sent through updateSavedMessagesTopic. Topics are sorted by their topic.order in descending order. Returns a 404 error if all topics have been loaded", + "class": "Ok", + "properties": [ + { + "name": "limit", + "type": "int32", + "description": "The maximum number of topics to be loaded. For optimal performance, the number of loaded topics is chosen by TDLib and can be smaller than the specified limit, even if the end of the list is not reached" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getSavedMessagesTopicHistory", + "description": "Returns messages in a Saved Messages topic. The messages are returned in a reverse chronological order (i.e., in order of decreasing message_id)", + "class": "Messages", + "properties": [ + { + "name": "saved_messages_topic_id", + "type": "int53", + "description": "Identifier of Saved Messages topic which messages will be fetched" + }, + { + "name": "from_message_id", + "type": "int53", + "description": "Identifier of the message starting from which messages must be fetched; use 0 to get results from the last message" + }, + { + "name": "offset", + "type": "int32", + "description": "Specify 0 to get results from exactly the message from_message_id or a negative offset up to 99 to get additionally some newer messages" + }, + { + "name": "limit", + "type": "int32", + "description": "The maximum number of messages to be returned; must be positive and can't be greater than 100. If the offset is negative, the limit must be greater than or equal to -offset. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getSavedMessagesTopicMessageByDate", + "description": "Returns the last message sent in a Saved Messages topic no later than the specified date", + "class": "Message", + "properties": [ + { + "name": "saved_messages_topic_id", + "type": "int53", + "description": "Identifier of Saved Messages topic which message will be returned" + }, + { + "name": "date", + "type": "int32", + "description": "Point in time (Unix timestamp) relative to which to search for messages" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "deleteSavedMessagesTopicHistory", + "description": "Deletes all messages in a Saved Messages topic", + "class": "Ok", + "properties": [ + { + "name": "saved_messages_topic_id", + "type": "int53", + "description": "Identifier of Saved Messages topic which messages will be deleted" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "deleteSavedMessagesTopicMessagesByDate", + "description": "Deletes all messages between the specified dates in a Saved Messages topic. Messages sent in the last 30 seconds will not be deleted", + "class": "Ok", + "properties": [ + { + "name": "saved_messages_topic_id", + "type": "int53", + "description": "Identifier of Saved Messages topic which messages will be deleted" + }, + { + "name": "min_date", + "type": "int32", + "description": "The minimum date of the messages to delete" + }, + { + "name": "max_date", + "type": "int32", + "description": "The maximum date of the messages to delete" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "toggleSavedMessagesTopicIsPinned", + "description": "Changes the pinned state of a Saved Messages topic. There can be up to getOption(\"pinned_saved_messages_topic_count_max\") pinned topics. The limit can be increased with Telegram Premium", + "class": "Ok", + "properties": [ + { + "name": "saved_messages_topic_id", + "type": "int53", + "description": "Identifier of Saved Messages topic to pin or unpin" + }, + { + "name": "is_pinned", + "type": "Bool", + "description": "Pass true to pin the topic; pass false to unpin it" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "setPinnedSavedMessagesTopics", + "description": "Changes the order of pinned Saved Messages topics", + "class": "Ok", + "properties": [ + { + "name": "saved_messages_topic_ids", + "type": "vector\u003cint53\u003e", + "description": "Identifiers of the new pinned Saved Messages topics" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "getGroupsInCommon", "description": "Returns a list of common group chats with a given user. Chats are sorted by their type and creation date", @@ -21165,7 +27627,7 @@ { "name": "offset", "type": "int32", - "description": "Specify 0 to get results from exactly the from_message_id or a negative offset up to 99 to get additionally some newer messages" + "description": "Specify 0 to get results from exactly the message from_message_id or a negative offset up to 99 to get additionally some newer messages" }, { "name": "limit", @@ -21204,7 +27666,7 @@ { "name": "offset", "type": "int32", - "description": "Specify 0 to get results from exactly the from_message_id or a negative offset up to 99 to get additionally some newer messages" + "description": "Specify 0 to get results from exactly the message from_message_id or a negative offset up to 99 to get additionally some newer messages" }, { "name": "limit", @@ -21281,7 +27743,7 @@ { "name": "offset", "type": "int32", - "description": "Specify 0 to get results from exactly the from_message_id or a negative offset to get the specified message and some newer messages" + "description": "Specify 0 to get results from exactly the message from_message_id or a negative offset to get the specified message and some newer messages" }, { "name": "limit", @@ -21297,6 +27759,11 @@ "name": "message_thread_id", "type": "int53", "description": "If not 0, only messages in the specified thread will be returned; supergroups only" + }, + { + "name": "saved_messages_topic_id", + "type": "int53", + "description": "If not 0, only messages in the specified Saved Messages topic will be returned; pass 0 to return all messages, or for chats other than Saved Messages" } ], "is_synchronous": false, @@ -21380,6 +27847,45 @@ "is_synchronous": false, "type": 2 }, + { + "name": "searchSavedMessages", + "description": "Searches for messages tagged by the given reaction and with the given words in the Saved Messages chat; for Telegram Premium users only. Returns the results in reverse chronological order, i.e. in order of decreasing message_id For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit", + "class": "FoundChatMessages", + "properties": [ + { + "name": "saved_messages_topic_id", + "type": "int53", + "description": "If not 0, only messages in the specified Saved Messages topic will be considered; pass 0 to consider all messages" + }, + { + "name": "tag", + "type": "ReactionType", + "description": "Tag to search for; pass null to return all suitable messages" + }, + { + "name": "query", + "type": "string", + "description": "Query to search for" + }, + { + "name": "from_message_id", + "type": "int53", + "description": "Identifier of the message starting from which messages must be fetched; use 0 to get results from the last message" + }, + { + "name": "offset", + "type": "int32", + "description": "Specify 0 to get results from exactly the message from_message_id or a negative offset to get the specified message and some newer messages" + }, + { + "name": "limit", + "type": "int32", + "description": "The maximum number of messages to be returned; must be positive and can't be greater than 100. If the offset is negative, the limit must be greater than -offset. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "searchCallMessages", "description": "Searches for call messages. Returns the results in reverse chronological order (i.e., in order of decreasing message_id). For optimal performance, the number of returned messages is chosen by TDLib", @@ -21507,6 +28013,11 @@ "name": "limit", "type": "int32", "description": "The expected number of message positions to be returned; 50-2000. A smaller number of positions can be returned, if there are not enough appropriate messages" + }, + { + "name": "saved_messages_topic_id", + "type": "int53", + "description": "If not 0, only messages in the specified Saved Messages topic will be considered; pass 0 to consider all messages, or for chats other than Saved Messages" } ], "is_synchronous": false, @@ -21531,6 +28042,11 @@ "name": "from_message_id", "type": "int53", "description": "The message identifier from which to return information about messages; use 0 to get results from the last message" + }, + { + "name": "saved_messages_topic_id", + "type": "int53", + "description": "If not0, only messages in the specified Saved Messages topic will be considered; pass 0 to consider all messages, or for chats other than Saved Messages" } ], "is_synchronous": false, @@ -21551,6 +28067,11 @@ "type": "SearchMessagesFilter", "description": "Filter for message content; searchMessagesFilterEmpty is unsupported in this function" }, + { + "name": "saved_messages_topic_id", + "type": "int53", + "description": "If not 0, only messages in the specified Saved Messages topic will be counted; pass 0 to count all messages, or for chats other than Saved Messages" + }, { "name": "return_local", "type": "Bool", @@ -21584,6 +28105,11 @@ "name": "message_thread_id", "type": "int53", "description": "If not 0, only messages in the specified thread will be considered; supergroups only" + }, + { + "name": "saved_messages_topic_id", + "type": "int53", + "description": "If not 0, only messages in the specified Saved Messages topic will be considered; pass 0 to consider all relevant messages, or for chats other than Saved Messages" } ], "is_synchronous": false, @@ -21603,35 +28129,6 @@ "is_synchronous": false, "type": 2 }, - { - "name": "getMessagePublicForwards", - "description": "Returns forwarded copies of a channel message to different public channels. For optimal performance, the number of returned messages is chosen by TDLib", - "class": "FoundMessages", - "properties": [ - { - "name": "chat_id", - "type": "int53", - "description": "Chat identifier of the message" - }, - { - "name": "message_id", - "type": "int53", - "description": "Message identifier" - }, - { - "name": "offset", - "type": "string", - "description": "Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results" - }, - { - "name": "limit", - "type": "int32", - "description": "The maximum number of messages to be returned; must be positive and can't be greater than 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit" - } - ], - "is_synchronous": false, - "type": 2 - }, { "name": "getChatSponsoredMessages", "description": "Returns sponsored messages to be shown in a chat; for channel chats only", @@ -21646,6 +28143,49 @@ "is_synchronous": false, "type": 2 }, + { + "name": "clickChatSponsoredMessage", + "description": "Informs TDLib that the user opened the sponsored chat via the button, the name, the photo, or a mention in the sponsored message", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier of the sponsored message" + }, + { + "name": "message_id", + "type": "int53", + "description": "Identifier of the sponsored message" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "reportChatSponsoredMessage", + "description": "Reports a sponsored message to Telegram moderators", + "class": "ReportChatSponsoredMessageResult", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier of the sponsored message" + }, + { + "name": "message_id", + "type": "int53", + "description": "Identifier of the sponsored message" + }, + { + "name": "option_id", + "type": "bytes", + "description": "Option identifier chosen by the user; leave empty for the initial request" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "removeNotification", "description": "Removes an active notification from notification list. Needs to be called only if the notification is removed by the current user", @@ -21702,7 +28242,7 @@ { "name": "media_timestamp", "type": "int32", - "description": "If not 0, timestamp from which the video/audio/video note/voice note playing must start, in seconds. The media can be in the message content or in its web page preview" + "description": "If not 0, timestamp from which the video/audio/video note/voice note/story playing must start, in seconds. The media can be in the message content or in its web page preview" }, { "name": "for_album", @@ -21758,23 +28298,42 @@ }, { "name": "translateText", - "description": "Translates a text to the given language. Returns a 404 error if the translation can't be performed", - "class": "Text", + "description": "Translates a text to the given language. If the current user is a Telegram Premium user, then text formatting is preserved", + "class": "FormattedText", "properties": [ { "name": "text", - "type": "string", + "type": "formattedText", "description": "Text to translate" }, - { - "name": "from_language_code", - "type": "string", - "description": "A two-letter ISO 639-1 language code of the language from which the message is translated. If empty, the language will be detected automatically" - }, { "name": "to_language_code", "type": "string", - "description": "A two-letter ISO 639-1 language code of the language to which the message is translated" + "description": "Language code of the language to which the message is translated. Must be one of \"af\", \"sq\", \"am\", \"ar\", \"hy\", \"az\", \"eu\", \"be\", \"bn\", \"bs\", \"bg\", \"ca\", \"ceb\", \"zh-CN\", \"zh\", \"zh-Hans\", \"zh-TW\", \"zh-Hant\", \"co\", \"hr\", \"cs\", \"da\", \"nl\", \"en\", \"eo\", \"et\", \"fi\", \"fr\", \"fy\", \"gl\", \"ka\", \"de\", \"el\", \"gu\", \"ht\", \"ha\", \"haw\", \"he\", \"iw\", \"hi\", \"hmn\", \"hu\", \"is\", \"ig\", \"id\", \"in\", \"ga\", \"it\", \"ja\", \"jv\", \"kn\", \"kk\", \"km\", \"rw\", \"ko\", \"ku\", \"ky\", \"lo\", \"la\", \"lv\", \"lt\", \"lb\", \"mk\", \"mg\", \"ms\", \"ml\", \"mt\", \"mi\", \"mr\", \"mn\", \"my\", \"ne\", \"no\", \"ny\", \"or\", \"ps\", \"fa\", \"pl\", \"pt\", \"pa\", \"ro\", \"ru\", \"sm\", \"gd\", \"sr\", \"st\", \"sn\", \"sd\", \"si\", \"sk\", \"sl\", \"so\", \"es\", \"su\", \"sw\", \"sv\", \"tl\", \"tg\", \"ta\", \"tt\", \"te\", \"th\", \"tr\", \"tk\", \"uk\", \"ur\", \"ug\", \"uz\", \"vi\", \"cy\", \"xh\", \"yi\", \"ji\", \"yo\", \"zu\"" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "translateMessageText", + "description": "Extracts text or caption of the given message and translates it to the given language. If the current user is a Telegram Premium user, then text formatting is preserved", + "class": "FormattedText", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat to which the message belongs" + }, + { + "name": "message_id", + "type": "int53", + "description": "Identifier of the message" + }, + { + "name": "to_language_code", + "type": "string", + "description": "Language code of the language to which the message is translated. Must be one of \"af\", \"sq\", \"am\", \"ar\", \"hy\", \"az\", \"eu\", \"be\", \"bn\", \"bs\", \"bg\", \"ca\", \"ceb\", \"zh-CN\", \"zh\", \"zh-Hans\", \"zh-TW\", \"zh-Hant\", \"co\", \"hr\", \"cs\", \"da\", \"nl\", \"en\", \"eo\", \"et\", \"fi\", \"fr\", \"fy\", \"gl\", \"ka\", \"de\", \"el\", \"gu\", \"ht\", \"ha\", \"haw\", \"he\", \"iw\", \"hi\", \"hmn\", \"hu\", \"is\", \"ig\", \"id\", \"in\", \"ga\", \"it\", \"ja\", \"jv\", \"kn\", \"kk\", \"km\", \"rw\", \"ko\", \"ku\", \"ky\", \"lo\", \"la\", \"lv\", \"lt\", \"lb\", \"mk\", \"mg\", \"ms\", \"ml\", \"mt\", \"mi\", \"mr\", \"mn\", \"my\", \"ne\", \"no\", \"ny\", \"or\", \"ps\", \"fa\", \"pl\", \"pt\", \"pa\", \"ro\", \"ru\", \"sm\", \"gd\", \"sr\", \"st\", \"sn\", \"sd\", \"si\", \"sk\", \"sl\", \"so\", \"es\", \"su\", \"sw\", \"sv\", \"tl\", \"tg\", \"ta\", \"tt\", \"te\", \"th\", \"tr\", \"tk\", \"uk\", \"ur\", \"ug\", \"uz\", \"vi\", \"cy\", \"xh\", \"yi\", \"ji\", \"yo\", \"zu\"" } ], "is_synchronous": false, @@ -21782,7 +28341,7 @@ }, { "name": "recognizeSpeech", - "description": "Recognizes speech in a video note or a voice note message. The message must be successfully sent and must not be scheduled. May return an error with a message \"MSG_VOICE_TOO_LONG\" if media duration is too big to be recognized", + "description": "Recognizes speech in a video note or a voice note message. The message must be successfully sent, must not be scheduled, and must be from a non-secret chat", "class": "Ok", "properties": [ { @@ -21869,12 +28428,12 @@ { "name": "message_thread_id", "type": "int53", - "description": "If not 0, a message thread identifier in which the message will be sent" + "description": "If not 0, the message thread identifier in which the message will be sent" }, { - "name": "reply_to_message_id", - "type": "int53", - "description": "Identifier of the replied message; 0 if none" + "name": "reply_to", + "type": "InputMessageReplyTo", + "description": "Information about the message or story to be replied; pass null if none" }, { "name": "options", @@ -21908,12 +28467,12 @@ { "name": "message_thread_id", "type": "int53", - "description": "If not 0, a message thread identifier in which the messages will be sent" + "description": "If not 0, the message thread identifier in which the messages will be sent" }, { - "name": "reply_to_message_id", - "type": "int53", - "description": "Identifier of a replied message; 0 if none" + "name": "reply_to", + "type": "InputMessageReplyTo", + "description": "Information about the message or story to be replied; pass null if none" }, { "name": "options", @@ -21924,11 +28483,6 @@ "name": "input_message_contents", "type": "vector\u003cInputMessageContent\u003e", "description": "Contents of messages to be sent. At most 10 messages can be added to an album" - }, - { - "name": "only_preview", - "type": "Bool", - "description": "Pass true to get fake messages instead of actually sending them" } ], "is_synchronous": false, @@ -21936,7 +28490,7 @@ }, { "name": "sendBotStartMessage", - "description": "Invites a bot to a chat (if it is not yet a member) and sends it the /start command. Bots can't be invited to a private chat other than the chat with the bot. Bots can't be invited to channels (although they can be added as admins) and secret chats. Returns the sent message", + "description": "Invites a bot to a chat (if it is not yet a member) and sends it the /start command; requires can_invite_users member right. Bots can't be invited to a private chat other than the chat with the bot. Bots can't be invited to channels (although they can be added as admins) and secret chats. Returns the sent message", "class": "Message", "properties": [ { @@ -21971,12 +28525,12 @@ { "name": "message_thread_id", "type": "int53", - "description": "If not 0, a message thread identifier in which the message will be sent" + "description": "If not 0, the message thread identifier in which the message will be sent" }, { - "name": "reply_to_message_id", - "type": "int53", - "description": "Identifier of a replied message; 0 if none" + "name": "reply_to", + "type": "InputMessageReplyTo", + "description": "Information about the message or story to be replied; pass null if none" }, { "name": "options", @@ -21991,7 +28545,7 @@ { "name": "result_id", "type": "string", - "description": "Identifier of the inline result" + "description": "Identifier of the inline query result" }, { "name": "hide_via_bot", @@ -22015,7 +28569,7 @@ { "name": "message_thread_id", "type": "int53", - "description": "If not 0, a message thread identifier in which the message will be sent; for forum threads only" + "description": "If not 0, the message thread identifier in which the message will be sent; for forum threads only" }, { "name": "from_chat_id", @@ -22025,7 +28579,7 @@ { "name": "message_ids", "type": "vector\u003cint53\u003e", - "description": "Identifiers of the messages to forward. Message identifiers must be in a strictly increasing order. At most 100 messages can be forwarded simultaneously" + "description": "Identifiers of the messages to forward. Message identifiers must be in a strictly increasing order. At most 100 messages can be forwarded simultaneously. A message can be forwarded only if message.can_be_forwarded" }, { "name": "options", @@ -22041,11 +28595,30 @@ "name": "remove_caption", "type": "Bool", "description": "Pass true to remove media captions of message copies. Ignored if send_copy is false" + } + ], + "is_synchronous": false, + "type": 1 + }, + { + "name": "sendQuickReplyShortcutMessages", + "description": "Sends messages from a quick reply shortcut. Requires Telegram Business subscription", + "class": "Messages", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat to which to send messages. The chat must be a private chat with a regular user" }, { - "name": "only_preview", - "type": "Bool", - "description": "Pass true to get fake messages instead of actually forwarding them" + "name": "shortcut_id", + "type": "int32", + "description": "Unique identifier of the quick reply shortcut" + }, + { + "name": "sending_id", + "type": "int32", + "description": "Non-persistent identifier, which will be returned back in messageSendingStatePending object and can be used to match sent messages and corresponding updateNewMessage updates" } ], "is_synchronous": false, @@ -22065,25 +28638,16 @@ "name": "message_ids", "type": "vector\u003cint53\u003e", "description": "Identifiers of the messages to resend. Message identifiers must be in a strictly increasing order" + }, + { + "name": "quote", + "type": "inputTextQuote", + "description": "New manually chosen quote from the message to be replied; pass null if none. Ignored if more than one message is re-sent, or if messageSendingStateFailed.need_another_reply_quote == false" } ], "is_synchronous": false, "type": 1 }, - { - "name": "sendChatScreenshotTakenNotification", - "description": "Sends a notification about a screenshot taken in a chat. Supported only in private and secret chats", - "class": "Ok", - "properties": [ - { - "name": "chat_id", - "type": "int53", - "description": "Chat identifier" - } - ], - "is_synchronous": false, - "type": 2 - }, { "name": "addLocalMessage", "description": "Adds a local message to a chat. The message is persistent across application restarts only if the message database is used. Returns the added message", @@ -22100,9 +28664,9 @@ "description": "Identifier of the sender of the message" }, { - "name": "reply_to_message_id", - "type": "int53", - "description": "Identifier of the replied message; 0 if none" + "name": "reply_to", + "type": "InputMessageReplyTo", + "description": "Information about the message or story to be replied; pass null if none" }, { "name": "disable_notification", @@ -22489,6 +29053,191 @@ "is_synchronous": false, "type": 2 }, + { + "name": "sendBusinessMessage", + "description": "Sends a message on behalf of a business account; for bots only. Returns the message after it was sent", + "class": "BusinessMessage", + "properties": [ + { + "name": "business_connection_id", + "type": "string", + "description": "Unique identifier of business connection on behalf of which to send the request" + }, + { + "name": "chat_id", + "type": "int53", + "description": "Target chat" + }, + { + "name": "reply_to", + "type": "InputMessageReplyTo", + "description": "Information about the message to be replied; pass null if none" + }, + { + "name": "disable_notification", + "type": "Bool", + "description": "Pass true to disable notification for the message" + }, + { + "name": "protect_content", + "type": "Bool", + "description": "Pass true if the content of the message must be protected from forwarding and saving" + }, + { + "name": "reply_markup", + "type": "ReplyMarkup", + "description": "Markup for replying to the message; pass null if none" + }, + { + "name": "input_message_content", + "type": "InputMessageContent", + "description": "The content of the message to be sent" + } + ], + "is_synchronous": false, + "type": 3 + }, + { + "name": "sendBusinessMessageAlbum", + "description": "Sends 2-10 messages grouped together into an album on behalf of a business account; for bots only. Currently, only audio, document, photo and video messages can be grouped into an album. Documents and audio files can be only grouped in an album with messages of the same type. Returns sent messages", + "class": "BusinessMessages", + "properties": [ + { + "name": "business_connection_id", + "type": "string", + "description": "Unique identifier of business connection on behalf of which to send the request" + }, + { + "name": "chat_id", + "type": "int53", + "description": "Target chat" + }, + { + "name": "reply_to", + "type": "InputMessageReplyTo", + "description": "Information about the message to be replied; pass null if none" + }, + { + "name": "disable_notification", + "type": "Bool", + "description": "Pass true to disable notification for the message" + }, + { + "name": "protect_content", + "type": "Bool", + "description": "Pass true if the content of the message must be protected from forwarding and saving" + }, + { + "name": "input_message_contents", + "type": "vector\u003cInputMessageContent\u003e", + "description": "Contents of messages to be sent. At most 10 messages can be added to an album" + } + ], + "is_synchronous": false, + "type": 3 + }, + { + "name": "checkQuickReplyShortcutName", + "description": "Checks validness of a name for a quick reply shortcut. Can be called synchronously", + "class": "Ok", + "properties": [ + { + "name": "name", + "type": "string", + "description": "The name of the shortcut; 1-32 characters" + } + ], + "is_synchronous": true, + "type": 1 + }, + { + "name": "loadQuickReplyShortcuts", + "description": "Loads quick reply shortcuts created by the current user. The loaded topics will be sent through updateQuickReplyShortcuts", + "class": "Ok", + "properties": [], + "is_synchronous": false, + "type": 2 + }, + { + "name": "setQuickReplyShortcutName", + "description": "Changes name of a quick reply shortcut", + "class": "Ok", + "properties": [ + { + "name": "shortcut_id", + "type": "int32", + "description": "Unique identifier of the quick reply shortcut" + }, + { + "name": "name", + "type": "string", + "description": "New name for the shortcut. Use checkQuickReplyShortcutName to check its validness" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "deleteQuickReplyShortcut", + "description": "Deletes a quick reply shortcut", + "class": "Ok", + "properties": [ + { + "name": "shortcut_id", + "type": "int32", + "description": "Unique identifier of the quick reply shortcut" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "reorderQuickReplyShortcuts", + "description": "Changes the order of quick reply shortcuts", + "class": "Ok", + "properties": [ + { + "name": "shortcut_ids", + "type": "vector\u003cint32\u003e", + "description": "The new order of quick reply shortcuts" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "loadQuickReplyShortcutMessages", + "description": "Loads quick reply messages that can be sent by a given quick reply shortcut. The loaded messages will be sent through updateQuickReplyShortcutMessages", + "class": "Ok", + "properties": [ + { + "name": "shortcut_id", + "type": "int32", + "description": "Unique identifier of the quick reply shortcut" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "deleteQuickReplyShortcutMessages", + "description": "Deletes specified quick reply messages", + "class": "Ok", + "properties": [ + { + "name": "shortcut_id", + "type": "int32", + "description": "Unique identifier of the quick reply shortcut to which the messages belong" + }, + { + "name": "message_ids", + "type": "vector\u003cint53\u003e", + "description": "Unique identifiers of the messages" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "getForumTopicDefaultIcons", "description": "Returns list of custom emojis, which can be used as forum topic icon by all users", @@ -22499,7 +29248,7 @@ }, { "name": "createForumTopic", - "description": "Creates a topic in a forum supergroup chat; requires can_manage_topics rights in the supergroup", + "description": "Creates a topic in a forum supergroup chat; requires can_manage_topics administrator or can_create_topics member right in the supergroup", "class": "ForumTopicInfo", "properties": [ { @@ -22523,7 +29272,7 @@ }, { "name": "editForumTopic", - "description": "Edits title and icon of a topic in a forum supergroup chat; requires can_manage_topics administrator right in the supergroup unless the user is creator of the topic", + "description": "Edits title and icon of a topic in a forum supergroup chat; requires can_manage_topics right in the supergroup unless the user is creator of the topic", "class": "Ok", "properties": [ { @@ -22658,7 +29407,7 @@ }, { "name": "toggleForumTopicIsClosed", - "description": "Toggles whether a topic is closed in a forum supergroup chat; requires can_manage_topics administrator right in the supergroup unless the user is creator of the topic", + "description": "Toggles whether a topic is closed in a forum supergroup chat; requires can_manage_topics right in the supergroup unless the user is creator of the topic", "class": "Ok", "properties": [ { @@ -22682,7 +29431,7 @@ }, { "name": "toggleGeneralForumTopicIsHidden", - "description": "Toggles whether a General topic is hidden in a forum supergroup chat; requires can_manage_topics administrator right in the supergroup", + "description": "Toggles whether a General topic is hidden in a forum supergroup chat; requires can_manage_topics right in the supergroup", "class": "Ok", "properties": [ { @@ -22701,7 +29450,7 @@ }, { "name": "toggleForumTopicIsPinned", - "description": "Changes the pinned state of a forum topic; requires can_manage_topics administrator right in the supergroup. There can be up to getOption(\"pinned_forum_topic_count_max\") pinned forum topics", + "description": "Changes the pinned state of a forum topic; requires can_manage_topics right in the supergroup. There can be up to getOption(\"pinned_forum_topic_count_max\") pinned forum topics", "class": "Ok", "properties": [ { @@ -22725,7 +29474,7 @@ }, { "name": "setPinnedForumTopics", - "description": "Changes the order of pinned forum topics", + "description": "Changes the order of pinned forum topics; requires can_manage_topics right in the supergroup", "class": "Ok", "properties": [ { @@ -22763,7 +29512,7 @@ }, { "name": "getEmojiReaction", - "description": "Returns information about a emoji reaction. Returns a 404 error if the reaction is not found", + "description": "Returns information about an emoji reaction. Returns a 404 error if the reaction is not found", "class": "EmojiReaction", "properties": [ { @@ -22817,7 +29566,7 @@ }, { "name": "addMessageReaction", - "description": "Adds a reaction to a message. Use getMessageAvailableReactions to receive the list of available reactions for the message", + "description": "Adds a reaction or a tag to a message. Use getMessageAvailableReactions to receive the list of available reactions for the message", "class": "Ok", "properties": [ { @@ -22843,7 +29592,7 @@ { "name": "update_recent_reactions", "type": "Bool", - "description": "Pass true if the reaction needs to be added to recent reactions" + "description": "Pass true if the reaction needs to be added to recent reactions; tags are never added to the list of recent reactions" } ], "is_synchronous": false, @@ -22873,6 +29622,35 @@ "is_synchronous": false, "type": 2 }, + { + "name": "setMessageReactions", + "description": "Sets reactions on a message; for bots only", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat to which the message belongs" + }, + { + "name": "message_id", + "type": "int53", + "description": "Identifier of the message" + }, + { + "name": "reaction_types", + "type": "vector\u003cReactionType\u003e", + "description": "Types of the reaction to set" + }, + { + "name": "is_big", + "type": "Bool", + "description": "Pass true if the reactions are added with a big animation" + } + ], + "is_synchronous": false, + "type": 3 + }, { "name": "getMessageAddedReactions", "description": "Returns reactions added for a message, along with their sender", @@ -22921,6 +29699,63 @@ "is_synchronous": false, "type": 2 }, + { + "name": "getSavedMessagesTags", + "description": "Returns tags used in Saved Messages or a Saved Messages topic", + "class": "SavedMessagesTags", + "properties": [ + { + "name": "saved_messages_topic_id", + "type": "int53", + "description": "Identifier of Saved Messages topic which tags will be returned; pass 0 to get all Saved Messages tags" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "setSavedMessagesTagLabel", + "description": "Changes label of a Saved Messages tag; for Telegram Premium users only", + "class": "Ok", + "properties": [ + { + "name": "tag", + "type": "ReactionType", + "description": "The tag which label will be changed" + }, + { + "name": "label", + "type": "string", + "description": "New label for the tag; 0-12 characters" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "searchQuote", + "description": "Searches for a given quote in a text. Returns found quote start position in UTF-16 code units. Returns a 404 error if the quote is not found. Can be called synchronously", + "class": "FoundPosition", + "properties": [ + { + "name": "text", + "type": "formattedText", + "description": "Text in which to search for the quote" + }, + { + "name": "quote", + "type": "formattedText", + "description": "Quote to search for" + }, + { + "name": "quote_position", + "type": "int32", + "description": "Approximate quote position in UTF-16 code units" + } + ], + "is_synchronous": true, + "type": 1 + }, { "name": "getTextEntities", "description": "Returns all entities (mentions, hashtags, cashtags, bot commands, bank card numbers, URLs, and email addresses) found in the text. Can be called synchronously", @@ -22929,7 +29764,7 @@ { "name": "text", "type": "string", - "description": "The text in which to look for entites" + "description": "The text in which to look for entities" } ], "is_synchronous": true, @@ -22937,7 +29772,7 @@ }, { "name": "parseTextEntities", - "description": "Parses Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, Code, Pre, PreCode, TextUrl and MentionName entities from a marked-up text. Can be called synchronously", + "description": "Parses Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, BlockQuote, Code, Pre, PreCode, TextUrl and MentionName entities from a marked-up text. Can be called synchronously", "class": "FormattedText", "properties": [ { @@ -22982,6 +29817,20 @@ "is_synchronous": true, "type": 1 }, + { + "name": "getCountryFlagEmoji", + "description": "Returns an emoji for the given country. Returns an empty string on failure. Can be called synchronously", + "class": "Text", + "properties": [ + { + "name": "country_code", + "type": "string", + "description": "A two-letter ISO 3166-1 alpha-2 country code as received from getCountries" + } + ], + "is_synchronous": true, + "type": 1 + }, { "name": "getFileMimeType", "description": "Returns the MIME type of a file, guessed by its extension. Returns an empty string on failure. Can be called synchronously", @@ -23121,8 +29970,8 @@ }, { "name": "getPollVoters", - "description": "Returns users voted for the specified option in a non-anonymous polls. For optimal performance, the number of returned users is chosen by TDLib", - "class": "Users", + "description": "Returns message senders voted for the specified option in a non-anonymous polls. For optimal performance, the number of returned users is chosen by TDLib", + "class": "MessageSenders", "properties": [ { "name": "chat_id", @@ -23142,12 +29991,12 @@ { "name": "offset", "type": "int32", - "description": "Number of users to skip in the result; must be non-negative" + "description": "Number of voters to skip in the result; must be non-negative" }, { "name": "limit", "type": "int32", - "description": "The maximum number of users to be returned; must be positive and can't be greater than 50. For optimal performance, the number of returned users is chosen by TDLib and can be smaller than the specified limit, even if the end of the voter list has not been reached" + "description": "The maximum number of voters to be returned; must be positive and can't be greater than 50. For optimal performance, the number of returned voters is chosen by TDLib and can be smaller than the specified limit, even if the end of the voter list has not been reached" } ], "is_synchronous": false, @@ -23155,7 +30004,7 @@ }, { "name": "stopPoll", - "description": "Stops a poll. A poll in a message can be stopped when the message has can_be_edited flag set", + "description": "Stops a poll. A poll in a message can be stopped when the message has can_be_edited flag is set", "class": "Ok", "properties": [ { @@ -23191,6 +30040,20 @@ "is_synchronous": false, "type": 2 }, + { + "name": "getBusinessConnection", + "description": "Returns information about a business connection by its identifier; for bots only", + "class": "BusinessConnection", + "properties": [ + { + "name": "connection_id", + "type": "string", + "description": "Identifier of the business connection to return" + } + ], + "is_synchronous": false, + "type": 3 + }, { "name": "getLoginUrlInfo", "description": "Returns information about a button of type inlineKeyboardButtonTypeLoginUrl. The method needs to be called when the user presses the button", @@ -23244,6 +30107,74 @@ "is_synchronous": false, "type": 2 }, + { + "name": "shareUsersWithBot", + "description": "Shares users after pressing a keyboardButtonTypeRequestUsers button with the bot", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat with the bot" + }, + { + "name": "message_id", + "type": "int53", + "description": "Identifier of the message with the button" + }, + { + "name": "button_id", + "type": "int32", + "description": "Identifier of the button" + }, + { + "name": "shared_user_ids", + "type": "vector\u003cint53\u003e", + "description": "Identifiers of the shared users" + }, + { + "name": "only_check", + "type": "Bool", + "description": "Pass true to check that the users can be shared by the button instead of actually sharing them" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "shareChatWithBot", + "description": "Shares a chat after pressing a keyboardButtonTypeRequestChat button with the bot", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat with the bot" + }, + { + "name": "message_id", + "type": "int53", + "description": "Identifier of the message with the button" + }, + { + "name": "button_id", + "type": "int32", + "description": "Identifier of the button" + }, + { + "name": "shared_chat_id", + "type": "int53", + "description": "Identifier of the shared chat" + }, + { + "name": "only_check", + "type": "Bool", + "description": "Pass true to check that the chat can be shared by the button instead of actually sharing it. Doesn't check bot_is_member and bot_administrator_rights restrictions. If the bot must be a member, then all chats from getGroupsInCommon and all chats, where the user can add the bot, are suitable. In the latter case the bot will be automatically added to the chat. If the bot must be an administrator, then all chats, where the bot already has requested rights or can be added to administrators by the user, are suitable. In the latter case the bot will be automatically granted requested rights" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "getInlineQueryResults", "description": "Sends an inline query to a bot and returns its results. Returns an error with code 502 if the bot fails to answer the query before the query timeout expires", @@ -23252,7 +30183,7 @@ { "name": "bot_user_id", "type": "int53", - "description": "The identifier of the target bot" + "description": "Identifier of the target bot" }, { "name": "chat_id", @@ -23272,7 +30203,7 @@ { "name": "offset", "type": "string", - "description": "Offset of the first entry to return" + "description": "Offset of the first entry to return; use empty string to get the first chunk of results" } ], "is_synchronous": false, @@ -23293,6 +30224,11 @@ "type": "Bool", "description": "Pass true if results may be cached and returned only for the user that sent the query. By default, results may be returned to any user who sends the same query" }, + { + "name": "button", + "type": "inlineQueryResultsButton", + "description": "Button to be shown above inline query results; pass null if none" + }, { "name": "results", "type": "vector\u003cInputInlineQueryResult\u003e", @@ -23307,24 +30243,77 @@ "name": "next_offset", "type": "string", "description": "Offset for the next inline query; pass an empty string if there are no more results" - }, - { - "name": "switch_pm_text", - "type": "string", - "description": "If non-empty, this text must be shown on the button that opens a private chat with the bot and sends a start message to the bot with the parameter switch_pm_parameter" - }, - { - "name": "switch_pm_parameter", - "type": "string", - "description": "The parameter for the bot start message" } ], "is_synchronous": false, "type": 3 }, + { + "name": "searchWebApp", + "description": "Returns information about a Web App by its short name. Returns a 404 error if the Web App is not found", + "class": "FoundWebApp", + "properties": [ + { + "name": "bot_user_id", + "type": "int53", + "description": "Identifier of the target bot" + }, + { + "name": "web_app_short_name", + "type": "string", + "description": "Short name of the Web App" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getWebAppLinkUrl", + "description": "Returns an HTTPS URL of a Web App to open after a link of the type internalLinkTypeWebApp is clicked", + "class": "HttpUrl", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat in which the link was clicked; pass 0 if none" + }, + { + "name": "bot_user_id", + "type": "int53", + "description": "Identifier of the target bot" + }, + { + "name": "web_app_short_name", + "type": "string", + "description": "Short name of the Web App" + }, + { + "name": "start_parameter", + "type": "string", + "description": "Start parameter from internalLinkTypeWebApp" + }, + { + "name": "theme", + "type": "themeParameters", + "description": "Preferred Web App theme; pass null to use the default theme" + }, + { + "name": "application_name", + "type": "string", + "description": "Short name of the application; 0-64 English letters, digits, and underscores" + }, + { + "name": "allow_write_access", + "type": "Bool", + "description": "Pass true if the current user allowed the bot to send them messages" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "getWebAppUrl", - "description": "Returns an HTTPS URL of a Web App to open after keyboardButtonTypeWebApp button is pressed", + "description": "Returns an HTTPS URL of a Web App to open from the side menu, a keyboardButtonTypeWebApp button, an inlineQueryResultsButtonTypeWebApp button, or an internalLinkTypeSideMenuBot link", "class": "HttpUrl", "properties": [ { @@ -23335,7 +30324,7 @@ { "name": "url", "type": "string", - "description": "The URL from the keyboardButtonTypeWebApp button" + "description": "The URL from a keyboardButtonTypeWebApp button, inlineQueryResultsButtonTypeWebApp button, an internalLinkTypeSideMenuBot link, or an empty when the bot is opened from the side menu" }, { "name": "theme", @@ -23369,7 +30358,7 @@ { "name": "data", "type": "string", - "description": "Received data" + "description": "The data" } ], "is_synchronous": false, @@ -23377,13 +30366,13 @@ }, { "name": "openWebApp", - "description": "Informs TDLib that a Web App is being opened from attachment menu, a botMenuButton button, an internalLinkTypeAttachmentMenuBot link, or an inlineKeyboardButtonTypeWebApp button. For each bot, a confirmation alert about data sent to the bot must be shown once", + "description": "Informs TDLib that a Web App is being opened from the attachment menu, a botMenuButton button, an internalLinkTypeAttachmentMenuBot link, or an inlineKeyboardButtonTypeWebApp button. For each bot, a confirmation alert about data sent to the bot must be shown once", "class": "WebAppInfo", "properties": [ { "name": "chat_id", "type": "int53", - "description": "Identifier of the chat in which the Web App is opened" + "description": "Identifier of the chat in which the Web App is opened. The Web App can't be opened in secret chats" }, { "name": "bot_user_id", @@ -23393,7 +30382,7 @@ { "name": "url", "type": "string", - "description": "The URL from an inlineKeyboardButtonTypeWebApp button, a botMenuButton button, or an internalLinkTypeAttachmentMenuBot link, or an empty string otherwise" + "description": "The URL from an inlineKeyboardButtonTypeWebApp button, a botMenuButton button, an internalLinkTypeAttachmentMenuBot link, or an empty string otherwise" }, { "name": "theme", @@ -23408,12 +30397,12 @@ { "name": "message_thread_id", "type": "int53", - "description": "If not 0, a message thread identifier in which the message will be sent" + "description": "If not 0, the message thread identifier in which the message will be sent" }, { - "name": "reply_to_message_id", - "type": "int53", - "description": "Identifier of the replied message for the message sent by the Web App; 0 if none" + "name": "reply_to", + "type": "InputMessageReplyTo", + "description": "Information about the message or story to be replied in the message sent by the Web App; pass null if none" } ], "is_synchronous": false, @@ -23701,7 +30690,12 @@ { "name": "message_thread_id", "type": "int53", - "description": "If not 0, a message thread identifier in which the action was performed" + "description": "If not 0, the message thread identifier in which the action was performed" + }, + { + "name": "business_connection_id", + "type": "string", + "description": "Unique identifier of business connection on behalf of which to send the request; for bots only" }, { "name": "action", @@ -23750,16 +30744,16 @@ "type": "int53", "description": "Chat identifier" }, - { - "name": "message_thread_id", - "type": "int53", - "description": "If not 0, a message thread identifier in which the messages are being viewed" - }, { "name": "message_ids", "type": "vector\u003cint53\u003e", "description": "The identifiers of the messages being viewed" }, + { + "name": "source", + "type": "MessageSource", + "description": "Source of the message view; pass null to guess the source based on chat open state" + }, { "name": "force_read", "type": "Bool", @@ -23807,6 +30801,25 @@ "is_synchronous": false, "type": 2 }, + { + "name": "getInternalLink", + "description": "Returns an HTTPS or a tg: link with the given type. Can be called before authorization", + "class": "HttpUrl", + "properties": [ + { + "name": "type", + "type": "InternalLinkType", + "description": "Expected type of the link" + }, + { + "name": "is_http", + "type": "Bool", + "description": "Pass true to create an HTTPS link (only available for some link types); pass false to create a tg: link" + } + ], + "is_synchronous": false, + "type": 1 + }, { "name": "getInternalLinkType", "description": "Returns information about the type of an internal link. Returns a 404 error if the link is not internal. Can be called before authorization", @@ -23999,7 +31012,7 @@ { "name": "user_ids", "type": "vector\u003cint53\u003e", - "description": "Identifiers of users to be added to the basic group" + "description": "Identifiers of users to be added to the basic group; may be empty to create a basic group without other members" }, { "name": "title", @@ -24025,10 +31038,15 @@ "type": "string", "description": "Title of the new chat; 1-128 characters" }, + { + "name": "is_forum", + "type": "Bool", + "description": "Pass true to create a forum supergroup chat" + }, { "name": "is_channel", "type": "Bool", - "description": "Pass true to create a channel chat" + "description": "Pass true to create a channel chat; ignored if a forum is created" }, { "name": "description", @@ -24048,7 +31066,7 @@ { "name": "for_import", "type": "Bool", - "description": "Pass true to create a supergroup for importing messages using importMessage" + "description": "Pass true to create a supergroup for importing messages using importMessages" } ], "is_synchronous": false, @@ -24066,11 +31084,11 @@ } ], "is_synchronous": false, - "type": 1 + "type": 2 }, { "name": "upgradeBasicGroupChatToSupergroupChat", - "description": "Creates a new supergroup from an existing basic group and sends a corresponding messageChatUpgradeTo and messageChatUpgradeFrom; requires creator privileges. Deactivates the original basic group", + "description": "Creates a new supergroup from an existing basic group and sends a corresponding messageChatUpgradeTo and messageChatUpgradeFrom; requires owner privileges. Deactivates the original basic group", "class": "Chat", "properties": [ { @@ -24116,110 +31134,345 @@ "type": 2 }, { - "name": "getChatFilter", - "description": "Returns information about a chat filter by its identifier", - "class": "ChatFilter", + "name": "getChatFolder", + "description": "Returns information about a chat folder by its identifier", + "class": "ChatFolder", "properties": [ { - "name": "chat_filter_id", + "name": "chat_folder_id", "type": "int32", - "description": "Chat filter identifier" + "description": "Chat folder identifier" } ], "is_synchronous": false, "type": 2 }, { - "name": "createChatFilter", - "description": "Creates new chat filter. Returns information about the created chat filter. There can be up to getOption(\"chat_filter_count_max\") chat filters, but the limit can be increased with Telegram Premium", - "class": "ChatFilterInfo", + "name": "createChatFolder", + "description": "Creates new chat folder. Returns information about the created chat folder. There can be up to getOption(\"chat_folder_count_max\") chat folders, but the limit can be increased with Telegram Premium", + "class": "ChatFolderInfo", "properties": [ { - "name": "filter", - "type": "chatFilter", - "description": "Chat filter" + "name": "folder", + "type": "chatFolder", + "description": "The new chat folder" } ], "is_synchronous": false, "type": 2 }, { - "name": "editChatFilter", - "description": "Edits existing chat filter. Returns information about the edited chat filter", - "class": "ChatFilterInfo", + "name": "editChatFolder", + "description": "Edits existing chat folder. Returns information about the edited chat folder", + "class": "ChatFolderInfo", "properties": [ { - "name": "chat_filter_id", + "name": "chat_folder_id", "type": "int32", - "description": "Chat filter identifier" + "description": "Chat folder identifier" }, { - "name": "filter", - "type": "chatFilter", - "description": "The edited chat filter" + "name": "folder", + "type": "chatFolder", + "description": "The edited chat folder" } ], "is_synchronous": false, "type": 2 }, { - "name": "deleteChatFilter", - "description": "Deletes existing chat filter", + "name": "deleteChatFolder", + "description": "Deletes existing chat folder", "class": "Ok", "properties": [ { - "name": "chat_filter_id", + "name": "chat_folder_id", "type": "int32", - "description": "Chat filter identifier" + "description": "Chat folder identifier" + }, + { + "name": "leave_chat_ids", + "type": "vector\u003cint53\u003e", + "description": "Identifiers of the chats to leave. The chats must be pinned or always included in the folder" } ], "is_synchronous": false, "type": 2 }, { - "name": "reorderChatFilters", - "description": "Changes the order of chat filters", + "name": "getChatFolderChatsToLeave", + "description": "Returns identifiers of pinned or always included chats from a chat folder, which are suggested to be left when the chat folder is deleted", + "class": "Chats", + "properties": [ + { + "name": "chat_folder_id", + "type": "int32", + "description": "Chat folder identifier" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getChatFolderChatCount", + "description": "Returns approximate number of chats in a being created chat folder. Main and archive chat lists must be fully preloaded for this function to work correctly", + "class": "Count", + "properties": [ + { + "name": "folder", + "type": "chatFolder", + "description": "The new chat folder" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "reorderChatFolders", + "description": "Changes the order of chat folders", "class": "Ok", "properties": [ { - "name": "chat_filter_ids", + "name": "chat_folder_ids", "type": "vector\u003cint32\u003e", - "description": "Identifiers of chat filters in the new correct order" + "description": "Identifiers of chat folders in the new correct order" }, { "name": "main_chat_list_position", "type": "int32", - "description": "Position of the main chat list among chat filters, 0-based. Can be non-zero only for Premium users" + "description": "Position of the main chat list among chat folders, 0-based. Can be non-zero only for Premium users" } ], "is_synchronous": false, "type": 2 }, { - "name": "getRecommendedChatFilters", - "description": "Returns recommended chat filters for the current user", - "class": "RecommendedChatFilters", + "name": "toggleChatFolderTags", + "description": "Toggles whether chat folder tags are enabled", + "class": "Ok", + "properties": [ + { + "name": "are_tags_enabled", + "type": "Bool", + "description": "Pass true to enable folder tags; pass false to disable them" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getRecommendedChatFolders", + "description": "Returns recommended chat folders for the current user", + "class": "RecommendedChatFolders", "properties": [], "is_synchronous": false, "type": 2 }, { - "name": "getChatFilterDefaultIconName", - "description": "Returns default icon name for a filter. Can be called synchronously", - "class": "Text", + "name": "getChatFolderDefaultIconName", + "description": "Returns default icon name for a folder. Can be called synchronously", + "class": "ChatFolderIcon", "properties": [ { - "name": "filter", - "type": "chatFilter", - "description": "Chat filter" + "name": "folder", + "type": "chatFolder", + "description": "Chat folder" } ], "is_synchronous": true, "type": 1 }, + { + "name": "getChatsForChatFolderInviteLink", + "description": "Returns identifiers of chats from a chat folder, suitable for adding to a chat folder invite link", + "class": "Chats", + "properties": [ + { + "name": "chat_folder_id", + "type": "int32", + "description": "Chat folder identifier" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "createChatFolderInviteLink", + "description": "Creates a new invite link for a chat folder. A link can be created for a chat folder if it has only pinned and included chats", + "class": "ChatFolderInviteLink", + "properties": [ + { + "name": "chat_folder_id", + "type": "int32", + "description": "Chat folder identifier" + }, + { + "name": "name", + "type": "string", + "description": "Name of the link; 0-32 characters" + }, + { + "name": "chat_ids", + "type": "vector\u003cint53\u003e", + "description": "Identifiers of chats to be accessible by the invite link. Use getChatsForChatFolderInviteLink to get suitable chats. Basic groups will be automatically converted to supergroups before link creation" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getChatFolderInviteLinks", + "description": "Returns invite links created by the current user for a shareable chat folder", + "class": "ChatFolderInviteLinks", + "properties": [ + { + "name": "chat_folder_id", + "type": "int32", + "description": "Chat folder identifier" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "editChatFolderInviteLink", + "description": "Edits an invite link for a chat folder", + "class": "ChatFolderInviteLink", + "properties": [ + { + "name": "chat_folder_id", + "type": "int32", + "description": "Chat folder identifier" + }, + { + "name": "invite_link", + "type": "string", + "description": "Invite link to be edited" + }, + { + "name": "name", + "type": "string", + "description": "New name of the link; 0-32 characters" + }, + { + "name": "chat_ids", + "type": "vector\u003cint53\u003e", + "description": "New identifiers of chats to be accessible by the invite link. Use getChatsForChatFolderInviteLink to get suitable chats. Basic groups will be automatically converted to supergroups before link editing" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "deleteChatFolderInviteLink", + "description": "Deletes an invite link for a chat folder", + "class": "Ok", + "properties": [ + { + "name": "chat_folder_id", + "type": "int32", + "description": "Chat folder identifier" + }, + { + "name": "invite_link", + "type": "string", + "description": "Invite link to be deleted" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "checkChatFolderInviteLink", + "description": "Checks the validity of an invite link for a chat folder and returns information about the corresponding chat folder", + "class": "ChatFolderInviteLinkInfo", + "properties": [ + { + "name": "invite_link", + "type": "string", + "description": "Invite link to be checked" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "addChatFolderByInviteLink", + "description": "Adds a chat folder by an invite link", + "class": "Ok", + "properties": [ + { + "name": "invite_link", + "type": "string", + "description": "Invite link for the chat folder" + }, + { + "name": "chat_ids", + "type": "vector\u003cint53\u003e", + "description": "Identifiers of the chats added to the chat folder. The chats are automatically joined if they aren't joined yet" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getChatFolderNewChats", + "description": "Returns new chats added to a shareable chat folder by its owner. The method must be called at most once in getOption(\"chat_folder_new_chats_update_period\") for the given chat folder", + "class": "Chats", + "properties": [ + { + "name": "chat_folder_id", + "type": "int32", + "description": "Chat folder identifier" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "processChatFolderNewChats", + "description": "Process new chats added to a shareable chat folder by its owner", + "class": "Ok", + "properties": [ + { + "name": "chat_folder_id", + "type": "int32", + "description": "Chat folder identifier" + }, + { + "name": "added_chat_ids", + "type": "vector\u003cint53\u003e", + "description": "Identifiers of the new chats, which are added to the chat folder. The chats are automatically joined if they aren't joined yet" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getArchiveChatListSettings", + "description": "Returns settings for automatic moving of chats to and from the Archive chat lists", + "class": "ArchiveChatListSettings", + "properties": [], + "is_synchronous": false, + "type": 2 + }, + { + "name": "setArchiveChatListSettings", + "description": "Changes settings for automatic moving of chats to and from the Archive chat lists", + "class": "Ok", + "properties": [ + { + "name": "settings", + "type": "archiveChatListSettings", + "description": "New settings" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "setChatTitle", - "description": "Changes the chat title. Supported only for basic groups, supergroups and channels. Requires can_change_info administrator right", + "description": "Changes the chat title. Supported only for basic groups, supergroups and channels. Requires can_change_info member right", "class": "Ok", "properties": [ { @@ -24238,7 +31491,7 @@ }, { "name": "setChatPhoto", - "description": "Changes the photo of a chat. Supported only for basic groups, supergroups and channels. Requires can_change_info administrator right", + "description": "Changes the photo of a chat. Supported only for basic groups, supergroups and channels. Requires can_change_info member right", "class": "Ok", "properties": [ { @@ -24255,6 +31508,54 @@ "is_synchronous": false, "type": 1 }, + { + "name": "setChatAccentColor", + "description": "Changes accent color and background custom emoji of a channel chat. Requires can_change_info administrator right", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "accent_color_id", + "type": "int32", + "description": "Identifier of the accent color to use. The chat must have at least accentColor.min_channel_chat_boost_level boost level to pass the corresponding color" + }, + { + "name": "background_custom_emoji_id", + "type": "int64", + "description": "Identifier of a custom emoji to be shown on the reply header and link preview background; 0 if none. Use chatBoostLevelFeatures.can_set_background_custom_emoji to check whether a custom emoji can be set" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "setChatProfileAccentColor", + "description": "Changes accent color and background custom emoji for profile of a supergroup or channel chat. Requires can_change_info administrator right", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "profile_accent_color_id", + "type": "int32", + "description": "Identifier of the accent color to use for profile; pass -1 if none. The chat must have at least profileAccentColor.min_supergroup_chat_boost_level for supergroups or profileAccentColor.min_channel_chat_boost_level for channels boost level to pass the corresponding color" + }, + { + "name": "profile_background_custom_emoji_id", + "type": "int64", + "description": "Identifier of a custom emoji to be shown on the chat's profile photo background; 0 if none. Use chatBoostLevelFeatures.can_set_profile_background_custom_emoji to check whether a custom emoji can be set" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "setChatMessageAutoDeleteTime", "description": "Changes the message auto-delete or self-destruct (for secret chats) time in a chat. Requires change_info administrator right in basic groups, supergroups and channels Message auto-delete time can't be changed in a chat with the current user (Saved Messages) and the chat 777000 (Telegram).", @@ -24272,7 +31573,26 @@ } ], "is_synchronous": false, - "type": 1 + "type": 2 + }, + { + "name": "setChatEmojiStatus", + "description": "Changes the emoji status of a chat. Use chatBoostLevelFeatures.can_set_emoji_status to check whether an emoji status can be set. Requires can_change_info administrator right", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "emoji_status", + "type": "emojiStatus", + "description": "New emoji status; pass null to remove emoji status" + } + ], + "is_synchronous": false, + "type": 2 }, { "name": "setChatPermissions", @@ -24293,6 +31613,59 @@ "is_synchronous": false, "type": 1 }, + { + "name": "setChatBackground", + "description": "Sets the background in a specific chat. Supported only in private and secret chats with non-deleted users, and in chats with sufficient boost level and can_change_info administrator right", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "background", + "type": "InputBackground", + "description": "The input background to use; pass null to create a new filled or chat theme background" + }, + { + "name": "type", + "type": "BackgroundType", + "description": "Background type; pass null to use default background type for the chosen background; backgroundTypeChatTheme isn't supported for private and secret chats. Use chatBoostLevelFeatures.chat_theme_background_count and chatBoostLevelFeatures.can_set_custom_background to check whether the background type can be set in the boosted chat" + }, + { + "name": "dark_theme_dimming", + "type": "int32", + "description": "Dimming of the background in dark themes, as a percentage; 0-100. Applied only to Wallpaper and Fill types of background" + }, + { + "name": "only_for_self", + "type": "Bool", + "description": "Pass true to set background only for self; pass false to set background for all chat users. Always false for backgrounds set in boosted chats. Background can be set for both users only by Telegram Premium users and if set background isn't of the type inputBackgroundPrevious" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "deleteChatBackground", + "description": "Deletes background in a specific chat", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "restore_previous", + "type": "Bool", + "description": "Pass true to restore previously set background. Can be used only in private and secret chats with non-deleted users if userFullInfo.set_chat_background == true. Supposed to be used from messageChatSetBackground messages with the currently set background that was set for both sides by the other user" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "setChatTheme", "description": "Changes the chat theme. Supported only in private and secret chats", @@ -24325,12 +31698,12 @@ { "name": "message_thread_id", "type": "int53", - "description": "If not 0, a message thread identifier in which the draft was changed" + "description": "If not 0, the message thread identifier in which the draft was changed" }, { "name": "draft_message", "type": "draftMessage", - "description": "New draft message; pass null to remove the draft" + "description": "New draft message; pass null to remove the draft. All files in draft message content must be of the type inputFileLocal. Media thumbnails and captions are ignored" } ], "is_synchronous": false, @@ -24374,6 +31747,44 @@ "is_synchronous": false, "type": 2 }, + { + "name": "toggleChatViewAsTopics", + "description": "Changes the view_as_topics setting of a forum chat or Saved Messages", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "view_as_topics", + "type": "Bool", + "description": "New value of view_as_topics" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "toggleChatIsTranslatable", + "description": "Changes the translatable state of a chat", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "is_translatable", + "type": "Bool", + "description": "New value of is_translatable" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "toggleChatIsMarkedAsUnread", "description": "Changes the marked as unread state of a chat", @@ -24414,7 +31825,7 @@ }, { "name": "setChatAvailableReactions", - "description": "Changes reactions, available in a chat. Available for basic groups, supergroups, and channels. Requires can_change_info administrator right", + "description": "Changes reactions, available in a chat. Available for basic groups, supergroups, and channels. Requires can_change_info member right", "class": "Ok", "properties": [ { @@ -24425,7 +31836,7 @@ { "name": "available_reactions", "type": "ChatAvailableReactions", - "description": "Reactions available in the chat. All emoji reactions must be active" + "description": "Reactions available in the chat. All explicitly specified emoji reactions must be active. In channel chats up to the chat's boost level custom emoji reactions can be explicitly specified" } ], "is_synchronous": false, @@ -24452,7 +31863,7 @@ }, { "name": "setChatDescription", - "description": "Changes information about a chat. Available for basic groups, supergroups, and channels. Requires can_change_info administrator right", + "description": "Changes information about a chat. Available for basic groups, supergroups, and channels. Requires can_change_info member right", "class": "Ok", "properties": [ { @@ -24477,7 +31888,7 @@ { "name": "chat_id", "type": "int53", - "description": "Identifier of the channel chat. Pass 0 to remove a link from the supergroup passed in the second argument to a linked channel chat (requires can_pin_messages rights in the supergroup)" + "description": "Identifier of the channel chat. Pass 0 to remove a link from the supergroup passed in the second argument to a linked channel chat (requires can_pin_messages member right in the supergroup)" }, { "name": "discussion_chat_id", @@ -24509,7 +31920,7 @@ }, { "name": "setChatSlowModeDelay", - "description": "Changes the slow mode delay of a chat. Available only for supergroups; requires can_restrict_members rights", + "description": "Changes the slow mode delay of a chat. Available only for supergroups; requires can_restrict_members right", "class": "Ok", "properties": [ { @@ -24528,7 +31939,7 @@ }, { "name": "pinChatMessage", - "description": "Pins a message in a chat; requires can_pin_messages rights or can_edit_messages rights in the channel", + "description": "Pins a message in a chat; requires can_pin_messages member right if the chat is a basic group or supergroup, or can_edit_messages administrator right if the chat is a channel", "class": "Ok", "properties": [ { @@ -24557,7 +31968,7 @@ }, { "name": "unpinChatMessage", - "description": "Removes a pinned message from a chat; requires can_pin_messages rights in the group or can_edit_messages rights in the channel", + "description": "Removes a pinned message from a chat; requires can_pin_messages member right if the chat is a basic group or supergroup, or can_edit_messages administrator right if the chat is a channel", "class": "Ok", "properties": [ { @@ -24576,7 +31987,7 @@ }, { "name": "unpinAllChatMessages", - "description": "Removes all pinned messages from a chat; requires can_pin_messages rights in the group or can_edit_messages rights in the channel", + "description": "Removes all pinned messages from a chat; requires can_pin_messages member right if the chat is a basic group or supergroup, or can_edit_messages administrator right if the chat is a channel", "class": "Ok", "properties": [ { @@ -24590,7 +32001,7 @@ }, { "name": "unpinAllMessageThreadMessages", - "description": "Removes all pinned messages from a forum topic; requires can_pin_messages rights in the supergroup", + "description": "Removes all pinned messages from a forum topic; requires can_pin_messages member right in the supergroup", "class": "Ok", "properties": [ { @@ -24637,7 +32048,7 @@ }, { "name": "addChatMember", - "description": "Adds a new member to a chat. Members can't be added to private or secret chats", + "description": "Adds a new member to a chat; requires can_invite_users member right. Members can't be added to private or secret chats", "class": "Ok", "properties": [ { @@ -24661,7 +32072,7 @@ }, { "name": "addChatMembers", - "description": "Adds multiple new members to a chat. Currently, this method is only available for supergroups and channels. This method can't be used to join a chat. Members can't be added to a channel if it has more than 200 members", + "description": "Adds multiple new members to a chat; requires can_invite_users member right. Currently, this method is only available for supergroups and channels. This method can't be used to join a chat. Members can't be added to a channel if it has more than 200 members", "class": "Ok", "properties": [ { @@ -24680,7 +32091,7 @@ }, { "name": "setChatMemberStatus", - "description": "Changes the status of a chat member, needs appropriate privileges. This function is currently not suitable for transferring chat ownership; use transferChatOwnership instead. Use addChatMember or banChatMember if some additional parameters needs to be passed", + "description": "Changes the status of a chat member; requires can_invite_users member right to add a chat member, can_promote_members administrator right to change administrator rights of the member, and can_restrict_members administrator right to change restrictions of a user. This function is currently not suitable for transferring chat ownership; use transferChatOwnership instead. Use addChatMember or banChatMember if some additional parameters needs to be passed", "class": "Ok", "properties": [ { @@ -24704,7 +32115,7 @@ }, { "name": "banChatMember", - "description": "Bans a member in a chat. Members can't be banned in private or secret chats. In supergroups and channels, the user will not be able to return to the group on their own using invite links, etc., unless unbanned first", + "description": "Bans a member in a chat; requires can_restrict_members administrator right. Members can't be banned in private or secret chats. In supergroups and channels, the user will not be able to return to the group on their own using invite links, etc., unless unbanned first", "class": "Ok", "properties": [ { @@ -24741,7 +32152,7 @@ }, { "name": "transferChatOwnership", - "description": "Changes the owner of a chat. The current user must be a current owner of the chat. Use the method canTransferOwnership to check whether the ownership can be transferred from the current session. Available only for supergroups and channel chats", + "description": "Changes the owner of a chat; requires owner privileges in the chat. Use the method canTransferOwnership to check whether the ownership can be transferred from the current session. Available only for supergroups and channel chats", "class": "Ok", "properties": [ { @@ -24784,7 +32195,7 @@ }, { "name": "searchChatMembers", - "description": "Searches for a specified query in the first name, last name and usernames of the members of a specified chat. Requires administrator rights in channels", + "description": "Searches for a specified query in the first name, last name and usernames of the members of a specified chat. Requires administrator rights if the chat is a channel", "class": "ChatMembers", "properties": [ { @@ -24891,7 +32302,7 @@ }, { "name": "getChatNotificationSettingsExceptions", - "description": "Returns list of chats with non-default notification settings", + "description": "Returns list of chats with non-default notification settings for new messages", "class": "Chats", "properties": [ { @@ -24992,9 +32403,702 @@ "is_synchronous": false, "type": 2 }, + { + "name": "readChatList", + "description": "Traverse all chats in a chat list and marks all messages in the chats as read", + "class": "Ok", + "properties": [ + { + "name": "chat_list", + "type": "ChatList", + "description": "Chat list in which to mark all chats as read" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getStory", + "description": "Returns a story", + "class": "Story", + "properties": [ + { + "name": "story_sender_chat_id", + "type": "int53", + "description": "Identifier of the chat that posted the story" + }, + { + "name": "story_id", + "type": "int32", + "description": "Story identifier" + }, + { + "name": "only_local", + "type": "Bool", + "description": "Pass true to get only locally available information without sending network requests" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getChatsToSendStories", + "description": "Returns supergroup and channel chats in which the current user has the right to post stories. The chats must be rechecked with canSendStory before actually trying to post a story there", + "class": "Chats", + "properties": [], + "is_synchronous": false, + "type": 2 + }, + { + "name": "canSendStory", + "description": "Checks whether the current user can send a story on behalf of a chat; requires can_post_stories right for supergroup and channel chats", + "class": "CanSendStoryResult", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "sendStory", + "description": "Sends a new story to a chat; requires can_post_stories right for supergroup and channel chats. Returns a temporary story", + "class": "Story", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat that will post the story" + }, + { + "name": "content", + "type": "InputStoryContent", + "description": "Content of the story" + }, + { + "name": "areas", + "type": "inputStoryAreas", + "description": "Clickable rectangle areas to be shown on the story media; pass null if none" + }, + { + "name": "caption", + "type": "formattedText", + "description": "Story caption; pass null to use an empty caption; 0-getOption(\"story_caption_length_max\") characters; can have entities only if getOption(\"can_use_text_entities_in_story_caption\")" + }, + { + "name": "privacy_settings", + "type": "StoryPrivacySettings", + "description": "The privacy settings for the story; ignored for stories sent to supergroup and channel chats" + }, + { + "name": "active_period", + "type": "int32", + "description": "Period after which the story is moved to archive, in seconds; must be one of 6 * 3600, 12 * 3600, 86400, or 2 * 86400 for Telegram Premium users, and 86400 otherwise" + }, + { + "name": "from_story_full_id", + "type": "storyFullId", + "description": "Full identifier of the original story, which content was used to create the story" + }, + { + "name": "is_pinned", + "type": "Bool", + "description": "Pass true to keep the story accessible after expiration" + }, + { + "name": "protect_content", + "type": "Bool", + "description": "Pass true if the content of the story must be protected from forwarding and screenshotting" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "editStory", + "description": "Changes content and caption of a story. Can be called only if story.can_be_edited == true", + "class": "Ok", + "properties": [ + { + "name": "story_sender_chat_id", + "type": "int53", + "description": "Identifier of the chat that posted the story" + }, + { + "name": "story_id", + "type": "int32", + "description": "Identifier of the story to edit" + }, + { + "name": "content", + "type": "InputStoryContent", + "description": "New content of the story; pass null to keep the current content" + }, + { + "name": "areas", + "type": "inputStoryAreas", + "description": "New clickable rectangle areas to be shown on the story media; pass null to keep the current areas. Areas can't be edited if story content isn't changed" + }, + { + "name": "caption", + "type": "formattedText", + "description": "New story caption; pass null to keep the current caption" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "setStoryPrivacySettings", + "description": "Changes privacy settings of a story. The method can be called only for stories posted on behalf of the current user and if story.can_be_edited == true", + "class": "Ok", + "properties": [ + { + "name": "story_id", + "type": "int32", + "description": "Identifier of the story" + }, + { + "name": "privacy_settings", + "type": "StoryPrivacySettings", + "description": "The new privacy settigs for the story" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "toggleStoryIsPinned", + "description": "Toggles whether a story is accessible after expiration. Can be called only if story.can_toggle_is_pinned == true", + "class": "Ok", + "properties": [ + { + "name": "story_sender_chat_id", + "type": "int53", + "description": "Identifier of the chat that posted the story" + }, + { + "name": "story_id", + "type": "int32", + "description": "Identifier of the story" + }, + { + "name": "is_pinned", + "type": "Bool", + "description": "Pass true to make the story accessible after expiration; pass false to make it private" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "deleteStory", + "description": "Deletes a previously sent story. Can be called only if story.can_be_deleted == true", + "class": "Ok", + "properties": [ + { + "name": "story_sender_chat_id", + "type": "int53", + "description": "Identifier of the chat that posted the story" + }, + { + "name": "story_id", + "type": "int32", + "description": "Identifier of the story to delete" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getStoryNotificationSettingsExceptions", + "description": "Returns list of chats with non-default notification settings for stories", + "class": "Chats", + "properties": [], + "is_synchronous": false, + "type": 2 + }, + { + "name": "loadActiveStories", + "description": "Loads more active stories from a story list. The loaded stories will be sent through updates. Active stories are sorted by the pair (active_stories.order, active_stories.story_sender_chat_id) in descending order. Returns a 404 error if all active stories have been loaded", + "class": "Ok", + "properties": [ + { + "name": "story_list", + "type": "StoryList", + "description": "The story list in which to load active stories" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "setChatActiveStoriesList", + "description": "Changes story list in which stories from the chat are shown", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat that posted stories" + }, + { + "name": "story_list", + "type": "StoryList", + "description": "New list for active stories posted by the chat" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getChatActiveStories", + "description": "Returns the list of active stories posted by the given chat", + "class": "ChatActiveStories", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getChatPinnedStories", + "description": "Returns the list of pinned stories posted by the given chat. The stories are returned in a reverse chronological order (i.e., in order of decreasing story_id). For optimal performance, the number of returned stories is chosen by TDLib", + "class": "Stories", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "from_story_id", + "type": "int32", + "description": "Identifier of the story starting from which stories must be returned; use 0 to get results from the last story" + }, + { + "name": "limit", + "type": "int32", + "description": "The maximum number of stories to be returned For optimal performance, the number of returned stories is chosen by TDLib and can be smaller than the specified limit" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getChatArchivedStories", + "description": "Returns the list of all stories posted by the given chat; requires can_edit_stories right in the chat. The stories are returned in a reverse chronological order (i.e., in order of decreasing story_id). For optimal performance, the number of returned stories is chosen by TDLib", + "class": "Stories", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "from_story_id", + "type": "int32", + "description": "Identifier of the story starting from which stories must be returned; use 0 to get results from the last story" + }, + { + "name": "limit", + "type": "int32", + "description": "The maximum number of stories to be returned For optimal performance, the number of returned stories is chosen by TDLib and can be smaller than the specified limit" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "openStory", + "description": "Informs TDLib that a story is opened and is being viewed by the user", + "class": "Ok", + "properties": [ + { + "name": "story_sender_chat_id", + "type": "int53", + "description": "The identifier of the sender of the opened story" + }, + { + "name": "story_id", + "type": "int32", + "description": "The identifier of the story" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "closeStory", + "description": "Informs TDLib that a story is closed by the user", + "class": "Ok", + "properties": [ + { + "name": "story_sender_chat_id", + "type": "int53", + "description": "The identifier of the sender of the story to close" + }, + { + "name": "story_id", + "type": "int32", + "description": "The identifier of the story" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getStoryAvailableReactions", + "description": "Returns reactions, which can be chosen for a story", + "class": "AvailableReactions", + "properties": [ + { + "name": "row_size", + "type": "int32", + "description": "Number of reaction per row, 5-25" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "setStoryReaction", + "description": "Changes chosen reaction on a story that has already been sent", + "class": "Ok", + "properties": [ + { + "name": "story_sender_chat_id", + "type": "int53", + "description": "The identifier of the sender of the story" + }, + { + "name": "story_id", + "type": "int32", + "description": "The identifier of the story" + }, + { + "name": "reaction_type", + "type": "ReactionType", + "description": "Type of the reaction to set; pass null to remove the reaction. `reactionTypeCustomEmoji` reactions can be used only by Telegram Premium users" + }, + { + "name": "update_recent_reactions", + "type": "Bool", + "description": "Pass true if the reaction needs to be added to recent reactions" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getStoryInteractions", + "description": "Returns interactions with a story. The method can be called only for stories posted on behalf of the current user", + "class": "StoryInteractions", + "properties": [ + { + "name": "story_id", + "type": "int32", + "description": "Story identifier" + }, + { + "name": "query", + "type": "string", + "description": "Query to search for in names, usernames and titles; may be empty to get all relevant interactions" + }, + { + "name": "only_contacts", + "type": "Bool", + "description": "Pass true to get only interactions by contacts; pass false to get all relevant interactions" + }, + { + "name": "prefer_forwards", + "type": "Bool", + "description": "Pass true to get forwards and reposts first, then reactions, then other views; pass false to get interactions sorted just by interaction date" + }, + { + "name": "prefer_with_reaction", + "type": "Bool", + "description": "Pass true to get interactions with reaction first; pass false to get interactions sorted just by interaction date. Ignored if prefer_forwards == true" + }, + { + "name": "offset", + "type": "string", + "description": "Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results" + }, + { + "name": "limit", + "type": "int32", + "description": "The maximum number of story interactions to return" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getChatStoryInteractions", + "description": "Returns interactions with a story posted in a chat. Can be used only if story is posted on behalf of a chat and the user is an administrator in the chat", + "class": "StoryInteractions", + "properties": [ + { + "name": "story_sender_chat_id", + "type": "int53", + "description": "The identifier of the sender of the story" + }, + { + "name": "story_id", + "type": "int32", + "description": "Story identifier" + }, + { + "name": "reaction_type", + "type": "ReactionType", + "description": "Pass the default heart reaction or a suggested reaction type to receive only interactions with the specified reaction type; pass null to receive all interactions" + }, + { + "name": "prefer_forwards", + "type": "Bool", + "description": "Pass true to get forwards and reposts first, then reactions, then other views; pass false to get interactions sorted just by interaction date" + }, + { + "name": "offset", + "type": "string", + "description": "Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results" + }, + { + "name": "limit", + "type": "int32", + "description": "The maximum number of story interactions to return" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "reportStory", + "description": "Reports a story to the Telegram moderators", + "class": "Ok", + "properties": [ + { + "name": "story_sender_chat_id", + "type": "int53", + "description": "The identifier of the sender of the story to report" + }, + { + "name": "story_id", + "type": "int32", + "description": "The identifier of the story to report" + }, + { + "name": "reason", + "type": "ReportReason", + "description": "The reason for reporting the story" + }, + { + "name": "text", + "type": "string", + "description": "Additional report details; 0-1024 characters" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "activateStoryStealthMode", + "description": "Activates stealth mode for stories, which hides all views of stories from the current user in the last \"story_stealth_mode_past_period\" seconds and for the next \"story_stealth_mode_future_period\" seconds; for Telegram Premium users only", + "class": "Ok", + "properties": [], + "is_synchronous": false, + "type": 1 + }, + { + "name": "getStoryPublicForwards", + "description": "Returns forwards of a story as a message to public chats and reposts by public channels. Can be used only if the story is posted on behalf of the current user or story.can_get_statistics == true. For optimal performance, the number of returned messages and stories is chosen by TDLib", + "class": "PublicForwards", + "properties": [ + { + "name": "story_sender_chat_id", + "type": "int53", + "description": "The identifier of the sender of the story" + }, + { + "name": "story_id", + "type": "int32", + "description": "The identifier of the story" + }, + { + "name": "offset", + "type": "string", + "description": "Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results" + }, + { + "name": "limit", + "type": "int32", + "description": "The maximum number of messages and stories to be returned; must be positive and can't be greater than 100. For optimal performance, the number of returned objects is chosen by TDLib and can be smaller than the specified limit" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getChatBoostLevelFeatures", + "description": "Returns list of features available on the specific chat boost level; this is an offline request", + "class": "ChatBoostLevelFeatures", + "properties": [ + { + "name": "is_channel", + "type": "Bool", + "description": "Pass true to get the list of features for channels; pass false to get the list of features for supergroups" + }, + { + "name": "level", + "type": "int32", + "description": "Chat boost level" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getChatBoostFeatures", + "description": "Returns list of features available on the first 10 chat boost levels; this is an offline request", + "class": "ChatBoostFeatures", + "properties": [ + { + "name": "is_channel", + "type": "Bool", + "description": "Pass true to get the list of features for channels; pass false to get the list of features for supergroups" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getAvailableChatBoostSlots", + "description": "Returns the list of available chat boost slots for the current user", + "class": "ChatBoostSlots", + "properties": [], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getChatBoostStatus", + "description": "Returns the current boost status for a supergroup or a channel chat", + "class": "ChatBoostStatus", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "boostChat", + "description": "Boosts a chat and returns the list of available chat boost slots for the current user after the boost", + "class": "ChatBoostSlots", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat" + }, + { + "name": "slot_ids", + "type": "vector\u003cint32\u003e", + "description": "Identifiers of boost slots of the current user from which to apply boosts to the chat" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getChatBoostLink", + "description": "Returns an HTTPS link to boost the specified supergroup or channel chat", + "class": "ChatBoostLink", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat" + } + ], + "is_synchronous": false, + "type": 1 + }, + { + "name": "getChatBoostLinkInfo", + "description": "Returns information about a link to boost a chat. Can be called for any internal link of the type internalLinkTypeChatBoost", + "class": "ChatBoostLinkInfo", + "properties": [ + { + "name": "url", + "type": "string", + "description": "The link to boost a chat" + } + ], + "is_synchronous": false, + "type": 1 + }, + { + "name": "getChatBoosts", + "description": "Returns list of boosts applied to a chat; requires administrator rights in the chat", + "class": "FoundChatBoosts", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat" + }, + { + "name": "only_gift_codes", + "type": "Bool", + "description": "Pass true to receive only boosts received from gift codes and giveaways created by the chat" + }, + { + "name": "offset", + "type": "string", + "description": "Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results" + }, + { + "name": "limit", + "type": "int32", + "description": "The maximum number of boosts to be returned; up to 100. For optimal performance, the number of returned boosts can be smaller than the specified limit" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getUserChatBoosts", + "description": "Returns list of boosts applied to a chat by a given user; requires administrator rights in the chat; for bots only", + "class": "FoundChatBoosts", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the chat" + }, + { + "name": "user_id", + "type": "int53", + "description": "Identifier of the user" + } + ], + "is_synchronous": false, + "type": 3 + }, { "name": "getAttachmentMenuBot", - "description": "Returns information about a bot that can be added to attachment menu", + "description": "Returns information about a bot that can be added to attachment or side menu", "class": "AttachmentMenuBot", "properties": [ { @@ -25008,7 +33112,7 @@ }, { "name": "toggleBotIsAddedToAttachmentMenu", - "description": "Adds or removes a bot to attachment menu. Bot can be added to attachment menu, only if userTypeBot.can_be_added_to_attachment_menu == true", + "description": "Adds or removes a bot to attachment and side menu. Bot can be added to the menu, only if userTypeBot.can_be_added_to_attachment_menu == true", "class": "Ok", "properties": [ { @@ -25032,7 +33136,7 @@ }, { "name": "getThemedEmojiStatuses", - "description": "Returns up to 8 emoji statuses, which must be shown right after the default Premium Badge in the emoji status list", + "description": "Returns up to 8 emoji statuses, which must be shown right after the default Premium Badge in the emoji status list for self status", "class": "EmojiStatuses", "properties": [], "is_synchronous": false, @@ -25040,7 +33144,7 @@ }, { "name": "getRecentEmojiStatuses", - "description": "Returns recent emoji statuses", + "description": "Returns recent emoji statuses for self status", "class": "EmojiStatuses", "properties": [], "is_synchronous": false, @@ -25048,7 +33152,7 @@ }, { "name": "getDefaultEmojiStatuses", - "description": "Returns default emoji statuses", + "description": "Returns default emoji statuses for self status", "class": "EmojiStatuses", "properties": [], "is_synchronous": false, @@ -25056,12 +33160,36 @@ }, { "name": "clearRecentEmojiStatuses", - "description": "Clears the list of recently used emoji statuses", + "description": "Clears the list of recently used emoji statuses for self status", "class": "Ok", "properties": [], "is_synchronous": false, "type": 2 }, + { + "name": "getThemedChatEmojiStatuses", + "description": "Returns up to 8 emoji statuses, which must be shown in the emoji status list for chats", + "class": "EmojiStatuses", + "properties": [], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getDefaultChatEmojiStatuses", + "description": "Returns default emoji statuses for chats", + "class": "EmojiStatuses", + "properties": [], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getDisallowedChatEmojiStatuses", + "description": "Returns the list of emoji statuses, which can't be used as chat emoji status, even they are from a sticker set with is_allowed_as_chat_emoji_status == true", + "class": "EmojiStatuses", + "properties": [], + "is_synchronous": false, + "type": 2 + }, { "name": "downloadFile", "description": "Downloads a file from the cloud. Download progress and completion of the download will be notified through updateFile updates", @@ -25155,7 +33283,7 @@ }, { "name": "preliminaryUploadFile", - "description": "Preliminary uploads a file to the cloud before sending it in a message, which can be useful for uploading of being recorded voice and video notes. Updates updateFile will be used to notify about upload progress and successful completion of the upload. The file will not have a persistent remote identifier until it will be sent in a message", + "description": "Preliminary uploads a file to the cloud before sending it in a message, which can be useful for uploading of being recorded voice and video notes. Updates updateFile will be used to notify about upload progress and successful completion of the upload. The file will not have a persistent remote identifier until it is sent in a message", "class": "File", "properties": [ { @@ -25457,7 +33585,7 @@ { "name": "chat_id", "type": "int53", - "description": "Identifier of a chat to which the messages will be imported. It must be an identifier of a private chat with a mutual contact or an identifier of a supergroup chat with can_change_info administrator right" + "description": "Identifier of a chat to which the messages will be imported. It must be an identifier of a private chat with a mutual contact or an identifier of a supergroup chat with can_change_info member right" } ], "is_synchronous": false, @@ -25471,7 +33599,7 @@ { "name": "chat_id", "type": "int53", - "description": "Identifier of a chat to which the messages will be imported. It must be an identifier of a private chat with a mutual contact or an identifier of a supergroup chat with can_change_info administrator right" + "description": "Identifier of a chat to which the messages will be imported. It must be an identifier of a private chat with a mutual contact or an identifier of a supergroup chat with can_change_info member right" }, { "name": "message_file", @@ -26040,7 +34168,7 @@ }, { "name": "createVideoChat", - "description": "Creates a video chat (a group call bound to a chat). Available only for basic groups, supergroups and channels; requires can_manage_video_chats rights", + "description": "Creates a video chat (a group call bound to a chat). Available only for basic groups, supergroups and channels; requires can_manage_video_chats administrator right", "class": "GroupCallId", "properties": [ { @@ -26061,7 +34189,7 @@ { "name": "is_rtmp_stream", "type": "Bool", - "description": "Pass true to create an RTMP stream instead of an ordinary video chat; requires creator privileges" + "description": "Pass true to create an RTMP stream instead of an ordinary video chat; requires owner privileges" } ], "is_synchronous": false, @@ -26069,7 +34197,7 @@ }, { "name": "getVideoChatRtmpUrl", - "description": "Returns RTMP URL for streaming to the chat; requires creator privileges", + "description": "Returns RTMP URL for streaming to the chat; requires owner privileges", "class": "RtmpUrl", "properties": [ { @@ -26083,7 +34211,7 @@ }, { "name": "replaceVideoChatRtmpUrl", - "description": "Replaces the current RTMP URL for streaming to the chat; requires creator privileges", + "description": "Replaces the current RTMP URL for streaming to the chat; requires owner privileges", "class": "RtmpUrl", "properties": [ { @@ -26125,7 +34253,7 @@ }, { "name": "toggleGroupCallEnabledStartNotification", - "description": "Toggles whether the current user will receive a notification when the group call will start; scheduled group calls only", + "description": "Toggles whether the current user will receive a notification when the group call starts; scheduled group calls only", "class": "Ok", "properties": [ { @@ -26283,7 +34411,7 @@ }, { "name": "inviteGroupCallParticipants", - "description": "Invites users to an active group call. Sends a service message of type messageInviteToGroupCall for video chats", + "description": "Invites users to an active group call. Sends a service message of type messageInviteVideoChatParticipants for video chats", "class": "Ok", "properties": [ { @@ -26456,7 +34584,7 @@ { "name": "is_muted", "type": "Bool", - "description": "Pass true to mute the user; pass false to unmute the them" + "description": "Pass true to mute the user; pass false to unmute them" } ], "is_synchronous": false, @@ -26606,8 +34734,8 @@ "type": 2 }, { - "name": "toggleMessageSenderIsBlocked", - "description": "Changes the block state of a message sender. Currently, only users and supergroup chats can be blocked", + "name": "setMessageSenderBlockList", + "description": "Changes the block list of a message sender. Currently, only users and supergroup chats can be blocked", "class": "Ok", "properties": [ { @@ -26616,9 +34744,9 @@ "description": "Identifier of a message sender to block/unblock" }, { - "name": "is_blocked", - "type": "Bool", - "description": "New value of is_blocked" + "name": "block_list", + "type": "BlockList", + "description": "New block list for the message sender; pass null to unblock the message sender" } ], "is_synchronous": false, @@ -26658,6 +34786,11 @@ "description": "Returns users and chats that were blocked by the current user", "class": "MessageSenders", "properties": [ + { + "name": "block_list", + "type": "BlockList", + "description": "Block list from which to return users" + }, { "name": "offset", "type": "int32", @@ -26707,7 +34840,7 @@ }, { "name": "getContacts", - "description": "Returns all user contacts", + "description": "Returns all contacts of the user", "class": "Users", "properties": [], "is_synchronous": false, @@ -26776,6 +34909,28 @@ "is_synchronous": false, "type": 2 }, + { + "name": "setCloseFriends", + "description": "Changes the list of close friends of the current user", + "class": "Ok", + "properties": [ + { + "name": "user_ids", + "type": "vector\u003cint53\u003e", + "description": "User identifiers of close friends; the users must be contacts of the current user" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getCloseFriends", + "description": "Returns all close friends of the current user", + "class": "Users", + "properties": [], + "is_synchronous": false, + "type": 2 + }, { "name": "setUserPersonalProfilePhoto", "description": "Changes a personal profile photo of a contact user", @@ -26868,7 +35023,7 @@ }, { "name": "getStickers", - "description": "Returns stickers from the installed sticker sets that correspond to a given emoji or can be found by sticker-specific keywords. If the query is non-empty, then favorite, recently used or trending stickers may also be returned", + "description": "Returns stickers from the installed sticker sets that correspond to any of the given emoji or can be found by sticker-specific keywords. If the query is non-empty, then favorite, recently used or trending stickers may also be returned", "class": "Stickers", "properties": [ { @@ -26879,7 +35034,7 @@ { "name": "query", "type": "string", - "description": "Search query; an emoji or a keyword prefix. If empty, returns all known installed stickers" + "description": "Search query; a space-separated list of emoji or a keyword prefix. If empty, returns all known installed stickers" }, { "name": "limit", @@ -26895,15 +35050,49 @@ "is_synchronous": false, "type": 2 }, + { + "name": "getAllStickerEmojis", + "description": "Returns unique emoji that correspond to stickers to be found by the getStickers(sticker_type, query, 1000000, chat_id)", + "class": "Emojis", + "properties": [ + { + "name": "sticker_type", + "type": "StickerType", + "description": "Type of the stickers to search for" + }, + { + "name": "query", + "type": "string", + "description": "Search query" + }, + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier for which to find stickers" + }, + { + "name": "return_only_main_emoji", + "type": "Bool", + "description": "Pass true if only main emoji for each found sticker must be included in the result" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "searchStickers", - "description": "Searches for stickers from public sticker sets that correspond to a given emoji", + "description": "Searches for stickers from public sticker sets that correspond to any of the given emoji", "class": "Stickers", "properties": [ { - "name": "emoji", + "name": "sticker_type", + "type": "StickerType", + "description": "Type of the stickers to return" + }, + { + "name": "emojis", "type": "string", - "description": "String representation of emoji; must be non-empty" + "description": "Space-separated list of emoji to search for; must be non-empty" }, { "name": "limit", @@ -26955,7 +35144,7 @@ { "name": "offset_sticker_set_id", "type": "int64", - "description": "Identifier of the sticker set from which to return the result" + "description": "Identifier of the sticker set from which to return the result; use 0 to get results from the beginning" }, { "name": "limit", @@ -27058,9 +35247,14 @@ }, { "name": "searchStickerSets", - "description": "Searches for ordinary sticker sets by looking for specified query in their title and name. Excludes installed sticker sets from the results", + "description": "Searches for sticker sets by looking for specified query in their title and name. Excludes installed sticker sets from the results", "class": "StickerSets", "properties": [ + { + "name": "sticker_type", + "type": "StickerType", + "description": "Type of the sticker sets to return" + }, { "name": "query", "type": "string", @@ -27143,7 +35337,7 @@ }, { "name": "addRecentSticker", - "description": "Manually adds a new sticker to the list of recently used stickers. The new sticker is added to the top of the list. If the sticker was already in the list, it is removed from the list first. Only stickers belonging to a sticker set can be added to this list. Emoji stickers can't be added to recent stickers", + "description": "Manually adds a new sticker to the list of recently used stickers. The new sticker is added to the top of the list. If the sticker was already in the list, it is removed from the list first. Only stickers belonging to a sticker set or in WEBP or WEBM format can be added to this list. Emoji stickers can't be added to recent stickers", "class": "Stickers", "properties": [ { @@ -27203,7 +35397,7 @@ }, { "name": "addFavoriteSticker", - "description": "Adds a new sticker to the list of favorite stickers. The new sticker is added to the top of the list. If the sticker was already in the list, it is removed from the list first. Only stickers belonging to a sticker set can be added to this list. Emoji stickers can't be added to favorite stickers", + "description": "Adds a new sticker to the list of favorite stickers. The new sticker is added to the top of the list. If the sticker was already in the list, it is removed from the list first. Only stickers belonging to a sticker set or in WEBP or WEBM format can be added to this list. Emoji stickers can't be added to favorite stickers", "class": "Ok", "properties": [ { @@ -27245,7 +35439,26 @@ }, { "name": "searchEmojis", - "description": "Searches for emojis by keywords. Supported only if the file database is enabled", + "description": "Searches for emojis by keywords. Supported only if the file database is enabled. Order of results is unspecified", + "class": "EmojiKeywords", + "properties": [ + { + "name": "text", + "type": "string", + "description": "Text to search for" + }, + { + "name": "input_language_codes", + "type": "vector\u003cstring\u003e", + "description": "List of possible IETF language tags of the user's input language; may be empty if unknown" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getKeywordEmojis", + "description": "Return emojis matching the keyword. Supported only if the file database is enabled. Order of results is unspecified", "class": "Emojis", "properties": [ { @@ -27253,11 +35466,6 @@ "type": "string", "description": "Text to search for" }, - { - "name": "exact_match", - "type": "Bool", - "description": "Pass true if only emojis, which exactly match the text, needs to be returned" - }, { "name": "input_language_codes", "type": "vector\u003cstring\u003e", @@ -27267,6 +35475,20 @@ "is_synchronous": false, "type": 2 }, + { + "name": "getEmojiCategories", + "description": "Returns available emojis categories", + "class": "EmojiCategories", + "properties": [ + { + "name": "type", + "type": "EmojiCategoryType", + "description": "Type of emoji categories to return; pass null to get default emoji categories" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "getAnimatedEmoji", "description": "Returns an animated emoji corresponding to a given emoji. Returns a 404 error if the emoji has no animated emoji", @@ -27309,6 +35531,30 @@ "is_synchronous": false, "type": 1 }, + { + "name": "getDefaultChatPhotoCustomEmojiStickers", + "description": "Returns default list of custom emoji stickers for placing on a chat photo", + "class": "Stickers", + "properties": [], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getDefaultProfilePhotoCustomEmojiStickers", + "description": "Returns default list of custom emoji stickers for placing on a profile photo", + "class": "Stickers", + "properties": [], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getDefaultBackgroundCustomEmojiStickers", + "description": "Returns default list of custom emoji stickers for reply background", + "class": "Stickers", + "properties": [], + "is_synchronous": false, + "type": 2 + }, { "name": "getSavedAnimations", "description": "Returns saved animations", @@ -27388,13 +35634,18 @@ }, { "name": "getWebPagePreview", - "description": "Returns a web page preview by the text of the message. Do not call this function too often. Returns a 404 error if the web page has no preview", + "description": "Returns a link preview by the text of a message. Do not call this function too often. Returns a 404 error if the text has no link preview", "class": "WebPage", "properties": [ { "name": "text", "type": "formattedText", "description": "Message text with formatting" + }, + { + "name": "link_preview_options", + "type": "linkPreviewOptions", + "description": "Options to be used for generation of the link preview; pass null to use default link preview options" } ], "is_synchronous": false, @@ -27452,6 +35703,44 @@ "is_synchronous": false, "type": 2 }, + { + "name": "setAccentColor", + "description": "Changes accent color and background custom emoji for the current user; for Telegram Premium users only", + "class": "Ok", + "properties": [ + { + "name": "accent_color_id", + "type": "int32", + "description": "Identifier of the accent color to use" + }, + { + "name": "background_custom_emoji_id", + "type": "int64", + "description": "Identifier of a custom emoji to be shown on the reply header and link preview background; 0 if none" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "setProfileAccentColor", + "description": "Changes accent color and background custom emoji for profile of the current user; for Telegram Premium users only", + "class": "Ok", + "properties": [ + { + "name": "profile_accent_color_id", + "type": "int32", + "description": "Identifier of the accent color to use for profile; pass -1 if none" + }, + { + "name": "profile_background_custom_emoji_id", + "type": "int64", + "description": "Identifier of a custom emoji to be shown on the user's profile photo background; 0 if none" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "setName", "description": "Changes the first and last name of the current user", @@ -27532,6 +35821,34 @@ "is_synchronous": false, "type": 2 }, + { + "name": "setBirthdate", + "description": "Changes the birthdate of the current user", + "class": "Ok", + "properties": [ + { + "name": "birthdate", + "type": "birthdate", + "description": "The new value of the current user's birthdate; pass null to remove the birthdate" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "setPersonalChat", + "description": "Changes the personal chat of the current user", + "class": "Ok", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the new personal chat; pass 0 to remove the chat. Use getSuitablePersonalChats to get suitable chats" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "setEmojiStatus", "description": "Changes the emoji status of the current user; for Telegram Premium users only", @@ -27541,11 +35858,6 @@ "name": "emoji_status", "type": "emojiStatus", "description": "New emoji status; pass null to switch to the default badge" - }, - { - "name": "duration", - "type": "int32", - "description": "Duration of the status, in seconds; pass 0 to keep the status active until it will be changed manually" } ], "is_synchronous": false, @@ -27553,7 +35865,7 @@ }, { "name": "setLocation", - "description": "Changes the location of the current user. Needs to be called if getOption(\"is_location_visible\") is true and location changes for more than 1 kilometer", + "description": "Changes the location of the current user. Needs to be called if getOption(\"is_location_visible\") is true and location changes for more than 1 kilometer. Must not be called if the user has a business location", "class": "Ok", "properties": [ { @@ -27565,9 +35877,79 @@ "is_synchronous": false, "type": 2 }, + { + "name": "setBusinessLocation", + "description": "Changes the business location of the current user. Requires Telegram Business subscription", + "class": "Ok", + "properties": [ + { + "name": "location", + "type": "businessLocation", + "description": "The new location of the business; pass null to remove the location" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "setBusinessOpeningHours", + "description": "Changes the business opening hours of the current user. Requires Telegram Business subscription", + "class": "Ok", + "properties": [ + { + "name": "opening_hours", + "type": "businessOpeningHours", + "description": "The new opening hours of the business; pass null to remove the opening hours; up to 28 time intervals can be specified" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "setBusinessGreetingMessageSettings", + "description": "Changes the business greeting message settings of the current user. Requires Telegram Business subscription", + "class": "Ok", + "properties": [ + { + "name": "greeting_message_settings", + "type": "businessGreetingMessageSettings", + "description": "The new settings for the greeting message of the business; pass null to disable the greeting message" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "setBusinessAwayMessageSettings", + "description": "Changes the business away message settings of the current user. Requires Telegram Business subscription", + "class": "Ok", + "properties": [ + { + "name": "away_message_settings", + "type": "businessAwayMessageSettings", + "description": "The new settings for the away message of the business; pass null to disable the away message" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "setBusinessIntro", + "description": "Changes the business intro of the current user. Requires Telegram Business subscription", + "class": "Ok", + "properties": [ + { + "name": "intro", + "type": "inputBusinessIntro", + "description": "The new intro of the business; pass null to remove the intro" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "changePhoneNumber", - "description": "Changes the phone number of the user and sends an authentication code to the user's new phone number. On success, returns information about the sent code", + "description": "Changes the phone number of the user and sends an authentication code to the user's new phone number; for official Android and iOS applications only. On success, returns information about the sent code", "class": "AuthenticationCodeInfo", "properties": [ { @@ -27606,6 +35988,42 @@ "is_synchronous": false, "type": 2 }, + { + "name": "getBusinessConnectedBot", + "description": "Returns the business bot that is connected to the current user account. Returns a 404 error if there is no connected bot", + "class": "BusinessConnectedBot", + "properties": [], + "is_synchronous": false, + "type": 2 + }, + { + "name": "setBusinessConnectedBot", + "description": "Adds or changes business bot that is connected to the current user account", + "class": "Ok", + "properties": [ + { + "name": "bot", + "type": "businessConnectedBot", + "description": "Connection settings for the bot" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "deleteBusinessConnectedBot", + "description": "Deletes the business bot that is connected to the current user account", + "class": "Ok", + "properties": [ + { + "name": "bot_user_id", + "type": "int53", + "description": "Unique user identifier for the bot" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "getUserLink", "description": "Returns an HTTPS link, which can be used to get information about the current user", @@ -27673,7 +36091,7 @@ }, { "name": "getCommands", - "description": "Returns the list of commands supported by the bot for the given user scope and language; for bots only", + "description": "Returns list of commands supported by the bot for the given user scope and language; for bots only", "class": "BotCommands", "properties": [ { @@ -27731,7 +36149,7 @@ { "name": "default_group_administrator_rights", "type": "chatAdministratorRights", - "description": "Default administrator rights for adding the bot to basic group and supergroup chats; may be null" + "description": "Default administrator rights for adding the bot to basic group and supergroup chats; pass null to remove default rights" } ], "is_synchronous": false, @@ -27745,12 +36163,255 @@ { "name": "default_channel_administrator_rights", "type": "chatAdministratorRights", - "description": "Default administrator rights for adding the bot to channels; may be null" + "description": "Default administrator rights for adding the bot to channels; pass null to remove default rights" } ], "is_synchronous": false, "type": 3 }, + { + "name": "canBotSendMessages", + "description": "Checks whether the specified bot can send messages to the user. Returns a 404 error if can't and the access can be granted by call to allowBotToSendMessages", + "class": "Ok", + "properties": [ + { + "name": "bot_user_id", + "type": "int53", + "description": "Identifier of the target bot" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "allowBotToSendMessages", + "description": "Allows the specified bot to send messages to the user", + "class": "Ok", + "properties": [ + { + "name": "bot_user_id", + "type": "int53", + "description": "Identifier of the target bot" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "sendWebAppCustomRequest", + "description": "Sends a custom request from a Web App", + "class": "CustomRequestResult", + "properties": [ + { + "name": "bot_user_id", + "type": "int53", + "description": "Identifier of the bot" + }, + { + "name": "method", + "type": "string", + "description": "The method name" + }, + { + "name": "parameters", + "type": "string", + "description": "JSON-serialized method parameters" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "setBotName", + "description": "Sets the name of a bot. Can be called only if userTypeBot.can_be_edited == true", + "class": "Ok", + "properties": [ + { + "name": "bot_user_id", + "type": "int53", + "description": "Identifier of the target bot" + }, + { + "name": "language_code", + "type": "string", + "description": "A two-letter ISO 639-1 language code. If empty, the name will be shown to all users for whose languages there is no dedicated name" + }, + { + "name": "name", + "type": "string", + "description": "New bot's name on the specified language; 0-64 characters; must be non-empty if language code is empty" + } + ], + "is_synchronous": false, + "type": 1 + }, + { + "name": "getBotName", + "description": "Returns the name of a bot in the given language. Can be called only if userTypeBot.can_be_edited == true", + "class": "Text", + "properties": [ + { + "name": "bot_user_id", + "type": "int53", + "description": "Identifier of the target bot" + }, + { + "name": "language_code", + "type": "string", + "description": "A two-letter ISO 639-1 language code or an empty string" + } + ], + "is_synchronous": false, + "type": 1 + }, + { + "name": "setBotProfilePhoto", + "description": "Changes a profile photo for a bot", + "class": "Ok", + "properties": [ + { + "name": "bot_user_id", + "type": "int53", + "description": "Identifier of the target bot" + }, + { + "name": "photo", + "type": "InputChatPhoto", + "description": "Profile photo to set; pass null to delete the chat photo" + } + ], + "is_synchronous": false, + "type": 1 + }, + { + "name": "toggleBotUsernameIsActive", + "description": "Changes active state for a username of a bot. The editable username can't be disabled. May return an error with a message \"USERNAMES_ACTIVE_TOO_MUCH\" if the maximum number of active usernames has been reached. Can be called only if userTypeBot.can_be_edited == true", + "class": "Ok", + "properties": [ + { + "name": "bot_user_id", + "type": "int53", + "description": "Identifier of the target bot" + }, + { + "name": "username", + "type": "string", + "description": "The username to change" + }, + { + "name": "is_active", + "type": "Bool", + "description": "Pass true to activate the username; pass false to disable it" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "reorderBotActiveUsernames", + "description": "Changes order of active usernames of a bot. Can be called only if userTypeBot.can_be_edited == true", + "class": "Ok", + "properties": [ + { + "name": "bot_user_id", + "type": "int53", + "description": "Identifier of the target bot" + }, + { + "name": "usernames", + "type": "vector\u003cstring\u003e", + "description": "The new order of active usernames. All currently active usernames must be specified" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "setBotInfoDescription", + "description": "Sets the text shown in the chat with a bot if the chat is empty. Can be called only if userTypeBot.can_be_edited == true", + "class": "Ok", + "properties": [ + { + "name": "bot_user_id", + "type": "int53", + "description": "Identifier of the target bot" + }, + { + "name": "language_code", + "type": "string", + "description": "A two-letter ISO 639-1 language code. If empty, the description will be shown to all users for whose languages there is no dedicated description" + }, + { + "name": "description", + "type": "string", + "description": "New bot's description on the specified language" + } + ], + "is_synchronous": false, + "type": 1 + }, + { + "name": "getBotInfoDescription", + "description": "Returns the text shown in the chat with a bot if the chat is empty in the given language. Can be called only if userTypeBot.can_be_edited == true", + "class": "Text", + "properties": [ + { + "name": "bot_user_id", + "type": "int53", + "description": "Identifier of the target bot" + }, + { + "name": "language_code", + "type": "string", + "description": "A two-letter ISO 639-1 language code or an empty string" + } + ], + "is_synchronous": false, + "type": 1 + }, + { + "name": "setBotInfoShortDescription", + "description": "Sets the text shown on a bot's profile page and sent together with the link when users share the bot. Can be called only if userTypeBot.can_be_edited == true", + "class": "Ok", + "properties": [ + { + "name": "bot_user_id", + "type": "int53", + "description": "Identifier of the target bot" + }, + { + "name": "language_code", + "type": "string", + "description": "A two-letter ISO 639-1 language code. If empty, the short description will be shown to all users for whose languages there is no dedicated description" + }, + { + "name": "short_description", + "type": "string", + "description": "New bot's short description on the specified language" + } + ], + "is_synchronous": false, + "type": 1 + }, + { + "name": "getBotInfoShortDescription", + "description": "Returns the text shown on a bot's profile page and sent together with the link when users share the bot in the given language. Can be called only if userTypeBot.can_be_edited == true", + "class": "Text", + "properties": [ + { + "name": "bot_user_id", + "type": "int53", + "description": "Identifier of the target bot" + }, + { + "name": "language_code", + "type": "string", + "description": "A two-letter ISO 639-1 language code or an empty string" + } + ], + "is_synchronous": false, + "type": 1 + }, { "name": "getActiveSessions", "description": "Returns all active sessions of the current user", @@ -27781,6 +36442,20 @@ "is_synchronous": false, "type": 2 }, + { + "name": "confirmSession", + "description": "Confirms an unconfirmed session of the current user from another device", + "class": "Ok", + "properties": [ + { + "name": "session_id", + "type": "int64", + "description": "Session identifier" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "toggleSessionCanAcceptCalls", "description": "Toggles whether a session can accept incoming calls", @@ -27813,7 +36488,7 @@ { "name": "can_accept_secret_chats", "type": "Bool", - "description": "Pass true to allow accepring secret chats by the session; pass false otherwise" + "description": "Pass true to allow accepting secret chats by the session; pass false otherwise" } ], "is_synchronous": false, @@ -27958,9 +36633,47 @@ "is_synchronous": false, "type": 1 }, + { + "name": "setSupergroupCustomEmojiStickerSet", + "description": "Changes the custom emoji sticker set of a supergroup; requires can_change_info administrator right. The chat must have at least chatBoostFeatures.min_custom_emoji_sticker_set_boost_level boost level to pass the corresponding color", + "class": "Ok", + "properties": [ + { + "name": "supergroup_id", + "type": "int53", + "description": "Identifier of the supergroup" + }, + { + "name": "custom_emoji_sticker_set_id", + "type": "int64", + "description": "New value of the custom emoji sticker set identifier for the supergroup. Use 0 to remove the custom emoji sticker set in the supergroup" + } + ], + "is_synchronous": false, + "type": 1 + }, + { + "name": "setSupergroupUnrestrictBoostCount", + "description": "Changes the number of times the supergroup must be boosted by a user to ignore slow mode and chat permission restrictions; requires can_restrict_members administrator right", + "class": "Ok", + "properties": [ + { + "name": "supergroup_id", + "type": "int53", + "description": "Identifier of the supergroup" + }, + { + "name": "unrestrict_boost_count", + "type": "int32", + "description": "New value of the unrestrict_boost_count supergroup setting; 0-8. Use 0 to remove the setting" + } + ], + "is_synchronous": false, + "type": 1 + }, { "name": "toggleSupergroupSignMessages", - "description": "Toggles whether sender signature is added to sent messages in a channel; requires can_change_info administrator right", + "description": "Toggles whether sender signature is added to sent messages in a channel; requires can_change_info member right", "class": "Ok", "properties": [ { @@ -28017,7 +36730,7 @@ }, { "name": "toggleSupergroupIsAllHistoryAvailable", - "description": "Toggles whether the message history of a supergroup is available to new members; requires can_change_info administrator right", + "description": "Toggles whether the message history of a supergroup is available to new members; requires can_change_info member right", "class": "Ok", "properties": [ { @@ -28074,7 +36787,7 @@ }, { "name": "toggleSupergroupIsForum", - "description": "Toggles whether the supergroup is a forum; requires owner privileges in the supergroup", + "description": "Toggles whether the supergroup is a forum; requires owner privileges in the supergroup. Discussion supergroups can't be converted to forums", "class": "Ok", "properties": [ { @@ -28085,7 +36798,7 @@ { "name": "is_forum", "type": "Bool", - "description": "New value of is_forum. A supergroup can be converted to a forum, only if it has at least getOption(\"forum_member_count_min\") members" + "description": "New value of is_forum" } ], "is_synchronous": false, @@ -28225,9 +36938,17 @@ "is_synchronous": false, "type": 2 }, + { + "name": "getTimeZones", + "description": "Returns the list of supported time zones", + "class": "TimeZones", + "properties": [], + "is_synchronous": false, + "type": 1 + }, { "name": "getPaymentForm", - "description": "Returns an invoice payment form. This method must be called when the user presses inlineKeyboardButtonBuy", + "description": "Returns an invoice payment form. This method must be called when the user presses inline button of the type inlineKeyboardButtonTypeBuy", "class": "PaymentForm", "properties": [ { @@ -28372,20 +37093,6 @@ "is_synchronous": false, "type": 2 }, - { - "name": "getBackgrounds", - "description": "Returns backgrounds installed by the user", - "class": "Backgrounds", - "properties": [ - { - "name": "for_dark_theme", - "type": "Bool", - "description": "Pass true to order returned backgrounds for a dark theme" - } - ], - "is_synchronous": false, - "type": 2 - }, { "name": "getBackgroundUrl", "description": "Constructs a persistent HTTP URL for a background", @@ -28399,7 +37106,7 @@ { "name": "type", "type": "BackgroundType", - "description": "Background type" + "description": "Background type; backgroundTypeChatTheme isn't supported" } ], "is_synchronous": false, @@ -28420,31 +37127,59 @@ "type": 2 }, { - "name": "setBackground", - "description": "Changes the background selected by the user; adds background to the list of installed backgrounds", + "name": "setDefaultBackground", + "description": "Sets default background for chats; adds the background to the list of installed backgrounds", "class": "Background", "properties": [ { "name": "background", "type": "InputBackground", - "description": "The input background to use; pass null to create a new filled backgrounds or to remove the current background" + "description": "The input background to use; pass null to create a new filled background" }, { "name": "type", "type": "BackgroundType", - "description": "Background type; pass null to use the default type of the remote background or to remove the current background" + "description": "Background type; pass null to use the default type of the remote background; backgroundTypeChatTheme isn't supported" }, { "name": "for_dark_theme", "type": "Bool", - "description": "Pass true if the background is changed for a dark theme" + "description": "Pass true if the background is set for a dark theme" } ], "is_synchronous": false, "type": 2 }, { - "name": "removeBackground", + "name": "deleteDefaultBackground", + "description": "Deletes default background for chats", + "class": "Ok", + "properties": [ + { + "name": "for_dark_theme", + "type": "Bool", + "description": "Pass true if the background is deleted for a dark theme" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getInstalledBackgrounds", + "description": "Returns backgrounds installed by the user", + "class": "Backgrounds", + "properties": [ + { + "name": "for_dark_theme", + "type": "Bool", + "description": "Pass true to order returned backgrounds for a dark theme" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "removeInstalledBackground", "description": "Removes background from the list of installed backgrounds", "class": "Ok", "properties": [ @@ -28458,7 +37193,7 @@ "type": 2 }, { - "name": "resetBackgrounds", + "name": "resetInstalledBackgrounds", "description": "Resets list of installed backgrounds to its default value", "class": "Ok", "properties": [], @@ -28534,7 +37269,7 @@ { "name": "language_pack_id", "type": "string", - "description": "Identifier of a language pack to be added; may be different from a name that is used in an \"https://t.me/setlanguage/\" link" + "description": "Identifier of a language pack to be added" } ], "is_synchronous": false, @@ -28548,7 +37283,7 @@ { "name": "info", "type": "languagePackInfo", - "description": "Information about the language pack. Language pack ID must start with 'X', consist only of English letters, digits and hyphens, and must not exceed 64 characters. Can be called before authorization" + "description": "Information about the language pack. Language pack identifier must start with 'X', consist only of English letters, digits and hyphens, and must not exceed 64 characters. Can be called before authorization" }, { "name": "strings", @@ -28700,6 +37435,69 @@ "is_synchronous": false, "type": 2 }, + { + "name": "setReadDatePrivacySettings", + "description": "Changes privacy settings for message read date", + "class": "Ok", + "properties": [ + { + "name": "settings", + "type": "readDatePrivacySettings", + "description": "New settings" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getReadDatePrivacySettings", + "description": "Returns privacy settings for message read date", + "class": "ReadDatePrivacySettings", + "properties": [], + "is_synchronous": false, + "type": 2 + }, + { + "name": "setNewChatPrivacySettings", + "description": "Changes privacy settings for new chat creation; can be used only if getOption(\"can_set_new_chat_privacy_settings\")", + "class": "Ok", + "properties": [ + { + "name": "settings", + "type": "newChatPrivacySettings", + "description": "New settings" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getNewChatPrivacySettings", + "description": "Returns privacy settings for new chat creation", + "class": "NewChatPrivacySettings", + "properties": [], + "is_synchronous": false, + "type": 2 + }, + { + "name": "canSendMessageToUser", + "description": "Check whether the current user can message another user or try to create a chat with them", + "class": "CanSendMessageToUserResult", + "properties": [ + { + "name": "user_id", + "type": "int53", + "description": "Identifier of the other user" + }, + { + "name": "only_local", + "type": "Bool", + "description": "Pass true to get only locally available information without sending network requests" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "getOption", "description": "Returns the value of an option by its name. (Check the list of available options on https://core.telegram.org/tdlib/options.) Can be called before authorization. Can be called synchronously for options \"version\" and \"commit_hash\"", @@ -28827,7 +37625,7 @@ }, { "name": "reason", - "type": "ChatReportReason", + "type": "ReportReason", "description": "The reason for reporting the chat" }, { @@ -28856,7 +37654,7 @@ }, { "name": "reason", - "type": "ChatReportReason", + "type": "ReportReason", "description": "The reason for reporting the chat photo" }, { @@ -28935,6 +37733,59 @@ "is_synchronous": false, "type": 2 }, + { + "name": "getMessagePublicForwards", + "description": "Returns forwarded copies of a channel message to different public channels and public reposts as a story. Can be used only if message.can_get_statistics == true. For optimal performance, the number of returned messages and stories is chosen by TDLib", + "class": "PublicForwards", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier of the message" + }, + { + "name": "message_id", + "type": "int53", + "description": "Message identifier" + }, + { + "name": "offset", + "type": "string", + "description": "Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results" + }, + { + "name": "limit", + "type": "int32", + "description": "The maximum number of messages and stories to be returned; must be positive and can't be greater than 100. For optimal performance, the number of returned objects is chosen by TDLib and can be smaller than the specified limit" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getStoryStatistics", + "description": "Returns detailed statistics about a story. Can be used only if story.can_get_statistics == true", + "class": "StoryStatistics", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Chat identifier" + }, + { + "name": "story_id", + "type": "int32", + "description": "Story identifier" + }, + { + "name": "is_dark", + "type": "Bool", + "description": "Pass true if a dark theme is used by the application" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "getStatisticalGraph", "description": "Loads an asynchronous or a zoomed in statistical graph", @@ -29120,6 +37971,41 @@ "is_synchronous": false, "type": 2 }, + { + "name": "getAutosaveSettings", + "description": "Returns autosave settings for the current user", + "class": "AutosaveSettings", + "properties": [], + "is_synchronous": false, + "type": 2 + }, + { + "name": "setAutosaveSettings", + "description": "Sets autosave settings for the given scope. The method is guaranteed to work only after at least one call to getAutosaveSettings", + "class": "Ok", + "properties": [ + { + "name": "scope", + "type": "AutosaveSettingsScope", + "description": "Autosave settings scope" + }, + { + "name": "settings", + "type": "scopeAutosaveSettings", + "description": "New autosave settings for the scope; pass null to set autosave settings to default" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "clearAutosaveSettingsExceptions", + "description": "Clears the list of all autosave settings exceptions. The method is guaranteed to work only after at least one call to getAutosaveSettings", + "class": "Ok", + "properties": [], + "is_synchronous": false, + "type": 2 + }, { "name": "getBankCardInfo", "description": "Returns information about a bank card", @@ -29452,10 +38338,15 @@ "type": "int53", "description": "Sticker file owner; ignored for regular users" }, + { + "name": "sticker_format", + "type": "StickerFormat", + "description": "Sticker format" + }, { "name": "sticker", - "type": "inputSticker", - "description": "Sticker file to upload" + "type": "InputFile", + "description": "File file to upload; must fit in a 512x512 square. For WEBP stickers the file must be in WEBP or PNG format, which will be converted to WEBP server-side. See https://core.telegram.org/animated_stickers#technical-requirements for technical requirements" } ], "is_synchronous": false, @@ -29507,17 +38398,22 @@ { "name": "name", "type": "string", - "description": "Sticker set name. Can contain only English letters, digits and underscores. Must end with *\"_by_\u003cbot username\u003e\"* (*\u003cbot_username\u003e* is case insensitive) for bots; 1-64 characters" + "description": "Sticker set name. Can contain only English letters, digits and underscores. Must end with *\"_by_\u003cbot username\u003e\"* (*\u003cbot_username\u003e* is case insensitive) for bots; 0-64 characters. If empty, then the name returned by getSuggestedStickerSetName will be used automatically" }, { "name": "sticker_type", "type": "StickerType", "description": "Type of the stickers in the set" }, + { + "name": "needs_repainting", + "type": "Bool", + "description": "Pass true if stickers in the sticker set must be repainted; for custom emoji sticker sets only" + }, { "name": "stickers", "type": "vector\u003cinputSticker\u003e", - "description": "List of stickers to be added to the set; must be non-empty. All stickers must have the same format. For TGS stickers, uploadStickerFile must be used before the sticker is shown" + "description": "List of stickers to be added to the set; 1-200 stickers for custom emoji sticker sets, and 1-120 stickers otherwise. For TGS stickers, uploadStickerFile must be used before the sticker is shown" }, { "name": "source", @@ -29530,18 +38426,18 @@ }, { "name": "addStickerToSet", - "description": "Adds a new sticker to a set; for bots only. Returns the sticker set", - "class": "StickerSet", + "description": "Adds a new sticker to a set", + "class": "Ok", "properties": [ { "name": "user_id", "type": "int53", - "description": "Sticker set owner" + "description": "Sticker set owner; ignored for regular users" }, { "name": "name", "type": "string", - "description": "Sticker set name" + "description": "Sticker set name. The sticker set must be owned by the current user, and contain less than 200 stickers for custom emoji sticker sets and less than 120 otherwise" }, { "name": "sticker", @@ -29550,35 +38446,121 @@ } ], "is_synchronous": false, - "type": 3 + "type": 1 }, { - "name": "setStickerSetThumbnail", - "description": "Sets a sticker set thumbnail; for bots only. Returns the sticker set", - "class": "StickerSet", + "name": "replaceStickerInSet", + "description": "Replaces existing sticker in a set. The function is equivalent to removeStickerFromSet, then addStickerToSet, then setStickerPositionInSet", + "class": "Ok", "properties": [ { "name": "user_id", "type": "int53", - "description": "Sticker set owner" + "description": "Sticker set owner; ignored for regular users" }, { "name": "name", "type": "string", - "description": "Sticker set name" + "description": "Sticker set name. The sticker set must be owned by the current user" + }, + { + "name": "old_sticker", + "type": "InputFile", + "description": "Sticker to remove from the set" + }, + { + "name": "new_sticker", + "type": "inputSticker", + "description": "Sticker to add to the set" + } + ], + "is_synchronous": false, + "type": 1 + }, + { + "name": "setStickerSetThumbnail", + "description": "Sets a sticker set thumbnail", + "class": "Ok", + "properties": [ + { + "name": "user_id", + "type": "int53", + "description": "Sticker set owner; ignored for regular users" + }, + { + "name": "name", + "type": "string", + "description": "Sticker set name. The sticker set must be owned by the current user" }, { "name": "thumbnail", "type": "InputFile", - "description": "Thumbnail to set in PNG, TGS, or WEBM format; pass null to remove the sticker set thumbnail. Thumbnail format must match the format of stickers in the set" + "description": "Thumbnail to set; pass null to remove the sticker set thumbnail" + }, + { + "name": "format", + "type": "StickerFormat", + "description": "Format of the thumbnail; pass null if thumbnail is removed" } ], "is_synchronous": false, - "type": 3 + "type": 1 + }, + { + "name": "setCustomEmojiStickerSetThumbnail", + "description": "Sets a custom emoji sticker set thumbnail", + "class": "Ok", + "properties": [ + { + "name": "name", + "type": "string", + "description": "Sticker set name. The sticker set must be owned by the current user" + }, + { + "name": "custom_emoji_id", + "type": "int64", + "description": "Identifier of the custom emoji from the sticker set, which will be set as sticker set thumbnail; pass 0 to remove the sticker set thumbnail" + } + ], + "is_synchronous": false, + "type": 1 + }, + { + "name": "setStickerSetTitle", + "description": "Sets a sticker set title", + "class": "Ok", + "properties": [ + { + "name": "name", + "type": "string", + "description": "Sticker set name. The sticker set must be owned by the current user" + }, + { + "name": "title", + "type": "string", + "description": "New sticker set title" + } + ], + "is_synchronous": false, + "type": 1 + }, + { + "name": "deleteStickerSet", + "description": "Completely deletes a sticker set", + "class": "Ok", + "properties": [ + { + "name": "name", + "type": "string", + "description": "Sticker set name. The sticker set must be owned by the current user" + } + ], + "is_synchronous": false, + "type": 1 }, { "name": "setStickerPositionInSet", - "description": "Changes the position of a sticker in the set to which it belongs; for bots only. The sticker set must have been created by the bot", + "description": "Changes the position of a sticker in the set to which it belongs. The sticker set must be owned by the current user", "class": "Ok", "properties": [ { @@ -29593,21 +38575,97 @@ } ], "is_synchronous": false, - "type": 3 + "type": 1 }, { "name": "removeStickerFromSet", - "description": "Removes a sticker from the set to which it belongs; for bots only. The sticker set must have been created by the bot", + "description": "Removes a sticker from the set to which it belongs. The sticker set must be owned by the current user", + "class": "Ok", + "properties": [ + { + "name": "sticker", + "type": "InputFile", + "description": "Sticker to remove from the set" + } + ], + "is_synchronous": false, + "type": 1 + }, + { + "name": "setStickerEmojis", + "description": "Changes the list of emoji corresponding to a sticker. The sticker must belong to a regular or custom emoji sticker set that is owned by the current user", "class": "Ok", "properties": [ { "name": "sticker", "type": "InputFile", "description": "Sticker" + }, + { + "name": "emojis", + "type": "string", + "description": "New string with 1-20 emoji corresponding to the sticker" } ], "is_synchronous": false, - "type": 3 + "type": 1 + }, + { + "name": "setStickerKeywords", + "description": "Changes the list of keywords of a sticker. The sticker must belong to a regular or custom emoji sticker set that is owned by the current user", + "class": "Ok", + "properties": [ + { + "name": "sticker", + "type": "InputFile", + "description": "Sticker" + }, + { + "name": "keywords", + "type": "vector\u003cstring\u003e", + "description": "List of up to 20 keywords with total length up to 64 characters, which can be used to find the sticker" + } + ], + "is_synchronous": false, + "type": 1 + }, + { + "name": "setStickerMaskPosition", + "description": "Changes the mask position of a mask sticker. The sticker must belong to a mask sticker set that is owned by the current user", + "class": "Ok", + "properties": [ + { + "name": "sticker", + "type": "InputFile", + "description": "Sticker" + }, + { + "name": "mask_position", + "type": "maskPosition", + "description": "Position where the mask is placed; pass null to remove mask position" + } + ], + "is_synchronous": false, + "type": 1 + }, + { + "name": "getOwnedStickerSets", + "description": "Returns sticker sets owned by the current user", + "class": "StickerSets", + "properties": [ + { + "name": "offset_sticker_set_id", + "type": "int64", + "description": "Identifier of the sticker set from which to return owned sticker sets; use 0 to get results from the beginning" + }, + { + "name": "limit", + "type": "int32", + "description": "The maximum number of sticker sets to be returned; must be positive and can't be greater than 100. For optimal performance, the number of returned objects is chosen by TDLib and can be smaller than the specified limit" + } + ], + "is_synchronous": false, + "type": 2 }, { "name": "getMapThumbnailFile", @@ -29714,6 +38772,86 @@ "is_synchronous": false, "type": 2 }, + { + "name": "getPremiumGiftCodePaymentOptions", + "description": "Returns available options for Telegram Premium gift code or giveaway creation", + "class": "PremiumGiftCodePaymentOptions", + "properties": [ + { + "name": "boosted_chat_id", + "type": "int53", + "description": "Identifier of the supergroup or channel chat, which will be automatically boosted by receivers of the gift codes and which is administered by the user; 0 if none" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "checkPremiumGiftCode", + "description": "Return information about a Telegram Premium gift code", + "class": "PremiumGiftCodeInfo", + "properties": [ + { + "name": "code", + "type": "string", + "description": "The code to check" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "applyPremiumGiftCode", + "description": "Applies a Telegram Premium gift code", + "class": "Ok", + "properties": [ + { + "name": "code", + "type": "string", + "description": "The code to apply" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "launchPrepaidPremiumGiveaway", + "description": "Launches a prepaid Telegram Premium giveaway", + "class": "Ok", + "properties": [ + { + "name": "giveaway_id", + "type": "int64", + "description": "Unique identifier of the prepaid giveaway" + }, + { + "name": "parameters", + "type": "premiumGiveawayParameters", + "description": "Giveaway parameters" + } + ], + "is_synchronous": false, + "type": 2 + }, + { + "name": "getPremiumGiveawayInfo", + "description": "Returns information about a Telegram Premium giveaway", + "class": "PremiumGiveawayInfo", + "properties": [ + { + "name": "chat_id", + "type": "int53", + "description": "Identifier of the channel chat which started the giveaway" + }, + { + "name": "message_id", + "type": "int53", + "description": "Identifier of the giveaway or a giveaway winners message in the chat" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "canPurchasePremium", "description": "Checks whether Telegram Premium purchase is possible. Must be called before in-store Premium purchase", @@ -29776,6 +38914,20 @@ "is_synchronous": false, "type": 2 }, + { + "name": "getBusinessFeatures", + "description": "Returns information about features, available to Business users", + "class": "BusinessFeatures", + "properties": [ + { + "name": "source", + "type": "BusinessFeature", + "description": "Source of the request; pass null if the method is called from settings or some non-standard source" + } + ], + "is_synchronous": false, + "type": 2 + }, { "name": "acceptTermsOfService", "description": "Accepts Telegram terms of services", @@ -29790,6 +38942,35 @@ "is_synchronous": false, "type": 2 }, + { + "name": "searchStringsByPrefix", + "description": "Searches specified query by word prefixes in the provided strings. Returns 0-based positions of strings that matched. Can be called synchronously", + "class": "FoundPositions", + "properties": [ + { + "name": "strings", + "type": "vector\u003cstring\u003e", + "description": "The strings to search in for the query" + }, + { + "name": "query", + "type": "string", + "description": "Query to search for" + }, + { + "name": "limit", + "type": "int32", + "description": "The maximum number of objects to return" + }, + { + "name": "return_none_for_empty_query", + "type": "Bool", + "description": "Pass true to receive no results for an empty query" + } + ], + "is_synchronous": true, + "type": 1 + }, { "name": "sendCustomRequest", "description": "Sends a custom request; for bots only", @@ -29892,12 +39073,18 @@ "type": 1 }, { - "name": "getApplicationDownloadLink", - "description": "Returns the link for downloading official Telegram application to be used when the current user invites friends to Telegram", - "class": "HttpUrl", - "properties": [], + "name": "getCollectibleItemInfo", + "description": "Returns information about a given collectible item that was purchased at https://fragment.com", + "class": "CollectibleItemInfo", + "properties": [ + { + "name": "type", + "type": "CollectibleItemType", + "description": "Type of the collectible item. The item must be used by a user and must be visible to the current user" + } + ], "is_synchronous": false, - "type": 2 + "type": 1 }, { "name": "getDeepLinkInfo", @@ -29945,6 +39132,14 @@ "is_synchronous": false, "type": 2 }, + { + "name": "getApplicationDownloadLink", + "description": "Returns the link for downloading official Telegram application to be used when the current user invites friends to Telegram", + "class": "HttpUrl", + "properties": [], + "is_synchronous": false, + "type": 2 + }, { "name": "addProxy", "description": "Adds a proxy server for network requests. Can be called before authorization", @@ -29953,7 +39148,7 @@ { "name": "server", "type": "string", - "description": "Proxy server IP address" + "description": "Proxy server domain or IP address" }, { "name": "port", @@ -29987,7 +39182,7 @@ { "name": "server", "type": "string", - "description": "Proxy server IP address" + "description": "Proxy server domain or IP address" }, { "name": "port", @@ -30217,6 +39412,14 @@ "is_synchronous": false, "type": 2 }, + { + "name": "getSupportName", + "description": "Returns localized name of the Telegram support user; for Telegram support only", + "class": "Text", + "properties": [], + "is_synchronous": false, + "type": 2 + }, { "name": "testCallEmpty", "description": "Does nothing; for testing only. This is an offline method. Can be called before authorization", @@ -30339,7 +39542,7 @@ { "name": "server", "type": "string", - "description": "Proxy server IP address" + "description": "Proxy server domain or IP address" }, { "name": "port", @@ -30396,4 +39599,4 @@ "type": 1 } ] -} \ No newline at end of file +}