{-# 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.DescribeActivity
(
DescribeActivity (..),
newDescribeActivity,
describeActivity_activityArn,
DescribeActivityResponse (..),
newDescribeActivityResponse,
describeActivityResponse_httpStatus,
describeActivityResponse_activityArn,
describeActivityResponse_name,
describeActivityResponse_creationDate,
)
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 DescribeActivity = DescribeActivity'
{
DescribeActivity -> Text
activityArn :: Prelude.Text
}
deriving (DescribeActivity -> DescribeActivity -> Bool
(DescribeActivity -> DescribeActivity -> Bool)
-> (DescribeActivity -> DescribeActivity -> Bool)
-> Eq DescribeActivity
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeActivity -> DescribeActivity -> Bool
$c/= :: DescribeActivity -> DescribeActivity -> Bool
== :: DescribeActivity -> DescribeActivity -> Bool
$c== :: DescribeActivity -> DescribeActivity -> Bool
Prelude.Eq, ReadPrec [DescribeActivity]
ReadPrec DescribeActivity
Int -> ReadS DescribeActivity
ReadS [DescribeActivity]
(Int -> ReadS DescribeActivity)
-> ReadS [DescribeActivity]
-> ReadPrec DescribeActivity
-> ReadPrec [DescribeActivity]
-> Read DescribeActivity
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeActivity]
$creadListPrec :: ReadPrec [DescribeActivity]
readPrec :: ReadPrec DescribeActivity
$creadPrec :: ReadPrec DescribeActivity
readList :: ReadS [DescribeActivity]
$creadList :: ReadS [DescribeActivity]
readsPrec :: Int -> ReadS DescribeActivity
$creadsPrec :: Int -> ReadS DescribeActivity
Prelude.Read, Int -> DescribeActivity -> ShowS
[DescribeActivity] -> ShowS
DescribeActivity -> String
(Int -> DescribeActivity -> ShowS)
-> (DescribeActivity -> String)
-> ([DescribeActivity] -> ShowS)
-> Show DescribeActivity
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeActivity] -> ShowS
$cshowList :: [DescribeActivity] -> ShowS
show :: DescribeActivity -> String
$cshow :: DescribeActivity -> String
showsPrec :: Int -> DescribeActivity -> ShowS
$cshowsPrec :: Int -> DescribeActivity -> ShowS
Prelude.Show, (forall x. DescribeActivity -> Rep DescribeActivity x)
-> (forall x. Rep DescribeActivity x -> DescribeActivity)
-> Generic DescribeActivity
forall x. Rep DescribeActivity x -> DescribeActivity
forall x. DescribeActivity -> Rep DescribeActivity x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeActivity x -> DescribeActivity
$cfrom :: forall x. DescribeActivity -> Rep DescribeActivity x
Prelude.Generic)
newDescribeActivity ::
Prelude.Text ->
DescribeActivity
newDescribeActivity :: Text -> DescribeActivity
newDescribeActivity Text
pActivityArn_ =
DescribeActivity' :: Text -> DescribeActivity
DescribeActivity' {$sel:activityArn:DescribeActivity' :: Text
activityArn = Text
pActivityArn_}
describeActivity_activityArn :: Lens.Lens' DescribeActivity Prelude.Text
describeActivity_activityArn :: (Text -> f Text) -> DescribeActivity -> f DescribeActivity
describeActivity_activityArn = (DescribeActivity -> Text)
-> (DescribeActivity -> Text -> DescribeActivity)
-> Lens DescribeActivity DescribeActivity Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeActivity' {Text
activityArn :: Text
$sel:activityArn:DescribeActivity' :: DescribeActivity -> Text
activityArn} -> Text
activityArn) (\s :: DescribeActivity
s@DescribeActivity' {} Text
a -> DescribeActivity
s {$sel:activityArn:DescribeActivity' :: Text
activityArn = Text
a} :: DescribeActivity)
instance Core.AWSRequest DescribeActivity where
type
AWSResponse DescribeActivity =
DescribeActivityResponse
request :: DescribeActivity -> Request DescribeActivity
request = Service -> DescribeActivity -> Request DescribeActivity
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeActivity
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeActivity)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeActivity))
-> Logger
-> Service
-> Proxy DescribeActivity
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeActivity)))
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 ->
Int -> Text -> Text -> POSIX -> DescribeActivityResponse
DescribeActivityResponse'
(Int -> Text -> Text -> POSIX -> DescribeActivityResponse)
-> Either String Int
-> Either
String (Text -> Text -> POSIX -> DescribeActivityResponse)
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))
Either String (Text -> Text -> POSIX -> DescribeActivityResponse)
-> Either String Text
-> Either String (Text -> POSIX -> DescribeActivityResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"activityArn")
Either String (Text -> POSIX -> DescribeActivityResponse)
-> Either String Text
-> Either String (POSIX -> DescribeActivityResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"name")
Either String (POSIX -> DescribeActivityResponse)
-> Either String POSIX -> Either String DescribeActivityResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String POSIX
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"creationDate")
)
instance Prelude.Hashable DescribeActivity
instance Prelude.NFData DescribeActivity
instance Core.ToHeaders DescribeActivity where
toHeaders :: DescribeActivity -> ResponseHeaders
toHeaders =
ResponseHeaders -> DescribeActivity -> 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.DescribeActivity" ::
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 DescribeActivity where
toJSON :: DescribeActivity -> Value
toJSON DescribeActivity' {Text
activityArn :: Text
$sel:activityArn:DescribeActivity' :: DescribeActivity -> 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
"activityArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
activityArn)]
)
instance Core.ToPath DescribeActivity where
toPath :: DescribeActivity -> ByteString
toPath = ByteString -> DescribeActivity -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DescribeActivity where
toQuery :: DescribeActivity -> QueryString
toQuery = QueryString -> DescribeActivity -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeActivityResponse = DescribeActivityResponse'
{
DescribeActivityResponse -> Int
httpStatus :: Prelude.Int,
DescribeActivityResponse -> Text
activityArn :: Prelude.Text,
DescribeActivityResponse -> Text
name :: Prelude.Text,
DescribeActivityResponse -> POSIX
creationDate :: Core.POSIX
}
deriving (DescribeActivityResponse -> DescribeActivityResponse -> Bool
(DescribeActivityResponse -> DescribeActivityResponse -> Bool)
-> (DescribeActivityResponse -> DescribeActivityResponse -> Bool)
-> Eq DescribeActivityResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeActivityResponse -> DescribeActivityResponse -> Bool
$c/= :: DescribeActivityResponse -> DescribeActivityResponse -> Bool
== :: DescribeActivityResponse -> DescribeActivityResponse -> Bool
$c== :: DescribeActivityResponse -> DescribeActivityResponse -> Bool
Prelude.Eq, ReadPrec [DescribeActivityResponse]
ReadPrec DescribeActivityResponse
Int -> ReadS DescribeActivityResponse
ReadS [DescribeActivityResponse]
(Int -> ReadS DescribeActivityResponse)
-> ReadS [DescribeActivityResponse]
-> ReadPrec DescribeActivityResponse
-> ReadPrec [DescribeActivityResponse]
-> Read DescribeActivityResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeActivityResponse]
$creadListPrec :: ReadPrec [DescribeActivityResponse]
readPrec :: ReadPrec DescribeActivityResponse
$creadPrec :: ReadPrec DescribeActivityResponse
readList :: ReadS [DescribeActivityResponse]
$creadList :: ReadS [DescribeActivityResponse]
readsPrec :: Int -> ReadS DescribeActivityResponse
$creadsPrec :: Int -> ReadS DescribeActivityResponse
Prelude.Read, Int -> DescribeActivityResponse -> ShowS
[DescribeActivityResponse] -> ShowS
DescribeActivityResponse -> String
(Int -> DescribeActivityResponse -> ShowS)
-> (DescribeActivityResponse -> String)
-> ([DescribeActivityResponse] -> ShowS)
-> Show DescribeActivityResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeActivityResponse] -> ShowS
$cshowList :: [DescribeActivityResponse] -> ShowS
show :: DescribeActivityResponse -> String
$cshow :: DescribeActivityResponse -> String
showsPrec :: Int -> DescribeActivityResponse -> ShowS
$cshowsPrec :: Int -> DescribeActivityResponse -> ShowS
Prelude.Show, (forall x.
DescribeActivityResponse -> Rep DescribeActivityResponse x)
-> (forall x.
Rep DescribeActivityResponse x -> DescribeActivityResponse)
-> Generic DescribeActivityResponse
forall x.
Rep DescribeActivityResponse x -> DescribeActivityResponse
forall x.
DescribeActivityResponse -> Rep DescribeActivityResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeActivityResponse x -> DescribeActivityResponse
$cfrom :: forall x.
DescribeActivityResponse -> Rep DescribeActivityResponse x
Prelude.Generic)
newDescribeActivityResponse ::
Prelude.Int ->
Prelude.Text ->
Prelude.Text ->
Prelude.UTCTime ->
DescribeActivityResponse
newDescribeActivityResponse :: Int -> Text -> Text -> UTCTime -> DescribeActivityResponse
newDescribeActivityResponse
Int
pHttpStatus_
Text
pActivityArn_
Text
pName_
UTCTime
pCreationDate_ =
DescribeActivityResponse' :: Int -> Text -> Text -> POSIX -> DescribeActivityResponse
DescribeActivityResponse'
{ $sel:httpStatus:DescribeActivityResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:activityArn:DescribeActivityResponse' :: Text
activityArn = Text
pActivityArn_,
$sel:name:DescribeActivityResponse' :: Text
name = Text
pName_,
$sel:creationDate:DescribeActivityResponse' :: POSIX
creationDate = Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
-> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pCreationDate_
}
describeActivityResponse_httpStatus :: Lens.Lens' DescribeActivityResponse Prelude.Int
describeActivityResponse_httpStatus :: (Int -> f Int)
-> DescribeActivityResponse -> f DescribeActivityResponse
describeActivityResponse_httpStatus = (DescribeActivityResponse -> Int)
-> (DescribeActivityResponse -> Int -> DescribeActivityResponse)
-> Lens DescribeActivityResponse DescribeActivityResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeActivityResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeActivityResponse' :: DescribeActivityResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeActivityResponse
s@DescribeActivityResponse' {} Int
a -> DescribeActivityResponse
s {$sel:httpStatus:DescribeActivityResponse' :: Int
httpStatus = Int
a} :: DescribeActivityResponse)
describeActivityResponse_activityArn :: Lens.Lens' DescribeActivityResponse Prelude.Text
describeActivityResponse_activityArn :: (Text -> f Text)
-> DescribeActivityResponse -> f DescribeActivityResponse
describeActivityResponse_activityArn = (DescribeActivityResponse -> Text)
-> (DescribeActivityResponse -> Text -> DescribeActivityResponse)
-> Lens DescribeActivityResponse DescribeActivityResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeActivityResponse' {Text
activityArn :: Text
$sel:activityArn:DescribeActivityResponse' :: DescribeActivityResponse -> Text
activityArn} -> Text
activityArn) (\s :: DescribeActivityResponse
s@DescribeActivityResponse' {} Text
a -> DescribeActivityResponse
s {$sel:activityArn:DescribeActivityResponse' :: Text
activityArn = Text
a} :: DescribeActivityResponse)
describeActivityResponse_name :: Lens.Lens' DescribeActivityResponse Prelude.Text
describeActivityResponse_name :: (Text -> f Text)
-> DescribeActivityResponse -> f DescribeActivityResponse
describeActivityResponse_name = (DescribeActivityResponse -> Text)
-> (DescribeActivityResponse -> Text -> DescribeActivityResponse)
-> Lens DescribeActivityResponse DescribeActivityResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeActivityResponse' {Text
name :: Text
$sel:name:DescribeActivityResponse' :: DescribeActivityResponse -> Text
name} -> Text
name) (\s :: DescribeActivityResponse
s@DescribeActivityResponse' {} Text
a -> DescribeActivityResponse
s {$sel:name:DescribeActivityResponse' :: Text
name = Text
a} :: DescribeActivityResponse)
describeActivityResponse_creationDate :: Lens.Lens' DescribeActivityResponse Prelude.UTCTime
describeActivityResponse_creationDate :: (UTCTime -> f UTCTime)
-> DescribeActivityResponse -> f DescribeActivityResponse
describeActivityResponse_creationDate = (DescribeActivityResponse -> POSIX)
-> (DescribeActivityResponse -> POSIX -> DescribeActivityResponse)
-> Lens
DescribeActivityResponse DescribeActivityResponse POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeActivityResponse' {POSIX
creationDate :: POSIX
$sel:creationDate:DescribeActivityResponse' :: DescribeActivityResponse -> POSIX
creationDate} -> POSIX
creationDate) (\s :: DescribeActivityResponse
s@DescribeActivityResponse' {} POSIX
a -> DescribeActivityResponse
s {$sel:creationDate:DescribeActivityResponse' :: POSIX
creationDate = POSIX
a} :: DescribeActivityResponse) ((POSIX -> f POSIX)
-> DescribeActivityResponse -> f DescribeActivityResponse)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> DescribeActivityResponse
-> f DescribeActivityResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
instance Prelude.NFData DescribeActivityResponse