{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.StepFunctions.ListExecutions
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Lists the executions of a state machine that meet the filtering
-- criteria. Results are sorted by time, with the most recent execution
-- first.
--
-- If @nextToken@ is returned, there are more results available. The value
-- of @nextToken@ is a unique pagination token for each page. Make the call
-- again using the returned token to retrieve the next page. Keep all other
-- arguments unchanged. Each pagination token expires after 24 hours. Using
-- an expired pagination token will return an /HTTP 400 InvalidToken/
-- error.
--
-- This operation is eventually consistent. The results are best effort and
-- may not reflect very recent updates and changes.
--
-- This API action is not supported by @EXPRESS@ state machines.
--
-- This operation returns paginated results.
module Amazonka.StepFunctions.ListExecutions
  ( -- * Creating a Request
    ListExecutions (..),
    newListExecutions,

    -- * Request Lenses
    listExecutions_statusFilter,
    listExecutions_nextToken,
    listExecutions_maxResults,
    listExecutions_stateMachineArn,

    -- * Destructuring the Response
    ListExecutionsResponse (..),
    newListExecutionsResponse,

    -- * Response Lenses
    listExecutionsResponse_nextToken,
    listExecutionsResponse_httpStatus,
    listExecutionsResponse_executions,
  )
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.StepFunctions.Types

-- | /See:/ 'newListExecutions' smart constructor.
data ListExecutions = ListExecutions'
  { -- | If specified, only list the executions whose current execution status
    -- matches the given filter.
    ListExecutions -> Maybe ExecutionStatus
statusFilter :: Prelude.Maybe ExecutionStatus,
    -- | If @nextToken@ is returned, there are more results available. The value
    -- of @nextToken@ is a unique pagination token for each page. Make the call
    -- again using the returned token to retrieve the next page. Keep all other
    -- arguments unchanged. Each pagination token expires after 24 hours. Using
    -- an expired pagination token will return an /HTTP 400 InvalidToken/
    -- error.
    ListExecutions -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results that are returned per call. You can use
    -- @nextToken@ to obtain further pages of results. The default is 100 and
    -- the maximum allowed page size is 1000. A value of 0 uses the default.
    --
    -- This is only an upper limit. The actual number of results returned per
    -- call might be fewer than the specified maximum.
    ListExecutions -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The Amazon Resource Name (ARN) of the state machine whose executions is
    -- listed.
    ListExecutions -> Text
stateMachineArn :: Prelude.Text
  }
  deriving (ListExecutions -> ListExecutions -> Bool
(ListExecutions -> ListExecutions -> Bool)
-> (ListExecutions -> ListExecutions -> Bool) -> Eq ListExecutions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListExecutions -> ListExecutions -> Bool
$c/= :: ListExecutions -> ListExecutions -> Bool
== :: ListExecutions -> ListExecutions -> Bool
$c== :: ListExecutions -> ListExecutions -> Bool
Prelude.Eq, ReadPrec [ListExecutions]
ReadPrec ListExecutions
Int -> ReadS ListExecutions
ReadS [ListExecutions]
(Int -> ReadS ListExecutions)
-> ReadS [ListExecutions]
-> ReadPrec ListExecutions
-> ReadPrec [ListExecutions]
-> Read ListExecutions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListExecutions]
$creadListPrec :: ReadPrec [ListExecutions]
readPrec :: ReadPrec ListExecutions
$creadPrec :: ReadPrec ListExecutions
readList :: ReadS [ListExecutions]
$creadList :: ReadS [ListExecutions]
readsPrec :: Int -> ReadS ListExecutions
$creadsPrec :: Int -> ReadS ListExecutions
Prelude.Read, Int -> ListExecutions -> ShowS
[ListExecutions] -> ShowS
ListExecutions -> String
(Int -> ListExecutions -> ShowS)
-> (ListExecutions -> String)
-> ([ListExecutions] -> ShowS)
-> Show ListExecutions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListExecutions] -> ShowS
$cshowList :: [ListExecutions] -> ShowS
show :: ListExecutions -> String
$cshow :: ListExecutions -> String
showsPrec :: Int -> ListExecutions -> ShowS
$cshowsPrec :: Int -> ListExecutions -> ShowS
Prelude.Show, (forall x. ListExecutions -> Rep ListExecutions x)
-> (forall x. Rep ListExecutions x -> ListExecutions)
-> Generic ListExecutions
forall x. Rep ListExecutions x -> ListExecutions
forall x. ListExecutions -> Rep ListExecutions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListExecutions x -> ListExecutions
$cfrom :: forall x. ListExecutions -> Rep ListExecutions x
Prelude.Generic)

-- |
-- Create a value of 'ListExecutions' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'statusFilter', 'listExecutions_statusFilter' - If specified, only list the executions whose current execution status
-- matches the given filter.
--
-- 'nextToken', 'listExecutions_nextToken' - If @nextToken@ is returned, there are more results available. The value
-- of @nextToken@ is a unique pagination token for each page. Make the call
-- again using the returned token to retrieve the next page. Keep all other
-- arguments unchanged. Each pagination token expires after 24 hours. Using
-- an expired pagination token will return an /HTTP 400 InvalidToken/
-- error.
--
-- 'maxResults', 'listExecutions_maxResults' - The maximum number of results that are returned per call. You can use
-- @nextToken@ to obtain further pages of results. The default is 100 and
-- the maximum allowed page size is 1000. A value of 0 uses the default.
--
-- This is only an upper limit. The actual number of results returned per
-- call might be fewer than the specified maximum.
--
-- 'stateMachineArn', 'listExecutions_stateMachineArn' - The Amazon Resource Name (ARN) of the state machine whose executions is
-- listed.
newListExecutions ::
  -- | 'stateMachineArn'
  Prelude.Text ->
  ListExecutions
newListExecutions :: Text -> ListExecutions
newListExecutions Text
pStateMachineArn_ =
  ListExecutions' :: Maybe ExecutionStatus
-> Maybe Text -> Maybe Natural -> Text -> ListExecutions
ListExecutions'
    { $sel:statusFilter:ListExecutions' :: Maybe ExecutionStatus
statusFilter = Maybe ExecutionStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListExecutions' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListExecutions' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:stateMachineArn:ListExecutions' :: Text
stateMachineArn = Text
pStateMachineArn_
    }

-- | If specified, only list the executions whose current execution status
-- matches the given filter.
listExecutions_statusFilter :: Lens.Lens' ListExecutions (Prelude.Maybe ExecutionStatus)
listExecutions_statusFilter :: (Maybe ExecutionStatus -> f (Maybe ExecutionStatus))
-> ListExecutions -> f ListExecutions
listExecutions_statusFilter = (ListExecutions -> Maybe ExecutionStatus)
-> (ListExecutions -> Maybe ExecutionStatus -> ListExecutions)
-> Lens
     ListExecutions
     ListExecutions
     (Maybe ExecutionStatus)
     (Maybe ExecutionStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListExecutions' {Maybe ExecutionStatus
statusFilter :: Maybe ExecutionStatus
$sel:statusFilter:ListExecutions' :: ListExecutions -> Maybe ExecutionStatus
statusFilter} -> Maybe ExecutionStatus
statusFilter) (\s :: ListExecutions
s@ListExecutions' {} Maybe ExecutionStatus
a -> ListExecutions
s {$sel:statusFilter:ListExecutions' :: Maybe ExecutionStatus
statusFilter = Maybe ExecutionStatus
a} :: ListExecutions)

