module TD.Query.SetAutoDownloadSettings
(SetAutoDownloadSettings(..)
, defaultSetAutoDownloadSettings
) where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as AT
import qualified TD.Lib.Internal as I
import qualified TD.Data.AutoDownloadSettings as AutoDownloadSettings
import qualified TD.Data.NetworkType as NetworkType
data SetAutoDownloadSettings
= SetAutoDownloadSettings
{ SetAutoDownloadSettings -> Maybe AutoDownloadSettings
settings :: Maybe AutoDownloadSettings.AutoDownloadSettings
, SetAutoDownloadSettings -> Maybe NetworkType
_type :: Maybe NetworkType.NetworkType
}
deriving (SetAutoDownloadSettings -> SetAutoDownloadSettings -> Bool
(SetAutoDownloadSettings -> SetAutoDownloadSettings -> Bool)
-> (SetAutoDownloadSettings -> SetAutoDownloadSettings -> Bool)
-> Eq SetAutoDownloadSettings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SetAutoDownloadSettings -> SetAutoDownloadSettings -> Bool
== :: SetAutoDownloadSettings -> SetAutoDownloadSettings -> Bool
$c/= :: SetAutoDownloadSettings -> SetAutoDownloadSettings -> Bool
/= :: SetAutoDownloadSettings -> SetAutoDownloadSettings -> Bool
Eq, Int -> SetAutoDownloadSettings -> ShowS
[SetAutoDownloadSettings] -> ShowS
SetAutoDownloadSettings -> String
(Int -> SetAutoDownloadSettings -> ShowS)
-> (SetAutoDownloadSettings -> String)
-> ([SetAutoDownloadSettings] -> ShowS)
-> Show SetAutoDownloadSettings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SetAutoDownloadSettings -> ShowS
showsPrec :: Int -> SetAutoDownloadSettings -> ShowS
$cshow :: SetAutoDownloadSettings -> String
show :: SetAutoDownloadSettings -> String
$cshowList :: [SetAutoDownloadSettings] -> ShowS
showList :: [SetAutoDownloadSettings] -> ShowS
Show)
instance I.ShortShow SetAutoDownloadSettings where
shortShow :: SetAutoDownloadSettings -> String
shortShow
SetAutoDownloadSettings
{ settings :: SetAutoDownloadSettings -> Maybe AutoDownloadSettings
settings = Maybe AutoDownloadSettings
settings_
, _type :: SetAutoDownloadSettings -> Maybe NetworkType
_type = Maybe NetworkType
_type_
}
= String
"SetAutoDownloadSettings"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"settings" String -> Maybe AutoDownloadSettings -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe AutoDownloadSettings
settings_
, String
"_type" String -> Maybe NetworkType -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe NetworkType
_type_
]
instance AT.ToJSON SetAutoDownloadSettings where
toJSON :: SetAutoDownloadSettings -> Value
toJSON
SetAutoDownloadSettings
{ settings :: SetAutoDownloadSettings -> Maybe AutoDownloadSettings
settings = Maybe AutoDownloadSettings
settings_
, _type :: SetAutoDownloadSettings -> Maybe NetworkType
_type = Maybe NetworkType
_type_
}
= [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
"setAutoDownloadSettings"
, Key
"settings" Key -> Maybe AutoDownloadSettings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe AutoDownloadSettings
settings_
, Key
"type" Key -> Maybe NetworkType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe NetworkType
_type_
]
defaultSetAutoDownloadSettings :: SetAutoDownloadSettings
defaultSetAutoDownloadSettings :: SetAutoDownloadSettings
defaultSetAutoDownloadSettings =
SetAutoDownloadSettings
{ settings :: Maybe AutoDownloadSettings
settings = Maybe AutoDownloadSettings
forall a. Maybe a
Nothing
, _type :: Maybe NetworkType
_type = Maybe NetworkType
forall a. Maybe a
Nothing
}