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