{-# 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.CodePipeline.ListActionExecutions
-- 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 action executions that have occurred in a pipeline.
--
-- This operation returns paginated results.
module Amazonka.CodePipeline.ListActionExecutions
  ( -- * Creating a Request
    ListActionExecutions (..),
    newListActionExecutions,

    -- * Request Lenses
    listActionExecutions_nextToken,
    listActionExecutions_filter,
    listActionExecutions_maxResults,
    listActionExecutions_pipelineName,

    -- * Destructuring the Response
    ListActionExecutionsResponse (..),
    newListActionExecutionsResponse,

    -- * Response Lenses
    listActionExecutionsResponse_actionExecutionDetails,
    listActionExecutionsResponse_nextToken,
    listActionExecutionsResponse_httpStatus,
  )
where

import Amazonka.CodePipeline.Types
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

-- | /See:/ 'newListActionExecutions' smart constructor.
data ListActionExecutions = ListActionExecutions'
  { -- | The token that was returned from the previous @ListActionExecutions@
    -- call, which can be used to return the next set of action executions in
    -- the list.
    ListActionExecutions -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Input information used to filter action execution history.
    ListActionExecutions -> Maybe ActionExecutionFilter
filter' :: Prelude.Maybe ActionExecutionFilter,
    -- | The maximum number of results to return in a single call. To retrieve
    -- the remaining results, make another call with the returned nextToken
    -- value. Action execution history is retained for up to 12 months, based
    -- on action execution start times. Default value is 100.
    --
    -- Detailed execution history is available for executions run on or after
    -- February 21, 2019.
    ListActionExecutions -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The name of the pipeline for which you want to list action execution
    -- history.
    ListActionExecutions -> Text
pipelineName :: Prelude.Text
  }
  deriving (ListActionExecutions -> ListActionExecutions -> Bool
(ListActionExecutions -> ListActionExecutions -> Bool)
-> (ListActionExecutions -> ListActionExecutions -> Bool)
-> Eq ListActionExecutions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListActionExecutions -> ListActionExecutions -> Bool
$c/= :: ListActionExecutions -> ListActionExecutions -> Bool
== :: ListActionExecutions -> ListActionExecutions -> Bool
$c== :: ListActionExecutions -> ListActionExecutions -> Bool
Prelude.Eq, ReadPrec [ListActionExecutions]
ReadPrec ListActionExecutions
Int -> ReadS ListActionExecutions
ReadS [ListActionExecutions]
(Int -> ReadS ListActionExecutions)
-> ReadS [ListActionExecutions]
-> ReadPrec ListActionExecutions
-> ReadPrec [ListActionExecutions]
-> Read ListActionExecutions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListActionExecutions]
$creadListPrec :: ReadPrec [ListActionExecutions]
readPrec :: ReadPrec ListActionExecutions
$creadPrec :: ReadPrec ListActionExecutions
readList :: ReadS [ListActionExecutions]
$creadList :: ReadS [ListActionExecutions]
readsPrec :: Int -> ReadS ListActionExecutions
$creadsPrec :: Int -> ReadS ListActionExecutions
Prelude.Read, Int -> ListActionExecutions -> ShowS
[ListActionExecutions] -> ShowS
ListActionExecutions -> String
(Int -> ListActionExecutions -> ShowS)
-> (ListActionExecutions -> String)
-> ([ListActionExecutions] -> ShowS)
-> Show ListActionExecutions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListActionExecutions] -> ShowS
$cshowList :: [ListActionExecutions] -> ShowS
show :: ListActionExecutions -> String
$cshow :: ListActionExecutions -> String
showsPrec :: Int -> ListActionExecutions -> ShowS
$cshowsPrec :: Int -> ListActionExecutions -> ShowS
Prelude.Show, (forall x. ListActionExecutions -> Rep ListActionExecutions x)
-> (forall x. Rep ListActionExecutions x -> ListActionExecutions)
-> Generic ListActionExecutions
forall x. Rep ListActionExecutions x -> ListActionExecutions
forall x. ListActionExecutions -> Rep ListActionExecutions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListActionExecutions x -> ListActionExecutions
$cfrom :: forall x. ListActionExecutions -> Rep ListActionExecutions x
Prelude.Generic)

