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

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

-- | Information needed to acknowledge the alarm.
--
-- /See:/ 'newAcknowledgeAlarmActionRequest' smart constructor.
data AcknowledgeAlarmActionRequest = AcknowledgeAlarmActionRequest'
  { -- | 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>.
    AcknowledgeAlarmActionRequest -> Maybe Text
keyValue :: Prelude.Maybe Prelude.Text,
    -- | The note that you can leave when you acknowledge the alarm.
    AcknowledgeAlarmActionRequest -> Maybe Text
note :: Prelude.Maybe Prelude.Text,
    -- | The request ID. Each ID must be unique within each batch.
    AcknowledgeAlarmActionRequest -> Text
requestId :: Prelude.Text,
    -- | The name of the alarm model.
    AcknowledgeAlarmActionRequest -> Text
alarmModelName :: Prelude.Text
  }
  deriving (AcknowledgeAlarmActionRequest
-> AcknowledgeAlarmActionRequest -> Bool
(AcknowledgeAlarmActionRequest
 -> AcknowledgeAlarmActionRequest -> Bool)
-> (AcknowledgeAlarmActionRequest
    -> AcknowledgeAlarmActionRequest -> Bool)
-> Eq AcknowledgeAlarmActionRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AcknowledgeAlarmActionRequest
-> AcknowledgeAlarmActionRequest -> Bool
$c/= :: AcknowledgeAlarmActionRequest
-> AcknowledgeAlarmActionRequest -> Bool
== :: AcknowledgeAlarmActionRequest
-> AcknowledgeAlarmActionRequest -> Bool
$c== :: AcknowledgeAlarmActionRequest
-> AcknowledgeAlarmActionRequest -> Bool
Prelude.Eq, ReadPrec [AcknowledgeAlarmActionRequest]
ReadPrec AcknowledgeAlarmActionRequest
Int -> ReadS AcknowledgeAlarmActionRequest
ReadS [AcknowledgeAlarmActionRequest]
(Int -> ReadS AcknowledgeAlarmActionRequest)
-> ReadS [AcknowledgeAlarmActionRequest]
-> ReadPrec AcknowledgeAlarmActionRequest
-> ReadPrec [AcknowledgeAlarmActionRequest]
-> Read AcknowledgeAlarmActionRequest
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AcknowledgeAlarmActionRequest]
$creadListPrec :: ReadPrec [AcknowledgeAlarmActionRequest]
readPrec :: ReadPrec AcknowledgeAlarmActionRequest
$creadPrec :: ReadPrec AcknowledgeAlarmActionRequest
readList :: ReadS [AcknowledgeAlarmActionRequest]
$creadList :: ReadS [AcknowledgeAlarmActionRequest]
readsPrec :: Int -> ReadS AcknowledgeAlarmActionRequest
$creadsPrec :: Int -> ReadS AcknowledgeAlarmActionRequest
Prelude.Read, Int -> AcknowledgeAlarmActionRequest -> ShowS
[AcknowledgeAlarmActionRequest] -> ShowS
AcknowledgeAlarmActionRequest -> String
(Int -> AcknowledgeAlarmActionRequest -> ShowS)
-> (AcknowledgeAlarmActionRequest -> String)
-> ([AcknowledgeAlarmActionRequest] -> ShowS)
-> Show AcknowledgeAlarmActionRequest
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AcknowledgeAlarmActionRequest] -> ShowS
$cshowList :: [AcknowledgeAlarmActionRequest] -> ShowS
show :: AcknowledgeAlarmActionRequest -> String
$cshow :: AcknowledgeAlarmActionRequest -> String
showsPrec :: Int -> AcknowledgeAlarmActionRequest -> ShowS
$cshowsPrec :: Int -> AcknowledgeAlarmActionRequest -> ShowS
Prelude.Show, (forall x.
 AcknowledgeAlarmActionRequest
 -> Rep AcknowledgeAlarmActionRequest x)
-> (forall x.
    Rep AcknowledgeAlarmActionRequest x
    -> AcknowledgeAlarmActionRequest)
