{-# LANGUAGE MultiWayIf #-}
-- CHANGE WITH CAUTION: This is a generated code file generated by https://github.com/Haskell-OpenAPI-Code-Generator/Haskell-OpenAPI-Client-Code-Generator.
{-# LANGUAGE OverloadedStrings #-}

-- | Contains the types generated from the schema TransactionFraudInfo
module RecurlyClient.Types.TransactionFraudInfo where

import qualified Control.Monad.Fail
import qualified Data.Aeson
import qualified Data.Aeson as Data.Aeson.Encoding.Internal
import qualified Data.Aeson as Data.Aeson.Types
import qualified Data.Aeson as Data.Aeson.Types.FromJSON
import qualified Data.Aeson as Data.Aeson.Types.Internal
import qualified Data.Aeson as Data.Aeson.Types.ToJSON
import qualified Data.ByteString
import qualified Data.ByteString as Data.ByteString.Internal
import qualified Data.Foldable
import qualified Data.Functor
import qualified Data.Maybe
import qualified Data.Scientific
import qualified Data.Text
import qualified Data.Text as Data.Text.Internal
import qualified Data.Time.Calendar as Data.Time.Calendar.Days
import qualified Data.Time.LocalTime as Data.Time.LocalTime.Internal.ZonedTime
import qualified GHC.Base
import qualified GHC.Classes
import qualified GHC.Int
import qualified GHC.Show
import qualified GHC.Types
import qualified RecurlyClient.Common
import RecurlyClient.TypeAlias
import {-# SOURCE #-} RecurlyClient.Types.FraudRiskRule
import qualified Prelude as GHC.Integer.Type
import qualified Prelude as GHC.Maybe

-- | Defines the object schema located at @components.schemas.TransactionFraudInfo@ in the specification.
data TransactionFraudInfo = TransactionFraudInfo
    { TransactionFraudInfo -> Maybe TransactionFraudInfoDecision
transactionFraudInfoDecision :: (GHC.Maybe.Maybe TransactionFraudInfoDecision)
    -- ^ decision
    --
    -- Constraints:
    --
    -- * Maximum length of 10
    , TransactionFraudInfo -> Maybe Text
transactionFraudInfoObject :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ object
    , TransactionFraudInfo -> Maybe Text
transactionFraudInfoReference :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ reference
    , TransactionFraudInfo -> Maybe [FraudRiskRule]
transactionFraudInfoRisk_rules_triggered :: (GHC.Maybe.Maybe [FraudRiskRule])
    -- ^ risk_rules_triggered: A list of fraud risk rules that were triggered for the transaction.
    , TransactionFraudInfo -> Maybe Int
transactionFraudInfoScore :: (GHC.Maybe.Maybe GHC.Types.Int)
    -- ^ score
    --
    -- Constraints:
    --
    -- * Maxium  of 99.0
    -- * Minimum  of 1.0
    }
    deriving
        ( Int -> TransactionFraudInfo -> ShowS
[TransactionFraudInfo] -> ShowS
TransactionFraudInfo -> String
(Int -> TransactionFraudInfo -> ShowS)
-> (TransactionFraudInfo -> String)
-> ([TransactionFraudInfo] -> ShowS)
-> Show TransactionFraudInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> TransactionFraudInfo -> ShowS
showsPrec :: Int -> TransactionFraudInfo -> ShowS
$cshow :: TransactionFraudInfo -> String
show :: TransactionFraudInfo -> String
$cshowList :: [TransactionFraudInfo] -> ShowS
showList :: [TransactionFraudInfo] -> ShowS
GHC.Show.Show
        , TransactionFraudInfo -> TransactionFraudInfo -> Bool
(TransactionFraudInfo -> TransactionFraudInfo -> Bool)
-> (TransactionFraudInfo -> TransactionFraudInfo -> Bool)
-> Eq TransactionFraudInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TransactionFraudInfo -> TransactionFraudInfo -> Bool
== :: TransactionFraudInfo -> TransactionFraudInfo -> Bool
$c/= :: TransactionFraudInfo -> TransactionFraudInfo -> Bool
/= :: TransactionFraudInfo -> TransactionFraudInfo -> Bool
GHC.Classes.Eq
        )

instance Data.Aeson.Types.ToJSON.ToJSON TransactionFraudInfo where
    toJSON :: TransactionFraudInfo -> Value
toJSON TransactionFraudInfo
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object ([[Pair]] -> [Pair]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
Data.Foldable.concat ([Pair]
-> (TransactionFraudInfoDecision -> [Pair])
-> Maybe TransactionFraudInfoDecision
-> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair])
-> (TransactionFraudInfoDecision -> Pair)
-> TransactionFraudInfoDecision
-> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"decision" Key -> TransactionFraudInfoDecision -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (TransactionFraudInfo -> Maybe TransactionFraudInfoDecision
transactionFraudInfoDecision TransactionFraudInfo
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Text -> [Pair]) -> Maybe Text -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Text -> Pair) -> Text -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"object" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (TransactionFraudInfo -> Maybe Text
transactionFraudInfoObject TransactionFraudInfo
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Text -> [Pair]) -> Maybe Text -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Text -> Pair) -> Text -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"reference" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (TransactionFraudInfo -> Maybe Text
transactionFraudInfoReference TransactionFraudInfo
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> ([FraudRiskRule] -> [Pair]) -> Maybe [FraudRiskRule] -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair])
-> ([FraudRiskRule] -> Pair) -> [FraudRiskRule] -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"risk_rules_triggered" Key -> [FraudRiskRule] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (TransactionFraudInfo -> Maybe [FraudRiskRule]
transactionFraudInfoRisk_rules_triggered TransactionFraudInfo
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Int -> [Pair]) -> Maybe Int -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Int -> Pair) -> Int -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"score" Key -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (TransactionFraudInfo -> Maybe Int
transactionFraudInfoScore TransactionFraudInfo
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [[Pair]]
forall a. Monoid a => a
GHC.Base.mempty))
    toEncoding :: TransactionFraudInfo -> Encoding
toEncoding TransactionFraudInfo
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ([Series] -> Series
forall a. Monoid a => [a] -> a
GHC.Base.mconcat ([[Series]] -> [Series]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
Data.Foldable.concat ([Series]
-> (TransactionFraudInfoDecision -> [Series])
-> Maybe TransactionFraudInfoDecision
-> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series])
-> (TransactionFraudInfoDecision -> Series)
-> TransactionFraudInfoDecision
-> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"decision" Key -> TransactionFraudInfoDecision -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (TransactionFraudInfo -> Maybe TransactionFraudInfoDecision
transactionFraudInfoDecision TransactionFraudInfo
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Text -> [Series]) -> Maybe Text -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Text -> Series) -> Text -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"object" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (TransactionFraudInfo -> Maybe Text
transactionFraudInfoObject TransactionFraudInfo
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Text -> [Series]) -> Maybe Text -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Text -> Series) -> Text -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"reference" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (TransactionFraudInfo -> Maybe Text
transactionFraudInfoReference TransactionFraudInfo
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> ([FraudRiskRule] -> [Series])
-> Maybe [FraudRiskRule]
-> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series])
-> ([FraudRiskRule] -> Series) -> [FraudRiskRule] -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"risk_rules_triggered" Key -> [FraudRiskRule] -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (TransactionFraudInfo -> Maybe [FraudRiskRule]
transactionFraudInfoRisk_rules_triggered TransactionFraudInfo
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Int -> [Series]) -> Maybe Int -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Int -> Series) -> Int -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"score" Key -> Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (TransactionFraudInfo -> Maybe Int
transactionFraudInfoScore TransactionFraudInfo
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [[Series]]
forall a. Monoid a => a
GHC.Base.mempty)))
instance Data.Aeson.Types.FromJSON.FromJSON TransactionFraudInfo where
    parseJSON :: Value -> Parser TransactionFraudInfo
parseJSON = String
-> (Object -> Parser TransactionFraudInfo)
-> Value
-> Parser TransactionFraudInfo
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"TransactionFraudInfo" (\Object
obj -> (((((Maybe TransactionFraudInfoDecision
 -> Maybe Text
 -> Maybe Text
 -> Maybe [FraudRiskRule]
 -> Maybe Int
 -> TransactionFraudInfo)
-> Parser
     (Maybe TransactionFraudInfoDecision
      -> Maybe Text
      -> Maybe Text
      -> Maybe [FraudRiskRule]
      -> Maybe Int
      -> TransactionFraudInfo)
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Maybe TransactionFraudInfoDecision
-> Maybe Text
-> Maybe Text
-> Maybe [FraudRiskRule]
-> Maybe Int
-> TransactionFraudInfo
TransactionFraudInfo Parser
  (Maybe TransactionFraudInfoDecision
   -> Maybe Text
   -> Maybe Text
   -> Maybe [FraudRiskRule]
   -> Maybe Int
   -> TransactionFraudInfo)
-> Parser (Maybe TransactionFraudInfoDecision)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe [FraudRiskRule]
      -> Maybe Int
      -> TransactionFraudInfo)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe TransactionFraudInfoDecision)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"decision")) Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe [FraudRiskRule]
   -> Maybe Int
   -> TransactionFraudInfo)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe [FraudRiskRule] -> Maybe Int -> TransactionFraudInfo)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"object")) Parser
  (Maybe Text
   -> Maybe [FraudRiskRule] -> Maybe Int -> TransactionFraudInfo)
-> Parser (Maybe Text)
-> Parser
     (Maybe [FraudRiskRule] -> Maybe Int -> TransactionFraudInfo)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"reference")) Parser (Maybe [FraudRiskRule] -> Maybe Int -> TransactionFraudInfo)
-> Parser (Maybe [FraudRiskRule])
-> Parser (Maybe Int -> TransactionFraudInfo)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe [FraudRiskRule])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"risk_rules_triggered")) Parser (Maybe Int -> TransactionFraudInfo)
-> Parser (Maybe Int) -> Parser TransactionFraudInfo
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"score"))

