{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.SageMaker.Types.ConditionStepMetadata
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.SageMaker.Types.ConditionStepMetadata where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SageMaker.Types.ConditionOutcome

-- | Metadata for a Condition step.
--
-- /See:/ 'newConditionStepMetadata' smart constructor.
data ConditionStepMetadata = ConditionStepMetadata'
  { -- | The outcome of the Condition step evaluation.
    ConditionStepMetadata -> Maybe ConditionOutcome
outcome :: Prelude.Maybe ConditionOutcome
  }
  deriving (ConditionStepMetadata -> ConditionStepMetadata -> Bool
(ConditionStepMetadata -> ConditionStepMetadata -> Bool)
-> (ConditionStepMetadata -> ConditionStepMetadata -> Bool)
-> Eq ConditionStepMetadata
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ConditionStepMetadata -> ConditionStepMetadata -> Bool
$c/= :: ConditionStepMetadata -> ConditionStepMetadata -> Bool
== :: ConditionStepMetadata -> ConditionStepMetadata -> Bool
$c== :: ConditionStepMetadata -> ConditionStepMetadata -> Bool
Prelude.Eq, ReadPrec [ConditionStepMetadata]
ReadPrec ConditionStepMetadata
Int -> ReadS ConditionStepMetadata
ReadS [ConditionStepMetadata]
(Int -> ReadS ConditionStepMetadata)
-> ReadS [ConditionStepMetadata]
-> ReadPrec ConditionStepMetadata
-> ReadPrec [ConditionStepMetadata]
-> Read ConditionStepMetadata
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ConditionStepMetadata]
$creadListPrec :: ReadPrec [ConditionStepMetadata]
readPrec :: ReadPrec ConditionStepMetadata
$creadPrec :: ReadPrec ConditionStepMetadata
readList :: ReadS [ConditionStepMetadata]
$creadList :: ReadS [ConditionStepMetadata]
readsPrec :: Int -> ReadS ConditionStepMetadata
$creadsPrec :: Int -> ReadS ConditionStepMetadata
Prelude.Read, Int -> ConditionStepMetadata -> ShowS
[ConditionStepMetadata] -> ShowS
ConditionStepMetadata -> String
(Int -> ConditionStepMetadata -> ShowS)
-> (ConditionStepMetadata -> String)
-> ([ConditionStepMetadata] -> ShowS)
-> Show ConditionStepMetadata
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ConditionStepMetadata] -> ShowS
$cshowList :: [ConditionStepMetadata] -> ShowS
show :: ConditionStepMetadata -> String
$cshow :: ConditionStepMetadata -> String
showsPrec :: Int -> ConditionStepMetadata -> ShowS
$cshowsPrec :: Int -> ConditionStepMetadata -> ShowS
Prelude.Show, (forall x. ConditionStepMetadata -> Rep ConditionStepMetadata x)
-> (forall x. Rep ConditionStepMetadata x -> ConditionStepMetadata)
-> Generic ConditionStepMetadata
forall x. Rep ConditionStepMetadata x -> ConditionStepMetadata
forall x. ConditionStepMetadata -> Rep ConditionStepMetadata x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ConditionStepMetadata x -> ConditionStepMetadata
$cfrom :: forall x. ConditionStepMetadata -> Rep ConditionStepMetadata x
Prelude.Generic)

-- |
-- Create a value of 'ConditionStepMetadata' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'outcome', 'conditionStepMetadata_outcome' - The outcome of the Condition step evaluation.
newConditionStepMetadata ::
  ConditionStepMetadata
newConditionStepMetadata :: ConditionStepMetadata
newConditionStepMetadata =
  ConditionStepMetadata' :: Maybe ConditionOutcome -> ConditionStepMetadata
ConditionStepMetadata' {$sel:outcome:ConditionStepMetadata' :: Maybe ConditionOutcome
outcome = Maybe ConditionOutcome
forall a. Maybe a
Prelude.Nothing}

-- | The outcome of the Condition step evaluation.
conditionStepMetadata_outcome :: Lens.Lens' ConditionStepMetadata (Prelude.Maybe ConditionOutcome)
conditionStepMetadata_outcome :: (Maybe ConditionOutcome -> f (Maybe ConditionOutcome))
-> ConditionStepMetadata -> f ConditionStepMetadata
conditionStepMetadata_outcome = (ConditionStepMetadata -> Maybe ConditionOutcome)
-> (ConditionStepMetadata
    -> Maybe ConditionOutcome -> ConditionStepMetadata)
-> Lens
     ConditionStepMetadata
     ConditionStepMetadata
     (Maybe ConditionOutcome)
     (Maybe ConditionOutcome)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConditionStepMetadata' {Maybe ConditionOutcome
outcome :: Maybe ConditionOutcome
$sel:outcome:ConditionStepMetadata' :: ConditionStepMetadata -> Maybe ConditionOutcome
outcome} -> Maybe ConditionOutcome
outcome) (\s :: ConditionStepMetadata
s@ConditionStepMetadata' {} Maybe ConditionOutcome
a -> ConditionStepMetadata
s {$sel:outcome:ConditionStepMetadata' :: Maybe ConditionOutcome
outcome = Maybe ConditionOutcome
a} :: ConditionStepMetadata)

instance Core.FromJSON ConditionStepMetadata where
  parseJSON :: Value -> Parser ConditionStepMetadata
parseJSON =
    String
-> (Object -> Parser ConditionStepMetadata)
-> Value
-> Parser ConditionStepMetadata
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ConditionStepMetadata"
      ( \Object
x ->
          Maybe ConditionOutcome -> ConditionStepMetadata
ConditionStepMetadata'
            (Maybe ConditionOutcome -> ConditionStepMetadata)
-> Parser (Maybe ConditionOutcome) -> Parser ConditionStepMetadata
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ConditionOutcome)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Outcome")
      )

instance Prelude.Hashable ConditionStepMetadata

instance Prelude.NFData ConditionStepMetadata