{-# 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.StepFunctions.GetActivityTask
(
GetActivityTask (..),
newGetActivityTask,
getActivityTask_workerName,
getActivityTask_activityArn,
GetActivityTaskResponse (..),
newGetActivityTaskResponse,
getActivityTaskResponse_input,
getActivityTaskResponse_taskToken,
getActivityTaskResponse_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.StepFunctions.Types
data GetActivityTask = GetActivityTask'
{
GetActivityTask -> Maybe Text
workerName :: Prelude.Maybe Prelude.Text,
GetActivityTask -> Text
activityArn :: Prelude.Text
}
deriving (GetActivityTask -> GetActivityTask -> Bool
(GetActivityTask -> GetActivityTask -> Bool)
-> (GetActivityTask -> GetActivityTask -> Bool)
-> Eq GetActivityTask
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetActivityTask -> GetActivityTask -> Bool
$c/= :: GetActivityTask -> GetActivityTask -> Bool
== :: GetActivityTask -> GetActivityTask -> Bool
$c== :: GetActivityTask -> GetActivityTask -> Bool
Prelude.Eq, ReadPrec [GetActivityTask]
ReadPrec GetActivityTask
Int -> ReadS GetActivityTask
ReadS [GetActivityTask]
(Int -> ReadS GetActivityTask)
-> ReadS [GetActivityTask]
-> ReadPrec GetActivityTask
-> ReadPrec [GetActivityTask]
-> Read GetActivityTask
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetActivityTask]
$creadListPrec :: ReadPrec [GetActivityTask]
readPrec :: ReadPrec GetActivityTask
$creadPrec :: ReadPrec GetActivityTask
readList :: ReadS [GetActivityTask]
$creadList :: ReadS [GetActivityTask]
readsPrec :: Int -> ReadS GetActivityTask
$creadsPrec :: Int -> ReadS GetActivityTask
Prelude.Read, Int -> GetActivityTask -> ShowS
[GetActivityTask] -> ShowS
GetActivityTask -> String
(Int -> GetActivityTask -> ShowS)
-> (GetActivityTask -> String)
-> ([GetActivityTask] -> ShowS)
-> Show GetActivityTask
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetActivityTask] -> ShowS
$cshowList :: [GetActivityTask] -> ShowS
show :: GetActivityTask -> String
$cshow :: GetActivityTask -> String
showsPrec :: Int -> GetActivityTask -> ShowS
$cshowsPrec :: Int -> GetActivityTask -> ShowS
Prelude.Show, (forall x. GetActivityTask -> Rep GetActivityTask x)
-> (forall x. Rep GetActivityTask x -> GetActivityTask)
-> Generic GetActivityTask
forall x. Rep GetActivityTask x -> GetActivityTask
forall x. GetActivityTask -> Rep GetActivityTask x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetActivityTask x -> GetActivityTask
$cfrom :: forall x. GetActivityTask -> Rep GetActivityTask x
Prelude.Generic)
newGetActivityTask ::
Prelude.Text ->
GetActivityTask
newGetActivityTask :: Text -> GetActivityTask
newGetActivityTask Text
pActivityArn_ =
GetActivityTask' :: Maybe Text -> Text -> GetActivityTask
GetActivityTask'
{ $sel:workerName:GetActivityTask' :: Maybe Text
workerName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:activityArn:GetActivityTask' :: Text
activityArn = Text
pActivityArn_
}
getActivityTask_workerName :: Lens.Lens' GetActivityTask (Prelude.Maybe Prelude.Text)
getActivityTask_workerName :: (Maybe Text -> f (Maybe Text))
-> GetActivityTask -> f GetActivityTask
getActivityTask_workerName = (GetActivityTask -> Maybe Text)
-> (GetActivityTask -> Maybe Text -> GetActivityTask)
-> Lens GetActivityTask GetActivityTask (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetActivityTask' {Maybe Text
workerName :: Maybe Text
$sel:workerName:GetActivityTask' :: GetActivityTask -> Maybe Text
workerName} -> Maybe Text
workerName) (\s :: GetActivityTask
s@GetActivityTask' {} Maybe Text
a -> GetActivityTask
s {$sel:workerName:GetActivityTask' :: Maybe Text
workerName = Maybe Text
a} :: GetActivityTask)
getActivityTask_activityArn :: Lens.Lens' GetActivityTask Prelude.Text
getActivityTask_activityArn :: (Text -> f Text) -> GetActivityTask -> f GetActivityTask
getActivityTask_activityArn = (GetActivityTask -> Text)
-> (GetActivityTask -> Text -> GetActivityTask)
-> Lens GetActivityTask GetActivityTask Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetActivityTask' {Text
activityArn :: Text
$sel:activityArn:GetActivityTask' :: GetActivityTask -> Text
activityArn} -> Text
activityArn) (\s :: GetActivityTask
s@GetActivityTask' {} Text
a -> GetActivityTask
s {$sel:activityArn:GetActivityTask' :: Text
activityArn = Text
a} :: GetActivityTask)
instance Core.AWSRequest GetActivityTask where
type
AWSResponse GetActivityTask =
GetActivityTaskResponse
request :: GetActivityTask -> Request GetActivityTask
request = Service -> GetActivityTask -> Request GetActivityTask
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy GetActivityTask
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetActivityTask)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetActivityTask))
-> Logger
-> Service
-> Proxy GetActivityTask
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetActivityTask)))
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 (Sensitive Text)
-> Maybe Text -> Int -> GetActivityTaskResponse
GetActivityTaskResponse'
(Maybe (Sensitive Text)
-> Maybe Text -> Int -> GetActivityTaskResponse)
-> Either String (Maybe (Sensitive Text))
-> Either String (Maybe Text -> Int -> GetActivityTaskResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Sensitive Text))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"input")
Either String (Maybe Text -> Int -> GetActivityTaskResponse)
-> Either String (Maybe Text)
-> Either String (Int -> GetActivityTaskResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"taskToken")
Either String (Int -> GetActivityTaskResponse)
-> Either String Int -> Either String GetActivityTaskResponse
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 GetActivityTask
instance Prelude.NFData GetActivityTask
instance Core.ToHeaders GetActivityTask where
toHeaders :: GetActivityTask -> ResponseHeaders
toHeaders =
ResponseHeaders -> GetActivityTask -> 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
"AWSStepFunctions.GetActivityTask" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.0" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON GetActivityTask where
toJSON :: GetActivityTask -> Value
toJSON GetActivityTask' {Maybe Text
Text
activityArn :: Text
workerName :: Maybe Text
$sel:activityArn:GetActivityTask' :: GetActivityTask -> Text
$sel:workerName:GetActivityTask' :: GetActivityTask -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"workerName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
workerName,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"activityArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
activityArn)
]
)
instance Core.ToPath GetActivityTask where
toPath :: GetActivityTask -> ByteString
toPath = ByteString -> GetActivityTask -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery GetActivityTask where
toQuery :: GetActivityTask -> QueryString
toQuery = QueryString -> GetActivityTask -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data GetActivityTaskResponse = GetActivityTaskResponse'
{
GetActivityTaskResponse -> Maybe (Sensitive Text)
input :: Prelude.Maybe (Core.Sensitive Prelude.Text),
GetActivityTaskResponse -> Maybe Text
taskToken :: Prelude.Maybe Prelude.Text,
GetActivityTaskResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetActivityTaskResponse -> GetActivityTaskResponse -> Bool
(GetActivityTaskResponse -> GetActivityTaskResponse -> Bool)
-> (GetActivityTaskResponse -> GetActivityTaskResponse -> Bool)
-> Eq GetActivityTaskResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetActivityTaskResponse -> GetActivityTaskResponse -> Bool
$c/= :: GetActivityTaskResponse -> GetActivityTaskResponse -> Bool
== :: GetActivityTaskResponse -> GetActivityTaskResponse -> Bool
$c== :: GetActivityTaskResponse -> GetActivityTaskResponse -> Bool
Prelude.Eq, Int -> GetActivityTaskResponse -> ShowS
[GetActivityTaskResponse] -> ShowS
GetActivityTaskResponse -> String
(Int -> GetActivityTaskResponse -> ShowS)
-> (GetActivityTaskResponse -> String)
-> ([GetActivityTaskResponse] -> ShowS)
-> Show GetActivityTaskResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetActivityTaskResponse] -> ShowS
$cshowList :: [GetActivityTaskResponse] -> ShowS
show :: GetActivityTaskResponse -> String
$cshow :: GetActivityTaskResponse -> String
showsPrec :: Int -> GetActivityTaskResponse -> ShowS
$cshowsPrec :: Int -> GetActivityTaskResponse -> ShowS
Prelude.Show, (forall x.
GetActivityTaskResponse -> Rep GetActivityTaskResponse x)
-> (forall x.
Rep GetActivityTaskResponse x -> GetActivityTaskResponse)
-> Generic GetActivityTaskResponse
forall x. Rep GetActivityTaskResponse x -> GetActivityTaskResponse
forall x. GetActivityTaskResponse -> Rep GetActivityTaskResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetActivityTaskResponse x -> GetActivityTaskResponse
$cfrom :: forall x. GetActivityTaskResponse -> Rep GetActivityTaskResponse x
Prelude.Generic)
newGetActivityTaskResponse ::
Prelude.Int ->
GetActivityTaskResponse
newGetActivityTaskResponse :: Int -> GetActivityTaskResponse
newGetActivityTaskResponse Int
pHttpStatus_ =
GetActivityTaskResponse' :: Maybe (Sensitive Text)
-> Maybe Text -> Int -> GetActivityTaskResponse
GetActivityTaskResponse'
{ $sel:input:GetActivityTaskResponse' :: Maybe (Sensitive Text)
input = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
$sel:taskToken:GetActivityTaskResponse' :: Maybe Text
taskToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetActivityTaskResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getActivityTaskResponse_input :: Lens.Lens' GetActivityTaskResponse (Prelude.Maybe Prelude.Text)
getActivityTaskResponse_input :: (Maybe Text -> f (Maybe Text))
-> GetActivityTaskResponse -> f GetActivityTaskResponse
getActivityTaskResponse_input = (GetActivityTaskResponse -> Maybe (Sensitive Text))
-> (GetActivityTaskResponse
-> Maybe (Sensitive Text) -> GetActivityTaskResponse)
-> Lens
GetActivityTaskResponse
GetActivityTaskResponse
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetActivityTaskResponse' {Maybe (Sensitive Text)
input :: Maybe (Sensitive Text)
$sel:input:GetActivityTaskResponse' :: GetActivityTaskResponse -> Maybe (Sensitive Text)
input} -> Maybe (Sensitive Text)
input) (\s :: GetActivityTaskResponse
s@GetActivityTaskResponse' {} Maybe (Sensitive Text)
a -> GetActivityTaskResponse
s {$sel:input:GetActivityTaskResponse' :: Maybe (Sensitive Text)
input = Maybe (Sensitive Text)
a} :: GetActivityTaskResponse) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> GetActivityTaskResponse -> f GetActivityTaskResponse)
-> ((Maybe Text -> f (Maybe Text))
-> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> GetActivityTaskResponse
-> f GetActivityTaskResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
(Maybe Text)
(Maybe 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 (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive
getActivityTaskResponse_taskToken :: Lens.Lens' GetActivityTaskResponse (Prelude.Maybe Prelude.Text)
getActivityTaskResponse_taskToken :: (Maybe Text -> f (Maybe Text))
-> GetActivityTaskResponse -> f GetActivityTaskResponse
getActivityTaskResponse_taskToken = (GetActivityTaskResponse -> Maybe Text)
-> (GetActivityTaskResponse
-> Maybe Text -> GetActivityTaskResponse)
-> Lens
GetActivityTaskResponse
GetActivityTaskResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetActivityTaskResponse' {Maybe Text
taskToken :: Maybe Text
$sel:taskToken:GetActivityTaskResponse' :: GetActivityTaskResponse -> Maybe Text
taskToken} -> Maybe Text
taskToken) (\s :: GetActivityTaskResponse
s@GetActivityTaskResponse' {} Maybe Text
a -> GetActivityTaskResponse
s {$sel:taskToken:GetActivityTaskResponse' :: Maybe Text
taskToken = Maybe Text
a} :: GetActivityTaskResponse)
getActivityTaskResponse_httpStatus :: Lens.Lens' GetActivityTaskResponse Prelude.Int
getActivityTaskResponse_httpStatus :: (Int -> f Int)
-> GetActivityTaskResponse -> f GetActivityTaskResponse
getActivityTaskResponse_httpStatus = (GetActivityTaskResponse -> Int)
-> (GetActivityTaskResponse -> Int -> GetActivityTaskResponse)
-> Lens GetActivityTaskResponse GetActivityTaskResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetActivityTaskResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetActivityTaskResponse' :: GetActivityTaskResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetActivityTaskResponse
s@GetActivityTaskResponse' {} Int
a -> GetActivityTaskResponse
s {$sel:httpStatus:GetActivityTaskResponse' :: Int
httpStatus = Int
a} :: GetActivityTaskResponse)
instance Prelude.NFData GetActivityTaskResponse