{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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. 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'
{ $sel:payload:SendAutomationSignal' :: Maybe (HashMap Text [Text])
payload = 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 :: Lens' SendAutomationSignal (Maybe (HashMap Text [Text]))
sendAutomationSignal_payload = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 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 :: Lens' SendAutomationSignal Text
sendAutomationSignal_automationExecutionId = 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 :: Lens' SendAutomationSignal SignalType
sendAutomationSignal_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 :: (Service -> Service)
-> SendAutomationSignal -> Request SendAutomationSignal
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy SendAutomationSignal
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse SendAutomationSignal)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> SendAutomationSignalResponse
SendAutomationSignalResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable SendAutomationSignal where
hashWithSalt :: Int -> SendAutomationSignal -> Int
hashWithSalt Int
_salt 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])
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text [Text])
payload
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
automationExecutionId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` SignalType
signalType
instance Prelude.NFData SendAutomationSignal where
rnf :: SendAutomationSignal -> ()
rnf 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])
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text [Text])
payload
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
automationExecutionId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf SignalType
signalType
instance Data.ToHeaders SendAutomationSignal where
toHeaders :: SendAutomationSignal -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"AmazonSSM.SendAutomationSignal" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.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
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"Payload" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text [Text])
payload,
forall a. a -> Maybe a
Prelude.Just
( Key
"AutomationExecutionId"
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
automationExecutionId
),
forall a. a -> Maybe a
Prelude.Just (Key
"SignalType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= SignalType
signalType)
]
)
instance Data.ToPath SendAutomationSignal where
toPath :: SendAutomationSignal -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery SendAutomationSignal where
toQuery :: SendAutomationSignal -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data SendAutomationSignalResponse = SendAutomationSignalResponse'
{
SendAutomationSignalResponse -> Int
httpStatus :: Prelude.Int
}
deriving (SendAutomationSignalResponse
-> SendAutomationSignalResponse -> Bool
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]
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
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.
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'
{ $sel:httpStatus:SendAutomationSignalResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
sendAutomationSignalResponse_httpStatus :: Lens.Lens' SendAutomationSignalResponse Prelude.Int
sendAutomationSignalResponse_httpStatus :: Lens' SendAutomationSignalResponse Int
sendAutomationSignalResponse_httpStatus = 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 where
rnf :: SendAutomationSignalResponse -> ()
rnf SendAutomationSignalResponse' {Int
httpStatus :: Int
$sel:httpStatus:SendAutomationSignalResponse' :: SendAutomationSignalResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus