{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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. 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'
{ $sel:domain:DescribeWorkflowType' :: Text
domain = Text
pDomain_,
$sel:workflowType:DescribeWorkflowType' :: WorkflowType
workflowType = WorkflowType
pWorkflowType_
}
describeWorkflowType_domain :: Lens.Lens' DescribeWorkflowType Prelude.Text
describeWorkflowType_domain :: Lens' DescribeWorkflowType Text
describeWorkflowType_domain = 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 :: Lens' DescribeWorkflowType WorkflowType
describeWorkflowType_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 :: (Service -> Service)
-> DescribeWorkflowType -> Request DescribeWorkflowType
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DescribeWorkflowType
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeWorkflowType)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Int
-> WorkflowTypeInfo
-> WorkflowTypeConfiguration
-> DescribeWorkflowTypeResponse
DescribeWorkflowTypeResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"typeInfo")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"configuration")
)
instance Prelude.Hashable DescribeWorkflowType where
hashWithSalt :: Int -> DescribeWorkflowType -> Int
hashWithSalt Int
_salt DescribeWorkflowType' {Text
WorkflowType
workflowType :: WorkflowType
domain :: Text
$sel:workflowType:DescribeWorkflowType' :: DescribeWorkflowType -> WorkflowType
$sel:domain:DescribeWorkflowType' :: DescribeWorkflowType -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
domain
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` WorkflowType
workflowType
instance Prelude.NFData DescribeWorkflowType where
rnf :: DescribeWorkflowType -> ()
rnf DescribeWorkflowType' {Text
WorkflowType
workflowType :: WorkflowType
domain :: Text
$sel:workflowType:DescribeWorkflowType' :: DescribeWorkflowType -> WorkflowType
$sel:domain:DescribeWorkflowType' :: DescribeWorkflowType -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
domain
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf WorkflowType
workflowType
instance Data.ToHeaders DescribeWorkflowType where
toHeaders :: DescribeWorkflowType -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"SimpleWorkflowService.DescribeWorkflowType" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.0" ::
Prelude.ByteString
)
]
)
instance Data.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
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"domain" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
domain),
forall a. a -> Maybe a
Prelude.Just (Key
"workflowType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= WorkflowType
workflowType)
]
)
instance Data.ToPath DescribeWorkflowType where
toPath :: DescribeWorkflowType -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery DescribeWorkflowType where
toQuery :: DescribeWorkflowType -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const 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
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]
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
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.
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'
{ $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 :: Lens' DescribeWorkflowTypeResponse Int
describeWorkflowTypeResponse_httpStatus = 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 :: Lens' DescribeWorkflowTypeResponse WorkflowTypeInfo
describeWorkflowTypeResponse_typeInfo = 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 :: Lens' DescribeWorkflowTypeResponse WorkflowTypeConfiguration
describeWorkflowTypeResponse_configuration = 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 where
rnf :: DescribeWorkflowTypeResponse -> ()
rnf DescribeWorkflowTypeResponse' {Int
WorkflowTypeConfiguration
WorkflowTypeInfo
configuration :: WorkflowTypeConfiguration
typeInfo :: WorkflowTypeInfo
httpStatus :: Int
$sel:configuration:DescribeWorkflowTypeResponse' :: DescribeWorkflowTypeResponse -> WorkflowTypeConfiguration
$sel:typeInfo:DescribeWorkflowTypeResponse' :: DescribeWorkflowTypeResponse -> WorkflowTypeInfo
$sel:httpStatus:DescribeWorkflowTypeResponse' :: DescribeWorkflowTypeResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf WorkflowTypeInfo
typeInfo
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf WorkflowTypeConfiguration
configuration