{-# 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.StopAutomationExecution
(
StopAutomationExecution (..),
newStopAutomationExecution,
stopAutomationExecution_type,
stopAutomationExecution_automationExecutionId,
StopAutomationExecutionResponse (..),
newStopAutomationExecutionResponse,
stopAutomationExecutionResponse_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 StopAutomationExecution = StopAutomationExecution'
{
StopAutomationExecution -> Maybe StopType
type' :: Prelude.Maybe StopType,
StopAutomationExecution -> Text
automationExecutionId :: Prelude.Text
}
deriving (StopAutomationExecution -> StopAutomationExecution -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StopAutomationExecution -> StopAutomationExecution -> Bool
$c/= :: StopAutomationExecution -> StopAutomationExecution -> Bool
== :: StopAutomationExecution -> StopAutomationExecution -> Bool
$c== :: StopAutomationExecution -> StopAutomationExecution -> Bool
Prelude.Eq, ReadPrec [StopAutomationExecution]
ReadPrec StopAutomationExecution
Int -> ReadS StopAutomationExecution
ReadS [StopAutomationExecution]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StopAutomationExecution]
$creadListPrec :: ReadPrec [StopAutomationExecution]
readPrec :: ReadPrec StopAutomationExecution
$creadPrec :: ReadPrec StopAutomationExecution
readList :: ReadS [StopAutomationExecution]
$creadList :: ReadS [StopAutomationExecution]
readsPrec :: Int -> ReadS StopAutomationExecution
$creadsPrec :: Int -> ReadS StopAutomationExecution
Prelude.Read, Int -> StopAutomationExecution -> ShowS
[StopAutomationExecution] -> ShowS
StopAutomationExecution -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StopAutomationExecution] -> ShowS
$cshowList :: [StopAutomationExecution] -> ShowS
show :: StopAutomationExecution -> String
$cshow :: StopAutomationExecution -> String
showsPrec :: Int -> StopAutomationExecution -> ShowS
$cshowsPrec :: Int -> StopAutomationExecution -> ShowS
Prelude.Show, forall x. Rep StopAutomationExecution x -> StopAutomationExecution
forall x. StopAutomationExecution -> Rep StopAutomationExecution x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StopAutomationExecution x -> StopAutomationExecution
$cfrom :: forall x. StopAutomationExecution -> Rep StopAutomationExecution x
Prelude.Generic)
newStopAutomationExecution ::
Prelude.Text ->
StopAutomationExecution
newStopAutomationExecution :: Text -> StopAutomationExecution
newStopAutomationExecution Text
pAutomationExecutionId_ =
StopAutomationExecution'
{ $sel:type':StopAutomationExecution' :: Maybe StopType
type' = forall a. Maybe a
Prelude.Nothing,
$sel:automationExecutionId:StopAutomationExecution' :: Text
automationExecutionId = Text
pAutomationExecutionId_
}
stopAutomationExecution_type :: Lens.Lens' StopAutomationExecution (Prelude.Maybe StopType)
stopAutomationExecution_type :: Lens' StopAutomationExecution (Maybe StopType)
stopAutomationExecution_type = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopAutomationExecution' {Maybe StopType
type' :: Maybe StopType
$sel:type':StopAutomationExecution' :: StopAutomationExecution -> Maybe StopType
type'} -> Maybe StopType
type') (\s :: StopAutomationExecution
s@StopAutomationExecution' {} Maybe StopType
a -> StopAutomationExecution
s {$sel:type':StopAutomationExecution' :: Maybe StopType
type' = Maybe StopType
a} :: StopAutomationExecution)
stopAutomationExecution_automationExecutionId :: Lens.Lens' StopAutomationExecution Prelude.Text
stopAutomationExecution_automationExecutionId :: Lens' StopAutomationExecution Text
stopAutomationExecution_automationExecutionId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopAutomationExecution' {Text
automationExecutionId :: Text
$sel:automationExecutionId:StopAutomationExecution' :: StopAutomationExecution -> Text
automationExecutionId} -> Text
automationExecutionId) (\s :: StopAutomationExecution
s@StopAutomationExecution' {} Text
a -> StopAutomationExecution
s {$sel:automationExecutionId:StopAutomationExecution' :: Text
automationExecutionId = Text
a} :: StopAutomationExecution)
instance Core.AWSRequest StopAutomationExecution where
type
AWSResponse StopAutomationExecution =
StopAutomationExecutionResponse
request :: (Service -> Service)
-> StopAutomationExecution -> Request StopAutomationExecution
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 StopAutomationExecution
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse StopAutomationExecution)))
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 -> StopAutomationExecutionResponse
StopAutomationExecutionResponse'
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 StopAutomationExecution where
hashWithSalt :: Int -> StopAutomationExecution -> Int
hashWithSalt Int
_salt StopAutomationExecution' {Maybe StopType
Text
automationExecutionId :: Text
type' :: Maybe StopType
$sel:automationExecutionId:StopAutomationExecution' :: StopAutomationExecution -> Text
$sel:type':StopAutomationExecution' :: StopAutomationExecution -> Maybe StopType
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe StopType
type'
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
automationExecutionId
instance Prelude.NFData StopAutomationExecution where
rnf :: StopAutomationExecution -> ()
rnf StopAutomationExecution' {Maybe StopType
Text
automationExecutionId :: Text
type' :: Maybe StopType
$sel:automationExecutionId:StopAutomationExecution' :: StopAutomationExecution -> Text
$sel:type':StopAutomationExecution' :: StopAutomationExecution -> Maybe StopType
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe StopType
type'
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
automationExecutionId
instance Data.ToHeaders StopAutomationExecution where
toHeaders :: StopAutomationExecution -> 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.StopAutomationExecution" ::
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 StopAutomationExecution where
toJSON :: StopAutomationExecution -> Value
toJSON StopAutomationExecution' {Maybe StopType
Text
automationExecutionId :: Text
type' :: Maybe StopType
$sel:automationExecutionId:StopAutomationExecution' :: StopAutomationExecution -> Text
$sel:type':StopAutomationExecution' :: StopAutomationExecution -> Maybe StopType
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"Type" 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 StopType
type',
forall a. a -> Maybe a
Prelude.Just
( Key
"AutomationExecutionId"
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
automationExecutionId
)
]
)
instance Data.ToPath StopAutomationExecution where
toPath :: StopAutomationExecution -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery StopAutomationExecution where
toQuery :: StopAutomationExecution -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data StopAutomationExecutionResponse = StopAutomationExecutionResponse'
{
StopAutomationExecutionResponse -> Int
httpStatus :: Prelude.Int
}
deriving (StopAutomationExecutionResponse
-> StopAutomationExecutionResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StopAutomationExecutionResponse
-> StopAutomationExecutionResponse -> Bool
$c/= :: StopAutomationExecutionResponse
-> StopAutomationExecutionResponse -> Bool
== :: StopAutomationExecutionResponse
-> StopAutomationExecutionResponse -> Bool
$c== :: StopAutomationExecutionResponse
-> StopAutomationExecutionResponse -> Bool
Prelude.Eq, ReadPrec [StopAutomationExecutionResponse]
ReadPrec StopAutomationExecutionResponse
Int -> ReadS StopAutomationExecutionResponse
ReadS [StopAutomationExecutionResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StopAutomationExecutionResponse]
$creadListPrec :: ReadPrec [StopAutomationExecutionResponse]
readPrec :: ReadPrec StopAutomationExecutionResponse
$creadPrec :: ReadPrec StopAutomationExecutionResponse
readList :: ReadS [StopAutomationExecutionResponse]
$creadList :: ReadS [StopAutomationExecutionResponse]
readsPrec :: Int -> ReadS StopAutomationExecutionResponse
$creadsPrec :: Int -> ReadS StopAutomationExecutionResponse
Prelude.Read, Int -> StopAutomationExecutionResponse -> ShowS
[StopAutomationExecutionResponse] -> ShowS
StopAutomationExecutionResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StopAutomationExecutionResponse] -> ShowS
$cshowList :: [StopAutomationExecutionResponse] -> ShowS
show :: StopAutomationExecutionResponse -> String
$cshow :: StopAutomationExecutionResponse -> String
showsPrec :: Int -> StopAutomationExecutionResponse -> ShowS
$cshowsPrec :: Int -> StopAutomationExecutionResponse -> ShowS
Prelude.Show, forall x.
Rep StopAutomationExecutionResponse x
-> StopAutomationExecutionResponse
forall x.
StopAutomationExecutionResponse
-> Rep StopAutomationExecutionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StopAutomationExecutionResponse x
-> StopAutomationExecutionResponse
$cfrom :: forall x.
StopAutomationExecutionResponse
-> Rep StopAutomationExecutionResponse x
Prelude.Generic)
newStopAutomationExecutionResponse ::
Prelude.Int ->
StopAutomationExecutionResponse
newStopAutomationExecutionResponse :: Int -> StopAutomationExecutionResponse
newStopAutomationExecutionResponse Int
pHttpStatus_ =
StopAutomationExecutionResponse'
{ $sel:httpStatus:StopAutomationExecutionResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
stopAutomationExecutionResponse_httpStatus :: Lens.Lens' StopAutomationExecutionResponse Prelude.Int
stopAutomationExecutionResponse_httpStatus :: Lens' StopAutomationExecutionResponse Int
stopAutomationExecutionResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopAutomationExecutionResponse' {Int
httpStatus :: Int
$sel:httpStatus:StopAutomationExecutionResponse' :: StopAutomationExecutionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: StopAutomationExecutionResponse
s@StopAutomationExecutionResponse' {} Int
a -> StopAutomationExecutionResponse
s {$sel:httpStatus:StopAutomationExecutionResponse' :: Int
httpStatus = Int
a} :: StopAutomationExecutionResponse)
instance
Prelude.NFData
StopAutomationExecutionResponse
where
rnf :: StopAutomationExecutionResponse -> ()
rnf StopAutomationExecutionResponse' {Int
httpStatus :: Int
$sel:httpStatus:StopAutomationExecutionResponse' :: StopAutomationExecutionResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus