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

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

-- | Information used to disable the alarm.
--
-- /See:/ 'newDisableAlarmActionRequest' smart constructor.
data DisableAlarmActionRequest = DisableAlarmActionRequest'
  { -- | The value of the key used as a filter to select only the alarms
    -- associated with the
    -- <https://docs.aws.amazon.com/iotevents/latest/apireference/API_CreateAlarmModel.html#iotevents-CreateAlarmModel-request-key key>.
    DisableAlarmActionRequest -> Maybe Text
keyValue :: Prelude.Maybe Prelude.Text,
    -- | The note that you can leave when you disable the alarm.
    DisableAlarmActionRequest -> Maybe Text
note :: Prelude.Maybe Prelude.Text,
    -- | The request ID. Each ID must be unique within each batch.
    DisableAlarmActionRequest -> Text
requestId :: Prelude.Text,
    -- | The name of the alarm model.
    DisableAlarmActionRequest -> Text
alarmModelName :: Prelude.Text
  }
  deriving (DisableAlarmActionRequest -> DisableAlarmActionRequest -> Bool
(DisableAlarmActionRequest -> DisableAlarmActionRequest -> Bool)
-> (DisableAlarmActionRequest -> DisableAlarmActionRequest -> Bool)
-> Eq DisableAlarmActionRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisableAlarmActionRequest -> DisableAlarmActionRequest -> Bool
$c/= :: DisableAlarmActionRequest -> DisableAlarmActionRequest -> Bool
== :: DisableAlarmActionRequest -> DisableAlarmActionRequest -> Bool
$c== :: DisableAlarmActionRequest -> DisableAlarmActionRequest -> Bool
Prelude.Eq, ReadPrec [DisableAlarmActionRequest]
ReadPrec DisableAlarmActionRequest
Int -> ReadS DisableAlarmActionRequest
ReadS [DisableAlarmActionRequest]
(Int -> ReadS DisableAlarmActionRequest)
-> ReadS [DisableAlarmActionRequest]
-> ReadPrec DisableAlarmActionRequest
-> ReadPrec [DisableAlarmActionRequest]
-> Read DisableAlarmActionRequest
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DisableAlarmActionRequest]
$creadListPrec :: ReadPrec [DisableAlarmActionRequest]
readPrec :: ReadPrec DisableAlarmActionRequest
$creadPrec :: ReadPrec DisableAlarmActionRequest
readList :: ReadS [DisableAlarmActionRequest]
$creadList :: ReadS [DisableAlarmActionRequest]
readsPrec :: Int -> ReadS DisableAlarmActionRequest
$creadsPrec :: Int -> ReadS DisableAlarmActionRequest
Prelude.Read, Int -> DisableAlarmActionRequest -> ShowS
[DisableAlarmActionRequest] -> ShowS
DisableAlarmActionRequest -> String
(Int -> DisableAlarmActionRequest -> ShowS)
-> (DisableAlarmActionRequest -> String)
-> ([DisableAlarmActionRequest] -> ShowS)
-> Show DisableAlarmActionRequest
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisableAlarmActionRequest] -> ShowS
$cshowList :: [DisableAlarmActionRequest] -> ShowS
show :: DisableAlarmActionRequest -> String
$cshow :: DisableAlarmActionRequest -> String
showsPrec :: Int -> DisableAlarmActionRequest -> ShowS
$cshowsPrec :: Int -> DisableAlarmActionRequest -> ShowS
Prelude.Show, (forall x.
 DisableAlarmActionRequest -> Rep DisableAlarmActionRequest x)
-> (forall x.
    Rep DisableAlarmActionRequest x -> DisableAlarmActionRequest)
-> Generic DisableAlarmActionRequest
forall x.
Rep DisableAlarmActionRequest x -> DisableAlarmActionRequest
forall x.
DisableAlarmActionRequest -> Rep DisableAlarmActionRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DisableAlarmActionRequest x -> DisableAlarmActionRequest
$cfrom :: forall x.
DisableAlarmActionRequest -> Rep DisableAlarmActionRequest x
Prelude.Generic)

-- |
-- Create a value of 'DisableAlarmActionRequest' 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:
--
-- 'keyValue', 'disableAlarmActionRequest_keyValue' - The value of the key used as a filter to select only the alarms
-- associated with the
-- <https://docs.aws.amazon.com/iotevents/latest/apireference/API_CreateAlarmModel.html#iotevents-CreateAlarmModel-request-key key>.
--
-- 'note', 'disableAlarmActionRequest_note' - The note that you can leave when you disable the alarm.
--
-- 'requestId', 'disableAlarmActionRequest_requestId' - The request ID. Each ID must be unique within each batch.
--
-- 'alarmModelName', 'disableAlarmActionRequest_alarmModelName' - The name of the alarm model.
newDisableAlarmActionRequest ::
  -- | 'requestId'
  Prelude.Text ->
  -- | 'alarmModelName'
  Prelude.Text ->
  DisableAlarmActionRequest
newDisableAlarmActionRequest :: Text -> Text -> DisableAlarmActionRequest
newDisableAlarmActionRequest
  Text
