{-# 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.ListPipelineExecutions
-- 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)
--
-- Gets a summary of the most recent executions for a pipeline.
--
-- This operation returns paginated results.
module Amazonka.CodePipeline.ListPipelineExecutions
  ( -- * Creating a Request
    ListPipelineExecutions (..),
    newListPipelineExecutions,

    -- * Request Lenses
    listPipelineExecutions_nextToken,
    listPipelineExecutions_maxResults,
    listPipelineExecutions_pipelineName,

    -- * Destructuring the Response
    ListPipelineExecutionsResponse (..),
    newListPipelineExecutionsResponse,

    -- * Response Lenses
    listPipelineExecutionsResponse_nextToken,
    listPipelineExecutionsResponse_pipelineExecutionSummaries,
    listPipelineExecutionsResponse_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

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

-- |
-- Create a value of 'ListPipelineExecutions' 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', 'listPipelineExecutions_nextToken' - The token that was returned from the previous @ListPipelineExecutions@
-- call, which can be used to return the next set of pipeline executions in
-- the list.
--
-- 'maxResults', 'listPipelineExecutions_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. Pipeline history is limited to the most recent 12 months, based
-- on pipeline execution start times. Default value is 100.
--
-- 'pipelineName', 'listPipelineExecutions_pipelineName' - The name of the pipeline for which you want to get execution summary
-- information.
newListPipelineExecutions ::
  -- | 'pipelineName'
  Prelude.Text ->
  ListPipelineExecutions
newListPipelineExecutions :: Text -> ListPipelineExecutions
newListPipelineExecutions Text
pPipelineName_ =
  ListPipelineExecutions' :: Maybe Text -> Maybe Natural -> Text -> ListPipelineExecutions
ListPipelineExecutions'
    { $sel:nextToken:ListPipelineExecutions' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListPipelineExecutions' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:pipelineName:ListPipelineExecutions' :: Text
pipelineName = Text
pPipelineName_
    }

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

-- | The maximum number of results to return in a single call. To retrieve
-- the remaining results, make another call with the returned nextToken
-- value. Pipeline history is limited to the most recent 12 months, based
-- on pipeline execution start times. Default value is 100.
listPipelineExecutions_maxResults :: Lens.Lens' ListPipelineExecutions (Prelude.Maybe Prelude.Natural)
listPipelineExecutions_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListPipelineExecutions -> f ListPipelineExecutions
listPipelineExecutions_maxResults = (ListPipelineExecutions -> Maybe Natural)
-> (ListPipelineExecutions
    -> Maybe Natural -> ListPipelineExecutions)
-> Lens
     ListPipelineExecutions
     ListPipelineExecutions
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPipelineExecutions' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListPipelineExecutions' :: ListPipelineExecutions -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListPipelineExecutions
s@ListPipelineExecutions' {} Maybe Natural
a -> ListPipelineExecutions
s {$sel:maxResults:ListPipelineExecutions' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListPipelineExecutions)

-- | The name of the pipeline for which you want to get execution summary
-- information.
listPipelineExecutions_pipelineName :: Lens.Lens' ListPipelineExecutions Prelude.Text
listPipelineExecutions_pipelineName :: (Text -> f Text)
-> ListPipelineExecutions -> f ListPipelineExecutions
listPipelineExecutions_pipelineName = (ListPipelineExecutions -> Text)
-> (ListPipelineExecutions -> Text -> ListPipelineExecutions)
-> Lens ListPipelineExecutions ListPipelineExecutions Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPipelineExecutions' {Text
pipelineName :: Text
$sel:pipelineName:ListPipelineExecutions' :: ListPipelineExecutions -> Text
pipelineName} -> Text
pipelineName) (\s :: ListPipelineExecutions
s@ListPipelineExecutions' {} Text
a -> ListPipelineExecutions
s {$sel:pipelineName:ListPipelineExecutions' :: Text
pipelineName = Text
a} :: ListPipelineExecutions)

