module TD.Data.SettingsSection
  (SettingsSection(..)) where

import qualified Data.Aeson as A
import qualified Data.Aeson.Types as AT
import qualified TD.Lib.Internal as I
import qualified Data.Text as T

-- | Describes a section of the application settings
data SettingsSection
  = SettingsSectionAppearance -- ^ The appearance section
    { SettingsSection -> Maybe Text
subsection :: Maybe T.Text -- ^ Subsection of the section; may be one of "", "themes", "themes/edit", "themes/create", "wallpapers", "wallpapers/edit", "wallpapers/set", "wallpapers/choose-photo", "your-color/profile", "your-color/profile/add-icons", "your-color/profile/use-gift", "your-color/profile/reset", "your-color/name", "your-color/name/add-icons", "your-color/name/use-gift", "night-mode", "auto-night-mode", "text-size", "text-size/use-system", "message-corners", "animations", "stickers-and-emoji", "stickers-and-emoji/edit", "stickers-and-emoji/trending", "stickers-and-emoji/archived", "stickers-and-emoji/archived/edit", "stickers-and-emoji/emoji", "stickers-and-emoji/emoji/edit", "stickers-and-emoji/emoji/archived", "stickers-and-emoji/emoji/archived/edit", "stickers-and-emoji/emoji/suggest", "stickers-and-emoji/emoji/quick-reaction", "stickers-and-emoji/emoji/quick-reaction/choose", "stickers-and-emoji/suggest-by-emoji", "stickers-and-emoji/large-emoji", "stickers-and-emoji/dynamic-order", "stickers-and-emoji/emoji/show-more", "app-icon", "tap-for-next-media"
    }
  | SettingsSectionAskQuestion -- ^ The "Ask a question" section
  | SettingsSectionBusiness -- ^ The "Telegram Business" section
    { subsection :: Maybe T.Text -- ^ Subsection of the section; may be one of "", "do-not-hide-ads"
    }
  | SettingsSectionChatFolders -- ^ The chat folder settings section
    { subsection :: Maybe T.Text -- ^ Subsection of the section; may be one of "", "edit", "create", "add-recommended", "show-tags", "tab-view"
    }
  | SettingsSectionDataAndStorage -- ^ The data and storage settings section
    { subsection :: Maybe T.Text -- ^ Subsection of the section; may be one of "", "storage", "storage/edit", "storage/auto-remove", "storage/clear-cache", "storage/max-cache", "usage", "usage/mobile", "usage/wifi", "usage/reset", "usage/roaming", "auto-download/mobile", "auto-download/mobile/enable", "auto-download/mobile/usage", "auto-download/mobile/photos", "auto-download/mobile/stories", "auto-download/mobile/videos", "auto-download/mobile/files", "auto-download/wifi", "auto-download/wifi/enable", "auto-download/wifi/usage", "auto-download/wifi/photos", "auto-download/wifi/stories", "auto-download/wifi/videos", "auto-download/wifi/files", "auto-download/roaming", "auto-download/roaming/enable", "auto-download/roaming/usage", "auto-download/roaming/photos", "auto-download/roaming/stories", "auto-download/roaming/videos", "auto-download/roaming/files", "auto-download/reset", "save-to-photos/chats", "save-to-photos/chats/max-video-size", "save-to-photos/chats/add-exception", "save-to-photos/chats/delete-all", "save-to-photos/groups", "save-to-photos/groups/max-video-size", "save-to-photos/groups/add-exception", "save-to-photos/groups/delete-all", "save-to-photos/channels", "save-to-photos/channels/max-video-size", "save-to-photos/channels/add-exception", "save-to-photos/channels/delete-all", "less-data-calls", "open-links", "share-sheet", "share-sheet/suggested-chats", "share-sheet/suggest-by", "share-sheet/reset", "saved-edited-photos", "pause-music", "raise-to-listen", "raise-to-speak", "show-18-content", "proxy", "proxy/edit", "proxy/use-proxy", "proxy/add-proxy", "proxy/share-list", "proxy/use-for-calls"
    }
  | SettingsSectionDevices -- ^ The Devices section
    { subsection :: Maybe T.Text -- ^ Subsection of the section; may be one of "", "edit", "link-desktop", "terminate-sessions", "auto-terminate"
    }
  | SettingsSectionEditProfile -- ^ The profile edit section
    { subsection :: Maybe T.Text -- ^ Subsection of the section; may be one of "", "set-photo", "first-name", "last-name", "emoji-status", "bio", "birthday", "change-number", "username", "your-color", "channel", "add-account", "log-out", "profile-color/profile", "profile-color/profile/add-icons", "profile-color/profile/use-gift", "profile-color/name", "profile-color/name/add-icons", "profile-color/name/use-gift", "profile-photo/use-emoji"
    }
  | SettingsSectionFaq -- ^ The FAQ section
  | SettingsSectionFeatures -- ^ The "Telegram Features" section
  | SettingsSectionInAppBrowser -- ^ The in-app browser settings section
    { subsection :: Maybe T.Text -- ^ Subsection of the section; may be one of "", "enable-browser", "clear-cookies", "clear-cache", "history", "clear-history", "never-open", "clear-list", "search"
    }
  | SettingsSectionLanguage -- ^ The application language section
    { subsection :: Maybe T.Text -- ^ Subsection of the section; may be one of "", "show-button" for Show Translate Button toggle, "translate-chats" for Translate Entire Chats toggle, "do-not-translate" - for Do Not Translate language list
    }
  | SettingsSectionMyStars -- ^ The Telegram Star balance and transaction section
    { subsection :: Maybe T.Text -- ^ Subsection of the section; may be one of "", "top-up", "stats", "gift", "earn"
    }
  | SettingsSectionMyToncoins -- ^ The Toncoin balance and transaction section
  | SettingsSectionNotifications -- ^ The notification settings section
    { subsection :: Maybe T.Text -- ^ Subsection of the section; may be one of "", "accounts", "private-chats", "private-chats/edit", "private-chats/show", "private-chats/preview", "private-chats/sound", "private-chats/add-exception", "private-chats/delete-exceptions", "private-chats/light-color", "private-chats/vibrate", "private-chats/priority", "groups", "groups/edit", "groups/show", "groups/preview", "groups/sound", "groups/add-exception", "groups/delete-exceptions", "groups/light-color", "groups/vibrate", "groups/priority", "channels", "channels/edit", "channels/show", "channels/preview", "channels/sound", "channels/add-exception", "channels/delete-exceptions", "channels/light-color", "channels/vibrate", "channels/priority", "stories", "stories/new", "stories/important", "stories/show-sender", "stories/sound", "stories/add-exception", "stories/delete-exceptions", "stories/light-color", "stories/vibrate", "stories/priority", "reactions", "reactions/messages", "reactions/stories", "reactions/show-sender", "reactions/sound", "reactions/light-color", "reactions/vibrate", "reactions/priority", "in-app-sounds", "in-app-vibrate", "in-app-preview", "in-chat-sounds", "in-app-popup", "lock-screen-names", "include-channels", "include-muted-chats", "count-unread-messages", "new-contacts", "pinned-messages", "reset", "web"
    }
  | SettingsSectionPowerSaving -- ^ The power saving settings section
    { subsection :: Maybe T.Text -- ^ Subsection of the section; may be one of "", "videos", "gifs", "stickers", "emoji", "effects", "preload", "background", "call-animations", "particles", "transitions"
    }
  | SettingsSectionPremium -- ^ The "Telegram Premium" section
  | SettingsSectionPrivacyAndSecurity -- ^ The privacy and security section
    { subsection :: Maybe T.Text -- ^ Subsection of the section; may be one of "", "blocked", "blocked/edit", "blocked/block-user", "blocked/block-user/chats", "blocked/block-user/contacts", "active-websites", "active-websites/edit", "active-websites/disconnect-all", "passcode", "passcode/disable", "passcode/change", "passcode/auto-lock", "passcode/face-id", "passcode/fingerprint", "2sv", "2sv/change", "2sv/disable", "2sv/change-email", "passkey", "passkey/create", "auto-delete", "auto-delete/set-custom", "login-email", "phone-number", "phone-number/never", "phone-number/always", "last-seen", "last-seen/never", "last-seen/always", "last-seen/hide-read-time", "profile-photos", "profile-photos/never", "profile-photos/always", "profile-photos/set-public", "profile-photos/update-public", "profile-photos/remove-public", "bio", "bio/never", "bio/always", "gifts", "gifts/show-icon", "gifts/never", "gifts/always", "gifts/accepted-types", "birthday", "birthday/add", "birthday/never", "birthday/always", "saved-music", "saved-music/never", "saved-music/always", "forwards", "forwards/never", "forwards/always", "calls", "calls/never", "calls/always", "calls/p2p", "calls/p2p/never", "calls/p2p/always", "calls/ios-integration", "voice", "voice/never", "voice/always", "messages", "messages/set-price", "messages/exceptions", "invites", "invites/never", "invites/always", "self-destruct", "data-settings", "data-settings/sync-contacts", "data-settings/delete-synced", "data-settings/suggest-contacts", "data-settings/delete-cloud-drafts", "data-settings/clear-payment-info", "data-settings/link-previews", "data-settings/bot-settings", "data-settings/map-provider", "archive-and-mute"
    }
  | SettingsSectionPrivacyPolicy -- ^ The "Privacy Policy" section
  | SettingsSectionQrCode -- ^ The current user's QR code section
    { subsection :: Maybe T.Text -- ^ Subsection of the section; may be one of "", "share", "scan"
    }
  | SettingsSectionSearch -- ^ Search in Settings
  | SettingsSectionSendGift -- ^ The "Send a gift" section
    { subsection :: Maybe T.Text -- ^ Subsection of the section; may be one of "", "self"
    }
  deriving (SettingsSection -> SettingsSection -> Bool
(SettingsSection -> SettingsSection -> Bool)
-> (SettingsSection -> SettingsSection -> Bool)
-> Eq SettingsSection
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SettingsSection -> SettingsSection -> Bool
== :: SettingsSection -> SettingsSection -> Bool
$c/= :: SettingsSection -> SettingsSection -> Bool
/= :: SettingsSection -> SettingsSection -> Bool
Eq, Int -> SettingsSection -> ShowS
[SettingsSection] -> ShowS
SettingsSection -> String
(Int -> SettingsSection -> ShowS)
-> (SettingsSection -> String)
-> ([SettingsSection] -> ShowS)
-> Show SettingsSection
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SettingsSection -> ShowS
showsPrec :: Int -> SettingsSection -> ShowS
$cshow :: SettingsSection -> String
show :: SettingsSection -> String
$cshowList :: [SettingsSection] -> ShowS
showList :: [SettingsSection] -> ShowS
Show)