-- | If @nextToken@ is returned, there are more results available. The value
-- of @nextToken@ is a unique pagination token for each page. Make the call
-- again using the returned token to retrieve the next page. Keep all other
-- arguments unchanged. Each pagination token expires after 24 hours. Using
-- an expired pagination token will return an /HTTP 400 InvalidToken/
-- error.
listExecutions_nextToken :: Lens.Lens' ListExecutions (Prelude.Maybe Prelude.Text)
listExecutions_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListExecutions -> f ListExecutions
listExecutions_nextToken = (ListExecutions -> Maybe Text)
-> (ListExecutions -> Maybe Text -> ListExecutions)
-> Lens ListExecutions ListExecutions (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListExecutions' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListExecutions' :: ListExecutions -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListExecutions
s@ListExecutions' {} Maybe Text
a -> ListExecutions
s {$sel:nextToken:ListExecutions' :: Maybe Text
nextToken = Maybe Text
a} :: ListExecutions)

-- | The maximum number of results that are returned per call. You can use
-- @nextToken@ to obtain further pages of results. The default is 100 and
-- the maximum allowed page size is 1000. A value of 0 uses the default.
--
-- This is only an upper limit. The actual number of results returned per
-- call might be fewer than the specified maximum.
listExecutions_maxResults :: Lens.Lens' ListExecutions (Prelude.Maybe Prelude.Natural)
listExecutions_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListExecutions -> f ListExecutions
listExecutions_maxResults = (ListExecutions -> Maybe Natural)
-> (ListExecutions -> Maybe Natural -> ListExecutions)
-> Lens
     ListExecutions ListExecutions (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListExecutions' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListExecutions' :: ListExecutions -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListExecutions
s@ListExecutions' {} Maybe Natural
a -> ListExecutions
s {$sel:maxResults:ListExecutions' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListExecutions)

-- | The Amazon Resource Name (ARN) of the state machine whose executions is
-- listed.
listExecutions_stateMachineArn :: Lens.Lens' ListExecutions Prelude.Text
listExecutions_stateMachineArn :: (Text -> f Text) -> ListExecutions -> f ListExecutions
listExecutions_stateMachineArn = (ListExecutions -> Text)
-> (ListExecutions -> Text -> ListExecutions)
-> Lens ListExecutions ListExecutions Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListExecutions' {Text
stateMachineArn :: Text
$sel:stateMachineArn:ListExecutions' :: ListExecutions -> Text
stateMachineArn} -> Text
stateMachineArn) (\s :: ListExecutions
s@ListExecutions' {} Text
a -> ListExecutions
s {$sel:stateMachineArn:ListExecutions' :: Text
stateMachineArn = Text
a} :: ListExecutions)

instance Core.AWSPager ListExecutions where
  page :: ListExecutions
-> AWSResponse ListExecutions -> Maybe ListExecutions
page ListExecutions
rq AWSResponse ListExecutions
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListExecutions
ListExecutionsResponse
rs
            ListExecutionsResponse
-> Getting (First Text) ListExecutionsResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListExecutionsResponse
-> Const (First Text) ListExecutionsResponse
Lens' ListExecutionsResponse (Maybe Text)
listExecutionsResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListExecutionsResponse
 -> Const (First Text) ListExecutionsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListExecutionsResponse 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 ListExecutions
forall a. Maybe a
Prelude.Nothing
    | [ExecutionListItem] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        (AWSResponse ListExecutions
ListExecutionsResponse
rs ListExecutionsResponse
-> Getting
     [ExecutionListItem] ListExecutionsResponse [ExecutionListItem]
-> [ExecutionListItem]
forall s a. s -> Getting a s a -> a
Lens.^. Getting
  [ExecutionListItem] ListExecutionsResponse [ExecutionListItem]
Lens' ListExecutionsResponse [ExecutionListItem]
listExecutionsResponse_executions) =
      Maybe ListExecutions
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListExecutions -> Maybe ListExecutions
forall a. a -> Maybe a
Prelude.Just (ListExecutions -> Maybe ListExecutions)
-> ListExecutions -> Maybe ListExecutions
forall a b. (a -> b) -> a -> b
Prelude.$
        ListExecutions