-- |
-- Create a value of 'ListActionExecutions' 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', 'listActionExecutions_nextToken' - The token that was returned from the previous @ListActionExecutions@
-- call, which can be used to return the next set of action executions in
-- the list.
--
-- 'filter'', 'listActionExecutions_filter' - Input information used to filter action execution history.
--
-- 'maxResults', 'listActionExecutions_maxResults' - The maximum number of results to return in a single call. To retrieve
-- the remaining results, make another call with the returned nextToken
-- value. Action execution history is retained for up to 12 months, based
-- on action execution start times. Default value is 100.
--
-- Detailed execution history is available for executions run on or after
-- February 21, 2019.
--
-- 'pipelineName', 'listActionExecutions_pipelineName' - The name of the pipeline for which you want to list action execution
-- history.
newListActionExecutions ::
  -- | 'pipelineName'
  Prelude.Text ->
  ListActionExecutions
newListActionExecutions :: Text -> ListActionExecutions
newListActionExecutions Text
pPipelineName_ =
  ListActionExecutions' :: Maybe Text
-> Maybe ActionExecutionFilter
-> Maybe Natural
-> Text
-> ListActionExecutions
ListActionExecutions'
    { $sel:nextToken:ListActionExecutions' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:filter':ListActionExecutions' :: Maybe ActionExecutionFilter
filter' = Maybe ActionExecutionFilter
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListActionExecutions' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:pipelineName:ListActionExecutions' :: Text
pipelineName = Text
pPipelineName_
    }

-- | The token that was returned from the previous @ListActionExecutions@
-- call, which can be used to return the next set of action executions in
-- the list.
listActionExecutions_nextToken :: Lens.Lens' ListActionExecutions (Prelude.Maybe Prelude.Text)
listActionExecutions_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListActionExecutions -> f ListActionExecutions
listActionExecutions_nextToken = (ListActionExecutions -> Maybe Text)
-> (ListActionExecutions -> Maybe Text -> ListActionExecutions)
-> Lens
     ListActionExecutions ListActionExecutions (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListActionExecutions' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListActionExecutions' :: ListActionExecutions -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListActionExecutions
s@ListActionExecutions' {} Maybe Text
a -> ListActionExecutions
s {$sel:nextToken:ListActionExecutions' :: Maybe Text
nextToken = Maybe Text
a} :: ListActionExecutions)

-- | Input information used to filter action execution history.
listActionExecutions_filter :: Lens.Lens' ListActionExecutions (Prelude.Maybe ActionExecutionFilter)
listActionExecutions_filter :: (Maybe ActionExecutionFilter -> f (Maybe ActionExecutionFilter))
-> ListActionExecutions -> f ListActionExecutions
listActionExecutions_filter = (ListActionExecutions -> Maybe ActionExecutionFilter)
-> (ListActionExecutions
    -> Maybe ActionExecutionFilter -> ListActionExecutions)
-> Lens
     ListActionExecutions
     ListActionExecutions
     (Maybe ActionExecutionFilter)
     (Maybe ActionExecutionFilter)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListActionExecutions' {Maybe ActionExecutionFilter
filter' :: Maybe ActionExecutionFilter
$sel:filter':ListActionExecutions' :: ListActionExecutions -> Maybe ActionExecutionFilter
filter'} -> Maybe ActionExecutionFilter
filter') (\s :: ListActionExecutions
s@ListActionExecutions' {} Maybe ActionExecutionFilter
a -> ListActionExecutions
s {$sel:filter':ListActionExecutions' :: Maybe ActionExecutionFilter
filter' = Maybe ActionExecutionFilter
a} :: ListActionExecutions)

-- | The maximum number of results to return in a single call. To retrieve
-- the remaining results, make another call with the returned nextToken
-- value. Action execution history is retained for up to 12 months, based
-- on action execution start times. Default value is 100.
--
-- Detailed execution history is available for executions run on or after
-- February 21, 2019.
listActionExecutions_maxResults :: Lens.Lens' ListActionExecutions (Prelude.Maybe Prelude.Natural)
listActionExecutions_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListActionExecutions -> f ListActionExecutions
listActionExecutions_maxResults = (ListActionExecutions -> Maybe Natural)
-> (ListActionExecutions -> Maybe Natural -> ListActionExecutions)
-> Lens
     ListActionExecutions
     ListActionExecutions
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListActionExecutions' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListActionExecutions' :: ListActionExecutions -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListActionExecutions
s@ListActionExecutions' {} Maybe Natural
a -> ListActionExecutions
s {$sel:maxResults:ListActionExecutions' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListActionExecutions)

-- | The name of the pipeline for which you want to list action execution
-- history.
listActionExecutions_pipelineName :: Lens.Lens' ListActionExecutions Prelude.Text
listActionExecutions_pipelineName :: (Text -> f Text) -> ListActionExecutions -> f ListActionExecutions
listActionExecutions_pipelineName = (ListActionExecutions -> Text)
-> (ListActionExecutions -> Text -> ListActionExecutions)
-> Lens ListActionExecutions ListActionExecutions Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListActionExecutions' {Text
pipelineName :: Text
$sel:pipelineName:ListActionExecutions' :: ListActionExecutions -> Text
pipelineName} -> Text
pipelineName) (\s :: ListActionExecutions
s@ListActionExecutions' {} Text
a -> ListActionExecutions
s {$sel:pipelineName:ListActionExecutions' :: Text
pipelineName = Text
a} :: ListActionExecutions)

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

instance Prelude.Hashable ListActionExecutions

instance Prelude.NFData ListActionExecutions

instance Core.ToHeaders ListActionExecutions where
  toHeaders :: ListActionExecutions -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListActionExecutions -> 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
"CodePipeline_20150709.ListActionExecutions" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON ListActionExecutions where
  toJSON :: ListActionExecutions -> Value
toJSON ListActionExecutions' {Maybe Natural
Maybe Text
Maybe ActionExecutionFilter
Text
pipelineName :: Text
maxResults :: Maybe Natural
filter' :: Maybe ActionExecutionFilter
nextToken :: Maybe Text
$sel:pipelineName:ListActionExecutions' :: ListActionExecutions -> Text
$sel:maxResults:ListActionExecutions' :: ListActionExecutions -> Maybe Natural
$sel:filter':ListActionExecutions' :: ListActionExecutions -> Maybe ActionExecutionFilter
$sel:nextToken:ListActionExecutions' :: ListActionExecutions -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (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
"filter" Text -> ActionExecutionFilter -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ActionExecutionFilter -> Pair)
-> Maybe ActionExecutionFilter -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ActionExecutionFilter
filter',
            (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
"pipelineName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
pipelineName)
          ]
      )

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

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