instance I.ShortShow SettingsSection where
  shortShow :: SettingsSection -> String
shortShow SettingsSectionAppearance
    { subsection :: SettingsSection -> Maybe Text
subsection = Maybe Text
subsection_
    }
      = String
"SettingsSectionAppearance"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"subsection" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
subsection_
        ]
  shortShow SettingsSection
SettingsSectionAskQuestion
      = String
"SettingsSectionAskQuestion"
  shortShow SettingsSectionBusiness
    { subsection :: SettingsSection -> Maybe Text
subsection = Maybe Text
subsection_
    }
      = String
"SettingsSectionBusiness"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"subsection" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
subsection_
        ]
  shortShow SettingsSectionChatFolders
    { subsection :: SettingsSection -> Maybe Text
subsection = Maybe Text
subsection_
    }
      = String
"SettingsSectionChatFolders"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"subsection" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
subsection_
        ]
  shortShow SettingsSectionDataAndStorage
    { subsection :: SettingsSection -> Maybe Text
subsection = Maybe Text
subsection_
    }
      = String
"SettingsSectionDataAndStorage"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"subsection" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
subsection_
        ]
  shortShow SettingsSectionDevices
    { subsection :: SettingsSection -> Maybe Text
subsection = Maybe Text
subsection_
    }
      = String
