{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Lists all executions of a state machine or a Map Run. You can list all
-- executions related to a state machine by specifying a state machine
-- Amazon Resource Name (ARN), or those related to a Map Run by specifying
-- a Map Run ARN.
--
-- 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_mapRunArn,
    listExecutions_maxResults,
    listExecutions_nextToken,
    listExecutions_stateMachineArn,
    listExecutions_statusFilter,

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

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

-- | /See:/ 'newListExecutions' smart constructor.
data ListExecutions = ListExecutions'
  { -- | The Amazon Resource Name (ARN) of the Map Run that started the child
    -- workflow executions. If the @mapRunArn@ field is specified, a list of
    -- all of the child workflow executions started by a Map Run is returned.
    -- For more information, see
    -- <https://docs.aws.amazon.com/step-functions/latest/dg/concepts-examine-map-run.html Examining Map Run>
    -- in the /Step Functions Developer Guide/.
    --
    -- You can specify either a @mapRunArn@ or a @stateMachineArn@, but not
    -- both.
    ListExecutions -> Maybe Text
mapRunArn :: 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,
    -- | 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 Amazon Resource Name (ARN) of the state machine whose executions is
    -- listed.
    --
    -- You can specify either a @mapRunArn@ or a @stateMachineArn@, but not
    -- both.
    ListExecutions -> Maybe Text
stateMachineArn :: Prelude.Maybe Prelude.Text,
    -- | If specified, only list the executions whose current execution status
    -- matches the given filter.
    ListExecutions -> Maybe ExecutionStatus
statusFilter :: Prelude.Maybe ExecutionStatus
  }
  deriving (ListExecutions -> ListExecutions -> Bool
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]
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
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. 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:
--
-- 'mapRunArn', 'listExecutions_mapRunArn' - The Amazon Resource Name (ARN) of the Map Run that started the child
-- workflow executions. If the @mapRunArn@ field is specified, a list of
-- all of the child workflow executions started by a Map Run is returned.
-- For more information, see
-- <https://docs.aws.amazon.com/step-functions/latest/dg/concepts-examine-map-run.html Examining Map Run>
-- in the /Step Functions Developer Guide/.
--
-- You can specify either a @mapRunArn@ or a @stateMachineArn@, but not
-- both.
--
-- '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.
--
-- '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.
--
-- 'stateMachineArn', 'listExecutions_stateMachineArn' - The Amazon Resource Name (ARN) of the state machine whose executions is
-- listed.
--
-- You can specify either a @mapRunArn@ or a @stateMachineArn@, but not
-- both.
--
-- 'statusFilter', 'listExecutions_statusFilter' - If specified, only list the executions whose current execution status
-- matches the given filter.
newListExecutions ::
  ListExecutions
newListExecutions :: ListExecutions
newListExecutions =
  ListExecutions'
    { $sel:mapRunArn:ListExecutions' :: Maybe Text
mapRunArn = forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListExecutions' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListExecutions' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:stateMachineArn:ListExecutions' :: Maybe Text
stateMachineArn = forall a. Maybe a
Prelude.Nothing,
      $sel:statusFilter:ListExecutions' :: Maybe ExecutionStatus
statusFilter = forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Resource Name (ARN) of the Map Run that started the child
-- workflow executions. If the @mapRunArn@ field is specified, a list of
-- all of the child workflow executions started by a Map Run is returned.
-- For more information, see
-- <https://docs.aws.amazon.com/step-functions/latest/dg/concepts-examine-map-run.html Examining Map Run>
-- in the /Step Functions Developer Guide/.
--
-- You can specify either a @mapRunArn@ or a @stateMachineArn@, but not
-- both.
listExecutions_mapRunArn :: Lens.Lens' ListExecutions (Prelude.Maybe Prelude.Text)
listExecutions_mapRunArn :: Lens' ListExecutions (Maybe Text)
listExecutions_mapRunArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListExecutions' {Maybe Text
mapRunArn :: Maybe Text
$sel:mapRunArn:ListExecutions' :: ListExecutions -> Maybe Text
mapRunArn} -> Maybe Text
mapRunArn) (\s :: ListExecutions
s@ListExecutions' {} Maybe Text
a -> ListExecutions
s {$sel:mapRunArn:ListExecutions' :: Maybe Text
mapRunArn = 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 :: Lens' ListExecutions (Maybe Natural)
listExecutions_maxResults = 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)

-- | 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 :: Lens' ListExecutions (Maybe Text)
listExecutions_nextToken = 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 Amazon Resource Name (ARN) of the state machine whose executions is
-- listed.
--
-- You can specify either a @mapRunArn@ or a @stateMachineArn@, but not
-- both.
listExecutions_stateMachineArn :: Lens.Lens' ListExecutions (Prelude.Maybe Prelude.Text)
listExecutions_stateMachineArn :: Lens' ListExecutions (Maybe Text)
listExecutions_stateMachineArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListExecutions' {Maybe Text
stateMachineArn :: Maybe Text
$sel:stateMachineArn:ListExecutions' :: ListExecutions -> Maybe Text
stateMachineArn} -> Maybe Text
stateMachineArn) (\s :: ListExecutions
s@ListExecutions' {} Maybe Text
a -> ListExecutions
s {$sel:stateMachineArn:ListExecutions' :: Maybe Text
stateMachineArn = Maybe Text
a} :: ListExecutions)

-- | If specified, only list the executions whose current execution status
-- matches the given filter.
listExecutions_statusFilter :: Lens.Lens' ListExecutions (Prelude.Maybe ExecutionStatus)
listExecutions_statusFilter :: Lens' ListExecutions (Maybe ExecutionStatus)
listExecutions_statusFilter = 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)

instance Core.AWSPager ListExecutions where
  page :: ListExecutions
-> AWSResponse ListExecutions -> Maybe ListExecutions
page ListExecutions
rq AWSResponse ListExecutions
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListExecutions
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListExecutionsResponse (Maybe Text)
listExecutionsResponse_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 ListExecutions
rs forall s a. s -> Getting a s a -> a
Lens.^. Lens' ListExecutionsResponse [ExecutionListItem]
listExecutionsResponse_executions) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ ListExecutions
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListExecutions (Maybe Text)
listExecutions_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListExecutions
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListExecutionsResponse (Maybe Text)
listExecutionsResponse_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 ListExecutions where
  type
    AWSResponse ListExecutions =
      ListExecutionsResponse
  request :: (Service -> Service) -> ListExecutions -> Request ListExecutions
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 ListExecutions
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListExecutions)))
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 -> [ExecutionListItem] -> ListExecutionsResponse
ListExecutionsResponse'
            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
"executions" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable ListExecutions where
  hashWithSalt :: Int -> ListExecutions -> Int
hashWithSalt Int
_salt ListExecutions' {Maybe Natural
Maybe Text
Maybe ExecutionStatus
statusFilter :: Maybe ExecutionStatus
stateMachineArn :: Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
mapRunArn :: Maybe Text
$sel:statusFilter:ListExecutions' :: ListExecutions -> Maybe ExecutionStatus
$sel:stateMachineArn:ListExecutions' :: ListExecutions -> Maybe Text
$sel:nextToken:ListExecutions' :: ListExecutions -> Maybe Text
$sel:maxResults:ListExecutions' :: ListExecutions -> Maybe Natural
$sel:mapRunArn:ListExecutions' :: ListExecutions -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
mapRunArn
      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` Maybe Text
stateMachineArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ExecutionStatus
statusFilter

instance Prelude.NFData ListExecutions where
  rnf :: ListExecutions -> ()
rnf ListExecutions' {Maybe Natural
Maybe Text
Maybe ExecutionStatus
statusFilter :: Maybe ExecutionStatus
stateMachineArn :: Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
mapRunArn :: Maybe Text
$sel:statusFilter:ListExecutions' :: ListExecutions -> Maybe ExecutionStatus
$sel:stateMachineArn:ListExecutions' :: ListExecutions -> Maybe Text
$sel:nextToken:ListExecutions' :: ListExecutions -> Maybe Text
$sel:maxResults:ListExecutions' :: ListExecutions -> Maybe Natural
$sel:mapRunArn:ListExecutions' :: ListExecutions -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
mapRunArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` 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 Maybe Text
stateMachineArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ExecutionStatus
statusFilter

instance Data.ToHeaders ListExecutions where
  toHeaders :: ListExecutions -> 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.ListExecutions" ::
                          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 ListExecutions where
  toJSON :: ListExecutions -> Value
toJSON ListExecutions' {Maybe Natural
Maybe Text
Maybe ExecutionStatus
statusFilter :: Maybe ExecutionStatus
stateMachineArn :: Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
mapRunArn :: Maybe Text
$sel:statusFilter:ListExecutions' :: ListExecutions -> Maybe ExecutionStatus
$sel:stateMachineArn:ListExecutions' :: ListExecutions -> Maybe Text
$sel:nextToken:ListExecutions' :: ListExecutions -> Maybe Text
$sel:maxResults:ListExecutions' :: ListExecutions -> Maybe Natural
$sel:mapRunArn:ListExecutions' :: ListExecutions -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"mapRunArn" 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
mapRunArn,
            (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,
            (Key
"stateMachineArn" 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
stateMachineArn,
            (Key
"statusFilter" 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 ExecutionStatus
statusFilter
          ]
      )

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

instance Data.ToQuery ListExecutions where
  toQuery :: ListExecutions -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const 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
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]
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
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. 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'
    { $sel:nextToken:ListExecutionsResponse' :: Maybe Text
nextToken =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListExecutionsResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:executions:ListExecutionsResponse' :: [ExecutionListItem]
executions = 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 :: Lens' ListExecutionsResponse (Maybe Text)
listExecutionsResponse_nextToken = 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 :: Lens' ListExecutionsResponse Int
listExecutionsResponse_httpStatus = 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 :: Lens' ListExecutionsResponse [ExecutionListItem]
listExecutionsResponse_executions = 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) 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 ListExecutionsResponse where
  rnf :: ListExecutionsResponse -> ()
rnf ListExecutionsResponse' {Int
[ExecutionListItem]
Maybe Text
executions :: [ExecutionListItem]
httpStatus :: Int
nextToken :: Maybe Text
$sel:executions:ListExecutionsResponse' :: ListExecutionsResponse -> [ExecutionListItem]
$sel:httpStatus:ListExecutionsResponse' :: ListExecutionsResponse -> Int
$sel:nextToken:ListExecutionsResponse' :: ListExecutionsResponse -> 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 [ExecutionListItem]
executions