instance Core.AWSPager ListPipelineExecutions where
  page :: ListPipelineExecutions
-> AWSResponse ListPipelineExecutions
-> Maybe ListPipelineExecutions
page ListPipelineExecutions
rq AWSResponse ListPipelineExecutions
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListPipelineExecutions
ListPipelineExecutionsResponse
rs
            ListPipelineExecutionsResponse
-> Getting (First Text) ListPipelineExecutionsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListPipelineExecutionsResponse
-> Const (First Text) ListPipelineExecutionsResponse
Lens' ListPipelineExecutionsResponse (Maybe Text)
listPipelineExecutionsResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListPipelineExecutionsResponse
 -> Const (First Text) ListPipelineExecutionsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListPipelineExecutionsResponse 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 ListPipelineExecutions
forall a. Maybe a
Prelude.Nothing
    | Maybe [PipelineExecutionSummary] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListPipelineExecutions
ListPipelineExecutionsResponse
rs
            ListPipelineExecutionsResponse
-> Getting
     (First [PipelineExecutionSummary])
     ListPipelineExecutionsResponse
     [PipelineExecutionSummary]
-> Maybe [PipelineExecutionSummary]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [PipelineExecutionSummary]
 -> Const
      (First [PipelineExecutionSummary])
      (Maybe [PipelineExecutionSummary]))
-> ListPipelineExecutionsResponse
-> Const
     (First [PipelineExecutionSummary]) ListPipelineExecutionsResponse
Lens'
  ListPipelineExecutionsResponse (Maybe [PipelineExecutionSummary])
listPipelineExecutionsResponse_pipelineExecutionSummaries
              ((Maybe [PipelineExecutionSummary]
  -> Const
       (First [PipelineExecutionSummary])
       (Maybe [PipelineExecutionSummary]))
 -> ListPipelineExecutionsResponse
 -> Const
      (First [PipelineExecutionSummary]) ListPipelineExecutionsResponse)
-> (([PipelineExecutionSummary]
     -> Const
          (First [PipelineExecutionSummary]) [PipelineExecutionSummary])
    -> Maybe [PipelineExecutionSummary]
    -> Const
         (First [PipelineExecutionSummary])
         (Maybe [PipelineExecutionSummary]))
-> Getting
     (First [PipelineExecutionSummary])
     ListPipelineExecutionsResponse
     [PipelineExecutionSummary]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([PipelineExecutionSummary]
 -> Const
      (First [PipelineExecutionSummary]) [PipelineExecutionSummary])
-> Maybe [PipelineExecutionSummary]
-> Const
     (First [PipelineExecutionSummary])
     (Maybe [PipelineExecutionSummary])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListPipelineExecutions
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListPipelineExecutions -> Maybe ListPipelineExecutions
forall a. a -> Maybe a
Prelude.Just (ListPipelineExecutions -> Maybe ListPipelineExecutions)
-> ListPipelineExecutions -> Maybe ListPipelineExecutions
forall a b. (a -> b) -> a -> b
Prelude.$
        ListPipelineExecutions
rq
          ListPipelineExecutions
-> (ListPipelineExecutions -> ListPipelineExecutions)
-> ListPipelineExecutions
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListPipelineExecutions -> Identity ListPipelineExecutions
Lens
  ListPipelineExecutions
  ListPipelineExecutions
  (Maybe Text)
  (Maybe Text)
listPipelineExecutions_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListPipelineExecutions -> Identity ListPipelineExecutions)
-> Maybe Text -> ListPipelineExecutions -> ListPipelineExecutions
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListPipelineExecutions
ListPipelineExecutionsResponse
rs
          ListPipelineExecutionsResponse
