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