module TD.Query.SetAuthenticationPhoneNumber
(SetAuthenticationPhoneNumber(..)
, defaultSetAuthenticationPhoneNumber
) 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
import qualified TD.Data.PhoneNumberAuthenticationSettings as PhoneNumberAuthenticationSettings
data SetAuthenticationPhoneNumber
= SetAuthenticationPhoneNumber
{ SetAuthenticationPhoneNumber -> Maybe Text
phone_number :: Maybe T.Text
, SetAuthenticationPhoneNumber
-> Maybe PhoneNumberAuthenticationSettings
settings :: Maybe PhoneNumberAuthenticationSettings.PhoneNumberAuthenticationSettings
}
deriving (SetAuthenticationPhoneNumber
-> SetAuthenticationPhoneNumber -> Bool
(SetAuthenticationPhoneNumber
-> SetAuthenticationPhoneNumber -> Bool)
-> (SetAuthenticationPhoneNumber
-> SetAuthenticationPhoneNumber -> Bool)
-> Eq SetAuthenticationPhoneNumber
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SetAuthenticationPhoneNumber
-> SetAuthenticationPhoneNumber -> Bool
== :: SetAuthenticationPhoneNumber
-> SetAuthenticationPhoneNumber -> Bool
$c/= :: SetAuthenticationPhoneNumber
-> SetAuthenticationPhoneNumber -> Bool
/= :: SetAuthenticationPhoneNumber
-> SetAuthenticationPhoneNumber -> Bool
Eq, Int -> SetAuthenticationPhoneNumber -> ShowS
[SetAuthenticationPhoneNumber] -> ShowS
SetAuthenticationPhoneNumber -> String
(Int -> SetAuthenticationPhoneNumber -> ShowS)
-> (SetAuthenticationPhoneNumber -> String)
-> ([SetAuthenticationPhoneNumber] -> ShowS)
-> Show SetAuthenticationPhoneNumber
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SetAuthenticationPhoneNumber -> ShowS
showsPrec :: Int -> SetAuthenticationPhoneNumber -> ShowS
$cshow :: SetAuthenticationPhoneNumber -> String
show :: SetAuthenticationPhoneNumber -> String
$cshowList :: [SetAuthenticationPhoneNumber] -> ShowS
showList :: [SetAuthenticationPhoneNumber] -> ShowS
Show)
instance I.ShortShow SetAuthenticationPhoneNumber where
shortShow :: SetAuthenticationPhoneNumber -> String
shortShow
SetAuthenticationPhoneNumber
{ phone_number :: SetAuthenticationPhoneNumber -> Maybe Text
phone_number = Maybe Text
phone_number_
, settings :: SetAuthenticationPhoneNumber
-> Maybe PhoneNumberAuthenticationSettings
settings = Maybe PhoneNumberAuthenticationSettings
settings_
}
= String
"SetAuthenticationPhoneNumber"
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
"settings" String -> Maybe PhoneNumberAuthenticationSettings -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe PhoneNumberAuthenticationSettings
settings_
]
instance AT.ToJSON SetAuthenticationPhoneNumber where
toJSON :: SetAuthenticationPhoneNumber -> Value
toJSON
SetAuthenticationPhoneNumber
{ phone_number :: SetAuthenticationPhoneNumber -> Maybe Text
phone_number = Maybe Text
phone_number_
, settings :: SetAuthenticationPhoneNumber
-> Maybe PhoneNumberAuthenticationSettings
settings = Maybe PhoneNumberAuthenticationSettings
settings_
}
= [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
"setAuthenticationPhoneNumber"
, 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
"settings" Key -> Maybe PhoneNumberAuthenticationSettings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe PhoneNumberAuthenticationSettings
settings_
]
defaultSetAuthenticationPhoneNumber :: SetAuthenticationPhoneNumber
defaultSetAuthenticationPhoneNumber :: SetAuthenticationPhoneNumber
defaultSetAuthenticationPhoneNumber =
SetAuthenticationPhoneNumber
{ phone_number :: Maybe Text
phone_number = Maybe Text
forall a. Maybe a
Nothing
, settings :: Maybe PhoneNumberAuthenticationSettings
settings = Maybe PhoneNumberAuthenticationSettings
forall a. Maybe a
Nothing
}