-- | /See:/ 'newListActionExecutionsResponse' smart constructor.
data ListActionExecutionsResponse = ListActionExecutionsResponse'
  { -- | The details for a list of recent executions, such as action execution
    -- ID.
    ListActionExecutionsResponse -> Maybe [ActionExecutionDetail]
actionExecutionDetails :: Prelude.Maybe [ActionExecutionDetail],
    -- | If the amount of returned information is significantly large, an
    -- identifier is also returned and can be used in a subsequent
    -- @ListActionExecutions@ call to return the next set of action executions
    -- in the list.
    ListActionExecutionsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListActionExecutionsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListActionExecutionsResponse
-> ListActionExecutionsResponse -> Bool
(ListActionExecutionsResponse
 -> ListActionExecutionsResponse -> Bool)
-> (ListActionExecutionsResponse
    -> ListActionExecutionsResponse -> Bool)
-> Eq ListActionExecutionsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListActionExecutionsResponse
-> ListActionExecutionsResponse -> Bool
$c/= :: ListActionExecutionsResponse
-> ListActionExecutionsResponse -> Bool
== :: ListActionExecutionsResponse
-> ListActionExecutionsResponse -> Bool
$c== :: ListActionExecutionsResponse
-> ListActionExecutionsResponse -> Bool
Prelude.Eq, ReadPrec [ListActionExecutionsResponse]
ReadPrec ListActionExecutionsResponse
Int -> ReadS ListActionExecutionsResponse
ReadS [ListActionExecutionsResponse]
(Int -> ReadS ListActionExecutionsResponse)
-> ReadS [ListActionExecutionsResponse]
-> ReadPrec ListActionExecutionsResponse
-> ReadPrec [ListActionExecutionsResponse]
-> Read ListActionExecutionsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListActionExecutionsResponse]
$creadListPrec :: ReadPrec [ListActionExecutionsResponse]
readPrec :: ReadPrec ListActionExecutionsResponse
$creadPrec :: ReadPrec ListActionExecutionsResponse
readList :: ReadS [ListActionExecutionsResponse]
$creadList :: ReadS [ListActionExecutionsResponse]
readsPrec :: Int -> ReadS ListActionExecutionsResponse
$creadsPrec :: Int -> ReadS ListActionExecutionsResponse
Prelude.Read, Int -> ListActionExecutionsResponse -> ShowS
[ListActionExecutionsResponse] -> ShowS
ListActionExecutionsResponse -> String
(Int -> ListActionExecutionsResponse -> ShowS)
-> (ListActionExecutionsResponse -> String)
-> ([ListActionExecutionsResponse] -> ShowS)
-> Show ListActionExecutionsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListActionExecutionsResponse] -> ShowS
$cshowList :: [ListActionExecutionsResponse] -> ShowS
show :: ListActionExecutionsResponse -> String
$cshow :: ListActionExecutionsResponse -> String
showsPrec :: Int -> ListActionExecutionsResponse -> ShowS
$cshowsPrec :: Int -> ListActionExecutionsResponse -> ShowS
Prelude.Show, (forall x.
 ListActionExecutionsResponse -> Rep ListActionExecutionsResponse x)
-> (forall x.
    Rep ListActionExecutionsResponse x -> ListActionExecutionsResponse)
-> Generic ListActionExecutionsResponse
forall x.
Rep ListActionExecutionsResponse x -> ListActionExecutionsResponse
forall x.
ListActionExecutionsResponse -> Rep ListActionExecutionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListActionExecutionsResponse x -> ListActionExecutionsResponse
$cfrom :: forall x.
ListActionExecutionsResponse -> Rep ListActionExecutionsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListActionExecutionsResponse' 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:
--
-- 'actionExecutionDetails', 'listActionExecutionsResponse_actionExecutionDetails' - The details for a list of recent executions, such as action execution
-- ID.
--
-- 'nextToken', 'listActionExecutionsResponse_nextToken' - If the amount of returned information is significantly large, an
-- identifier is also returned and can be used in a subsequent
-- @ListActionExecutions@ call to return the next set of action executions
-- in the list.
--
-- 'httpStatus', 'listActionExecutionsResponse_httpStatus' - The response's http status code.
newListActionExecutionsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListActionExecutionsResponse
newListActionExecutionsResponse :: Int -> ListActionExecutionsResponse
newListActionExecutionsResponse Int
pHttpStatus_ =
  ListActionExecutionsResponse' :: Maybe [ActionExecutionDetail]