rq
          ListExecutions
-> (ListExecutions -> ListExecutions) -> ListExecutions
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListExecutions -> Identity ListExecutions
Lens ListExecutions ListExecutions (Maybe Text) (Maybe Text)
listExecutions_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListExecutions -> Identity ListExecutions)
-> Maybe Text -> ListExecutions -> ListExecutions
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListExecutions
ListExecutionsResponse
rs
          ListExecutionsResponse
-> Getting (First Text) ListExecutionsResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListExecutionsResponse
-> Const (First Text) ListExecutionsResponse
Lens' ListExecutionsResponse (Maybe Text)
listExecutionsResponse_nextToken ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListExecutionsResponse
 -> Const (First Text) ListExecutionsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListExecutionsResponse 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 ListExecutions where
  type
    AWSResponse ListExecutions =
      ListExecutionsResponse
  request :: ListExecutions -> Request ListExecutions
request = Service -> ListExecutions -> Request ListExecutions
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ListExecutions
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListExecutions)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListExecutions))
-> Logger
-> Service
-> Proxy ListExecutions
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListExecutions)))
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 -> Int -> [ExecutionListItem] -> ListExecutionsResponse
ListExecutionsResponse'
            (Maybe Text
 -> Int -> [ExecutionListItem] -> ListExecutionsResponse)
-> Either String (Maybe Text)
-> Either
     String (Int -> [ExecutionListItem] -> ListExecutionsResponse)
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
"nextToken")
            Either
  String (Int -> [ExecutionListItem] -> ListExecutionsResponse)
-> Either String Int
-> Either String ([ExecutionListItem] -> ListExecutionsResponse)
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 ([ExecutionListItem] -> ListExecutionsResponse)
-> Either String [ExecutionListItem]
-> Either String ListExecutionsResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe [ExecutionListItem])
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"executions" Either String (Maybe [ExecutionListItem])
-> [ExecutionListItem] -> Either String [ExecutionListItem]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [ExecutionListItem]
forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable ListExecutions

instance Prelude.NFData ListExecutions

instance Core.ToHeaders ListExecutions where
  toHeaders :: ListExecutions -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListExecutions -> 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
"AWSStepFunctions.ListExecutions" ::
                          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 ListExecutions where
  toJSON :: ListExecutions -> Value
toJSON ListExecutions' {Maybe Natural
Maybe Text
Maybe ExecutionStatus
Text
stateMachineArn :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
statusFilter :: Maybe ExecutionStatus
$sel:stateMachineArn:ListExecutions' :: ListExecutions -> Text
$sel:maxResults:ListExecutions' :: ListExecutions -> Maybe Natural
$sel:nextToken:ListExecutions' :: ListExecutions -> Maybe Text
$sel:statusFilter:ListExecutions' :: ListExecutions -> Maybe ExecutionStatus
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"statusFilter" Text -> ExecutionStatus -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ExecutionStatus -> Pair) -> Maybe ExecutionStatus -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ExecutionStatus
statusFilter,
            (Text
"nextToken" 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
nextToken,
            (Text
"maxResults" 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
maxResults,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"stateMachineArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
stateMachineArn)
          ]
      )

instance Core.ToPath ListExecutions where
  toPath :: ListExecutions -> ByteString
toPath = ByteString -> ListExecutions -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery ListExecutions where
  toQuery :: ListExecutions -> QueryString
