{-# 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.DescribeWorkflowType
(
DescribeWorkflowType (..),
newDescribeWorkflowType,
describeWorkflowType_domain,
describeWorkflowType_workflowType,
DescribeWorkflowTypeResponse (..),
newDescribeWorkflowTypeResponse,
describeWorkflowTypeResponse_httpStatus,
describeWorkflowTypeResponse_typeInfo,
describeWorkflowTypeResponse_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 DescribeWorkflowType = DescribeWorkflowType'
{
DescribeWorkflowType -> Text
domain :: Prelude.Text,
DescribeWorkflowType -> WorkflowType
workflowType :: WorkflowType
}
deriving (DescribeWorkflowType -> DescribeWorkflowType -> Bool
(DescribeWorkflowType -> DescribeWorkflowType -> Bool)
-> (DescribeWorkflowType -> DescribeWorkflowType -> Bool)
-> Eq DescribeWorkflowType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeWorkflowType -> DescribeWorkflowType -> Bool
$c/= :: DescribeWorkflowType -> DescribeWorkflowType -> Bool
== :: DescribeWorkflowType -> DescribeWorkflowType -> Bool
$c== :: DescribeWorkflowType -> DescribeWorkflowType -> Bool
Prelude.Eq, ReadPrec [DescribeWorkflowType]
ReadPrec DescribeWorkflowType
Int -> ReadS DescribeWorkflowType
ReadS [DescribeWorkflowType]
(Int -> ReadS DescribeWorkflowType)
-> ReadS [DescribeWorkflowType]
-> ReadPrec DescribeWorkflowType
-> ReadPrec [DescribeWorkflowType]
-> Read DescribeWorkflowType
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeWorkflowType]
$creadListPrec :: ReadPrec [DescribeWorkflowType]
readPrec :: ReadPrec DescribeWorkflowType
$creadPrec :: ReadPrec DescribeWorkflowType
readList :: ReadS [DescribeWorkflowType]
$creadList :: ReadS [DescribeWorkflowType]
readsPrec :: Int -> ReadS DescribeWorkflowType
$creadsPrec :: Int -> ReadS DescribeWorkflowType
Prelude.Read, Int -> DescribeWorkflowType -> ShowS
[DescribeWorkflowType] -> ShowS
DescribeWorkflowType -> String
(Int -> DescribeWorkflowType -> ShowS)
-> (DescribeWorkflowType -> String)
-> ([DescribeWorkflowType] -> ShowS)
-> Show DescribeWorkflowType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeWorkflowType] -> ShowS
$cshowList :: [DescribeWorkflowType] -> ShowS
show :: DescribeWorkflowType -> String
$cshow :: DescribeWorkflowType -> String
showsPrec :: Int -> DescribeWorkflowType -> ShowS
$cshowsPrec :: Int -> DescribeWorkflowType -> ShowS
Prelude.Show, (forall x. DescribeWorkflowType -> Rep DescribeWorkflowType x)
-> (forall x. Rep DescribeWorkflowType x -> DescribeWorkflowType)
-> Generic DescribeWorkflowType
forall x. Rep DescribeWorkflowType x -> DescribeWorkflowType
forall x. DescribeWorkflowType -> Rep DescribeWorkflowType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeWorkflowType x -> DescribeWorkflowType
$cfrom :: forall x. DescribeWorkflowType -> Rep DescribeWorkflowType x
Prelude.Generic)
newDescribeWorkflowType ::
Prelude.Text ->
WorkflowType ->
DescribeWorkflowType
newDescribeWorkflowType :: Text -> WorkflowType -> DescribeWorkflowType
newDescribeWorkflowType Text
pDomain_ WorkflowType
pWorkflowType_ =
DescribeWorkflowType' :: Text -> WorkflowType -> DescribeWorkflowType
DescribeWorkflowType'
{ $sel:domain:DescribeWorkflowType' :: Text
domain = Text
pDomain_,
$sel:workflowType:DescribeWorkflowType' :: WorkflowType
workflowType = WorkflowType
pWorkflowType_
}
describeWorkflowType_domain :: Lens.Lens' DescribeWorkflowType Prelude.Text
describeWorkflowType_domain :: (Text -> f Text) -> DescribeWorkflowType -> f DescribeWorkflowType
describeWorkflowType_domain = (DescribeWorkflowType -> Text)
-> (DescribeWorkflowType -> Text -> DescribeWorkflowType)
-> Lens DescribeWorkflowType DescribeWorkflowType Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeWorkflowType' {Text
domain :: Text
$sel:domain:DescribeWorkflowType' :: DescribeWorkflowType -> Text
domain} -> Text
domain) (\s :: DescribeWorkflowType
s@DescribeWorkflowType' {} Text
a -> DescribeWorkflowType
s {$sel:domain:DescribeWorkflowType' :: Text
domain = Text
a} :: DescribeWorkflowType)
describeWorkflowType_workflowType :: Lens.Lens' DescribeWorkflowType WorkflowType
describeWorkflowType_workflowType :: (WorkflowType -> f WorkflowType)
-> DescribeWorkflowType -> f DescribeWorkflowType
describeWorkflowType_workflowType = (DescribeWorkflowType -> WorkflowType)
-> (DescribeWorkflowType -> WorkflowType -> DescribeWorkflowType)
-> Lens
DescribeWorkflowType DescribeWorkflowType WorkflowType WorkflowType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeWorkflowType' {WorkflowType
workflowType :: WorkflowType
$sel:workflowType:DescribeWorkflowType' :: DescribeWorkflowType -> WorkflowType
workflowType} -> WorkflowType
workflowType) (\s :: DescribeWorkflowType
s@DescribeWorkflowType' {} WorkflowType
a -> DescribeWorkflowType
s {$sel:workflowType:DescribeWorkflowType' :: WorkflowType
workflowType = WorkflowType
a} :: DescribeWorkflowType)
instance Core.AWSRequest DescribeWorkflowType where
type
AWSResponse DescribeWorkflowType =
DescribeWorkflowTypeResponse
request :: DescribeWorkflowType -> Request DescribeWorkflowType
request = Service -> DescribeWorkflowType -> Request DescribeWorkflowType
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeWorkflowType
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeWorkflowType)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeWorkflowType))
-> Logger
-> Service
-> Proxy DescribeWorkflowType
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeWorkflowType)))
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
-> WorkflowTypeInfo
-> WorkflowTypeConfiguration
-> DescribeWorkflowTypeResponse
DescribeWorkflowTypeResponse'
(Int
-> WorkflowTypeInfo
-> WorkflowTypeConfiguration
-> DescribeWorkflowTypeResponse)
-> Either String Int
-> Either
String
(WorkflowTypeInfo
-> WorkflowTypeConfiguration -> DescribeWorkflowTypeResponse)
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
(WorkflowTypeInfo
-> WorkflowTypeConfiguration -> DescribeWorkflowTypeResponse)
-> Either String WorkflowTypeInfo
-> Either
String (WorkflowTypeConfiguration -> DescribeWorkflowTypeResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String WorkflowTypeInfo
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"typeInfo")
Either
String (WorkflowTypeConfiguration -> DescribeWorkflowTypeResponse)
-> Either String WorkflowTypeConfiguration
-> Either String DescribeWorkflowTypeResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String WorkflowTypeConfiguration
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"configuration")
)
instance Prelude.Hashable DescribeWorkflowType
instance Prelude.NFData DescribeWorkflowType
instance Core.ToHeaders DescribeWorkflowType where
toHeaders :: DescribeWorkflowType -> ResponseHeaders
toHeaders =
ResponseHeaders -> DescribeWorkflowType -> 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.DescribeWorkflowType" ::
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 DescribeWorkflowType where
toJSON :: DescribeWorkflowType -> Value
toJSON DescribeWorkflowType' {Text
WorkflowType
workflowType :: WorkflowType
domain :: Text
$sel:workflowType:DescribeWorkflowType' :: DescribeWorkflowType -> WorkflowType
$sel:domain:DescribeWorkflowType' :: DescribeWorkflowType -> 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
"workflowType" Text -> WorkflowType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= WorkflowType
workflowType)
]
)
instance Core.ToPath DescribeWorkflowType where
toPath :: DescribeWorkflowType -> ByteString
toPath = ByteString -> DescribeWorkflowType -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DescribeWorkflowType where
toQuery :: DescribeWorkflowType -> QueryString
toQuery = QueryString -> DescribeWorkflowType -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeWorkflowTypeResponse = DescribeWorkflowTypeResponse'
{
DescribeWorkflowTypeResponse -> Int
httpStatus :: Prelude.Int,
DescribeWorkflowTypeResponse -> WorkflowTypeInfo
typeInfo :: WorkflowTypeInfo,
DescribeWorkflowTypeResponse -> WorkflowTypeConfiguration
configuration :: WorkflowTypeConfiguration
}
deriving (DescribeWorkflowTypeResponse
-> DescribeWorkflowTypeResponse -> Bool
(DescribeWorkflowTypeResponse
-> DescribeWorkflowTypeResponse -> Bool)
-> (DescribeWorkflowTypeResponse
-> DescribeWorkflowTypeResponse -> Bool)
-> Eq DescribeWorkflowTypeResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeWorkflowTypeResponse
-> DescribeWorkflowTypeResponse -> Bool
$c/= :: DescribeWorkflowTypeResponse
-> DescribeWorkflowTypeResponse -> Bool
== :: DescribeWorkflowTypeResponse
-> DescribeWorkflowTypeResponse -> Bool
$c== :: DescribeWorkflowTypeResponse
-> DescribeWorkflowTypeResponse -> Bool
Prelude.Eq, ReadPrec [DescribeWorkflowTypeResponse]
ReadPrec DescribeWorkflowTypeResponse
Int -> ReadS DescribeWorkflowTypeResponse
ReadS [DescribeWorkflowTypeResponse]
(Int -> ReadS DescribeWorkflowTypeResponse)
-> ReadS [DescribeWorkflowTypeResponse]
-> ReadPrec DescribeWorkflowTypeResponse
-> ReadPrec [DescribeWorkflowTypeResponse]
-> Read DescribeWorkflowTypeResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeWorkflowTypeResponse]
$creadListPrec :: ReadPrec [DescribeWorkflowTypeResponse]
readPrec :: ReadPrec DescribeWorkflowTypeResponse
$creadPrec :: ReadPrec DescribeWorkflowTypeResponse
readList :: ReadS [DescribeWorkflowTypeResponse]
$creadList :: ReadS [DescribeWorkflowTypeResponse]
readsPrec :: Int -> ReadS DescribeWorkflowTypeResponse
$creadsPrec :: Int -> ReadS DescribeWorkflowTypeResponse
Prelude.Read, Int -> DescribeWorkflowTypeResponse -> ShowS
[DescribeWorkflowTypeResponse] -> ShowS
DescribeWorkflowTypeResponse -> String
(Int -> DescribeWorkflowTypeResponse -> ShowS)
-> (DescribeWorkflowTypeResponse -> String)
-> ([DescribeWorkflowTypeResponse] -> ShowS)
-> Show DescribeWorkflowTypeResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeWorkflowTypeResponse] -> ShowS
$cshowList :: [DescribeWorkflowTypeResponse] -> ShowS
show :: DescribeWorkflowTypeResponse -> String
$cshow :: DescribeWorkflowTypeResponse -> String
showsPrec :: Int -> DescribeWorkflowTypeResponse -> ShowS
$cshowsPrec :: Int -> DescribeWorkflowTypeResponse -> ShowS
Prelude.Show, (forall x.
DescribeWorkflowTypeResponse -> Rep DescribeWorkflowTypeResponse x)
-> (forall x.
Rep DescribeWorkflowTypeResponse x -> DescribeWorkflowTypeResponse)
-> Generic DescribeWorkflowTypeResponse
forall x.
Rep DescribeWorkflowTypeResponse x -> DescribeWorkflowTypeResponse
forall x.
DescribeWorkflowTypeResponse -> Rep DescribeWorkflowTypeResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeWorkflowTypeResponse x -> DescribeWorkflowTypeResponse
$cfrom :: forall x.
DescribeWorkflowTypeResponse -> Rep DescribeWorkflowTypeResponse x
Prelude.Generic)
newDescribeWorkflowTypeResponse ::
Prelude.Int ->
WorkflowTypeInfo ->
WorkflowTypeConfiguration ->
DescribeWorkflowTypeResponse
newDescribeWorkflowTypeResponse :: Int
-> WorkflowTypeInfo
-> WorkflowTypeConfiguration
-> DescribeWorkflowTypeResponse
newDescribeWorkflowTypeResponse
Int
pHttpStatus_
WorkflowTypeInfo
pTypeInfo_
WorkflowTypeConfiguration
pConfiguration_ =
DescribeWorkflowTypeResponse' :: Int
-> WorkflowTypeInfo
-> WorkflowTypeConfiguration
-> DescribeWorkflowTypeResponse
DescribeWorkflowTypeResponse'
{ $sel:httpStatus:DescribeWorkflowTypeResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:typeInfo:DescribeWorkflowTypeResponse' :: WorkflowTypeInfo
typeInfo = WorkflowTypeInfo
pTypeInfo_,
$sel:configuration:DescribeWorkflowTypeResponse' :: WorkflowTypeConfiguration
configuration = WorkflowTypeConfiguration
pConfiguration_
}
describeWorkflowTypeResponse_httpStatus :: Lens.Lens' DescribeWorkflowTypeResponse Prelude.Int
describeWorkflowTypeResponse_httpStatus :: (Int -> f Int)
-> DescribeWorkflowTypeResponse -> f DescribeWorkflowTypeResponse
describeWorkflowTypeResponse_httpStatus = (DescribeWorkflowTypeResponse -> Int)
-> (DescribeWorkflowTypeResponse
-> Int -> DescribeWorkflowTypeResponse)
-> Lens
DescribeWorkflowTypeResponse DescribeWorkflowTypeResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeWorkflowTypeResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeWorkflowTypeResponse' :: DescribeWorkflowTypeResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeWorkflowTypeResponse
s@DescribeWorkflowTypeResponse' {} Int
a -> DescribeWorkflowTypeResponse
s {$sel:httpStatus:DescribeWorkflowTypeResponse' :: Int
httpStatus = Int
a} :: DescribeWorkflowTypeResponse)
describeWorkflowTypeResponse_typeInfo :: Lens.Lens' DescribeWorkflowTypeResponse WorkflowTypeInfo
describeWorkflowTypeResponse_typeInfo :: (WorkflowTypeInfo -> f WorkflowTypeInfo)
-> DescribeWorkflowTypeResponse -> f DescribeWorkflowTypeResponse
describeWorkflowTypeResponse_typeInfo = (DescribeWorkflowTypeResponse -> WorkflowTypeInfo)
-> (DescribeWorkflowTypeResponse
-> WorkflowTypeInfo -> DescribeWorkflowTypeResponse)
-> Lens
DescribeWorkflowTypeResponse
DescribeWorkflowTypeResponse
WorkflowTypeInfo
WorkflowTypeInfo
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeWorkflowTypeResponse' {WorkflowTypeInfo
typeInfo :: WorkflowTypeInfo
$sel:typeInfo:DescribeWorkflowTypeResponse' :: DescribeWorkflowTypeResponse -> WorkflowTypeInfo
typeInfo} -> WorkflowTypeInfo
typeInfo) (\s :: DescribeWorkflowTypeResponse
s@DescribeWorkflowTypeResponse' {} WorkflowTypeInfo
a -> DescribeWorkflowTypeResponse
s {$sel:typeInfo:DescribeWorkflowTypeResponse' :: WorkflowTypeInfo
typeInfo = WorkflowTypeInfo
a} :: DescribeWorkflowTypeResponse)
describeWorkflowTypeResponse_configuration :: Lens.Lens' DescribeWorkflowTypeResponse WorkflowTypeConfiguration
describeWorkflowTypeResponse_configuration :: (WorkflowTypeConfiguration -> f WorkflowTypeConfiguration)
-> DescribeWorkflowTypeResponse -> f DescribeWorkflowTypeResponse
describeWorkflowTypeResponse_configuration = (DescribeWorkflowTypeResponse -> WorkflowTypeConfiguration)
-> (DescribeWorkflowTypeResponse
-> WorkflowTypeConfiguration -> DescribeWorkflowTypeResponse)
-> Lens
DescribeWorkflowTypeResponse
DescribeWorkflowTypeResponse
WorkflowTypeConfiguration
WorkflowTypeConfiguration
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeWorkflowTypeResponse' {WorkflowTypeConfiguration
configuration :: WorkflowTypeConfiguration
$sel:configuration:DescribeWorkflowTypeResponse' :: DescribeWorkflowTypeResponse -> WorkflowTypeConfiguration
configuration} -> WorkflowTypeConfiguration
configuration) (\s :: DescribeWorkflowTypeResponse
s@DescribeWorkflowTypeResponse' {} WorkflowTypeConfiguration
a -> DescribeWorkflowTypeResponse
s {$sel:configuration:DescribeWorkflowTypeResponse' :: WorkflowTypeConfiguration
configuration = WorkflowTypeConfiguration
a} :: DescribeWorkflowTypeResponse)
instance Prelude.NFData DescribeWorkflowTypeResponse