-> Maybe Text -> Int -> ListActionExecutionsResponse
ListActionExecutionsResponse'
    { $sel:actionExecutionDetails:ListActionExecutionsResponse' :: Maybe [ActionExecutionDetail]
actionExecutionDetails =
        Maybe [ActionExecutionDetail]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListActionExecutionsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListActionExecutionsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The details for a list of recent executions, such as action execution
-- ID.
listActionExecutionsResponse_actionExecutionDetails :: Lens.Lens' ListActionExecutionsResponse (Prelude.Maybe [ActionExecutionDetail])
listActionExecutionsResponse_actionExecutionDetails :: (Maybe [ActionExecutionDetail]
 -> f (Maybe [ActionExecutionDetail]))
-> ListActionExecutionsResponse -> f ListActionExecutionsResponse
listActionExecutionsResponse_actionExecutionDetails = (ListActionExecutionsResponse -> Maybe [ActionExecutionDetail])
-> (ListActionExecutionsResponse
    -> Maybe [ActionExecutionDetail] -> ListActionExecutionsResponse)
-> Lens'
     ListActionExecutionsResponse (Maybe [ActionExecutionDetail])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListActionExecutionsResponse' {Maybe [ActionExecutionDetail]
actionExecutionDetails :: Maybe [ActionExecutionDetail]
$sel:actionExecutionDetails:ListActionExecutionsResponse' :: ListActionExecutionsResponse -> Maybe [ActionExecutionDetail]
actionExecutionDetails} -> Maybe [ActionExecutionDetail]
actionExecutionDetails) (\s :: ListActionExecutionsResponse
s@ListActionExecutionsResponse' {} Maybe [ActionExecutionDetail]
a -> ListActionExecutionsResponse
s {$sel:actionExecutionDetails:ListActionExecutionsResponse' :: Maybe [ActionExecutionDetail]
actionExecutionDetails = Maybe [ActionExecutionDetail]
a} :: ListActionExecutionsResponse) ((Maybe [ActionExecutionDetail]
  -> f (Maybe [ActionExecutionDetail]))
 -> ListActionExecutionsResponse -> f ListActionExecutionsResponse)
-> ((Maybe [ActionExecutionDetail]
     -> f (Maybe [ActionExecutionDetail]))
    -> Maybe [ActionExecutionDetail]
    -> f (Maybe [ActionExecutionDetail]))
-> (Maybe [ActionExecutionDetail]
    -> f (Maybe [ActionExecutionDetail]))
-> ListActionExecutionsResponse
-> f ListActionExecutionsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ActionExecutionDetail]
  [ActionExecutionDetail]
  [ActionExecutionDetail]
  [ActionExecutionDetail]
-> Iso
     (Maybe [ActionExecutionDetail])
     (Maybe [ActionExecutionDetail])
     (Maybe [ActionExecutionDetail])
     (Maybe [ActionExecutionDetail])
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
  [ActionExecutionDetail]
  [ActionExecutionDetail]
  [ActionExecutionDetail]
  [ActionExecutionDetail]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | If the amount of returned information is significantly large, an
-- identifier is also returned and can be used in a subsequent
-- @ListActionExecutions@ call to return the next set of action executions
-- in the list.
listActionExecutionsResponse_nextToken :: Lens.Lens' ListActionExecutionsResponse (Prelude.Maybe Prelude.Text)
listActionExecutionsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListActionExecutionsResponse -> f ListActionExecutionsResponse
listActionExecutionsResponse_nextToken = (ListActionExecutionsResponse -> Maybe Text)
-> (ListActionExecutionsResponse
    -> Maybe Text -> ListActionExecutionsResponse)
-> Lens' ListActionExecutionsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListActionExecutionsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListActionExecutionsResponse' :: ListActionExecutionsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListActionExecutionsResponse
s@ListActionExecutionsResponse' {} Maybe Text
a -> ListActionExecutionsResponse
s {$sel:nextToken:ListActionExecutionsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListActionExecutionsResponse)

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

instance Prelude.NFData ListActionExecutionsResponse