toQuery = QueryString -> ListExecutions -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newListExecutionsResponse' smart constructor.
data ListExecutionsResponse = ListExecutionsResponse'
  { -- | If @nextToken@ is returned, there are more results available. The value
    -- of @nextToken@ is a unique pagination token for each page. Make the call
    -- again using the returned token to retrieve the next page. Keep all other
    -- arguments unchanged. Each pagination token expires after 24 hours. Using
    -- an expired pagination token will return an /HTTP 400 InvalidToken/
    -- error.
    ListExecutionsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListExecutionsResponse -> Int
httpStatus :: Prelude.Int,
    -- | The list of matching executions.
    ListExecutionsResponse -> [ExecutionListItem]
executions :: [ExecutionListItem]
  }
  deriving (ListExecutionsResponse -> ListExecutionsResponse -> Bool
(ListExecutionsResponse -> ListExecutionsResponse -> Bool)
-> (ListExecutionsResponse -> ListExecutionsResponse -> Bool)
-> Eq ListExecutionsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListExecutionsResponse -> ListExecutionsResponse -> Bool
$c/= :: ListExecutionsResponse -> ListExecutionsResponse -> Bool
== :: ListExecutionsResponse -> ListExecutionsResponse -> Bool
$c== :: ListExecutionsResponse -> ListExecutionsResponse -> Bool
Prelude.Eq, ReadPrec [ListExecutionsResponse]
ReadPrec ListExecutionsResponse
Int -> ReadS ListExecutionsResponse
ReadS [ListExecutionsResponse]
(Int -> ReadS ListExecutionsResponse)
-> ReadS [ListExecutionsResponse]
-> ReadPrec ListExecutionsResponse
-> ReadPrec [ListExecutionsResponse]
-> Read ListExecutionsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListExecutionsResponse]
$creadListPrec :: ReadPrec [ListExecutionsResponse]
readPrec :: ReadPrec ListExecutionsResponse
$creadPrec :: ReadPrec ListExecutionsResponse
readList :: ReadS [ListExecutionsResponse]
$creadList :: ReadS [ListExecutionsResponse]
readsPrec :: Int -> ReadS ListExecutionsResponse
$creadsPrec :: Int -> ReadS ListExecutionsResponse
Prelude.Read, Int -> ListExecutionsResponse -> ShowS
[ListExecutionsResponse] -> ShowS
ListExecutionsResponse -> String
(Int -> ListExecutionsResponse -> ShowS)
-> (ListExecutionsResponse -> String)
-> ([ListExecutionsResponse] -> ShowS)
-> Show ListExecutionsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListExecutionsResponse] -> ShowS
$cshowList :: [ListExecutionsResponse] -> ShowS
show :: ListExecutionsResponse -> String
$cshow :: ListExecutionsResponse -> String
showsPrec :: Int -> ListExecutionsResponse -> ShowS
$cshowsPrec :: Int -> ListExecutionsResponse -> ShowS
Prelude.Show, (forall x. ListExecutionsResponse -> Rep ListExecutionsResponse x)
-> (forall x.
    Rep ListExecutionsResponse x -> ListExecutionsResponse)
-> Generic ListExecutionsResponse
forall x. Rep ListExecutionsResponse x -> ListExecutionsResponse
forall x. ListExecutionsResponse -> Rep ListExecutionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListExecutionsResponse x -> ListExecutionsResponse
$cfrom :: forall x. ListExecutionsResponse -> Rep ListExecutionsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListExecutionsResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'nextToken', 'listExecutionsResponse_nextToken' - If @nextToken@ is returned, there are more results available. The value
-- of @nextToken@ is a unique pagination token for each page. Make the call
-- again using the returned token to retrieve the next page. Keep all other
-- arguments unchanged. Each pagination token expires after 24 hours. Using
-- an expired pagination token will return an /HTTP 400 InvalidToken/
-- error.
--
-- 'httpStatus', 'listExecutionsResponse_httpStatus' - The response's http status code.
--
-- 'executions', 'listExecutionsResponse_executions' - The list of matching executions.
newListExecutionsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListExecutionsResponse
newListExecutionsResponse :: Int -> ListExecutionsResponse
newListExecutionsResponse Int
pHttpStatus_ =
  ListExecutionsResponse' :: Maybe Text -> Int -> [ExecutionListItem] -> ListExecutionsResponse
ListExecutionsResponse'
    { $sel:nextToken:ListExecutionsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListExecutionsResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:executions:ListExecutionsResponse' :: [ExecutionListItem]
executions = [ExecutionListItem]
forall a. Monoid a => a
Prelude.mempty
    }

-- | If @nextToken@ is returned, there are more results available. The value
-- of @nextToken@ is a unique pagination token for each page. Make the call
-- again using the returned token to retrieve the next page. Keep all other
-- arguments unchanged. Each pagination token expires after 24 hours. Using
-- an expired pagination token will return an /HTTP 400 InvalidToken/
-- error.
listExecutionsResponse_nextToken :: Lens.Lens' ListExecutionsResponse (Prelude.Maybe Prelude.Text)
listExecutionsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListExecutionsResponse -> f ListExecutionsResponse
listExecutionsResponse_nextToken = (ListExecutionsResponse -> Maybe Text)
-> (ListExecutionsResponse -> Maybe Text -> ListExecutionsResponse)
-> Lens' ListExecutionsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListExecutionsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListExecutionsResponse' :: ListExecutionsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListExecutionsResponse
s@ListExecutionsResponse' {} Maybe Text
a -> ListExecutionsResponse
s {$sel:nextToken:ListExecutionsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListExecutionsResponse)

-- | The response's http status code.
listExecutionsResponse_httpStatus :: Lens.Lens' ListExecutionsResponse Prelude.Int
listExecutionsResponse_httpStatus :: (Int -> f Int)
-> ListExecutionsResponse -> f ListExecutionsResponse
listExecutionsResponse_httpStatus = (ListExecutionsResponse -> Int)
-> (ListExecutionsResponse -> Int -> ListExecutionsResponse)
-> Lens ListExecutionsResponse ListExecutionsResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListExecutionsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListExecutionsResponse' :: ListExecutionsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListExecutionsResponse
s@ListExecutionsResponse' {} Int
a -> ListExecutionsResponse
s {$sel:httpStatus:ListExecutionsResponse' :: Int
httpStatus = Int
a} :: ListExecutionsResponse)

-- | The list of matching executions.
listExecutionsResponse_executions :: Lens.Lens' ListExecutionsResponse [ExecutionListItem]
listExecutionsResponse_executions :: ([ExecutionListItem] -> f [ExecutionListItem])
-> ListExecutionsResponse -> f ListExecutionsResponse
listExecutionsResponse_executions = (ListExecutionsResponse -> [ExecutionListItem])
-> (ListExecutionsResponse
    -> [ExecutionListItem] -> ListExecutionsResponse)
-> Lens' ListExecutionsResponse [ExecutionListItem]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListExecutionsResponse' {[ExecutionListItem]
executions :: [ExecutionListItem]
$sel:executions:ListExecutionsResponse' :: ListExecutionsResponse -> [ExecutionListItem]
executions} -> [ExecutionListItem]
executions) (\s :: ListExecutionsResponse
s@ListExecutionsResponse' {} [ExecutionListItem]
a -> ListExecutionsResponse
s {$sel:executions:ListExecutionsResponse' :: [ExecutionListItem]
executions = [ExecutionListItem]
a} :: ListExecutionsResponse) (([ExecutionListItem] -> f [ExecutionListItem])
 -> ListExecutionsResponse -> f ListExecutionsResponse)
-> (([ExecutionListItem] -> f [ExecutionListItem])
    -> [ExecutionListItem] -> f [ExecutionListItem])
-> ([ExecutionListItem] -> f [ExecutionListItem])
-> ListExecutionsResponse
-> f ListExecutionsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([ExecutionListItem] -> f [ExecutionListItem])
-> [ExecutionListItem] -> f [ExecutionListItem]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.NFData ListExecutionsResponse