"SettingsSectionDevices"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"subsection" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
subsection_
        ]
  shortShow SettingsSectionEditProfile
    { subsection :: SettingsSection -> Maybe Text
subsection = Maybe Text
subsection_
    }
      = String
"SettingsSectionEditProfile"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"subsection" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
subsection_
        ]
  shortShow SettingsSection
SettingsSectionFaq
      = String
"SettingsSectionFaq"
  shortShow SettingsSection
SettingsSectionFeatures
      = String
"SettingsSectionFeatures"
  shortShow SettingsSectionInAppBrowser
    { subsection :: SettingsSection -> Maybe Text
subsection = Maybe Text
subsection_
    }
      = String
"SettingsSectionInAppBrowser"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"subsection" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
subsection_
        ]
  shortShow SettingsSectionLanguage
    { subsection :: SettingsSection -> Maybe Text
subsection = Maybe Text
subsection_
    }
      = String
"SettingsSectionLanguage"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"subsection" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
subsection_
        ]
  shortShow SettingsSectionMyStars
    { subsection :: SettingsSection -> Maybe Text
subsection = Maybe Text
subsection_
    }
      = String
"SettingsSectionMyStars"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"subsection" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
subsection_
        ]
  shortShow SettingsSection
SettingsSectionMyToncoins
      = String
"SettingsSectionMyToncoins"
  shortShow SettingsSectionNotifications
    { subsection :: SettingsSection -> Maybe Text
subsection = Maybe Text
subsection_
    }
      = String
"SettingsSectionNotifications"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"subsection" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
subsection_
        ]
  shortShow SettingsSectionPowerSaving
    { subsection :: SettingsSection -> Maybe Text
subsection = Maybe Text
subsection_
    }
      = String
"SettingsSectionPowerSaving"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"subsection" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
subsection_
        ]
  shortShow SettingsSection
SettingsSectionPremium
      = String
"SettingsSectionPremium"
  shortShow SettingsSectionPrivacyAndSecurity
    { subsection :: SettingsSection -> Maybe Text
subsection = Maybe Text
subsection_
    }
      = String
"SettingsSectionPrivacyAndSecurity"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"subsection" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
subsection_
        ]
  shortShow SettingsSection
SettingsSectionPrivacyPolicy
      = String
"SettingsSectionPrivacyPolicy"
  shortShow SettingsSectionQrCode
    { subsection :: SettingsSection -> Maybe Text
subsection = Maybe Text
subsection_
    }
      = String
"SettingsSectionQrCode"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"subsection" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
subsection_
        ]
  shortShow SettingsSection
SettingsSectionSearch
      = String
"SettingsSectionSearch"
  shortShow SettingsSectionSendGift
    { subsection :: SettingsSection -> Maybe Text
subsection = Maybe Text
subsection_
    }
      = String
"SettingsSectionSendGift"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"subsection" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
subsection_
        ]

instance AT.FromJSON SettingsSection where
  parseJSON :: Value -> Parser SettingsSection
parseJSON v :: Value
v@(AT.Object Object
obj) = do
    String
t <- Object
obj Object -> Key -> Parser String
forall a. FromJSON a => Object -> Key -> Parser a
A..: Key
"@type" :: AT.Parser String

    case String
t of
      String
"settingsSectionAppearance"         -> Value -> Parser SettingsSection
parseSettingsSectionAppearance Value
v
      String
"settingsSectionAskQuestion"        -> SettingsSection -> Parser SettingsSection
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure SettingsSection
SettingsSectionAskQuestion
      String
"settingsSectionBusiness"           -> Value -> Parser SettingsSection
parseSettingsSectionBusiness Value
v
      String
"settingsSectionChatFolders"        -> Value -> Parser SettingsSection
parseSettingsSectionChatFolders Value
v
      String
"settingsSectionDataAndStorage"     -> Value -> Parser SettingsSection
parseSettingsSectionDataAndStorage Value
v
      String
"settingsSectionDevices"            -> Value -> Parser SettingsSection
parseSettingsSectionDevices Value
v
      String
"settingsSectionEditProfile"        -> Value -> Parser SettingsSection
parseSettingsSectionEditProfile Value
v
      String
"settingsSectionFaq"                -> SettingsSection -> Parser SettingsSection
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure SettingsSection
SettingsSectionFaq
      String
"settingsSectionFeatures"           -> SettingsSection -> Parser SettingsSection
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure SettingsSection
SettingsSectionFeatures
      String
"settingsSectionInAppBrowser"       -> Value -> Parser SettingsSection
parseSettingsSectionInAppBrowser Value
v
      String
"settingsSectionLanguage"           -> Value -> Parser SettingsSection
parseSettingsSectionLanguage Value
v
      String
"settingsSectionMyStars"            -> Value -> Parser SettingsSection
parseSettingsSectionMyStars Value
v
      String
"settingsSectionMyToncoins"         -> SettingsSection -> Parser SettingsSection
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure SettingsSection
SettingsSectionMyToncoins
      String
"settingsSectionNotifications"      -> Value -> Parser SettingsSection
parseSettingsSectionNotifications Value
v
      String
"settingsSectionPowerSaving"        -> Value -> Parser SettingsSection
parseSettingsSectionPowerSaving Value
v
      String
"settingsSectionPremium"            -> SettingsSection -> Parser SettingsSection
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure SettingsSection
SettingsSectionPremium
      String
"settingsSectionPrivacyAndSecurity" -> Value -> Parser SettingsSection
parseSettingsSectionPrivacyAndSecurity Value
v
      String
"settingsSectionPrivacyPolicy"      -> SettingsSection -> Parser SettingsSection
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure SettingsSection
SettingsSectionPrivacyPolicy
      String
"settingsSectionQrCode"             -> Value -> Parser SettingsSection
parseSettingsSectionQrCode Value
v
      String
"settingsSectionSearch"             -> SettingsSection -> Parser SettingsSection
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure SettingsSection
SettingsSectionSearch
      String
"settingsSectionSendGift"           -> Value -> Parser SettingsSection
parseSettingsSectionSendGift Value
v
      String
_                                   -> Parser SettingsSection
forall a. Monoid a => a
mempty
    
    where
      parseSettingsSectionAppearance :: A.Value -> AT.Parser SettingsSection
      parseSettingsSectionAppearance :: Value -> Parser SettingsSection
parseSettingsSectionAppearance = String
-> (Object -> Parser SettingsSection)
-> Value
-> Parser SettingsSection
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"SettingsSectionAppearance" ((Object -> Parser SettingsSection)
 -> Value -> Parser SettingsSection)
-> (Object -> Parser SettingsSection)
-> Value
-> Parser SettingsSection
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Text
subsection_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"subsection"
        SettingsSection -> Parser SettingsSection
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (SettingsSection -> Parser SettingsSection)
-> SettingsSection -> Parser SettingsSection
forall a b. (a -> b) -> a -> b
$ SettingsSectionAppearance
          { subsection :: Maybe Text
subsection = Maybe Text
subsection_
          }
      parseSettingsSectionBusiness :: A.Value -> AT.Parser SettingsSection
      parseSettingsSectionBusiness :: Value -> Parser SettingsSection
parseSettingsSectionBusiness = String
-> (Object -> Parser SettingsSection)
-> Value
-> Parser SettingsSection
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"SettingsSectionBusiness" ((Object -> Parser SettingsSection)
 -> Value -> Parser SettingsSection)
-> (Object -> Parser SettingsSection)
-> Value
-> Parser SettingsSection
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Text
subsection_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"subsection"
        SettingsSection -> Parser SettingsSection
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (SettingsSection -> Parser SettingsSection)
-> SettingsSection -> Parser SettingsSection
forall a b. (a -> b) -> a -> b
$ SettingsSectionBusiness
          { subsection :: Maybe Text
subsection = Maybe Text
subsection_
          }
      parseSettingsSectionChatFolders :: A.Value -> AT.Parser SettingsSection
      parseSettingsSectionChatFolders :: Value -> Parser SettingsSection
parseSettingsSectionChatFolders = String
-> (Object -> Parser SettingsSection)
-> Value
-> Parser SettingsSection
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"SettingsSectionChatFolders" ((Object -> Parser SettingsSection)
 -> Value -> Parser SettingsSection)
-> (Object -> Parser SettingsSection)
-> Value
-> Parser SettingsSection
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Text
subsection_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"subsection"
        SettingsSection -> Parser SettingsSection
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (SettingsSection -> Parser SettingsSection)
-> SettingsSection -> Parser SettingsSection
forall a b. (a -> b) -> a -> b
$ SettingsSectionChatFolders
          { subsection :: Maybe Text
subsection = Maybe Text
subsection_
          }
      parseSettingsSectionDataAndStorage :: A.Value -> AT.Parser SettingsSection
      parseSettingsSectionDataAndStorage :: Value -> Parser SettingsSection
parseSettingsSectionDataAndStorage = String
-> (Object -> Parser SettingsSection)
-> Value
-> Parser SettingsSection
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"SettingsSectionDataAndStorage" ((Object -> Parser SettingsSection)
 -> Value -> Parser SettingsSection)
-> (Object -> Parser SettingsSection)
-> Value
-> Parser SettingsSection
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Text
subsection_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"subsection"
        SettingsSection -> Parser SettingsSection
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (SettingsSection -> Parser SettingsSection)
-> SettingsSection -> Parser SettingsSection
forall a b. (a -> b) -> a -> b
$ SettingsSectionDataAndStorage
          { subsection :: Maybe Text
subsection = Maybe Text
subsection_
          }
      parseSettingsSectionDevices :: A.Value -> AT.Parser SettingsSection
      parseSettingsSectionDevices :: Value -> Parser SettingsSection
parseSettingsSectionDevices = String
-> (Object -> Parser SettingsSection)
-> Value
-> Parser SettingsSection
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"SettingsSectionDevices" ((Object -> Parser SettingsSection)
 -> Value -> Parser SettingsSection)
-> (Object -> Parser SettingsSection)
-> Value
-> Parser SettingsSection
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Text
subsection_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"subsection"
        SettingsSection -> Parser SettingsSection
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (SettingsSection -> Parser SettingsSection)
-> SettingsSection -> Parser SettingsSection
forall a b. (a -> b) -> a -> b
$ SettingsSectionDevices
          { subsection :: Maybe Text
subsection = Maybe Text
subsection_
          }
      parseSettingsSectionEditProfile :: A.Value -> AT.Parser SettingsSection
      parseSettingsSectionEditProfile :: Value -> Parser SettingsSection
parseSettingsSectionEditProfile = String
-> (Object -> Parser SettingsSection)
-> Value
-> Parser SettingsSection
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"SettingsSectionEditProfile" ((Object -> Parser SettingsSection)
 -> Value -> Parser SettingsSection)
-> (Object -> Parser SettingsSection)
-> Value
-> Parser SettingsSection
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Text
subsection_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"subsection"
        SettingsSection -> Parser SettingsSection
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (SettingsSection -> Parser SettingsSection)
-> SettingsSection -> Parser SettingsSection
forall a b. (a -> b) -> a -> b
$ SettingsSectionEditProfile
          { subsection :: Maybe Text
subsection = Maybe Text
subsection_
          }
      parseSettingsSectionInAppBrowser :: A.Value -> AT.Parser SettingsSection
      parseSettingsSectionInAppBrowser :: Value -> Parser SettingsSection
parseSettingsSectionInAppBrowser = String
-> (Object -> Parser SettingsSection)
-> Value
-> Parser SettingsSection
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"SettingsSectionInAppBrowser" ((Object -> Parser SettingsSection)
 -> Value -> Parser SettingsSection)
-> (Object -> Parser SettingsSection)
-> Value
-> Parser SettingsSection
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Text
subsection_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"subsection"
        SettingsSection -> Parser SettingsSection
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (SettingsSection -> Parser SettingsSection)
-> SettingsSection -> Parser SettingsSection
forall a b. (a -> b) -> a -> b
$ SettingsSectionInAppBrowser
          { subsection :: Maybe Text
subsection = Maybe Text
subsection_
          }
      parseSettingsSectionLanguage :: A.Value -> AT.Parser SettingsSection
      parseSettingsSectionLanguage :: Value -> Parser SettingsSection
parseSettingsSectionLanguage = String
-> (Object -> Parser SettingsSection)
-> Value
-> Parser SettingsSection
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"SettingsSectionLanguage" ((Object -> Parser SettingsSection)
 -> Value -> Parser SettingsSection)
-> (Object -> Parser SettingsSection)
-> Value
-> Parser SettingsSection
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Text
subsection_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"subsection"
        SettingsSection -> Parser SettingsSection
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (SettingsSection -> Parser SettingsSection)
-> SettingsSection -> Parser SettingsSection
forall a b. (a -> b) -> a -> b
$ SettingsSectionLanguage
          { subsection :: Maybe Text
subsection = Maybe Text
subsection_
          }
      parseSettingsSectionMyStars :: A.Value -> AT.Parser SettingsSection
      parseSettingsSectionMyStars :: Value -> Parser SettingsSection
parseSettingsSectionMyStars = String
-> (Object -> Parser SettingsSection)
-> Value
-> Parser SettingsSection
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"SettingsSectionMyStars" ((Object -> Parser SettingsSection)
 -> Value -> Parser SettingsSection)
-> (Object -> Parser SettingsSection)
-> Value
-> Parser SettingsSection
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Text
subsection_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"subsection"
        SettingsSection -> Parser SettingsSection
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (SettingsSection -> Parser SettingsSection)
-> SettingsSection -> Parser SettingsSection
forall a b. (a -> b) -> a -> b
$ SettingsSectionMyStars
          { subsection :: Maybe Text
subsection = Maybe Text
subsection_
          }
      parseSettingsSectionNotifications :: A.Value -> AT.Parser SettingsSection
      parseSettingsSectionNotifications :: Value -> Parser SettingsSection
parseSettingsSectionNotifications = String
-> (Object -> Parser SettingsSection)
-> Value
-> Parser SettingsSection
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"SettingsSectionNotifications" ((Object -> Parser SettingsSection)
 -> Value -> Parser SettingsSection)
-> (Object -> Parser SettingsSection)
-> Value
-> Parser SettingsSection
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Text
subsection_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"subsection"
        SettingsSection -> Parser SettingsSection
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (SettingsSection -> Parser SettingsSection)
-> SettingsSection -> Parser SettingsSection
forall a b. (a -> b) -> a -> b
$ SettingsSectionNotifications
          { subsection :: Maybe Text
subsection = Maybe Text
subsection_
          }
      parseSettingsSectionPowerSaving :: A.Value -> AT.Parser SettingsSection
      parseSettingsSectionPowerSaving :: Value -> Parser SettingsSection
