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

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

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

-- |
-- Create a value of 'SnoozeAlarmActionRequest' 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', 'snoozeAlarmActionRequest_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', 'snoozeAlarmActionRequest_note' - The note that you can leave when you snooze the alarm.
--
-- 'requestId', 'snoozeAlarmActionRequest_requestId' - The request ID. Each ID must be unique within each batch.
--
-- 'alarmModelName', 'snoozeAlarmActionRequest_alarmModelName' - The name of the alarm model.
--
-- 'snoozeDuration', 'snoozeAlarmActionRequest_snoozeDuration' - The snooze time in seconds. The alarm automatically changes to the
-- @NORMAL@ state after this duration.
newSnoozeAlarmActionRequest ::
  -- | 'requestId'
  Prelude.Text ->
  -- | 'alarmModelName'
  Prelude.Text ->
  -- | 'snoozeDuration'
  Prelude.Int ->
  SnoozeAlarmActionRequest
newSnoozeAlarmActionRequest :: Text -> Text -> Int -> SnoozeAlarmActionRequest
newSnoozeAlarmActionRequest
  Text
pRequestId_
  Text
pAlarmModelName_
  Int
pSnoozeDuration_ =
    SnoozeAlarmActionRequest' :: Maybe Text
-> Maybe Text -> Text -> Text -> Int -> SnoozeAlarmActionRequest
SnoozeAlarmActionRequest'
      { $sel:keyValue:SnoozeAlarmActionRequest' :: Maybe Text
keyValue =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:note:SnoozeAlarmActionRequest' :: Maybe Text
note = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:requestId:SnoozeAlarmActionRequest' :: Text
requestId = Text
pRequestId_,
        $sel:alarmModelName:SnoozeAlarmActionRequest' :: Text
alarmModelName = Text
pAlarmModelName_,
        $sel:snoozeDuration:SnoozeAlarmActionRequest' :: Int
snoozeDuration = Int
pSnoozeDuration_
      }

-- | 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>.
snoozeAlarmActionRequest_keyValue :: Lens.Lens' SnoozeAlarmActionRequest (Prelude.Maybe Prelude.Text)
snoozeAlarmActionRequest_keyValue :: (Maybe Text -> f (Maybe Text))
-> SnoozeAlarmActionRequest -> f SnoozeAlarmActionRequest
snoozeAlarmActionRequest_keyValue = (SnoozeAlarmActionRequest -> Maybe Text)
-> (SnoozeAlarmActionRequest
    -> Maybe Text -> SnoozeAlarmActionRequest)
-> Lens
     SnoozeAlarmActionRequest
     SnoozeAlarmActionRequest
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SnoozeAlarmActionRequest' {Maybe Text
keyValue :: Maybe Text
$sel:keyValue:SnoozeAlarmActionRequest' :: SnoozeAlarmActionRequest -> Maybe Text
keyValue} -> Maybe Text
keyValue) (\s :: SnoozeAlarmActionRequest
s@SnoozeAlarmActionRequest' {} Maybe Text
a -> SnoozeAlarmActionRequest
s {$sel:keyValue:SnoozeAlarmActionRequest' :: Maybe Text
keyValue = Maybe Text
a} :: SnoozeAlarmActionRequest)

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

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

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

-- | The snooze time in seconds. The alarm automatically changes to the
-- @NORMAL@ state after this duration.
snoozeAlarmActionRequest_snoozeDuration :: Lens.Lens' SnoozeAlarmActionRequest Prelude.Int
snoozeAlarmActionRequest_snoozeDuration :: (Int -> f Int)
-> SnoozeAlarmActionRequest -> f SnoozeAlarmActionRequest
snoozeAlarmActionRequest_snoozeDuration = (SnoozeAlarmActionRequest -> Int)
-> (SnoozeAlarmActionRequest -> Int -> SnoozeAlarmActionRequest)
-> Lens SnoozeAlarmActionRequest SnoozeAlarmActionRequest Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SnoozeAlarmActionRequest' {Int
snoozeDuration :: Int
$sel:snoozeDuration:SnoozeAlarmActionRequest' :: SnoozeAlarmActionRequest -> Int
snoozeDuration} -> Int
snoozeDuration) (\s :: SnoozeAlarmActionRequest
s@SnoozeAlarmActionRequest' {} Int
a -> SnoozeAlarmActionRequest
s {$sel:snoozeDuration:SnoozeAlarmActionRequest' :: Int
snoozeDuration = Int
a} :: SnoozeAlarmActionRequest)

instance Prelude.Hashable SnoozeAlarmActionRequest

instance Prelude.NFData SnoozeAlarmActionRequest

instance Core.ToJSON SnoozeAlarmActionRequest where
  toJSON :: SnoozeAlarmActionRequest -> Value
toJSON SnoozeAlarmActionRequest' {Int
Maybe Text
Text
snoozeDuration :: Int
alarmModelName :: Text
requestId :: Text
note :: Maybe Text
keyValue :: Maybe Text
$sel:snoozeDuration:SnoozeAlarmActionRequest' :: SnoozeAlarmActionRequest -> Int
$sel:alarmModelName:SnoozeAlarmActionRequest' :: SnoozeAlarmActionRequest -> Text
$sel:requestId:SnoozeAlarmActionRequest' :: SnoozeAlarmActionRequest -> Text
$sel:note:SnoozeAlarmActionRequest' :: SnoozeAlarmActionRequest -> Maybe Text
$sel:keyValue:SnoozeAlarmActionRequest' :: SnoozeAlarmActionRequest -> 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),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"snoozeDuration" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Int
snoozeDuration)
          ]
      )