{-# 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.CountPendingDecisionTasks
(
CountPendingDecisionTasks (..),
newCountPendingDecisionTasks,
countPendingDecisionTasks_domain,
countPendingDecisionTasks_taskList,
PendingTaskCount (..),
newPendingTaskCount,
pendingTaskCount_truncated,
pendingTaskCount_count,
)
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 CountPendingDecisionTasks = CountPendingDecisionTasks'
{
CountPendingDecisionTasks -> Text
domain :: Prelude.Text,
CountPendingDecisionTasks -> TaskList
taskList :: TaskList
}
deriving (CountPendingDecisionTasks -> CountPendingDecisionTasks -> Bool
(CountPendingDecisionTasks -> CountPendingDecisionTasks -> Bool)
-> (CountPendingDecisionTasks -> CountPendingDecisionTasks -> Bool)
-> Eq CountPendingDecisionTasks
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CountPendingDecisionTasks -> CountPendingDecisionTasks -> Bool
$c/= :: CountPendingDecisionTasks -> CountPendingDecisionTasks -> Bool
== :: CountPendingDecisionTasks -> CountPendingDecisionTasks -> Bool
$c== :: CountPendingDecisionTasks -> CountPendingDecisionTasks -> Bool
Prelude.Eq, ReadPrec [CountPendingDecisionTasks]
ReadPrec CountPendingDecisionTasks
Int -> ReadS CountPendingDecisionTasks
ReadS [CountPendingDecisionTasks]
(Int -> ReadS CountPendingDecisionTasks)
-> ReadS [CountPendingDecisionTasks]
-> ReadPrec CountPendingDecisionTasks
-> ReadPrec [CountPendingDecisionTasks]
-> Read CountPendingDecisionTasks
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CountPendingDecisionTasks]
$creadListPrec :: ReadPrec [CountPendingDecisionTasks]
readPrec :: ReadPrec CountPendingDecisionTasks
$creadPrec :: ReadPrec CountPendingDecisionTasks
readList :: ReadS [CountPendingDecisionTasks]
$creadList :: ReadS [CountPendingDecisionTasks]
readsPrec :: Int -> ReadS CountPendingDecisionTasks
$creadsPrec :: Int -> ReadS CountPendingDecisionTasks
Prelude.Read, Int -> CountPendingDecisionTasks -> ShowS
[CountPendingDecisionTasks] -> ShowS
CountPendingDecisionTasks -> String
(Int -> CountPendingDecisionTasks -> ShowS)
-> (CountPendingDecisionTasks -> String)
-> ([CountPendingDecisionTasks] -> ShowS)
-> Show CountPendingDecisionTasks
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CountPendingDecisionTasks] -> ShowS
$cshowList :: [CountPendingDecisionTasks] -> ShowS
show :: CountPendingDecisionTasks -> String
$cshow :: CountPendingDecisionTasks -> String
showsPrec :: Int -> CountPendingDecisionTasks -> ShowS
$cshowsPrec :: Int -> CountPendingDecisionTasks -> ShowS
Prelude.Show, (forall x.
CountPendingDecisionTasks -> Rep CountPendingDecisionTasks x)
-> (forall x.
Rep CountPendingDecisionTasks x -> CountPendingDecisionTasks)
-> Generic CountPendingDecisionTasks
forall x.
Rep CountPendingDecisionTasks x -> CountPendingDecisionTasks
forall x.
CountPendingDecisionTasks -> Rep CountPendingDecisionTasks x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CountPendingDecisionTasks x -> CountPendingDecisionTasks
$cfrom :: forall x.
CountPendingDecisionTasks -> Rep CountPendingDecisionTasks x
Prelude.Generic)
newCountPendingDecisionTasks ::
Prelude.Text ->
TaskList ->
CountPendingDecisionTasks
newCountPendingDecisionTasks :: Text -> TaskList -> CountPendingDecisionTasks
newCountPendingDecisionTasks Text
pDomain_ TaskList
pTaskList_ =
CountPendingDecisionTasks' :: Text -> TaskList -> CountPendingDecisionTasks
CountPendingDecisionTasks'
{ $sel:domain:CountPendingDecisionTasks' :: Text
domain = Text
pDomain_,
$sel:taskList:CountPendingDecisionTasks' :: TaskList
taskList = TaskList
pTaskList_
}
countPendingDecisionTasks_domain :: Lens.Lens' CountPendingDecisionTasks Prelude.Text
countPendingDecisionTasks_domain :: (Text -> f Text)
-> CountPendingDecisionTasks -> f CountPendingDecisionTasks
countPendingDecisionTasks_domain = (CountPendingDecisionTasks -> Text)
-> (CountPendingDecisionTasks -> Text -> CountPendingDecisionTasks)
-> Lens
CountPendingDecisionTasks CountPendingDecisionTasks Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CountPendingDecisionTasks' {Text
domain :: Text
$sel:domain:CountPendingDecisionTasks' :: CountPendingDecisionTasks -> Text
domain} -> Text
domain) (\s :: CountPendingDecisionTasks
s@CountPendingDecisionTasks' {} Text
a -> CountPendingDecisionTasks
s {$sel:domain:CountPendingDecisionTasks' :: Text
domain = Text
a} :: CountPendingDecisionTasks)
countPendingDecisionTasks_taskList :: Lens.Lens' CountPendingDecisionTasks TaskList
countPendingDecisionTasks_taskList :: (TaskList -> f TaskList)
-> CountPendingDecisionTasks -> f CountPendingDecisionTasks
countPendingDecisionTasks_taskList = (CountPendingDecisionTasks -> TaskList)
-> (CountPendingDecisionTasks
-> TaskList -> CountPendingDecisionTasks)
-> Lens
CountPendingDecisionTasks
CountPendingDecisionTasks
TaskList
TaskList
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CountPendingDecisionTasks' {TaskList
taskList :: TaskList
$sel:taskList:CountPendingDecisionTasks' :: CountPendingDecisionTasks -> TaskList
taskList} -> TaskList
taskList) (\s :: CountPendingDecisionTasks
s@CountPendingDecisionTasks' {} TaskList
a -> CountPendingDecisionTasks
s {$sel:taskList:CountPendingDecisionTasks' :: TaskList
taskList = TaskList
a} :: CountPendingDecisionTasks)
instance Core.AWSRequest CountPendingDecisionTasks where
type
AWSResponse CountPendingDecisionTasks =
PendingTaskCount
request :: CountPendingDecisionTasks -> Request CountPendingDecisionTasks
request = Service
-> CountPendingDecisionTasks -> Request CountPendingDecisionTasks
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CountPendingDecisionTasks
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CountPendingDecisionTasks)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse CountPendingDecisionTasks))
-> Logger
-> Service
-> Proxy CountPendingDecisionTasks
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CountPendingDecisionTasks)))
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 -> Object -> Either String PendingTaskCount
forall a. FromJSON a => Object -> Either String a
Core.eitherParseJSON Object
x)
instance Prelude.Hashable CountPendingDecisionTasks
instance Prelude.NFData CountPendingDecisionTasks
instance Core.ToHeaders CountPendingDecisionTasks where
toHeaders :: CountPendingDecisionTasks -> ResponseHeaders
toHeaders =
ResponseHeaders -> CountPendingDecisionTasks -> 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.CountPendingDecisionTasks" ::
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 CountPendingDecisionTasks where
toJSON :: CountPendingDecisionTasks -> Value
toJSON CountPendingDecisionTasks' {Text
TaskList
taskList :: TaskList
domain :: Text
$sel:taskList:CountPendingDecisionTasks' :: CountPendingDecisionTasks -> TaskList
$sel:domain:CountPendingDecisionTasks' :: CountPendingDecisionTasks -> 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
"taskList" Text -> TaskList -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= TaskList
taskList)
]
)
instance Core.ToPath CountPendingDecisionTasks where
toPath :: CountPendingDecisionTasks -> ByteString
toPath = ByteString -> CountPendingDecisionTasks -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery CountPendingDecisionTasks where
toQuery :: CountPendingDecisionTasks -> QueryString
toQuery = QueryString -> CountPendingDecisionTasks -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty