{-# 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.MonitoringAlertActions
-- 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.MonitoringAlertActions 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
import Amazonka.SageMaker.Types.ModelDashboardIndicatorAction

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

-- |
-- Create a value of 'MonitoringAlertActions' 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:
--
-- 'modelDashboardIndicator', 'monitoringAlertActions_modelDashboardIndicator' - An alert action taken to light up an icon on the Model Dashboard when an
-- alert goes into @InAlert@ status.
newMonitoringAlertActions ::
  MonitoringAlertActions
newMonitoringAlertActions :: MonitoringAlertActions
newMonitoringAlertActions =
  MonitoringAlertActions'
    { $sel:modelDashboardIndicator:MonitoringAlertActions' :: Maybe ModelDashboardIndicatorAction
modelDashboardIndicator =
        forall a. Maybe a
Prelude.Nothing
    }

-- | An alert action taken to light up an icon on the Model Dashboard when an
-- alert goes into @InAlert@ status.
monitoringAlertActions_modelDashboardIndicator :: Lens.Lens' MonitoringAlertActions (Prelude.Maybe ModelDashboardIndicatorAction)
monitoringAlertActions_modelDashboardIndicator :: Lens' MonitoringAlertActions (Maybe ModelDashboardIndicatorAction)
monitoringAlertActions_modelDashboardIndicator = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MonitoringAlertActions' {Maybe ModelDashboardIndicatorAction
modelDashboardIndicator :: Maybe ModelDashboardIndicatorAction
$sel:modelDashboardIndicator:MonitoringAlertActions' :: MonitoringAlertActions -> Maybe ModelDashboardIndicatorAction
modelDashboardIndicator} -> Maybe ModelDashboardIndicatorAction
modelDashboardIndicator) (\s :: MonitoringAlertActions
s@MonitoringAlertActions' {} Maybe ModelDashboardIndicatorAction
a -> MonitoringAlertActions
s {$sel:modelDashboardIndicator:MonitoringAlertActions' :: Maybe ModelDashboardIndicatorAction
modelDashboardIndicator = Maybe ModelDashboardIndicatorAction
a} :: MonitoringAlertActions)

instance Data.FromJSON MonitoringAlertActions where
  parseJSON :: Value -> Parser MonitoringAlertActions
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"MonitoringAlertActions"
      ( \Object
x ->
          Maybe ModelDashboardIndicatorAction -> MonitoringAlertActions
MonitoringAlertActions'
            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
"ModelDashboardIndicator")
      )

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

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