{-# 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.PollForDecisionTask
(
PollForDecisionTask (..),
newPollForDecisionTask,
pollForDecisionTask_nextPageToken,
pollForDecisionTask_reverseOrder,
pollForDecisionTask_maximumPageSize,
pollForDecisionTask_identity,
pollForDecisionTask_domain,
pollForDecisionTask_taskList,
PollForDecisionTaskResponse (..),
newPollForDecisionTaskResponse,
pollForDecisionTaskResponse_nextPageToken,
pollForDecisionTaskResponse_workflowType,
pollForDecisionTaskResponse_previousStartedEventId,
pollForDecisionTaskResponse_events,
pollForDecisionTaskResponse_taskToken,
pollForDecisionTaskResponse_workflowExecution,
pollForDecisionTaskResponse_httpStatus,
pollForDecisionTaskResponse_startedEventId,
)
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 PollForDecisionTask = PollForDecisionTask'
{
PollForDecisionTask -> Maybe Text
nextPageToken :: Prelude.Maybe Prelude.Text,
PollForDecisionTask -> Maybe Bool
reverseOrder :: Prelude.Maybe Prelude.Bool,
PollForDecisionTask -> Maybe Natural
maximumPageSize :: Prelude.Maybe Prelude.Natural,
PollForDecisionTask -> Maybe Text
identity :: Prelude.Maybe Prelude.Text,
PollForDecisionTask -> Text
domain :: Prelude.Text,
PollForDecisionTask -> TaskList
taskList :: TaskList
}
deriving (PollForDecisionTask -> PollForDecisionTask -> Bool
(PollForDecisionTask -> PollForDecisionTask -> Bool)
-> (PollForDecisionTask -> PollForDecisionTask -> Bool)
-> Eq PollForDecisionTask
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PollForDecisionTask -> PollForDecisionTask -> Bool
$c/= :: PollForDecisionTask -> PollForDecisionTask -> Bool
== :: PollForDecisionTask -> PollForDecisionTask -> Bool
$c== :: PollForDecisionTask -> PollForDecisionTask -> Bool
Prelude.Eq, ReadPrec [PollForDecisionTask]
ReadPrec PollForDecisionTask
Int -> ReadS PollForDecisionTask
ReadS [PollForDecisionTask]
(Int -> ReadS PollForDecisionTask)
-> ReadS [PollForDecisionTask]
-> ReadPrec PollForDecisionTask
-> ReadPrec [PollForDecisionTask]
-> Read PollForDecisionTask
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PollForDecisionTask]
$creadListPrec :: ReadPrec [PollForDecisionTask]
readPrec :: ReadPrec PollForDecisionTask
$creadPrec :: ReadPrec PollForDecisionTask
readList :: ReadS [PollForDecisionTask]
$creadList :: ReadS [PollForDecisionTask]
readsPrec :: Int -> ReadS PollForDecisionTask
$creadsPrec :: Int -> ReadS PollForDecisionTask
Prelude.Read, Int -> PollForDecisionTask -> ShowS
[PollForDecisionTask] -> ShowS
PollForDecisionTask -> String
(Int -> PollForDecisionTask -> ShowS)
-> (PollForDecisionTask -> String)
-> ([PollForDecisionTask] -> ShowS)
-> Show PollForDecisionTask
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PollForDecisionTask] -> ShowS
$cshowList :: [PollForDecisionTask] -> ShowS
show :: PollForDecisionTask -> String
$cshow :: PollForDecisionTask -> String
showsPrec :: Int -> PollForDecisionTask -> ShowS
$cshowsPrec :: Int -> PollForDecisionTask -> ShowS
Prelude.Show, (forall x. PollForDecisionTask -> Rep PollForDecisionTask x)
-> (forall x. Rep PollForDecisionTask x -> PollForDecisionTask)
-> Generic PollForDecisionTask
forall x. Rep PollForDecisionTask x -> PollForDecisionTask
forall x. PollForDecisionTask -> Rep PollForDecisionTask x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PollForDecisionTask x -> PollForDecisionTask
$cfrom :: forall x. PollForDecisionTask -> Rep PollForDecisionTask x
Prelude.Generic)
newPollForDecisionTask ::
Prelude.Text ->
TaskList ->
PollForDecisionTask
newPollForDecisionTask :: Text -> TaskList -> PollForDecisionTask
newPollForDecisionTask Text
pDomain_ TaskList
pTaskList_ =
PollForDecisionTask' :: Maybe Text
-> Maybe Bool
-> Maybe Natural
-> Maybe Text
-> Text
-> TaskList
-> PollForDecisionTask
PollForDecisionTask'
{ $sel:nextPageToken:PollForDecisionTask' :: Maybe Text
nextPageToken =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:reverseOrder:PollForDecisionTask' :: Maybe Bool
reverseOrder = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:maximumPageSize:PollForDecisionTask' :: Maybe Natural
maximumPageSize = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:identity:PollForDecisionTask' :: Maybe Text
identity = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:domain:PollForDecisionTask' :: Text
domain = Text
pDomain_,
$sel:taskList:PollForDecisionTask' :: TaskList
taskList = TaskList
pTaskList_
}
pollForDecisionTask_nextPageToken :: Lens.Lens' PollForDecisionTask (Prelude.Maybe Prelude.Text)
pollForDecisionTask_nextPageToken :: (Maybe Text -> f (Maybe Text))
-> PollForDecisionTask -> f PollForDecisionTask
pollForDecisionTask_nextPageToken = (PollForDecisionTask -> Maybe Text)
-> (PollForDecisionTask -> Maybe Text -> PollForDecisionTask)
-> Lens
PollForDecisionTask PollForDecisionTask (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PollForDecisionTask' {Maybe Text
nextPageToken :: Maybe Text
$sel:nextPageToken:PollForDecisionTask' :: PollForDecisionTask -> Maybe Text
nextPageToken} -> Maybe Text
nextPageToken) (\s :: PollForDecisionTask
s@PollForDecisionTask' {} Maybe Text
a -> PollForDecisionTask
s {$sel:nextPageToken:PollForDecisionTask' :: Maybe Text
nextPageToken = Maybe Text
a} :: PollForDecisionTask)
pollForDecisionTask_reverseOrder :: Lens.Lens' PollForDecisionTask (Prelude.Maybe Prelude.Bool)
pollForDecisionTask_reverseOrder :: (Maybe Bool -> f (Maybe Bool))
-> PollForDecisionTask -> f PollForDecisionTask
pollForDecisionTask_reverseOrder = (PollForDecisionTask -> Maybe Bool)
-> (PollForDecisionTask -> Maybe Bool -> PollForDecisionTask)
-> Lens
PollForDecisionTask PollForDecisionTask (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PollForDecisionTask' {Maybe Bool
reverseOrder :: Maybe Bool
$sel:reverseOrder:PollForDecisionTask' :: PollForDecisionTask -> Maybe Bool
reverseOrder} -> Maybe Bool
reverseOrder) (\s :: PollForDecisionTask
s@PollForDecisionTask' {} Maybe Bool
a -> PollForDecisionTask
s {$sel:reverseOrder:PollForDecisionTask' :: Maybe Bool
reverseOrder = Maybe Bool
a} :: PollForDecisionTask)
pollForDecisionTask_maximumPageSize :: Lens.Lens' PollForDecisionTask (Prelude.Maybe Prelude.Natural)
pollForDecisionTask_maximumPageSize :: (Maybe Natural -> f (Maybe Natural))
-> PollForDecisionTask -> f PollForDecisionTask
pollForDecisionTask_maximumPageSize = (PollForDecisionTask -> Maybe Natural)
-> (PollForDecisionTask -> Maybe Natural -> PollForDecisionTask)
-> Lens
PollForDecisionTask
PollForDecisionTask
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PollForDecisionTask' {Maybe Natural
maximumPageSize :: Maybe Natural
$sel:maximumPageSize:PollForDecisionTask' :: PollForDecisionTask -> Maybe Natural
maximumPageSize} -> Maybe Natural
maximumPageSize) (\s :: PollForDecisionTask
s@PollForDecisionTask' {} Maybe Natural
a -> PollForDecisionTask
s {$sel:maximumPageSize:PollForDecisionTask' :: Maybe Natural
maximumPageSize = Maybe Natural
a} :: PollForDecisionTask)
pollForDecisionTask_identity :: Lens.Lens' PollForDecisionTask (Prelude.Maybe Prelude.Text)
pollForDecisionTask_identity :: (Maybe Text -> f (Maybe Text))
-> PollForDecisionTask -> f PollForDecisionTask
pollForDecisionTask_identity = (PollForDecisionTask -> Maybe Text)
-> (PollForDecisionTask -> Maybe Text -> PollForDecisionTask)
-> Lens
PollForDecisionTask PollForDecisionTask (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PollForDecisionTask' {Maybe Text
identity :: Maybe Text
$sel:identity:PollForDecisionTask' :: PollForDecisionTask -> Maybe Text
identity} -> Maybe Text
identity) (\s :: PollForDecisionTask
s@PollForDecisionTask' {} Maybe Text
a -> PollForDecisionTask
s {$sel:identity:PollForDecisionTask' :: Maybe Text
identity = Maybe Text
a} :: PollForDecisionTask)
pollForDecisionTask_domain :: Lens.Lens' PollForDecisionTask Prelude.Text
pollForDecisionTask_domain :: (Text -> f Text) -> PollForDecisionTask -> f PollForDecisionTask
pollForDecisionTask_domain = (PollForDecisionTask -> Text)
-> (PollForDecisionTask -> Text -> PollForDecisionTask)
-> Lens PollForDecisionTask PollForDecisionTask Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PollForDecisionTask' {Text
domain :: Text
$sel:domain:PollForDecisionTask' :: PollForDecisionTask -> Text
domain} -> Text
domain) (\s :: PollForDecisionTask
s@PollForDecisionTask' {} Text
a -> PollForDecisionTask
s {$sel:domain:PollForDecisionTask' :: Text
domain = Text
a} :: PollForDecisionTask)
pollForDecisionTask_taskList :: Lens.Lens' PollForDecisionTask TaskList
pollForDecisionTask_taskList :: (TaskList -> f TaskList)
-> PollForDecisionTask -> f PollForDecisionTask
pollForDecisionTask_taskList = (PollForDecisionTask -> TaskList)
-> (PollForDecisionTask -> TaskList -> PollForDecisionTask)
-> Lens PollForDecisionTask PollForDecisionTask TaskList TaskList
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PollForDecisionTask' {TaskList
taskList :: TaskList
$sel:taskList:PollForDecisionTask' :: PollForDecisionTask -> TaskList
taskList} -> TaskList
taskList) (\s :: PollForDecisionTask
s@PollForDecisionTask' {} TaskList
a -> PollForDecisionTask
s {$sel:taskList:PollForDecisionTask' :: TaskList
taskList = TaskList
a} :: PollForDecisionTask)
instance Core.AWSPager PollForDecisionTask where
page :: PollForDecisionTask
-> AWSResponse PollForDecisionTask -> Maybe PollForDecisionTask
page PollForDecisionTask
rq AWSResponse PollForDecisionTask
rs
| Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse PollForDecisionTask
PollForDecisionTaskResponse
rs
PollForDecisionTaskResponse
-> Getting (First Text) PollForDecisionTaskResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> PollForDecisionTaskResponse
-> Const (First Text) PollForDecisionTaskResponse
Lens' PollForDecisionTaskResponse (Maybe Text)
pollForDecisionTaskResponse_nextPageToken
((Maybe Text -> Const (First Text) (Maybe Text))
-> PollForDecisionTaskResponse
-> Const (First Text) PollForDecisionTaskResponse)
-> ((Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) PollForDecisionTaskResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
Maybe PollForDecisionTask
forall a. Maybe a
Prelude.Nothing
| Maybe [HistoryEvent] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse PollForDecisionTask
PollForDecisionTaskResponse
rs
PollForDecisionTaskResponse
-> Getting
(First [HistoryEvent]) PollForDecisionTaskResponse [HistoryEvent]
-> Maybe [HistoryEvent]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [HistoryEvent]
-> Const (First [HistoryEvent]) (Maybe [HistoryEvent]))
-> PollForDecisionTaskResponse
-> Const (First [HistoryEvent]) PollForDecisionTaskResponse
Lens' PollForDecisionTaskResponse (Maybe [HistoryEvent])
pollForDecisionTaskResponse_events
((Maybe [HistoryEvent]
-> Const (First [HistoryEvent]) (Maybe [HistoryEvent]))
-> PollForDecisionTaskResponse
-> Const (First [HistoryEvent]) PollForDecisionTaskResponse)
-> (([HistoryEvent] -> Const (First [HistoryEvent]) [HistoryEvent])
-> Maybe [HistoryEvent]
-> Const (First [HistoryEvent]) (Maybe [HistoryEvent]))
-> Getting
(First [HistoryEvent]) PollForDecisionTaskResponse [HistoryEvent]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([HistoryEvent] -> Const (First [HistoryEvent]) [HistoryEvent])
-> Maybe [HistoryEvent]
-> Const (First [HistoryEvent]) (Maybe [HistoryEvent])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
Maybe PollForDecisionTask
forall a. Maybe a
Prelude.Nothing
| Bool
Prelude.otherwise =
PollForDecisionTask -> Maybe PollForDecisionTask
forall a. a -> Maybe a
Prelude.Just (PollForDecisionTask -> Maybe PollForDecisionTask)
-> PollForDecisionTask -> Maybe PollForDecisionTask
forall a b. (a -> b) -> a -> b
Prelude.$
PollForDecisionTask
rq
PollForDecisionTask
-> (PollForDecisionTask -> PollForDecisionTask)
-> PollForDecisionTask
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> PollForDecisionTask -> Identity PollForDecisionTask
Lens
PollForDecisionTask PollForDecisionTask (Maybe Text) (Maybe Text)
pollForDecisionTask_nextPageToken
((Maybe Text -> Identity (Maybe Text))
-> PollForDecisionTask -> Identity PollForDecisionTask)
-> Maybe Text -> PollForDecisionTask -> PollForDecisionTask
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse PollForDecisionTask
PollForDecisionTaskResponse
rs
PollForDecisionTaskResponse
-> Getting (First Text) PollForDecisionTaskResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> PollForDecisionTaskResponse
-> Const (First Text) PollForDecisionTaskResponse
Lens' PollForDecisionTaskResponse (Maybe Text)
pollForDecisionTaskResponse_nextPageToken
((Maybe Text -> Const (First Text) (Maybe Text))
-> PollForDecisionTaskResponse
-> Const (First Text) PollForDecisionTaskResponse)
-> ((Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) PollForDecisionTaskResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
instance Core.AWSRequest PollForDecisionTask where
type
AWSResponse PollForDecisionTask =
PollForDecisionTaskResponse
request :: PollForDecisionTask -> Request PollForDecisionTask
request = Service -> PollForDecisionTask -> Request PollForDecisionTask
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy PollForDecisionTask
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse PollForDecisionTask)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse PollForDecisionTask))
-> Logger
-> Service
-> Proxy PollForDecisionTask
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse PollForDecisionTask)))
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 ->
Maybe Text
-> Maybe WorkflowType
-> Maybe Integer
-> Maybe [HistoryEvent]
-> Maybe Text
-> Maybe WorkflowExecution
-> Int
-> Integer
-> PollForDecisionTaskResponse
PollForDecisionTaskResponse'
(Maybe Text
-> Maybe WorkflowType
-> Maybe Integer
-> Maybe [HistoryEvent]
-> Maybe Text
-> Maybe WorkflowExecution
-> Int
-> Integer
-> PollForDecisionTaskResponse)
-> Either String (Maybe Text)
-> Either
String
(Maybe WorkflowType
-> Maybe Integer
-> Maybe [HistoryEvent]
-> Maybe Text
-> Maybe WorkflowExecution
-> Int
-> Integer
-> PollForDecisionTaskResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"nextPageToken")
Either
String
(Maybe WorkflowType
-> Maybe Integer
-> Maybe [HistoryEvent]
-> Maybe Text
-> Maybe WorkflowExecution
-> Int
-> Integer
-> PollForDecisionTaskResponse)
-> Either String (Maybe WorkflowType)
-> Either
String
(Maybe Integer
-> Maybe [HistoryEvent]
-> Maybe Text
-> Maybe WorkflowExecution
-> Int
-> Integer
-> PollForDecisionTaskResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe WorkflowType)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"workflowType")
Either
String
(Maybe Integer
-> Maybe [HistoryEvent]
-> Maybe Text
-> Maybe WorkflowExecution
-> Int
-> Integer
-> PollForDecisionTaskResponse)
-> Either String (Maybe Integer)
-> Either
String
(Maybe [HistoryEvent]
-> Maybe Text
-> Maybe WorkflowExecution
-> Int
-> Integer
-> PollForDecisionTaskResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"previousStartedEventId")
Either
String
(Maybe [HistoryEvent]
-> Maybe Text
-> Maybe WorkflowExecution
-> Int
-> Integer
-> PollForDecisionTaskResponse)
-> Either String (Maybe [HistoryEvent])
-> Either
String
(Maybe Text
-> Maybe WorkflowExecution
-> Int
-> Integer
-> PollForDecisionTaskResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [HistoryEvent]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"events" Either String (Maybe (Maybe [HistoryEvent]))
-> Maybe [HistoryEvent] -> Either String (Maybe [HistoryEvent])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [HistoryEvent]
forall a. Monoid a => a
Prelude.mempty)
Either
String
(Maybe Text
-> Maybe WorkflowExecution
-> Int
-> Integer
-> PollForDecisionTaskResponse)
-> Either String (Maybe Text)
-> Either
String
(Maybe WorkflowExecution
-> Int -> Integer -> PollForDecisionTaskResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"taskToken")
Either
String
(Maybe WorkflowExecution
-> Int -> Integer -> PollForDecisionTaskResponse)
-> Either String (Maybe WorkflowExecution)
-> Either String (Int -> Integer -> PollForDecisionTaskResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe WorkflowExecution)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"workflowExecution")
Either String (Int -> Integer -> PollForDecisionTaskResponse)
-> Either String Int
-> Either String (Integer -> PollForDecisionTaskResponse)
forall (f :: * -> *) a b. Applicative f => 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 (Integer -> PollForDecisionTaskResponse)
-> Either String Integer
-> Either String PollForDecisionTaskResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Integer
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"startedEventId")
)
instance Prelude.Hashable PollForDecisionTask
instance Prelude.NFData PollForDecisionTask
instance Core.ToHeaders PollForDecisionTask where
toHeaders :: PollForDecisionTask -> ResponseHeaders
toHeaders =
ResponseHeaders -> PollForDecisionTask -> 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.PollForDecisionTask" ::
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 PollForDecisionTask where
toJSON :: PollForDecisionTask -> Value
toJSON PollForDecisionTask' {Maybe Bool
Maybe Natural
Maybe Text
Text
TaskList
taskList :: TaskList
domain :: Text
identity :: Maybe Text
maximumPageSize :: Maybe Natural
reverseOrder :: Maybe Bool
nextPageToken :: Maybe Text
$sel:taskList:PollForDecisionTask' :: PollForDecisionTask -> TaskList
$sel:domain:PollForDecisionTask' :: PollForDecisionTask -> Text
$sel:identity:PollForDecisionTask' :: PollForDecisionTask -> Maybe Text
$sel:maximumPageSize:PollForDecisionTask' :: PollForDecisionTask -> Maybe Natural
$sel:reverseOrder:PollForDecisionTask' :: PollForDecisionTask -> Maybe Bool
$sel:nextPageToken:PollForDecisionTask' :: PollForDecisionTask -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"nextPageToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextPageToken,
(Text
"reverseOrder" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
reverseOrder,
(Text
"maximumPageSize" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maximumPageSize,
(Text
"identity" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
identity,
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 PollForDecisionTask where
toPath :: PollForDecisionTask -> ByteString
toPath = ByteString -> PollForDecisionTask -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery PollForDecisionTask where
toQuery :: PollForDecisionTask -> QueryString
toQuery = QueryString -> PollForDecisionTask -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data PollForDecisionTaskResponse = PollForDecisionTaskResponse'
{
PollForDecisionTaskResponse -> Maybe Text
nextPageToken :: Prelude.Maybe Prelude.Text,
PollForDecisionTaskResponse -> Maybe WorkflowType
workflowType :: Prelude.Maybe WorkflowType,
PollForDecisionTaskResponse -> Maybe Integer
previousStartedEventId :: Prelude.Maybe Prelude.Integer,
PollForDecisionTaskResponse -> Maybe [HistoryEvent]
events :: Prelude.Maybe [HistoryEvent],
PollForDecisionTaskResponse -> Maybe Text
taskToken :: Prelude.Maybe Prelude.Text,
PollForDecisionTaskResponse -> Maybe WorkflowExecution
workflowExecution :: Prelude.Maybe WorkflowExecution,
PollForDecisionTaskResponse -> Int
httpStatus :: Prelude.Int,
PollForDecisionTaskResponse -> Integer
startedEventId :: Prelude.Integer
}
deriving (PollForDecisionTaskResponse -> PollForDecisionTaskResponse -> Bool
(PollForDecisionTaskResponse
-> PollForDecisionTaskResponse -> Bool)
-> (PollForDecisionTaskResponse
-> PollForDecisionTaskResponse -> Bool)
-> Eq PollForDecisionTaskResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PollForDecisionTaskResponse -> PollForDecisionTaskResponse -> Bool
$c/= :: PollForDecisionTaskResponse -> PollForDecisionTaskResponse -> Bool
== :: PollForDecisionTaskResponse -> PollForDecisionTaskResponse -> Bool
$c== :: PollForDecisionTaskResponse -> PollForDecisionTaskResponse -> Bool
Prelude.Eq, ReadPrec [PollForDecisionTaskResponse]
ReadPrec PollForDecisionTaskResponse
Int -> ReadS PollForDecisionTaskResponse
ReadS [PollForDecisionTaskResponse]
(Int -> ReadS PollForDecisionTaskResponse)
-> ReadS [PollForDecisionTaskResponse]
-> ReadPrec PollForDecisionTaskResponse
-> ReadPrec [PollForDecisionTaskResponse]
-> Read PollForDecisionTaskResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PollForDecisionTaskResponse]
$creadListPrec :: ReadPrec [PollForDecisionTaskResponse]
readPrec :: ReadPrec PollForDecisionTaskResponse
$creadPrec :: ReadPrec PollForDecisionTaskResponse
readList :: ReadS [PollForDecisionTaskResponse]
$creadList :: ReadS [PollForDecisionTaskResponse]
readsPrec :: Int -> ReadS PollForDecisionTaskResponse
$creadsPrec :: Int -> ReadS PollForDecisionTaskResponse
Prelude.Read, Int -> PollForDecisionTaskResponse -> ShowS
[PollForDecisionTaskResponse] -> ShowS
PollForDecisionTaskResponse -> String
(Int -> PollForDecisionTaskResponse -> ShowS)
-> (PollForDecisionTaskResponse -> String)
-> ([PollForDecisionTaskResponse] -> ShowS)
-> Show PollForDecisionTaskResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PollForDecisionTaskResponse] -> ShowS
$cshowList :: [PollForDecisionTaskResponse] -> ShowS
show :: PollForDecisionTaskResponse -> String
$cshow :: PollForDecisionTaskResponse -> String
showsPrec :: Int -> PollForDecisionTaskResponse -> ShowS
$cshowsPrec :: Int -> PollForDecisionTaskResponse -> ShowS
Prelude.Show, (forall x.
PollForDecisionTaskResponse -> Rep PollForDecisionTaskResponse x)
-> (forall x.
Rep PollForDecisionTaskResponse x -> PollForDecisionTaskResponse)
-> Generic PollForDecisionTaskResponse
forall x.
Rep PollForDecisionTaskResponse x -> PollForDecisionTaskResponse
forall x.
PollForDecisionTaskResponse -> Rep PollForDecisionTaskResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PollForDecisionTaskResponse x -> PollForDecisionTaskResponse
$cfrom :: forall x.
PollForDecisionTaskResponse -> Rep PollForDecisionTaskResponse x
Prelude.Generic)
newPollForDecisionTaskResponse ::
Prelude.Int ->
Prelude.Integer ->
PollForDecisionTaskResponse
newPollForDecisionTaskResponse :: Int -> Integer -> PollForDecisionTaskResponse
newPollForDecisionTaskResponse
Int
pHttpStatus_
Integer
pStartedEventId_ =
PollForDecisionTaskResponse' :: Maybe Text
-> Maybe WorkflowType
-> Maybe Integer
-> Maybe [HistoryEvent]
-> Maybe Text
-> Maybe WorkflowExecution
-> Int
-> Integer
-> PollForDecisionTaskResponse
PollForDecisionTaskResponse'
{ $sel:nextPageToken:PollForDecisionTaskResponse' :: Maybe Text
nextPageToken =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:workflowType:PollForDecisionTaskResponse' :: Maybe WorkflowType
workflowType = Maybe WorkflowType
forall a. Maybe a
Prelude.Nothing,
$sel:previousStartedEventId:PollForDecisionTaskResponse' :: Maybe Integer
previousStartedEventId = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
$sel:events:PollForDecisionTaskResponse' :: Maybe [HistoryEvent]
events = Maybe [HistoryEvent]
forall a. Maybe a
Prelude.Nothing,
$sel:taskToken:PollForDecisionTaskResponse' :: Maybe Text
taskToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:workflowExecution:PollForDecisionTaskResponse' :: Maybe WorkflowExecution
workflowExecution = Maybe WorkflowExecution
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:PollForDecisionTaskResponse' :: Int
httpStatus = Int
pHttpStatus_,
$sel:startedEventId:PollForDecisionTaskResponse' :: Integer
startedEventId = Integer
pStartedEventId_
}
pollForDecisionTaskResponse_nextPageToken :: Lens.Lens' PollForDecisionTaskResponse (Prelude.Maybe Prelude.Text)
pollForDecisionTaskResponse_nextPageToken :: (Maybe Text -> f (Maybe Text))
-> PollForDecisionTaskResponse -> f PollForDecisionTaskResponse
pollForDecisionTaskResponse_nextPageToken = (PollForDecisionTaskResponse -> Maybe Text)
-> (PollForDecisionTaskResponse
-> Maybe Text -> PollForDecisionTaskResponse)
-> Lens' PollForDecisionTaskResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PollForDecisionTaskResponse' {Maybe Text
nextPageToken :: Maybe Text
$sel:nextPageToken:PollForDecisionTaskResponse' :: PollForDecisionTaskResponse -> Maybe Text
nextPageToken} -> Maybe Text
nextPageToken) (\s :: PollForDecisionTaskResponse
s@PollForDecisionTaskResponse' {} Maybe Text
a -> PollForDecisionTaskResponse
s {$sel:nextPageToken:PollForDecisionTaskResponse' :: Maybe Text
nextPageToken = Maybe Text
a} :: PollForDecisionTaskResponse)
pollForDecisionTaskResponse_workflowType :: Lens.Lens' PollForDecisionTaskResponse (Prelude.Maybe WorkflowType)
pollForDecisionTaskResponse_workflowType :: (Maybe WorkflowType -> f (Maybe WorkflowType))
-> PollForDecisionTaskResponse -> f PollForDecisionTaskResponse
pollForDecisionTaskResponse_workflowType = (PollForDecisionTaskResponse -> Maybe WorkflowType)
-> (PollForDecisionTaskResponse
-> Maybe WorkflowType -> PollForDecisionTaskResponse)
-> Lens
PollForDecisionTaskResponse
PollForDecisionTaskResponse
(Maybe WorkflowType)
(Maybe WorkflowType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PollForDecisionTaskResponse' {Maybe WorkflowType
workflowType :: Maybe WorkflowType
$sel:workflowType:PollForDecisionTaskResponse' :: PollForDecisionTaskResponse -> Maybe WorkflowType
workflowType} -> Maybe WorkflowType
workflowType) (\s :: PollForDecisionTaskResponse
s@PollForDecisionTaskResponse' {} Maybe WorkflowType
a -> PollForDecisionTaskResponse
s {$sel:workflowType:PollForDecisionTaskResponse' :: Maybe WorkflowType
workflowType = Maybe WorkflowType
a} :: PollForDecisionTaskResponse)
pollForDecisionTaskResponse_previousStartedEventId :: Lens.Lens' PollForDecisionTaskResponse (Prelude.Maybe Prelude.Integer)
pollForDecisionTaskResponse_previousStartedEventId :: (Maybe Integer -> f (Maybe Integer))
-> PollForDecisionTaskResponse -> f PollForDecisionTaskResponse
pollForDecisionTaskResponse_previousStartedEventId = (PollForDecisionTaskResponse -> Maybe Integer)
-> (PollForDecisionTaskResponse
-> Maybe Integer -> PollForDecisionTaskResponse)
-> Lens
PollForDecisionTaskResponse
PollForDecisionTaskResponse
(Maybe Integer)
(Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PollForDecisionTaskResponse' {Maybe Integer
previousStartedEventId :: Maybe Integer
$sel:previousStartedEventId:PollForDecisionTaskResponse' :: PollForDecisionTaskResponse -> Maybe Integer
previousStartedEventId} -> Maybe Integer
previousStartedEventId) (\s :: PollForDecisionTaskResponse
s@PollForDecisionTaskResponse' {} Maybe Integer
a -> PollForDecisionTaskResponse
s {$sel:previousStartedEventId:PollForDecisionTaskResponse' :: Maybe Integer
previousStartedEventId = Maybe Integer
a} :: PollForDecisionTaskResponse)
pollForDecisionTaskResponse_events :: Lens.Lens' PollForDecisionTaskResponse (Prelude.Maybe [HistoryEvent])
pollForDecisionTaskResponse_events :: (Maybe [HistoryEvent] -> f (Maybe [HistoryEvent]))
-> PollForDecisionTaskResponse -> f PollForDecisionTaskResponse
pollForDecisionTaskResponse_events = (PollForDecisionTaskResponse -> Maybe [HistoryEvent])
-> (PollForDecisionTaskResponse
-> Maybe [HistoryEvent] -> PollForDecisionTaskResponse)
-> Lens' PollForDecisionTaskResponse (Maybe [HistoryEvent])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PollForDecisionTaskResponse' {Maybe [HistoryEvent]
events :: Maybe [HistoryEvent]
$sel:events:PollForDecisionTaskResponse' :: PollForDecisionTaskResponse -> Maybe [HistoryEvent]
events} -> Maybe [HistoryEvent]
events) (\s :: PollForDecisionTaskResponse
s@PollForDecisionTaskResponse' {} Maybe [HistoryEvent]
a -> PollForDecisionTaskResponse
s {$sel:events:PollForDecisionTaskResponse' :: Maybe [HistoryEvent]
events = Maybe [HistoryEvent]
a} :: PollForDecisionTaskResponse) ((Maybe [HistoryEvent] -> f (Maybe [HistoryEvent]))
-> PollForDecisionTaskResponse -> f PollForDecisionTaskResponse)
-> ((Maybe [HistoryEvent] -> f (Maybe [HistoryEvent]))
-> Maybe [HistoryEvent] -> f (Maybe [HistoryEvent]))
-> (Maybe [HistoryEvent] -> f (Maybe [HistoryEvent]))
-> PollForDecisionTaskResponse
-> f PollForDecisionTaskResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [HistoryEvent] [HistoryEvent] [HistoryEvent] [HistoryEvent]
-> Iso
(Maybe [HistoryEvent])
(Maybe [HistoryEvent])
(Maybe [HistoryEvent])
(Maybe [HistoryEvent])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [HistoryEvent] [HistoryEvent] [HistoryEvent] [HistoryEvent]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
pollForDecisionTaskResponse_taskToken :: Lens.Lens' PollForDecisionTaskResponse (Prelude.Maybe Prelude.Text)
pollForDecisionTaskResponse_taskToken :: (Maybe Text -> f (Maybe Text))
-> PollForDecisionTaskResponse -> f PollForDecisionTaskResponse
pollForDecisionTaskResponse_taskToken = (PollForDecisionTaskResponse -> Maybe Text)
-> (PollForDecisionTaskResponse
-> Maybe Text -> PollForDecisionTaskResponse)
-> Lens' PollForDecisionTaskResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PollForDecisionTaskResponse' {Maybe Text
taskToken :: Maybe Text
$sel:taskToken:PollForDecisionTaskResponse' :: PollForDecisionTaskResponse -> Maybe Text
taskToken} -> Maybe Text
taskToken) (\s :: PollForDecisionTaskResponse
s@PollForDecisionTaskResponse' {} Maybe Text
a -> PollForDecisionTaskResponse
s {$sel:taskToken:PollForDecisionTaskResponse' :: Maybe Text
taskToken = Maybe Text
a} :: PollForDecisionTaskResponse)
pollForDecisionTaskResponse_workflowExecution :: Lens.Lens' PollForDecisionTaskResponse (Prelude.Maybe WorkflowExecution)
pollForDecisionTaskResponse_workflowExecution :: (Maybe WorkflowExecution -> f (Maybe WorkflowExecution))
-> PollForDecisionTaskResponse -> f PollForDecisionTaskResponse
pollForDecisionTaskResponse_workflowExecution = (PollForDecisionTaskResponse -> Maybe WorkflowExecution)
-> (PollForDecisionTaskResponse
-> Maybe WorkflowExecution -> PollForDecisionTaskResponse)
-> Lens
PollForDecisionTaskResponse
PollForDecisionTaskResponse
(Maybe WorkflowExecution)
(Maybe WorkflowExecution)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PollForDecisionTaskResponse' {Maybe WorkflowExecution
workflowExecution :: Maybe WorkflowExecution
$sel:workflowExecution:PollForDecisionTaskResponse' :: PollForDecisionTaskResponse -> Maybe WorkflowExecution
workflowExecution} -> Maybe WorkflowExecution
workflowExecution) (\s :: PollForDecisionTaskResponse
s@PollForDecisionTaskResponse' {} Maybe WorkflowExecution
a -> PollForDecisionTaskResponse
s {$sel:workflowExecution:PollForDecisionTaskResponse' :: Maybe WorkflowExecution
workflowExecution = Maybe WorkflowExecution
a} :: PollForDecisionTaskResponse)
pollForDecisionTaskResponse_httpStatus :: Lens.Lens' PollForDecisionTaskResponse Prelude.Int
pollForDecisionTaskResponse_httpStatus :: (Int -> f Int)
-> PollForDecisionTaskResponse -> f PollForDecisionTaskResponse
pollForDecisionTaskResponse_httpStatus = (PollForDecisionTaskResponse -> Int)
-> (PollForDecisionTaskResponse
-> Int -> PollForDecisionTaskResponse)
-> Lens
PollForDecisionTaskResponse PollForDecisionTaskResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PollForDecisionTaskResponse' {Int
httpStatus :: Int
$sel:httpStatus:PollForDecisionTaskResponse' :: PollForDecisionTaskResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: PollForDecisionTaskResponse
s@PollForDecisionTaskResponse' {} Int
a -> PollForDecisionTaskResponse
s {$sel:httpStatus:PollForDecisionTaskResponse' :: Int
httpStatus = Int
a} :: PollForDecisionTaskResponse)
pollForDecisionTaskResponse_startedEventId :: Lens.Lens' PollForDecisionTaskResponse Prelude.Integer
pollForDecisionTaskResponse_startedEventId :: (Integer -> f Integer)
-> PollForDecisionTaskResponse -> f PollForDecisionTaskResponse
pollForDecisionTaskResponse_startedEventId = (PollForDecisionTaskResponse -> Integer)
-> (PollForDecisionTaskResponse
-> Integer -> PollForDecisionTaskResponse)
-> Lens
PollForDecisionTaskResponse
PollForDecisionTaskResponse
Integer
Integer
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PollForDecisionTaskResponse' {Integer
startedEventId :: Integer
$sel:startedEventId:PollForDecisionTaskResponse' :: PollForDecisionTaskResponse -> Integer
startedEventId} -> Integer
startedEventId) (\s :: PollForDecisionTaskResponse
s@PollForDecisionTaskResponse' {} Integer
a -> PollForDecisionTaskResponse
s {$sel:startedEventId:PollForDecisionTaskResponse' :: Integer
startedEventId = Integer
a} :: PollForDecisionTaskResponse)
instance Prelude.NFData PollForDecisionTaskResponse