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
data SettingsSection
= SettingsSectionAppearance
{ SettingsSection -> Maybe Text
subsection :: Maybe T.Text
}
| SettingsSectionAskQuestion
| SettingsSectionBusiness
{ subsection :: Maybe T.Text
}
| SettingsSectionChatFolders
{ subsection :: Maybe T.Text
}
| SettingsSectionDataAndStorage
{ subsection :: Maybe T.Text
}
| SettingsSectionDevices
{ subsection :: Maybe T.Text
}
| SettingsSectionEditProfile
{ subsection :: Maybe T.Text
}
| SettingsSectionFaq
| SettingsSectionFeatures
| SettingsSectionInAppBrowser
{ subsection :: Maybe T.Text
}
| SettingsSectionLanguage
{ subsection :: Maybe T.Text
}
| SettingsSectionMyStars
{ subsection :: Maybe T.Text
}
| SettingsSectionMyToncoins
| SettingsSectionNotifications
{ subsection :: Maybe T.Text
}
| SettingsSectionPowerSaving
{ subsection :: Maybe T.Text
}
| SettingsSectionPremium
| SettingsSectionPrivacyAndSecurity
{ subsection :: Maybe T.Text
}
| SettingsSectionPrivacyPolicy
| SettingsSectionQrCode
{ subsection :: Maybe T.Text
}
| SettingsSectionSearch
| SettingsSectionSendGift
{ subsection :: Maybe T.Text
}
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_
]