pRequestId_
  Text
pAlarmModelName_ =
    DisableAlarmActionRequest' :: Maybe Text
-> Maybe Text -> Text -> Text -> DisableAlarmActionRequest
DisableAlarmActionRequest'
      { $sel:keyValue:DisableAlarmActionRequest' :: Maybe Text
keyValue =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:note:DisableAlarmActionRequest' :: Maybe Text
note = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:requestId:DisableAlarmActionRequest' :: Text
requestId = Text
pRequestId_,
        $sel:alarmModelName:DisableAlarmActionRequest' :: Text
alarmModelName = Text
pAlarmModelName_
      }

-- | The value of the key used as a filter to select only the alarms
-- associated with the
-- <https://docs.aws.amazon.com/iotevents/latest/apireference/API_CreateAlarmModel.html#iotevents-CreateAlarmModel-request-key key>.
disableAlarmActionRequest_keyValue :: Lens.Lens' DisableAlarmActionRequest (Prelude.Maybe Prelude.Text)
disableAlarmActionRequest_keyValue :: (Maybe Text -> f (Maybe Text))
-> DisableAlarmActionRequest -> f DisableAlarmActionRequest
disableAlarmActionRequest_keyValue = (DisableAlarmActionRequest -> Maybe Text)
-> (DisableAlarmActionRequest
    -> Maybe Text -> DisableAlarmActionRequest)
-> Lens
     DisableAlarmActionRequest
     DisableAlarmActionRequest
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisableAlarmActionRequest' {Maybe Text
keyValue :: Maybe Text
$sel:keyValue:DisableAlarmActionRequest' :: DisableAlarmActionRequest -> Maybe Text
keyValue} -> Maybe Text
keyValue) (\s :: DisableAlarmActionRequest
s@DisableAlarmActionRequest' {} Maybe Text
a -> DisableAlarmActionRequest
s {$sel:keyValue:DisableAlarmActionRequest' :: Maybe Text
keyValue = Maybe Text
a} :: DisableAlarmActionRequest)

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

-- | The request ID. Each ID must be unique within each batch.
disableAlarmActionRequest_requestId :: Lens.Lens' DisableAlarmActionRequest Prelude.Text
disableAlarmActionRequest_requestId :: (Text -> f Text)
-> DisableAlarmActionRequest -> f DisableAlarmActionRequest
disableAlarmActionRequest_requestId = (DisableAlarmActionRequest -> Text)
-> (DisableAlarmActionRequest -> Text -> DisableAlarmActionRequest)
-> Lens
     DisableAlarmActionRequest DisableAlarmActionRequest Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisableAlarmActionRequest' {Text
requestId :: Text
$sel:requestId:DisableAlarmActionRequest' :: DisableAlarmActionRequest -> Text
requestId} -> Text
requestId) (\s :: DisableAlarmActionRequest
s@DisableAlarmActionRequest' {} Text
a -> DisableAlarmActionRequest
s {$sel:requestId:DisableAlarmActionRequest' :: Text
requestId = Text
a} :: DisableAlarmActionRequest)

-- | The name of the alarm model.
disableAlarmActionRequest_alarmModelName :: Lens.Lens' DisableAlarmActionRequest Prelude.Text
disableAlarmActionRequest_alarmModelName :: (Text -> f Text)
-> DisableAlarmActionRequest -> f DisableAlarmActionRequest
disableAlarmActionRequest_alarmModelName = (DisableAlarmActionRequest -> Text)
-> (DisableAlarmActionRequest -> Text -> DisableAlarmActionRequest)
-> Lens
     DisableAlarmActionRequest DisableAlarmActionRequest Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisableAlarmActionRequest' {Text
alarmModelName :: Text
$sel:alarmModelName:DisableAlarmActionRequest' :: DisableAlarmActionRequest -> Text
alarmModelName} -> Text
alarmModelName) (\s :: DisableAlarmActionRequest
s@DisableAlarmActionRequest' {} Text
a -> DisableAlarmActionRequest
s {$sel:alarmModelName:DisableAlarmActionRequest' :: Text
alarmModelName = Text
a} :: DisableAlarmActionRequest)

instance Prelude.Hashable DisableAlarmActionRequest

instance Prelude.NFData DisableAlarmActionRequest

instance Core.ToJSON DisableAlarmActionRequest where
  toJSON :: DisableAlarmActionRequest -> Value
toJSON DisableAlarmActionRequest' {Maybe Text
Text
alarmModelName :: Text
requestId :: Text
note :: Maybe Text
keyValue :: Maybe Text
$sel:alarmModelName:DisableAlarmActionRequest' :: DisableAlarmActionRequest -> Text
$sel:requestId:DisableAlarmActionRequest' :: DisableAlarmActionRequest -> Text
$sel:note:DisableAlarmActionRequest' :: DisableAlarmActionRequest -> Maybe Text
$sel:keyValue:DisableAlarmActionRequest' :: DisableAlarmActionRequest -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"keyValue" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
keyValue,
            (Text
"note" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
note,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"requestId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
requestId),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"alarmModelName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
alarmModelName)
          ]
      )