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

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

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

-- |
-- Create a value of 'ResetAlarmActionRequest' 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', 'resetAlarmActionRequest_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', 'resetAlarmActionRequest_note' - The note that you can leave when you reset the alarm.
--
-- 'requestId', 'resetAlarmActionRequest_requestId' - The request ID. Each ID must be unique within each batch.
--
-- 'alarmModelName', 'resetAlarmActionRequest_alarmModelName' - The name of the alarm model.
newResetAlarmActionRequest ::
  -- | 'requestId'
  Prelude.Text ->
  -- | 'alarmModelName'
  Prelude.Text ->
  ResetAlarmActionRequest
newResetAlarmActionRequest :: Text -> Text -> ResetAlarmActionRequest
newResetAlarmActionRequest
  Text
pRequestId_
  Text
pAlarmModelName_ =
    ResetAlarmActionRequest' :: Maybe Text -> Maybe Text -> Text -> Text -> ResetAlarmActionRequest
ResetAlarmActionRequest'
      { $sel:keyValue:ResetAlarmActionRequest' :: Maybe Text
keyValue =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:note:ResetAlarmActionRequest' :: Maybe Text
note = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:requestId:ResetAlarmActionRequest' :: Text
requestId = Text
pRequestId_,
        $sel:alarmModelName:ResetAlarmActionRequest' :: 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>.
resetAlarmActionRequest_keyValue :: Lens.Lens' ResetAlarmActionRequest (Prelude.Maybe Prelude.Text)
resetAlarmActionRequest_keyValue :: (Maybe Text -> f (Maybe Text))
-> ResetAlarmActionRequest -> f ResetAlarmActionRequest
resetAlarmActionRequest_keyValue = (ResetAlarmActionRequest -> Maybe Text)
-> (ResetAlarmActionRequest
    -> Maybe Text -> ResetAlarmActionRequest)
-> Lens
     ResetAlarmActionRequest
     ResetAlarmActionRequest
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResetAlarmActionRequest' {Maybe Text
keyValue :: Maybe Text
$sel:keyValue:ResetAlarmActionRequest' :: ResetAlarmActionRequest -> Maybe Text
keyValue} -> Maybe Text
keyValue) (\s :: ResetAlarmActionRequest
s@ResetAlarmActionRequest' {} Maybe Text
a -> ResetAlarmActionRequest
s {$sel:keyValue:ResetAlarmActionRequest' :: Maybe Text
keyValue = Maybe Text
a} :: ResetAlarmActionRequest)

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

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

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

instance Prelude.Hashable ResetAlarmActionRequest

instance Prelude.NFData ResetAlarmActionRequest

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