{-# 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.IoTEventsData.Types.AcknowledgeActionConfiguration
-- 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.IoTEventsData.Types.AcknowledgeActionConfiguration where

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

-- | Contains the configuration information of an acknowledge action.
--
-- /See:/ 'newAcknowledgeActionConfiguration' smart constructor.
data AcknowledgeActionConfiguration = AcknowledgeActionConfiguration'
  { -- | The note that you can leave when you acknowledge the alarm.
    AcknowledgeActionConfiguration -> Maybe Text
note :: Prelude.Maybe Prelude.Text
  }
  deriving (AcknowledgeActionConfiguration
-> AcknowledgeActionConfiguration -> Bool
(AcknowledgeActionConfiguration
 -> AcknowledgeActionConfiguration -> Bool)
-> (AcknowledgeActionConfiguration
    -> AcknowledgeActionConfiguration -> Bool)
-> Eq AcknowledgeActionConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AcknowledgeActionConfiguration
-> AcknowledgeActionConfiguration -> Bool
$c/= :: AcknowledgeActionConfiguration
-> AcknowledgeActionConfiguration -> Bool
== :: AcknowledgeActionConfiguration
-> AcknowledgeActionConfiguration -> Bool
$c== :: AcknowledgeActionConfiguration
-> AcknowledgeActionConfiguration -> Bool
Prelude.Eq, ReadPrec [AcknowledgeActionConfiguration]
ReadPrec AcknowledgeActionConfiguration
Int -> ReadS AcknowledgeActionConfiguration
ReadS [AcknowledgeActionConfiguration]
(Int -> ReadS AcknowledgeActionConfiguration)
-> ReadS [AcknowledgeActionConfiguration]
-> ReadPrec AcknowledgeActionConfiguration
-> ReadPrec [AcknowledgeActionConfiguration]
-> Read AcknowledgeActionConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AcknowledgeActionConfiguration]
$creadListPrec :: ReadPrec [AcknowledgeActionConfiguration]
readPrec :: ReadPrec AcknowledgeActionConfiguration
$creadPrec :: ReadPrec AcknowledgeActionConfiguration
readList :: ReadS [AcknowledgeActionConfiguration]
$creadList :: ReadS [AcknowledgeActionConfiguration]
readsPrec :: Int -> ReadS AcknowledgeActionConfiguration
$creadsPrec :: Int -> ReadS AcknowledgeActionConfiguration
Prelude.Read, Int -> AcknowledgeActionConfiguration -> ShowS
[AcknowledgeActionConfiguration] -> ShowS
AcknowledgeActionConfiguration -> String
(Int -> AcknowledgeActionConfiguration -> ShowS)
-> (AcknowledgeActionConfiguration -> String)
-> ([AcknowledgeActionConfiguration] -> ShowS)
-> Show AcknowledgeActionConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AcknowledgeActionConfiguration] -> ShowS
$cshowList :: [AcknowledgeActionConfiguration] -> ShowS
show :: AcknowledgeActionConfiguration -> String
$cshow :: AcknowledgeActionConfiguration -> String
showsPrec :: Int -> AcknowledgeActionConfiguration -> ShowS
$cshowsPrec :: Int -> AcknowledgeActionConfiguration -> ShowS
Prelude.Show, (forall x.
 AcknowledgeActionConfiguration
 -> Rep AcknowledgeActionConfiguration x)
-> (forall x.
    Rep AcknowledgeActionConfiguration x
    -> AcknowledgeActionConfiguration)
-> Generic AcknowledgeActionConfiguration
forall x.
Rep AcknowledgeActionConfiguration x
-> AcknowledgeActionConfiguration
forall x.
AcknowledgeActionConfiguration
-> Rep AcknowledgeActionConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AcknowledgeActionConfiguration x
-> AcknowledgeActionConfiguration
$cfrom :: forall x.
AcknowledgeActionConfiguration
-> Rep AcknowledgeActionConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'AcknowledgeActionConfiguration' 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:
--
-- 'note', 'acknowledgeActionConfiguration_note' - The note that you can leave when you acknowledge the alarm.
newAcknowledgeActionConfiguration ::
  AcknowledgeActionConfiguration
newAcknowledgeActionConfiguration :: AcknowledgeActionConfiguration
newAcknowledgeActionConfiguration =
  AcknowledgeActionConfiguration' :: Maybe Text -> AcknowledgeActionConfiguration
AcknowledgeActionConfiguration'
    { $sel:note:AcknowledgeActionConfiguration' :: Maybe Text
note =
        Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The note that you can leave when you acknowledge the alarm.
acknowledgeActionConfiguration_note :: Lens.Lens' AcknowledgeActionConfiguration (Prelude.Maybe Prelude.Text)
acknowledgeActionConfiguration_note :: (Maybe Text -> f (Maybe Text))
-> AcknowledgeActionConfiguration
-> f AcknowledgeActionConfiguration
acknowledgeActionConfiguration_note = (AcknowledgeActionConfiguration -> Maybe Text)
-> (AcknowledgeActionConfiguration
    -> Maybe Text -> AcknowledgeActionConfiguration)
-> Lens
     AcknowledgeActionConfiguration
     AcknowledgeActionConfiguration
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AcknowledgeActionConfiguration' {Maybe Text
note :: Maybe Text
$sel:note:AcknowledgeActionConfiguration' :: AcknowledgeActionConfiguration -> Maybe Text
note} -> Maybe Text
note) (\s :: AcknowledgeActionConfiguration
s@AcknowledgeActionConfiguration' {} Maybe Text
a -> AcknowledgeActionConfiguration
s {$sel:note:AcknowledgeActionConfiguration' :: Maybe Text
note = Maybe Text
a} :: AcknowledgeActionConfiguration)

instance Core.FromJSON AcknowledgeActionConfiguration where
  parseJSON :: Value -> Parser AcknowledgeActionConfiguration
parseJSON =
    String
-> (Object -> Parser AcknowledgeActionConfiguration)
-> Value
-> Parser AcknowledgeActionConfiguration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AcknowledgeActionConfiguration"
      ( \Object
x ->
          Maybe Text -> AcknowledgeActionConfiguration
AcknowledgeActionConfiguration'
            (Maybe Text -> AcknowledgeActionConfiguration)
-> Parser (Maybe Text) -> Parser AcknowledgeActionConfiguration
forall (f :: * -> *) a b. Functor 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
"note")
      )

instance
  Prelude.Hashable
    AcknowledgeActionConfiguration

instance
  Prelude.NFData
    AcknowledgeActionConfiguration