{-# 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.GetAutomationExecution
(
GetAutomationExecution (..),
newGetAutomationExecution,
getAutomationExecution_automationExecutionId,
GetAutomationExecutionResponse (..),
newGetAutomationExecutionResponse,
getAutomationExecutionResponse_automationExecution,
getAutomationExecutionResponse_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 GetAutomationExecution = GetAutomationExecution'
{
GetAutomationExecution -> Text
automationExecutionId :: Prelude.Text
}
deriving (GetAutomationExecution -> GetAutomationExecution -> Bool
(GetAutomationExecution -> GetAutomationExecution -> Bool)
-> (GetAutomationExecution -> GetAutomationExecution -> Bool)
-> Eq GetAutomationExecution
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetAutomationExecution -> GetAutomationExecution -> Bool
$c/= :: GetAutomationExecution -> GetAutomationExecution -> Bool
== :: GetAutomationExecution -> GetAutomationExecution -> Bool
$c== :: GetAutomationExecution -> GetAutomationExecution -> Bool
Prelude.Eq, ReadPrec [GetAutomationExecution]
ReadPrec GetAutomationExecution
Int -> ReadS GetAutomationExecution
ReadS [GetAutomationExecution]
(Int -> ReadS GetAutomationExecution)
-> ReadS [GetAutomationExecution]
-> ReadPrec GetAutomationExecution
-> ReadPrec [GetAutomationExecution]
-> Read GetAutomationExecution
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetAutomationExecution]
$creadListPrec :: ReadPrec [GetAutomationExecution]
readPrec :: ReadPrec GetAutomationExecution
$creadPrec :: ReadPrec GetAutomationExecution
readList :: ReadS [GetAutomationExecution]
$creadList :: ReadS [GetAutomationExecution]
readsPrec :: Int -> ReadS GetAutomationExecution
$creadsPrec :: Int -> ReadS GetAutomationExecution
Prelude.Read, Int -> GetAutomationExecution -> ShowS
[GetAutomationExecution] -> ShowS
GetAutomationExecution -> String
(Int -> GetAutomationExecution -> ShowS)
-> (GetAutomationExecution -> String)
-> ([GetAutomationExecution] -> ShowS)
-> Show GetAutomationExecution
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetAutomationExecution] -> ShowS
$cshowList :: [GetAutomationExecution] -> ShowS
show :: GetAutomationExecution -> String
$cshow :: GetAutomationExecution -> String
showsPrec :: Int -> GetAutomationExecution -> ShowS
$cshowsPrec :: Int -> GetAutomationExecution -> ShowS
Prelude.Show, (forall x. GetAutomationExecution -> Rep GetAutomationExecution x)
-> (forall x.
Rep GetAutomationExecution x -> GetAutomationExecution)
-> Generic GetAutomationExecution
forall x. Rep GetAutomationExecution x -> GetAutomationExecution
forall x. GetAutomationExecution -> Rep GetAutomationExecution x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetAutomationExecution x -> GetAutomationExecution
$cfrom :: forall x. GetAutomationExecution -> Rep GetAutomationExecution x
Prelude.Generic)
newGetAutomationExecution ::
Prelude.Text ->
GetAutomationExecution
newGetAutomationExecution :: Text -> GetAutomationExecution
newGetAutomationExecution Text
pAutomationExecutionId_ =
GetAutomationExecution' :: Text -> GetAutomationExecution
GetAutomationExecution'
{ $sel:automationExecutionId:GetAutomationExecution' :: Text
automationExecutionId =
Text
pAutomationExecutionId_
}
getAutomationExecution_automationExecutionId :: Lens.Lens' GetAutomationExecution Prelude.Text
getAutomationExecution_automationExecutionId :: (Text -> f Text)
-> GetAutomationExecution -> f GetAutomationExecution
getAutomationExecution_automationExecutionId = (GetAutomationExecution -> Text)
-> (GetAutomationExecution -> Text -> GetAutomationExecution)
-> Lens GetAutomationExecution GetAutomationExecution Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAutomationExecution' {Text
automationExecutionId :: Text
$sel:automationExecutionId:GetAutomationExecution' :: GetAutomationExecution -> Text
automationExecutionId} -> Text
automationExecutionId) (\s :: GetAutomationExecution
s@GetAutomationExecution' {} Text
a -> GetAutomationExecution
s {$sel:automationExecutionId:GetAutomationExecution' :: Text
automationExecutionId = Text
a} :: GetAutomationExecution)
instance Core.AWSRequest GetAutomationExecution where
type
AWSResponse GetAutomationExecution =
GetAutomationExecutionResponse
request :: GetAutomationExecution -> Request GetAutomationExecution
request = Service -> GetAutomationExecution -> Request GetAutomationExecution
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy GetAutomationExecution
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetAutomationExecution)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetAutomationExecution))
-> Logger
-> Service
-> Proxy GetAutomationExecution
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetAutomationExecution)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe AutomationExecution -> Int -> GetAutomationExecutionResponse
GetAutomationExecutionResponse'
(Maybe AutomationExecution
-> Int -> GetAutomationExecutionResponse)
-> Either String (Maybe AutomationExecution)
-> Either String (Int -> GetAutomationExecutionResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe AutomationExecution)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"AutomationExecution")
Either String (Int -> GetAutomationExecutionResponse)
-> Either String Int
-> Either String GetAutomationExecutionResponse
forall (f :: * -> *) a b. Applicative f => 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 GetAutomationExecution
instance Prelude.NFData GetAutomationExecution
instance Core.ToHeaders GetAutomationExecution where
toHeaders :: GetAutomationExecution -> ResponseHeaders
toHeaders =
ResponseHeaders -> GetAutomationExecution -> 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.GetAutomationExecution" ::
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 GetAutomationExecution where
toJSON :: GetAutomationExecution -> Value
toJSON GetAutomationExecution' {Text
automationExecutionId :: Text
$sel:automationExecutionId:GetAutomationExecution' :: GetAutomationExecution -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ 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
)
]
)
instance Core.ToPath GetAutomationExecution where
toPath :: GetAutomationExecution -> ByteString
toPath = ByteString -> GetAutomationExecution -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery GetAutomationExecution where
toQuery :: GetAutomationExecution -> QueryString
toQuery = QueryString -> GetAutomationExecution -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data GetAutomationExecutionResponse = GetAutomationExecutionResponse'
{
GetAutomationExecutionResponse -> Maybe AutomationExecution
automationExecution :: Prelude.Maybe AutomationExecution,
GetAutomationExecutionResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetAutomationExecutionResponse
-> GetAutomationExecutionResponse -> Bool
(GetAutomationExecutionResponse
-> GetAutomationExecutionResponse -> Bool)
-> (GetAutomationExecutionResponse
-> GetAutomationExecutionResponse -> Bool)
-> Eq GetAutomationExecutionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetAutomationExecutionResponse
-> GetAutomationExecutionResponse -> Bool
$c/= :: GetAutomationExecutionResponse
-> GetAutomationExecutionResponse -> Bool
== :: GetAutomationExecutionResponse
-> GetAutomationExecutionResponse -> Bool
$c== :: GetAutomationExecutionResponse
-> GetAutomationExecutionResponse -> Bool
Prelude.Eq, ReadPrec [GetAutomationExecutionResponse]
ReadPrec GetAutomationExecutionResponse
Int -> ReadS GetAutomationExecutionResponse
ReadS [GetAutomationExecutionResponse]
(Int -> ReadS GetAutomationExecutionResponse)
-> ReadS [GetAutomationExecutionResponse]
-> ReadPrec GetAutomationExecutionResponse
-> ReadPrec [GetAutomationExecutionResponse]
-> Read GetAutomationExecutionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetAutomationExecutionResponse]
$creadListPrec :: ReadPrec [GetAutomationExecutionResponse]
readPrec :: ReadPrec GetAutomationExecutionResponse
$creadPrec :: ReadPrec GetAutomationExecutionResponse
readList :: ReadS [GetAutomationExecutionResponse]
$creadList :: ReadS [GetAutomationExecutionResponse]
readsPrec :: Int -> ReadS GetAutomationExecutionResponse
$creadsPrec :: Int -> ReadS GetAutomationExecutionResponse
Prelude.Read, Int -> GetAutomationExecutionResponse -> ShowS
[GetAutomationExecutionResponse] -> ShowS
GetAutomationExecutionResponse -> String
(Int -> GetAutomationExecutionResponse -> ShowS)
-> (GetAutomationExecutionResponse -> String)
-> ([GetAutomationExecutionResponse] -> ShowS)
-> Show GetAutomationExecutionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetAutomationExecutionResponse] -> ShowS
$cshowList :: [GetAutomationExecutionResponse] -> ShowS
show :: GetAutomationExecutionResponse -> String
$cshow :: GetAutomationExecutionResponse -> String
showsPrec :: Int -> GetAutomationExecutionResponse -> ShowS
$cshowsPrec :: Int -> GetAutomationExecutionResponse -> ShowS
Prelude.Show, (forall x.
GetAutomationExecutionResponse
-> Rep GetAutomationExecutionResponse x)
-> (forall x.
Rep GetAutomationExecutionResponse x
-> GetAutomationExecutionResponse)
-> Generic GetAutomationExecutionResponse
forall x.
Rep GetAutomationExecutionResponse x
-> GetAutomationExecutionResponse
forall x.
GetAutomationExecutionResponse
-> Rep GetAutomationExecutionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetAutomationExecutionResponse x
-> GetAutomationExecutionResponse
$cfrom :: forall x.
GetAutomationExecutionResponse
-> Rep GetAutomationExecutionResponse x
Prelude.Generic)
newGetAutomationExecutionResponse ::
Prelude.Int ->
GetAutomationExecutionResponse
newGetAutomationExecutionResponse :: Int -> GetAutomationExecutionResponse
newGetAutomationExecutionResponse Int
pHttpStatus_ =
GetAutomationExecutionResponse' :: Maybe AutomationExecution -> Int -> GetAutomationExecutionResponse
GetAutomationExecutionResponse'
{ $sel:automationExecution:GetAutomationExecutionResponse' :: Maybe AutomationExecution
automationExecution =
Maybe AutomationExecution
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetAutomationExecutionResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getAutomationExecutionResponse_automationExecution :: Lens.Lens' GetAutomationExecutionResponse (Prelude.Maybe AutomationExecution)
getAutomationExecutionResponse_automationExecution :: (Maybe AutomationExecution -> f (Maybe AutomationExecution))
-> GetAutomationExecutionResponse
-> f GetAutomationExecutionResponse
getAutomationExecutionResponse_automationExecution = (GetAutomationExecutionResponse -> Maybe AutomationExecution)
-> (GetAutomationExecutionResponse
-> Maybe AutomationExecution -> GetAutomationExecutionResponse)
-> Lens
GetAutomationExecutionResponse
GetAutomationExecutionResponse
(Maybe AutomationExecution)
(Maybe AutomationExecution)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAutomationExecutionResponse' {Maybe AutomationExecution
automationExecution :: Maybe AutomationExecution
$sel:automationExecution:GetAutomationExecutionResponse' :: GetAutomationExecutionResponse -> Maybe AutomationExecution
automationExecution} -> Maybe AutomationExecution
automationExecution) (\s :: GetAutomationExecutionResponse
s@GetAutomationExecutionResponse' {} Maybe AutomationExecution
a -> GetAutomationExecutionResponse
s {$sel:automationExecution:GetAutomationExecutionResponse' :: Maybe AutomationExecution
automationExecution = Maybe AutomationExecution
a} :: GetAutomationExecutionResponse)
getAutomationExecutionResponse_httpStatus :: Lens.Lens' GetAutomationExecutionResponse Prelude.Int
getAutomationExecutionResponse_httpStatus :: (Int -> f Int)
-> GetAutomationExecutionResponse
-> f GetAutomationExecutionResponse
getAutomationExecutionResponse_httpStatus = (GetAutomationExecutionResponse -> Int)
-> (GetAutomationExecutionResponse
-> Int -> GetAutomationExecutionResponse)
-> Lens
GetAutomationExecutionResponse
GetAutomationExecutionResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAutomationExecutionResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetAutomationExecutionResponse' :: GetAutomationExecutionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetAutomationExecutionResponse
s@GetAutomationExecutionResponse' {} Int
a -> GetAutomationExecutionResponse
s {$sel:httpStatus:GetAutomationExecutionResponse' :: Int
httpStatus = Int
a} :: GetAutomationExecutionResponse)
instance
Prelude.NFData
GetAutomationExecutionResponse