module TD.Data.AuthenticationCodeType
(AuthenticationCodeType(..)) 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.FirebaseDeviceVerificationParameters as FirebaseDeviceVerificationParameters
data AuthenticationCodeType
= AuthenticationCodeTypeTelegramMessage
{ AuthenticationCodeType -> Maybe Int
_length :: Maybe Int
}
| AuthenticationCodeTypeSms
{ _length :: Maybe Int
}
| AuthenticationCodeTypeSmsWord
{ AuthenticationCodeType -> Maybe Text
first_letter :: Maybe T.Text
}
| AuthenticationCodeTypeSmsPhrase
{ AuthenticationCodeType -> Maybe Text
first_word :: Maybe T.Text
}
| AuthenticationCodeTypeCall
{ _length :: Maybe Int
}
| AuthenticationCodeTypeFlashCall
{ AuthenticationCodeType -> Maybe Text
pattern :: Maybe T.Text
}
| AuthenticationCodeTypeMissedCall
{ AuthenticationCodeType -> Maybe Text
phone_number_prefix :: Maybe T.Text
, _length :: Maybe Int
}
| AuthenticationCodeTypeFragment
{ AuthenticationCodeType -> Maybe Text
url :: Maybe T.Text
, _length :: Maybe Int
}
| AuthenticationCodeTypeFirebaseAndroid
{ AuthenticationCodeType
-> Maybe FirebaseDeviceVerificationParameters
device_verification_parameters :: Maybe FirebaseDeviceVerificationParameters.FirebaseDeviceVerificationParameters
, _length :: Maybe Int
}
| AuthenticationCodeTypeFirebaseIos
{ AuthenticationCodeType -> Maybe Text
receipt :: Maybe T.Text
, AuthenticationCodeType -> Maybe Int
push_timeout :: Maybe Int
, _length :: Maybe Int
}
deriving (AuthenticationCodeType -> AuthenticationCodeType -> Bool
(AuthenticationCodeType -> AuthenticationCodeType -> Bool)
-> (AuthenticationCodeType -> AuthenticationCodeType -> Bool)
-> Eq AuthenticationCodeType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AuthenticationCodeType -> AuthenticationCodeType -> Bool
== :: AuthenticationCodeType -> AuthenticationCodeType -> Bool
$c/= :: AuthenticationCodeType -> AuthenticationCodeType -> Bool
/= :: AuthenticationCodeType -> AuthenticationCodeType -> Bool
Eq, Int -> AuthenticationCodeType -> ShowS
[AuthenticationCodeType] -> ShowS
AuthenticationCodeType -> String
(Int -> AuthenticationCodeType -> ShowS)
-> (AuthenticationCodeType -> String)
-> ([AuthenticationCodeType] -> ShowS)
-> Show AuthenticationCodeType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> AuthenticationCodeType -> ShowS
showsPrec :: Int -> AuthenticationCodeType -> ShowS
$cshow :: AuthenticationCodeType -> String
show :: AuthenticationCodeType -> String
$cshowList :: [AuthenticationCodeType] -> ShowS
showList :: [AuthenticationCodeType] -> ShowS
Show)
instance I.ShortShow AuthenticationCodeType where
shortShow :: AuthenticationCodeType -> String
shortShow AuthenticationCodeTypeTelegramMessage
{ _length :: AuthenticationCodeType -> Maybe Int
_length = Maybe Int
_length_
}
= String
"AuthenticationCodeTypeTelegramMessage"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"_length" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
_length_
]
shortShow AuthenticationCodeTypeSms
{ _length :: AuthenticationCodeType -> Maybe Int
_length = Maybe Int
_length_
}
= String
"AuthenticationCodeTypeSms"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"_length" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
_length_
]
shortShow AuthenticationCodeTypeSmsWord
{ first_letter :: AuthenticationCodeType -> Maybe Text
first_letter = Maybe Text
first_letter_
}
= String
"AuthenticationCodeTypeSmsWord"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"first_letter" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
first_letter_
]
shortShow AuthenticationCodeTypeSmsPhrase
{ first_word :: AuthenticationCodeType -> Maybe Text
first_word = Maybe Text
first_word_
}
= String
"AuthenticationCodeTypeSmsPhrase"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"first_word" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
first_word_
]
shortShow AuthenticationCodeTypeCall
{ _length :: AuthenticationCodeType -> Maybe Int
_length = Maybe Int
_length_
}
= String
"AuthenticationCodeTypeCall"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"_length" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
_length_
]
shortShow AuthenticationCodeTypeFlashCall
{ pattern :: AuthenticationCodeType -> Maybe Text
pattern = Maybe Text
pattern_
}
= String
"AuthenticationCodeTypeFlashCall"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"pattern" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
pattern_
]
shortShow AuthenticationCodeTypeMissedCall
{ phone_number_prefix :: AuthenticationCodeType -> Maybe Text
phone_number_prefix = Maybe Text
phone_number_prefix_
, _length :: AuthenticationCodeType -> Maybe Int
_length = Maybe Int
_length_
}
= String
"AuthenticationCodeTypeMissedCall"
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_
, String
"_length" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
_length_
]
shortShow AuthenticationCodeTypeFragment
{ url :: AuthenticationCodeType -> Maybe Text
url = Maybe Text
url_
, _length :: AuthenticationCodeType -> Maybe Int
_length = Maybe Int
_length_
}
= String
"AuthenticationCodeTypeFragment"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"url" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
url_
, String
"_length" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
_length_
]
shortShow AuthenticationCodeTypeFirebaseAndroid
{ device_verification_parameters :: AuthenticationCodeType
-> Maybe FirebaseDeviceVerificationParameters
device_verification_parameters = Maybe FirebaseDeviceVerificationParameters
device_verification_parameters_
, _length :: AuthenticationCodeType -> Maybe Int
_length = Maybe Int
_length_
}
= String
"AuthenticationCodeTypeFirebaseAndroid"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"device_verification_parameters" String -> Maybe FirebaseDeviceVerificationParameters -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe FirebaseDeviceVerificationParameters
device_verification_parameters_
, String
"_length" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
_length_
]
shortShow AuthenticationCodeTypeFirebaseIos
{ receipt :: AuthenticationCodeType -> Maybe Text
receipt = Maybe Text
receipt_
, push_timeout :: AuthenticationCodeType -> Maybe Int
push_timeout = Maybe Int
push_timeout_
, _length :: AuthenticationCodeType -> Maybe Int
_length = Maybe Int
_length_
}
= String
"AuthenticationCodeTypeFirebaseIos"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"receipt" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
receipt_
, String
"push_timeout" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
push_timeout_
, String
"_length" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
_length_
]
instance AT.FromJSON AuthenticationCodeType where
parseJSON :: Value -> Parser AuthenticationCodeType
parseJSON v :: Value
v@(AT.Object Object
obj) = do
String
t <- Object
obj Object -> Key -> Parser String
forall a. FromJSON a => Object -> Key -> Parser a
A..: Key
"@type" :: AT.Parser String
case String
t of
String
"authenticationCodeTypeTelegramMessage" -> Value -> Parser AuthenticationCodeType
parseAuthenticationCodeTypeTelegramMessage Value
v
String
"authenticationCodeTypeSms" -> Value -> Parser AuthenticationCodeType
parseAuthenticationCodeTypeSms Value
v
String
"authenticationCodeTypeSmsWord" -> Value -> Parser AuthenticationCodeType
parseAuthenticationCodeTypeSmsWord Value
v
String
"authenticationCodeTypeSmsPhrase" -> Value -> Parser AuthenticationCodeType
parseAuthenticationCodeTypeSmsPhrase Value
v
String
"authenticationCodeTypeCall" -> Value -> Parser AuthenticationCodeType
parseAuthenticationCodeTypeCall Value
v
String
"authenticationCodeTypeFlashCall" -> Value -> Parser AuthenticationCodeType
parseAuthenticationCodeTypeFlashCall Value
v
String
"authenticationCodeTypeMissedCall" -> Value -> Parser AuthenticationCodeType
parseAuthenticationCodeTypeMissedCall Value
v
String
"authenticationCodeTypeFragment" -> Value -> Parser AuthenticationCodeType
parseAuthenticationCodeTypeFragment Value
v
String
"authenticationCodeTypeFirebaseAndroid" -> Value -> Parser AuthenticationCodeType
parseAuthenticationCodeTypeFirebaseAndroid Value
v
String
"authenticationCodeTypeFirebaseIos" -> Value -> Parser AuthenticationCodeType
parseAuthenticationCodeTypeFirebaseIos Value
v
String
_ -> Parser AuthenticationCodeType
forall a. Monoid a => a
mempty
where
parseAuthenticationCodeTypeTelegramMessage :: A.Value -> AT.Parser AuthenticationCodeType
parseAuthenticationCodeTypeTelegramMessage :: Value -> Parser AuthenticationCodeType
parseAuthenticationCodeTypeTelegramMessage = String
-> (Object -> Parser AuthenticationCodeType)
-> Value
-> Parser AuthenticationCodeType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"AuthenticationCodeTypeTelegramMessage" ((Object -> Parser AuthenticationCodeType)
-> Value -> Parser AuthenticationCodeType)
-> (Object -> Parser AuthenticationCodeType)
-> Value
-> Parser AuthenticationCodeType
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe Int
_length_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"length"
AuthenticationCodeType -> Parser AuthenticationCodeType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (AuthenticationCodeType -> Parser AuthenticationCodeType)
-> AuthenticationCodeType -> Parser AuthenticationCodeType
forall a b. (a -> b) -> a -> b
$ AuthenticationCodeTypeTelegramMessage
{ _length :: Maybe Int
_length = Maybe Int
_length_
}
parseAuthenticationCodeTypeSms :: A.Value -> AT.Parser AuthenticationCodeType
parseAuthenticationCodeTypeSms :: Value -> Parser AuthenticationCodeType
parseAuthenticationCodeTypeSms = String
-> (Object -> Parser AuthenticationCodeType)
-> Value
-> Parser AuthenticationCodeType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"AuthenticationCodeTypeSms" ((Object -> Parser AuthenticationCodeType)
-> Value -> Parser AuthenticationCodeType)
-> (Object -> Parser AuthenticationCodeType)
-> Value
-> Parser AuthenticationCodeType
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe Int
_length_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"length"
AuthenticationCodeType -> Parser AuthenticationCodeType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (AuthenticationCodeType -> Parser AuthenticationCodeType)
-> AuthenticationCodeType -> Parser AuthenticationCodeType
forall a b. (a -> b) -> a -> b
$ AuthenticationCodeTypeSms
{ _length :: Maybe Int
_length = Maybe Int
_length_
}
parseAuthenticationCodeTypeSmsWord :: A.Value -> AT.Parser AuthenticationCodeType
parseAuthenticationCodeTypeSmsWord :: Value -> Parser AuthenticationCodeType
parseAuthenticationCodeTypeSmsWord = String
-> (Object -> Parser AuthenticationCodeType)
-> Value
-> Parser AuthenticationCodeType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"AuthenticationCodeTypeSmsWord" ((Object -> Parser AuthenticationCodeType)
-> Value -> Parser AuthenticationCodeType)
-> (Object -> Parser AuthenticationCodeType)
-> Value
-> Parser AuthenticationCodeType
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe Text
first_letter_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"first_letter"
AuthenticationCodeType -> Parser AuthenticationCodeType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (AuthenticationCodeType -> Parser AuthenticationCodeType)
-> AuthenticationCodeType -> Parser AuthenticationCodeType
forall a b. (a -> b) -> a -> b
$ AuthenticationCodeTypeSmsWord
{ first_letter :: Maybe Text
first_letter = Maybe Text
first_letter_
}
parseAuthenticationCodeTypeSmsPhrase :: A.Value -> AT.Parser AuthenticationCodeType
parseAuthenticationCodeTypeSmsPhrase :: Value -> Parser AuthenticationCodeType
parseAuthenticationCodeTypeSmsPhrase = String
-> (Object -> Parser AuthenticationCodeType)
-> Value
-> Parser AuthenticationCodeType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"AuthenticationCodeTypeSmsPhrase" ((Object -> Parser AuthenticationCodeType)
-> Value -> Parser AuthenticationCodeType)
-> (Object -> Parser AuthenticationCodeType)
-> Value
-> Parser AuthenticationCodeType
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe Text
first_word_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"first_word"
AuthenticationCodeType -> Parser AuthenticationCodeType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (AuthenticationCodeType -> Parser AuthenticationCodeType)
-> AuthenticationCodeType -> Parser AuthenticationCodeType
forall a b. (a -> b) -> a -> b
$ AuthenticationCodeTypeSmsPhrase
{ first_word :: Maybe Text
first_word = Maybe Text
first_word_
}
parseAuthenticationCodeTypeCall :: A.Value -> AT.Parser AuthenticationCodeType
parseAuthenticationCodeTypeCall :: Value -> Parser AuthenticationCodeType
parseAuthenticationCodeTypeCall = String
-> (Object -> Parser AuthenticationCodeType)
-> Value
-> Parser AuthenticationCodeType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"AuthenticationCodeTypeCall" ((Object -> Parser AuthenticationCodeType)
-> Value -> Parser AuthenticationCodeType)
-> (Object -> Parser AuthenticationCodeType)
-> Value
-> Parser AuthenticationCodeType
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe Int
_length_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"length"
AuthenticationCodeType -> Parser AuthenticationCodeType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (AuthenticationCodeType -> Parser AuthenticationCodeType)
-> AuthenticationCodeType -> Parser AuthenticationCodeType
forall a b. (a -> b) -> a -> b
$ AuthenticationCodeTypeCall
{ _length :: Maybe Int
_length = Maybe Int
_length_
}
parseAuthenticationCodeTypeFlashCall :: A.Value -> AT.Parser AuthenticationCodeType
parseAuthenticationCodeTypeFlashCall :: Value -> Parser AuthenticationCodeType
parseAuthenticationCodeTypeFlashCall = String
-> (Object -> Parser AuthenticationCodeType)
-> Value
-> Parser AuthenticationCodeType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"AuthenticationCodeTypeFlashCall" ((Object -> Parser AuthenticationCodeType)
-> Value -> Parser AuthenticationCodeType)
-> (Object -> Parser AuthenticationCodeType)
-> Value
-> Parser AuthenticationCodeType
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe Text
pattern_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"pattern"
AuthenticationCodeType -> Parser AuthenticationCodeType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (AuthenticationCodeType -> Parser AuthenticationCodeType)
-> AuthenticationCodeType -> Parser AuthenticationCodeType
forall a b. (a -> b) -> a -> b
$ AuthenticationCodeTypeFlashCall
{ pattern :: Maybe Text
pattern = Maybe Text
pattern_
}
parseAuthenticationCodeTypeMissedCall :: A.Value -> AT.Parser AuthenticationCodeType
parseAuthenticationCodeTypeMissedCall :: Value -> Parser AuthenticationCodeType
parseAuthenticationCodeTypeMissedCall = String
-> (Object -> Parser AuthenticationCodeType)
-> Value
-> Parser AuthenticationCodeType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"AuthenticationCodeTypeMissedCall" ((Object -> Parser AuthenticationCodeType)
-> Value -> Parser AuthenticationCodeType)
-> (Object -> Parser AuthenticationCodeType)
-> Value
-> Parser AuthenticationCodeType
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe Text
phone_number_prefix_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"phone_number_prefix"
Maybe Int
_length_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"length"
AuthenticationCodeType -> Parser AuthenticationCodeType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (AuthenticationCodeType -> Parser AuthenticationCodeType)
-> AuthenticationCodeType -> Parser AuthenticationCodeType
forall a b. (a -> b) -> a -> b
$ AuthenticationCodeTypeMissedCall
{ phone_number_prefix :: Maybe Text
phone_number_prefix = Maybe Text
phone_number_prefix_
, _length :: Maybe Int
_length = Maybe Int
_length_
}
parseAuthenticationCodeTypeFragment :: A.Value -> AT.Parser AuthenticationCodeType
parseAuthenticationCodeTypeFragment :: Value -> Parser AuthenticationCodeType
parseAuthenticationCodeTypeFragment = String
-> (Object -> Parser AuthenticationCodeType)
-> Value
-> Parser AuthenticationCodeType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"AuthenticationCodeTypeFragment" ((Object -> Parser AuthenticationCodeType)
-> Value -> Parser AuthenticationCodeType)
-> (Object -> Parser AuthenticationCodeType)
-> Value
-> Parser AuthenticationCodeType
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe Text
url_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"url"
Maybe Int
_length_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"length"
AuthenticationCodeType -> Parser AuthenticationCodeType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (AuthenticationCodeType -> Parser AuthenticationCodeType)
-> AuthenticationCodeType -> Parser AuthenticationCodeType
forall a b. (a -> b) -> a -> b
$ AuthenticationCodeTypeFragment
{ url :: Maybe Text
url = Maybe Text
url_
, _length :: Maybe Int
_length = Maybe Int
_length_
}
parseAuthenticationCodeTypeFirebaseAndroid :: A.Value -> AT.Parser AuthenticationCodeType
parseAuthenticationCodeTypeFirebaseAndroid :: Value -> Parser AuthenticationCodeType
parseAuthenticationCodeTypeFirebaseAndroid = String
-> (Object -> Parser AuthenticationCodeType)
-> Value
-> Parser AuthenticationCodeType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"AuthenticationCodeTypeFirebaseAndroid" ((Object -> Parser AuthenticationCodeType)
-> Value -> Parser AuthenticationCodeType)
-> (Object -> Parser AuthenticationCodeType)
-> Value
-> Parser AuthenticationCodeType
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe FirebaseDeviceVerificationParameters
device_verification_parameters_ <- Object
o Object
-> Key -> Parser (Maybe FirebaseDeviceVerificationParameters)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"device_verification_parameters"
Maybe Int
_length_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"length"
AuthenticationCodeType -> Parser AuthenticationCodeType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (AuthenticationCodeType -> Parser AuthenticationCodeType)
-> AuthenticationCodeType -> Parser AuthenticationCodeType
forall a b. (a -> b) -> a -> b
$ AuthenticationCodeTypeFirebaseAndroid
{ device_verification_parameters :: Maybe FirebaseDeviceVerificationParameters
device_verification_parameters = Maybe FirebaseDeviceVerificationParameters
device_verification_parameters_
, _length :: Maybe Int
_length = Maybe Int
_length_
}
parseAuthenticationCodeTypeFirebaseIos :: A.Value -> AT.Parser AuthenticationCodeType
parseAuthenticationCodeTypeFirebaseIos :: Value -> Parser AuthenticationCodeType
parseAuthenticationCodeTypeFirebaseIos = String
-> (Object -> Parser AuthenticationCodeType)
-> Value
-> Parser AuthenticationCodeType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"AuthenticationCodeTypeFirebaseIos" ((Object -> Parser AuthenticationCodeType)
-> Value -> Parser AuthenticationCodeType)
-> (Object -> Parser AuthenticationCodeType)
-> Value
-> Parser AuthenticationCodeType
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe Text
receipt_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"receipt"
Maybe Int
push_timeout_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"push_timeout"
Maybe Int
_length_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"length"
AuthenticationCodeType -> Parser AuthenticationCodeType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (AuthenticationCodeType -> Parser AuthenticationCodeType)
-> AuthenticationCodeType -> Parser AuthenticationCodeType
forall a b. (a -> b) -> a -> b
$ AuthenticationCodeTypeFirebaseIos
{ receipt :: Maybe Text
receipt = Maybe Text
receipt_
, push_timeout :: Maybe Int
push_timeout = Maybe Int
push_timeout_
, _length :: Maybe Int
_length = Maybe Int
_length_
}
parseJSON Value
_ = Parser AuthenticationCodeType
forall a. Monoid a => a
mempty