{-# 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.StepFunctions.ListMapRuns
(
ListMapRuns (..),
newListMapRuns,
listMapRuns_maxResults,
listMapRuns_nextToken,
listMapRuns_executionArn,
ListMapRunsResponse (..),
newListMapRunsResponse,
listMapRunsResponse_nextToken,
listMapRunsResponse_httpStatus,
listMapRunsResponse_mapRuns,
)
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.StepFunctions.Types
data ListMapRuns = ListMapRuns'
{
ListMapRuns -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListMapRuns -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListMapRuns -> Text
executionArn :: Prelude.Text
}
deriving (ListMapRuns -> ListMapRuns -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListMapRuns -> ListMapRuns -> Bool
$c/= :: ListMapRuns -> ListMapRuns -> Bool
== :: ListMapRuns -> ListMapRuns -> Bool
$c== :: ListMapRuns -> ListMapRuns -> Bool
Prelude.Eq, ReadPrec [ListMapRuns]
ReadPrec ListMapRuns
Int -> ReadS ListMapRuns
ReadS [ListMapRuns]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListMapRuns]
$creadListPrec :: ReadPrec [ListMapRuns]
readPrec :: ReadPrec ListMapRuns
$creadPrec :: ReadPrec ListMapRuns
readList :: ReadS [ListMapRuns]
$creadList :: ReadS [ListMapRuns]
readsPrec :: Int -> ReadS ListMapRuns
$creadsPrec :: Int -> ReadS ListMapRuns
Prelude.Read, Int -> ListMapRuns -> ShowS
[ListMapRuns] -> ShowS
ListMapRuns -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListMapRuns] -> ShowS
$cshowList :: [ListMapRuns] -> ShowS
show :: ListMapRuns -> String
$cshow :: ListMapRuns -> String
showsPrec :: Int -> ListMapRuns -> ShowS
$cshowsPrec :: Int -> ListMapRuns -> ShowS
Prelude.Show, forall x. Rep ListMapRuns x -> ListMapRuns
forall x. ListMapRuns -> Rep ListMapRuns x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListMapRuns x -> ListMapRuns
$cfrom :: forall x. ListMapRuns -> Rep ListMapRuns x
Prelude.Generic)
newListMapRuns ::
Prelude.Text ->
ListMapRuns
newListMapRuns :: Text -> ListMapRuns
newListMapRuns Text
pExecutionArn_ =
ListMapRuns'
{ $sel:maxResults:ListMapRuns' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListMapRuns' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:executionArn:ListMapRuns' :: Text
executionArn = Text
pExecutionArn_
}
listMapRuns_maxResults :: Lens.Lens' ListMapRuns (Prelude.Maybe Prelude.Natural)
listMapRuns_maxResults :: Lens' ListMapRuns (Maybe Natural)
listMapRuns_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListMapRuns' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListMapRuns' :: ListMapRuns -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListMapRuns
s@ListMapRuns' {} Maybe Natural
a -> ListMapRuns
s {$sel:maxResults:ListMapRuns' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListMapRuns)
listMapRuns_nextToken :: Lens.Lens' ListMapRuns (Prelude.Maybe Prelude.Text)
listMapRuns_nextToken :: Lens' ListMapRuns (Maybe Text)
listMapRuns_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListMapRuns' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListMapRuns' :: ListMapRuns -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListMapRuns
s@ListMapRuns' {} Maybe Text
a -> ListMapRuns
s {$sel:nextToken:ListMapRuns' :: Maybe Text
nextToken = Maybe Text
a} :: ListMapRuns)
listMapRuns_executionArn :: Lens.Lens' ListMapRuns Prelude.Text
listMapRuns_executionArn :: Lens' ListMapRuns Text
listMapRuns_executionArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListMapRuns' {Text
executionArn :: Text
$sel:executionArn:ListMapRuns' :: ListMapRuns -> Text
executionArn} -> Text
executionArn) (\s :: ListMapRuns
s@ListMapRuns' {} Text
a -> ListMapRuns
s {$sel:executionArn:ListMapRuns' :: Text
executionArn = Text
a} :: ListMapRuns)
instance Core.AWSPager ListMapRuns where
page :: ListMapRuns -> AWSResponse ListMapRuns -> Maybe ListMapRuns
page ListMapRuns
rq AWSResponse ListMapRuns
rs
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListMapRuns
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListMapRunsResponse (Maybe Text)
listMapRunsResponse_nextToken
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
forall a. Maybe a
Prelude.Nothing
| forall a. AWSTruncated a => a -> Bool
Core.stop (AWSResponse ListMapRuns
rs forall s a. s -> Getting a s a -> a
Lens.^. Lens' ListMapRunsResponse [MapRunListItem]
listMapRunsResponse_mapRuns) =
forall a. Maybe a
Prelude.Nothing
| Bool
Prelude.otherwise =
forall a. a -> Maybe a
Prelude.Just
forall a b. (a -> b) -> a -> b
Prelude.$ ListMapRuns
rq
forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListMapRuns (Maybe Text)
listMapRuns_nextToken
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListMapRuns
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListMapRunsResponse (Maybe Text)
listMapRunsResponse_nextToken
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
instance Core.AWSRequest ListMapRuns where
type AWSResponse ListMapRuns = ListMapRunsResponse
request :: (Service -> Service) -> ListMapRuns -> Request ListMapRuns
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 ListMapRuns
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListMapRuns)))
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 ->
Maybe Text -> Int -> [MapRunListItem] -> ListMapRunsResponse
ListMapRunsResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"nextToken")
forall (f :: * -> *) a b. Applicative f => 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 (Maybe a)
Data..?> Key
"mapRuns" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable ListMapRuns where
hashWithSalt :: Int -> ListMapRuns -> Int
hashWithSalt Int
_salt ListMapRuns' {Maybe Natural
Maybe Text
Text
executionArn :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:executionArn:ListMapRuns' :: ListMapRuns -> Text
$sel:nextToken:ListMapRuns' :: ListMapRuns -> Maybe Text
$sel:maxResults:ListMapRuns' :: ListMapRuns -> Maybe Natural
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
executionArn
instance Prelude.NFData ListMapRuns where
rnf :: ListMapRuns -> ()
rnf ListMapRuns' {Maybe Natural
Maybe Text
Text
executionArn :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:executionArn:ListMapRuns' :: ListMapRuns -> Text
$sel:nextToken:ListMapRuns' :: ListMapRuns -> Maybe Text
$sel:maxResults:ListMapRuns' :: ListMapRuns -> Maybe Natural
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
executionArn
instance Data.ToHeaders ListMapRuns where
toHeaders :: ListMapRuns -> 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
"AWSStepFunctions.ListMapRuns" ::
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 ListMapRuns where
toJSON :: ListMapRuns -> Value
toJSON ListMapRuns' {Maybe Natural
Maybe Text
Text
executionArn :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:executionArn:ListMapRuns' :: ListMapRuns -> Text
$sel:nextToken:ListMapRuns' :: ListMapRuns -> Maybe Text
$sel:maxResults:ListMapRuns' :: ListMapRuns -> Maybe Natural
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"maxResults" 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 Natural
maxResults,
(Key
"nextToken" 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 Text
nextToken,
forall a. a -> Maybe a
Prelude.Just (Key
"executionArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
executionArn)
]
)
instance Data.ToPath ListMapRuns where
toPath :: ListMapRuns -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery ListMapRuns where
toQuery :: ListMapRuns -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data ListMapRunsResponse = ListMapRunsResponse'
{
ListMapRunsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListMapRunsResponse -> Int
httpStatus :: Prelude.Int,
ListMapRunsResponse -> [MapRunListItem]
mapRuns :: [MapRunListItem]
}
deriving (ListMapRunsResponse -> ListMapRunsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListMapRunsResponse -> ListMapRunsResponse -> Bool
$c/= :: ListMapRunsResponse -> ListMapRunsResponse -> Bool
== :: ListMapRunsResponse -> ListMapRunsResponse -> Bool
$c== :: ListMapRunsResponse -> ListMapRunsResponse -> Bool
Prelude.Eq, ReadPrec [ListMapRunsResponse]
ReadPrec ListMapRunsResponse
Int -> ReadS ListMapRunsResponse
ReadS [ListMapRunsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListMapRunsResponse]
$creadListPrec :: ReadPrec [ListMapRunsResponse]
readPrec :: ReadPrec ListMapRunsResponse
$creadPrec :: ReadPrec ListMapRunsResponse
readList :: ReadS [ListMapRunsResponse]
$creadList :: ReadS [ListMapRunsResponse]
readsPrec :: Int -> ReadS ListMapRunsResponse
$creadsPrec :: Int -> ReadS ListMapRunsResponse
Prelude.Read, Int -> ListMapRunsResponse -> ShowS
[ListMapRunsResponse] -> ShowS
ListMapRunsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListMapRunsResponse] -> ShowS
$cshowList :: [ListMapRunsResponse] -> ShowS
show :: ListMapRunsResponse -> String
$cshow :: ListMapRunsResponse -> String
showsPrec :: Int -> ListMapRunsResponse -> ShowS
$cshowsPrec :: Int -> ListMapRunsResponse -> ShowS
Prelude.Show, forall x. Rep ListMapRunsResponse x -> ListMapRunsResponse
forall x. ListMapRunsResponse -> Rep ListMapRunsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListMapRunsResponse x -> ListMapRunsResponse
$cfrom :: forall x. ListMapRunsResponse -> Rep ListMapRunsResponse x
Prelude.Generic)
newListMapRunsResponse ::
Prelude.Int ->
ListMapRunsResponse
newListMapRunsResponse :: Int -> ListMapRunsResponse
newListMapRunsResponse Int
pHttpStatus_ =
ListMapRunsResponse'
{ $sel:nextToken:ListMapRunsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListMapRunsResponse' :: Int
httpStatus = Int
pHttpStatus_,
$sel:mapRuns:ListMapRunsResponse' :: [MapRunListItem]
mapRuns = forall a. Monoid a => a
Prelude.mempty
}
listMapRunsResponse_nextToken :: Lens.Lens' ListMapRunsResponse (Prelude.Maybe Prelude.Text)
listMapRunsResponse_nextToken :: Lens' ListMapRunsResponse (Maybe Text)
listMapRunsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListMapRunsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListMapRunsResponse' :: ListMapRunsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListMapRunsResponse
s@ListMapRunsResponse' {} Maybe Text
a -> ListMapRunsResponse
s {$sel:nextToken:ListMapRunsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListMapRunsResponse)
listMapRunsResponse_httpStatus :: Lens.Lens' ListMapRunsResponse Prelude.Int
listMapRunsResponse_httpStatus :: Lens' ListMapRunsResponse Int
listMapRunsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListMapRunsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListMapRunsResponse' :: ListMapRunsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListMapRunsResponse
s@ListMapRunsResponse' {} Int
a -> ListMapRunsResponse
s {$sel:httpStatus:ListMapRunsResponse' :: Int
httpStatus = Int
a} :: ListMapRunsResponse)
listMapRunsResponse_mapRuns :: Lens.Lens' ListMapRunsResponse [MapRunListItem]
listMapRunsResponse_mapRuns :: Lens' ListMapRunsResponse [MapRunListItem]
listMapRunsResponse_mapRuns = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListMapRunsResponse' {[MapRunListItem]
mapRuns :: [MapRunListItem]
$sel:mapRuns:ListMapRunsResponse' :: ListMapRunsResponse -> [MapRunListItem]
mapRuns} -> [MapRunListItem]
mapRuns) (\s :: ListMapRunsResponse
s@ListMapRunsResponse' {} [MapRunListItem]
a -> ListMapRunsResponse
s {$sel:mapRuns:ListMapRunsResponse' :: [MapRunListItem]
mapRuns = [MapRunListItem]
a} :: ListMapRunsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Prelude.NFData ListMapRunsResponse where
rnf :: ListMapRunsResponse -> ()
rnf ListMapRunsResponse' {Int
[MapRunListItem]
Maybe Text
mapRuns :: [MapRunListItem]
httpStatus :: Int
nextToken :: Maybe Text
$sel:mapRuns:ListMapRunsResponse' :: ListMapRunsResponse -> [MapRunListItem]
$sel:httpStatus:ListMapRunsResponse' :: ListMapRunsResponse -> Int
$sel:nextToken:ListMapRunsResponse' :: ListMapRunsResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
seq :: forall a b. a -> b -> b
`Prelude.seq` 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 [MapRunListItem]
mapRuns