-> Getting (First Text) ListPipelineExecutionsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListPipelineExecutionsResponse
-> Const (First Text) ListPipelineExecutionsResponse
Lens' ListPipelineExecutionsResponse (Maybe Text)
listPipelineExecutionsResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListPipelineExecutionsResponse
 -> Const (First Text) ListPipelineExecutionsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListPipelineExecutionsResponse 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 ListPipelineExecutions where
  type
    AWSResponse ListPipelineExecutions =
      ListPipelineExecutionsResponse
  request :: ListPipelineExecutions -> Request ListPipelineExecutions
request = Service -> ListPipelineExecutions -> Request ListPipelineExecutions
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ListPipelineExecutions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListPipelineExecutions)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListPipelineExecutions))
-> Logger
-> Service
-> Proxy ListPipelineExecutions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListPipelineExecutions)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe [PipelineExecutionSummary]
-> Int
-> ListPipelineExecutionsResponse
ListPipelineExecutionsResponse'
            (Maybe Text
 -> Maybe [PipelineExecutionSummary]
 -> Int
 -> ListPipelineExecutionsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [PipelineExecutionSummary]
      -> Int -> ListPipelineExecutionsResponse)
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
  (Maybe [PipelineExecutionSummary]
   -> Int -> ListPipelineExecutionsResponse)
