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

-- | 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
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]
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
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.
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'
    { $sel:note:AcknowledgeActionConfiguration' :: Maybe Text
note =
        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 :: Lens' AcknowledgeActionConfiguration (Maybe Text)
acknowledgeActionConfiguration_note = 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 Data.FromJSON AcknowledgeActionConfiguration where
  parseJSON :: Value -> Parser AcknowledgeActionConfiguration
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"AcknowledgeActionConfiguration"
      ( \Object
x ->
          Maybe Text -> AcknowledgeActionConfiguration
AcknowledgeActionConfiguration'
            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
"note")
      )

instance
  Prelude.Hashable
    AcknowledgeActionConfiguration
  where
  hashWithSalt :: Int -> AcknowledgeActionConfiguration -> Int
hashWithSalt
    Int
_salt
    AcknowledgeActionConfiguration' {Maybe Text
note :: Maybe Text
$sel:note:AcknowledgeActionConfiguration' :: AcknowledgeActionConfiguration -> Maybe Text
..} =
      Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
note

instance
  Prelude.NFData
    AcknowledgeActionConfiguration
  where
  rnf :: AcknowledgeActionConfiguration -> ()
rnf AcknowledgeActionConfiguration' {Maybe Text
note :: Maybe Text
$sel:note:AcknowledgeActionConfiguration' :: AcknowledgeActionConfiguration -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
note