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

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

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

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

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

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

instance Prelude.NFData DisableActionConfiguration