-> Either String (Maybe [PipelineExecutionSummary])
-> Either String (Int -> ListPipelineExecutionsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text -> Either String (Maybe (Maybe [PipelineExecutionSummary]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"pipelineExecutionSummaries"
                            Either String (Maybe (Maybe [PipelineExecutionSummary]))
-> Maybe [PipelineExecutionSummary]
-> Either String (Maybe [PipelineExecutionSummary])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [PipelineExecutionSummary]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either String (Int -> ListPipelineExecutionsResponse)
-> Either String Int
-> Either String ListPipelineExecutionsResponse
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 ListPipelineExecutions

instance Prelude.NFData ListPipelineExecutions

instance Core.ToHeaders ListPipelineExecutions where
  toHeaders :: ListPipelineExecutions -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListPipelineExecutions -> 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.ListPipelineExecutions" ::
                          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 ListPipelineExecutions where
  toJSON :: ListPipelineExecutions -> Value
toJSON ListPipelineExecutions' {Maybe Natural
Maybe Text
Text
pipelineName :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:pipelineName:ListPipelineExecutions' :: ListPipelineExecutions -> Text
$sel:maxResults:ListPipelineExecutions' :: ListPipelineExecutions -> Maybe Natural
$sel:nextToken:ListPipelineExecutions' :: ListPipelineExecutions -> 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
"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 ListPipelineExecutions where
  toPath :: ListPipelineExecutions -> ByteString
toPath = ByteString -> ListPipelineExecutions -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | Represents the output of a @ListPipelineExecutions@ action.
--
-- /See:/ 'newListPipelineExecutionsResponse' smart constructor.
data ListPipelineExecutionsResponse = ListPipelineExecutionsResponse'
  { -- | A token that can be used in the next @ListPipelineExecutions@ call. To
    -- view all items in the list, continue to call this operation with each
    -- subsequent token until no more nextToken values are returned.
    ListPipelineExecutionsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | A list of executions in the history of a pipeline.
    ListPipelineExecutionsResponse -> Maybe [PipelineExecutionSummary]
pipelineExecutionSummaries :: Prelude.Maybe [PipelineExecutionSummary],
    -- | The response's http status code.
    ListPipelineExecutionsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListPipelineExecutionsResponse
-> ListPipelineExecutionsResponse -> Bool
(ListPipelineExecutionsResponse
 -> ListPipelineExecutionsResponse -> Bool)
-> (ListPipelineExecutionsResponse
    -> ListPipelineExecutionsResponse -> Bool)
-> Eq ListPipelineExecutionsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListPipelineExecutionsResponse
-> ListPipelineExecutionsResponse -> Bool
$c/= :: ListPipelineExecutionsResponse
-> ListPipelineExecutionsResponse -> Bool
== :: ListPipelineExecutionsResponse
-> ListPipelineExecutionsResponse -> Bool
$c== :: ListPipelineExecutionsResponse
-> ListPipelineExecutionsResponse -> Bool
Prelude.Eq, ReadPrec [ListPipelineExecutionsResponse]
ReadPrec ListPipelineExecutionsResponse
Int -> ReadS ListPipelineExecutionsResponse
ReadS [ListPipelineExecutionsResponse]
(Int -> ReadS ListPipelineExecutionsResponse)
-> ReadS [ListPipelineExecutionsResponse]
-> ReadPrec ListPipelineExecutionsResponse
-> ReadPrec [ListPipelineExecutionsResponse]
-> Read ListPipelineExecutionsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListPipelineExecutionsResponse]
$creadListPrec :: ReadPrec [ListPipelineExecutionsResponse]
readPrec :: ReadPrec ListPipelineExecutionsResponse
$creadPrec :: ReadPrec ListPipelineExecutionsResponse
readList :: ReadS [ListPipelineExecutionsResponse]
$creadList :: ReadS [ListPipelineExecutionsResponse]
readsPrec :: Int -> ReadS ListPipelineExecutionsResponse
$creadsPrec :: Int -> ReadS ListPipelineExecutionsResponse
Prelude.Read, Int -> ListPipelineExecutionsResponse -> ShowS
[ListPipelineExecutionsResponse] -> ShowS
ListPipelineExecutionsResponse -> String
(Int -> ListPipelineExecutionsResponse -> ShowS)
-> (ListPipelineExecutionsResponse -> String)
-> ([ListPipelineExecutionsResponse] -> ShowS)
-> Show ListPipelineExecutionsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListPipelineExecutionsResponse] -> ShowS
$cshowList :: [ListPipelineExecutionsResponse] -> ShowS
show :: ListPipelineExecutionsResponse -> String
$cshow :: ListPipelineExecutionsResponse -> String
showsPrec :: Int -> ListPipelineExecutionsResponse -> ShowS
$cshowsPrec :: Int -> ListPipelineExecutionsResponse -> ShowS
Prelude.Show, (forall x.
 ListPipelineExecutionsResponse
 -> Rep ListPipelineExecutionsResponse x)
-> (forall x.
    Rep ListPipelineExecutionsResponse x
    -> ListPipelineExecutionsResponse)
-> Generic ListPipelineExecutionsResponse
forall x.
Rep ListPipelineExecutionsResponse x
-> ListPipelineExecutionsResponse
forall x.
ListPipelineExecutionsResponse
-> Rep ListPipelineExecutionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListPipelineExecutionsResponse x
-> ListPipelineExecutionsResponse
$cfrom :: forall x.
ListPipelineExecutionsResponse
-> Rep ListPipelineExecutionsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListPipelineExecutionsResponse' 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', 'listPipelineExecutionsResponse_nextToken' - A token that can be used in the next @ListPipelineExecutions@ call. To
-- view all items in the list, continue to call this operation with each
-- subsequent token until no more nextToken values are returned.
--
-- 'pipelineExecutionSummaries', 'listPipelineExecutionsResponse_pipelineExecutionSummaries' - A list of executions in the history of a pipeline.
--
-- 'httpStatus', 'listPipelineExecutionsResponse_httpStatus' - The response's http status code.
newListPipelineExecutionsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListPipelineExecutionsResponse
newListPipelineExecutionsResponse :: Int -> ListPipelineExecutionsResponse
newListPipelineExecutionsResponse Int
pHttpStatus_ =
  ListPipelineExecutionsResponse' :: Maybe Text
-> Maybe [PipelineExecutionSummary]
-> Int
-> ListPipelineExecutionsResponse
ListPipelineExecutionsResponse'
    { $sel:nextToken:ListPipelineExecutionsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:pipelineExecutionSummaries:ListPipelineExecutionsResponse' :: Maybe [PipelineExecutionSummary]
pipelineExecutionSummaries =
        Maybe [PipelineExecutionSummary]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListPipelineExecutionsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A token that can be used in the next @ListPipelineExecutions@ call. To
-- view all items in the list, continue to call this operation with each
-- subsequent token until no more nextToken values are returned.
listPipelineExecutionsResponse_nextToken :: Lens.Lens' ListPipelineExecutionsResponse (Prelude.Maybe Prelude.Text)
listPipelineExecutionsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListPipelineExecutionsResponse
-> f ListPipelineExecutionsResponse
listPipelineExecutionsResponse_nextToken = (ListPipelineExecutionsResponse -> Maybe Text)
-> (ListPipelineExecutionsResponse
    -> Maybe Text -> ListPipelineExecutionsResponse)
-> Lens' ListPipelineExecutionsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPipelineExecutionsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListPipelineExecutionsResponse' :: ListPipelineExecutionsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListPipelineExecutionsResponse
s@ListPipelineExecutionsResponse' {} Maybe Text
a -> ListPipelineExecutionsResponse
s {$sel:nextToken:ListPipelineExecutionsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListPipelineExecutionsResponse)

-- | A list of executions in the history of a pipeline.
listPipelineExecutionsResponse_pipelineExecutionSummaries :: Lens.Lens' ListPipelineExecutionsResponse (Prelude.Maybe [PipelineExecutionSummary])
listPipelineExecutionsResponse_pipelineExecutionSummaries :: (Maybe [PipelineExecutionSummary]
 -> f (Maybe [PipelineExecutionSummary]))
-> ListPipelineExecutionsResponse
-> f ListPipelineExecutionsResponse
listPipelineExecutionsResponse_pipelineExecutionSummaries = (ListPipelineExecutionsResponse
 -> Maybe [PipelineExecutionSummary])
-> (ListPipelineExecutionsResponse
    -> Maybe [PipelineExecutionSummary]
    -> ListPipelineExecutionsResponse)
-> Lens'
     ListPipelineExecutionsResponse (Maybe [PipelineExecutionSummary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPipelineExecutionsResponse' {Maybe [PipelineExecutionSummary]
pipelineExecutionSummaries :: Maybe [PipelineExecutionSummary]
$sel:pipelineExecutionSummaries:ListPipelineExecutionsResponse' :: ListPipelineExecutionsResponse -> Maybe [PipelineExecutionSummary]
pipelineExecutionSummaries} -> Maybe [PipelineExecutionSummary]
pipelineExecutionSummaries) (\s :: ListPipelineExecutionsResponse
s@ListPipelineExecutionsResponse' {} Maybe [PipelineExecutionSummary]
a -> ListPipelineExecutionsResponse
s {$sel:pipelineExecutionSummaries:ListPipelineExecutionsResponse' :: Maybe [PipelineExecutionSummary]
pipelineExecutionSummaries = Maybe [PipelineExecutionSummary]
a} :: ListPipelineExecutionsResponse) ((Maybe [PipelineExecutionSummary]
  -> f (Maybe [PipelineExecutionSummary]))
 -> ListPipelineExecutionsResponse
 -> f ListPipelineExecutionsResponse)
-> ((Maybe [PipelineExecutionSummary]
     -> f (Maybe [PipelineExecutionSummary]))
    -> Maybe [PipelineExecutionSummary]
    -> f (Maybe [PipelineExecutionSummary]))
-> (Maybe [PipelineExecutionSummary]
    -> f (Maybe [PipelineExecutionSummary]))
-> ListPipelineExecutionsResponse
-> f ListPipelineExecutionsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [PipelineExecutionSummary]
  [PipelineExecutionSummary]
  [PipelineExecutionSummary]
  [PipelineExecutionSummary]
-> Iso
     (Maybe [PipelineExecutionSummary])
     (Maybe [PipelineExecutionSummary])
     (Maybe [PipelineExecutionSummary])
     (Maybe [PipelineExecutionSummary])
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
  [PipelineExecutionSummary]
  [PipelineExecutionSummary]
  [PipelineExecutionSummary]
  [PipelineExecutionSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    ListPipelineExecutionsResponse