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