{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.FraudDetector.Types.ExternalEventsDetail where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ExternalEventsDetail = ExternalEventsDetail'
{
ExternalEventsDetail -> Text
dataLocation :: Prelude.Text,
ExternalEventsDetail -> Text
dataAccessRoleArn :: Prelude.Text
}
deriving (ExternalEventsDetail -> ExternalEventsDetail -> Bool
(ExternalEventsDetail -> ExternalEventsDetail -> Bool)
-> (ExternalEventsDetail -> ExternalEventsDetail -> Bool)
-> Eq ExternalEventsDetail
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExternalEventsDetail -> ExternalEventsDetail -> Bool
$c/= :: ExternalEventsDetail -> ExternalEventsDetail -> Bool
== :: ExternalEventsDetail -> ExternalEventsDetail -> Bool
$c== :: ExternalEventsDetail -> ExternalEventsDetail -> Bool
Prelude.Eq, ReadPrec [ExternalEventsDetail]
ReadPrec ExternalEventsDetail
Int -> ReadS ExternalEventsDetail
ReadS [ExternalEventsDetail]
(Int -> ReadS ExternalEventsDetail)
-> ReadS [ExternalEventsDetail]
-> ReadPrec ExternalEventsDetail
-> ReadPrec [ExternalEventsDetail]
-> Read ExternalEventsDetail
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ExternalEventsDetail]
$creadListPrec :: ReadPrec [ExternalEventsDetail]
readPrec :: ReadPrec ExternalEventsDetail
$creadPrec :: ReadPrec ExternalEventsDetail
readList :: ReadS [ExternalEventsDetail]
$creadList :: ReadS [ExternalEventsDetail]
readsPrec :: Int -> ReadS ExternalEventsDetail
$creadsPrec :: Int -> ReadS ExternalEventsDetail
Prelude.Read, Int -> ExternalEventsDetail -> ShowS
[ExternalEventsDetail] -> ShowS
ExternalEventsDetail -> String
(Int -> ExternalEventsDetail -> ShowS)
-> (ExternalEventsDetail -> String)
-> ([ExternalEventsDetail] -> ShowS)
-> Show ExternalEventsDetail
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ExternalEventsDetail] -> ShowS
$cshowList :: [ExternalEventsDetail] -> ShowS
show :: ExternalEventsDetail -> String
$cshow :: ExternalEventsDetail -> String
showsPrec :: Int -> ExternalEventsDetail -> ShowS
$cshowsPrec :: Int -> ExternalEventsDetail -> ShowS
Prelude.Show, (forall x. ExternalEventsDetail -> Rep ExternalEventsDetail x)
-> (forall x. Rep ExternalEventsDetail x -> ExternalEventsDetail)
-> Generic ExternalEventsDetail
forall x. Rep ExternalEventsDetail x -> ExternalEventsDetail
forall x. ExternalEventsDetail -> Rep ExternalEventsDetail x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ExternalEventsDetail x -> ExternalEventsDetail
$cfrom :: forall x. ExternalEventsDetail -> Rep ExternalEventsDetail x
Prelude.Generic)
newExternalEventsDetail ::
Prelude.Text ->
Prelude.Text ->
ExternalEventsDetail
newExternalEventsDetail :: Text -> Text -> ExternalEventsDetail
newExternalEventsDetail
Text
pDataLocation_
Text
pDataAccessRoleArn_ =
ExternalEventsDetail' :: Text -> Text -> ExternalEventsDetail
ExternalEventsDetail'
{ $sel:dataLocation:ExternalEventsDetail' :: Text
dataLocation =
Text
pDataLocation_,
$sel:dataAccessRoleArn:ExternalEventsDetail' :: Text
dataAccessRoleArn = Text
pDataAccessRoleArn_
}
externalEventsDetail_dataLocation :: Lens.Lens' ExternalEventsDetail Prelude.Text
externalEventsDetail_dataLocation :: (Text -> f Text) -> ExternalEventsDetail -> f ExternalEventsDetail
externalEventsDetail_dataLocation = (ExternalEventsDetail -> Text)
-> (ExternalEventsDetail -> Text -> ExternalEventsDetail)
-> Lens ExternalEventsDetail ExternalEventsDetail Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExternalEventsDetail' {Text
dataLocation :: Text
$sel:dataLocation:ExternalEventsDetail' :: ExternalEventsDetail -> Text
dataLocation} -> Text
dataLocation) (\s :: ExternalEventsDetail
s@ExternalEventsDetail' {} Text
a -> ExternalEventsDetail
s {$sel:dataLocation:ExternalEventsDetail' :: Text
dataLocation = Text
a} :: ExternalEventsDetail)
externalEventsDetail_dataAccessRoleArn :: Lens.Lens' ExternalEventsDetail Prelude.Text
externalEventsDetail_dataAccessRoleArn :: (Text -> f Text) -> ExternalEventsDetail -> f ExternalEventsDetail
externalEventsDetail_dataAccessRoleArn = (ExternalEventsDetail -> Text)
-> (ExternalEventsDetail -> Text -> ExternalEventsDetail)
-> Lens ExternalEventsDetail ExternalEventsDetail Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExternalEventsDetail' {Text
dataAccessRoleArn :: Text
$sel:dataAccessRoleArn:ExternalEventsDetail' :: ExternalEventsDetail -> Text
dataAccessRoleArn} -> Text
dataAccessRoleArn) (\s :: ExternalEventsDetail
s@ExternalEventsDetail' {} Text
a -> ExternalEventsDetail
s {$sel:dataAccessRoleArn:ExternalEventsDetail' :: Text
dataAccessRoleArn = Text
a} :: ExternalEventsDetail)
instance Core.FromJSON ExternalEventsDetail where
parseJSON :: Value -> Parser ExternalEventsDetail
parseJSON =
String
-> (Object -> Parser ExternalEventsDetail)
-> Value
-> Parser ExternalEventsDetail
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ExternalEventsDetail"
( \Object
x ->
Text -> Text -> ExternalEventsDetail
ExternalEventsDetail'
(Text -> Text -> ExternalEventsDetail)
-> Parser Text -> Parser (Text -> ExternalEventsDetail)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"dataLocation")
Parser (Text -> ExternalEventsDetail)
-> Parser Text -> Parser ExternalEventsDetail
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"dataAccessRoleArn")
)
instance Prelude.Hashable ExternalEventsDetail
instance Prelude.NFData ExternalEventsDetail
instance Core.ToJSON ExternalEventsDetail where
toJSON :: ExternalEventsDetail -> Value
toJSON ExternalEventsDetail' {Text
dataAccessRoleArn :: Text
dataLocation :: Text
$sel:dataAccessRoleArn:ExternalEventsDetail' :: ExternalEventsDetail -> Text
$sel:dataLocation:ExternalEventsDetail' :: ExternalEventsDetail -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"dataLocation" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
dataLocation),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"dataAccessRoleArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
dataAccessRoleArn)
]
)