-- | Create a new 'TransactionFraudInfo' with all required fields.
mkTransactionFraudInfo :: TransactionFraudInfo
mkTransactionFraudInfo :: TransactionFraudInfo
mkTransactionFraudInfo =
    TransactionFraudInfo
        { transactionFraudInfoDecision :: Maybe TransactionFraudInfoDecision
transactionFraudInfoDecision = Maybe TransactionFraudInfoDecision
forall a. Maybe a
GHC.Maybe.Nothing
        , transactionFraudInfoObject :: Maybe Text
transactionFraudInfoObject = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , transactionFraudInfoReference :: Maybe Text
transactionFraudInfoReference = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , transactionFraudInfoRisk_rules_triggered :: Maybe [FraudRiskRule]
transactionFraudInfoRisk_rules_triggered = Maybe [FraudRiskRule]
forall a. Maybe a
GHC.Maybe.Nothing
        , transactionFraudInfoScore :: Maybe Int
transactionFraudInfoScore = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing
        }

-- | Defines the enum schema located at @components.schemas.TransactionFraudInfo.properties.decision@ in the specification.
data TransactionFraudInfoDecision
    = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
      TransactionFraudInfoDecisionOther Data.Aeson.Types.Internal.Value
    | -- | This constructor can be used to send values to the server which are not present in the specification yet.
      TransactionFraudInfoDecisionTyped Data.Text.Internal.Text
    | -- | Represents the JSON value @"approve"@
      TransactionFraudInfoDecisionEnumApprove
    | -- | Represents the JSON value @"decline"@
      TransactionFraudInfoDecisionEnumDecline
    | -- | Represents the JSON value @"escalate"@
      TransactionFraudInfoDecisionEnumEscalate
    | -- | Represents the JSON value @"review"@
      TransactionFraudInfoDecisionEnumReview
    deriving (Int -> TransactionFraudInfoDecision -> ShowS
[TransactionFraudInfoDecision] -> ShowS
TransactionFraudInfoDecision -> String
(Int -> TransactionFraudInfoDecision -> ShowS)
-> (TransactionFraudInfoDecision -> String)
-> ([TransactionFraudInfoDecision] -> ShowS)
-> Show TransactionFraudInfoDecision
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> TransactionFraudInfoDecision -> ShowS
showsPrec :: Int -> TransactionFraudInfoDecision -> ShowS
$cshow :: TransactionFraudInfoDecision -> String
show :: TransactionFraudInfoDecision -> String
$cshowList :: [TransactionFraudInfoDecision] -> ShowS
showList :: [TransactionFraudInfoDecision] -> ShowS
GHC.Show.Show, TransactionFraudInfoDecision
-> TransactionFraudInfoDecision -> Bool
(TransactionFraudInfoDecision
 -> TransactionFraudInfoDecision -> Bool)
-> (TransactionFraudInfoDecision
    -> TransactionFraudInfoDecision -> Bool)
-> Eq TransactionFraudInfoDecision
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TransactionFraudInfoDecision
-> TransactionFraudInfoDecision -> Bool
== :: TransactionFraudInfoDecision
-> TransactionFraudInfoDecision -> Bool
$c/= :: TransactionFraudInfoDecision
-> TransactionFraudInfoDecision -> Bool
/= :: TransactionFraudInfoDecision
-> TransactionFraudInfoDecision -> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON TransactionFraudInfoDecision where
    toJSON :: TransactionFraudInfoDecision -> Value
toJSON (TransactionFraudInfoDecisionOther Value
val) = Value
val
    toJSON (TransactionFraudInfoDecisionTyped Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
    toJSON (TransactionFraudInfoDecision
TransactionFraudInfoDecisionEnumApprove) = Value
"approve"
    toJSON (TransactionFraudInfoDecision
TransactionFraudInfoDecisionEnumDecline) = Value
"decline"
    toJSON (TransactionFraudInfoDecision
TransactionFraudInfoDecisionEnumEscalate) = Value
"escalate"
    toJSON (TransactionFraudInfoDecision
TransactionFraudInfoDecisionEnumReview) = Value
"review"
instance Data.Aeson.Types.FromJSON.FromJSON TransactionFraudInfoDecision where
    parseJSON :: Value -> Parser TransactionFraudInfoDecision
parseJSON Value
val =
        TransactionFraudInfoDecision -> Parser TransactionFraudInfoDecision
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure
            ( if
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"approve" -> TransactionFraudInfoDecision
TransactionFraudInfoDecisionEnumApprove
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"decline" -> TransactionFraudInfoDecision
TransactionFraudInfoDecisionEnumDecline
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"escalate" -> TransactionFraudInfoDecision
TransactionFraudInfoDecisionEnumEscalate
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"review" -> TransactionFraudInfoDecision
TransactionFraudInfoDecisionEnumReview
                | Bool
GHC.Base.otherwise -> Value -> TransactionFraudInfoDecision
TransactionFraudInfoDecisionOther Value
val
            )