{-# 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.ModelDashboardIndicatorAction
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.SageMaker.Types.ModelDashboardIndicatorAction where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

-- | An alert action taken to light up an icon on the Amazon SageMaker Model
-- Dashboard when an alert goes into @InAlert@ status.
--
-- /See:/ 'newModelDashboardIndicatorAction' smart constructor.
data ModelDashboardIndicatorAction = ModelDashboardIndicatorAction'
  { -- | Indicates whether the alert action is turned on.
    ModelDashboardIndicatorAction -> Maybe Bool
enabled :: Prelude.Maybe Prelude.Bool
  }
  deriving (ModelDashboardIndicatorAction
-> ModelDashboardIndicatorAction -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModelDashboardIndicatorAction
-> ModelDashboardIndicatorAction -> Bool
$c/= :: ModelDashboardIndicatorAction
-> ModelDashboardIndicatorAction -> Bool
== :: ModelDashboardIndicatorAction
-> ModelDashboardIndicatorAction -> Bool
$c== :: ModelDashboardIndicatorAction
-> ModelDashboardIndicatorAction -> Bool
Prelude.Eq, ReadPrec [ModelDashboardIndicatorAction]
ReadPrec ModelDashboardIndicatorAction
Int -> ReadS ModelDashboardIndicatorAction
ReadS [ModelDashboardIndicatorAction]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModelDashboardIndicatorAction]
$creadListPrec :: ReadPrec [ModelDashboardIndicatorAction]
readPrec :: ReadPrec ModelDashboardIndicatorAction
$creadPrec :: ReadPrec ModelDashboardIndicatorAction
readList :: ReadS [ModelDashboardIndicatorAction]
$creadList :: ReadS [ModelDashboardIndicatorAction]
readsPrec :: Int -> ReadS ModelDashboardIndicatorAction
$creadsPrec :: Int -> ReadS ModelDashboardIndicatorAction
Prelude.Read, Int -> ModelDashboardIndicatorAction -> ShowS
[ModelDashboardIndicatorAction] -> ShowS
ModelDashboardIndicatorAction -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModelDashboardIndicatorAction] -> ShowS
$cshowList :: [ModelDashboardIndicatorAction] -> ShowS
show :: ModelDashboardIndicatorAction -> String
$cshow :: ModelDashboardIndicatorAction -> String
showsPrec :: Int -> ModelDashboardIndicatorAction -> ShowS
$cshowsPrec :: Int -> ModelDashboardIndicatorAction -> ShowS
Prelude.Show, forall x.
Rep ModelDashboardIndicatorAction x
-> ModelDashboardIndicatorAction
forall x.
ModelDashboardIndicatorAction
-> Rep ModelDashboardIndicatorAction x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ModelDashboardIndicatorAction x
-> ModelDashboardIndicatorAction
$cfrom :: forall x.
ModelDashboardIndicatorAction
-> Rep ModelDashboardIndicatorAction x
Prelude.Generic)

-- |
-- Create a value of 'ModelDashboardIndicatorAction' 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:
--
-- 'enabled', 'modelDashboardIndicatorAction_enabled' - Indicates whether the alert action is turned on.
newModelDashboardIndicatorAction ::
  ModelDashboardIndicatorAction
newModelDashboardIndicatorAction :: ModelDashboardIndicatorAction
newModelDashboardIndicatorAction =
  ModelDashboardIndicatorAction'
    { $sel:enabled:ModelDashboardIndicatorAction' :: Maybe Bool
enabled =
        forall a. Maybe a
Prelude.Nothing
    }

-- | Indicates whether the alert action is turned on.
modelDashboardIndicatorAction_enabled :: Lens.Lens' ModelDashboardIndicatorAction (Prelude.Maybe Prelude.Bool)
modelDashboardIndicatorAction_enabled :: Lens' ModelDashboardIndicatorAction (Maybe Bool)
modelDashboardIndicatorAction_enabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModelDashboardIndicatorAction' {Maybe Bool
enabled :: Maybe Bool
$sel:enabled:ModelDashboardIndicatorAction' :: ModelDashboardIndicatorAction -> Maybe Bool
enabled} -> Maybe Bool
enabled) (\s :: ModelDashboardIndicatorAction
s@ModelDashboardIndicatorAction' {} Maybe Bool
a -> ModelDashboardIndicatorAction
s {$sel:enabled:ModelDashboardIndicatorAction' :: Maybe Bool
enabled = Maybe Bool
a} :: ModelDashboardIndicatorAction)

instance Data.FromJSON ModelDashboardIndicatorAction where
  parseJSON :: Value -> Parser ModelDashboardIndicatorAction
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ModelDashboardIndicatorAction"
      ( \Object
x ->
          Maybe Bool -> ModelDashboardIndicatorAction
ModelDashboardIndicatorAction'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Enabled")
      )

instance
  Prelude.Hashable
    ModelDashboardIndicatorAction
  where
  hashWithSalt :: Int -> ModelDashboardIndicatorAction -> Int
hashWithSalt Int
_salt ModelDashboardIndicatorAction' {Maybe Bool
enabled :: Maybe Bool
$sel:enabled:ModelDashboardIndicatorAction' :: ModelDashboardIndicatorAction -> Maybe Bool
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
enabled

instance Prelude.NFData ModelDashboardIndicatorAction where
  rnf :: ModelDashboardIndicatorAction -> ()
rnf ModelDashboardIndicatorAction' {Maybe Bool
enabled :: Maybe Bool
$sel:enabled:ModelDashboardIndicatorAction' :: ModelDashboardIndicatorAction -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
enabled