parseSettingsSectionPowerSaving = String
-> (Object -> Parser SettingsSection)
-> Value
-> Parser SettingsSection
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"SettingsSectionPowerSaving" ((Object -> Parser SettingsSection)
 -> Value -> Parser SettingsSection)
-> (Object -> Parser SettingsSection)
-> Value
-> Parser SettingsSection
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Text
subsection_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"subsection"
        SettingsSection -> Parser SettingsSection
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (SettingsSection -> Parser SettingsSection)
-> SettingsSection -> Parser SettingsSection
forall a b. (a -> b) -> a -> b
$ SettingsSectionPowerSaving
          { subsection :: Maybe Text
subsection = Maybe Text
subsection_
          }
      parseSettingsSectionPrivacyAndSecurity :: A.Value -> AT.Parser SettingsSection
      parseSettingsSectionPrivacyAndSecurity :: Value -> Parser SettingsSection
parseSettingsSectionPrivacyAndSecurity = String
-> (Object -> Parser SettingsSection)
-> Value
-> Parser SettingsSection
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"SettingsSectionPrivacyAndSecurity" ((Object -> Parser SettingsSection)
 -> Value -> Parser SettingsSection)
-> (Object -> Parser SettingsSection)
-> Value
-> Parser SettingsSection
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Text
subsection_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"subsection"
        SettingsSection -> Parser SettingsSection
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (SettingsSection -> Parser SettingsSection)
-> SettingsSection -> Parser SettingsSection
forall a b. (a -> b) -> a -> b
$ SettingsSectionPrivacyAndSecurity
          { subsection :: Maybe Text
subsection = Maybe Text
subsection_
          }
      parseSettingsSectionQrCode :: A.Value -> AT.Parser SettingsSection
      parseSettingsSectionQrCode :: Value -> Parser SettingsSection
parseSettingsSectionQrCode = String
-> (Object -> Parser SettingsSection)
-> Value
-> Parser SettingsSection
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"SettingsSectionQrCode" ((Object -> Parser SettingsSection)
 -> Value -> Parser SettingsSection)
-> (Object -> Parser SettingsSection)
-> Value
-> Parser SettingsSection
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Text
subsection_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"subsection"
        SettingsSection -> Parser SettingsSection
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (SettingsSection -> Parser SettingsSection)
-> SettingsSection -> Parser SettingsSection
forall a b. (a -> b) -> a -> b
$ SettingsSectionQrCode
          { subsection :: Maybe Text
subsection = Maybe Text
subsection_
          }
      parseSettingsSectionSendGift :: A.Value -> AT.Parser SettingsSection
      parseSettingsSectionSendGift :: Value -> Parser SettingsSection
parseSettingsSectionSendGift = String
-> (Object -> Parser SettingsSection)
-> Value
-> Parser SettingsSection
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"SettingsSectionSendGift" ((Object -> Parser SettingsSection)
 -> Value -> Parser SettingsSection)
-> (Object -> Parser SettingsSection)
-> Value
-> Parser SettingsSection
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Text
subsection_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"subsection"
        SettingsSection -> Parser SettingsSection
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (SettingsSection -> Parser SettingsSection)
-> SettingsSection -> Parser SettingsSection
forall a b. (a -> b) -> a -> b
$ SettingsSectionSendGift
          { subsection :: Maybe Text
subsection = Maybe Text
subsection_
          }
  parseJSON Value
_ = Parser SettingsSection
forall a. Monoid a => a
mempty

instance AT.ToJSON SettingsSection where
  toJSON :: SettingsSection -> Value
toJSON SettingsSectionAppearance
    { subsection :: SettingsSection -> Maybe Text
subsection = Maybe Text
subsection_
    }
      = [Pair] -> Value
A.object
        [ Key
"@type"      Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"settingsSectionAppearance"
        , Key
"subsection" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
subsection_
        ]
  toJSON SettingsSection
SettingsSectionAskQuestion
      = [Pair] -> Value
A.object
        [ Key
"@type" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"settingsSectionAskQuestion"
        ]
  toJSON SettingsSectionBusiness
    { subsection :: SettingsSection -> Maybe Text
subsection = Maybe Text
subsection_
    }
      = [Pair] -> Value
A.object
        [ Key
"@type"      Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"settingsSectionBusiness"
        , Key
"subsection" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
subsection_
        ]
  toJSON SettingsSectionChatFolders
    { subsection :: SettingsSection -> Maybe Text
subsection = Maybe Text
subsection_
    }
      = [Pair] -> Value