-> Generic AcknowledgeAlarmActionRequest
forall x.
Rep AcknowledgeAlarmActionRequest x
-> AcknowledgeAlarmActionRequest
forall x.
AcknowledgeAlarmActionRequest
-> Rep AcknowledgeAlarmActionRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AcknowledgeAlarmActionRequest x
-> AcknowledgeAlarmActionRequest
$cfrom :: forall x.
AcknowledgeAlarmActionRequest
-> Rep AcknowledgeAlarmActionRequest x
Prelude.Generic)

-- |
-- Create a value of 'AcknowledgeAlarmActionRequest' 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', 'acknowledgeAlarmActionRequest_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', 'acknowledgeAlarmActionRequest_note' - The note that you can leave when you acknowledge the alarm.
--
-- 'requestId', 'acknowledgeAlarmActionRequest_requestId' - The request ID. Each ID must be unique within each batch.
--
-- 'alarmModelName', 'acknowledgeAlarmActionRequest_alarmModelName' - The name of the alarm model.
newAcknowledgeAlarmActionRequest ::
  -- | 'requestId'
  Prelude.Text ->
  -- | 'alarmModelName'
  Prelude.Text ->
  AcknowledgeAlarmActionRequest
newAcknowledgeAlarmActionRequest :: Text -> Text -> AcknowledgeAlarmActionRequest
newAcknowledgeAlarmActionRequest
  Text
pRequestId_
  Text
pAlarmModelName_ =
    AcknowledgeAlarmActionRequest' :: Maybe Text
-> Maybe Text -> Text -> Text -> AcknowledgeAlarmActionRequest
AcknowledgeAlarmActionRequest'
      { $sel:keyValue:AcknowledgeAlarmActionRequest' :: Maybe Text
keyValue =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:note:AcknowledgeAlarmActionRequest' :: Maybe Text
note = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:requestId:AcknowledgeAlarmActionRequest' :: Text
requestId = Text
pRequestId_,
        $sel:alarmModelName:AcknowledgeAlarmActionRequest' :: 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>.
acknowledgeAlarmActionRequest_keyValue :: Lens.Lens' AcknowledgeAlarmActionRequest (Prelude.Maybe Prelude.Text)
acknowledgeAlarmActionRequest_keyValue :: (Maybe Text -> f (Maybe Text))
-> AcknowledgeAlarmActionRequest -> f AcknowledgeAlarmActionRequest
acknowledgeAlarmActionRequest_keyValue = (AcknowledgeAlarmActionRequest -> Maybe Text)
-> (AcknowledgeAlarmActionRequest
    -> Maybe Text -> AcknowledgeAlarmActionRequest)
-> Lens
     AcknowledgeAlarmActionRequest
     AcknowledgeAlarmActionRequest
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AcknowledgeAlarmActionRequest' {Maybe Text
keyValue :: Maybe Text
$sel:keyValue:AcknowledgeAlarmActionRequest' :: AcknowledgeAlarmActionRequest -> Maybe Text
keyValue} -> Maybe Text
keyValue) (\s :: AcknowledgeAlarmActionRequest
s@AcknowledgeAlarmActionRequest' {} Maybe Text
a -> AcknowledgeAlarmActionRequest
s {$sel:keyValue:AcknowledgeAlarmActionRequest' :: Maybe Text
keyValue = Maybe Text
a} :: AcknowledgeAlarmActionRequest)

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

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

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

instance
  Prelude.Hashable
    AcknowledgeAlarmActionRequest

instance Prelude.NFData AcknowledgeAlarmActionRequest

instance Core.ToJSON AcknowledgeAlarmActionRequest where
  toJSON :: AcknowledgeAlarmActionRequest -> Value
toJSON AcknowledgeAlarmActionRequest' {Maybe Text
Text
alarmModelName :: Text
requestId :: Text
note :: Maybe Text
keyValue :: Maybe Text
$sel:alarmModelName:AcknowledgeAlarmActionRequest' :: AcknowledgeAlarmActionRequest -> Text
$sel:requestId:AcknowledgeAlarmActionRequest' :: AcknowledgeAlarmActionRequest -> Text
$sel:note:AcknowledgeAlarmActionRequest' :: AcknowledgeAlarmActionRequest -> Maybe Text
$sel:keyValue:AcknowledgeAlarmActionRequest' :: AcknowledgeAlarmActionRequest -> 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)
          ]
      )