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