A.object
        [ Key
"@type"      Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"settingsSectionChatFolders"
        , Key
"subsection" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
subsection_
        ]
  toJSON SettingsSectionDataAndStorage
    { subsection :: SettingsSection -> Maybe Text
subsection = Maybe Text
subsection_
    }
      = [Pair] -> Value
A.object
        [ Key
"@type"      Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"settingsSectionDataAndStorage"
        , Key
"subsection" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
subsection_
        ]
  toJSON SettingsSectionDevices
    { subsection :: SettingsSection -> Maybe Text
subsection = Maybe Text
subsection_
    }
      = [Pair] -> Value
A.object
        [ Key
"@type"      Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"settingsSectionDevices"
        , Key
"subsection" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
subsection_
        ]
  toJSON SettingsSectionEditProfile
    { subsection :: SettingsSection -> Maybe Text
subsection = Maybe Text
subsection_
    }
      = [Pair] -> Value
A.object
        [ Key
"@type"      Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"settingsSectionEditProfile"
        , Key
"subsection" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
subsection_
        ]
  toJSON SettingsSection
SettingsSectionFaq
      = [Pair] -> Value
A.object
        [ Key
"@type" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"settingsSectionFaq"
        ]
  toJSON SettingsSection
SettingsSectionFeatures
      = [Pair] -> Value
A.object
        [ Key
"@type" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"settingsSectionFeatures"
        ]
  toJSON SettingsSectionInAppBrowser
    { subsection :: SettingsSection -> Maybe Text
subsection = Maybe Text
subsection_
    }
      = [Pair] -> Value
A.object
        [ Key
"@type"      Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"settingsSectionInAppBrowser"
        , Key
"subsection" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
subsection_
        ]
  toJSON SettingsSectionLanguage
    { subsection :: SettingsSection -> Maybe Text
subsection = Maybe Text
subsection_
    }
      = [Pair] -> Value
A.object
        [ Key
"@type"      Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"settingsSectionLanguage"
        , Key
"subsection" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
subsection_
        ]
  toJSON SettingsSectionMyStars
    { subsection :: SettingsSection -> Maybe Text
subsection = Maybe Text
subsection_
    }
      = [Pair] -> Value
A.object
        [ Key
"@type"      Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"settingsSectionMyStars"
        , Key
"subsection" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
subsection_
        ]
  toJSON SettingsSection
SettingsSectionMyToncoins
      = [Pair] -> Value
A.object
        [ Key
"@type" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"settingsSectionMyToncoins"
        ]
  toJSON SettingsSectionNotifications
    { subsection :: SettingsSection -> Maybe Text
subsection = Maybe Text
subsection_
    }
      = [Pair] -> Value
A.object
        [ Key
"@type"      Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"settingsSectionNotifications"
        , Key
"subsection" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
subsection_
        ]
  toJSON SettingsSectionPowerSaving
    { subsection :: SettingsSection -> Maybe Text
subsection = Maybe Text
subsection_
    }
      = [Pair] -> Value
A.object
        [ Key
"@type"      Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"settingsSectionPowerSaving"
        , Key
"subsection" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
subsection_
        ]
  toJSON SettingsSection
SettingsSectionPremium
      = [Pair] -> Value
A.object
        [ Key
"@type" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"settingsSectionPremium"
        ]
  toJSON SettingsSectionPrivacyAndSecurity
    { subsection :: SettingsSection -> Maybe Text
subsection = Maybe Text
subsection_
    }
      = [Pair] -> Value
A.object
        [ Key
"@type"      Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"settingsSectionPrivacyAndSecurity"
        , Key
"subsection" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
subsection_
        ]
  toJSON SettingsSection
SettingsSectionPrivacyPolicy
      = [Pair] -> Value
A.object
        [ Key
"@type" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"settingsSectionPrivacyPolicy"
        ]
  toJSON SettingsSectionQrCode
    { subsection :: SettingsSection -> Maybe Text
subsection = Maybe Text
subsection_
    }
      = [Pair] -> Value
A.object
        [ Key
"@type"      Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"settingsSectionQrCode"
        , Key
"subsection" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
subsection_
        ]
  toJSON SettingsSection
SettingsSectionSearch
      = [Pair] -> Value
A.object
        [ Key
"@type" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"settingsSectionSearch"
        ]
  toJSON SettingsSectionSendGift
    { subsection :: SettingsSection -> Maybe Text
subsection = Maybe Text
subsection_
    }
      = [Pair] -> Value
A.object
        [ Key
"@type"      Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"settingsSectionSendGift"
        , Key
"subsection" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
subsection_
        ]