{-# 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.DebugRuleEvaluationStatus
-- 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.DebugRuleEvaluationStatus where

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

-- | Information about the status of the rule evaluation.
--
-- /See:/ 'newDebugRuleEvaluationStatus' smart constructor.
data DebugRuleEvaluationStatus = DebugRuleEvaluationStatus'
  { -- | Timestamp when the rule evaluation status was last modified.
    DebugRuleEvaluationStatus -> Maybe POSIX
lastModifiedTime :: Prelude.Maybe Core.POSIX,
    -- | Details from the rule evaluation.
    DebugRuleEvaluationStatus -> Maybe Text
statusDetails :: Prelude.Maybe Prelude.Text,
    -- | Status of the rule evaluation.
    DebugRuleEvaluationStatus -> Maybe RuleEvaluationStatus
ruleEvaluationStatus :: Prelude.Maybe RuleEvaluationStatus,
    -- | The Amazon Resource Name (ARN) of the rule evaluation job.
    DebugRuleEvaluationStatus -> Maybe Text
ruleEvaluationJobArn :: Prelude.Maybe Prelude.Text,
    -- | The name of the rule configuration.
    DebugRuleEvaluationStatus -> Maybe Text
ruleConfigurationName :: Prelude.Maybe Prelude.Text
  }
  deriving (DebugRuleEvaluationStatus -> DebugRuleEvaluationStatus -> Bool
(DebugRuleEvaluationStatus -> DebugRuleEvaluationStatus -> Bool)
-> (DebugRuleEvaluationStatus -> DebugRuleEvaluationStatus -> Bool)
-> Eq DebugRuleEvaluationStatus
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DebugRuleEvaluationStatus -> DebugRuleEvaluationStatus -> Bool
$c/= :: DebugRuleEvaluationStatus -> DebugRuleEvaluationStatus -> Bool
== :: DebugRuleEvaluationStatus -> DebugRuleEvaluationStatus -> Bool
$c== :: DebugRuleEvaluationStatus -> DebugRuleEvaluationStatus -> Bool
Prelude.Eq, ReadPrec [DebugRuleEvaluationStatus]
ReadPrec DebugRuleEvaluationStatus
Int -> ReadS DebugRuleEvaluationStatus
ReadS [DebugRuleEvaluationStatus]
(Int -> ReadS DebugRuleEvaluationStatus)
-> ReadS [DebugRuleEvaluationStatus]
-> ReadPrec DebugRuleEvaluationStatus
-> ReadPrec [DebugRuleEvaluationStatus]
-> Read DebugRuleEvaluationStatus
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DebugRuleEvaluationStatus]
$creadListPrec :: ReadPrec [DebugRuleEvaluationStatus]
readPrec :: ReadPrec DebugRuleEvaluationStatus
$creadPrec :: ReadPrec DebugRuleEvaluationStatus
readList :: ReadS [DebugRuleEvaluationStatus]
$creadList :: ReadS [DebugRuleEvaluationStatus]
readsPrec :: Int -> ReadS DebugRuleEvaluationStatus
$creadsPrec :: Int -> ReadS DebugRuleEvaluationStatus
Prelude.Read, Int -> DebugRuleEvaluationStatus -> ShowS
[DebugRuleEvaluationStatus] -> ShowS
DebugRuleEvaluationStatus -> String
(Int -> DebugRuleEvaluationStatus -> ShowS)
-> (DebugRuleEvaluationStatus -> String)
-> ([DebugRuleEvaluationStatus] -> ShowS)
-> Show DebugRuleEvaluationStatus
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DebugRuleEvaluationStatus] -> ShowS
$cshowList :: [DebugRuleEvaluationStatus] -> ShowS
show :: DebugRuleEvaluationStatus -> String
$cshow :: DebugRuleEvaluationStatus -> String
showsPrec :: Int -> DebugRuleEvaluationStatus -> ShowS
$cshowsPrec :: Int -> DebugRuleEvaluationStatus -> ShowS
Prelude.Show, (forall x.
 DebugRuleEvaluationStatus -> Rep DebugRuleEvaluationStatus x)
-> (forall x.
    Rep DebugRuleEvaluationStatus x -> DebugRuleEvaluationStatus)
-> Generic DebugRuleEvaluationStatus
forall x.
Rep DebugRuleEvaluationStatus x -> DebugRuleEvaluationStatus
forall x.
DebugRuleEvaluationStatus -> Rep DebugRuleEvaluationStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DebugRuleEvaluationStatus x -> DebugRuleEvaluationStatus
$cfrom :: forall x.
DebugRuleEvaluationStatus -> Rep DebugRuleEvaluationStatus x
Prelude.Generic)

-- |
-- Create a value of 'DebugRuleEvaluationStatus' 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:
--
-- 'lastModifiedTime', 'debugRuleEvaluationStatus_lastModifiedTime' - Timestamp when the rule evaluation status was last modified.
--
-- 'statusDetails', 'debugRuleEvaluationStatus_statusDetails' - Details from the rule evaluation.
--
-- 'ruleEvaluationStatus', 'debugRuleEvaluationStatus_ruleEvaluationStatus' - Status of the rule evaluation.
--
-- 'ruleEvaluationJobArn', 'debugRuleEvaluationStatus_ruleEvaluationJobArn' - The Amazon Resource Name (ARN) of the rule evaluation job.
--
-- 'ruleConfigurationName', 'debugRuleEvaluationStatus_ruleConfigurationName' - The name of the rule configuration.
newDebugRuleEvaluationStatus ::
  DebugRuleEvaluationStatus
newDebugRuleEvaluationStatus :: DebugRuleEvaluationStatus
newDebugRuleEvaluationStatus =
  DebugRuleEvaluationStatus' :: Maybe POSIX
-> Maybe Text
-> Maybe RuleEvaluationStatus
-> Maybe Text
-> Maybe Text
-> DebugRuleEvaluationStatus
DebugRuleEvaluationStatus'
    { $sel:lastModifiedTime:DebugRuleEvaluationStatus' :: Maybe POSIX
lastModifiedTime =
        Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:statusDetails:DebugRuleEvaluationStatus' :: Maybe Text
statusDetails = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:ruleEvaluationStatus:DebugRuleEvaluationStatus' :: Maybe RuleEvaluationStatus
ruleEvaluationStatus = Maybe RuleEvaluationStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:ruleEvaluationJobArn:DebugRuleEvaluationStatus' :: Maybe Text
ruleEvaluationJobArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:ruleConfigurationName:DebugRuleEvaluationStatus' :: Maybe Text
ruleConfigurationName = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | Timestamp when the rule evaluation status was last modified.
debugRuleEvaluationStatus_lastModifiedTime :: Lens.Lens' DebugRuleEvaluationStatus (Prelude.Maybe Prelude.UTCTime)
debugRuleEvaluationStatus_lastModifiedTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> DebugRuleEvaluationStatus -> f DebugRuleEvaluationStatus
debugRuleEvaluationStatus_lastModifiedTime = (DebugRuleEvaluationStatus -> Maybe POSIX)
-> (DebugRuleEvaluationStatus
    -> Maybe POSIX -> DebugRuleEvaluationStatus)
-> Lens
     DebugRuleEvaluationStatus
     DebugRuleEvaluationStatus
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DebugRuleEvaluationStatus' {Maybe POSIX
lastModifiedTime :: Maybe POSIX
$sel:lastModifiedTime:DebugRuleEvaluationStatus' :: DebugRuleEvaluationStatus -> Maybe POSIX
lastModifiedTime} -> Maybe POSIX
lastModifiedTime) (\s :: DebugRuleEvaluationStatus
s@DebugRuleEvaluationStatus' {} Maybe POSIX
a -> DebugRuleEvaluationStatus
s {$sel:lastModifiedTime:DebugRuleEvaluationStatus' :: Maybe POSIX
lastModifiedTime = Maybe POSIX
a} :: DebugRuleEvaluationStatus) ((Maybe POSIX -> f (Maybe POSIX))
 -> DebugRuleEvaluationStatus -> f DebugRuleEvaluationStatus)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> DebugRuleEvaluationStatus
-> f DebugRuleEvaluationStatus
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | Details from the rule evaluation.
debugRuleEvaluationStatus_statusDetails :: Lens.Lens' DebugRuleEvaluationStatus (Prelude.Maybe Prelude.Text)
debugRuleEvaluationStatus_statusDetails :: (Maybe Text -> f (Maybe Text))
-> DebugRuleEvaluationStatus -> f DebugRuleEvaluationStatus
debugRuleEvaluationStatus_statusDetails = (DebugRuleEvaluationStatus -> Maybe Text)
-> (DebugRuleEvaluationStatus
    -> Maybe Text -> DebugRuleEvaluationStatus)
-> Lens
     DebugRuleEvaluationStatus
     DebugRuleEvaluationStatus
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DebugRuleEvaluationStatus' {Maybe Text
statusDetails :: Maybe Text
$sel:statusDetails:DebugRuleEvaluationStatus' :: DebugRuleEvaluationStatus -> Maybe Text
statusDetails} -> Maybe Text
statusDetails) (\s :: DebugRuleEvaluationStatus
s@DebugRuleEvaluationStatus' {} Maybe Text
a -> DebugRuleEvaluationStatus
s {$sel:statusDetails:DebugRuleEvaluationStatus' :: Maybe Text
statusDetails = Maybe Text
a} :: DebugRuleEvaluationStatus)

-- | Status of the rule evaluation.
debugRuleEvaluationStatus_ruleEvaluationStatus :: Lens.Lens' DebugRuleEvaluationStatus (Prelude.Maybe RuleEvaluationStatus)
debugRuleEvaluationStatus_ruleEvaluationStatus :: (Maybe RuleEvaluationStatus -> f (Maybe RuleEvaluationStatus))
-> DebugRuleEvaluationStatus -> f DebugRuleEvaluationStatus
debugRuleEvaluationStatus_ruleEvaluationStatus = (DebugRuleEvaluationStatus -> Maybe RuleEvaluationStatus)
-> (DebugRuleEvaluationStatus
    -> Maybe RuleEvaluationStatus -> DebugRuleEvaluationStatus)
-> Lens
     DebugRuleEvaluationStatus
     DebugRuleEvaluationStatus
     (Maybe RuleEvaluationStatus)
     (Maybe RuleEvaluationStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DebugRuleEvaluationStatus' {Maybe RuleEvaluationStatus
ruleEvaluationStatus :: Maybe RuleEvaluationStatus
$sel:ruleEvaluationStatus:DebugRuleEvaluationStatus' :: DebugRuleEvaluationStatus -> Maybe RuleEvaluationStatus
ruleEvaluationStatus} -> Maybe RuleEvaluationStatus
ruleEvaluationStatus) (\s :: DebugRuleEvaluationStatus
s@DebugRuleEvaluationStatus' {} Maybe RuleEvaluationStatus
a -> DebugRuleEvaluationStatus
s {$sel:ruleEvaluationStatus:DebugRuleEvaluationStatus' :: Maybe RuleEvaluationStatus
ruleEvaluationStatus = Maybe RuleEvaluationStatus
a} :: DebugRuleEvaluationStatus)

-- | The Amazon Resource Name (ARN) of the rule evaluation job.
debugRuleEvaluationStatus_ruleEvaluationJobArn :: Lens.Lens' DebugRuleEvaluationStatus (Prelude.Maybe Prelude.Text)
debugRuleEvaluationStatus_ruleEvaluationJobArn :: (Maybe Text -> f (Maybe Text))
-> DebugRuleEvaluationStatus -> f DebugRuleEvaluationStatus
debugRuleEvaluationStatus_ruleEvaluationJobArn = (DebugRuleEvaluationStatus -> Maybe Text)
-> (DebugRuleEvaluationStatus
    -> Maybe Text -> DebugRuleEvaluationStatus)
-> Lens
     DebugRuleEvaluationStatus
     DebugRuleEvaluationStatus
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DebugRuleEvaluationStatus' {Maybe Text
ruleEvaluationJobArn :: Maybe Text
$sel:ruleEvaluationJobArn:DebugRuleEvaluationStatus' :: DebugRuleEvaluationStatus -> Maybe Text
ruleEvaluationJobArn} -> Maybe Text
ruleEvaluationJobArn) (\s :: DebugRuleEvaluationStatus
s@DebugRuleEvaluationStatus' {} Maybe Text
a -> DebugRuleEvaluationStatus
s {$sel:ruleEvaluationJobArn:DebugRuleEvaluationStatus' :: Maybe Text
ruleEvaluationJobArn = Maybe Text
a} :: DebugRuleEvaluationStatus)

-- | The name of the rule configuration.
debugRuleEvaluationStatus_ruleConfigurationName :: Lens.Lens' DebugRuleEvaluationStatus (Prelude.Maybe Prelude.Text)
debugRuleEvaluationStatus_ruleConfigurationName :: (Maybe Text -> f (Maybe Text))
-> DebugRuleEvaluationStatus -> f DebugRuleEvaluationStatus
debugRuleEvaluationStatus_ruleConfigurationName = (DebugRuleEvaluationStatus -> Maybe Text)
-> (DebugRuleEvaluationStatus
    -> Maybe Text -> DebugRuleEvaluationStatus)
-> Lens
     DebugRuleEvaluationStatus
     DebugRuleEvaluationStatus
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DebugRuleEvaluationStatus' {Maybe Text
ruleConfigurationName :: Maybe Text
$sel:ruleConfigurationName:DebugRuleEvaluationStatus' :: DebugRuleEvaluationStatus -> Maybe Text
ruleConfigurationName} -> Maybe Text
ruleConfigurationName) (\s :: DebugRuleEvaluationStatus
s@DebugRuleEvaluationStatus' {} Maybe Text
a -> DebugRuleEvaluationStatus
s {$sel:ruleConfigurationName:DebugRuleEvaluationStatus' :: Maybe Text
ruleConfigurationName = Maybe Text
a} :: DebugRuleEvaluationStatus)

instance Core.FromJSON DebugRuleEvaluationStatus where
  parseJSON :: Value -> Parser DebugRuleEvaluationStatus
parseJSON =
    String
-> (Object -> Parser DebugRuleEvaluationStatus)
-> Value
-> Parser DebugRuleEvaluationStatus
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"DebugRuleEvaluationStatus"
      ( \Object
x ->
          Maybe POSIX
-> Maybe Text
-> Maybe RuleEvaluationStatus
-> Maybe Text
-> Maybe Text
-> DebugRuleEvaluationStatus
DebugRuleEvaluationStatus'
            (Maybe POSIX
 -> Maybe Text
 -> Maybe RuleEvaluationStatus
 -> Maybe Text
 -> Maybe Text
 -> DebugRuleEvaluationStatus)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe RuleEvaluationStatus
      -> Maybe Text
      -> Maybe Text
      -> DebugRuleEvaluationStatus)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LastModifiedTime")
            Parser
  (Maybe Text
   -> Maybe RuleEvaluationStatus
   -> Maybe Text
   -> Maybe Text
   -> DebugRuleEvaluationStatus)
-> Parser (Maybe Text)
-> Parser
     (Maybe RuleEvaluationStatus
      -> Maybe Text -> Maybe Text -> DebugRuleEvaluationStatus)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"StatusDetails")
            Parser
  (Maybe RuleEvaluationStatus
   -> Maybe Text -> Maybe Text -> DebugRuleEvaluationStatus)
-> Parser (Maybe RuleEvaluationStatus)
-> Parser (Maybe Text -> Maybe Text -> DebugRuleEvaluationStatus)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe RuleEvaluationStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"RuleEvaluationStatus")
            Parser (Maybe Text -> Maybe Text -> DebugRuleEvaluationStatus)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> DebugRuleEvaluationStatus)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"RuleEvaluationJobArn")
            Parser (Maybe Text -> DebugRuleEvaluationStatus)
-> Parser (Maybe Text) -> Parser DebugRuleEvaluationStatus
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"RuleConfigurationName")
      )

instance Prelude.Hashable DebugRuleEvaluationStatus

instance Prelude.NFData DebugRuleEvaluationStatus