{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.CloudWatch.SetAlarmState
(
SetAlarmState (..),
newSetAlarmState,
setAlarmState_stateReasonData,
setAlarmState_alarmName,
setAlarmState_stateValue,
setAlarmState_stateReason,
SetAlarmStateResponse (..),
newSetAlarmStateResponse,
)
where
import Amazonka.CloudWatch.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data SetAlarmState = SetAlarmState'
{
SetAlarmState -> Maybe Text
stateReasonData :: Prelude.Maybe Prelude.Text,
SetAlarmState -> Text
alarmName :: Prelude.Text,
SetAlarmState -> StateValue
stateValue :: StateValue,
SetAlarmState -> Text
stateReason :: Prelude.Text
}
deriving (SetAlarmState -> SetAlarmState -> Bool
(SetAlarmState -> SetAlarmState -> Bool)
-> (SetAlarmState -> SetAlarmState -> Bool) -> Eq SetAlarmState
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SetAlarmState -> SetAlarmState -> Bool
$c/= :: SetAlarmState -> SetAlarmState -> Bool
== :: SetAlarmState -> SetAlarmState -> Bool
$c== :: SetAlarmState -> SetAlarmState -> Bool
Prelude.Eq, ReadPrec [SetAlarmState]
ReadPrec SetAlarmState
Int -> ReadS SetAlarmState
ReadS [SetAlarmState]
(Int -> ReadS SetAlarmState)
-> ReadS [SetAlarmState]
-> ReadPrec SetAlarmState
-> ReadPrec [SetAlarmState]
-> Read SetAlarmState
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SetAlarmState]
$creadListPrec :: ReadPrec [SetAlarmState]
readPrec :: ReadPrec SetAlarmState
$creadPrec :: ReadPrec SetAlarmState
readList :: ReadS [SetAlarmState]
$creadList :: ReadS [SetAlarmState]
readsPrec :: Int -> ReadS SetAlarmState
$creadsPrec :: Int -> ReadS SetAlarmState
Prelude.Read, Int -> SetAlarmState -> ShowS
[SetAlarmState] -> ShowS
SetAlarmState -> String
(Int -> SetAlarmState -> ShowS)
-> (SetAlarmState -> String)
-> ([SetAlarmState] -> ShowS)
-> Show SetAlarmState
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SetAlarmState] -> ShowS
$cshowList :: [SetAlarmState] -> ShowS
show :: SetAlarmState -> String
$cshow :: SetAlarmState -> String
showsPrec :: Int -> SetAlarmState -> ShowS
$cshowsPrec :: Int -> SetAlarmState -> ShowS
Prelude.Show, (forall x. SetAlarmState -> Rep SetAlarmState x)
-> (forall x. Rep SetAlarmState x -> SetAlarmState)
-> Generic SetAlarmState
forall x. Rep SetAlarmState x -> SetAlarmState
forall x. SetAlarmState -> Rep SetAlarmState x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SetAlarmState x -> SetAlarmState
$cfrom :: forall x. SetAlarmState -> Rep SetAlarmState x
Prelude.Generic)
newSetAlarmState ::
Prelude.Text ->
StateValue ->
Prelude.Text ->
SetAlarmState
newSetAlarmState :: Text -> StateValue -> Text -> SetAlarmState
newSetAlarmState
Text
pAlarmName_
StateValue
pStateValue_
Text
pStateReason_ =
SetAlarmState' :: Maybe Text -> Text -> StateValue -> Text -> SetAlarmState
SetAlarmState'
{ $sel:stateReasonData:SetAlarmState' :: Maybe Text
stateReasonData = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:alarmName:SetAlarmState' :: Text
alarmName = Text
pAlarmName_,
$sel:stateValue:SetAlarmState' :: StateValue
stateValue = StateValue
pStateValue_,
$sel:stateReason:SetAlarmState' :: Text
stateReason = Text
pStateReason_
}
setAlarmState_stateReasonData :: Lens.Lens' SetAlarmState (Prelude.Maybe Prelude.Text)
setAlarmState_stateReasonData :: (Maybe Text -> f (Maybe Text)) -> SetAlarmState -> f SetAlarmState
setAlarmState_stateReasonData = (SetAlarmState -> Maybe Text)
-> (SetAlarmState -> Maybe Text -> SetAlarmState)
-> Lens SetAlarmState SetAlarmState (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetAlarmState' {Maybe Text
stateReasonData :: Maybe Text
$sel:stateReasonData:SetAlarmState' :: SetAlarmState -> Maybe Text
stateReasonData} -> Maybe Text
stateReasonData) (\s :: SetAlarmState
s@SetAlarmState' {} Maybe Text
a -> SetAlarmState
s {$sel:stateReasonData:SetAlarmState' :: Maybe Text
stateReasonData = Maybe Text
a} :: SetAlarmState)
setAlarmState_alarmName :: Lens.Lens' SetAlarmState Prelude.Text
setAlarmState_alarmName :: (Text -> f Text) -> SetAlarmState -> f SetAlarmState
setAlarmState_alarmName = (SetAlarmState -> Text)
-> (SetAlarmState -> Text -> SetAlarmState)
-> Lens SetAlarmState SetAlarmState Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetAlarmState' {Text
alarmName :: Text
$sel:alarmName:SetAlarmState' :: SetAlarmState -> Text
alarmName} -> Text
alarmName) (\s :: SetAlarmState
s@SetAlarmState' {} Text
a -> SetAlarmState
s {$sel:alarmName:SetAlarmState' :: Text
alarmName = Text
a} :: SetAlarmState)
setAlarmState_stateValue :: Lens.Lens' SetAlarmState StateValue
setAlarmState_stateValue :: (StateValue -> f StateValue) -> SetAlarmState -> f SetAlarmState
setAlarmState_stateValue = (SetAlarmState -> StateValue)
-> (SetAlarmState -> StateValue -> SetAlarmState)
-> Lens SetAlarmState SetAlarmState StateValue StateValue
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetAlarmState' {StateValue
stateValue :: StateValue
$sel:stateValue:SetAlarmState' :: SetAlarmState -> StateValue
stateValue} -> StateValue
stateValue) (\s :: SetAlarmState
s@SetAlarmState' {} StateValue
a -> SetAlarmState
s {$sel:stateValue:SetAlarmState' :: StateValue
stateValue = StateValue
a} :: SetAlarmState)
setAlarmState_stateReason :: Lens.Lens' SetAlarmState Prelude.Text
setAlarmState_stateReason :: (Text -> f Text) -> SetAlarmState -> f SetAlarmState
setAlarmState_stateReason = (SetAlarmState -> Text)
-> (SetAlarmState -> Text -> SetAlarmState)
-> Lens SetAlarmState SetAlarmState Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetAlarmState' {Text
stateReason :: Text
$sel:stateReason:SetAlarmState' :: SetAlarmState -> Text
stateReason} -> Text
stateReason) (\s :: SetAlarmState
s@SetAlarmState' {} Text
a -> SetAlarmState
s {$sel:stateReason:SetAlarmState' :: Text
stateReason = Text
a} :: SetAlarmState)
instance Core.AWSRequest SetAlarmState where
type
AWSResponse SetAlarmState =
SetAlarmStateResponse
request :: SetAlarmState -> Request SetAlarmState
request = Service -> SetAlarmState -> Request SetAlarmState
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy SetAlarmState
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse SetAlarmState)))
response =
AWSResponse SetAlarmState
-> Logger
-> Service
-> Proxy SetAlarmState
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse SetAlarmState)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse SetAlarmState
SetAlarmStateResponse
SetAlarmStateResponse'
instance Prelude.Hashable SetAlarmState
instance Prelude.NFData SetAlarmState
instance Core.ToHeaders SetAlarmState where
toHeaders :: SetAlarmState -> [Header]
toHeaders = [Header] -> SetAlarmState -> [Header]
forall a b. a -> b -> a
Prelude.const [Header]
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath SetAlarmState where
toPath :: SetAlarmState -> ByteString
toPath = ByteString -> SetAlarmState -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery SetAlarmState where
toQuery :: SetAlarmState -> QueryString
toQuery SetAlarmState' {Maybe Text
Text
StateValue
stateReason :: Text
stateValue :: StateValue
alarmName :: Text
stateReasonData :: Maybe Text
$sel:stateReason:SetAlarmState' :: SetAlarmState -> Text
$sel:stateValue:SetAlarmState' :: SetAlarmState -> StateValue
$sel:alarmName:SetAlarmState' :: SetAlarmState -> Text
$sel:stateReasonData:SetAlarmState' :: SetAlarmState -> Maybe Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"SetAlarmState" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-08-01" :: Prelude.ByteString),
ByteString
"StateReasonData" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
stateReasonData,
ByteString
"AlarmName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
alarmName,
ByteString
"StateValue" ByteString -> StateValue -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: StateValue
stateValue,
ByteString
"StateReason" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
stateReason
]
data SetAlarmStateResponse = SetAlarmStateResponse'
{
}
deriving (SetAlarmStateResponse -> SetAlarmStateResponse -> Bool
(SetAlarmStateResponse -> SetAlarmStateResponse -> Bool)
-> (SetAlarmStateResponse -> SetAlarmStateResponse -> Bool)
-> Eq SetAlarmStateResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SetAlarmStateResponse -> SetAlarmStateResponse -> Bool
$c/= :: SetAlarmStateResponse -> SetAlarmStateResponse -> Bool
== :: SetAlarmStateResponse -> SetAlarmStateResponse -> Bool
$c== :: SetAlarmStateResponse -> SetAlarmStateResponse -> Bool
Prelude.Eq, ReadPrec [SetAlarmStateResponse]
ReadPrec SetAlarmStateResponse
Int -> ReadS SetAlarmStateResponse
ReadS [SetAlarmStateResponse]
(Int -> ReadS SetAlarmStateResponse)
-> ReadS [SetAlarmStateResponse]
-> ReadPrec SetAlarmStateResponse
-> ReadPrec [SetAlarmStateResponse]
-> Read SetAlarmStateResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SetAlarmStateResponse]
$creadListPrec :: ReadPrec [SetAlarmStateResponse]
readPrec :: ReadPrec SetAlarmStateResponse
$creadPrec :: ReadPrec SetAlarmStateResponse
readList :: ReadS [SetAlarmStateResponse]
$creadList :: ReadS [SetAlarmStateResponse]
readsPrec :: Int -> ReadS SetAlarmStateResponse
$creadsPrec :: Int -> ReadS SetAlarmStateResponse
Prelude.Read, Int -> SetAlarmStateResponse -> ShowS
[SetAlarmStateResponse] -> ShowS
SetAlarmStateResponse -> String
(Int -> SetAlarmStateResponse -> ShowS)
-> (SetAlarmStateResponse -> String)
-> ([SetAlarmStateResponse] -> ShowS)
-> Show SetAlarmStateResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SetAlarmStateResponse] -> ShowS
$cshowList :: [SetAlarmStateResponse] -> ShowS
show :: SetAlarmStateResponse -> String
$cshow :: SetAlarmStateResponse -> String
showsPrec :: Int -> SetAlarmStateResponse -> ShowS
$cshowsPrec :: Int -> SetAlarmStateResponse -> ShowS
Prelude.Show, (forall x. SetAlarmStateResponse -> Rep SetAlarmStateResponse x)
-> (forall x. Rep SetAlarmStateResponse x -> SetAlarmStateResponse)
-> Generic SetAlarmStateResponse
forall x. Rep SetAlarmStateResponse x -> SetAlarmStateResponse
forall x. SetAlarmStateResponse -> Rep SetAlarmStateResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SetAlarmStateResponse x -> SetAlarmStateResponse
$cfrom :: forall x. SetAlarmStateResponse -> Rep SetAlarmStateResponse x
Prelude.Generic)
newSetAlarmStateResponse ::
SetAlarmStateResponse
newSetAlarmStateResponse :: SetAlarmStateResponse
newSetAlarmStateResponse = SetAlarmStateResponse
SetAlarmStateResponse'
instance Prelude.NFData SetAlarmStateResponse