{-# 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.SWF.DescribeActivityType
(
DescribeActivityType (..),
newDescribeActivityType,
describeActivityType_domain,
describeActivityType_activityType,
DescribeActivityTypeResponse (..),
newDescribeActivityTypeResponse,
describeActivityTypeResponse_httpStatus,
describeActivityTypeResponse_typeInfo,
describeActivityTypeResponse_configuration,
)
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.SWF.Types
data DescribeActivityType = DescribeActivityType'
{
DescribeActivityType -> Text
domain :: Prelude.Text,
DescribeActivityType -> ActivityType
activityType :: ActivityType
}
deriving (DescribeActivityType -> DescribeActivityType -> Bool
(DescribeActivityType -> DescribeActivityType -> Bool)
-> (DescribeActivityType -> DescribeActivityType -> Bool)
-> Eq DescribeActivityType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeActivityType -> DescribeActivityType -> Bool
$c/= :: DescribeActivityType -> DescribeActivityType -> Bool
== :: DescribeActivityType -> DescribeActivityType -> Bool
$c== :: DescribeActivityType -> DescribeActivityType -> Bool
Prelude.Eq, ReadPrec [DescribeActivityType]
ReadPrec DescribeActivityType
Int -> ReadS DescribeActivityType
ReadS [DescribeActivityType]
(Int -> ReadS DescribeActivityType)
-> ReadS [DescribeActivityType]
-> ReadPrec DescribeActivityType
-> ReadPrec [DescribeActivityType]
-> Read DescribeActivityType
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeActivityType]
$creadListPrec :: ReadPrec [DescribeActivityType]
readPrec :: ReadPrec DescribeActivityType
$creadPrec :: ReadPrec DescribeActivityType
readList :: ReadS [DescribeActivityType]
$creadList :: ReadS [DescribeActivityType]
readsPrec :: Int -> ReadS DescribeActivityType
$creadsPrec :: Int -> ReadS DescribeActivityType
Prelude.Read, Int -> DescribeActivityType -> ShowS
[DescribeActivityType] -> ShowS
DescribeActivityType -> String
(Int -> DescribeActivityType -> ShowS)
-> (DescribeActivityType -> String)
-> ([DescribeActivityType] -> ShowS)
-> Show DescribeActivityType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeActivityType] -> ShowS
$cshowList :: [DescribeActivityType] -> ShowS
show :: DescribeActivityType -> String
$cshow :: DescribeActivityType -> String
showsPrec :: Int -> DescribeActivityType -> ShowS
$cshowsPrec :: Int -> DescribeActivityType -> ShowS
Prelude.Show, (forall x. DescribeActivityType -> Rep DescribeActivityType x)
-> (forall x. Rep DescribeActivityType x -> DescribeActivityType)
-> Generic DescribeActivityType
forall x. Rep DescribeActivityType x -> DescribeActivityType
forall x. DescribeActivityType -> Rep DescribeActivityType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeActivityType x -> DescribeActivityType
$cfrom :: forall x. DescribeActivityType -> Rep DescribeActivityType x
Prelude.Generic)
newDescribeActivityType ::
Prelude.Text ->
ActivityType ->
DescribeActivityType
newDescribeActivityType :: Text -> ActivityType -> DescribeActivityType
newDescribeActivityType Text
pDomain_ ActivityType
pActivityType_ =
DescribeActivityType' :: Text -> ActivityType -> DescribeActivityType
DescribeActivityType'
{ $sel:domain:DescribeActivityType' :: Text
domain = Text
pDomain_,
$sel:activityType:DescribeActivityType' :: ActivityType
activityType = ActivityType
pActivityType_
}
describeActivityType_domain :: Lens.Lens' DescribeActivityType Prelude.Text
describeActivityType_domain :: (Text -> f Text) -> DescribeActivityType -> f DescribeActivityType
describeActivityType_domain = (DescribeActivityType -> Text)
-> (DescribeActivityType -> Text -> DescribeActivityType)
-> Lens DescribeActivityType DescribeActivityType Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeActivityType' {Text
domain :: Text
$sel:domain:DescribeActivityType' :: DescribeActivityType -> Text
domain} -> Text
domain) (\s :: DescribeActivityType
s@DescribeActivityType' {} Text
a -> DescribeActivityType
s {$sel:domain:DescribeActivityType' :: Text
domain = Text
a} :: DescribeActivityType)
describeActivityType_activityType :: Lens.Lens' DescribeActivityType ActivityType
describeActivityType_activityType :: (ActivityType -> f ActivityType)
-> DescribeActivityType -> f DescribeActivityType
describeActivityType_activityType = (DescribeActivityType -> ActivityType)
-> (DescribeActivityType -> ActivityType -> DescribeActivityType)
-> Lens
DescribeActivityType DescribeActivityType ActivityType ActivityType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeActivityType' {ActivityType
activityType :: ActivityType
$sel:activityType:DescribeActivityType' :: DescribeActivityType -> ActivityType
activityType} -> ActivityType
activityType) (\s :: DescribeActivityType
s@DescribeActivityType' {} ActivityType
a -> DescribeActivityType
s {$sel:activityType:DescribeActivityType' :: ActivityType
activityType = ActivityType
a} :: DescribeActivityType)
instance Core.AWSRequest DescribeActivityType where
type
AWSResponse DescribeActivityType =
DescribeActivityTypeResponse
request :: DescribeActivityType -> Request DescribeActivityType
request = Service -> DescribeActivityType -> Request DescribeActivityType
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeActivityType
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeActivityType)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeActivityType))
-> Logger
-> Service
-> Proxy DescribeActivityType
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeActivityType)))
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
-> ActivityTypeInfo
-> ActivityTypeConfiguration
-> DescribeActivityTypeResponse
DescribeActivityTypeResponse'
(Int
-> ActivityTypeInfo
-> ActivityTypeConfiguration
-> DescribeActivityTypeResponse)
-> Either String Int
-> Either
String
(ActivityTypeInfo
-> ActivityTypeConfiguration -> DescribeActivityTypeResponse)
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
(ActivityTypeInfo
-> ActivityTypeConfiguration -> DescribeActivityTypeResponse)
-> Either String ActivityTypeInfo
-> Either
String (ActivityTypeConfiguration -> DescribeActivityTypeResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String ActivityTypeInfo
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"typeInfo")
Either
String (ActivityTypeConfiguration -> DescribeActivityTypeResponse)
-> Either String ActivityTypeConfiguration
-> Either String DescribeActivityTypeResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String ActivityTypeConfiguration
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"configuration")
)
instance Prelude.Hashable DescribeActivityType
instance Prelude.NFData DescribeActivityType
instance Core.ToHeaders DescribeActivityType where
toHeaders :: DescribeActivityType -> ResponseHeaders
toHeaders =
ResponseHeaders -> DescribeActivityType -> 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
"SimpleWorkflowService.DescribeActivityType" ::
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 DescribeActivityType where
toJSON :: DescribeActivityType -> Value
toJSON DescribeActivityType' {Text
ActivityType
activityType :: ActivityType
domain :: Text
$sel:activityType:DescribeActivityType' :: DescribeActivityType -> ActivityType
$sel:domain:DescribeActivityType' :: DescribeActivityType -> 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
"domain" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
domain),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"activityType" Text -> ActivityType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ActivityType
activityType)
]
)
instance Core.ToPath DescribeActivityType where
toPath :: DescribeActivityType -> ByteString
toPath = ByteString -> DescribeActivityType -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DescribeActivityType where
toQuery :: DescribeActivityType -> QueryString
toQuery = QueryString -> DescribeActivityType -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeActivityTypeResponse = DescribeActivityTypeResponse'
{
DescribeActivityTypeResponse -> Int
httpStatus :: Prelude.Int,
DescribeActivityTypeResponse -> ActivityTypeInfo
typeInfo :: ActivityTypeInfo,
DescribeActivityTypeResponse -> ActivityTypeConfiguration
configuration :: ActivityTypeConfiguration
}
deriving (DescribeActivityTypeResponse
-> DescribeActivityTypeResponse -> Bool
(DescribeActivityTypeResponse
-> DescribeActivityTypeResponse -> Bool)
-> (DescribeActivityTypeResponse
-> DescribeActivityTypeResponse -> Bool)
-> Eq DescribeActivityTypeResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeActivityTypeResponse
-> DescribeActivityTypeResponse -> Bool
$c/= :: DescribeActivityTypeResponse
-> DescribeActivityTypeResponse -> Bool
== :: DescribeActivityTypeResponse
-> DescribeActivityTypeResponse -> Bool
$c== :: DescribeActivityTypeResponse
-> DescribeActivityTypeResponse -> Bool
Prelude.Eq, ReadPrec [DescribeActivityTypeResponse]
ReadPrec DescribeActivityTypeResponse
Int -> ReadS DescribeActivityTypeResponse
ReadS [DescribeActivityTypeResponse]
(Int -> ReadS DescribeActivityTypeResponse)
-> ReadS [DescribeActivityTypeResponse]
-> ReadPrec DescribeActivityTypeResponse
-> ReadPrec [DescribeActivityTypeResponse]
-> Read DescribeActivityTypeResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeActivityTypeResponse]
$creadListPrec :: ReadPrec [DescribeActivityTypeResponse]
readPrec :: ReadPrec DescribeActivityTypeResponse
$creadPrec :: ReadPrec DescribeActivityTypeResponse
readList :: ReadS [DescribeActivityTypeResponse]
$creadList :: ReadS [DescribeActivityTypeResponse]
readsPrec :: Int -> ReadS DescribeActivityTypeResponse
$creadsPrec :: Int -> ReadS DescribeActivityTypeResponse
Prelude.Read, Int -> DescribeActivityTypeResponse -> ShowS
[DescribeActivityTypeResponse] -> ShowS
DescribeActivityTypeResponse -> String
(Int -> DescribeActivityTypeResponse -> ShowS)
-> (DescribeActivityTypeResponse -> String)
-> ([DescribeActivityTypeResponse] -> ShowS)
-> Show DescribeActivityTypeResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeActivityTypeResponse] -> ShowS
$cshowList :: [DescribeActivityTypeResponse] -> ShowS
show :: DescribeActivityTypeResponse -> String
$cshow :: DescribeActivityTypeResponse -> String
showsPrec :: Int -> DescribeActivityTypeResponse -> ShowS
$cshowsPrec :: Int -> DescribeActivityTypeResponse -> ShowS
Prelude.Show, (forall x.
DescribeActivityTypeResponse -> Rep DescribeActivityTypeResponse x)
-> (forall x.
Rep DescribeActivityTypeResponse x -> DescribeActivityTypeResponse)
-> Generic DescribeActivityTypeResponse
forall x.
Rep DescribeActivityTypeResponse x -> DescribeActivityTypeResponse
forall x.
DescribeActivityTypeResponse -> Rep DescribeActivityTypeResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeActivityTypeResponse x -> DescribeActivityTypeResponse
$cfrom :: forall x.
DescribeActivityTypeResponse -> Rep DescribeActivityTypeResponse x
Prelude.Generic)
newDescribeActivityTypeResponse ::
Prelude.Int ->
ActivityTypeInfo ->
ActivityTypeConfiguration ->
DescribeActivityTypeResponse
newDescribeActivityTypeResponse :: Int
-> ActivityTypeInfo
-> ActivityTypeConfiguration
-> DescribeActivityTypeResponse
newDescribeActivityTypeResponse
Int
pHttpStatus_
ActivityTypeInfo
pTypeInfo_
ActivityTypeConfiguration
pConfiguration_ =
DescribeActivityTypeResponse' :: Int
-> ActivityTypeInfo
-> ActivityTypeConfiguration
-> DescribeActivityTypeResponse
DescribeActivityTypeResponse'
{ $sel:httpStatus:DescribeActivityTypeResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:typeInfo:DescribeActivityTypeResponse' :: ActivityTypeInfo
typeInfo = ActivityTypeInfo
pTypeInfo_,
$sel:configuration:DescribeActivityTypeResponse' :: ActivityTypeConfiguration
configuration = ActivityTypeConfiguration
pConfiguration_
}
describeActivityTypeResponse_httpStatus :: Lens.Lens' DescribeActivityTypeResponse Prelude.Int
describeActivityTypeResponse_httpStatus :: (Int -> f Int)
-> DescribeActivityTypeResponse -> f DescribeActivityTypeResponse
describeActivityTypeResponse_httpStatus = (DescribeActivityTypeResponse -> Int)
-> (DescribeActivityTypeResponse
-> Int -> DescribeActivityTypeResponse)
-> Lens
DescribeActivityTypeResponse DescribeActivityTypeResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeActivityTypeResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeActivityTypeResponse' :: DescribeActivityTypeResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeActivityTypeResponse
s@DescribeActivityTypeResponse' {} Int
a -> DescribeActivityTypeResponse
s {$sel:httpStatus:DescribeActivityTypeResponse' :: Int
httpStatus = Int
a} :: DescribeActivityTypeResponse)
describeActivityTypeResponse_typeInfo :: Lens.Lens' DescribeActivityTypeResponse ActivityTypeInfo
describeActivityTypeResponse_typeInfo :: (ActivityTypeInfo -> f ActivityTypeInfo)
-> DescribeActivityTypeResponse -> f DescribeActivityTypeResponse
describeActivityTypeResponse_typeInfo = (DescribeActivityTypeResponse -> ActivityTypeInfo)
-> (DescribeActivityTypeResponse
-> ActivityTypeInfo -> DescribeActivityTypeResponse)
-> Lens
DescribeActivityTypeResponse
DescribeActivityTypeResponse
ActivityTypeInfo
ActivityTypeInfo
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeActivityTypeResponse' {ActivityTypeInfo
typeInfo :: ActivityTypeInfo
$sel:typeInfo:DescribeActivityTypeResponse' :: DescribeActivityTypeResponse -> ActivityTypeInfo
typeInfo} -> ActivityTypeInfo
typeInfo) (\s :: DescribeActivityTypeResponse
s@DescribeActivityTypeResponse' {} ActivityTypeInfo
a -> DescribeActivityTypeResponse
s {$sel:typeInfo:DescribeActivityTypeResponse' :: ActivityTypeInfo
typeInfo = ActivityTypeInfo
a} :: DescribeActivityTypeResponse)
describeActivityTypeResponse_configuration :: Lens.Lens' DescribeActivityTypeResponse ActivityTypeConfiguration
describeActivityTypeResponse_configuration :: (ActivityTypeConfiguration -> f ActivityTypeConfiguration)
-> DescribeActivityTypeResponse -> f DescribeActivityTypeResponse
describeActivityTypeResponse_configuration = (DescribeActivityTypeResponse -> ActivityTypeConfiguration)
-> (DescribeActivityTypeResponse
-> ActivityTypeConfiguration -> DescribeActivityTypeResponse)
-> Lens
DescribeActivityTypeResponse
DescribeActivityTypeResponse
ActivityTypeConfiguration
ActivityTypeConfiguration
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeActivityTypeResponse' {ActivityTypeConfiguration
configuration :: ActivityTypeConfiguration
$sel:configuration:DescribeActivityTypeResponse' :: DescribeActivityTypeResponse -> ActivityTypeConfiguration
configuration} -> ActivityTypeConfiguration
configuration) (\s :: DescribeActivityTypeResponse
s@DescribeActivityTypeResponse' {} ActivityTypeConfiguration
a -> DescribeActivityTypeResponse
s {$sel:configuration:DescribeActivityTypeResponse' :: ActivityTypeConfiguration
configuration = ActivityTypeConfiguration
a} :: DescribeActivityTypeResponse)
instance Prelude.NFData DescribeActivityTypeResponse