module TD.Query.GetPreferredCountryLanguage
(GetPreferredCountryLanguage(..)
) 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 GetPreferredCountryLanguage
= GetPreferredCountryLanguage
{ GetPreferredCountryLanguage -> Maybe Text
country_code :: Maybe T.Text
}
deriving (GetPreferredCountryLanguage -> GetPreferredCountryLanguage -> Bool
(GetPreferredCountryLanguage
-> GetPreferredCountryLanguage -> Bool)
-> (GetPreferredCountryLanguage
-> GetPreferredCountryLanguage -> Bool)
-> Eq GetPreferredCountryLanguage
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GetPreferredCountryLanguage -> GetPreferredCountryLanguage -> Bool
== :: GetPreferredCountryLanguage -> GetPreferredCountryLanguage -> Bool
$c/= :: GetPreferredCountryLanguage -> GetPreferredCountryLanguage -> Bool
/= :: GetPreferredCountryLanguage -> GetPreferredCountryLanguage -> Bool
Eq, Int -> GetPreferredCountryLanguage -> ShowS
[GetPreferredCountryLanguage] -> ShowS
GetPreferredCountryLanguage -> String
(Int -> GetPreferredCountryLanguage -> ShowS)
-> (GetPreferredCountryLanguage -> String)
-> ([GetPreferredCountryLanguage] -> ShowS)
-> Show GetPreferredCountryLanguage
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GetPreferredCountryLanguage -> ShowS
showsPrec :: Int -> GetPreferredCountryLanguage -> ShowS
$cshow :: GetPreferredCountryLanguage -> String
show :: GetPreferredCountryLanguage -> String
$cshowList :: [GetPreferredCountryLanguage] -> ShowS
showList :: [GetPreferredCountryLanguage] -> ShowS
Show)
instance I.ShortShow GetPreferredCountryLanguage where
shortShow :: GetPreferredCountryLanguage -> String
shortShow
GetPreferredCountryLanguage
{ country_code :: GetPreferredCountryLanguage -> Maybe Text
country_code = Maybe Text
country_code_
}
= String
"GetPreferredCountryLanguage"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"country_code" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
country_code_
]
instance AT.ToJSON GetPreferredCountryLanguage where
toJSON :: GetPreferredCountryLanguage -> Value
toJSON
GetPreferredCountryLanguage
{ country_code :: GetPreferredCountryLanguage -> Maybe Text
country_code = Maybe Text
country_code_
}
= [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
"getPreferredCountryLanguage"
, Key
"country_code" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
country_code_
]