packages feed

tdlib-types-0.4.0: src/TDLib/Generated/Types.hs

{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE TemplateHaskell #-}

-- | TD API data types generated by tdlib-gen
module TDLib.Generated.Types where

import GHC.Generics
import Language.Haskell.Codegen.TH
import Data.ByteString.Base64.Type
import qualified Data.Text as T
import Language.TL.I64

type I53 = Int
type I32 = Int
type T = T.Text


data Error
  = -- | An object of this type can be returned on every function call, in case of an error
  Error
    { -- | 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 :: I32,
      -- | Error message; subject to future changes
      message :: T
    }
  deriving (Show, Eq, Generic)
data Ok
  = -- | An object of this type is returned on a successful function call for certain functions
  Ok
    { 
    }
  deriving (Show, Eq, Generic)
data TdlibParameters
  = -- | Contains parameters for TDLib initialization
  TdlibParameters
    { -- | If set to true, the Telegram test environment will be used instead of the production environment
      useTestDc :: Bool,
      -- | The path to the directory for the persistent database; if empty, the current working directory will be used
      databaseDirectory :: T,
      -- | The path to the directory for storing files; if empty, database_directory will be used
      filesDirectory :: T,
      -- | If set to true, information about downloaded and uploaded files will be saved between application restarts
      useFileDatabase :: Bool,
      -- | If set to true, the library will maintain a cache of users, basic groups, supergroups, channels and secret chats. Implies use_file_database
      useChatInfoDatabase :: Bool,
      -- | If set to true, the library will maintain a cache of chats and messages. Implies use_chat_info_database
      useMessageDatabase :: Bool,
      -- | If set to true, support for secret chats will be enabled
      useSecretChats :: Bool,
      -- | Application identifier for Telegram API access, which can be obtained at https://my.telegram.org
      apiId :: I32,
      -- | Application identifier hash for Telegram API access, which can be obtained at https://my.telegram.org
      apiHash :: T,
      -- | IETF language tag of the user's operating system language; must be non-empty
      systemLanguageCode :: T,
      -- | Model of the device the application is being run on; must be non-empty
      deviceModel :: T,
      -- | Version of the operating system the application is being run on; must be non-empty
      systemVersion :: T,
      -- | Application version; must be non-empty
      applicationVersion :: T,
      -- | If set to true, old files will automatically be deleted
      enableStorageOptimizer :: Bool,
      -- | If set to true, original file names will be ignored. Otherwise, downloaded files will be saved under names as close as possible to the original name
      ignoreFileNames :: Bool
    }
  deriving (Show, Eq, Generic)
-- | Provides information about the method by which an authentication code is delivered to the user
data AuthenticationCodeType
  = -- | An authentication code is delivered via a private Telegram message, which can be viewed in another client 
  AuthenticationCodeTypeTelegramMessage
    { -- | Length of the code
      length :: I32
    }
  | -- | An authentication code is delivered via an SMS message to the specified phone number 
  AuthenticationCodeTypeSms
    { -- | Length of the code
      length :: I32
    }
  | -- | An authentication code is delivered via a phone call to the specified phone number 
  AuthenticationCodeTypeCall
    { -- | Length of the code
      length :: I32
    }
  | -- | An authentication code is delivered by an immediately cancelled call to the specified phone number. The number from which the call was made is the code 
  AuthenticationCodeTypeFlashCall
    { -- | Pattern of the phone number from which the call will be made
      pattern_ :: T
    }
  deriving (Show, Eq, Generic)
data AuthenticationCodeInfo
  = -- | Information about the authentication code that was sent 
  AuthenticationCodeInfo
    { -- | A phone number that is being authenticated 
      phoneNumber :: T,
      -- | Describes the way the code was sent to the user 
      type_ :: AuthenticationCodeType,
      -- | Describes the way the next code will be sent to the user; may be null 
      nextType :: (Maybe) (AuthenticationCodeType),
      -- | Timeout before the code should be re-sent, in seconds
      timeout :: I32
    }
  deriving (Show, Eq, Generic)
data EmailAddressAuthenticationCodeInfo
  = -- | Information about the email address authentication code that was sent 
  EmailAddressAuthenticationCodeInfo
    { -- | Pattern of the email address to which an authentication code was sent 
      emailAddressPattern :: T,
      -- | Length of the code; 0 if unknown
      length :: I32
    }
  deriving (Show, Eq, Generic)
data TextEntity
  = -- | Represents a part of the text that needs to be formatted in some unusual way 
  TextEntity
    { -- | Offset of the entity in UTF-16 code units 
      offset :: I32,
      -- | Length of the entity, in UTF-16 code units 
      length :: I32,
      -- | Type of the entity
      type_ :: TextEntityType
    }
  deriving (Show, Eq, Generic)
data TextEntities
  = -- | Contains a list of text entities 
  TextEntities
    { -- | List of text entities
      entities :: [TextEntity]
    }
  deriving (Show, Eq, Generic)
data FormattedText
  = -- | A text with some entities 
  FormattedText
    { -- | The text 
      text :: T,
      -- | Entities contained in the text. Entities can be nested, but must not mutually intersect with each other.
      entities :: [TextEntity]
    }
  deriving (Show, Eq, Generic)
data TermsOfService
  = -- | Contains Telegram terms of service 
  TermsOfService
    { -- | Text of the terms of service 
      text :: FormattedText,
      -- | The minimum age of a user to be able to accept the terms; 0 if any 
      minUserAge :: I32,
      -- | True, if a blocking popup with terms of service must be shown to the user
      showPopup :: Bool
    }
  deriving (Show, Eq, Generic)
-- | Represents the current authorization state of the client
data AuthorizationState
  = -- | TDLib needs TdlibParameters for initialization
  AuthorizationStateWaitTdlibParameters
    { 
    }
  | -- | TDLib needs an encryption key to decrypt the local database 
  AuthorizationStateWaitEncryptionKey
    { -- | True, if the database is currently encrypted
      isEncrypted :: Bool
    }
  | -- | 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
  AuthorizationStateWaitPhoneNumber
    { 
    }
  | -- | TDLib needs the user's authentication code to authorize 
  AuthorizationStateWaitCode
    { -- | Information about the authorization code that was sent
      codeInfo :: AuthenticationCodeInfo
    }
  | -- | The user needs to confirm authorization on another logged in device by scanning a QR code with the provided link 
  AuthorizationStateWaitOtherDeviceConfirmation
    { -- | A tg:// URL for the QR code. The link will be updated frequently
      link :: T
    }
  | -- | The user is unregistered and need to accept terms of service and enter their first name and last name to finish registration 
  AuthorizationStateWaitRegistration
    { -- | Telegram terms of service
      termsOfService :: TermsOfService
    }
  | -- | The user has been authorized, but needs to enter a password to start using the application 
  AuthorizationStateWaitPassword
    { -- | Hint for the password; may be empty 
      passwordHint :: T,
      -- | True, if a recovery email address has been set up
      hasRecoveryEmailAddress :: Bool,
      -- | Pattern of the email address to which the recovery email was sent; empty until a recovery email has been sent
      recoveryEmailAddressPattern :: T
    }
  | -- | The user has been successfully authorized. TDLib is now ready to answer queries
  AuthorizationStateReady
    { 
    }
  | -- | The user is currently logging out
  AuthorizationStateLoggingOut
    { 
    }
  | -- | 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
  AuthorizationStateClosing
    { 
    }
  | -- | 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
  AuthorizationStateClosed
    { 
    }
  deriving (Show, Eq, Generic)
data PasswordState
  = -- | Represents the current state of 2-step verification 
  PasswordState
    { -- | True, if a 2-step verification password is set 
      hasPassword :: Bool,
      -- | Hint for the password; may be empty
      passwordHint :: T,
      -- | True, if a recovery email is set 
      hasRecoveryEmailAddress :: Bool,
      -- | True, if some Telegram Passport elements were saved
      hasPassportData :: Bool,
      -- | Information about the recovery email address to which the confirmation email was sent; may be null
      recoveryEmailAddressCodeInfo :: (Maybe) (EmailAddressAuthenticationCodeInfo)
    }
  deriving (Show, Eq, Generic)
data RecoveryEmailAddress
  = -- | Contains information about the current recovery email address 
  RecoveryEmailAddress
    { -- | Recovery email address
      recoveryEmailAddress :: T
    }
  deriving (Show, Eq, Generic)
data TemporaryPasswordState
  = -- | Returns information about the availability of a temporary password, which can be used for payments 
  TemporaryPasswordState
    { -- | True, if a temporary password is available 
      hasPassword :: Bool,
      -- | Time left before the temporary password expires, in seconds
      validFor :: I32
    }
  deriving (Show, Eq, Generic)
data LocalFile
  = -- | Represents a local file
  LocalFile
    { -- | Local path to the locally available file part; may be empty
      path :: T,
      -- | True, if it is possible to try to download or generate the file
      canBeDownloaded :: Bool,
      -- | True, if the file can be deleted
      canBeDeleted :: Bool,
      -- | True, if the file is currently being downloaded (or a local copy is being generated by some other means)
      isDownloadingActive :: Bool,
      -- | True, if the local copy is fully available
      isDownloadingCompleted :: Bool,
      -- | Download will be started from this offset. downloaded_prefix_size is calculated from this offset
      downloadOffset :: I32,
      -- | 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
      downloadedPrefixSize :: I32,
      -- | Total downloaded file bytes. Should be used only for calculating download progress. The actual file size may be bigger, and some parts of it may contain garbage
      downloadedSize :: I32
    }
  deriving (Show, Eq, Generic)
data RemoteFile
  = -- | Represents a remote file
  RemoteFile
    { -- | 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.
      id :: T,
      -- | 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 :: T,
      -- | True, if the file is currently being uploaded (or a remote copy is being generated by some other means)
      isUploadingActive :: Bool,
      -- | True, if a remote copy is fully available
      isUploadingCompleted :: Bool,
      -- | Size of the remote available part of the file; 0 if unknown
      uploadedSize :: I32
    }
  deriving (Show, Eq, Generic)
data File
  = -- | Represents a file
  File
    { -- | Unique file identifier
      id :: I32,
      -- | File size; 0 if unknown
      size :: I32,
      -- | Expected file size in case the exact file size is unknown, but an approximate size is known. Can be used to show download/upload progress
      expectedSize :: I32,
      -- | Information about the local copy of the file
      local :: LocalFile,
      -- | Information about the remote copy of the file
      remote :: RemoteFile
    }
  deriving (Show, Eq, Generic)
-- | Points to a file
data InputFile
  = -- | A file defined by its unique ID 
  InputFileId
    { -- | Unique file identifier
      id_2 :: I32
    }
  | -- | 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.
  InputFileRemote
    { -- | Remote file identifier
      id :: T
    }
  | -- | A file defined by a local path 
  InputFileLocal
    { -- | Local path to the file
      path :: T
    }
  | -- | A file generated by the client 
  InputFileGenerated
    { -- | Local path to a file from which the file is generated; may be empty if there is no such file
      originalPath :: T,
      -- | String specifying the conversion applied to the original file; should be persistent across application restarts. Conversions beginning with '#' are reserved for internal TDLib usage
      conversion :: T,
      -- | Expected size of the generated file; 0 if unknown
      expectedSize :: I32
    }
  deriving (Show, Eq, Generic)
data PhotoSize
  = -- | Photo description 
  PhotoSize
    { -- | Thumbnail type (see https://core.telegram.org/constructor/photoSize) 
      type_ :: T,
      -- | Information about the photo file 
      photo :: File,
      -- | Photo width 
      width :: I32,
      -- | Photo height
      height :: I32
    }
  deriving (Show, Eq, Generic)
data Minithumbnail
  = -- | Thumbnail image of a very poor quality and low resolution 
  Minithumbnail
    { -- | Thumbnail width, usually doesn't exceed 40 
      width :: I32,
      -- | Thumbnail height, usually doesn't exceed 40 
      height :: I32,
      -- | The thumbnail in JPEG format
      data_ :: ByteString64
    }
  deriving (Show, Eq, Generic)
-- | Describes format of the thumbnail
data ThumbnailFormat
  = -- | The thumbnail is in JPEG format
  ThumbnailFormatJpeg
    { 
    }
  | -- | The thumbnail is in PNG format. It will be used only for background patterns
  ThumbnailFormatPng
    { 
    }
  | -- | The thumbnail is in WEBP format. It will be used only for some stickers
  ThumbnailFormatWebp
    { 
    }
  | -- | The thumbnail is in static GIF format. It will be used only for some bot inline results
  ThumbnailFormatGif
    { 
    }
  | -- | The thumbnail is in TGS format. It will be used only for animated sticker sets
  ThumbnailFormatTgs
    { 
    }
  | -- | The thumbnail is in MPEG4 format. It will be used only for some animations and videos
  ThumbnailFormatMpeg4
    { 
    }
  deriving (Show, Eq, Generic)
data Thumbnail
  = -- | Represents a thumbnail 
  Thumbnail
    { -- | Thumbnail format 
      format :: ThumbnailFormat,
      -- | Thumbnail width 
      width :: I32,
      -- | Thumbnail height 
      height :: I32,
      -- | The thumbnail
      file :: File
    }
  deriving (Show, Eq, Generic)
-- | Part of the face, relative to which a mask should be placed
data MaskPoint
  = -- | A mask should be placed relatively to the forehead
  MaskPointForehead
    { 
    }
  | -- | A mask should be placed relatively to the eyes
  MaskPointEyes
    { 
    }
  | -- | A mask should be placed relatively to the mouth
  MaskPointMouth
    { 
    }
  | -- | A mask should be placed relatively to the chin
  MaskPointChin
    { 
    }
  deriving (Show, Eq, Generic)
data MaskPosition
  = -- | Position on a photo where a mask should be placed 
  MaskPosition
    { -- | Part of the face, relative to which the mask should be placed
      point :: MaskPoint,
      -- | 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 :: Double,
      -- | 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 :: Double,
      -- | Mask scaling coefficient. (For example, 2.0 means a doubled size)
      scale :: Double
    }
  deriving (Show, Eq, Generic)
data PollOption
  = -- | Describes one answer option of a poll 
  PollOption
    { -- | Option text, 1-100 characters 
      text :: T,
      -- | Number of voters for this option, available only for closed or voted polls 
      voterCount :: I32,
      -- | The percentage of votes for this option, 0-100
      votePercentage :: I32,
      -- | True, if the option was chosen by the user 
      isChosen :: Bool,
      -- | True, if the option is being chosen by a pending setPollAnswer request
      isBeingChosen :: Bool
    }
  deriving (Show, Eq, Generic)
-- | Describes the type of a poll
data PollType
  = -- | A regular poll 
  PollTypeRegular
    { -- | True, if multiple answer options can be chosen simultaneously
      allowMultipleAnswers :: Bool
    }
  | -- | A poll in quiz mode, which has exactly one correct answer option and can be answered only once
  PollTypeQuiz
    { -- | 0-based identifier of the correct answer option; -1 for a yet unanswered poll
      correctOptionId :: I32,
      -- | 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
    }
  deriving (Show, Eq, Generic)
data Animation
  = -- | Describes an animation file. The animation must be encoded in GIF or MPEG4 format 
  Animation
    { -- | Duration of the animation, in seconds; as defined by the sender 
      duration :: I32,
      -- | Width of the animation 
      width :: I32,
      -- | Height of the animation
      height :: I32,
      -- | Original name of the file; as defined by the sender 
      fileName :: T,
      -- | MIME type of the file, usually "image/gif" or "video/mp4"
      mimeType :: T,
      -- | True, if stickers were added to the animation. The list of corresponding sticker set can be received using getAttachedStickerSets
      hasStickers :: Bool,
      -- | Animation minithumbnail; may be null 
      minithumbnail :: (Maybe) (Minithumbnail),
      -- | Animation thumbnail in JPEG or MPEG4 format; may be null 
      thumbnail :: (Maybe) (Thumbnail),
      -- | File containing the animation
      animation :: File
    }
  deriving (Show, Eq, Generic)
data Audio
  = -- | Describes an audio file. Audio is usually in MP3 or M4A format 
  Audio
    { -- | Duration of the audio, in seconds; as defined by the sender 
      duration :: I32,
      -- | Title of the audio; as defined by the sender 
      title :: T,
      -- | Performer of the audio; as defined by the sender
      performer :: T,
      -- | Original name of the file; as defined by the sender 
      fileName :: T,
      -- | The MIME type of the file; as defined by the sender 
      mimeType :: T,
      -- | The minithumbnail of the album cover; may be null
      albumCoverMinithumbnail :: (Maybe) (Minithumbnail),
      -- | The thumbnail of the album cover in JPEG format; as defined by the sender. The full size thumbnail should be extracted from the downloaded file; may be null 
      albumCoverThumbnail :: (Maybe) (Thumbnail),
      -- | File containing the audio
      audio :: File
    }
  deriving (Show, Eq, Generic)
data Document
  = -- | Describes a document of any type 
  Document
    { -- | Original name of the file; as defined by the sender 
      fileName :: T,
      -- | MIME type of the file; as defined by the sender
      mimeType :: T,
      -- | Document minithumbnail; may be null 
      minithumbnail :: (Maybe) (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 :: (Maybe) (Thumbnail),
      -- | File containing the document
      document :: File
    }
  deriving (Show, Eq, Generic)
data Photo
  = -- | Describes a photo 
  Photo
    { -- | True, if stickers were added to the photo. The list of corresponding sticker sets can be received using getAttachedStickerSets
      hasStickers :: Bool,
      -- | Photo minithumbnail; may be null 
      minithumbnail :: (Maybe) (Minithumbnail),
      -- | Available variants of the photo, in different sizes
      sizes :: [PhotoSize]
    }
  deriving (Show, Eq, Generic)
data Sticker
  = -- | Describes a sticker 
  Sticker
    { -- | The identifier of the sticker set to which the sticker belongs; 0 if none 
      setId :: I64,
      -- | Sticker width; as defined by the sender 
      width :: I32,
      -- | Sticker height; as defined by the sender
      height :: I32,
      -- | Emoji corresponding to the sticker 
      emoji :: T,
      -- | True, if the sticker is an animated sticker in TGS format 
      isAnimated :: Bool,
      -- | True, if the sticker is a mask 
      isMask :: Bool,
      -- | Position where the mask should be placed; may be null
      maskPosition :: (Maybe) (MaskPosition),
      -- | Sticker thumbnail in WEBP or JPEG format; may be null 
      thumbnail :: (Maybe) (Thumbnail),
      -- | File containing the sticker
      sticker :: File
    }
  deriving (Show, Eq, Generic)
data Video
  = -- | Describes a video file 
  Video
    { -- | Duration of the video, in seconds; as defined by the sender 
      duration :: I32,
      -- | Video width; as defined by the sender 
      width :: I32,
      -- | Video height; as defined by the sender
      height :: I32,
      -- | Original name of the file; as defined by the sender 
      fileName :: T,
      -- | MIME type of the file; as defined by the sender
      mimeType :: T,
      -- | True, if stickers were added to the video. The list of corresponding sticker sets can be received using getAttachedStickerSets
      hasStickers :: Bool,
      -- | True, if the video should be tried to be streamed 
      supportsStreaming :: Bool,
      -- | Video minithumbnail; may be null
      minithumbnail :: (Maybe) (Minithumbnail),
      -- | Video thumbnail in JPEG or MPEG4 format; as defined by the sender; may be null 
      thumbnail :: (Maybe) (Thumbnail),
      -- | File containing the video
      video :: File
    }
  deriving (Show, Eq, Generic)
data VideoNote
  = -- | Describes a video note. The video must be equal in width and height, cropped to a circle, and stored in MPEG4 format 
  VideoNote
    { -- | Duration of the video, in seconds; as defined by the sender
      duration :: I32,
      -- | Video width and height; as defined by the sender 
      length :: I32,
      -- | Video minithumbnail; may be null
      minithumbnail :: (Maybe) (Minithumbnail),
      -- | Video thumbnail in JPEG format; as defined by the sender; may be null 
      thumbnail :: (Maybe) (Thumbnail),
      -- | File containing the video
      video :: File
    }
  deriving (Show, Eq, Generic)
data VoiceNote
  = -- | 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 
  VoiceNote
    { -- | Duration of the voice note, in seconds; as defined by the sender
      duration :: I32,
      -- | A waveform representation of the voice note in 5-bit format 
      waveform :: ByteString64,
      -- | MIME type of the file; as defined by the sender 
      mimeType :: T,
      -- | File containing the voice note
      voice :: File
    }
  deriving (Show, Eq, Generic)
data Contact
  = -- | Describes a user contact 
  Contact
    { -- | Phone number of the user 
      phoneNumber :: T,
      -- | First name of the user; 1-255 characters in length 
      firstName :: T,
      -- | Last name of the user 
      lastName :: T,
      -- | Additional data about the user in a form of vCard; 0-2048 bytes in length 
      vcard :: T,
      -- | Identifier of the user, if known; otherwise 0
      userId :: I32
    }
  deriving (Show, Eq, Generic)
data Location
  = -- | Describes a location on planet Earth 
  Location
    { -- | Latitude of the location in degrees; as defined by the sender 
      latitude :: Double,
      -- | Longitude of the location, in degrees; as defined by the sender
      longitude :: Double
    }
  deriving (Show, Eq, Generic)
data Venue
  = -- | Describes a venue 
  Venue
    { -- | Venue location; as defined by the sender 
      location :: Location,
      -- | Venue name; as defined by the sender 
      title :: T,
      -- | Venue address; as defined by the sender 
      address :: T,
      -- | Provider of the venue database; as defined by the sender. Currently only "foursquare" needs to be supported
      provider :: T,
      -- | Identifier of the venue in the provider database; as defined by the sender 
      id :: T,
      -- | Type of the venue in the provider database; as defined by the sender
      type_ :: T
    }
  deriving (Show, Eq, Generic)
data Game
  = -- | Describes a game 
  Game
    { -- | Game ID 
      id :: I64,
      -- | Game short name. To share a game use the URL https://t.me/{bot_username}?game={game_short_name} 
      shortName :: T,
      -- | Game title 
      title :: T,
      -- | Game text, usually containing scoreboards for a game
      text :: FormattedText,
      -- | Describes a game 
      description :: T,
      -- | Game photo 
      photo :: Photo,
      -- | Game animation; may be null
      animation :: (Maybe) (Animation)
    }
  deriving (Show, Eq, Generic)
data Poll
  = -- | Describes a poll 
  Poll
    { -- | Unique poll identifier 
      id :: I64,
      -- | Poll question, 1-255 characters 
      question :: T,
      -- | List of poll answer options
      options :: [PollOption],
      -- | Total number of voters, participating in the poll 
      totalVoterCount :: I32,
      -- | User identifiers of recent voters, if the poll is non-anonymous
      recentVoterUserIds :: [I32],
      -- | True, if the poll is anonymous 
      isAnonymous :: Bool,
      -- | Type of the poll
      type_ :: PollType,
      -- | Amount of time the poll will be active after creation, in seconds 
      openPeriod :: I32,
      -- | Point in time (Unix timestamp) when the poll will be automatically closed 
      closeDate :: I32,
      -- | True, if the poll is closed
      isClosed :: Bool
    }
  deriving (Show, Eq, Generic)
data ProfilePhoto
  = -- | Describes a user profile photo 
  ProfilePhoto
    { -- | Photo identifier; 0 for an empty photo. Can be used to find a photo in a list of userProfilePhotos
      id :: I64,
      -- | A small (160x160) user profile photo. The file can be downloaded only before the photo is changed 
      small :: File,
      -- | A big (640x640) user profile photo. The file can be downloaded only before the photo is changed
      big :: File
    }
  deriving (Show, Eq, Generic)
data ChatPhoto
  = -- | Describes the photo of a chat 
  ChatPhoto
    { -- | A small (160x160) chat photo. The file can be downloaded only before the photo is changed 
      small :: File,
      -- | A big (640x640) chat photo. The file can be downloaded only before the photo is changed
      big :: File
    }
  deriving (Show, Eq, Generic)
-- | Represents the type of a user. The following types are possible: regular users, deleted users and bots
data UserType
  = -- | A regular user
  UserTypeRegular
    { 
    }
  | -- | 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
  UserTypeDeleted
    { 
    }
  | -- | A bot (see https://core.telegram.org/bots) 
  UserTypeBot
    { -- | True, if the bot can be invited to basic group and supergroup chats
      canJoinGroups :: Bool,
      -- | 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,
      -- | True, if the bot supports inline queries 
      isInline :: Bool,
      -- | Placeholder for inline queries (displayed on the client input field) 
      inlineQueryPlaceholder :: T,
      -- | True, if the location of the user should be sent with every inline query to this bot
      needLocation :: Bool
    }
  | -- | 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
  UserTypeUnknown
    { 
    }
  deriving (Show, Eq, Generic)
data BotCommand
  = -- | Represents a command supported by a bot 
  BotCommand
    { -- | Text of the bot command 
      command :: T,
      -- | Represents a command supported by a bot 
      description :: T
    }
  deriving (Show, Eq, Generic)
data BotInfo
  = -- | Provides information about a bot and its supported commands 
  BotInfo
    { -- | Provides information about a bot and its supported commands 
      description :: T,
      -- | A list of commands supported by the bot
      commands :: [BotCommand]
    }
  deriving (Show, Eq, Generic)
data ChatLocation
  = -- | Represents a location to which a chat is connected 
  ChatLocation
    { -- | The location 
      location :: Location,
      -- | Location address; 1-64 characters, as defined by the chat owner
      address :: T
    }
  deriving (Show, Eq, Generic)
data User
  = -- | Represents a user 
  User
    { -- | User identifier 
      id :: I32,
      -- | First name of the user 
      firstName :: T,
      -- | Last name of the user 
      lastName :: T,
      -- | Username of the user
      username :: T,
      -- | Phone number of the user 
      phoneNumber :: T,
      -- | Current online status of the user 
      status :: UserStatus,
      -- | Profile photo of the user; may be null
      profilePhoto :: (Maybe) (ProfilePhoto),
      -- | The user is a contact of the current user
      isContact :: Bool,
      -- | The user is a contact of the current user and the current user is a contact of the user
      isMutualContact :: Bool,
      -- | True, if the user is verified 
      isVerified :: Bool,
      -- | True, if the user is Telegram support account
      isSupport :: Bool,
      -- | If non-empty, it contains a human-readable description of the reason why access to this user must be restricted
      restrictionReason :: T,
      -- | True, if many users reported this user as a scam
      isScam :: Bool,
      -- | If false, the user is inaccessible, and the only information known about the user is inside this class. It can't be passed to any method except GetUser 
      haveAccess :: Bool,
      -- | Type of the user 
      type_ :: UserType,
      -- | IETF language tag of the user's language; only available to bots
      languageCode :: T
    }
  deriving (Show, Eq, Generic)
data UserFullInfo
  = -- | Contains full information about a user (except the full list of profile photos) 
  UserFullInfo
    { -- | True, if the user is blacklisted by the current user
      isBlocked :: Bool,
      -- | True, if the user can be called 
      canBeCalled :: Bool,
      -- | True, if the user can't be called due to their privacy settings
      hasPrivateCalls :: Bool,
      -- | 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,
      -- | A short user bio 
      bio :: T,
      -- | For bots, the text that is included with the link when users share the bot 
      shareText :: T,
      -- | Number of group chats where both the other user and the current user are a member; 0 for the current user 
      groupInCommonCount :: I32,
      -- | If the user is a bot, information about the bot; may be null
      botInfo :: (Maybe) (BotInfo)
    }
  deriving (Show, Eq, Generic)
data UserProfilePhoto
  = -- | Contains full information about a user profile photo 
  UserProfilePhoto
    { -- | Unique user profile photo identifier 
      id :: I64,
      -- | Point in time (Unix timestamp) when the photo has been added 
      addedDate :: I32,
      -- | Available variants of the user photo, in different sizes
      sizes :: [PhotoSize]
    }
  deriving (Show, Eq, Generic)
data UserProfilePhotos
  = -- | Contains part of the list of user photos 
  UserProfilePhotos
    { -- | Total number of user profile photos 
      totalCount :: I32,
      -- | A list of photos
      photos :: [UserProfilePhoto]
    }
  deriving (Show, Eq, Generic)
data Users
  = -- | Represents a list of users 
  Users
    { -- | Approximate total count of users found 
      totalCount :: I32,
      -- | A list of user identifiers
      userIds :: [I32]
    }
  deriving (Show, Eq, Generic)
data ChatAdministrator
  = -- | Contains information about a chat administrator 
  ChatAdministrator
    { -- | User identifier of the administrator 
      userId :: I32,
      -- | Custom title of the administrator 
      customTitle :: T,
      -- | True, if the user is the owner of the chat
      isOwner :: Bool
    }
  deriving (Show, Eq, Generic)
data ChatAdministrators
  = -- | Represents a list of chat administrators 
  ChatAdministrators
    { -- | A list of chat administrators
      administrators :: [ChatAdministrator]
    }
  deriving (Show, Eq, Generic)
data ChatPermissions
  = -- | Describes actions that a user is allowed to take in a chat
  ChatPermissions
    { -- | True, if the user can send text messages, contacts, locations, and venues
      canSendMessages :: Bool,
      -- | True, if the user can send audio files, documents, photos, videos, video notes, and voice notes. Implies can_send_messages permissions
      canSendMediaMessages :: Bool,
      -- | True, if the user can send polls. Implies can_send_messages permissions
      canSendPolls :: Bool,
      -- | True, if the user can send animations, games, and stickers and use inline bots. Implies can_send_messages permissions
      canSendOtherMessages :: Bool,
      -- | True, if the user may add a web page preview to their messages. Implies can_send_messages permissions
      canAddWebPagePreviews :: Bool,
      -- | True, if the user can change the chat title, photo, and other settings
      canChangeInfo :: Bool,
      -- | True, if the user can invite new users to the chat
      canInviteUsers :: Bool,
      -- | True, if the user can pin messages
      canPinMessages :: Bool
    }
  deriving (Show, Eq, Generic)
-- | Provides information about the status of a member in a chat
data ChatMemberStatus
  = -- | The user is the owner of a chat and has all the administrator privileges
  ChatMemberStatusCreator
    { -- | A custom title of the owner; 0-16 characters without emojis; applicable to supergroups only
      customTitle :: T,
      -- | True, if the user is a member of the chat
      isMember :: Bool
    }
  | -- | The user is a member of a chat and has some additional privileges. In basic groups, administrators can edit and delete messages sent by others, add new members, and ban unprivileged members. In supergroups and channels, there are more detailed options for administrator privileges
  ChatMemberStatusAdministrator
    { -- | A custom title of the administrator; 0-16 characters without emojis; applicable to supergroups only
      customTitle :: T,
      -- | True, if the current user can edit the administrator privileges for the called user
      canBeEdited :: Bool,
      -- | True, if the administrator can change the chat title, photo, and other settings
      canChangeInfo :: Bool,
      -- | True, if the administrator can create channel posts; applicable to channels only
      canPostMessages :: Bool,
      -- | True, if the administrator can edit messages of other users and pin messages; applicable to channels only
      canEditMessages :: Bool,
      -- | True, if the administrator can delete messages of other users
      canDeleteMessages :: Bool,
      -- | True, if the administrator can invite new users to the chat
      canInviteUsers :: Bool,
      -- | True, if the administrator can restrict, ban, or unban chat members
      canRestrictMembers :: Bool,
      -- | True, if the administrator can pin messages; applicable to groups only
      canPinMessages :: Bool,
      -- | 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
    }
  | -- | The user is a member of a chat, without any additional privileges or restrictions
  ChatMemberStatusMember
    { 
    }
  | -- | The user is under certain restrictions in the chat. Not supported in basic groups and channels
  ChatMemberStatusRestricted
    { -- | True, if the user is a member of the chat
      isMember :: Bool,
      -- | 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 :: I32,
      -- | User permissions in the chat
      permissions :: ChatPermissions
    }
  | -- | The user is not a chat member
  ChatMemberStatusLeft
    { 
    }
  | -- | The user was banned (and hence is not a member of the chat). Implies the user can't return to the chat or view messages
  ChatMemberStatusBanned
    { -- | 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
      bannedUntilDate :: I32
    }
  deriving (Show, Eq, Generic)
data ChatMember
  = -- | A user with information about joining/leaving a chat 
  ChatMember
    { -- | User identifier of the chat member 
      userId :: I32,
      -- | Identifier of a user that invited/promoted/banned this member in the chat; 0 if unknown
      inviterUserId :: I32,
      -- | Point in time (Unix timestamp) when the user joined a chat 
      joinedChatDate :: I32,
      -- | Status of the member in the chat 
      status :: ChatMemberStatus,
      -- | If the user is a bot, information about the bot; may be null. Can be null even for a bot if the bot is not a chat member
      botInfo :: (Maybe) (BotInfo)
    }
  deriving (Show, Eq, Generic)
data ChatMembers
  = -- | Contains a list of chat members 
  ChatMembers
    { -- | Approximate total count of chat members found 
      totalCount :: I32,
      -- | A list of chat members
      members :: [ChatMember]
    }
  deriving (Show, Eq, Generic)
-- | Specifies the kind of chat members to return in searchChatMembers
data ChatMembersFilter
  = -- | Returns contacts of the user
  ChatMembersFilterContacts
    { 
    }
  | -- | Returns the owner and administrators
  ChatMembersFilterAdministrators
    { 
    }
  | -- | Returns all chat members, including restricted chat members
  ChatMembersFilterMembers
    { 
    }
  | -- | Returns users under certain restrictions in the chat; can be used only by administrators in a supergroup
  ChatMembersFilterRestricted
    { 
    }
  | -- | Returns users banned from the chat; can be used only by administrators in a supergroup or in a channel
  ChatMembersFilterBanned
    { 
    }
  | -- | Returns bot members of the chat
  ChatMembersFilterBots
    { 
    }
  deriving (Show, Eq, Generic)
-- | Specifies the kind of chat members to return in getSupergroupMembers
data SupergroupMembersFilter
  = -- | Returns recently active users in reverse chronological order
  SupergroupMembersFilterRecent
    { 
    }
  | -- | Returns contacts of the user, which are members of the supergroup or channel 
  SupergroupMembersFilterContacts
    { -- | Query to search for
      query :: T
    }
  | -- | Returns the owner and administrators
  SupergroupMembersFilterAdministrators
    { 
    }
  | -- | Used to search for supergroup or channel members via a (string) query 
  SupergroupMembersFilterSearch
    { -- | Query to search for
      query :: T
    }
  | -- | Returns restricted supergroup members; can be used only by administrators 
  SupergroupMembersFilterRestricted
    { -- | Query to search for
      query :: T
    }
  | -- | Returns users banned from the supergroup or channel; can be used only by administrators 
  SupergroupMembersFilterBanned
    { -- | Query to search for
      query :: T
    }
  | -- | Returns bot members of the supergroup or channel
  SupergroupMembersFilterBots
    { 
    }
  deriving (Show, Eq, Generic)
data BasicGroup
  = -- | Represents a basic group of 0-200 users (must be upgraded to a supergroup to accommodate more than 200 users)
  BasicGroup
    { -- | Group identifier
      id :: I32,
      -- | Number of members in the group
      memberCount :: I32,
      -- | Status of the current user in the group
      status :: ChatMemberStatus,
      -- | True, if the group is active
      isActive :: Bool,
      -- | Identifier of the supergroup to which this group was upgraded; 0 if none
      upgradedToSupergroupId :: I32
    }
  deriving (Show, Eq, Generic)
data BasicGroupFullInfo
  = -- | Contains full information about a basic group 
  BasicGroupFullInfo
    { -- | Contains full information about a basic group 
      description :: T,
      -- | User identifier of the creator of the group; 0 if unknown 
      creatorUserId :: I32,
      -- | Group members 
      members :: [ChatMember],
      -- | Invite link for this group; available only after it has been generated at least once and only for the group creator
      inviteLink :: T
    }
  deriving (Show, Eq, Generic)
data Supergroup
  = -- | 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
  Supergroup
    { -- | Supergroup or channel identifier
      id :: I32,
      -- | Username of the supergroup or channel; empty for private supergroups or channels
      username :: T,
      -- | 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 :: I32,
      -- | Status of the current user in the supergroup or channel; custom title will be always empty
      status :: ChatMemberStatus,
      -- | 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 found through SearchPublicChats
      memberCount :: I32,
      -- | True, if the channel has a discussion group, or the supergroup is the designated discussion group for a channel
      hasLinkedChat :: Bool,
      -- | True, if the supergroup is connected to a location, i.e. the supergroup is a location-based supergroup
      hasLocation :: Bool,
      -- | True, if messages sent to the channel should contain information about the sender. This field is only applicable to channels
      signMessages :: Bool,
      -- | True, if the slow mode is enabled in the supergroup
      isSlowModeEnabled :: Bool,
      -- | True, if the supergroup is a channel
      isChannel :: Bool,
      -- | True, if the supergroup or channel is verified
      isVerified :: Bool,
      -- | If non-empty, contains a human-readable description of the reason why access to this supergroup or channel must be restricted
      restrictionReason :: T,
      -- | True, if many users reported this supergroup as a scam
      isScam :: Bool
    }
  deriving (Show, Eq, Generic)
data SupergroupFullInfo
  = -- | Contains full information about a supergroup or channel
  SupergroupFullInfo
    { -- | Contains full information about a supergroup or channel
      description :: T,
      -- | Number of members in the supergroup or channel; 0 if unknown
      memberCount :: I32,
      -- | Number of privileged users in the supergroup or channel; 0 if unknown
      administratorCount :: I32,
      -- | Number of restricted users in the supergroup; 0 if unknown
      restrictedCount :: I32,
      -- | Number of users banned from chat; 0 if unknown
      bannedCount :: I32,
      -- | 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 :: I53,
      -- | Delay between consecutive sent messages for non-administrator supergroup members, in seconds
      slowModeDelay :: I32,
      -- | 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 :: Double,
      -- | True, if members of the chat can be retrieved
      canGetMembers :: Bool,
      -- | True, if the chat username can be changed
      canSetUsername :: Bool,
      -- | True, if the supergroup sticker set can be changed
      canSetStickerSet :: Bool,
      -- | True, if the supergroup location can be changed
      canSetLocation :: Bool,
      -- | True, if the channel statistics is available
      canViewStatistics :: Bool,
      -- | True, if new chat members will have access to old messages. In public or discussion groups and both public and private channels, old messages are always available, so this option affects only private supergroups without a linked chat. The value of this field is only available for chat administrators
      isAllHistoryAvailable :: Bool,
      -- | Identifier of the supergroup sticker set; 0 if none
      stickerSetId :: I64,
      -- | Location to which the supergroup is connected; may be null
      location :: (Maybe) (ChatLocation),
      -- | Invite link for this chat
      inviteLink :: T,
      -- | Identifier of the basic group from which supergroup was upgraded; 0 if none
      upgradedFromBasicGroupId :: I32,
      -- | Identifier of the last message in the basic group from which supergroup was upgraded; 0 if none
      upgradedFromMaxMessageId :: I53
    }
  deriving (Show, Eq, Generic)
-- | Describes the current secret chat state
data SecretChatState
  = -- | The secret chat is not yet created; waiting for the other user to get online
  SecretChatStatePending
    { 
    }
  | -- | The secret chat is ready to use
  SecretChatStateReady
    { 
    }
  | -- | The secret chat is closed
  SecretChatStateClosed
    { 
    }
  deriving (Show, Eq, Generic)
data SecretChat
  = -- | Represents a secret chat
  SecretChat
    { -- | Secret chat identifier
      id :: I32,
      -- | Identifier of the chat partner
      userId :: I32,
      -- | State of the secret chat
      state :: SecretChatState,
      -- | True, if the chat was created by the current user; otherwise false
      isOutbound :: Bool,
      -- | Current message Time To Live setting (self-destruct timer) for the chat, in seconds
      ttl :: I32,
      -- | 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.
      keyHash :: ByteString64,
      -- | Secret chat layer; determines features supported by the other client. Video notes are supported if the layer >= 66; nested text entities and underline and strikethrough entities are supported if the layer >= 101
      layer :: I32
    }
  deriving (Show, Eq, Generic)
-- | Contains information about the origin of a forwarded message
data MessageForwardOrigin
  = -- | The message was originally written by a known user 
  MessageForwardOriginUser
    { -- | Identifier of the user that originally sent the message
      senderUserId :: I32
    }
  | -- | The message was originally written by a user, which is hidden by their privacy settings 
  MessageForwardOriginHiddenUser
    { -- | Name of the sender
      senderName :: T
    }
  | -- | The message was originally a post in a channel
  MessageForwardOriginChannel
    { -- | Identifier of the chat from which the message was originally forwarded
      chatId :: I53,
      -- | Message identifier of the original message; 0 if unknown
      messageId :: I53,
      -- | Original post author signature
      authorSignature :: T
    }
  deriving (Show, Eq, Generic)
data MessageForwardInfo
  = -- | Contains information about a forwarded message
  MessageForwardInfo
    { -- | Origin of a forwarded message
      origin :: MessageForwardOrigin,
      -- | Point in time (Unix timestamp) when the message was originally sent
      date :: I32,
      -- | The type of a public service announcement for the forwarded message
      publicServiceAnnouncementType :: T,
      -- | For messages forwarded to the chat with the current user (Saved Messages) or to the channel's discussion group, the identifier of the chat from which the message was forwarded last time; 0 if unknown
      fromChatId :: I53,
      -- | For messages forwarded to the chat with the current user (Saved Messages) 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 :: I53
    }
  deriving (Show, Eq, Generic)
-- | Contains information about the sending state of the message
data MessageSendingState
  = -- | The message is being sent now, but has not yet been delivered to the server
  MessageSendingStatePending
    { 
    }
  | -- | The message failed to be sent 
  MessageSendingStateFailed
    { -- | An error code; 0 if unknown 
      errorCode :: I32,
      -- | Error message
      errorMessage :: T,
      -- | True, if the message can be re-sent 
      canRetry :: Bool,
      -- | Time left before the message can be re-sent, in seconds. No update is sent when this field changes
      retryAfter :: Double
    }
  deriving (Show, Eq, Generic)
data Message
  = -- | Describes a message
  Message
    { -- | Message identifier, unique for the chat to which the message belongs
      id :: I53,
      -- | Identifier of the user who sent the message; 0 if unknown. Currently, it is unknown for channel posts and for channel posts automatically forwarded to discussion group
      senderUserId :: I32,
      -- | Chat identifier
      chatId :: I53,
      -- | Information about the sending state of the message; may be null
      sendingState :: (Maybe) (MessageSendingState),
      -- | Information about the scheduling state of the message; may be null
      schedulingState :: (Maybe) (MessageSchedulingState),
      -- | True, if the message is outgoing
      isOutgoing :: Bool,
      -- | 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 client
      canBeEdited :: Bool,
      -- | True, if the message can be forwarded
      canBeForwarded :: Bool,
      -- | True, if the message can be deleted only for the current user while other users will continue to see it
      canBeDeletedOnlyForSelf :: Bool,
      -- | True, if the message can be deleted for all users
      canBeDeletedForAllUsers :: Bool,
      -- | True, if the message is a channel post. All messages to channels are channel posts, all other messages are not channel posts
      isChannelPost :: Bool,
      -- | True, if the message contains an unread mention for the current user
      containsUnreadMention :: Bool,
      -- | Point in time (Unix timestamp) when the message was sent
      date :: I32,
      -- | Point in time (Unix timestamp) when the message was last edited
      editDate :: I32,
      -- | Information about the initial message sender; may be null
      forwardInfo :: (Maybe) (MessageForwardInfo),
      -- | If non-zero, the identifier of the message this message is replying to; can be the identifier of a deleted message
      replyToMessageId :: I53,
      -- | For self-destructing messages, the message's TTL (Time To Live), in seconds; 0 if none. TDLib will send updateDeleteMessages or updateMessageContent once the TTL expires
      ttl :: I32,
      -- | Time left before the message expires, in seconds
      ttlExpiresIn :: Double,
      -- | If non-zero, the user identifier of the bot through which this message was sent
      viaBotUserId :: I32,
      -- | For channel posts, optional author signature
      authorSignature :: T,
      -- | Number of times this message was viewed
      views :: I32,
      -- | Unique identifier of an album this message belongs to. Only photos and videos can be grouped together in albums
      mediaAlbumId :: I64,
      -- | If non-empty, contains a human-readable description of the reason why access to this message must be restricted
      restrictionReason :: T,
      -- | Content of the message
      content :: MessageContent,
      -- | Reply markup for the message; may be null
      replyMarkup :: (Maybe) (ReplyMarkup)
    }
  deriving (Show, Eq, Generic)
data Messages
  = -- | Contains a list of messages 
  Messages
    { -- | Approximate total count of messages found 
      totalCount :: I32,
      -- | List of messages; messages may be null
      messages :: [(Maybe) (Message)]
    }
  deriving (Show, Eq, Generic)
data FoundMessages
  = -- | Contains a list of messages found by a search 
  FoundMessages
    { -- | List of messages 
      messages :: [Message],
      -- | Value to pass as from_search_id to get more results
      nextFromSearchId :: I64
    }
  deriving (Show, Eq, Generic)
-- | Describes the types of chats to which notification settings are applied
data NotificationSettingsScope
  = -- | Notification settings applied to all private and secret chats when the corresponding chat setting has a default value
  NotificationSettingsScopePrivateChats
    { 
    }
  | -- | Notification settings applied to all basic groups and supergroups when the corresponding chat setting has a default value
  NotificationSettingsScopeGroupChats
    { 
    }
  | -- | Notification settings applied to all channels when the corresponding chat setting has a default value
  NotificationSettingsScopeChannelChats
    { 
    }
  deriving (Show, Eq, Generic)
data ChatNotificationSettings
  = -- | Contains information about notification settings for a chat
  ChatNotificationSettings
    { -- | If true, mute_for is ignored and the value for the relevant type of chat is used instead 
      useDefaultMuteFor :: Bool,
      -- | Time left before notifications will be unmuted, in seconds
      muteFor :: I32,
      -- | If true, sound is ignored and the value for the relevant type of chat is used instead 
      useDefaultSound :: Bool,
      -- | The name of an audio file to be used for notification sounds; only applies to iOS applications
      sound :: T,
      -- | If true, show_preview is ignored and the value for the relevant type of chat is used instead 
      useDefaultShowPreview :: Bool,
      -- | True, if message content should be displayed in notifications
      showPreview :: Bool,
      -- | If true, disable_pinned_message_notifications is ignored and the value for the relevant type of chat is used instead 
      useDefaultDisablePinnedMessageNotifications :: Bool,
      -- | If true, notifications for incoming pinned messages will be created as for an ordinary unread message
      disablePinnedMessageNotifications :: Bool,
      -- | If true, disable_mention_notifications is ignored and the value for the relevant type of chat is used instead 
      useDefaultDisableMentionNotifications :: Bool,
      -- | If true, notifications for messages with mentions will be created as for an ordinary unread message
      disableMentionNotifications :: Bool
    }
  deriving (Show, Eq, Generic)
data ScopeNotificationSettings
  = -- | Contains information about notification settings for several chats
  ScopeNotificationSettings
    { -- | Time left before notifications will be unmuted, in seconds
      muteFor :: I32,
      -- | The name of an audio file to be used for notification sounds; only applies to iOS applications
      sound :: T,
      -- | True, if message content should be displayed in notifications
      showPreview :: Bool,
      -- | True, if notifications for incoming pinned messages will be created as for an ordinary unread message
      disablePinnedMessageNotifications :: Bool,
      -- | True, if notifications for messages with mentions will be created as for an ordinary unread message
      disableMentionNotifications :: Bool
    }
  deriving (Show, Eq, Generic)
data DraftMessage
  = -- | Contains information about a message draft
  DraftMessage
    { -- | Identifier of the message to reply to; 0 if none
      replyToMessageId :: I53,
      -- | Point in time (Unix timestamp) when the draft was created
      date :: I32,
      -- | Content of the message draft; this should always be of type inputMessageText
      inputMessageText :: InputMessageContent
    }
  deriving (Show, Eq, Generic)
-- | Describes the type of a chat
data ChatType
  = -- | An ordinary chat with a user 
  ChatTypePrivate
    { -- | User identifier
      userId :: I32
    }
  | -- | A basic group (i.e., a chat with 0-200 other users) 
  ChatTypeBasicGroup
    { -- | Basic group identifier
      basicGroupId :: I32
    }
  | -- | A supergroup (i.e. a chat with up to GetOption("supergroup_max_size") other users), or channel (with unlimited members) 
  ChatTypeSupergroup
    { -- | Supergroup or channel identifier 
      supergroupId :: I32,
      -- | True, if the supergroup is a channel
      isChannel :: Bool
    }
  | -- | A secret chat with a user 
  ChatTypeSecret
    { -- | Secret chat identifier 
      secretChatId :: I32,
      -- | User identifier of the secret chat peer
      userId :: I32
    }
  deriving (Show, Eq, Generic)
data ChatFilter
  = -- | Represents a filter of user chats
  ChatFilter
    { -- | The title of the filter; 1-12 characters without line feeds
      title :: T,
      -- | The 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".
      iconName :: T,
      -- | The chat identifiers of pinned chats in the filtered chat list
      pinnedChatIds :: [I53],
      -- | The chat identifiers of always included chats in the filtered chat list
      includedChatIds :: [I53],
      -- | The chat identifiers of always excluded chats in the filtered chat list
      excludedChatIds :: [I53],
      -- | True, if the muted chats need to be excluded
      excludeMuted :: Bool,
      -- | True, if read chats need to be excluded
      excludeRead :: Bool,
      -- | True, if archived chats need to be excluded
      excludeArchived :: Bool,
      -- | True, if contacts need to be included
      includeContacts :: Bool,
      -- | True, if non-contact users need to be included
      includeNonContacts :: Bool,
      -- | True, if bots need to be included
      includeBots :: Bool,
      -- | True, if basic groups and supergroups need to be included
      includeGroups :: Bool,
      -- | True, if channels need to be included
      includeChannels :: Bool
    }
  deriving (Show, Eq, Generic)
data ChatFilterInfo
  = -- | Contains basic information about a chat filter
  ChatFilterInfo
    { -- | Unique chat filter identifier
      id :: I32,
      -- | The title of the filter; 1-12 characters without line feeds
      title :: T,
      -- | The icon name for short filter representation. One of "All", "Unread", "Unmuted", "Bots", "Channels", "Groups", "Private", "Custom", "Setup", "Cat", "Crown", "Favorite", "Flower", "Game", "Home", "Love", "Mask", "Party", "Sport", "Study", "Trade", "Travel", "Work"
      iconName :: T
    }
  deriving (Show, Eq, Generic)
data RecommendedChatFilter
  = -- | Describes a recommended chat filter 
  RecommendedChatFilter
    { -- | The chat filter 
      filter :: ChatFilter,
      -- | Describes a recommended chat filter 
      description :: T
    }
  deriving (Show, Eq, Generic)
data RecommendedChatFilters
  = -- | Contains a list of recommended chat filters 
  RecommendedChatFilters
    { -- | List of recommended chat filters
      chatFilters :: [RecommendedChatFilter]
    }
  deriving (Show, Eq, Generic)
-- | Describes a list of chats
data ChatList
  = -- | A main list of chats
  ChatListMain
    { 
    }
  | -- | 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
  ChatListArchive
    { 
    }
  | -- | A list of chats belonging to a chat filter 
  ChatListFilter
    { -- | Chat filter identifier
      chatFilterId :: I32
    }
  deriving (Show, Eq, Generic)
data ChatLists
  = -- | Contains a list of chat lists 
  ChatLists
    { -- | List of chat lists
      chatLists :: [ChatList]
    }
  deriving (Show, Eq, Generic)
-- | Describes a reason why an external chat is shown in a chat list
data ChatSource
  = -- | The chat is sponsored by the user's MTProxy server
  ChatSourceMtprotoProxy
    { 
    }
  | -- | The chat contains a public service announcement 
  ChatSourcePublicServiceAnnouncement
    { -- | The type of the announcement 
      type_ :: T,
      -- | The text of the announcement
      text :: T
    }
  deriving (Show, Eq, Generic)
data ChatPosition
  = -- | Describes a position of a chat in a chat list
  ChatPosition
    { -- | The chat list
      list :: ChatList,
      -- | 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 :: I64,
      -- | True, if the chat is pinned in the chat list
      isPinned :: Bool,
      -- | Source of the chat in the chat list; may be null
      source :: (Maybe) (ChatSource)
    }
  deriving (Show, Eq, Generic)
data Chat
  = -- | A chat. (Can be a private chat, basic group, supergroup, or secret chat)
  Chat
    { -- | Chat unique identifier
      id :: I53,
      -- | Type of the chat
      type_ :: ChatType,
      -- | Chat title
      title :: T,
      -- | Chat photo; may be null
      photo :: (Maybe) (ChatPhoto),
      -- | Actions that non-administrator chat members are allowed to take in the chat
      permissions :: ChatPermissions,
      -- | Last message in the chat; may be null
      lastMessage :: (Maybe) (Message),
      -- | Positions of the chat in chat lists
      positions :: [ChatPosition],
      -- | True, if the chat is marked as unread
      isMarkedAsUnread :: Bool,
      -- | True, if the chat has scheduled messages
      hasScheduledMessages :: Bool,
      -- | True, if the chat messages can be deleted only for the current user while other users will continue to see the messages
      canBeDeletedOnlyForSelf :: Bool,
      -- | True, if the chat messages can be deleted for all users
      canBeDeletedForAllUsers :: Bool,
      -- | True, if the chat can be reported to Telegram moderators through reportChat
      canBeReported :: Bool,
      -- | Default value of the disable_notification parameter, used when a message is sent to the chat
      defaultDisableNotification :: Bool,
      -- | Number of unread messages in the chat
      unreadCount :: I32,
      -- | Identifier of the last read incoming message
      lastReadInboxMessageId :: I53,
      -- | Identifier of the last read outgoing message
      lastReadOutboxMessageId :: I53,
      -- | Number of unread messages with a mention/reply in the chat
      unreadMentionCount :: I32,
      -- | Notification settings for this chat
      notificationSettings :: ChatNotificationSettings,
      -- | Describes actions which should be possible to do through a chat action bar; may be null
      actionBar :: (Maybe) (ChatActionBar),
      -- | Identifier of the pinned message in the chat; 0 if none
      pinnedMessageId :: I53,
      -- | 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 :: I53,
      -- | A draft of a message in the chat; may be null
      draftMessage :: (Maybe) (DraftMessage),
      -- | Contains client-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 :: T
    }
  deriving (Show, Eq, Generic)
data Chats
  = -- | Represents a list of chats 
  Chats
    { -- | List of chat identifiers
      chatIds :: [I53]
    }
  deriving (Show, Eq, Generic)
data ChatNearby
  = -- | Describes a chat located nearby 
  ChatNearby
    { -- | Chat identifier 
      chatId :: I53,
      -- | Distance to the chat location in meters
      distance :: I32
    }
  deriving (Show, Eq, Generic)
data ChatsNearby
  = -- | Represents a list of chats located nearby 
  ChatsNearby
    { -- | List of users nearby 
      usersNearby :: [ChatNearby],
      -- | List of location-based supergroups nearby
      supergroupsNearby :: [ChatNearby]
    }
  deriving (Show, Eq, Generic)
data ChatInviteLink
  = -- | Contains a chat invite link 
  ChatInviteLink
    { -- | Chat invite link
      inviteLink :: T
    }
  deriving (Show, Eq, Generic)
data ChatInviteLinkInfo
  = -- | Contains information about a chat invite link
  ChatInviteLinkInfo
    { -- | Chat identifier of the invite link; 0 if the user is not a member of this chat
      chatId :: I53,
      -- | Contains information about the type of the chat
      type_ :: ChatType,
      -- | Title of the chat
      title :: T,
      -- | Chat photo; may be null
      photo :: (Maybe) (ChatPhoto),
      -- | Number of members in the chat
      memberCount :: I32,
      -- | User identifiers of some chat members that may be known to the current user
      memberUserIds :: [I32],
      -- | 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
    }
  deriving (Show, Eq, Generic)
-- | Describes a type of public chats
data PublicChatType
  = -- | The chat is public, because it has username
  PublicChatTypeHasUsername
    { 
    }
  | -- | The chat is public, because it is a location-based supergroup
  PublicChatTypeIsLocationBased
    { 
    }
  deriving (Show, Eq, Generic)
-- | Describes actions which should be possible to do through a chat action bar
data ChatActionBar
  = -- | The chat can be reported as spam using the method reportChat with the reason chatReportReasonSpam
  ChatActionBarReportSpam
    { 
    }
  | -- | The chat is a location-based supergroup, which can be reported as having unrelated location using the method reportChat with the reason chatReportReasonUnrelatedLocation
  ChatActionBarReportUnrelatedLocation
    { 
    }
  | -- | The chat is a private or secret chat, which can be reported using the method reportChat, or the other user can be added to the contact list using the method addContact, or the other user can be blocked using the method blockUser
  ChatActionBarReportAddBlock
    { 
    }
  | -- | The chat is a private or secret chat and the other user can be added to the contact list using the method addContact
  ChatActionBarAddContact
    { 
    }
  | -- | 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
  ChatActionBarSharePhoneNumber
    { 
    }
  deriving (Show, Eq, Generic)
-- | Describes a keyboard button type
data KeyboardButtonType
  = -- | A simple button, with text that should be sent when the button is pressed
  KeyboardButtonTypeText
    { 
    }
  | -- | A button that sends the user's phone number when pressed; available only in private chats
  KeyboardButtonTypeRequestPhoneNumber
    { 
    }
  | -- | A button that sends the user's location when pressed; available only in private chats
  KeyboardButtonTypeRequestLocation
    { 
    }
  | -- | A button that allows the user to create and send a poll when pressed; available only in private chats 
  KeyboardButtonTypeRequestPoll
    { -- | If true, only regular polls must be allowed to create 
      forceRegular :: Bool,
      -- | If true, only polls in quiz mode must be allowed to create
      forceQuiz :: Bool
    }
  deriving (Show, Eq, Generic)
data KeyboardButton
  = -- | Represents a single button in a bot keyboard 
  KeyboardButton
    { -- | Text of the button 
      text :: T,
      -- | Type of the button
      type_ :: KeyboardButtonType
    }
  deriving (Show, Eq, Generic)
-- | Describes the type of an inline keyboard button
data InlineKeyboardButtonType
  = -- | A button that opens a specified URL 
  InlineKeyboardButtonTypeUrl
    { -- | HTTP or tg:// URL to open
      url :: T
    }
  | -- | A button that opens a specified URL and automatically logs in in current user if they allowed to do that 
  InlineKeyboardButtonTypeLoginUrl
    { -- | An HTTP URL to open 
      url :: T,
      -- | Unique button identifier 
      id :: I32,
      -- | If non-empty, new text of the button in forwarded messages
      forwardText :: T
    }
  | -- | A button that sends a special callback query to a bot 
  InlineKeyboardButtonTypeCallback
    { -- | Data to be sent to the bot via a callback query
      data_ :: ByteString64
    }
  | -- | A button with a game that sends a special 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
  InlineKeyboardButtonTypeCallbackGame
    { 
    }
  | -- | A button that forces an inline query to the bot to be inserted in the input field 
  InlineKeyboardButtonTypeSwitchInline
    { -- | Inline query to be sent to the bot 
      query :: T,
      -- | True, if the inline query should be sent from the current chat
      inCurrentChat :: Bool
    }
  | -- | 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
  InlineKeyboardButtonTypeBuy
    { 
    }
  deriving (Show, Eq, Generic)
data InlineKeyboardButton
  = -- | Represents a single button in an inline keyboard 
  InlineKeyboardButton
    { -- | Text of the button 
      text :: T,
      -- | Type of the button
      type_ :: InlineKeyboardButtonType
    }
  deriving (Show, Eq, Generic)
-- | Contains a description of a custom keyboard and actions that can be done with it to quickly reply to bots
data ReplyMarkup
  = -- | Instructs clients 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
  ReplyMarkupRemoveKeyboard
    { -- | True, if the keyboard is removed only for the mentioned users or the target user of a reply
      isPersonal :: Bool
    }
  | -- | Instructs clients to force a reply to this message
  ReplyMarkupForceReply
    { -- | 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
    }
  | -- | Contains a custom keyboard layout to quickly reply to bots
  ReplyMarkupShowKeyboard
    { -- | A list of rows of bot keyboard buttons
      rows_2 :: [[KeyboardButton]],
      -- | True, if the client needs to resize the keyboard vertically
      resizeKeyboard :: Bool,
      -- | True, if the client needs to hide the keyboard after use
      oneTime :: Bool,
      -- | 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
    }
  | -- | Contains an inline keyboard layout
  ReplyMarkupInlineKeyboard
    { -- | A list of rows of inline keyboard buttons
      rows :: [[InlineKeyboardButton]]
    }
  deriving (Show, Eq, Generic)
-- | Contains information about an inline button of type inlineKeyboardButtonTypeLoginUrl
data LoginUrlInfo
  = -- | An HTTP url needs to be open 
  LoginUrlInfoOpen
    { -- | The URL to open 
      url :: T,
      -- | True, if there is no need to show an ordinary open URL confirm
      skipConfirm :: Bool
    }
  | -- | An authorization confirmation dialog needs to be shown to the user 
  LoginUrlInfoRequestConfirmation
    { -- | An HTTP URL to be opened 
      url :: T,
      -- | A domain of the URL
      domain :: T,
      -- | User identifier of a bot linked with the website 
      botUserId :: I32,
      -- | True, if the user needs to be requested to give the permission to the bot to send them messages
      requestWriteAccess :: Bool
    }
  deriving (Show, Eq, Generic)
-- | Describes a text object inside an instant-view web page
data RichText
  = -- | A plain text 
  RichTextPlain
    { -- | Text
      text_2 :: T
    }
  | -- | A bold rich text 
  RichTextBold
    { -- | Text
      text :: RichText
    }
  | -- | An italicized rich text 
  RichTextItalic
    { -- | Text
      text :: RichText
    }
  | -- | An underlined rich text 
  RichTextUnderline
    { -- | Text
      text :: RichText
    }
  | -- | A strikethrough rich text 
  RichTextStrikethrough
    { -- | Text
      text :: RichText
    }
  | -- | A fixed-width rich text 
  RichTextFixed
    { -- | Text
      text :: RichText
    }
  | -- | A rich text URL link 
  RichTextUrl
    { -- | Text 
      text :: RichText,
      -- | URL 
      url :: T,
      -- | True, if the URL has cached instant view server-side
      isCached :: Bool
    }
  | -- | A rich text email link 
  RichTextEmailAddress
    { -- | Text 
      text :: RichText,
      -- | Email address
      emailAddress :: T
    }
  | -- | A subscript rich text 
  RichTextSubscript
    { -- | Text
      text :: RichText
    }
  | -- | A superscript rich text 
  RichTextSuperscript
    { -- | Text
      text :: RichText
    }
  | -- | A marked rich text 
  RichTextMarked
    { -- | Text
      text :: RichText
    }
  | -- | A rich text phone number 
  RichTextPhoneNumber
    { -- | Text 
      text :: RichText,
      -- | Phone number
      phoneNumber :: T
    }
  | -- | A small image inside the text 
  RichTextIcon
    { -- | The image represented as a document. The image can be in GIF, JPEG or PNG format
      document :: Document,
      -- | Width of a bounding box in which the image should be shown; 0 if unknown
      width :: I32,
      -- | Height of a bounding box in which the image should be shown; 0 if unknown
      height :: I32
    }
  | -- | A rich text reference of a text on the same web page 
  RichTextReference
    { -- | The text 
      text :: RichText,
      -- | The text to show on click 
      referenceText :: RichText,
      -- | An HTTP URL, opening the reference
      url :: T
    }
  | -- | An anchor 
  RichTextAnchor
    { -- | Anchor name
      name :: T
    }
  | -- | A link to an anchor on the same web page 
  RichTextAnchorLink
    { -- | The link text 
      text :: RichText,
      -- | The anchor name. If the name is empty, the link should bring back to top 
      name :: T,
      -- | An HTTP URL, opening the anchor
      url :: T
    }
  | -- | A concatenation of rich texts 
  RichTexts
    { -- | Texts
      texts :: [RichText]
    }
  deriving (Show, Eq, Generic)
data PageBlockCaption
  = -- | Contains a caption of an instant view web page block, consisting of a text and a trailing credit 
  PageBlockCaption
    { -- | Content of the caption 
      text :: RichText,
      -- | Block credit (like HTML tag <cite>)
      credit :: RichText
    }
  deriving (Show, Eq, Generic)
data PageBlockListItem
  = -- | Describes an item of a list page block 
  PageBlockListItem
    { -- | Item label 
      label :: T,
      -- | Item blocks
      pageBlocks :: [PageBlock]
    }
  deriving (Show, Eq, Generic)
-- | Describes a horizontal alignment of a table cell content
data PageBlockHorizontalAlignment
  = -- | The content should be left-aligned
  PageBlockHorizontalAlignmentLeft
    { 
    }
  | -- | The content should be center-aligned
  PageBlockHorizontalAlignmentCenter
    { 
    }
  | -- | The content should be right-aligned
  PageBlockHorizontalAlignmentRight
    { 
    }
  deriving (Show, Eq, Generic)
-- | Describes a Vertical alignment of a table cell content
data PageBlockVerticalAlignment
  = -- | The content should be top-aligned
  PageBlockVerticalAlignmentTop
    { 
    }
  | -- | The content should be middle-aligned
  PageBlockVerticalAlignmentMiddle
    { 
    }
  | -- | The content should be bottom-aligned
  PageBlockVerticalAlignmentBottom
    { 
    }
  deriving (Show, Eq, Generic)
data PageBlockTableCell
  = -- | Represents a cell of a table 
  PageBlockTableCell
    { -- | Cell text; may be null. If the text is null, then the cell should be invisible 
      text :: (Maybe) (RichText),
      -- | True, if it is a header cell
      isHeader :: Bool,
      -- | The number of columns the cell should span 
      colspan :: I32,
      -- | The number of rows the cell should span
      rowspan :: I32,
      -- | Horizontal cell content alignment 
      align :: PageBlockHorizontalAlignment,
      -- | Vertical cell content alignment
      valign :: PageBlockVerticalAlignment
    }
  deriving (Show, Eq, Generic)
data PageBlockRelatedArticle
  = -- | Contains information about a related article 
  PageBlockRelatedArticle
    { -- | Related article URL 
      url :: T,
      -- | Article title; may be empty 
      title :: T,
      -- | Contains information about a related article 
      description :: T,
      -- | Article photo; may be null 
      photo :: (Maybe) (Photo),
      -- | Article author; may be empty 
      author :: T,
      -- | Point in time (Unix timestamp) when the article was published; 0 if unknown
      publishDate :: I32
    }
  deriving (Show, Eq, Generic)
-- | Describes a block of an instant view web page
data PageBlock
  = -- | The title of a page 
  PageBlockTitle
    { -- | Title
      title_2 :: RichText
    }
  | -- | The subtitle of a page 
  PageBlockSubtitle
    { -- | Subtitle
      subtitle :: RichText
    }
  | -- | The author and publishing date of a page 
  PageBlockAuthorDate
    { -- | Author 
      author_2 :: RichText,
      -- | Point in time (Unix timestamp) when the article was published; 0 if unknown
      publishDate :: I32
    }
  | -- | A header 
  PageBlockHeader
    { -- | Header
      header :: RichText
    }
  | -- | A subheader 
  PageBlockSubheader
    { -- | Subheader
      subheader :: RichText
    }
  | -- | A kicker 
  PageBlockKicker
    { -- | Kicker
      kicker :: RichText
    }
  | -- | A text paragraph 
  PageBlockParagraph
    { -- | Paragraph text
      text :: RichText
    }
  | -- | A preformatted text paragraph 
  PageBlockPreformatted
    { -- | Paragraph text 
      text :: RichText,
      -- | Programming language for which the text should be formatted
      language :: T
    }
  | -- | The footer of a page 
  PageBlockFooter
    { -- | Footer
      footer :: RichText
    }
  | -- | An empty block separating a page
  PageBlockDivider
    { 
    }
  | -- | An invisible anchor on a page, which can be used in a URL to open the page from the specified anchor 
  PageBlockAnchor
    { -- | Name of the anchor
      name :: T
    }
  | -- | A list of data blocks 
  PageBlockList
    { -- | The items of the list
      items :: [PageBlockListItem]
    }
  | -- | A block quote 
  PageBlockBlockQuote
    { -- | Quote text 
      text :: RichText,
      -- | Quote credit
      credit :: RichText
    }
  | -- | A pull quote 
  PageBlockPullQuote
    { -- | Quote text 
      text :: RichText,
      -- | Quote credit
      credit :: RichText
    }
  | -- | An animation 
  PageBlockAnimation
    { -- | Animation file; may be null 
      animation :: (Maybe) (Animation),
      -- | Animation caption 
      caption :: PageBlockCaption,
      -- | True, if the animation should be played automatically
      needAutoplay :: Bool
    }
  | -- | An audio file 
  PageBlockAudio
    { -- | Audio file; may be null 
      audio :: (Maybe) (Audio),
      -- | Audio file caption
      caption :: PageBlockCaption
    }
  | -- | A photo 
  PageBlockPhoto
    { -- | Photo file; may be null 
      photo_2 :: (Maybe) (Photo),
      -- | Photo caption 
      caption :: PageBlockCaption,
      -- | URL that needs to be opened when the photo is clicked
      url :: T
    }
  | -- | A video 
  PageBlockVideo
    { -- | Video file; may be null 
      video :: (Maybe) (Video),
      -- | Video caption 
      caption :: PageBlockCaption,
      -- | True, if the video should be played automatically 
      needAutoplay :: Bool,
      -- | True, if the video should be looped
      isLooped :: Bool
    }
  | -- | A voice note 
  PageBlockVoiceNote
    { -- | Voice note; may be null 
      voiceNote :: (Maybe) (VoiceNote),
      -- | Voice note caption
      caption :: PageBlockCaption
    }
  | -- | A page cover 
  PageBlockCover
    { -- | Cover
      cover :: PageBlock
    }
  | -- | An embedded web page 
  PageBlockEmbedded
    { -- | Web page URL, if available 
      url :: T,
      -- | HTML-markup of the embedded page 
      html :: T,
      -- | Poster photo, if available; may be null 
      posterPhoto :: (Maybe) (Photo),
      -- | Block width; 0 if unknown 
      width :: I32,
      -- | Block height; 0 if unknown 
      height :: I32,
      -- | Block caption 
      caption :: PageBlockCaption,
      -- | True, if the block should be full width 
      isFullWidth :: Bool,
      -- | True, if scrolling should be allowed
      allowScrolling :: Bool
    }
  | -- | An embedded post 
  PageBlockEmbeddedPost
    { -- | Web page URL 
      url :: T,
      -- | Post author 
      author :: T,
      -- | Post author photo; may be null 
      authorPhoto :: (Maybe) (Photo),
      -- | Point in time (Unix timestamp) when the post was created; 0 if unknown 
      date :: I32,
      -- | Post content 
      pageBlocks :: [PageBlock],
      -- | Post caption
      caption :: PageBlockCaption
    }
  | -- | A collage 
  PageBlockCollage
    { -- | Collage item contents 
      pageBlocks :: [PageBlock],
      -- | Block caption
      caption :: PageBlockCaption
    }
  | -- | A slideshow 
  PageBlockSlideshow
    { -- | Slideshow item contents 
      pageBlocks :: [PageBlock],
      -- | Block caption
      caption :: PageBlockCaption
    }
  | -- | A link to a chat 
  PageBlockChatLink
    { -- | Chat title 
      title :: T,
      -- | Chat photo; may be null 
      photo :: (Maybe) (ChatPhoto),
      -- | Chat username, by which all other information about the chat should be resolved
      username :: T
    }
  | -- | A table 
  PageBlockTable
    { -- | Table caption 
      caption_2 :: RichText,
      -- | Table cells 
      cells :: [[PageBlockTableCell]],
      -- | True, if the table is bordered 
      isBordered :: Bool,
      -- | True, if the table is striped
      isStriped :: Bool
    }
  | -- | A collapsible block 
  PageBlockDetails
    { -- | Always visible heading for the block 
      header :: RichText,
      -- | Block contents 
      pageBlocks :: [PageBlock],
      -- | True, if the block is open by default
      isOpen :: Bool
    }
  | -- | Related articles 
  PageBlockRelatedArticles
    { -- | Block header 
      header :: RichText,
      -- | List of related articles
      articles :: [PageBlockRelatedArticle]
    }
  | -- | A map 
  PageBlockMap
    { -- | Location of the map center 
      location :: Location,
      -- | Map zoom level 
      zoom :: I32,
      -- | Map width 
      width :: I32,
      -- | Map height 
      height :: I32,
      -- | Block caption
      caption :: PageBlockCaption
    }
  deriving (Show, Eq, Generic)
data WebPageInstantView
  = -- | Describes an instant view page for a web page
  WebPageInstantView
    { -- | Content of the web page
      pageBlocks :: [PageBlock],
      -- | Number of the instant view views; 0 if unknown
      viewCount :: I32,
      -- | Version of the instant view, currently can be 1 or 2
      version :: I32,
      -- | True, if the instant view must be shown from right to left
      isRtl :: Bool,
      -- | 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
    }
  deriving (Show, Eq, Generic)
data WebPage
  = -- | Describes a web page preview
  WebPage
    { -- | Original URL of the link
      url :: T,
      -- | URL to display
      displayUrl :: T,
      -- | Type of the web page. Can be: article, photo, audio, video, document, profile, app, or something else
      type_ :: T,
      -- | Short name of the site (e.g., Google Docs, App Store)
      siteName :: T,
      -- | Title of the content
      title :: T,
      -- | Describes a web page preview
      description :: FormattedText,
      -- | Image representing the content; may be null
      photo :: (Maybe) (Photo),
      -- | URL to show in the embedded preview
      embedUrl :: T,
      -- | MIME type of the embedded preview, (e.g., text/html or video/mp4)
      embedType :: T,
      -- | Width of the embedded preview
      embedWidth :: I32,
      -- | Height of the embedded preview
      embedHeight :: I32,
      -- | Duration of the content, in seconds
      duration :: I32,
      -- | Author of the content
      author :: T,
      -- | Preview of the content as an animation, if available; may be null
      animation :: (Maybe) (Animation),
      -- | Preview of the content as an audio file, if available; may be null
      audio :: (Maybe) (Audio),
      -- | Preview of the content as a document, if available (currently only available for small PDF files and ZIP archives); may be null
      document :: (Maybe) (Document),
      -- | Preview of the content as a sticker for small WEBP files, if available; may be null
      sticker :: (Maybe) (Sticker),
      -- | Preview of the content as a video, if available; may be null
      video :: (Maybe) (Video),
      -- | Preview of the content as a video note, if available; may be null
      videoNote :: (Maybe) (VideoNote),
      -- | Preview of the content as a voice note, if available; may be null
      voiceNote :: (Maybe) (VoiceNote),
      -- | Version of instant view, available for the web page (currently can be 1 or 2), 0 if none
      instantViewVersion :: I32
    }
  deriving (Show, Eq, Generic)
data BankCardActionOpenUrl
  = -- | Describes an action associated with a bank card number 
  BankCardActionOpenUrl
    { -- | Action text 
      text :: T,
      -- | The URL to be opened
      url :: T
    }
  deriving (Show, Eq, Generic)
data BankCardInfo
  = -- | Information about a bank card 
  BankCardInfo
    { -- | Title of the bank card description 
      title :: T,
      -- | Actions that can be done with the bank card number
      actions :: [BankCardActionOpenUrl]
    }
  deriving (Show, Eq, Generic)
data Address
  = -- | Describes an address 
  Address
    { -- | A two-letter ISO 3166-1 alpha-2 country code 
      countryCode :: T,
      -- | State, if applicable 
      state :: T,
      -- | City 
      city :: T,
      -- | First line of the address 
      streetLine1 :: T,
      -- | Second line of the address 
      streetLine2 :: T,
      -- | Address postal code
      postalCode :: T
    }
  deriving (Show, Eq, Generic)
data LabeledPricePart
  = -- | Portion of the price of a product (e.g., "delivery cost", "tax amount") 
  LabeledPricePart
    { -- | Label for this portion of the product price 
      label :: T,
      -- | Currency amount in minimal quantity of the currency
      amount :: I53
    }
  deriving (Show, Eq, Generic)
data Invoice
  = -- | Product invoice 
  Invoice
    { -- | ISO 4217 currency code 
      currency :: T,
      -- | A list of objects used to calculate the total price of the product 
      priceParts :: [LabeledPricePart],
      -- | True, if the payment is a test payment
      isTest :: Bool,
      -- | True, if the user's name is needed for payment 
      needName :: Bool,
      -- | True, if the user's phone number is needed for payment 
      needPhoneNumber :: Bool,
      -- | True, if the user's email address is needed for payment
      needEmailAddress :: Bool,
      -- | True, if the user's shipping address is needed for payment 
      needShippingAddress :: Bool,
      -- | True, if the user's phone number will be sent to the provider
      sendPhoneNumberToProvider :: Bool,
      -- | True, if the user's email address will be sent to the provider 
      sendEmailAddressToProvider :: Bool,
      -- | True, if the total price depends on the shipping method
      isFlexible :: Bool
    }
  deriving (Show, Eq, Generic)
data OrderInfo
  = -- | Order information 
  OrderInfo
    { -- | Name of the user 
      name :: T,
      -- | Phone number of the user 
      phoneNumber :: T,
      -- | Email address of the user 
      emailAddress :: T,
      -- | Shipping address for this order; may be null
      shippingAddress :: (Maybe) (Address)
    }
  deriving (Show, Eq, Generic)
data ShippingOption
  = -- | One shipping option 
  ShippingOption
    { -- | Shipping option identifier 
      id :: T,
      -- | Option title 
      title :: T,
      -- | A list of objects used to calculate the total shipping costs
      priceParts :: [LabeledPricePart]
    }
  deriving (Show, Eq, Generic)
data SavedCredentials
  = -- | Contains information about saved card credentials 
  SavedCredentials
    { -- | Unique identifier of the saved credentials 
      id :: T,
      -- | Title of the saved credentials
      title :: T
    }
  deriving (Show, Eq, Generic)
-- | Contains information about the payment method chosen by the user
data InputCredentials
  = -- | Applies if a user chooses some previously saved payment credentials. To use their previously saved credentials, the user must have a valid temporary password 
  InputCredentialsSaved
    { -- | Identifier of the saved credentials
      savedCredentialsId :: T
    }
  | -- | Applies if a user enters new credentials on a payment provider website 
  InputCredentialsNew
    { -- | Contains JSON-encoded data with a credential identifier from the payment provider 
      data_ :: T,
      -- | True, if the credential identifier can be saved on the server side
      allowSave :: Bool
    }
  | -- | Applies if a user enters new credentials using Android Pay 
  InputCredentialsAndroidPay
    { -- | JSON-encoded data with the credential identifier
      data_ :: T
    }
  | -- | Applies if a user enters new credentials using Apple Pay 
  InputCredentialsApplePay
    { -- | JSON-encoded data with the credential identifier
      data_ :: T
    }
  deriving (Show, Eq, Generic)
data PaymentsProviderStripe
  = -- | Stripe payment provider 
  PaymentsProviderStripe
    { -- | Stripe API publishable key 
      publishableKey :: T,
      -- | True, if the user country must be provided 
      needCountry :: Bool,
      -- | True, if the user ZIP/postal code must be provided 
      needPostalCode :: Bool,
      -- | True, if the cardholder name must be provided
      needCardholderName :: Bool
    }
  deriving (Show, Eq, Generic)
data PaymentForm
  = -- | Contains information about an invoice payment form 
  PaymentForm
    { -- | Full information of the invoice 
      invoice :: Invoice,
      -- | Payment form URL 
      url :: T,
      -- | Contains information about the payment provider, if available, to support it natively without the need for opening the URL; may be null
      paymentsProvider :: (Maybe) (PaymentsProviderStripe),
      -- | Saved server-side order information; may be null 
      savedOrderInfo :: (Maybe) (OrderInfo),
      -- | Contains information about saved card credentials; may be null 
      savedCredentials :: (Maybe) (SavedCredentials),
      -- | True, if the user can choose to save credentials 
      canSaveCredentials :: Bool,
      -- | True, if the user will be able to save credentials protected by a password they set up
      needPassword :: Bool
    }
  deriving (Show, Eq, Generic)
data ValidatedOrderInfo
  = -- | Contains a temporary identifier of validated order information, which is stored for one hour. Also contains the available shipping options 
  ValidatedOrderInfo
    { -- | Temporary identifier of the order information 
      orderInfoId :: T,
      -- | Available shipping options
      shippingOptions :: [ShippingOption]
    }
  deriving (Show, Eq, Generic)
data PaymentResult
  = -- | Contains the result of a payment request 
  PaymentResult
    { -- | True, if the payment request was successful; otherwise the verification_url will be not empty 
      success :: Bool,
      -- | URL for additional payment credentials verification
      verificationUrl :: T
    }
  deriving (Show, Eq, Generic)
data PaymentReceipt
  = -- | Contains information about a successful payment 
  PaymentReceipt
    { -- | Point in time (Unix timestamp) when the payment was made 
      date :: I32,
      -- | User identifier of the payment provider bot 
      paymentsProviderUserId :: I32,
      -- | Contains information about the invoice
      invoice :: Invoice,
      -- | Contains order information; may be null 
      orderInfo :: (Maybe) (OrderInfo),
      -- | Chosen shipping option; may be null 
      shippingOption :: (Maybe) (ShippingOption),
      -- | Title of the saved credentials
      credentialsTitle :: T
    }
  deriving (Show, Eq, Generic)
data DatedFile
  = -- | File with the date it was uploaded 
  DatedFile
    { -- | The file 
      file :: File,
      -- | Point in time (Unix timestamp) when the file was uploaded
      date :: I32
    }
  deriving (Show, Eq, Generic)
-- | Contains the type of a Telegram Passport element
data PassportElementType
  = -- | A Telegram Passport element containing the user's personal details
  PassportElementTypePersonalDetails
    { 
    }
  | -- | A Telegram Passport element containing the user's passport
  PassportElementTypePassport
    { 
    }
  | -- | A Telegram Passport element containing the user's driver license
  PassportElementTypeDriverLicense
    { 
    }
  | -- | A Telegram Passport element containing the user's identity card
  PassportElementTypeIdentityCard
    { 
    }
  | -- | A Telegram Passport element containing the user's internal passport
  PassportElementTypeInternalPassport
    { 
    }
  | -- | A Telegram Passport element containing the user's address
  PassportElementTypeAddress
    { 
    }
  | -- | A Telegram Passport element containing the user's utility bill
  PassportElementTypeUtilityBill
    { 
    }
  | -- | A Telegram Passport element containing the user's bank statement
  PassportElementTypeBankStatement
    { 
    }
  | -- | A Telegram Passport element containing the user's rental agreement
  PassportElementTypeRentalAgreement
    { 
    }
  | -- | A Telegram Passport element containing the registration page of the user's passport
  PassportElementTypePassportRegistration
    { 
    }
  | -- | A Telegram Passport element containing the user's temporary registration
  PassportElementTypeTemporaryRegistration
    { 
    }
  | -- | A Telegram Passport element containing the user's phone number
  PassportElementTypePhoneNumber
    { 
    }
  | -- | A Telegram Passport element containing the user's email address
  PassportElementTypeEmailAddress
    { 
    }
  deriving (Show, Eq, Generic)
data Date
  = -- | Represents a date according to the Gregorian calendar 
  Date
    { -- | Day of the month, 1-31 
      day :: I32,
      -- | Month, 1-12 
      month :: I32,
      -- | Year, 1-9999
      year :: I32
    }
  deriving (Show, Eq, Generic)
data PersonalDetails
  = -- | Contains the user's personal details
  PersonalDetails
    { -- | First name of the user written in English; 1-255 characters 
      firstName :: T,
      -- | Middle name of the user written in English; 0-255 characters 
      middleName :: T,
      -- | Last name of the user written in English; 1-255 characters
      lastName :: T,
      -- | Native first name of the user; 1-255 characters 
      nativeFirstName :: T,
      -- | Native middle name of the user; 0-255 characters 
      nativeMiddleName :: T,
      -- | Native last name of the user; 1-255 characters
      nativeLastName :: T,
      -- | Birthdate of the user 
      birthdate :: Date,
      -- | Gender of the user, "male" or "female" 
      gender :: T,
      -- | A two-letter ISO 3166-1 alpha-2 country code of the user's country 
      countryCode :: T,
      -- | A two-letter ISO 3166-1 alpha-2 country code of the user's residence country
      residenceCountryCode :: T
    }
  deriving (Show, Eq, Generic)
data IdentityDocument
  = -- | An identity document 
  IdentityDocument
    { -- | Document number; 1-24 characters 
      number :: T,
      -- | Document expiry date; may be null 
      expiryDate :: (Maybe) (Date),
      -- | Front side of the document
      frontSide :: DatedFile,
      -- | Reverse side of the document; only for driver license and identity card 
      reverseSide :: DatedFile,
      -- | Selfie with the document; may be null 
      selfie :: (Maybe) (DatedFile),
      -- | List of files containing a certified English translation of the document
      translation :: [DatedFile]
    }
  deriving (Show, Eq, Generic)
data InputIdentityDocument
  = -- | An identity document to be saved to Telegram Passport 
  InputIdentityDocument
    { -- | Document number; 1-24 characters 
      number :: T,
      -- | Document expiry date, if available 
      expiryDate :: Date,
      -- | Front side of the document
      frontSide :: InputFile,
      -- | Reverse side of the document; only for driver license and identity card 
      reverseSide :: InputFile,
      -- | Selfie with the document, if available 
      selfie :: InputFile,
      -- | List of files containing a certified English translation of the document
      translation :: [InputFile]
    }
  deriving (Show, Eq, Generic)
data PersonalDocument
  = -- | A personal document, containing some information about a user 
  PersonalDocument
    { -- | List of files containing the pages of the document 
      files :: [DatedFile],
      -- | List of files containing a certified English translation of the document
      translation :: [DatedFile]
    }
  deriving (Show, Eq, Generic)
data InputPersonalDocument
  = -- | A personal document to be saved to Telegram Passport 
  InputPersonalDocument
    { -- | List of files containing the pages of the document 
      files :: [InputFile],
      -- | List of files containing a certified English translation of the document
      translation :: [InputFile]
    }
  deriving (Show, Eq, Generic)
-- | Contains information about a Telegram Passport element
data PassportElement
  = -- | A Telegram Passport element containing the user's personal details 
  PassportElementPersonalDetails
    { -- | Personal details of the user
      personalDetails :: PersonalDetails
    }
  | -- | A Telegram Passport element containing the user's passport 
  PassportElementPassport
    { -- | Passport
      passport :: IdentityDocument
    }
  | -- | A Telegram Passport element containing the user's driver license 
  PassportElementDriverLicense
    { -- | Driver license
      driverLicense :: IdentityDocument
    }
  | -- | A Telegram Passport element containing the user's identity card 
  PassportElementIdentityCard
    { -- | Identity card
      identityCard :: IdentityDocument
    }
  | -- | A Telegram Passport element containing the user's internal passport 
  PassportElementInternalPassport
    { -- | Internal passport
      internalPassport :: IdentityDocument
    }
  | -- | A Telegram Passport element containing the user's address 
  PassportElementAddress
    { -- | Address
      address :: Address
    }
  | -- | A Telegram Passport element containing the user's utility bill 
  PassportElementUtilityBill
    { -- | Utility bill
      utilityBill :: PersonalDocument
    }
  | -- | A Telegram Passport element containing the user's bank statement 
  PassportElementBankStatement
    { -- | Bank statement
      bankStatement :: PersonalDocument
    }
  | -- | A Telegram Passport element containing the user's rental agreement 
  PassportElementRentalAgreement
    { -- | Rental agreement
      rentalAgreement :: PersonalDocument
    }
  | -- | A Telegram Passport element containing the user's passport registration pages 
  PassportElementPassportRegistration
    { -- | Passport registration pages
      passportRegistration :: PersonalDocument
    }
  | -- | A Telegram Passport element containing the user's temporary registration 
  PassportElementTemporaryRegistration
    { -- | Temporary registration
      temporaryRegistration :: PersonalDocument
    }
  | -- | A Telegram Passport element containing the user's phone number 
  PassportElementPhoneNumber
    { -- | Phone number
      phoneNumber :: T
    }
  | -- | A Telegram Passport element containing the user's email address 
  PassportElementEmailAddress
    { -- | Email address
      emailAddress :: T
    }
  deriving (Show, Eq, Generic)
-- | Contains information about a Telegram Passport element to be saved
data InputPassportElement
  = -- | A Telegram Passport element to be saved containing the user's personal details 
  InputPassportElementPersonalDetails
    { -- | Personal details of the user
      personalDetails :: PersonalDetails
    }
  | -- | A Telegram Passport element to be saved containing the user's passport 
  InputPassportElementPassport
    { -- | The passport to be saved
      passport :: InputIdentityDocument
    }
  | -- | A Telegram Passport element to be saved containing the user's driver license 
  InputPassportElementDriverLicense
    { -- | The driver license to be saved
      driverLicense :: InputIdentityDocument
    }
  | -- | A Telegram Passport element to be saved containing the user's identity card 
  InputPassportElementIdentityCard
    { -- | The identity card to be saved
      identityCard :: InputIdentityDocument
    }
  | -- | A Telegram Passport element to be saved containing the user's internal passport 
  InputPassportElementInternalPassport
    { -- | The internal passport to be saved
      internalPassport :: InputIdentityDocument
    }
  | -- | A Telegram Passport element to be saved containing the user's address 
  InputPassportElementAddress
    { -- | The address to be saved
      address :: Address
    }
  | -- | A Telegram Passport element to be saved containing the user's utility bill 
  InputPassportElementUtilityBill
    { -- | The utility bill to be saved
      utilityBill :: InputPersonalDocument
    }
  | -- | A Telegram Passport element to be saved containing the user's bank statement 
  InputPassportElementBankStatement
    { -- | The bank statement to be saved
      bankStatement :: InputPersonalDocument
    }
  | -- | A Telegram Passport element to be saved containing the user's rental agreement 
  InputPassportElementRentalAgreement
    { -- | The rental agreement to be saved
      rentalAgreement :: InputPersonalDocument
    }
  | -- | A Telegram Passport element to be saved containing the user's passport registration 
  InputPassportElementPassportRegistration
    { -- | The passport registration page to be saved
      passportRegistration :: InputPersonalDocument
    }
  | -- | A Telegram Passport element to be saved containing the user's temporary registration 
  InputPassportElementTemporaryRegistration
    { -- | The temporary registration document to be saved
      temporaryRegistration :: InputPersonalDocument
    }
  | -- | A Telegram Passport element to be saved containing the user's phone number 
  InputPassportElementPhoneNumber
    { -- | The phone number to be saved
      phoneNumber :: T
    }
  | -- | A Telegram Passport element to be saved containing the user's email address 
  InputPassportElementEmailAddress
    { -- | The email address to be saved
      emailAddress :: T
    }
  deriving (Show, Eq, Generic)
data PassportElements
  = -- | Contains information about saved Telegram Passport elements 
  PassportElements
    { -- | Telegram Passport elements
      elements :: [PassportElement]
    }
  deriving (Show, Eq, Generic)
-- | Contains the description of an error in a Telegram Passport element
data PassportElementErrorSource
  = -- | The element contains an error in an unspecified place. The error will be considered resolved when new data is added
  PassportElementErrorSourceUnspecified
    { 
    }
  | -- | One of the data fields contains an error. The error will be considered resolved when the value of the field changes 
  PassportElementErrorSourceDataField
    { -- | Field name
      fieldName :: T
    }
  | -- | The front side of the document contains an error. The error will be considered resolved when the file with the front side changes
  PassportElementErrorSourceFrontSide
    { 
    }
  | -- | The reverse side of the document contains an error. The error will be considered resolved when the file with the reverse side changes
  PassportElementErrorSourceReverseSide
    { 
    }
  | -- | The selfie with the document contains an error. The error will be considered resolved when the file with the selfie changes
  PassportElementErrorSourceSelfie
    { 
    }
  | -- | One of files with the translation of the document contains an error. The error will be considered resolved when the file changes 
  PassportElementErrorSourceTranslationFile
    { -- | Index of a file with the error
      fileIndex :: I32
    }
  | -- | The translation of the document contains an error. The error will be considered resolved when the list of translation files changes
  PassportElementErrorSourceTranslationFiles
    { 
    }
  | -- | The file contains an error. The error will be considered resolved when the file changes 
  PassportElementErrorSourceFile
    { -- | Index of a file with the error
      fileIndex :: I32
    }
  | -- | The list of attached files contains an error. The error will be considered resolved when the list of files changes
  PassportElementErrorSourceFiles
    { 
    }
  deriving (Show, Eq, Generic)
data PassportElementError
  = -- | Contains the description of an error in a Telegram Passport element 
  PassportElementError
    { -- | Type of the Telegram Passport element which has the error 
      type_ :: PassportElementType,
      -- | Error message 
      message :: T,
      -- | Error source
      source :: PassportElementErrorSource
    }
  deriving (Show, Eq, Generic)
data PassportSuitableElement
  = -- | Contains information about a Telegram Passport element that was requested by a service 
  PassportSuitableElement
    { -- | Type of the element 
      type_ :: PassportElementType,
      -- | True, if a selfie is required with the identity document
      isSelfieRequired :: Bool,
      -- | True, if a certified English translation is required with the document 
      isTranslationRequired :: Bool,
      -- | True, if personal details must include the user's name in the language of their country of residence
      isNativeNameRequired :: Bool
    }
  deriving (Show, Eq, Generic)
data PassportRequiredElement
  = -- | Contains a description of the required Telegram Passport element that was requested by a service 
  PassportRequiredElement
    { -- | List of Telegram Passport elements any of which is enough to provide
      suitableElements :: [PassportSuitableElement]
    }
  deriving (Show, Eq, Generic)
data PassportAuthorizationForm
  = -- | Contains information about a Telegram Passport authorization form that was requested 
  PassportAuthorizationForm
    { -- | Unique identifier of the authorization form
      id :: I32,
      -- | Information about the Telegram Passport elements that need to be provided to complete the form
      requiredElements :: [PassportRequiredElement],
      -- | URL for the privacy policy of the service; may be empty
      privacyPolicyUrl :: T
    }
  deriving (Show, Eq, Generic)
data PassportElementsWithErrors
  = -- | Contains information about a Telegram Passport elements and corresponding errors 
  PassportElementsWithErrors
    { -- | Telegram Passport elements 
      elements :: [PassportElement],
      -- | Errors in the elements that are already available
      errors :: [PassportElementError]
    }
  deriving (Show, Eq, Generic)
data EncryptedCredentials
  = -- | Contains encrypted Telegram Passport data credentials 
  EncryptedCredentials
    { -- | The encrypted credentials 
      data_ :: ByteString64,
      -- | The decrypted data hash 
      hash :: ByteString64,
      -- | Secret for data decryption, encrypted with the service's public key
      secret :: ByteString64
    }
  deriving (Show, Eq, Generic)
data EncryptedPassportElement
  = -- | Contains information about an encrypted Telegram Passport element; for bots only 
  EncryptedPassportElement
    { -- | Type of Telegram Passport element 
      type_ :: PassportElementType,
      -- | Encrypted JSON-encoded data about the user 
      data_ :: ByteString64,
      -- | The front side of an identity document 
      frontSide :: DatedFile,
      -- | The reverse side of an identity document; may be null 
      reverseSide :: (Maybe) (DatedFile),
      -- | Selfie with the document; may be null 
      selfie :: (Maybe) (DatedFile),
      -- | List of files containing a certified English translation of the document 
      translation :: [DatedFile],
      -- | List of attached files 
      files :: [DatedFile],
      -- | Unencrypted data, phone number or email address 
      value :: T,
      -- | Hash of the entire element
      hash :: T
    }
  deriving (Show, Eq, Generic)
-- | Contains the description of an error in a Telegram Passport element; for bots only
data InputPassportElementErrorSource
  = -- | The element contains an error in an unspecified place. The error will be considered resolved when new data is added 
  InputPassportElementErrorSourceUnspecified
    { -- | Current hash of the entire element
      elementHash :: ByteString64
    }
  | -- | A data field contains an error. The error is considered resolved when the field's value changes 
  InputPassportElementErrorSourceDataField
    { -- | Field name 
      fieldName :: T,
      -- | Current data hash
      dataHash :: ByteString64
    }
  | -- | 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 
  InputPassportElementErrorSourceFrontSide
    { -- | Current hash of the file containing the front side
      fileHash :: ByteString64
    }
  | -- | 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 
  InputPassportElementErrorSourceReverseSide
    { -- | Current hash of the file containing the reverse side
      fileHash :: ByteString64
    }
  | -- | The selfie contains an error. The error is considered resolved when the file with the selfie changes 
  InputPassportElementErrorSourceSelfie
    { -- | Current hash of the file containing the selfie
      fileHash :: ByteString64
    }
  | -- | 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 
  InputPassportElementErrorSourceTranslationFile
    { -- | Current hash of the file containing the translation
      fileHash :: ByteString64
    }
  | -- | The translation of the document contains an error. The error is considered resolved when the list of files changes 
  InputPassportElementErrorSourceTranslationFiles
    { -- | Current hashes of all files with the translation
      fileHashes :: [ByteString64]
    }
  | -- | The file contains an error. The error is considered resolved when the file changes 
  InputPassportElementErrorSourceFile
    { -- | Current hash of the file which has the error
      fileHash :: ByteString64
    }
  | -- | The list of attached files contains an error. The error is considered resolved when the file list changes 
  InputPassportElementErrorSourceFiles
    { -- | Current hashes of all attached files
      fileHashes :: [ByteString64]
    }
  deriving (Show, Eq, Generic)
data InputPassportElementError
  = -- | Contains the description of an error in a Telegram Passport element; for bots only 
  InputPassportElementError
    { -- | Type of Telegram Passport element that has the error 
      type_ :: PassportElementType,
      -- | Error message 
      message :: T,
      -- | Error source
      source :: InputPassportElementErrorSource
    }
  deriving (Show, Eq, Generic)
-- | Contains the content of a message
data MessageContent
  = -- | A text message 
  MessageText
    { -- | Text of the message 
      text_2 :: FormattedText,
      -- | A preview of the web page that's mentioned in the text; may be null
      webPage :: (Maybe) (WebPage)
    }
  | -- | An animation message (GIF-style). 
  MessageAnimation
    { -- | The animation description 
      animation :: Animation,
      -- | Animation caption 
      caption :: FormattedText,
      -- | True, if the animation thumbnail must be blurred and the animation must be shown only while tapped
      isSecret :: Bool
    }
  | -- | An audio message 
  MessageAudio
    { -- | The audio description 
      audio :: Audio,
      -- | Audio caption
      caption :: FormattedText
    }
  | -- | A document message (general file) 
  MessageDocument
    { -- | The document description 
      document :: Document,
      -- | Document caption
      caption :: FormattedText
    }
  | -- | A photo message 
  MessagePhoto
    { -- | The photo description 
      photo :: Photo,
      -- | Photo caption 
      caption :: FormattedText,
      -- | True, if the photo must be blurred and must be shown only while tapped
      isSecret :: Bool
    }
  | -- | An expired photo message (self-destructed after TTL has elapsed)
  MessageExpiredPhoto
    { 
    }
  | -- | A sticker message 
  MessageSticker
    { -- | The sticker description
      sticker :: Sticker
    }
  | -- | A video message 
  MessageVideo
    { -- | The video description 
      video :: Video,
      -- | Video caption 
      caption :: FormattedText,
      -- | True, if the video thumbnail must be blurred and the video must be shown only while tapped
      isSecret :: Bool
    }
  | -- | An expired video message (self-destructed after TTL has elapsed)
  MessageExpiredVideo
    { 
    }
  | -- | A video note message 
  MessageVideoNote
    { -- | The video note description 
      videoNote :: VideoNote,
      -- | True, if at least one of the recipients has viewed the video note 
      isViewed :: Bool,
      -- | True, if the video note thumbnail must be blurred and the video note must be shown only while tapped
      isSecret :: Bool
    }
  | -- | A voice note message 
  MessageVoiceNote
    { -- | The voice note description 
      voiceNote :: VoiceNote,
      -- | Voice note caption 
      caption :: FormattedText,
      -- | True, if at least one of the recipients has listened to the voice note
      isListened :: Bool
    }
  | -- | A message with a location 
  MessageLocation
    { -- | The location description 
      location :: Location,
      -- | Time relative to the message sent date until which the location can be updated, in seconds
      livePeriod :: I32,
      -- | Left time for which the location can be updated, in seconds. updateMessageContent is not sent when this field changes
      expiresIn :: I32
    }
  | -- | A message with information about a venue 
  MessageVenue
    { -- | The venue description
      venue :: Venue
    }
  | -- | A message with a user contact 
  MessageContact
    { -- | The contact description
      contact :: Contact
    }
  | -- | A dice message. The dice value is randomly generated by the server
  MessageDice
    { -- | The animated sticker with the initial dice animation; may be null if unknown. updateMessageContent will be sent when the sticker became known
      initialStateSticker :: (Maybe) (Sticker),
      -- | The animated sticker with the final dice animation; may be null if unknown. updateMessageContent will be sent when the sticker became known
      finalStateSticker :: (Maybe) (Sticker),
      -- | Emoji on which the dice throw animation is based
      emoji :: T,
      -- | The dice value. If the value is 0, the dice don't have final state yet
      value :: I32,
      -- | Number of frame after which a success animation like a shower of confetti needs to be shown on updateMessageSendSucceeded
      successAnimationFrameNumber :: I32
    }
  | -- | A message with a game 
  MessageGame
    { -- | The game description
      game :: Game
    }
  | -- | A message with a poll 
  MessagePoll
    { -- | The poll description
      poll :: Poll
    }
  | -- | A message with an invoice from a bot 
  MessageInvoice
    { -- | Product title 
      title :: T,
      -- | A message with an invoice from a bot 
      description :: T,
      -- | Product photo; may be null 
      photo_2 :: (Maybe) (Photo),
      -- | Currency for the product price 
      currency :: T,
      -- | Product total price in the minimal quantity of the currency
      totalAmount :: I53,
      -- | Unique invoice bot start_parameter. To share an invoice use the URL https://t.me/{bot_username}?start={start_parameter} 
      startParameter :: T,
      -- | True, if the invoice is a test invoice
      isTest :: Bool,
      -- | True, if the shipping address should be specified 
      needShippingAddress :: Bool,
      -- | The identifier of the message with the receipt, after the product has been purchased
      receiptMessageId :: I53
    }
  | -- | A message with information about an ended call 
  MessageCall
    { -- | Reason why the call was discarded 
      discardReason :: CallDiscardReason,
      -- | Call duration, in seconds
      duration :: I32
    }
  | -- | A newly created basic group 
  MessageBasicGroupChatCreate
    { -- | Title of the basic group 
      title :: T,
      -- | User identifiers of members in the basic group
      memberUserIds :: [I32]
    }
  | -- | A newly created supergroup or channel 
  MessageSupergroupChatCreate
    { -- | Title of the supergroup or channel
      title :: T
    }
  | -- | An updated chat title 
  MessageChatChangeTitle
    { -- | New chat title
      title :: T
    }
  | -- | An updated chat photo 
  MessageChatChangePhoto
    { -- | New chat photo
      photo :: Photo
    }
  | -- | A deleted chat photo
  MessageChatDeletePhoto
    { 
    }
  | -- | New chat members were added 
  MessageChatAddMembers
    { -- | User identifiers of the new members
      memberUserIds :: [I32]
    }
  | -- | A new member joined the chat by invite link
  MessageChatJoinByLink
    { 
    }
  | -- | A chat member was deleted 
  MessageChatDeleteMember
    { -- | User identifier of the deleted chat member
      userId :: I32
    }
  | -- | A basic group was upgraded to a supergroup and was deactivated as the result 
  MessageChatUpgradeTo
    { -- | Identifier of the supergroup to which the basic group was upgraded
      supergroupId :: I32
    }
  | -- | A supergroup has been created from a basic group 
  MessageChatUpgradeFrom
    { -- | Title of the newly created supergroup 
      title :: T,
      -- | The identifier of the original basic group
      basicGroupId :: I32
    }
  | -- | A message has been pinned 
  MessagePinMessage
    { -- | Identifier of the pinned message, can be an identifier of a deleted message or 0
      messageId :: I53
    }
  | -- | A screenshot of a message in the chat has been taken
  MessageScreenshotTaken
    { 
    }
  | -- | The TTL (Time To Live) setting messages in a secret chat has been changed 
  MessageChatSetTtl
    { -- | New TTL
      ttl :: I32
    }
  | -- | A non-standard action has happened in the chat 
  MessageCustomServiceAction
    { -- | Message text to be shown in the chat
      text :: T
    }
  | -- | A new high score was achieved in a game 
  MessageGameScore
    { -- | Identifier of the message with the game, can be an identifier of a deleted message 
      gameMessageId :: I53,
      -- | Identifier of the game; may be different from the games presented in the message with the game 
      gameId :: I64,
      -- | New score
      score :: I32
    }
  | -- | A payment has been completed 
  MessagePaymentSuccessful
    { -- | Identifier of the message with the corresponding invoice; can be an identifier of a deleted message 
      invoiceMessageId :: I53,
      -- | Currency for the price of the product 
      currency :: T,
      -- | Total price for the product, in the minimal quantity of the currency
      totalAmount :: I53
    }
  | -- | A payment has been completed; for bots only 
  MessagePaymentSuccessfulBot
    { -- | Identifier of the message with the corresponding invoice; can be an identifier of a deleted message 
      invoiceMessageId :: I53,
      -- | Currency for price of the product
      currency :: T,
      -- | Total price for the product, in the minimal quantity of the currency 
      totalAmount :: I53,
      -- | Invoice payload 
      invoicePayload :: ByteString64,
      -- | Identifier of the shipping option chosen by the user; may be empty if not applicable 
      shippingOptionId :: T,
      -- | Information about the order; may be null
      orderInfo :: (Maybe) (OrderInfo),
      -- | Telegram payment identifier 
      telegramPaymentChargeId :: T,
      -- | Provider payment identifier
      providerPaymentChargeId :: T
    }
  | -- | A contact has registered with Telegram
  MessageContactRegistered
    { 
    }
  | -- | The current user has connected a website by logging in using Telegram Login Widget on it 
  MessageWebsiteConnected
    { -- | Domain name of the connected website
      domainName :: T
    }
  | -- | Telegram Passport data has been sent 
  MessagePassportDataSent
    { -- | List of Telegram Passport element types sent
      types :: [PassportElementType]
    }
  | -- | Telegram Passport data has been received; for bots only 
  MessagePassportDataReceived
    { -- | List of received Telegram Passport elements 
      elements :: [EncryptedPassportElement],
      -- | Encrypted data credentials
      credentials :: EncryptedCredentials
    }
  | -- | Message content that is not supported by the client
  MessageUnsupported
    { 
    }
  deriving (Show, Eq, Generic)
-- | Represents a part of the text which must be formatted differently
data TextEntityType
  = -- | A mention of a user by their username
  TextEntityTypeMention
    { 
    }
  | -- | A hashtag text, beginning with "#"
  TextEntityTypeHashtag
    { 
    }
  | -- | A cashtag text, beginning with "$" and consisting of capital english letters (i.e. "$USD")
  TextEntityTypeCashtag
    { 
    }
  | -- | A bot command, beginning with "/". This shouldn't be highlighted if there are no bots in the chat
  TextEntityTypeBotCommand
    { 
    }
  | -- | An HTTP URL
  TextEntityTypeUrl
    { 
    }
  | -- | An email address
  TextEntityTypeEmailAddress
    { 
    }
  | -- | A phone number
  TextEntityTypePhoneNumber
    { 
    }
  | -- | A bank card number. The getBankCardInfo method can be used to get information about the bank card
  TextEntityTypeBankCardNumber
    { 
    }
  | -- | A bold text
  TextEntityTypeBold
    { 
    }
  | -- | An italic text
  TextEntityTypeItalic
    { 
    }
  | -- | An underlined text
  TextEntityTypeUnderline
    { 
    }
  | -- | A strikethrough text
  TextEntityTypeStrikethrough
    { 
    }
  | -- | Text that must be formatted as if inside a code HTML tag
  TextEntityTypeCode
    { 
    }
  | -- | Text that must be formatted as if inside a pre HTML tag
  TextEntityTypePre
    { 
    }
  | -- | Text that must be formatted as if inside pre, and code HTML tags 
  TextEntityTypePreCode
    { -- | Programming language of the code; as defined by the sender
      language :: T
    }
  | -- | A text description shown instead of a raw URL 
  TextEntityTypeTextUrl
    { -- | HTTP or tg:// URL to be opened when the link is clicked
      url :: T
    }
  | -- | A text shows instead of a raw mention of the user (e.g., when the user has no username) 
  TextEntityTypeMentionName
    { -- | Identifier of the mentioned user
      userId :: I32
    }
  deriving (Show, Eq, Generic)
data InputThumbnail
  = -- | A thumbnail to be sent along with a file; should be in JPEG or WEBP format for stickers, and less than 200 KB in size 
  InputThumbnail
    { -- | Thumbnail file to send. Sending thumbnails by file_id is currently not supported
      thumbnail :: InputFile,
      -- | Thumbnail width, usually shouldn't exceed 320. Use 0 if unknown 
      width :: I32,
      -- | Thumbnail height, usually shouldn't exceed 320. Use 0 if unknown
      height :: I32
    }
  deriving (Show, Eq, Generic)
-- | Contains information about the time when a scheduled message will be sent
data MessageSchedulingState
  = -- | The message will be sent at the specified date 
  MessageSchedulingStateSendAtDate
    { -- | Date the message will be sent. The date must be within 367 days in the future
      sendDate :: I32
    }
  | -- | 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
  MessageSchedulingStateSendWhenOnline
    { 
    }
  deriving (Show, Eq, Generic)
data SendMessageOptions
  = -- | Options to be used when a message is send
  SendMessageOptions
    { -- | Pass true to disable notification for the message. Must be false if the message is sent to a secret chat
      disableNotification :: Bool,
      -- | Pass true if the message is sent from the background
      fromBackground :: Bool,
      -- | Message scheduling state. Messages sent to a secret chat, live location messages and self-destructing messages can't be scheduled
      schedulingState :: MessageSchedulingState
    }
  deriving (Show, Eq, Generic)
-- | The content of a message to send
data InputMessageContent
  = -- | A text message 
  InputMessageText
    { -- | Formatted text to be sent; 1-GetOption("message_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Code, Pre, PreCode, TextUrl and MentionName entities are allowed to be specified manually
      text :: FormattedText,
      -- | True, if rich web page previews for URLs in the message text should be disabled 
      disableWebPagePreview :: Bool,
      -- | True, if a chat message draft should be deleted
      clearDraft :: Bool
    }
  | -- | An animation message (GIF-style). 
  InputMessageAnimation
    { -- | Animation file to be sent 
      animation :: InputFile,
      -- | Animation thumbnail, if available 
      thumbnail :: InputThumbnail,
      -- | File identifiers of the stickers added to the animation, if applicable
      addedStickerFileIds :: [I32],
      -- | Duration of the animation, in seconds 
      duration :: I32,
      -- | Width of the animation; may be replaced by the server 
      width :: I32,
      -- | Height of the animation; may be replaced by the server 
      height :: I32,
      -- | Animation caption; 0-GetOption("message_caption_length_max") characters
      caption :: FormattedText
    }
  | -- | An audio message 
  InputMessageAudio
    { -- | Audio file to be sent 
      audio :: InputFile,
      -- | Thumbnail of the cover for the album, if available 
      albumCoverThumbnail :: InputThumbnail,
      -- | Duration of the audio, in seconds; may be replaced by the server 
      duration :: I32,
      -- | Title of the audio; 0-64 characters; may be replaced by the server
      title :: T,
      -- | Performer of the audio; 0-64 characters, may be replaced by the server 
      performer :: T,
      -- | Audio caption; 0-GetOption("message_caption_length_max") characters
      caption :: FormattedText
    }
  | -- | A document message (general file) 
  InputMessageDocument
    { -- | Document to be sent 
      document :: InputFile,
      -- | Document thumbnail, if available 
      thumbnail :: InputThumbnail,
      -- | Document caption; 0-GetOption("message_caption_length_max") characters
      caption :: FormattedText
    }
  | -- | A photo message 
  InputMessagePhoto
    { -- | Photo to send 
      photo :: InputFile,
      -- | Photo thumbnail to be sent, this is sent to the other party in secret chats only 
      thumbnail :: InputThumbnail,
      -- | File identifiers of the stickers added to the photo, if applicable 
      addedStickerFileIds :: [I32],
      -- | Photo width 
      width :: I32,
      -- | Photo height 
      height :: I32,
      -- | Photo caption; 0-GetOption("message_caption_length_max") characters
      caption :: FormattedText,
      -- | Photo TTL (Time To Live), in seconds (0-60). A non-zero TTL can be specified only in private chats
      ttl :: I32
    }
  | -- | A sticker message 
  InputMessageSticker
    { -- | Sticker to be sent 
      sticker :: InputFile,
      -- | Sticker thumbnail, if available 
      thumbnail :: InputThumbnail,
      -- | Sticker width 
      width :: I32,
      -- | Sticker height
      height :: I32
    }
  | -- | A video message 
  InputMessageVideo
    { -- | Video to be sent 
      video :: InputFile,
      -- | Video thumbnail, if available 
      thumbnail :: InputThumbnail,
      -- | File identifiers of the stickers added to the video, if applicable
      addedStickerFileIds :: [I32],
      -- | Duration of the video, in seconds 
      duration :: I32,
      -- | Video width 
      width :: I32,
      -- | Video height 
      height :: I32,
      -- | True, if the video should be tried to be streamed
      supportsStreaming :: Bool,
      -- | Video caption; 0-GetOption("message_caption_length_max") characters 
      caption :: FormattedText,
      -- | Video TTL (Time To Live), in seconds (0-60). A non-zero TTL can be specified only in private chats
      ttl :: I32
    }
  | -- | A video note message 
  InputMessageVideoNote
    { -- | Video note to be sent 
      videoNote :: InputFile,
      -- | Video thumbnail, if available 
      thumbnail :: InputThumbnail,
      -- | Duration of the video, in seconds 
      duration :: I32,
      -- | Video width and height; must be positive and not greater than 640
      length :: I32
    }
  | -- | A voice note message 
  InputMessageVoiceNote
    { -- | Voice note to be sent 
      voiceNote :: InputFile,
      -- | Duration of the voice note, in seconds 
      duration :: I32,
      -- | Waveform representation of the voice note, in 5-bit format 
      waveform :: ByteString64,
      -- | Voice note caption; 0-GetOption("message_caption_length_max") characters
      caption :: FormattedText
    }
  | -- | A message with a location 
  InputMessageLocation
    { -- | Location to be sent 
      location :: Location,
      -- | Period for which the location can be updated, in seconds; should be between 60 and 86400 for a live location and 0 otherwise
      livePeriod :: I32
    }
  | -- | A message with information about a venue 
  InputMessageVenue
    { -- | Venue to send
      venue :: Venue
    }
  | -- | A message containing a user contact 
  InputMessageContact
    { -- | Contact to send
      contact :: Contact
    }
  | -- | A dice message 
  InputMessageDice
    { -- | Emoji on which the dice throw animation is based 
      emoji :: T,
      -- | True, if a chat message draft should be deleted
      clearDraft :: Bool
    }
  | -- | A message with a game; not supported for channels or secret chats 
  InputMessageGame
    { -- | User identifier of the bot that owns the game 
      botUserId :: I32,
      -- | Short name of the game
      gameShortName :: T
    }
  | -- | A message with an invoice; can be used only by bots and only in private chats 
  InputMessageInvoice
    { -- | Invoice 
      invoice :: Invoice,
      -- | Product title; 1-32 characters 
      title :: T,
      -- | A message with an invoice; can be used only by bots and only in private chats 
      description :: T,
      -- | Product photo URL; optional 
      photoUrl :: T,
      -- | Product photo size 
      photoSize :: I32,
      -- | Product photo width 
      photoWidth :: I32,
      -- | Product photo height
      photoHeight :: I32,
      -- | The invoice payload 
      payload :: ByteString64,
      -- | Payment provider token 
      providerToken :: T,
      -- | JSON-encoded data about the invoice, which will be shared with the payment provider 
      providerData :: T,
      -- | Unique invoice bot start_parameter for the generation of this invoice
      startParameter :: T
    }
  | -- | 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 
  InputMessagePoll
    { -- | Poll question, 1-255 characters 
      question :: T,
      -- | List of poll answer options, 2-10 strings 1-100 characters each
      options :: [T],
      -- | True, if the poll voters are anonymous. Non-anonymous polls can't be sent or forwarded to channels 
      isAnonymous :: Bool,
      -- | Type of the poll
      type_ :: PollType,
      -- | Amount of time the poll will be active after creation, in seconds; for bots only
      openPeriod :: I32,
      -- | Point in time (Unix timestamp) when the poll will be automatically closed; for bots only
      closeDate :: I32,
      -- | True, if the poll needs to be sent already closed; for bots only
      isClosed :: Bool
    }
  | -- | A forwarded message 
  InputMessageForwarded
    { -- | Identifier for the chat this forwarded message came from 
      fromChatId :: I53,
      -- | Identifier of the message to forward
      messageId :: I53,
      -- | True, if a game message should be shared within a launched game; applies only to game messages
      inGameShare :: Bool,
      -- | True, if content of the message needs to be copied without a link to the original message. Always true if the message is forwarded to a secret chat
      sendCopy :: Bool,
      -- | True, if media caption of the message copy needs to be removed. Ignored if send_copy is false
      removeCaption :: Bool
    }
  deriving (Show, Eq, Generic)
-- | Represents a filter for message search results
data SearchMessagesFilter
  = -- | Returns all found messages, no filter is applied
  SearchMessagesFilterEmpty
    { 
    }
  | -- | Returns only animation messages
  SearchMessagesFilterAnimation
    { 
    }
  | -- | Returns only audio messages
  SearchMessagesFilterAudio
    { 
    }
  | -- | Returns only document messages
  SearchMessagesFilterDocument
    { 
    }
  | -- | Returns only photo messages
  SearchMessagesFilterPhoto
    { 
    }
  | -- | Returns only video messages
  SearchMessagesFilterVideo
    { 
    }
  | -- | Returns only voice note messages
  SearchMessagesFilterVoiceNote
    { 
    }
  | -- | Returns only photo and video messages
  SearchMessagesFilterPhotoAndVideo
    { 
    }
  | -- | Returns only messages containing URLs
  SearchMessagesFilterUrl
    { 
    }
  | -- | Returns only messages containing chat photos
  SearchMessagesFilterChatPhoto
    { 
    }
  | -- | Returns only call messages
  SearchMessagesFilterCall
    { 
    }
  | -- | Returns only incoming call messages with missed/declined discard reasons
  SearchMessagesFilterMissedCall
    { 
    }
  | -- | Returns only video note messages
  SearchMessagesFilterVideoNote
    { 
    }
  | -- | Returns only voice and video note messages
  SearchMessagesFilterVoiceAndVideoNote
    { 
    }
  | -- | Returns only messages with mentions of the current user, or messages that are replies to their messages
  SearchMessagesFilterMention
    { 
    }
  | -- | 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 or by the sending user
  SearchMessagesFilterUnreadMention
    { 
    }
  | -- | Returns only failed to send messages. This filter can be used only if the message database is used
  SearchMessagesFilterFailedToSend
    { 
    }
  deriving (Show, Eq, Generic)
-- | Describes the different types of activity in a chat
data ChatAction
  = -- | The user is typing a message
  ChatActionTyping
    { 
    }
  | -- | The user is recording a video
  ChatActionRecordingVideo
    { 
    }
  | -- | The user is uploading a video 
  ChatActionUploadingVideo
    { -- | Upload progress, as a percentage
      progress :: I32
    }
  | -- | The user is recording a voice note
  ChatActionRecordingVoiceNote
    { 
    }
  | -- | The user is uploading a voice note 
  ChatActionUploadingVoiceNote
    { -- | Upload progress, as a percentage
      progress :: I32
    }
  | -- | The user is uploading a photo 
  ChatActionUploadingPhoto
    { -- | Upload progress, as a percentage
      progress :: I32
    }
  | -- | The user is uploading a document 
  ChatActionUploadingDocument
    { -- | Upload progress, as a percentage
      progress :: I32
    }
  | -- | The user is picking a location or venue to send
  ChatActionChoosingLocation
    { 
    }
  | -- | The user is picking a contact to send
  ChatActionChoosingContact
    { 
    }
  | -- | The user has started to play a game
  ChatActionStartPlayingGame
    { 
    }
  | -- | The user is recording a video note
  ChatActionRecordingVideoNote
    { 
    }
  | -- | The user is uploading a video note 
  ChatActionUploadingVideoNote
    { -- | Upload progress, as a percentage
      progress :: I32
    }
  | -- | The user has cancelled the previous action
  ChatActionCancel
    { 
    }
  deriving (Show, Eq, Generic)
-- | Describes the last time the user was online
data UserStatus
  = -- | The user status was never changed
  UserStatusEmpty
    { 
    }
  | -- | The user is online 
  UserStatusOnline
    { -- | Point in time (Unix timestamp) when the user's online status will expire
      expires :: I32
    }
  | -- | The user is offline 
  UserStatusOffline
    { -- | Point in time (Unix timestamp) when the user was last online
      wasOnline :: I32
    }
  | -- | The user was online recently
  UserStatusRecently
    { 
    }
  | -- | The user is offline, but was online last week
  UserStatusLastWeek
    { 
    }
  | -- | The user is offline, but was online last month
  UserStatusLastMonth
    { 
    }
  deriving (Show, Eq, Generic)
data Stickers
  = -- | Represents a list of stickers 
  Stickers
    { -- | List of stickers
      stickers :: [Sticker]
    }
  deriving (Show, Eq, Generic)
data Emojis
  = -- | Represents a list of emoji 
  Emojis
    { -- | List of emojis
      emojis :: [T]
    }
  deriving (Show, Eq, Generic)
data StickerSet
  = -- | Represents a sticker set
  StickerSet
    { -- | Identifier of the sticker set 
      id :: I64,
      -- | Title of the sticker set 
      title :: T,
      -- | Name of the sticker set 
      name :: T,
      -- | Sticker set thumbnail in WEBP or TGS format with width and height 100; may be null. The file can be downloaded only before the thumbnail is changed
      thumbnail :: (Maybe) (Thumbnail),
      -- | True, if the sticker set has been installed by the current user 
      isInstalled :: Bool,
      -- | True, if the sticker set has been archived. A sticker set can't be installed and archived simultaneously
      isArchived :: Bool,
      -- | True, if the sticker set is official 
      isOfficial :: Bool,
      -- | True, is the stickers in the set are animated 
      isAnimated :: Bool,
      -- | True, if the stickers in the set are masks 
      isMasks :: Bool,
      -- | True for already viewed trending sticker sets
      isViewed :: Bool,
      -- | List of stickers in this set 
      stickers :: [Sticker],
      -- | 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]
    }
  deriving (Show, Eq, Generic)
data StickerSetInfo
  = -- | Represents short information about a sticker set
  StickerSetInfo
    { -- | Identifier of the sticker set 
      id :: I64,
      -- | Title of the sticker set 
      title :: T,
      -- | Name of the sticker set 
      name :: T,
      -- | Sticker set thumbnail in WEBP or TGS format with width and height 100; may be null
      thumbnail :: (Maybe) (Thumbnail),
      -- | True, if the sticker set has been installed by current user 
      isInstalled :: Bool,
      -- | True, if the sticker set has been archived. A sticker set can't be installed and archived simultaneously
      isArchived :: Bool,
      -- | True, if the sticker set is official 
      isOfficial :: Bool,
      -- | True, is the stickers in the set are animated 
      isAnimated :: Bool,
      -- | True, if the stickers in the set are masks 
      isMasks :: Bool,
      -- | True for already viewed trending sticker sets
      isViewed :: Bool,
      -- | Total number of stickers in the set 
      size :: I32,
      -- | Contains up to the first 5 stickers from the set, depending on the context. If the client needs more stickers the full set should be requested
      covers :: [Sticker]
    }
  deriving (Show, Eq, Generic)
data StickerSets
  = -- | Represents a list of sticker sets 
  StickerSets
    { -- | Approximate total number of sticker sets found 
      totalCount :: I32,
      -- | List of sticker sets
      sets :: [StickerSetInfo]
    }
  deriving (Show, Eq, Generic)
-- | Describes the reason why a call was discarded
data CallDiscardReason
  = -- | The call wasn't discarded, or the reason is unknown
  CallDiscardReasonEmpty
    { 
    }
  | -- | The call was ended before the conversation started. It was cancelled by the caller or missed by the other party
  CallDiscardReasonMissed
    { 
    }
  | -- | The call was ended before the conversation started. It was declined by the other party
  CallDiscardReasonDeclined
    { 
    }
  | -- | The call was ended during the conversation because the users were disconnected
  CallDiscardReasonDisconnected
    { 
    }
  | -- | The call was ended because one of the parties hung up
  CallDiscardReasonHungUp
    { 
    }
  deriving (Show, Eq, Generic)
data CallProtocol
  = -- | Specifies the supported call protocols
  CallProtocol
    { -- | True, if UDP peer-to-peer connections are supported
      udpP2p :: Bool,
      -- | True, if connection through UDP reflectors is supported
      udpReflector :: Bool,
      -- | The minimum supported API layer; use 65
      minLayer :: I32,
      -- | The maximum supported API layer; use 65
      maxLayer :: I32,
      -- | List of supported libtgvoip versions
      libraryVersions :: [T]
    }
  deriving (Show, Eq, Generic)
data CallConnection
  = -- | Describes the address of UDP reflectors 
  CallConnection
    { -- | Reflector identifier 
      id :: I64,
      -- | IPv4 reflector address 
      ip :: T,
      -- | IPv6 reflector address 
      ipv6 :: T,
      -- | Reflector port number 
      port :: I32,
      -- | Connection peer tag
      peerTag :: ByteString64
    }
  deriving (Show, Eq, Generic)
data CallId
  = -- | Contains the call identifier 
  CallId
    { -- | Call identifier
      id :: I32
    }
  deriving (Show, Eq, Generic)
-- | Describes the current call state
data CallState
  = -- | The call is pending, waiting to be accepted by a user 
  CallStatePending
    { -- | True, if the call has already been created by the server 
      isCreated :: Bool,
      -- | True, if the call has already been received by the other party
      isReceived :: Bool
    }
  | -- | The call has been answered and encryption keys are being exchanged
  CallStateExchangingKeys
    { 
    }
  | -- | The call is ready to use 
  CallStateReady
    { -- | Call protocols supported by the peer 
      protocol :: CallProtocol,
      -- | Available UDP reflectors 
      connections :: [CallConnection],
      -- | A JSON-encoded call config 
      config :: T,
      -- | Call encryption key 
      encryptionKey :: ByteString64,
      -- | Encryption key emojis fingerprint 
      emojis :: [T],
      -- | True, if peer-to-peer connection is allowed by users privacy settings
      allowP2p :: Bool
    }
  | -- | The call is hanging up after discardCall has been called
  CallStateHangingUp
    { 
    }
  | -- | The call has ended successfully 
  CallStateDiscarded
    { -- | The reason, why the call has ended 
      reason :: CallDiscardReason,
      -- | True, if the call rating should be sent to the server 
      needRating :: Bool,
      -- | True, if the call debug information should be sent to the server
      needDebugInformation :: Bool
    }
  | -- | The call has ended with an error 
  CallStateError
    { -- | Error. An error with the code 4005000 will be returned if an outgoing call is missed because of an expired timeout
      error :: Error
    }
  deriving (Show, Eq, Generic)
-- | Describes the exact type of a problem with a call
data CallProblem
  = -- | The user heard their own voice
  CallProblemEcho
    { 
    }
  | -- | The user heard background noise
  CallProblemNoise
    { 
    }
  | -- | The other side kept disappearing
  CallProblemInterruptions
    { 
    }
  | -- | The speech was distorted
  CallProblemDistortedSpeech
    { 
    }
  | -- | The user couldn't hear the other side
  CallProblemSilentLocal
    { 
    }
  | -- | The other side couldn't hear the user
  CallProblemSilentRemote
    { 
    }
  | -- | The call ended unexpectedly
  CallProblemDropped
    { 
    }
  deriving (Show, Eq, Generic)
data Call
  = -- | Describes a call 
  Call
    { -- | Call identifier, not persistent 
      id :: I32,
      -- | Peer user identifier 
      userId :: I32,
      -- | True, if the call is outgoing 
      isOutgoing :: Bool,
      -- | Call state
      state :: CallState
    }
  deriving (Show, Eq, Generic)
data PhoneNumberAuthenticationSettings
  = -- | Contains settings for the authentication of the user's phone number
  PhoneNumberAuthenticationSettings
    { -- | Pass true if the authentication code may be sent via flash call to the specified phone number
      allowFlashCall :: Bool,
      -- | Pass true if the authenticated phone number is used on the current device
      isCurrentPhoneNumber :: Bool,
      -- | For official applications only. True, if the app 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
    }
  deriving (Show, Eq, Generic)
data Animations
  = -- | Represents a list of animations 
  Animations
    { -- | List of animations
      animations :: [Animation]
    }
  deriving (Show, Eq, Generic)
data ImportedContacts
  = -- | Represents the result of an ImportContacts request 
  ImportedContacts
    { -- | 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 :: [I32],
      -- | The number of users that imported the corresponding contact; 0 for already registered users or if unavailable
      importerCount :: [I32]
    }
  deriving (Show, Eq, Generic)
data HttpUrl
  = -- | Contains an HTTP URL 
  HttpUrl
    { -- | The URL
      url :: T
    }
  deriving (Show, Eq, Generic)
-- | Represents a single result of an inline query; for bots only
data InputInlineQueryResult
  = -- | Represents a link to an animated GIF or an animated (i.e. without sound) H.264/MPEG-4 AVC video
  InputInlineQueryResultAnimation
    { -- | Unique identifier of the query result 
      id :: T,
      -- | Title of the query result
      title :: T,
      -- | URL of the result thumbnail (JPEG, GIF, or MPEG4), if it exists 
      thumbnailUrl :: T,
      -- | MIME type of the video thumbnail. If non-empty, must be one of "image/jpeg", "image/gif" and "video/mp4"
      thumbnailMimeType :: T,
      -- | The URL of the video file (file size must not exceed 1MB) 
      videoUrl :: T,
      -- | MIME type of the video file. Must be one of "image/gif" and "video/mp4"
      videoMimeType :: T,
      -- | Duration of the video, in seconds 
      videoDuration :: I32,
      -- | Width of the video 
      videoWidth :: I32,
      -- | Height of the video
      videoHeight :: I32,
      -- | The message reply markup. Must be of type replyMarkupInlineKeyboard or null
      replyMarkup :: ReplyMarkup,
      -- | The content of the message to be sent. Must be one of the following types: InputMessageText, InputMessageAnimation, InputMessageLocation, InputMessageVenue or InputMessageContact
      inputMessageContent :: InputMessageContent
    }
  | -- | Represents a link to an article or web page 
  InputInlineQueryResultArticle
    { -- | Unique identifier of the query result 
      id :: T,
      -- | URL of the result, if it exists 
      url :: T,
      -- | True, if the URL must be not shown 
      hideUrl :: Bool,
      -- | Title of the result
      title :: T,
      -- | Represents a link to an article or web page 
      description :: T,
      -- | URL of the result thumbnail, if it exists 
      thumbnailUrl :: T,
      -- | Thumbnail width, if known 
      thumbnailWidth :: I32,
      -- | Thumbnail height, if known
      thumbnailHeight :: I32,
      -- | The message reply markup. Must be of type replyMarkupInlineKeyboard or null
      replyMarkup :: ReplyMarkup,
      -- | The content of the message to be sent. Must be one of the following types: InputMessageText, InputMessageLocation, InputMessageVenue or InputMessageContact
      inputMessageContent :: InputMessageContent
    }
  | -- | Represents a link to an MP3 audio file 
  InputInlineQueryResultAudio
    { -- | Unique identifier of the query result 
      id :: T,
      -- | Title of the audio file 
      title :: T,
      -- | Performer of the audio file
      performer :: T,
      -- | The URL of the audio file 
      audioUrl :: T,
      -- | Audio file duration, in seconds
      audioDuration :: I32,
      -- | The message reply markup. Must be of type replyMarkupInlineKeyboard or null
      replyMarkup :: ReplyMarkup,
      -- | The content of the message to be sent. Must be one of the following types: InputMessageText, InputMessageAudio, InputMessageLocation, InputMessageVenue or InputMessageContact
      inputMessageContent :: InputMessageContent
    }
  | -- | Represents a user contact 
  InputInlineQueryResultContact
    { -- | Unique identifier of the query result 
      id :: T,
      -- | User contact 
      contact :: Contact,
      -- | URL of the result thumbnail, if it exists 
      thumbnailUrl :: T,
      -- | Thumbnail width, if known 
      thumbnailWidth :: I32,
      -- | Thumbnail height, if known
      thumbnailHeight :: I32,
      -- | The message reply markup. Must be of type replyMarkupInlineKeyboard or null
      replyMarkup :: ReplyMarkup,
      -- | The content of the message to be sent. Must be one of the following types: InputMessageText, InputMessageLocation, InputMessageVenue or InputMessageContact
      inputMessageContent :: InputMessageContent
    }
  | -- | Represents a link to a file 
  InputInlineQueryResultDocument
    { -- | Unique identifier of the query result 
      id :: T,
      -- | Title of the resulting file 
      title :: T,
      -- | Represents a link to a file 
      description :: T,
      -- | URL of the file 
      documentUrl :: T,
      -- | MIME type of the file content; only "application/pdf" and "application/zip" are currently allowed
      mimeType :: T,
      -- | The URL of the file thumbnail, if it exists 
      thumbnailUrl :: T,
      -- | Width of the thumbnail 
      thumbnailWidth :: I32,
      -- | Height of the thumbnail
      thumbnailHeight :: I32,
      -- | The message reply markup. Must be of type replyMarkupInlineKeyboard or null
      replyMarkup :: ReplyMarkup,
      -- | The content of the message to be sent. Must be one of the following types: InputMessageText, InputMessageDocument, InputMessageLocation, InputMessageVenue or InputMessageContact
      inputMessageContent :: InputMessageContent
    }
  | -- | Represents a game 
  InputInlineQueryResultGame
    { -- | Unique identifier of the query result 
      id :: T,
      -- | Short name of the game 
      gameShortName :: T,
      -- | Message reply markup. Must be of type replyMarkupInlineKeyboard or null
      replyMarkup :: ReplyMarkup
    }
  | -- | Represents a point on the map 
  InputInlineQueryResultLocation
    { -- | Unique identifier of the query result 
      id :: T,
      -- | Location result 
      location :: Location,
      -- | Amount of time relative to the message sent time until the location can be updated, in seconds 
      livePeriod :: I32,
      -- | Title of the result 
      title :: T,
      -- | URL of the result thumbnail, if it exists 
      thumbnailUrl :: T,
      -- | Thumbnail width, if known 
      thumbnailWidth :: I32,
      -- | Thumbnail height, if known
      thumbnailHeight :: I32,
      -- | The message reply markup. Must be of type replyMarkupInlineKeyboard or null
      replyMarkup :: ReplyMarkup,
      -- | The content of the message to be sent. Must be one of the following types: InputMessageText, InputMessageLocation, InputMessageVenue or InputMessageContact
      inputMessageContent :: InputMessageContent
    }
  | -- | Represents link to a JPEG image 
  InputInlineQueryResultPhoto
    { -- | Unique identifier of the query result 
      id :: T,
      -- | Title of the result, if known 
      title :: T,
      -- | Represents link to a JPEG image 
      description :: T,
      -- | URL of the photo thumbnail, if it exists
      thumbnailUrl :: T,
      -- | The URL of the JPEG photo (photo size must not exceed 5MB) 
      photoUrl :: T,
      -- | Width of the photo 
      photoWidth :: I32,
      -- | Height of the photo
      photoHeight :: I32,
      -- | The message reply markup. Must be of type replyMarkupInlineKeyboard or null
      replyMarkup :: ReplyMarkup,
      -- | The content of the message to be sent. Must be one of the following types: InputMessageText, InputMessagePhoto, InputMessageLocation, InputMessageVenue or InputMessageContact
      inputMessageContent :: InputMessageContent
    }
  | -- | Represents a link to a WEBP or TGS sticker 
  InputInlineQueryResultSticker
    { -- | Unique identifier of the query result 
      id :: T,
      -- | URL of the sticker thumbnail, if it exists
      thumbnailUrl :: T,
      -- | The URL of the WEBP or TGS sticker (sticker file size must not exceed 5MB) 
      stickerUrl :: T,
      -- | Width of the sticker 
      stickerWidth :: I32,
      -- | Height of the sticker
      stickerHeight :: I32,
      -- | The message reply markup. Must be of type replyMarkupInlineKeyboard or null
      replyMarkup :: ReplyMarkup,
      -- | The content of the message to be sent. Must be one of the following types: InputMessageText, inputMessageSticker, InputMessageLocation, InputMessageVenue or InputMessageContact
      inputMessageContent :: InputMessageContent
    }
  | -- | Represents information about a venue 
  InputInlineQueryResultVenue
    { -- | Unique identifier of the query result 
      id :: T,
      -- | Venue result 
      venue :: Venue,
      -- | URL of the result thumbnail, if it exists 
      thumbnailUrl :: T,
      -- | Thumbnail width, if known 
      thumbnailWidth :: I32,
      -- | Thumbnail height, if known
      thumbnailHeight :: I32,
      -- | The message reply markup. Must be of type replyMarkupInlineKeyboard or null
      replyMarkup :: ReplyMarkup,
      -- | The content of the message to be sent. Must be one of the following types: InputMessageText, InputMessageLocation, InputMessageVenue or InputMessageContact
      inputMessageContent :: InputMessageContent
    }
  | -- | Represents a link to a page containing an embedded video player or a video file 
  InputInlineQueryResultVideo
    { -- | Unique identifier of the query result 
      id :: T,
      -- | Title of the result 
      title :: T,
      -- | Represents a link to a page containing an embedded video player or a video file 
      description :: T,
      -- | The URL of the video thumbnail (JPEG), if it exists 
      thumbnailUrl :: T,
      -- | URL of the embedded video player or video file 
      videoUrl :: T,
      -- | MIME type of the content of the video URL, only "text/html" or "video/mp4" are currently supported
      mimeType :: T,
      -- | Width of the video 
      videoWidth :: I32,
      -- | Height of the video 
      videoHeight :: I32,
      -- | Video duration, in seconds
      videoDuration :: I32,
      -- | The message reply markup. Must be of type replyMarkupInlineKeyboard or null
      replyMarkup :: ReplyMarkup,
      -- | The content of the message to be sent. Must be one of the following types: InputMessageText, InputMessageVideo, InputMessageLocation, InputMessageVenue or InputMessageContact
      inputMessageContent :: InputMessageContent
    }
  | -- | Represents a link to an opus-encoded audio file within an OGG container, single channel audio 
  InputInlineQueryResultVoiceNote
    { -- | Unique identifier of the query result 
      id :: T,
      -- | Title of the voice note
      title :: T,
      -- | The URL of the voice note file 
      voiceNoteUrl :: T,
      -- | Duration of the voice note, in seconds
      voiceNoteDuration :: I32,
      -- | The message reply markup. Must be of type replyMarkupInlineKeyboard or null
      replyMarkup :: ReplyMarkup,
      -- | The content of the message to be sent. Must be one of the following types: InputMessageText, InputMessageVoiceNote, InputMessageLocation, InputMessageVenue or InputMessageContact
      inputMessageContent :: InputMessageContent
    }
  deriving (Show, Eq, Generic)
-- | Represents a single result of an inline query
data InlineQueryResult
  = -- | Represents a link to an article or web page 
  InlineQueryResultArticle
    { -- | Unique identifier of the query result 
      id :: T,
      -- | URL of the result, if it exists 
      url :: T,
      -- | True, if the URL must be not shown 
      hideUrl :: Bool,
      -- | Title of the result
      title :: T,
      -- | Represents a link to an article or web page 
      description :: T,
      -- | Result thumbnail in JPEG format; may be null
      thumbnail :: (Maybe) (Thumbnail)
    }
  | -- | Represents a user contact 
  InlineQueryResultContact
    { -- | Unique identifier of the query result 
      id :: T,
      -- | A user contact 
      contact :: Contact,
      -- | Result thumbnail in JPEG format; may be null
      thumbnail :: (Maybe) (Thumbnail)
    }
  | -- | Represents a point on the map 
  InlineQueryResultLocation
    { -- | Unique identifier of the query result 
      id :: T,
      -- | Location result 
      location :: Location,
      -- | Title of the result 
      title :: T,
      -- | Result thumbnail in JPEG format; may be null
      thumbnail :: (Maybe) (Thumbnail)
    }
  | -- | Represents information about a venue 
  InlineQueryResultVenue
    { -- | Unique identifier of the query result 
      id :: T,
      -- | Venue result 
      venue :: Venue,
      -- | Result thumbnail in JPEG format; may be null
      thumbnail :: (Maybe) (Thumbnail)
    }
  | -- | Represents information about a game 
  InlineQueryResultGame
    { -- | Unique identifier of the query result 
      id :: T,
      -- | Game result
      game :: Game
    }
  | -- | Represents an animation file 
  InlineQueryResultAnimation
    { -- | Unique identifier of the query result 
      id :: T,
      -- | Animation file 
      animation :: Animation,
      -- | Animation title
      title :: T
    }
  | -- | Represents an audio file 
  InlineQueryResultAudio
    { -- | Unique identifier of the query result 
      id :: T,
      -- | Audio file
      audio :: Audio
    }
  | -- | Represents a document 
  InlineQueryResultDocument
    { -- | Unique identifier of the query result 
      id :: T,
      -- | Document 
      document :: Document,
      -- | Document title 
      title :: T,
      -- | Represents a document 
      description :: T
    }
  | -- | Represents a photo 
  InlineQueryResultPhoto
    { -- | Unique identifier of the query result 
      id :: T,
      -- | Photo 
      photo :: Photo,
      -- | Title of the result, if known 
      title :: T,
      -- | Represents a photo 
      description :: T
    }
  | -- | Represents a sticker 
  InlineQueryResultSticker
    { -- | Unique identifier of the query result 
      id :: T,
      -- | Sticker
      sticker :: Sticker
    }
  | -- | Represents a video 
  InlineQueryResultVideo
    { -- | Unique identifier of the query result 
      id :: T,
      -- | Video 
      video :: Video,
      -- | Title of the video 
      title :: T,
      -- | Represents a video 
      description :: T
    }
  | -- | Represents a voice note 
  InlineQueryResultVoiceNote
    { -- | Unique identifier of the query result 
      id :: T,
      -- | Voice note 
      voiceNote :: VoiceNote,
      -- | Title of the voice note
      title :: T
    }
  deriving (Show, Eq, Generic)
data InlineQueryResults
  = -- | Represents the results of the inline query. Use sendInlineQueryResultMessage to send the result of the query 
  InlineQueryResults
    { -- | Unique identifier of the inline query 
      inlineQueryId :: I64,
      -- | The offset for the next request. If empty, there are no more results 
      nextOffset :: T,
      -- | Results of the query
      results :: [InlineQueryResult],
      -- | If non-empty, this text should 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 :: T,
      -- | Parameter for the bot start message
      switchPmParameter :: T
    }
  deriving (Show, Eq, Generic)
-- | Represents a payload of a callback query
data CallbackQueryPayload
  = -- | The payload from a general callback button 
  CallbackQueryPayloadData
    { -- | Data that was attached to the callback button
      data_ :: ByteString64
    }
  | -- | The payload from a game callback button 
  CallbackQueryPayloadGame
    { -- | A short name of the game that was attached to the callback button
      gameShortName :: T
    }
  deriving (Show, Eq, Generic)
data CallbackQueryAnswer
  = -- | Contains a bot's answer to a callback query 
  CallbackQueryAnswer
    { -- | Text of the answer 
      text :: T,
      -- | True, if an alert should be shown to the user instead of a toast notification 
      showAlert :: Bool,
      -- | URL to be opened
      url :: T
    }
  deriving (Show, Eq, Generic)
data CustomRequestResult
  = -- | Contains the result of a custom request 
  CustomRequestResult
    { -- | A JSON-serialized result
      result :: T
    }
  deriving (Show, Eq, Generic)
data GameHighScore
  = -- | Contains one row of the game high score table 
  GameHighScore
    { -- | Position in the high score table 
      position :: I32,
      -- | User identifier 
      userId :: I32,
      -- | User score
      score :: I32
    }
  deriving (Show, Eq, Generic)
data GameHighScores
  = -- | Contains a list of game high scores 
  GameHighScores
    { -- | A list of game high scores
      scores :: [GameHighScore]
    }
  deriving (Show, Eq, Generic)
-- | Represents a chat event
data ChatEventAction
  = -- | A message was edited 
  ChatEventMessageEdited
    { -- | The original message before the edit 
      oldMessage :: Message,
      -- | The message after it was edited
      newMessage :: Message
    }
  | -- | A message was deleted 
  ChatEventMessageDeleted
    { -- | Deleted message
      message :: Message
    }
  | -- | A poll in a message was stopped 
  ChatEventPollStopped
    { -- | The message with the poll
      message :: Message
    }
  | -- | A message was pinned 
  ChatEventMessagePinned
    { -- | Pinned message
      message :: Message
    }
  | -- | A message was unpinned
  ChatEventMessageUnpinned
    { 
    }
  | -- | A new member joined the chat
  ChatEventMemberJoined
    { 
    }
  | -- | A member left the chat
  ChatEventMemberLeft
    { 
    }
  | -- | A new chat member was invited 
  ChatEventMemberInvited
    { -- | New member user identifier 
      userId :: I32,
      -- | New member status
      status :: ChatMemberStatus
    }
  | -- | A chat member has gained/lost administrator status, or the list of their administrator privileges has changed 
  ChatEventMemberPromoted
    { -- | Chat member user identifier 
      userId :: I32,
      -- | Previous status of the chat member 
      oldStatus :: ChatMemberStatus,
      -- | New status of the chat member
      newStatus :: ChatMemberStatus
    }
  | -- | A chat member was restricted/unrestricted or banned/unbanned, or the list of their restrictions has changed 
  ChatEventMemberRestricted
    { -- | Chat member user identifier 
      userId :: I32,
      -- | Previous status of the chat member 
      oldStatus :: ChatMemberStatus,
      -- | New status of the chat member
      newStatus :: ChatMemberStatus
    }
  | -- | The chat title was changed 
  ChatEventTitleChanged
    { -- | Previous chat title 
      oldTitle :: T,
      -- | New chat title
      newTitle :: T
    }
  | -- | The chat permissions was changed 
  ChatEventPermissionsChanged
    { -- | Previous chat permissions 
      oldPermissions :: ChatPermissions,
      -- | New chat permissions
      newPermissions :: ChatPermissions
    }
  | -- | The chat description was changed 
  ChatEventDescriptionChanged
    { -- | Previous chat description 
      oldDescription :: T,
      -- | New chat description
      newDescription :: T
    }
  | -- | The chat username was changed 
  ChatEventUsernameChanged
    { -- | Previous chat username 
      oldUsername :: T,
      -- | New chat username
      newUsername :: T
    }
  | -- | The chat photo was changed 
  ChatEventPhotoChanged
    { -- | Previous chat photo value; may be null 
      oldPhoto :: (Maybe) (Photo),
      -- | New chat photo value; may be null
      newPhoto :: (Maybe) (Photo)
    }
  | -- | The can_invite_users permission of a supergroup chat was toggled 
  ChatEventInvitesToggled
    { -- | New value of can_invite_users permission
      canInviteUsers :: Bool
    }
  | -- | The linked chat of a supergroup was changed 
  ChatEventLinkedChatChanged
    { -- | Previous supergroup linked chat identifier 
      oldLinkedChatId :: I53,
      -- | New supergroup linked chat identifier
      newLinkedChatId :: I53
    }
  | -- | The slow_mode_delay setting of a supergroup was changed 
  ChatEventSlowModeDelayChanged
    { -- | Previous value of slow_mode_delay 
      oldSlowModeDelay :: I32,
      -- | New value of slow_mode_delay
      newSlowModeDelay :: I32
    }
  | -- | The sign_messages setting of a channel was toggled 
  ChatEventSignMessagesToggled
    { -- | New value of sign_messages
      signMessages :: Bool
    }
  | -- | The supergroup sticker set was changed 
  ChatEventStickerSetChanged
    { -- | Previous identifier of the chat sticker set; 0 if none 
      oldStickerSetId :: I64,
      -- | New identifier of the chat sticker set; 0 if none
      newStickerSetId :: I64
    }
  | -- | The supergroup location was changed 
  ChatEventLocationChanged
    { -- | Previous location; may be null 
      oldLocation :: (Maybe) (ChatLocation),
      -- | New location; may be null
      newLocation :: (Maybe) (ChatLocation)
    }
  | -- | The is_all_history_available setting of a supergroup was toggled 
  ChatEventIsAllHistoryAvailableToggled
    { -- | New value of is_all_history_available
      isAllHistoryAvailable :: Bool
    }
  deriving (Show, Eq, Generic)
data ChatEvent
  = -- | Represents a chat event 
  ChatEvent
    { -- | Chat event identifier 
      id :: I64,
      -- | Point in time (Unix timestamp) when the event happened 
      date :: I32,
      -- | Identifier of the user who performed the action that triggered the event 
      userId :: I32,
      -- | Action performed by the user
      action :: ChatEventAction
    }
  deriving (Show, Eq, Generic)
data ChatEvents
  = -- | Contains a list of chat events 
  ChatEvents
    { -- | List of events
      events :: [ChatEvent]
    }
  deriving (Show, Eq, Generic)
data ChatEventLogFilters
  = -- | Represents a set of filters used to obtain a chat event log
  ChatEventLogFilters
    { -- | True, if message edits should be returned
      messageEdits :: Bool,
      -- | True, if message deletions should be returned
      messageDeletions :: Bool,
      -- | True, if pin/unpin events should be returned
      messagePins :: Bool,
      -- | True, if members joining events should be returned
      memberJoins :: Bool,
      -- | True, if members leaving events should be returned
      memberLeaves :: Bool,
      -- | True, if invited member events should be returned
      memberInvites :: Bool,
      -- | True, if member promotion/demotion events should be returned
      memberPromotions :: Bool,
      -- | True, if member restricted/unrestricted/banned/unbanned events should be returned
      memberRestrictions :: Bool,
      -- | True, if changes in chat information should be returned
      infoChanges :: Bool,
      -- | True, if changes in chat settings should be returned
      settingChanges :: Bool
    }
  deriving (Show, Eq, Generic)
-- | Represents the value of a string in a language pack
data LanguagePackStringValue
  = -- | An ordinary language pack string 
  LanguagePackStringValueOrdinary
    { -- | String value
      value :: T
    }
  | -- | 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 info
  LanguagePackStringValuePluralized
    { -- | Value for zero objects 
      zeroValue :: T,
      -- | Value for one object 
      oneValue :: T,
      -- | Value for two objects
      twoValue :: T,
      -- | Value for few objects 
      fewValue :: T,
      -- | Value for many objects 
      manyValue :: T,
      -- | Default value
      otherValue :: T
    }
  | -- | A deleted language pack string, the value should be taken from the built-in english language pack
  LanguagePackStringValueDeleted
    { 
    }
  deriving (Show, Eq, Generic)
data LanguagePackString
  = -- | Represents one language pack string 
  LanguagePackString
    { -- | String key 
      key :: T,
      -- | String value
      value :: LanguagePackStringValue
    }
  deriving (Show, Eq, Generic)
data LanguagePackStrings
  = -- | Contains a list of language pack strings 
  LanguagePackStrings
    { -- | A list of language pack strings
      strings :: [LanguagePackString]
    }
  deriving (Show, Eq, Generic)
data LanguagePackInfo
  = -- | Contains information about a language pack 
  LanguagePackInfo
    { -- | Unique language pack identifier
      id :: T,
      -- | Identifier of a base language pack; may be empty. If a string is missed in the language pack, then it should be fetched from base language pack. Unsupported in custom language packs
      baseLanguagePackId :: T,
      -- | Language name 
      name :: T,
      -- | Name of the language in that language
      nativeName :: T,
      -- | 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 info
      pluralCode :: T,
      -- | True, if the language pack is official 
      isOfficial :: Bool,
      -- | True, if the language pack strings are RTL 
      isRtl :: Bool,
      -- | True, if the language pack is a beta language pack
      isBeta :: Bool,
      -- | True, if the language pack is installed by the current user
      isInstalled :: Bool,
      -- | Total number of non-deleted strings from the language pack 
      totalStringCount :: I32,
      -- | Total number of translated strings from the language pack
      translatedStringCount :: I32,
      -- | Total number of non-deleted strings from the language pack available locally 
      localStringCount :: I32,
      -- | Link to language translation interface; empty for custom local language packs
      translationUrl :: T
    }
  deriving (Show, Eq, Generic)
data LocalizationTargetInfo
  = -- | Contains information about the current localization target 
  LocalizationTargetInfo
    { -- | List of available language packs for this application
      languagePacks :: [LanguagePackInfo]
    }
  deriving (Show, Eq, Generic)
-- | Represents a data needed to subscribe for push notifications through registerDevice method. To use specific push notification service, you must specify the correct application platform and upload valid server authentication data at https://my.telegram.org
data DeviceToken
  = -- | A token for Firebase Cloud Messaging 
  DeviceTokenFirebaseCloudMessaging
    { -- | Device registration token; may be empty to de-register a device 
      token :: T,
      -- | True, if push notifications should be additionally encrypted
      encrypt :: Bool
    }
  | -- | A token for Apple Push Notification service 
  DeviceTokenApplePush
    { -- | Device token; may be empty to de-register a device 
      deviceToken :: T,
      -- | True, if App Sandbox is enabled
      isAppSandbox :: Bool
    }
  | -- | A token for Apple Push Notification service VoIP notifications 
  DeviceTokenApplePushVoIP
    { -- | Device token; may be empty to de-register a device 
      deviceToken :: T,
      -- | True, if App Sandbox is enabled 
      isAppSandbox :: Bool,
      -- | True, if push notifications should be additionally encrypted
      encrypt :: Bool
    }
  | -- | A token for Windows Push Notification Services 
  DeviceTokenWindowsPush
    { -- | The access token that will be used to send notifications; may be empty to de-register a device
      accessToken :: T
    }
  | -- | A token for Microsoft Push Notification Service 
  DeviceTokenMicrosoftPush
    { -- | Push notification channel URI; may be empty to de-register a device
      channelUri :: T
    }
  | -- | A token for Microsoft Push Notification Service VoIP channel 
  DeviceTokenMicrosoftPushVoIP
    { -- | Push notification channel URI; may be empty to de-register a device
      channelUri :: T
    }
  | -- | A token for web Push API 
  DeviceTokenWebPush
    { -- | Absolute URL exposed by the push service where the application server can send push messages; may be empty to de-register a device
      endpoint :: T,
      -- | Base64url-encoded P-256 elliptic curve Diffie-Hellman public key 
      p256dhBase64url :: T,
      -- | Base64url-encoded authentication secret
      authBase64url :: T
    }
  | -- | A token for Simple Push API for Firefox OS 
  DeviceTokenSimplePush
    { -- | Absolute URL exposed by the push service where the application server can send push messages; may be empty to de-register a device
      endpoint :: T
    }
  | -- | A token for Ubuntu Push Client service 
  DeviceTokenUbuntuPush
    { -- | Token; may be empty to de-register a device
      token :: T
    }
  | -- | A token for BlackBerry Push Service 
  DeviceTokenBlackBerryPush
    { -- | Token; may be empty to de-register a device
      token :: T
    }
  | -- | A token for Tizen Push Service 
  DeviceTokenTizenPush
    { -- | Push service registration identifier; may be empty to de-register a device
      regId :: T
    }
  deriving (Show, Eq, Generic)
data PushReceiverId
  = -- | Contains a globally unique push receiver identifier, which can be used to identify which account has received a push notification 
  PushReceiverId
    { -- | The globally unique identifier of push notification subscription
      id :: I64
    }
  deriving (Show, Eq, Generic)
-- | Describes a fill of a background
data BackgroundFill
  = -- | Describes a solid fill of a background 
  BackgroundFillSolid
    { -- | A color of the background in the RGB24 format
      color :: I32
    }
  | -- | Describes a gradient fill of a background 
  BackgroundFillGradient
    { -- | A top color of the background in the RGB24 format 
      topColor :: I32,
      -- | A bottom color of the background in the RGB24 format
      bottomColor :: I32,
      -- | Clockwise rotation angle of the gradient, in degrees; 0-359. Should be always divisible by 45
      rotationAngle :: I32
    }
  deriving (Show, Eq, Generic)
-- | Describes the type of a background
data BackgroundType
  = -- | A wallpaper in JPEG format
  BackgroundTypeWallpaper
    { -- | True, if the wallpaper must be downscaled to fit in 450x450 square and then box-blurred with radius 12
      isBlurred :: Bool,
      -- | True, if the background needs to be slightly moved when device is tilted
      isMoving :: Bool
    }
  | -- | 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
  BackgroundTypePattern
    { -- | Description of the background fill
      fill :: BackgroundFill,
      -- | Intensity of the pattern when it is shown above the filled background, 0-100
      intensity :: I32,
      -- | True, if the background needs to be slightly moved when device is tilted
      isMoving :: Bool
    }
  | -- | A filled background 
  BackgroundTypeFill
    { -- | Description of the background fill
      fill :: BackgroundFill
    }
  deriving (Show, Eq, Generic)
data Background
  = -- | Describes a chat background
  Background
    { -- | Unique background identifier
      id :: I64,
      -- | True, if this is one of default backgrounds
      isDefault :: Bool,
      -- | True, if the background is dark and is recommended to be used with dark theme
      isDark :: Bool,
      -- | Unique background name
      name :: T,
      -- | Document with the background; may be null. Null only for filled backgrounds
      document :: (Maybe) (Document),
      -- | Type of the background
      type_ :: BackgroundType
    }
  deriving (Show, Eq, Generic)
data Backgrounds
  = -- | Contains a list of backgrounds 
  Backgrounds
    { -- | A list of backgrounds
      backgrounds :: [Background]
    }
  deriving (Show, Eq, Generic)
-- | Contains information about background to set
data InputBackground
  = -- | A background from a local file
  InputBackgroundLocal
    { -- | 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
    }
  | -- | A background from the server 
  InputBackgroundRemote
    { -- | The background identifier
      backgroundId :: I64
    }
  deriving (Show, Eq, Generic)
data Hashtags
  = -- | Contains a list of hashtags 
  Hashtags
    { -- | A list of hashtags
      hashtags :: [T]
    }
  deriving (Show, Eq, Generic)
-- | Represents result of checking whether the current session can be used to transfer a chat ownership to another user
data CanTransferOwnershipResult
  = -- | The session can be used
  CanTransferOwnershipResultOk
    { 
    }
  | -- | The 2-step verification needs to be enabled first
  CanTransferOwnershipResultPasswordNeeded
    { 
    }
  | -- | The 2-step verification was enabled recently, user needs to wait 
  CanTransferOwnershipResultPasswordTooFresh
    { -- | Time left before the session can be used to transfer ownership of a chat, in seconds
      retryAfter :: I32
    }
  | -- | The session was created recently, user needs to wait 
  CanTransferOwnershipResultSessionTooFresh
    { -- | Time left before the session can be used to transfer ownership of a chat, in seconds
      retryAfter :: I32
    }
  deriving (Show, Eq, Generic)
-- | Represents result of checking whether a username can be set for a chat
data CheckChatUsernameResult
  = -- | The username can be set
  CheckChatUsernameResultOk
    { 
    }
  | -- | The username is invalid
  CheckChatUsernameResultUsernameInvalid
    { 
    }
  | -- | The username is occupied
  CheckChatUsernameResultUsernameOccupied
    { 
    }
  | -- | The user has too much chats with username, one of them should be made private first
  CheckChatUsernameResultPublicChatsTooMuch
    { 
    }
  | -- | The user can't be a member of a public supergroup
  CheckChatUsernameResultPublicGroupsUnavailable
    { 
    }
  deriving (Show, Eq, Generic)
-- | Contains content of a push message notification
data PushMessageContent
  = -- | A general message with hidden content 
  PushMessageContentHidden
    { -- | True, if the message is a pinned message with the specified content
      isPinned :: Bool
    }
  | -- | An animation message (GIF-style). 
  PushMessageContentAnimation
    { -- | Message content; may be null 
      animation :: (Maybe) (Animation),
      -- | Animation caption 
      caption :: T,
      -- | True, if the message is a pinned message with the specified content
      isPinned :: Bool
    }
  | -- | An audio message 
  PushMessageContentAudio
    { -- | Message content; may be null 
      audio :: (Maybe) (Audio),
      -- | True, if the message is a pinned message with the specified content
      isPinned :: Bool
    }
  | -- | A message with a user contact 
  PushMessageContentContact
    { -- | Contact's name 
      name :: T,
      -- | True, if the message is a pinned message with the specified content
      isPinned :: Bool
    }
  | -- | A contact has registered with Telegram
  PushMessageContentContactRegistered
    { 
    }
  | -- | A document message (a general file) 
  PushMessageContentDocument
    { -- | Message content; may be null 
      document :: (Maybe) (Document),
      -- | True, if the message is a pinned message with the specified content
      isPinned :: Bool
    }
  | -- | A message with a game 
  PushMessageContentGame
    { -- | Game title, empty for pinned game message 
      title :: T,
      -- | True, if the message is a pinned message with the specified content
      isPinned :: Bool
    }
  | -- | A new high score was achieved in a game 
  PushMessageContentGameScore
    { -- | Game title, empty for pinned message 
      title :: T,
      -- | New score, 0 for pinned message 
      score :: I32,
      -- | True, if the message is a pinned message with the specified content
      isPinned :: Bool
    }
  | -- | A message with an invoice from a bot 
  PushMessageContentInvoice
    { -- | Product price 
      price :: T,
      -- | True, if the message is a pinned message with the specified content
      isPinned :: Bool
    }
  | -- | A message with a location 
  PushMessageContentLocation
    { -- | True, if the location is live 
      isLive :: Bool,
      -- | True, if the message is a pinned message with the specified content
      isPinned :: Bool
    }
  | -- | A photo message 
  PushMessageContentPhoto
    { -- | Message content; may be null 
      photo :: (Maybe) (Photo),
      -- | Photo caption 
      caption :: T,
      -- | True, if the photo is secret 
      isSecret :: Bool,
      -- | True, if the message is a pinned message with the specified content
      isPinned :: Bool
    }
  | -- | A message with a poll 
  PushMessageContentPoll
    { -- | Poll question 
      question :: T,
      -- | True, if the poll is regular and not in quiz mode 
      isRegular :: Bool,
      -- | True, if the message is a pinned message with the specified content
      isPinned :: Bool
    }
  | -- | A screenshot of a message in the chat has been taken
  PushMessageContentScreenshotTaken
    { 
    }
  | -- | A message with a sticker 
  PushMessageContentSticker
    { -- | Message content; may be null 
      sticker :: (Maybe) (Sticker),
      -- | Emoji corresponding to the sticker; may be empty 
      emoji :: T,
      -- | True, if the message is a pinned message with the specified content
      isPinned :: Bool
    }
  | -- | A text message 
  PushMessageContentText
    { -- | Message text 
      text :: T,
      -- | True, if the message is a pinned message with the specified content
      isPinned :: Bool
    }
  | -- | A video message 
  PushMessageContentVideo
    { -- | Message content; may be null 
      video :: (Maybe) (Video),
      -- | Video caption 
      caption :: T,
      -- | True, if the video is secret 
      isSecret :: Bool,
      -- | True, if the message is a pinned message with the specified content
      isPinned :: Bool
    }
  | -- | A video note message 
  PushMessageContentVideoNote
    { -- | Message content; may be null 
      videoNote :: (Maybe) (VideoNote),
      -- | True, if the message is a pinned message with the specified content
      isPinned :: Bool
    }
  | -- | A voice note message 
  PushMessageContentVoiceNote
    { -- | Message content; may be null 
      voiceNote :: (Maybe) (VoiceNote),
      -- | True, if the message is a pinned message with the specified content
      isPinned :: Bool
    }
  | -- | A newly created basic group
  PushMessageContentBasicGroupChatCreate
    { 
    }
  | -- | New chat members were invited to a group 
  PushMessageContentChatAddMembers
    { -- | Name of the added member 
      memberName :: T,
      -- | True, if the current user was added to the group
      isCurrentUser :: Bool,
      -- | True, if the user has returned to the group themself
      isReturned :: Bool
    }
  | -- | A chat photo was edited
  PushMessageContentChatChangePhoto
    { 
    }
  | -- | A chat title was edited 
  PushMessageContentChatChangeTitle
    { -- | New chat title
      title :: T
    }
  | -- | A chat member was deleted 
  PushMessageContentChatDeleteMember
    { -- | Name of the deleted member 
      memberName :: T,
      -- | True, if the current user was deleted from the group
      isCurrentUser :: Bool,
      -- | True, if the user has left the group themself
      isLeft :: Bool
    }
  | -- | A new member joined the chat by invite link
  PushMessageContentChatJoinByLink
    { 
    }
  | -- | A forwarded messages 
  PushMessageContentMessageForwards
    { -- | Number of forwarded messages
      totalCount :: I32
    }
  | -- | A media album 
  PushMessageContentMediaAlbum
    { -- | Number of messages in the album 
      totalCount :: I32,
      -- | True, if the album has at least one photo 
      hasPhotos :: Bool,
      -- | True, if the album has at least one video
      hasVideos :: Bool
    }
  deriving (Show, Eq, Generic)
-- | Contains detailed information about a notification
data NotificationType
  = -- | New message was received 
  NotificationTypeNewMessage
    { -- | The message
      message :: Message
    }
  | -- | New secret chat was created
  NotificationTypeNewSecretChat
    { 
    }
  | -- | New call was received 
  NotificationTypeNewCall
    { -- | Call identifier
      callId :: I32
    }
  | -- | New message was received through a push notification
  NotificationTypeNewPushMessage
    { -- | The message identifier. The message will not be available in the chat history, but the ID can be used in viewMessages and as reply_to_message_id
      messageId :: I53,
      -- | Sender of the message; 0 if unknown. Corresponding user may be inaccessible
      senderUserId :: I32,
      -- | Name of the sender; can be different from the name of the sender user
      senderName :: T,
      -- | True, if the message is outgoing
      isOutgoing :: Bool,
      -- | Push message content
      content :: PushMessageContent
    }
  deriving (Show, Eq, Generic)
-- | Describes the type of notifications in a notification group
data NotificationGroupType
  = -- | A group containing notifications of type notificationTypeNewMessage and notificationTypeNewPushMessage with ordinary unread messages
  NotificationGroupTypeMessages
    { 
    }
  | -- | A group containing notifications of type notificationTypeNewMessage and notificationTypeNewPushMessage with unread mentions of the current user, replies to their messages, or a pinned message
  NotificationGroupTypeMentions
    { 
    }
  | -- | A group containing a notification of type notificationTypeNewSecretChat
  NotificationGroupTypeSecretChat
    { 
    }
  | -- | A group containing notifications of type notificationTypeNewCall
  NotificationGroupTypeCalls
    { 
    }
  deriving (Show, Eq, Generic)
data Notification
  = -- | Contains information about a notification 
  Notification
    { -- | Unique persistent identifier of this notification 
      id :: I32,
      -- | Notification date
      date :: I32,
      -- | True, if the notification was initially silent 
      isSilent :: Bool,
      -- | Notification type
      type_ :: NotificationType
    }
  deriving (Show, Eq, Generic)
data NotificationGroup
  = -- | Describes a group of notifications 
  NotificationGroup
    { -- | Unique persistent auto-incremented from 1 identifier of the notification group 
      id :: I32,
      -- | Type of the group
      type_ :: NotificationGroupType,
      -- | Identifier of a chat to which all notifications in the group belong
      chatId :: I53,
      -- | Total number of active notifications in the group 
      totalCount :: I32,
      -- | The list of active notifications
      notifications :: [Notification]
    }
  deriving (Show, Eq, Generic)
-- | Represents the value of an option
data OptionValue
  = -- | Represents a boolean option 
  OptionValueBoolean
    { -- | The value of the option
      value_3 :: Bool
    }
  | -- | Represents an unknown option or an option which has a default value
  OptionValueEmpty
    { 
    }
  | -- | Represents an integer option 
  OptionValueInteger
    { -- | The value of the option
      value_2 :: I32
    }
  | -- | Represents a string option 
  OptionValueString
    { -- | The value of the option
      value :: T
    }
  deriving (Show, Eq, Generic)
data JsonObjectMember
  = -- | Represents one member of a JSON object 
  JsonObjectMember
    { -- | Member's key 
      key :: T,
      -- | Member's value
      value :: JsonValue
    }
  deriving (Show, Eq, Generic)
-- | Represents a JSON value
data JsonValue
  = -- | Represents a null JSON value
  JsonValueNull
    { 
    }
  | -- | Represents a boolean JSON value 
  JsonValueBoolean
    { -- | The value
      value_3 :: Bool
    }
  | -- | Represents a numeric JSON value 
  JsonValueNumber
    { -- | The value
      value_2 :: Double
    }
  | -- | Represents a string JSON value 
  JsonValueString
    { -- | The value
      value :: T
    }
  | -- | Represents a JSON array 
  JsonValueArray
    { -- | The list of array elements
      values :: [JsonValue]
    }
  | -- | Represents a JSON object 
  JsonValueObject
    { -- | The list of object members
      members :: [JsonObjectMember]
    }
  deriving (Show, Eq, Generic)
-- | Represents a single rule for managing privacy settings
data UserPrivacySettingRule
  = -- | A rule to allow all users to do something
  UserPrivacySettingRuleAllowAll
    { 
    }
  | -- | A rule to allow all of a user's contacts to do something
  UserPrivacySettingRuleAllowContacts
    { 
    }
  | -- | A rule to allow certain specified users to do something 
  UserPrivacySettingRuleAllowUsers
    { -- | The user identifiers, total number of users in all rules must not exceed 1000
      userIds :: [I32]
    }
  | -- | A rule to allow all members of certain specified basic groups and supergroups to doing something 
  UserPrivacySettingRuleAllowChatMembers
    { -- | The chat identifiers, total number of chats in all rules must not exceed 20
      chatIds :: [I53]
    }
  | -- | A rule to restrict all users from doing something
  UserPrivacySettingRuleRestrictAll
    { 
    }
  | -- | A rule to restrict all contacts of a user from doing something
  UserPrivacySettingRuleRestrictContacts
    { 
    }
  | -- | A rule to restrict all specified users from doing something 
  UserPrivacySettingRuleRestrictUsers
    { -- | The user identifiers, total number of users in all rules must not exceed 1000
      userIds :: [I32]
    }
  | -- | A rule to restrict all members of specified basic groups and supergroups from doing something 
  UserPrivacySettingRuleRestrictChatMembers
    { -- | The chat identifiers, total number of chats in all rules must not exceed 20
      chatIds :: [I53]
    }
  deriving (Show, Eq, Generic)
data UserPrivacySettingRules
  = -- | 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 
  UserPrivacySettingRules
    { -- | A list of rules
      rules :: [UserPrivacySettingRule]
    }
  deriving (Show, Eq, Generic)
-- | Describes available user privacy settings
data UserPrivacySetting
  = -- | A privacy setting for managing whether the user's online status is visible
  UserPrivacySettingShowStatus
    { 
    }
  | -- | A privacy setting for managing whether the user's profile photo is visible
  UserPrivacySettingShowProfilePhoto
    { 
    }
  | -- | A privacy setting for managing whether a link to the user's account is included in forwarded messages
  UserPrivacySettingShowLinkInForwardedMessages
    { 
    }
  | -- | A privacy setting for managing whether the user's phone number is visible
  UserPrivacySettingShowPhoneNumber
    { 
    }
  | -- | A privacy setting for managing whether the user can be invited to chats
  UserPrivacySettingAllowChatInvites
    { 
    }
  | -- | A privacy setting for managing whether the user can be called
  UserPrivacySettingAllowCalls
    { 
    }
  | -- | A privacy setting for managing whether peer-to-peer connections can be used for calls
  UserPrivacySettingAllowPeerToPeerCalls
    { 
    }
  | -- | 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"
  UserPrivacySettingAllowFindingByPhoneNumber
    { 
    }
  deriving (Show, Eq, Generic)
data AccountTtl
  = -- | Contains information about the period of inactivity after which the current user's account will automatically be deleted 
  AccountTtl
    { -- | Number of days of inactivity before the account will be flagged for deletion; should range from 30-366 days
      days :: I32
    }
  deriving (Show, Eq, Generic)
data Session
  = -- | Contains information about one session in a Telegram application used by the current user. Sessions should be shown to the user in the returned order
  Session
    { -- | Session identifier 
      id :: I64,
      -- | True, if this session is the current session
      isCurrent :: Bool,
      -- | True, if a password is needed to complete authorization of the session
      isPasswordPending :: Bool,
      -- | Telegram API identifier, as provided by the application 
      apiId :: I32,
      -- | Name of the application, as provided by the application
      applicationName :: T,
      -- | The version of the application, as provided by the application 
      applicationVersion :: T,
      -- | True, if the application is an official application or uses the api_id of an official application
      isOfficialApplication :: Bool,
      -- | Model of the device the application has been run or is running on, as provided by the application 
      deviceModel :: T,
      -- | Operating system the application has been run or is running on, as provided by the application
      platform :: T,
      -- | Version of the operating system the application has been run or is running on, as provided by the application 
      systemVersion :: T,
      -- | Point in time (Unix timestamp) when the user has logged in
      logInDate :: I32,
      -- | Point in time (Unix timestamp) when the session was last used 
      lastActiveDate :: I32,
      -- | IP address from which the session was created, in human-readable format
      ip :: T,
      -- | A two-letter country code for the country from which the session was created, based on the IP address 
      country :: T,
      -- | Region code from which the session was created, based on the IP address
      region :: T
    }
  deriving (Show, Eq, Generic)
data Sessions
  = -- | Contains a list of sessions 
  Sessions
    { -- | List of sessions
      sessions :: [Session]
    }
  deriving (Show, Eq, Generic)
data ConnectedWebsite
  = -- | Contains information about one website the current user is logged in with Telegram
  ConnectedWebsite
    { -- | Website identifier
      id :: I64,
      -- | The domain name of the website
      domainName :: T,
      -- | User identifier of a bot linked with the website
      botUserId :: I32,
      -- | The version of a browser used to log in
      browser :: T,
      -- | Operating system the browser is running on
      platform :: T,
      -- | Point in time (Unix timestamp) when the user was logged in
      logInDate :: I32,
      -- | Point in time (Unix timestamp) when obtained authorization was last used
      lastActiveDate :: I32,
      -- | IP address from which the user was logged in, in human-readable format
      ip :: T,
      -- | Human-readable description of a country and a region, from which the user was logged in, based on the IP address
      location :: T
    }
  deriving (Show, Eq, Generic)
data ConnectedWebsites
  = -- | Contains a list of websites the current user is logged in with Telegram 
  ConnectedWebsites
    { -- | List of connected websites
      websites :: [ConnectedWebsite]
    }
  deriving (Show, Eq, Generic)
-- | Describes the reason why a chat is reported
data ChatReportReason
  = -- | The chat contains spam messages
  ChatReportReasonSpam
    { 
    }
  | -- | The chat promotes violence
  ChatReportReasonViolence
    { 
    }
  | -- | The chat contains pornographic messages
  ChatReportReasonPornography
    { 
    }
  | -- | The chat has child abuse related content
  ChatReportReasonChildAbuse
    { 
    }
  | -- | The chat contains copyrighted content
  ChatReportReasonCopyright
    { 
    }
  | -- | The location-based chat is unrelated to its stated location
  ChatReportReasonUnrelatedLocation
    { 
    }
  | -- | A custom reason provided by the user 
  ChatReportReasonCustom
    { -- | Report text
      text :: T
    }
  deriving (Show, Eq, Generic)
data PublicMessageLink
  = -- | Contains a public HTTPS link to a message in a supergroup or channel with a username 
  PublicMessageLink
    { -- | Message link 
      link :: T,
      -- | HTML-code for embedding the message
      html :: T
    }
  deriving (Show, Eq, Generic)
data MessageLinkInfo
  = -- | Contains information about a link to a message in a chat
  MessageLinkInfo
    { -- | True, if the link is a public link for a message in a chat
      isPublic :: Bool,
      -- | If found, identifier of the chat to which the message belongs, 0 otherwise
      chatId :: I53,
      -- | If found, the linked message; may be null
      message :: (Maybe) (Message),
      -- | True, if the whole media album to which the message belongs is linked
      forAlbum :: Bool
    }
  deriving (Show, Eq, Generic)
data FilePart
  = -- | Contains a part of a file 
  FilePart
    { -- | File bytes
      data_ :: ByteString64
    }
  deriving (Show, Eq, Generic)
-- | Represents the type of a file
data FileType
  = -- | The data is not a file
  FileTypeNone
    { 
    }
  | -- | The file is an animation
  FileTypeAnimation
    { 
    }
  | -- | The file is an audio file
  FileTypeAudio
    { 
    }
  | -- | The file is a document
  FileTypeDocument
    { 
    }
  | -- | The file is a photo
  FileTypePhoto
    { 
    }
  | -- | The file is a profile photo
  FileTypeProfilePhoto
    { 
    }
  | -- | The file was sent to a secret chat (the file type is not known to the server)
  FileTypeSecret
    { 
    }
  | -- | The file is a thumbnail of a file from a secret chat
  FileTypeSecretThumbnail
    { 
    }
  | -- | The file is a file from Secure storage used for storing Telegram Passport files
  FileTypeSecure
    { 
    }
  | -- | The file is a sticker
  FileTypeSticker
    { 
    }
  | -- | The file is a thumbnail of another file
  FileTypeThumbnail
    { 
    }
  | -- | The file type is not yet known
  FileTypeUnknown
    { 
    }
  | -- | The file is a video
  FileTypeVideo
    { 
    }
  | -- | The file is a video note
  FileTypeVideoNote
    { 
    }
  | -- | The file is a voice note
  FileTypeVoiceNote
    { 
    }
  | -- | The file is a wallpaper or a background pattern
  FileTypeWallpaper
    { 
    }
  deriving (Show, Eq, Generic)
data StorageStatisticsByFileType
  = -- | Contains the storage usage statistics for a specific file type 
  StorageStatisticsByFileType
    { -- | File type 
      fileType :: FileType,
      -- | Total size of the files 
      size :: I53,
      -- | Total number of files
      count :: I32
    }
  deriving (Show, Eq, Generic)
data StorageStatisticsByChat
  = -- | Contains the storage usage statistics for a specific chat 
  StorageStatisticsByChat
    { -- | Chat identifier; 0 if none 
      chatId :: I53,
      -- | Total size of the files in the chat 
      size :: I53,
      -- | Total number of files in the chat 
      count :: I32,
      -- | Statistics split by file types
      byFileType :: [StorageStatisticsByFileType]
    }
  deriving (Show, Eq, Generic)
data StorageStatistics
  = -- | Contains the exact storage usage statistics split by chats and file type 
  StorageStatistics
    { -- | Total size of files 
      size :: I53,
      -- | Total number of files 
      count :: I32,
      -- | Statistics split by chats
      byChat :: [StorageStatisticsByChat]
    }
  deriving (Show, Eq, Generic)
data StorageStatisticsFast
  = -- | Contains approximate storage usage statistics, excluding files of unknown file type 
  StorageStatisticsFast
    { -- | Approximate total size of files 
      filesSize :: I53,
      -- | Approximate number of files
      fileCount :: I32,
      -- | Size of the database 
      databaseSize :: I53,
      -- | Size of the language pack database 
      languagePackDatabaseSize :: I53,
      -- | Size of the TDLib internal log
      logSize :: I53
    }
  deriving (Show, Eq, Generic)
data DatabaseStatistics
  = -- | Contains database statistics
  DatabaseStatistics
    { -- | Database statistics in an unspecified human-readable format
      statistics :: T
    }
  deriving (Show, Eq, Generic)
-- | Represents the type of a network
data NetworkType
  = -- | The network is not available
  NetworkTypeNone
    { 
    }
  | -- | A mobile network
  NetworkTypeMobile
    { 
    }
  | -- | A mobile roaming network
  NetworkTypeMobileRoaming
    { 
    }
  | -- | A Wi-Fi network
  NetworkTypeWiFi
    { 
    }
  | -- | A different network type (e.g., Ethernet network)
  NetworkTypeOther
    { 
    }
  deriving (Show, Eq, Generic)
-- | Contains statistics about network usage
data NetworkStatisticsEntry
  = -- | Contains information about the total amount of data that was used to send and receive files 
  NetworkStatisticsEntryFile
    { -- | Type of the file the data is part of 
      fileType :: FileType,
      -- | Type of the network the data was sent through. Call setNetworkType to maintain the actual network type
      networkType :: NetworkType,
      -- | Total number of bytes sent 
      sentBytes :: I53,
      -- | Total number of bytes received
      receivedBytes :: I53
    }
  | -- | Contains information about the total amount of data that was used for calls 
  NetworkStatisticsEntryCall
    { -- | Type of the network the data was sent through. Call setNetworkType to maintain the actual network type
      networkType :: NetworkType,
      -- | Total number of bytes sent 
      sentBytes :: I53,
      -- | Total number of bytes received 
      receivedBytes :: I53,
      -- | Total call duration, in seconds
      duration :: Double
    }
  deriving (Show, Eq, Generic)
data NetworkStatistics
  = -- | A full list of available network statistic entries 
  NetworkStatistics
    { -- | Point in time (Unix timestamp) when the app began collecting statistics 
      sinceDate :: I32,
      -- | Network statistics entries
      entries :: [NetworkStatisticsEntry]
    }
  deriving (Show, Eq, Generic)
data AutoDownloadSettings
  = -- | Contains auto-download settings
  AutoDownloadSettings
    { -- | True, if the auto-download is enabled
      isAutoDownloadEnabled :: Bool,
      -- | The maximum size of a photo file to be auto-downloaded
      maxPhotoFileSize :: I32,
      -- | The maximum size of a video file to be auto-downloaded
      maxVideoFileSize :: I32,
      -- | The maximum size of other file types to be auto-downloaded
      maxOtherFileSize :: I32,
      -- | The maximum suggested bitrate for uploaded videos
      videoUploadBitrate :: I32,
      -- | True, if the beginning of videos needs to be preloaded for instant playback
      preloadLargeVideos :: Bool,
      -- | True, if the next audio track needs to be preloaded while the user is listening to an audio file
      preloadNextAudio :: Bool,
      -- | True, if "use less data for calls" option needs to be enabled
      useLessDataForCalls :: Bool
    }
  deriving (Show, Eq, Generic)
data AutoDownloadSettingsPresets
  = -- | Contains auto-download settings presets for the user
  AutoDownloadSettingsPresets
    { -- | Preset with lowest settings; supposed to be used by default when roaming
      low :: AutoDownloadSettings,
      -- | Preset with medium settings; supposed to be used by default when using mobile data
      medium :: AutoDownloadSettings,
      -- | Preset with highest settings; supposed to be used by default when connected on Wi-Fi
      high :: AutoDownloadSettings
    }
  deriving (Show, Eq, Generic)
-- | Describes the current state of the connection to Telegram servers
data ConnectionState
  = -- | Currently waiting for the network to become available. Use setNetworkType to change the available network type
  ConnectionStateWaitingForNetwork
    { 
    }
  | -- | Currently establishing a connection with a proxy server
  ConnectionStateConnectingToProxy
    { 
    }
  | -- | Currently establishing a connection to the Telegram servers
  ConnectionStateConnecting
    { 
    }
  | -- | Downloading data received while the client was offline
  ConnectionStateUpdating
    { 
    }
  | -- | There is a working connection to the Telegram servers
  ConnectionStateReady
    { 
    }
  deriving (Show, Eq, Generic)
-- | Represents the categories of chats for which a list of frequently used chats can be retrieved
data TopChatCategory
  = -- | A category containing frequently used private chats with non-bot users
  TopChatCategoryUsers
    { 
    }
  | -- | A category containing frequently used private chats with bot users
  TopChatCategoryBots
    { 
    }
  | -- | A category containing frequently used basic groups and supergroups
  TopChatCategoryGroups
    { 
    }
  | -- | A category containing frequently used channels
  TopChatCategoryChannels
    { 
    }
  | -- | A category containing frequently used chats with inline bots sorted by their usage in inline mode
  TopChatCategoryInlineBots
    { 
    }
  | -- | A category containing frequently used chats used for calls
  TopChatCategoryCalls
    { 
    }
  | -- | A category containing frequently used chats used to forward messages
  TopChatCategoryForwardChats
    { 
    }
  deriving (Show, Eq, Generic)
-- | Describes the type of a URL linking to an internal Telegram entity
data TMeUrlType
  = -- | A URL linking to a user 
  TMeUrlTypeUser
    { -- | Identifier of the user
      userId :: I32
    }
  | -- | A URL linking to a public supergroup or channel 
  TMeUrlTypeSupergroup
    { -- | Identifier of the supergroup or channel
      supergroupId :: I53
    }
  | -- | A chat invite link 
  TMeUrlTypeChatInvite
    { -- | Chat invite link info
      info :: ChatInviteLinkInfo
    }
  | -- | A URL linking to a sticker set 
  TMeUrlTypeStickerSet
    { -- | Identifier of the sticker set
      stickerSetId :: I64
    }
  deriving (Show, Eq, Generic)
data TMeUrl
  = -- | Represents a URL linking to an internal Telegram entity 
  TMeUrl
    { -- | URL 
      url :: T,
      -- | Type of the URL
      type_ :: TMeUrlType
    }
  deriving (Show, Eq, Generic)
data TMeUrls
  = -- | Contains a list of t.me URLs 
  TMeUrls
    { -- | List of URLs
      urls :: [TMeUrl]
    }
  deriving (Show, Eq, Generic)
data Count
  = -- | Contains a counter 
  Count
    { -- | Count
      count :: I32
    }
  deriving (Show, Eq, Generic)
data Text
  = -- | Contains some text 
  Text
    { -- | Text
      text :: T
    }
  deriving (Show, Eq, Generic)
data Seconds
  = -- | Contains a value representing a number of seconds 
  Seconds
    { -- | Number of seconds
      seconds :: Double
    }
  deriving (Show, Eq, Generic)
data DeepLinkInfo
  = -- | Contains information about a tg:// deep link 
  DeepLinkInfo
    { -- | Text to be shown to the user 
      text :: FormattedText,
      -- | True, if user should be asked to update the application
      needUpdateApplication :: Bool
    }
  deriving (Show, Eq, Generic)
-- | Describes the way the text should be parsed for TextEntities
data TextParseMode
  = -- | The text uses Markdown-style formatting
  TextParseModeMarkdown
    { -- | Version of the parser: 0 or 1 - Telegram Bot API "Markdown" parse mode, 2 - Telegram Bot API "MarkdownV2" parse mode
      version :: I32
    }
  | -- | The text uses HTML-style formatting. The same as Telegram Bot API "HTML" parse mode
  TextParseModeHTML
    { 
    }
  deriving (Show, Eq, Generic)
-- | Describes the type of a proxy server
data ProxyType
  = -- | A SOCKS5 proxy server 
  ProxyTypeSocks5
    { -- | Username for logging in; may be empty 
      username :: T,
      -- | Password for logging in; may be empty
      password :: T
    }
  | -- | A HTTP transparent proxy server 
  ProxyTypeHttp
    { -- | Username for logging in; may be empty 
      username :: T,
      -- | Password for logging in; may be empty 
      password :: T,
      -- | Pass true if the proxy supports only HTTP requests and doesn't support transparent TCP connections via HTTP CONNECT method
      httpOnly :: Bool
    }
  | -- | An MTProto proxy server 
  ProxyTypeMtproto
    { -- | The proxy's secret in hexadecimal encoding
      secret :: T
    }
  deriving (Show, Eq, Generic)
data Proxy
  = -- | Contains information about a proxy server 
  Proxy
    { -- | Unique identifier of the proxy 
      id :: I32,
      -- | Proxy server IP address 
      server :: T,
      -- | Proxy server port 
      port :: I32,
      -- | Point in time (Unix timestamp) when the proxy was last used; 0 if never 
      lastUsedDate :: I32,
      -- | True, if the proxy is enabled now 
      isEnabled :: Bool,
      -- | Type of the proxy
      type_ :: ProxyType
    }
  deriving (Show, Eq, Generic)
data Proxies
  = -- | Represents a list of proxy servers 
  Proxies
    { -- | List of proxy servers
      proxies :: [Proxy]
    }
  deriving (Show, Eq, Generic)
-- | Describes a sticker that needs to be added to a sticker set
data InputSticker
  = -- | A static sticker in PNG format, which will be converted to WEBP server-side
  InputStickerStatic
    { -- | PNG image with the sticker; must be up to 512 KB in size and fit in a 512x512 square
      sticker :: InputFile,
      -- | Emojis corresponding to the sticker
      emojis :: T,
      -- | For masks, position where the mask should be placed; may be null
      maskPosition :: (Maybe) (MaskPosition)
    }
  | -- | An animated sticker in TGS format
  InputStickerAnimated
    { -- | File with the animated sticker. Only local or uploaded within a week files are supported. See https://core.telegram.org/animated_stickers#technical-requirements for technical requirements
      sticker :: InputFile,
      -- | Emojis corresponding to the sticker
      emojis :: T
    }
  deriving (Show, Eq, Generic)
data DateRange
  = -- | Represents a date range 
  DateRange
    { -- | Point in time (Unix timestamp) at which the date range begins 
      startDate :: I32,
      -- | Point in time (Unix timestamp) at which the date range ends
      endDate :: I32
    }
  deriving (Show, Eq, Generic)
data StatisticsValue
  = -- | A statistics value 
  StatisticsValue
    { -- | The value 
      value :: Double,
      -- | The value for the previous day 
      previousValue :: Double,
      -- | The growth rate of the value, as a percentage
      growthRatePercentage :: Double
    }
  deriving (Show, Eq, Generic)
-- | Describes a statistics graph
data StatisticsGraph
  = -- | A graph data 
  StatisticsGraphData
    { -- | Graph data in JSON format 
      jsonData :: T,
      -- | If non-empty, a token which can be used to receive a zoomed in graph
      zoomToken :: T
    }
  | -- | The graph data to be asynchronously loaded through getChatStatisticsGraph 
  StatisticsGraphAsync
    { -- | The token to use for data loading
      token :: T
    }
  | -- | An error message to be shown to the user instead of the graph 
  StatisticsGraphError
    { -- | The error message
      errorMessage :: T
    }
  deriving (Show, Eq, Generic)
data ChatStatisticsMessageInteractionCounters
  = -- | Contains statistics about interactions with a message
  ChatStatisticsMessageInteractionCounters
    { -- | Message identifier
      messageId :: I53,
      -- | Number of times the message was viewed
      viewCount :: I32,
      -- | Number of times the message was forwarded
      forwardCount :: I32
    }
  deriving (Show, Eq, Generic)
data ChatStatistics
  = -- | A detailed statistics about a chat
  ChatStatistics
    { -- | A period to which the statistics applies
      period :: DateRange,
      -- | Number of members in the chat
      memberCount :: StatisticsValue,
      -- | Mean number of times the recently sent messages was viewed
      meanViewCount :: StatisticsValue,
      -- | Mean number of times the recently sent messages was shared
      meanShareCount :: StatisticsValue,
      -- | A percentage of users with enabled notifications for the chat
      enabledNotificationsPercentage :: Double,
      -- | A graph containing number of members in the chat
      memberCountGraph :: StatisticsGraph,
      -- | A graph containing number of members joined and left the chat
      joinGraph :: StatisticsGraph,
      -- | A graph containing number of members muted and unmuted the chat
      muteGraph :: StatisticsGraph,
      -- | A graph containing number of message views in a given hour in the last two weeks
      viewCountByHourGraph :: StatisticsGraph,
      -- | A graph containing number of message views per source
      viewCountBySourceGraph :: StatisticsGraph,
      -- | A graph containing number of new member joins per source
      joinBySourceGraph :: StatisticsGraph,
      -- | A graph containing number of users viewed chat messages per language
      languageGraph :: StatisticsGraph,
      -- | A graph containing number of chat message views and shares
      messageInteractionGraph :: StatisticsGraph,
      -- | A graph containing number of views of associated with the chat instant views
      instantViewInteractionGraph :: StatisticsGraph,
      -- | Detailed statistics about number of views and shares of recently sent messages
      recentMessageInteractions :: [ChatStatisticsMessageInteractionCounters]
    }
  deriving (Show, Eq, Generic)
-- | Contains notifications about data changes
data Update
  = -- | The user authorization state has changed 
  UpdateAuthorizationState
    { -- | New authorization state
      authorizationState :: AuthorizationState
    }
  | -- | A new message was received; can also be an outgoing message 
  UpdateNewMessage
    { -- | The new message
      message :: Message
    }
  | -- | 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
  UpdateMessageSendAcknowledged
    { -- | The chat identifier of the sent message 
      chatId :: I53,
      -- | A temporary message identifier
      messageId :: I53
    }
  | -- | A message has been successfully sent 
  UpdateMessageSendSucceeded
    { -- | Information about the sent message. Usually only the message identifier, date, and content are changed, but almost all other fields can also change 
      message :: Message,
      -- | The previous temporary message identifier
      oldMessageId :: I53
    }
  | -- | 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
  UpdateMessageSendFailed
    { -- | Contains information about the message which failed to send 
      message :: Message,
      -- | The previous temporary message identifier 
      oldMessageId :: I53,
      -- | An error code 
      errorCode :: I32,
      -- | Error message
      errorMessage :: T
    }
  | -- | The message content has changed 
  UpdateMessageContent
    { -- | Chat identifier 
      chatId :: I53,
      -- | Message identifier 
      messageId :: I53,
      -- | New message content
      newContent :: MessageContent
    }
  | -- | A message was edited. Changes in the message content will come in a separate updateMessageContent 
  UpdateMessageEdited
    { -- | Chat identifier 
      chatId :: I53,
      -- | Message identifier 
      messageId :: I53,
      -- | Point in time (Unix timestamp) when the message was edited 
      editDate :: I32,
      -- | New message reply markup; may be null
      replyMarkup :: (Maybe) (ReplyMarkup)
    }
  | -- | The view count of the message has changed 
  UpdateMessageViews
    { -- | Chat identifier 
      chatId :: I53,
      -- | Message identifier 
      messageId :: I53,
      -- | New value of the view count
      views :: I32
    }
  | -- | The message content was opened. Updates voice note messages to "listened", video note messages to "viewed" and starts the TTL timer for self-destructing messages 
  UpdateMessageContentOpened
    { -- | Chat identifier 
      chatId :: I53,
      -- | Message identifier
      messageId :: I53
    }
  | -- | A message with an unread mention was read 
  UpdateMessageMentionRead
    { -- | Chat identifier 
      chatId :: I53,
      -- | Message identifier 
      messageId :: I53,
      -- | The new number of unread mention messages left in the chat
      unreadMentionCount :: I32
    }
  | -- | A message with a live location was viewed. When the update is received, the client is supposed to update the live location
  UpdateMessageLiveLocationViewed
    { -- | Identifier of the chat with the live location message 
      chatId :: I53,
      -- | Identifier of the message with live location
      messageId :: I53
    }
  | -- | A new chat has been loaded/created. This update is guaranteed to come before the chat identifier is returned to the client. The chat field changes will be reported through separate updates 
  UpdateNewChat
    { -- | The chat
      chat :: Chat
    }
  | -- | The title of a chat was changed 
  UpdateChatTitle
    { -- | Chat identifier 
      chatId :: I53,
      -- | The new chat title
      title :: T
    }
  | -- | A chat photo was changed 
  UpdateChatPhoto
    { -- | Chat identifier 
      chatId :: I53,
      -- | The new chat photo; may be null
      photo :: (Maybe) (ChatPhoto)
    }
  | -- | Chat permissions was changed 
  UpdateChatPermissions
    { -- | Chat identifier 
      chatId :: I53,
      -- | The new chat permissions
      permissions :: ChatPermissions
    }
  | -- | 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 
  UpdateChatLastMessage
    { -- | Chat identifier 
      chatId :: I53,
      -- | The new last message in the chat; may be null 
      lastMessage :: (Maybe) (Message),
      -- | The new chat positions in the chat lists
      positions :: [ChatPosition]
    }
  | -- | The position of a chat in a chat list has changed. Instead of this update updateChatLastMessage or updateChatDraftMessage might be sent 
  UpdateChatPosition
    { -- | Chat identifier 
      chatId :: I53,
      -- | New chat position. If new order is 0, then the chat needs to be removed from the list
      position :: ChatPosition
    }
  | -- | A chat was marked as unread or was read 
  UpdateChatIsMarkedAsUnread
    { -- | Chat identifier 
      chatId :: I53,
      -- | New value of is_marked_as_unread
      isMarkedAsUnread :: Bool
    }
  | -- | A chat's has_scheduled_messages field has changed 
  UpdateChatHasScheduledMessages
    { -- | Chat identifier 
      chatId :: I53,
      -- | New value of has_scheduled_messages
      hasScheduledMessages :: Bool
    }
  | -- | The value of the default disable_notification parameter, used when a message is sent to the chat, was changed 
  UpdateChatDefaultDisableNotification
    { -- | Chat identifier 
      chatId :: I53,
      -- | The new default_disable_notification value
      defaultDisableNotification :: Bool
    }
  | -- | Incoming messages were read or number of unread messages has been changed 
  UpdateChatReadInbox
    { -- | Chat identifier 
      chatId :: I53,
      -- | Identifier of the last read incoming message 
      lastReadInboxMessageId :: I53,
      -- | The number of unread messages left in the chat
      unreadCount :: I32
    }
  | -- | Outgoing messages were read 
  UpdateChatReadOutbox
    { -- | Chat identifier 
      chatId :: I53,
      -- | Identifier of last read outgoing message
      lastReadOutboxMessageId :: I53
    }
  | -- | The chat unread_mention_count has changed 
  UpdateChatUnreadMentionCount
    { -- | Chat identifier 
      chatId :: I53,
      -- | The number of unread mention messages left in the chat
      unreadMentionCount :: I32
    }
  | -- | Notification settings for a chat were changed 
  UpdateChatNotificationSettings
    { -- | Chat identifier 
      chatId :: I53,
      -- | The new notification settings
      notificationSettings_2 :: ChatNotificationSettings
    }
  | -- | Notification settings for some type of chats were updated 
  UpdateScopeNotificationSettings
    { -- | Types of chats for which notification settings were updated 
      scope :: NotificationSettingsScope,
      -- | The new notification settings
      notificationSettings :: ScopeNotificationSettings
    }
  | -- | The chat action bar was changed 
  UpdateChatActionBar
    { -- | Chat identifier 
      chatId :: I53,
      -- | The new value of the action bar; may be null
      actionBar :: (Maybe) (ChatActionBar)
    }
  | -- | The chat pinned message was changed 
  UpdateChatPinnedMessage
    { -- | Chat identifier 
      chatId :: I53,
      -- | The new identifier of the pinned message; 0 if there is no pinned message in the chat
      pinnedMessageId :: I53
    }
  | -- | 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
  UpdateChatReplyMarkup
    { -- | Chat identifier 
      chatId :: I53,
      -- | 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 :: I53
    }
  | -- | 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 shouldn't be applied 
  UpdateChatDraftMessage
    { -- | Chat identifier 
      chatId :: I53,
      -- | The new draft message; may be null 
      draftMessage :: (Maybe) (DraftMessage),
      -- | The new chat positions in the chat lists
      positions :: [ChatPosition]
    }
  | -- | The list of chat filters or a chat filter has changed 
  UpdateChatFilters
    { -- | The new list of chat filters
      chatFilters :: [ChatFilterInfo]
    }
  | -- | The number of online group members has changed. This update with non-zero count is sent only for currently opened chats. There is no guarantee that it will be sent just after the count has changed 
  UpdateChatOnlineMemberCount
    { -- | Identifier of the chat 
      chatId :: I53,
      -- | New number of online members in the chat, or 0 if unknown
      onlineMemberCount :: I32
    }
  | -- | A notification was changed 
  UpdateNotification
    { -- | Unique notification group identifier 
      notificationGroupId :: I32,
      -- | Changed notification
      notification :: Notification
    }
  | -- | A list of active notifications in a notification group has changed
  UpdateNotificationGroup
    { -- | Unique notification group identifier
      notificationGroupId :: I32,
      -- | New type of the notification group
      type_2 :: NotificationGroupType,
      -- | Identifier of a chat to which all notifications in the group belong
      chatId :: I53,
      -- | Chat identifier, which notification settings must be applied to the added notifications
      notificationSettingsChatId :: I53,
      -- | True, if the notifications should be shown without sound
      isSilent :: Bool,
      -- | Total number of unread notifications in the group, can be bigger than number of active notifications
      totalCount :: I32,
      -- | List of added group notifications, sorted by notification ID 
      addedNotifications :: [Notification],
      -- | Identifiers of removed group notifications, sorted by notification ID
      removedNotificationIds :: [I32]
    }
  | -- | 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 
  UpdateActiveNotifications
    { -- | Lists of active notification groups
      groups :: [NotificationGroup]
    }
  | -- | Describes whether there are some pending notification updates. Can be used to prevent application from killing, while there are some pending notifications
  UpdateHavePendingNotifications
    { -- | True, if there are some delayed notification updates, which will be sent soon
      haveDelayedNotifications :: Bool,
      -- | True, if there can be some yet unreceived notifications, which are being fetched from the server
      haveUnreceivedNotifications :: Bool
    }
  | -- | Some messages were deleted 
  UpdateDeleteMessages
    { -- | Chat identifier 
      chatId :: I53,
      -- | Identifiers of the deleted messages
      messageIds :: [I53],
      -- | True, if the messages are permanently deleted by a user (as opposed to just becoming inaccessible)
      isPermanent :: Bool,
      -- | True, if the messages are deleted only from the cache and can possibly be retrieved again in the future
      fromCache :: Bool
    }
  | -- | User activity in the chat has changed 
  UpdateUserChatAction
    { -- | Chat identifier 
      chatId :: I53,
      -- | Identifier of a user performing an action 
      userId :: I32,
      -- | The action description
      action :: ChatAction
    }
  | -- | The user went online or offline 
  UpdateUserStatus
    { -- | User identifier 
      userId :: I32,
      -- | New status of the user
      status :: UserStatus
    }
  | -- | Some data of a user has changed. This update is guaranteed to come before the user identifier is returned to the client 
  UpdateUser
    { -- | New data about the user
      user :: User
    }
  | -- | Some data of a basic group has changed. This update is guaranteed to come before the basic group identifier is returned to the client 
  UpdateBasicGroup
    { -- | New data about the group
      basicGroup :: BasicGroup
    }
  | -- | Some data of a supergroup or a channel has changed. This update is guaranteed to come before the supergroup identifier is returned to the client 
  UpdateSupergroup
    { -- | New data about the supergroup
      supergroup :: Supergroup
    }
  | -- | Some data of a secret chat has changed. This update is guaranteed to come before the secret chat identifier is returned to the client 
  UpdateSecretChat
    { -- | New data about the secret chat
      secretChat :: SecretChat
    }
  | -- | Some data from userFullInfo has been changed 
  UpdateUserFullInfo
    { -- | User identifier 
      userId :: I32,
      -- | New full information about the user
      userFullInfo :: UserFullInfo
    }
  | -- | Some data from basicGroupFullInfo has been changed 
  UpdateBasicGroupFullInfo
    { -- | Identifier of a basic group 
      basicGroupId :: I32,
      -- | New full information about the group
      basicGroupFullInfo :: BasicGroupFullInfo
    }
  | -- | Some data from supergroupFullInfo has been changed 
  UpdateSupergroupFullInfo
    { -- | Identifier of the supergroup or channel 
      supergroupId :: I32,
      -- | New full information about the supergroup
      supergroupFullInfo :: SupergroupFullInfo
    }
  | -- | Service notification from the server. Upon receiving this the client must show a popup with the content of the notification
  UpdateServiceNotification
    { -- | Notification type. If type begins with "AUTH_KEY_DROP_", then two buttons "Cancel" and "Log out" should be shown under notification; if user presses the second, all local data should be destroyed using Destroy method
      type_ :: T,
      -- | Notification content
      content :: MessageContent
    }
  | -- | Information about a file was updated 
  UpdateFile
    { -- | New data about the file
      file :: File
    }
  | -- | The file generation process needs to be started by the client
  UpdateFileGenerationStart
    { -- | Unique identifier for the generation process
      generationId :: I64,
      -- | The path to a file from which a new file is generated; may be empty
      originalPath :: T,
      -- | The path to a file that should be created and where the new file should be generated
      destinationPath :: T,
      -- | 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 should be downloaded by the client
      conversion :: T
    }
  | -- | File generation is no longer needed 
  UpdateFileGenerationStop
    { -- | Unique identifier for the generation process
      generationId :: I64
    }
  | -- | New call was created or information about a call was updated 
  UpdateCall
    { -- | New data about a call
      call :: Call
    }
  | -- | Some privacy setting rules have been changed 
  UpdateUserPrivacySettingRules
    { -- | The privacy setting 
      setting :: UserPrivacySetting,
      -- | New privacy rules
      rules :: UserPrivacySettingRules
    }
  | -- | Number of unread messages in a chat list has changed. This update is sent only if the message database is used 
  UpdateUnreadMessageCount
    { -- | The chat list with changed number of unread messages
      chatList :: ChatList,
      -- | Total number of unread messages 
      unreadCount :: I32,
      -- | Total number of unread messages in unmuted chats
      unreadUnmutedCount :: I32
    }
  | -- | 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
  UpdateUnreadChatCount
    { -- | The chat list with changed number of unread messages
      chatList :: ChatList,
      -- | Approximate total number of chats in the chat list
      totalCount :: I32,
      -- | Total number of unread chats 
      unreadCount :: I32,
      -- | Total number of unread unmuted chats
      unreadUnmutedCount :: I32,
      -- | Total number of chats marked as unread 
      markedAsUnreadCount :: I32,
      -- | Total number of unmuted chats marked as unread
      markedAsUnreadUnmutedCount :: I32
    }
  | -- | An option changed its value 
  UpdateOption
    { -- | The option name 
      name :: T,
      -- | The new option value
      value :: OptionValue
    }
  | -- | A sticker set has changed 
  UpdateStickerSet
    { -- | The sticker set
      stickerSet :: StickerSet
    }
  | -- | The list of installed sticker sets was updated 
  UpdateInstalledStickerSets
    { -- | True, if the list of installed mask sticker sets was updated 
      isMasks :: Bool,
      -- | The new list of installed ordinary sticker sets
      stickerSetIds :: [I64]
    }
  | -- | The list of trending sticker sets was updated or some of them were viewed 
  UpdateTrendingStickerSets
    { -- | The prefix of the list of trending sticker sets with the newest trending sticker sets
      stickerSets :: StickerSets
    }
  | -- | The list of recently used stickers was updated 
  UpdateRecentStickers
    { -- | True, if the list of stickers attached to photo or video files was updated, otherwise the list of sent stickers is updated 
      isAttached :: Bool,
      -- | The new list of file identifiers of recently used stickers
      stickerIds :: [I32]
    }
  | -- | The list of favorite stickers was updated 
  UpdateFavoriteStickers
    { -- | The new list of file identifiers of favorite stickers
      stickerIds :: [I32]
    }
  | -- | The list of saved animations was updated 
  UpdateSavedAnimations
    { -- | The new list of file identifiers of saved animations
      animationIds :: [I32]
    }
  | -- | The selected background has changed 
  UpdateSelectedBackground
    { -- | True, if background for dark theme has changed 
      forDarkTheme :: Bool,
      -- | The new selected background; may be null
      background :: (Maybe) (Background)
    }
  | -- | Some language pack strings have been updated 
  UpdateLanguagePackStrings
    { -- | Localization target to which the language pack belongs 
      localizationTarget :: T,
      -- | Identifier of the updated language pack 
      languagePackId :: T,
      -- | List of changed language pack strings
      strings :: [LanguagePackString]
    }
  | -- | The connection state has changed 
  UpdateConnectionState
    { -- | The new connection state
      state :: ConnectionState
    }
  | -- | New terms of service must be accepted by the user. If the terms of service are declined, then the deleteAccount method should be called with the reason "Decline ToS update" 
  UpdateTermsOfService
    { -- | Identifier of the terms of service 
      termsOfServiceId :: T,
      -- | The new terms of service
      termsOfService :: TermsOfService
    }
  | -- | The list of users nearby has changed. The update is sent only 60 seconds after a successful searchChatsNearby request 
  UpdateUsersNearby
    { -- | The new list of users nearby
      usersNearby :: [ChatNearby]
    }
  | -- | The list of supported dice emojis has changed 
  UpdateDiceEmojis
    { -- | The new list of supported dice emojis
      emojis :: [T]
    }
  | -- | The parameters of animation search through GetOption("animation_search_bot_username") bot has changed 
  UpdateAnimationSearchParameters
    { -- | Name of the animation search provider 
      provider :: T,
      -- | The new list of emojis suggested for searching
      emojis :: [T]
    }
  | -- | A new incoming inline query; for bots only 
  UpdateNewInlineQuery
    { -- | Unique query identifier 
      id :: I64,
      -- | Identifier of the user who sent the query 
      senderUserId :: I32,
      -- | User location, provided by the client; may be null
      userLocation :: (Maybe) (Location),
      -- | Text of the query 
      query :: T,
      -- | Offset of the first entry to return
      offset :: T
    }
  | -- | The user has chosen a result of an inline query; for bots only 
  UpdateNewChosenInlineResult
    { -- | Identifier of the user who sent the query 
      senderUserId :: I32,
      -- | User location, provided by the client; may be null
      userLocation :: (Maybe) (Location),
      -- | Text of the query 
      query :: T,
      -- | Identifier of the chosen result 
      resultId :: T,
      -- | Identifier of the sent inline message, if known
      inlineMessageId :: T
    }
  | -- | A new incoming callback query; for bots only 
  UpdateNewCallbackQuery
    { -- | Unique query identifier 
      id :: I64,
      -- | Identifier of the user who sent the query
      senderUserId :: I32,
      -- | Identifier of the chat where the query was sent 
      chatId :: I53,
      -- | Identifier of the message, from which the query originated
      messageId :: I53,
      -- | Identifier that uniquely corresponds to the chat to which the message was sent 
      chatInstance :: I64,
      -- | Query payload
      payload :: CallbackQueryPayload
    }
  | -- | A new incoming callback query from a message sent via a bot; for bots only 
  UpdateNewInlineCallbackQuery
    { -- | Unique query identifier 
      id :: I64,
      -- | Identifier of the user who sent the query 
      senderUserId :: I32,
      -- | Identifier of the inline message, from which the query originated
      inlineMessageId :: T,
      -- | An identifier uniquely corresponding to the chat a message was sent to 
      chatInstance :: I64,
      -- | Query payload
      payload :: CallbackQueryPayload
    }
  | -- | A new incoming shipping query; for bots only. Only for invoices with flexible price 
  UpdateNewShippingQuery
    { -- | Unique query identifier 
      id :: I64,
      -- | Identifier of the user who sent the query 
      senderUserId :: I32,
      -- | Invoice payload 
      invoicePayload_2 :: T,
      -- | User shipping address
      shippingAddress :: Address
    }
  | -- | A new incoming pre-checkout query; for bots only. Contains full information about a checkout 
  UpdateNewPreCheckoutQuery
    { -- | Unique query identifier 
      id :: I64,
      -- | Identifier of the user who sent the query 
      senderUserId :: I32,
      -- | Currency for the product price 
      currency :: T,
      -- | Total price for the product, in the minimal quantity of the currency
      totalAmount :: I53,
      -- | Invoice payload 
      invoicePayload :: ByteString64,
      -- | Identifier of a shipping option chosen by the user; may be empty if not applicable 
      shippingOptionId :: T,
      -- | Information about the order; may be null
      orderInfo :: (Maybe) (OrderInfo)
    }
  | -- | A new incoming event; for bots only 
  UpdateNewCustomEvent
    { -- | A JSON-serialized event
      event :: T
    }
  | -- | A new incoming query; for bots only 
  UpdateNewCustomQuery
    { -- | The query identifier 
      id :: I64,
      -- | JSON-serialized query data 
      data_ :: T,
      -- | Query timeout
      timeout :: I32
    }
  | -- | A poll was updated; for bots only 
  UpdatePoll
    { -- | New data about the poll
      poll :: Poll
    }
  | -- | A user changed the answer to a poll; for bots only 
  UpdatePollAnswer
    { -- | Unique poll identifier 
      pollId :: I64,
      -- | The user, who changed the answer to the poll 
      userId :: I32,
      -- | 0-based identifiers of answer options, chosen by the user
      optionIds :: [I32]
    }
  deriving (Show, Eq, Generic)
data Updates
  = -- | Contains a list of updates 
  Updates
    { -- | List of updates
      updates :: [Update]
    }
  deriving (Show, Eq, Generic)
-- | Describes a stream to which TDLib internal log is written
data LogStream
  = -- | The log is written to stderr or an OS specific log
  LogStreamDefault
    { 
    }
  | -- | The log is written to a file 
  LogStreamFile
    { -- | Path to the file to where the internal TDLib log will be written 
      path :: T,
      -- | The maximum size of the file to where the internal TDLib log is written before the file will be auto-rotated
      maxFileSize :: I53
    }
  | -- | The log is written nowhere
  LogStreamEmpty
    { 
    }
  deriving (Show, Eq, Generic)
data LogVerbosityLevel
  = -- | Contains a TDLib internal log verbosity level 
  LogVerbosityLevel
    { -- | Log verbosity level
      verbosityLevel :: I32
    }
  deriving (Show, Eq, Generic)
data LogTags
  = -- | Contains a list of available TDLib internal log tags 
  LogTags
    { -- | List of log tags
      tags :: [T]
    }
  deriving (Show, Eq, Generic)
data TestInt
  = -- | A simple object containing a number; for testing only 
  TestInt
    { -- | Number
      value :: I32
    }
  deriving (Show, Eq, Generic)
data TestString
  = -- | A simple object containing a string; for testing only 
  TestString
    { -- | String
      value :: T
    }
  deriving (Show, Eq, Generic)
data TestBytes
  = -- | A simple object containing a sequence of bytes; for testing only 
  TestBytes
    { -- | Bytes
      value :: ByteString64
    }
  deriving (Show, Eq, Generic)
data TestVectorInt
  = -- | A simple object containing a vector of numbers; for testing only 
  TestVectorInt
    { -- | Vector of numbers
      value :: [I32]
    }
  deriving (Show, Eq, Generic)
data TestVectorIntObject
  = -- | A simple object containing a vector of objects that hold a number; for testing only 
  TestVectorIntObject
    { -- | Vector of objects
      value :: [TestInt]
    }
  deriving (Show, Eq, Generic)
data TestVectorString
  = -- | A simple object containing a vector of strings; for testing only 
  TestVectorString
    { -- | Vector of strings
      value :: [T]
    }
  deriving (Show, Eq, Generic)
data TestVectorStringObject
  = -- | A simple object containing a vector of objects that hold a string; for testing only 
  TestVectorStringObject
    { -- | Vector of objects
      value :: [TestString]
    }
  deriving (Show, Eq, Generic)

typeInstances