{-# 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.Rekognition.Types.HumanLoopConfig where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Rekognition.Types.HumanLoopDataAttributes
data HumanLoopConfig = HumanLoopConfig'
{
HumanLoopConfig -> Maybe HumanLoopDataAttributes
dataAttributes :: Prelude.Maybe HumanLoopDataAttributes,
HumanLoopConfig -> Text
humanLoopName :: Prelude.Text,
HumanLoopConfig -> Text
flowDefinitionArn :: Prelude.Text
}
deriving (HumanLoopConfig -> HumanLoopConfig -> Bool
(HumanLoopConfig -> HumanLoopConfig -> Bool)
-> (HumanLoopConfig -> HumanLoopConfig -> Bool)
-> Eq HumanLoopConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HumanLoopConfig -> HumanLoopConfig -> Bool
$c/= :: HumanLoopConfig -> HumanLoopConfig -> Bool
== :: HumanLoopConfig -> HumanLoopConfig -> Bool
$c== :: HumanLoopConfig -> HumanLoopConfig -> Bool
Prelude.Eq, ReadPrec [HumanLoopConfig]
ReadPrec HumanLoopConfig
Int -> ReadS HumanLoopConfig
ReadS [HumanLoopConfig]
(Int -> ReadS HumanLoopConfig)
-> ReadS [HumanLoopConfig]
-> ReadPrec HumanLoopConfig
-> ReadPrec [HumanLoopConfig]
-> Read HumanLoopConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [HumanLoopConfig]
$creadListPrec :: ReadPrec [HumanLoopConfig]
readPrec :: ReadPrec HumanLoopConfig
$creadPrec :: ReadPrec HumanLoopConfig
readList :: ReadS [HumanLoopConfig]
$creadList :: ReadS [HumanLoopConfig]
readsPrec :: Int -> ReadS HumanLoopConfig
$creadsPrec :: Int -> ReadS HumanLoopConfig
Prelude.Read, Int -> HumanLoopConfig -> ShowS
[HumanLoopConfig] -> ShowS
HumanLoopConfig -> String
(Int -> HumanLoopConfig -> ShowS)
-> (HumanLoopConfig -> String)
-> ([HumanLoopConfig] -> ShowS)
-> Show HumanLoopConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [HumanLoopConfig] -> ShowS
$cshowList :: [HumanLoopConfig] -> ShowS
show :: HumanLoopConfig -> String
$cshow :: HumanLoopConfig -> String
showsPrec :: Int -> HumanLoopConfig -> ShowS
$cshowsPrec :: Int -> HumanLoopConfig -> ShowS
Prelude.Show, (forall x. HumanLoopConfig -> Rep HumanLoopConfig x)
-> (forall x. Rep HumanLoopConfig x -> HumanLoopConfig)
-> Generic HumanLoopConfig
forall x. Rep HumanLoopConfig x -> HumanLoopConfig
forall x. HumanLoopConfig -> Rep HumanLoopConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep HumanLoopConfig x -> HumanLoopConfig
$cfrom :: forall x. HumanLoopConfig -> Rep HumanLoopConfig x
Prelude.Generic)
newHumanLoopConfig ::
Prelude.Text ->
Prelude.Text ->
HumanLoopConfig
newHumanLoopConfig :: Text -> Text -> HumanLoopConfig
newHumanLoopConfig
Text
pHumanLoopName_
Text
pFlowDefinitionArn_ =
HumanLoopConfig' :: Maybe HumanLoopDataAttributes -> Text -> Text -> HumanLoopConfig
HumanLoopConfig'
{ $sel:dataAttributes:HumanLoopConfig' :: Maybe HumanLoopDataAttributes
dataAttributes = Maybe HumanLoopDataAttributes
forall a. Maybe a
Prelude.Nothing,
$sel:humanLoopName:HumanLoopConfig' :: Text
humanLoopName = Text
pHumanLoopName_,
$sel:flowDefinitionArn:HumanLoopConfig' :: Text
flowDefinitionArn = Text
pFlowDefinitionArn_
}
humanLoopConfig_dataAttributes :: Lens.Lens' HumanLoopConfig (Prelude.Maybe HumanLoopDataAttributes)
humanLoopConfig_dataAttributes :: (Maybe HumanLoopDataAttributes
-> f (Maybe HumanLoopDataAttributes))
-> HumanLoopConfig -> f HumanLoopConfig
humanLoopConfig_dataAttributes = (HumanLoopConfig -> Maybe HumanLoopDataAttributes)
-> (HumanLoopConfig
-> Maybe HumanLoopDataAttributes -> HumanLoopConfig)
-> Lens
HumanLoopConfig
HumanLoopConfig
(Maybe HumanLoopDataAttributes)
(Maybe HumanLoopDataAttributes)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HumanLoopConfig' {Maybe HumanLoopDataAttributes
dataAttributes :: Maybe HumanLoopDataAttributes
$sel:dataAttributes:HumanLoopConfig' :: HumanLoopConfig -> Maybe HumanLoopDataAttributes
dataAttributes} -> Maybe HumanLoopDataAttributes
dataAttributes) (\s :: HumanLoopConfig
s@HumanLoopConfig' {} Maybe HumanLoopDataAttributes
a -> HumanLoopConfig
s {$sel:dataAttributes:HumanLoopConfig' :: Maybe HumanLoopDataAttributes
dataAttributes = Maybe HumanLoopDataAttributes
a} :: HumanLoopConfig)
humanLoopConfig_humanLoopName :: Lens.Lens' HumanLoopConfig Prelude.Text
humanLoopConfig_humanLoopName :: (Text -> f Text) -> HumanLoopConfig -> f HumanLoopConfig
humanLoopConfig_humanLoopName = (HumanLoopConfig -> Text)
-> (HumanLoopConfig -> Text -> HumanLoopConfig)
-> Lens HumanLoopConfig HumanLoopConfig Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HumanLoopConfig' {Text
humanLoopName :: Text
$sel:humanLoopName:HumanLoopConfig' :: HumanLoopConfig -> Text
humanLoopName} -> Text
humanLoopName) (\s :: HumanLoopConfig
s@HumanLoopConfig' {} Text
a -> HumanLoopConfig
s {$sel:humanLoopName:HumanLoopConfig' :: Text
humanLoopName = Text
a} :: HumanLoopConfig)
humanLoopConfig_flowDefinitionArn :: Lens.Lens' HumanLoopConfig Prelude.Text
humanLoopConfig_flowDefinitionArn :: (Text -> f Text) -> HumanLoopConfig -> f HumanLoopConfig
humanLoopConfig_flowDefinitionArn = (HumanLoopConfig -> Text)
-> (HumanLoopConfig -> Text -> HumanLoopConfig)
-> Lens HumanLoopConfig HumanLoopConfig Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HumanLoopConfig' {Text
flowDefinitionArn :: Text
$sel:flowDefinitionArn:HumanLoopConfig' :: HumanLoopConfig -> Text
flowDefinitionArn} -> Text
flowDefinitionArn) (\s :: HumanLoopConfig
s@HumanLoopConfig' {} Text
a -> HumanLoopConfig
s {$sel:flowDefinitionArn:HumanLoopConfig' :: Text
flowDefinitionArn = Text
a} :: HumanLoopConfig)
instance Prelude.Hashable HumanLoopConfig
instance Prelude.NFData HumanLoopConfig
instance Core.ToJSON HumanLoopConfig where
toJSON :: HumanLoopConfig -> Value
toJSON HumanLoopConfig' {Maybe HumanLoopDataAttributes
Text
flowDefinitionArn :: Text
humanLoopName :: Text
dataAttributes :: Maybe HumanLoopDataAttributes
$sel:flowDefinitionArn:HumanLoopConfig' :: HumanLoopConfig -> Text
$sel:humanLoopName:HumanLoopConfig' :: HumanLoopConfig -> Text
$sel:dataAttributes:HumanLoopConfig' :: HumanLoopConfig -> Maybe HumanLoopDataAttributes
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"DataAttributes" Text -> HumanLoopDataAttributes -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(HumanLoopDataAttributes -> Pair)
-> Maybe HumanLoopDataAttributes -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe HumanLoopDataAttributes
dataAttributes,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"HumanLoopName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
humanLoopName),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"FlowDefinitionArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
flowDefinitionArn)
]
)