{-# 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.SSM.SendAutomationSignal
(
SendAutomationSignal (..),
newSendAutomationSignal,
sendAutomationSignal_payload,
sendAutomationSignal_automationExecutionId,
sendAutomationSignal_signalType,
SendAutomationSignalResponse (..),
newSendAutomationSignalResponse,
sendAutomationSignalResponse_httpStatus,
)
where
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
import Amazonka.SSM.Types
data SendAutomationSignal = SendAutomationSignal'
{
SendAutomationSignal -> Maybe (HashMap Text [Text])
payload :: Prelude.Maybe (Prelude.HashMap Prelude.Text [Prelude.Text]),
SendAutomationSignal -> Text
automationExecutionId :: Prelude.Text,
SendAutomationSignal -> SignalType
signalType :: SignalType
}
deriving (SendAutomationSignal -> SendAutomationSignal -> Bool
(SendAutomationSignal -> SendAutomationSignal -> Bool)
-> (SendAutomationSignal -> SendAutomationSignal -> Bool)
-> Eq SendAutomationSignal
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SendAutomationSignal -> SendAutomationSignal -> Bool
$c/= :: SendAutomationSignal -> SendAutomationSignal -> Bool
== :: SendAutomationSignal -> SendAutomationSignal -> Bool
$c== :: SendAutomationSignal -> SendAutomationSignal -> Bool
Prelude.Eq, ReadPrec [SendAutomationSignal]
ReadPrec SendAutomationSignal
Int -> ReadS SendAutomationSignal
ReadS [SendAutomationSignal]
(Int -> ReadS SendAutomationSignal)
-> ReadS [SendAutomationSignal]
-> ReadPrec SendAutomationSignal
-> ReadPrec [SendAutomationSignal]
-> Read SendAutomationSignal
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SendAutomationSignal]
$creadListPrec :: ReadPrec [SendAutomationSignal]
readPrec :: ReadPrec SendAutomationSignal
$creadPrec :: ReadPrec SendAutomationSignal
readList :: ReadS [SendAutomationSignal]
$creadList :: ReadS [SendAutomationSignal]
readsPrec :: Int -> ReadS SendAutomationSignal
$creadsPrec :: Int -> ReadS SendAutomationSignal
Prelude.Read, Int -> SendAutomationSignal -> ShowS
[SendAutomationSignal] -> ShowS
SendAutomationSignal -> String
(Int -> SendAutomationSignal -> ShowS)
-> (SendAutomationSignal -> String)
-> ([SendAutomationSignal] -> ShowS)
-> Show SendAutomationSignal
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SendAutomationSignal] -> ShowS
$cshowList :: [SendAutomationSignal] -> ShowS
show :: SendAutomationSignal -> String
$cshow :: SendAutomationSignal -> String
showsPrec :: Int -> SendAutomationSignal -> ShowS
$cshowsPrec :: Int -> SendAutomationSignal -> ShowS
Prelude.Show, (forall x. SendAutomationSignal -> Rep SendAutomationSignal x)
-> (forall x. Rep SendAutomationSignal x -> SendAutomationSignal)
-> Generic SendAutomationSignal
forall x. Rep SendAutomationSignal x -> SendAutomationSignal
forall x. SendAutomationSignal -> Rep SendAutomationSignal x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SendAutomationSignal x -> SendAutomationSignal
$cfrom :: forall x. SendAutomationSignal -> Rep SendAutomationSignal x
Prelude.Generic)
newSendAutomationSignal ::
Prelude.Text ->
SignalType ->
SendAutomationSignal
newSendAutomationSignal :: Text -> SignalType -> SendAutomationSignal
newSendAutomationSignal
Text
pAutomationExecutionId_
SignalType
pSignalType_ =
SendAutomationSignal' :: Maybe (HashMap Text [Text])
-> Text -> SignalType -> SendAutomationSignal
SendAutomationSignal'
{ $sel:payload:SendAutomationSignal' :: Maybe (HashMap Text [Text])
payload = Maybe (HashMap Text [Text])
forall a. Maybe a
Prelude.Nothing,
$sel:automationExecutionId:SendAutomationSignal' :: Text
automationExecutionId = Text
pAutomationExecutionId_,
$sel:signalType:SendAutomationSignal' :: SignalType
signalType = SignalType
pSignalType_
}
sendAutomationSignal_payload :: Lens.Lens' SendAutomationSignal (Prelude.Maybe (Prelude.HashMap Prelude.Text [Prelude.Text]))
sendAutomationSignal_payload :: (Maybe (HashMap Text [Text]) -> f (Maybe (HashMap Text [Text])))
-> SendAutomationSignal -> f SendAutomationSignal
sendAutomationSignal_payload = (SendAutomationSignal -> Maybe (HashMap Text [Text]))
-> (SendAutomationSignal
-> Maybe (HashMap Text [Text]) -> SendAutomationSignal)
-> Lens
SendAutomationSignal
SendAutomationSignal
(Maybe (HashMap Text [Text]))
(Maybe (HashMap Text [Text]))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendAutomationSignal' {Maybe (HashMap Text [Text])
payload :: Maybe (HashMap Text [Text])
$sel:payload:SendAutomationSignal' :: SendAutomationSignal -> Maybe (HashMap Text [Text])
payload} -> Maybe (HashMap Text [Text])
payload) (\s :: SendAutomationSignal
s@SendAutomationSignal' {} Maybe (HashMap Text [Text])
a -> SendAutomationSignal
s {$sel:payload:SendAutomationSignal' :: Maybe (HashMap Text [Text])
payload = Maybe (HashMap Text [Text])
a} :: SendAutomationSignal) ((Maybe (HashMap Text [Text]) -> f (Maybe (HashMap Text [Text])))
-> SendAutomationSignal -> f SendAutomationSignal)
-> ((Maybe (HashMap Text [Text])
-> f (Maybe (HashMap Text [Text])))
-> Maybe (HashMap Text [Text]) -> f (Maybe (HashMap Text [Text])))
-> (Maybe (HashMap Text [Text]) -> f (Maybe (HashMap Text [Text])))
-> SendAutomationSignal
-> f SendAutomationSignal
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text [Text])
(HashMap Text [Text])
(HashMap Text [Text])
(HashMap Text [Text])
-> Iso
(Maybe (HashMap Text [Text]))
(Maybe (HashMap Text [Text]))
(Maybe (HashMap Text [Text]))
(Maybe (HashMap Text [Text]))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
(HashMap Text [Text])
(HashMap Text [Text])
(HashMap Text [Text])
(HashMap Text [Text])
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
sendAutomationSignal_automationExecutionId :: Lens.Lens' SendAutomationSignal Prelude.Text
sendAutomationSignal_automationExecutionId :: (Text -> f Text) -> SendAutomationSignal -> f SendAutomationSignal
sendAutomationSignal_automationExecutionId = (SendAutomationSignal -> Text)
-> (SendAutomationSignal -> Text -> SendAutomationSignal)
-> Lens SendAutomationSignal SendAutomationSignal Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendAutomationSignal' {Text
automationExecutionId :: Text
$sel:automationExecutionId:SendAutomationSignal' :: SendAutomationSignal -> Text
automationExecutionId} -> Text
automationExecutionId) (\s :: SendAutomationSignal
s@SendAutomationSignal' {} Text
a -> SendAutomationSignal
s {$sel:automationExecutionId:SendAutomationSignal' :: Text
automationExecutionId = Text
a} :: SendAutomationSignal)
sendAutomationSignal_signalType :: Lens.Lens' SendAutomationSignal SignalType
sendAutomationSignal_signalType :: (SignalType -> f SignalType)
-> SendAutomationSignal -> f SendAutomationSignal
sendAutomationSignal_signalType = (SendAutomationSignal -> SignalType)
-> (SendAutomationSignal -> SignalType -> SendAutomationSignal)
-> Lens
SendAutomationSignal SendAutomationSignal SignalType SignalType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendAutomationSignal' {SignalType
signalType :: SignalType
$sel:signalType:SendAutomationSignal' :: SendAutomationSignal -> SignalType
signalType} -> SignalType
signalType) (\s :: SendAutomationSignal
s@SendAutomationSignal' {} SignalType
a -> SendAutomationSignal
s {$sel:signalType:SendAutomationSignal' :: SignalType
signalType = SignalType
a} :: SendAutomationSignal)
instance Core.AWSRequest SendAutomationSignal where
type
AWSResponse SendAutomationSignal =
SendAutomationSignalResponse
request :: SendAutomationSignal -> Request SendAutomationSignal
request = Service -> SendAutomationSignal -> Request SendAutomationSignal
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy SendAutomationSignal
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse SendAutomationSignal)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse SendAutomationSignal))
-> Logger
-> Service
-> Proxy SendAutomationSignal
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse SendAutomationSignal)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> SendAutomationSignalResponse
SendAutomationSignalResponse'
(Int -> SendAutomationSignalResponse)
-> Either String Int -> Either String SendAutomationSignalResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable SendAutomationSignal
instance Prelude.NFData SendAutomationSignal
instance Core.ToHeaders SendAutomationSignal where
toHeaders :: SendAutomationSignal -> ResponseHeaders
toHeaders =
ResponseHeaders -> SendAutomationSignal -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AmazonSSM.SendAutomationSignal" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON SendAutomationSignal where
toJSON :: SendAutomationSignal -> Value
toJSON SendAutomationSignal' {Maybe (HashMap Text [Text])
Text
SignalType
signalType :: SignalType
automationExecutionId :: Text
payload :: Maybe (HashMap Text [Text])
$sel:signalType:SendAutomationSignal' :: SendAutomationSignal -> SignalType
$sel:automationExecutionId:SendAutomationSignal' :: SendAutomationSignal -> Text
$sel:payload:SendAutomationSignal' :: SendAutomationSignal -> Maybe (HashMap Text [Text])
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"Payload" Text -> HashMap Text [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text [Text] -> Pair)
-> Maybe (HashMap Text [Text]) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text [Text])
payload,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"AutomationExecutionId"
Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
automationExecutionId
),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"SignalType" Text -> SignalType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= SignalType
signalType)
]
)
instance Core.ToPath SendAutomationSignal where
toPath :: SendAutomationSignal -> ByteString
toPath = ByteString -> SendAutomationSignal -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery SendAutomationSignal where
toQuery :: SendAutomationSignal -> QueryString
toQuery = QueryString -> SendAutomationSignal -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data SendAutomationSignalResponse = SendAutomationSignalResponse'
{
SendAutomationSignalResponse -> Int
httpStatus :: Prelude.Int
}
deriving (SendAutomationSignalResponse
-> SendAutomationSignalResponse -> Bool
(SendAutomationSignalResponse
-> SendAutomationSignalResponse -> Bool)
-> (SendAutomationSignalResponse
-> SendAutomationSignalResponse -> Bool)
-> Eq SendAutomationSignalResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SendAutomationSignalResponse
-> SendAutomationSignalResponse -> Bool
$c/= :: SendAutomationSignalResponse
-> SendAutomationSignalResponse -> Bool
== :: SendAutomationSignalResponse
-> SendAutomationSignalResponse -> Bool
$c== :: SendAutomationSignalResponse
-> SendAutomationSignalResponse -> Bool
Prelude.Eq, ReadPrec [SendAutomationSignalResponse]
ReadPrec SendAutomationSignalResponse
Int -> ReadS SendAutomationSignalResponse
ReadS [SendAutomationSignalResponse]
(Int -> ReadS SendAutomationSignalResponse)
-> ReadS [SendAutomationSignalResponse]
-> ReadPrec SendAutomationSignalResponse
-> ReadPrec [SendAutomationSignalResponse]
-> Read SendAutomationSignalResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SendAutomationSignalResponse]
$creadListPrec :: ReadPrec [SendAutomationSignalResponse]
readPrec :: ReadPrec SendAutomationSignalResponse
$creadPrec :: ReadPrec SendAutomationSignalResponse
readList :: ReadS [SendAutomationSignalResponse]
$creadList :: ReadS [SendAutomationSignalResponse]
readsPrec :: Int -> ReadS SendAutomationSignalResponse
$creadsPrec :: Int -> ReadS SendAutomationSignalResponse
Prelude.Read, Int -> SendAutomationSignalResponse -> ShowS
[SendAutomationSignalResponse] -> ShowS
SendAutomationSignalResponse -> String
(Int -> SendAutomationSignalResponse -> ShowS)
-> (SendAutomationSignalResponse -> String)
-> ([SendAutomationSignalResponse] -> ShowS)
-> Show SendAutomationSignalResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SendAutomationSignalResponse] -> ShowS
$cshowList :: [SendAutomationSignalResponse] -> ShowS
show :: SendAutomationSignalResponse -> String
$cshow :: SendAutomationSignalResponse -> String
showsPrec :: Int -> SendAutomationSignalResponse -> ShowS
$cshowsPrec :: Int -> SendAutomationSignalResponse -> ShowS
Prelude.Show, (forall x.
SendAutomationSignalResponse -> Rep SendAutomationSignalResponse x)
-> (forall x.
Rep SendAutomationSignalResponse x -> SendAutomationSignalResponse)
-> Generic SendAutomationSignalResponse
forall x.
Rep SendAutomationSignalResponse x -> SendAutomationSignalResponse
forall x.
SendAutomationSignalResponse -> Rep SendAutomationSignalResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SendAutomationSignalResponse x -> SendAutomationSignalResponse
$cfrom :: forall x.
SendAutomationSignalResponse -> Rep SendAutomationSignalResponse x
Prelude.Generic)
newSendAutomationSignalResponse ::
Prelude.Int ->
SendAutomationSignalResponse
newSendAutomationSignalResponse :: Int -> SendAutomationSignalResponse
newSendAutomationSignalResponse Int
pHttpStatus_ =
SendAutomationSignalResponse' :: Int -> SendAutomationSignalResponse
SendAutomationSignalResponse'
{ $sel:httpStatus:SendAutomationSignalResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
sendAutomationSignalResponse_httpStatus :: Lens.Lens' SendAutomationSignalResponse Prelude.Int
sendAutomationSignalResponse_httpStatus :: (Int -> f Int)
-> SendAutomationSignalResponse -> f SendAutomationSignalResponse
sendAutomationSignalResponse_httpStatus = (SendAutomationSignalResponse -> Int)
-> (SendAutomationSignalResponse
-> Int -> SendAutomationSignalResponse)
-> Lens
SendAutomationSignalResponse SendAutomationSignalResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendAutomationSignalResponse' {Int
httpStatus :: Int
$sel:httpStatus:SendAutomationSignalResponse' :: SendAutomationSignalResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: SendAutomationSignalResponse
s@SendAutomationSignalResponse' {} Int
a -> SendAutomationSignalResponse
s {$sel:httpStatus:SendAutomationSignalResponse' :: Int
httpStatus = Int
a} :: SendAutomationSignalResponse)
instance Prelude.NFData SendAutomationSignalResponse