{-# 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.CountOpenWorkflowExecutions
(
CountOpenWorkflowExecutions (..),
newCountOpenWorkflowExecutions,
countOpenWorkflowExecutions_executionFilter,
countOpenWorkflowExecutions_tagFilter,
countOpenWorkflowExecutions_typeFilter,
countOpenWorkflowExecutions_domain,
countOpenWorkflowExecutions_startTimeFilter,
WorkflowExecutionCount (..),
newWorkflowExecutionCount,
workflowExecutionCount_truncated,
workflowExecutionCount_count,
)
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 CountOpenWorkflowExecutions = CountOpenWorkflowExecutions'
{
CountOpenWorkflowExecutions -> Maybe WorkflowExecutionFilter
executionFilter :: Prelude.Maybe WorkflowExecutionFilter,
CountOpenWorkflowExecutions -> Maybe TagFilter
tagFilter :: Prelude.Maybe TagFilter,
CountOpenWorkflowExecutions -> Maybe WorkflowTypeFilter
typeFilter :: Prelude.Maybe WorkflowTypeFilter,
CountOpenWorkflowExecutions -> Text
domain :: Prelude.Text,
CountOpenWorkflowExecutions -> ExecutionTimeFilter
startTimeFilter :: ExecutionTimeFilter
}
deriving (CountOpenWorkflowExecutions -> CountOpenWorkflowExecutions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CountOpenWorkflowExecutions -> CountOpenWorkflowExecutions -> Bool
$c/= :: CountOpenWorkflowExecutions -> CountOpenWorkflowExecutions -> Bool
== :: CountOpenWorkflowExecutions -> CountOpenWorkflowExecutions -> Bool
$c== :: CountOpenWorkflowExecutions -> CountOpenWorkflowExecutions -> Bool
Prelude.Eq, ReadPrec [CountOpenWorkflowExecutions]
ReadPrec CountOpenWorkflowExecutions
Int -> ReadS CountOpenWorkflowExecutions
ReadS [CountOpenWorkflowExecutions]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CountOpenWorkflowExecutions]
$creadListPrec :: ReadPrec [CountOpenWorkflowExecutions]
readPrec :: ReadPrec CountOpenWorkflowExecutions
$creadPrec :: ReadPrec CountOpenWorkflowExecutions
readList :: ReadS [CountOpenWorkflowExecutions]
$creadList :: ReadS [CountOpenWorkflowExecutions]
readsPrec :: Int -> ReadS CountOpenWorkflowExecutions
$creadsPrec :: Int -> ReadS CountOpenWorkflowExecutions
Prelude.Read, Int -> CountOpenWorkflowExecutions -> ShowS
[CountOpenWorkflowExecutions] -> ShowS
CountOpenWorkflowExecutions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CountOpenWorkflowExecutions] -> ShowS
$cshowList :: [CountOpenWorkflowExecutions] -> ShowS
show :: CountOpenWorkflowExecutions -> String
$cshow :: CountOpenWorkflowExecutions -> String
showsPrec :: Int -> CountOpenWorkflowExecutions -> ShowS
$cshowsPrec :: Int -> CountOpenWorkflowExecutions -> ShowS
Prelude.Show, forall x.
Rep CountOpenWorkflowExecutions x -> CountOpenWorkflowExecutions
forall x.
CountOpenWorkflowExecutions -> Rep CountOpenWorkflowExecutions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CountOpenWorkflowExecutions x -> CountOpenWorkflowExecutions
$cfrom :: forall x.
CountOpenWorkflowExecutions -> Rep CountOpenWorkflowExecutions x
Prelude.Generic)
newCountOpenWorkflowExecutions ::
Prelude.Text ->
ExecutionTimeFilter ->
CountOpenWorkflowExecutions
newCountOpenWorkflowExecutions :: Text -> ExecutionTimeFilter -> CountOpenWorkflowExecutions
newCountOpenWorkflowExecutions
Text
pDomain_
ExecutionTimeFilter
pStartTimeFilter_ =
CountOpenWorkflowExecutions'
{ $sel:executionFilter:CountOpenWorkflowExecutions' :: Maybe WorkflowExecutionFilter
executionFilter =
forall a. Maybe a
Prelude.Nothing,
$sel:tagFilter:CountOpenWorkflowExecutions' :: Maybe TagFilter
tagFilter = forall a. Maybe a
Prelude.Nothing,
$sel:typeFilter:CountOpenWorkflowExecutions' :: Maybe WorkflowTypeFilter
typeFilter = forall a. Maybe a
Prelude.Nothing,
$sel:domain:CountOpenWorkflowExecutions' :: Text
domain = Text
pDomain_,
$sel:startTimeFilter:CountOpenWorkflowExecutions' :: ExecutionTimeFilter
startTimeFilter = ExecutionTimeFilter
pStartTimeFilter_
}
countOpenWorkflowExecutions_executionFilter :: Lens.Lens' CountOpenWorkflowExecutions (Prelude.Maybe WorkflowExecutionFilter)
countOpenWorkflowExecutions_executionFilter :: Lens' CountOpenWorkflowExecutions (Maybe WorkflowExecutionFilter)
countOpenWorkflowExecutions_executionFilter = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CountOpenWorkflowExecutions' {Maybe WorkflowExecutionFilter
executionFilter :: Maybe WorkflowExecutionFilter
$sel:executionFilter:CountOpenWorkflowExecutions' :: CountOpenWorkflowExecutions -> Maybe WorkflowExecutionFilter
executionFilter} -> Maybe WorkflowExecutionFilter
executionFilter) (\s :: CountOpenWorkflowExecutions
s@CountOpenWorkflowExecutions' {} Maybe WorkflowExecutionFilter
a -> CountOpenWorkflowExecutions
s {$sel:executionFilter:CountOpenWorkflowExecutions' :: Maybe WorkflowExecutionFilter
executionFilter = Maybe WorkflowExecutionFilter
a} :: CountOpenWorkflowExecutions)
countOpenWorkflowExecutions_tagFilter :: Lens.Lens' CountOpenWorkflowExecutions (Prelude.Maybe TagFilter)
countOpenWorkflowExecutions_tagFilter :: Lens' CountOpenWorkflowExecutions (Maybe TagFilter)
countOpenWorkflowExecutions_tagFilter = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CountOpenWorkflowExecutions' {Maybe TagFilter
tagFilter :: Maybe TagFilter
$sel:tagFilter:CountOpenWorkflowExecutions' :: CountOpenWorkflowExecutions -> Maybe TagFilter
tagFilter} -> Maybe TagFilter
tagFilter) (\s :: CountOpenWorkflowExecutions
s@CountOpenWorkflowExecutions' {} Maybe TagFilter
a -> CountOpenWorkflowExecutions
s {$sel:tagFilter:CountOpenWorkflowExecutions' :: Maybe TagFilter
tagFilter = Maybe TagFilter
a} :: CountOpenWorkflowExecutions)
countOpenWorkflowExecutions_typeFilter :: Lens.Lens' CountOpenWorkflowExecutions (Prelude.Maybe WorkflowTypeFilter)
countOpenWorkflowExecutions_typeFilter :: Lens' CountOpenWorkflowExecutions (Maybe WorkflowTypeFilter)
countOpenWorkflowExecutions_typeFilter = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CountOpenWorkflowExecutions' {Maybe WorkflowTypeFilter
typeFilter :: Maybe WorkflowTypeFilter
$sel:typeFilter:CountOpenWorkflowExecutions' :: CountOpenWorkflowExecutions -> Maybe WorkflowTypeFilter
typeFilter} -> Maybe WorkflowTypeFilter
typeFilter) (\s :: CountOpenWorkflowExecutions
s@CountOpenWorkflowExecutions' {} Maybe WorkflowTypeFilter
a -> CountOpenWorkflowExecutions
s {$sel:typeFilter:CountOpenWorkflowExecutions' :: Maybe WorkflowTypeFilter
typeFilter = Maybe WorkflowTypeFilter
a} :: CountOpenWorkflowExecutions)
countOpenWorkflowExecutions_domain :: Lens.Lens' CountOpenWorkflowExecutions Prelude.Text
countOpenWorkflowExecutions_domain :: Lens' CountOpenWorkflowExecutions Text
countOpenWorkflowExecutions_domain = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CountOpenWorkflowExecutions' {Text
domain :: Text
$sel:domain:CountOpenWorkflowExecutions' :: CountOpenWorkflowExecutions -> Text
domain} -> Text
domain) (\s :: CountOpenWorkflowExecutions
s@CountOpenWorkflowExecutions' {} Text
a -> CountOpenWorkflowExecutions
s {$sel:domain:CountOpenWorkflowExecutions' :: Text
domain = Text
a} :: CountOpenWorkflowExecutions)
countOpenWorkflowExecutions_startTimeFilter :: Lens.Lens' CountOpenWorkflowExecutions ExecutionTimeFilter
countOpenWorkflowExecutions_startTimeFilter :: Lens' CountOpenWorkflowExecutions ExecutionTimeFilter
countOpenWorkflowExecutions_startTimeFilter = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CountOpenWorkflowExecutions' {ExecutionTimeFilter
startTimeFilter :: ExecutionTimeFilter
$sel:startTimeFilter:CountOpenWorkflowExecutions' :: CountOpenWorkflowExecutions -> ExecutionTimeFilter
startTimeFilter} -> ExecutionTimeFilter
startTimeFilter) (\s :: CountOpenWorkflowExecutions
s@CountOpenWorkflowExecutions' {} ExecutionTimeFilter
a -> CountOpenWorkflowExecutions
s {$sel:startTimeFilter:CountOpenWorkflowExecutions' :: ExecutionTimeFilter
startTimeFilter = ExecutionTimeFilter
a} :: CountOpenWorkflowExecutions)
instance Core.AWSRequest CountOpenWorkflowExecutions where
type
AWSResponse CountOpenWorkflowExecutions =
WorkflowExecutionCount
request :: (Service -> Service)
-> CountOpenWorkflowExecutions
-> Request CountOpenWorkflowExecutions
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 CountOpenWorkflowExecutions
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CountOpenWorkflowExecutions)))
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 -> forall a. FromJSON a => Object -> Either String a
Data.eitherParseJSON Object
x)
instance Prelude.Hashable CountOpenWorkflowExecutions where
hashWithSalt :: Int -> CountOpenWorkflowExecutions -> Int
hashWithSalt Int
_salt CountOpenWorkflowExecutions' {Maybe TagFilter
Maybe WorkflowExecutionFilter
Maybe WorkflowTypeFilter
Text
ExecutionTimeFilter
startTimeFilter :: ExecutionTimeFilter
domain :: Text
typeFilter :: Maybe WorkflowTypeFilter
tagFilter :: Maybe TagFilter
executionFilter :: Maybe WorkflowExecutionFilter
$sel:startTimeFilter:CountOpenWorkflowExecutions' :: CountOpenWorkflowExecutions -> ExecutionTimeFilter
$sel:domain:CountOpenWorkflowExecutions' :: CountOpenWorkflowExecutions -> Text
$sel:typeFilter:CountOpenWorkflowExecutions' :: CountOpenWorkflowExecutions -> Maybe WorkflowTypeFilter
$sel:tagFilter:CountOpenWorkflowExecutions' :: CountOpenWorkflowExecutions -> Maybe TagFilter
$sel:executionFilter:CountOpenWorkflowExecutions' :: CountOpenWorkflowExecutions -> Maybe WorkflowExecutionFilter
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe WorkflowExecutionFilter
executionFilter
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe TagFilter
tagFilter
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe WorkflowTypeFilter
typeFilter
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
domain
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ExecutionTimeFilter
startTimeFilter
instance Prelude.NFData CountOpenWorkflowExecutions where
rnf :: CountOpenWorkflowExecutions -> ()
rnf CountOpenWorkflowExecutions' {Maybe TagFilter
Maybe WorkflowExecutionFilter
Maybe WorkflowTypeFilter
Text
ExecutionTimeFilter
startTimeFilter :: ExecutionTimeFilter
domain :: Text
typeFilter :: Maybe WorkflowTypeFilter
tagFilter :: Maybe TagFilter
executionFilter :: Maybe WorkflowExecutionFilter
$sel:startTimeFilter:CountOpenWorkflowExecutions' :: CountOpenWorkflowExecutions -> ExecutionTimeFilter
$sel:domain:CountOpenWorkflowExecutions' :: CountOpenWorkflowExecutions -> Text
$sel:typeFilter:CountOpenWorkflowExecutions' :: CountOpenWorkflowExecutions -> Maybe WorkflowTypeFilter
$sel:tagFilter:CountOpenWorkflowExecutions' :: CountOpenWorkflowExecutions -> Maybe TagFilter
$sel:executionFilter:CountOpenWorkflowExecutions' :: CountOpenWorkflowExecutions -> Maybe WorkflowExecutionFilter
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe WorkflowExecutionFilter
executionFilter
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe TagFilter
tagFilter
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe WorkflowTypeFilter
typeFilter
seq :: forall a b. a -> b -> b
`Prelude.seq` 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 ExecutionTimeFilter
startTimeFilter
instance Data.ToHeaders CountOpenWorkflowExecutions where
toHeaders :: CountOpenWorkflowExecutions -> 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.CountOpenWorkflowExecutions" ::
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 CountOpenWorkflowExecutions where
toJSON :: CountOpenWorkflowExecutions -> Value
toJSON CountOpenWorkflowExecutions' {Maybe TagFilter
Maybe WorkflowExecutionFilter
Maybe WorkflowTypeFilter
Text
ExecutionTimeFilter
startTimeFilter :: ExecutionTimeFilter
domain :: Text
typeFilter :: Maybe WorkflowTypeFilter
tagFilter :: Maybe TagFilter
executionFilter :: Maybe WorkflowExecutionFilter
$sel:startTimeFilter:CountOpenWorkflowExecutions' :: CountOpenWorkflowExecutions -> ExecutionTimeFilter
$sel:domain:CountOpenWorkflowExecutions' :: CountOpenWorkflowExecutions -> Text
$sel:typeFilter:CountOpenWorkflowExecutions' :: CountOpenWorkflowExecutions -> Maybe WorkflowTypeFilter
$sel:tagFilter:CountOpenWorkflowExecutions' :: CountOpenWorkflowExecutions -> Maybe TagFilter
$sel:executionFilter:CountOpenWorkflowExecutions' :: CountOpenWorkflowExecutions -> Maybe WorkflowExecutionFilter
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"executionFilter" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe WorkflowExecutionFilter
executionFilter,
(Key
"tagFilter" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe TagFilter
tagFilter,
(Key
"typeFilter" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe WorkflowTypeFilter
typeFilter,
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
"startTimeFilter" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= ExecutionTimeFilter
startTimeFilter)
]
)
instance Data.ToPath CountOpenWorkflowExecutions where
toPath :: CountOpenWorkflowExecutions -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery CountOpenWorkflowExecutions where
toQuery :: CountOpenWorkflowExecutions -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty