{-# 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.SageMaker.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 list of the pipeline executions.
--
-- This operation returns paginated results.
module Amazonka.SageMaker.ListPipelineExecutions
  ( -- * Creating a Request
    ListPipelineExecutions (..),
    newListPipelineExecutions,

    -- * Request Lenses
    listPipelineExecutions_createdAfter,
    listPipelineExecutions_nextToken,
    listPipelineExecutions_sortOrder,
    listPipelineExecutions_maxResults,
    listPipelineExecutions_createdBefore,
    listPipelineExecutions_sortBy,
    listPipelineExecutions_pipelineName,

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

    -- * Response Lenses
    listPipelineExecutionsResponse_nextToken,
    listPipelineExecutionsResponse_pipelineExecutionSummaries,
    listPipelineExecutionsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.SageMaker.Types

-- | /See:/ 'newListPipelineExecutions' smart constructor.
data ListPipelineExecutions = ListPipelineExecutions'
  { -- | A filter that returns the pipeline executions that were created after a
    -- specified time.
    ListPipelineExecutions -> Maybe POSIX
createdAfter :: Prelude.Maybe Core.POSIX,
    -- | If the result of the previous @ListPipelineExecutions@ request was
    -- truncated, the response includes a @NextToken@. To retrieve the next set
    -- of pipeline executions, use the token in the next request.
    ListPipelineExecutions -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The sort order for results.
    ListPipelineExecutions -> Maybe SortOrder
sortOrder :: Prelude.Maybe SortOrder,
    -- | The maximum number of pipeline executions to return in the response.
    ListPipelineExecutions -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | A filter that returns the pipeline executions that were created before a
    -- specified time.
    ListPipelineExecutions -> Maybe POSIX
createdBefore :: Prelude.Maybe Core.POSIX,
    -- | The field by which to sort results. The default is @CreatedTime@.
    ListPipelineExecutions -> Maybe SortPipelineExecutionsBy
sortBy :: Prelude.Maybe SortPipelineExecutionsBy,
    -- | The name of the pipeline.
    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:
--
-- 'createdAfter', 'listPipelineExecutions_createdAfter' - A filter that returns the pipeline executions that were created after a
-- specified time.
--
-- 'nextToken', 'listPipelineExecutions_nextToken' - If the result of the previous @ListPipelineExecutions@ request was
-- truncated, the response includes a @NextToken@. To retrieve the next set
-- of pipeline executions, use the token in the next request.
--
-- 'sortOrder', 'listPipelineExecutions_sortOrder' - The sort order for results.
--
-- 'maxResults', 'listPipelineExecutions_maxResults' - The maximum number of pipeline executions to return in the response.
--
-- 'createdBefore', 'listPipelineExecutions_createdBefore' - A filter that returns the pipeline executions that were created before a
-- specified time.
--
-- 'sortBy', 'listPipelineExecutions_sortBy' - The field by which to sort results. The default is @CreatedTime@.
--
-- 'pipelineName', 'listPipelineExecutions_pipelineName' - The name of the pipeline.
newListPipelineExecutions ::
  -- | 'pipelineName'
  Prelude.Text ->
  ListPipelineExecutions
newListPipelineExecutions :: Text -> ListPipelineExecutions
newListPipelineExecutions Text
pPipelineName_ =
  ListPipelineExecutions' :: Maybe POSIX
-> Maybe Text
-> Maybe SortOrder
-> Maybe Natural
-> Maybe POSIX
-> Maybe SortPipelineExecutionsBy
-> Text
-> ListPipelineExecutions
ListPipelineExecutions'
    { $sel:createdAfter:ListPipelineExecutions' :: Maybe POSIX
createdAfter =
        Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListPipelineExecutions' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:sortOrder:ListPipelineExecutions' :: Maybe SortOrder
sortOrder = Maybe SortOrder
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListPipelineExecutions' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:createdBefore:ListPipelineExecutions' :: Maybe POSIX
createdBefore = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:sortBy:ListPipelineExecutions' :: Maybe SortPipelineExecutionsBy
sortBy = Maybe SortPipelineExecutionsBy
forall a. Maybe a
Prelude.Nothing,
      $sel:pipelineName:ListPipelineExecutions' :: Text
pipelineName = Text
pPipelineName_
    }

-- | A filter that returns the pipeline executions that were created after a
-- specified time.
listPipelineExecutions_createdAfter :: Lens.Lens' ListPipelineExecutions (Prelude.Maybe Prelude.UTCTime)
listPipelineExecutions_createdAfter :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ListPipelineExecutions -> f ListPipelineExecutions
listPipelineExecutions_createdAfter = (ListPipelineExecutions -> Maybe POSIX)
-> (ListPipelineExecutions
    -> Maybe POSIX -> ListPipelineExecutions)
-> Lens
     ListPipelineExecutions
     ListPipelineExecutions
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPipelineExecutions' {Maybe POSIX
createdAfter :: Maybe POSIX
$sel:createdAfter:ListPipelineExecutions' :: ListPipelineExecutions -> Maybe POSIX
createdAfter} -> Maybe POSIX
createdAfter) (\s :: ListPipelineExecutions
s@ListPipelineExecutions' {} Maybe POSIX
a -> ListPipelineExecutions
s {$sel:createdAfter:ListPipelineExecutions' :: Maybe POSIX
createdAfter = Maybe POSIX
a} :: ListPipelineExecutions) ((Maybe POSIX -> f (Maybe POSIX))
 -> ListPipelineExecutions -> f ListPipelineExecutions)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ListPipelineExecutions
-> f ListPipelineExecutions
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | If the result of the previous @ListPipelineExecutions@ request was
-- truncated, the response includes a @NextToken@. To retrieve the next set
-- of pipeline executions, use the token in the next request.
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 sort order for results.
listPipelineExecutions_sortOrder :: Lens.Lens' ListPipelineExecutions (Prelude.Maybe SortOrder)
listPipelineExecutions_sortOrder :: (Maybe SortOrder -> f (Maybe SortOrder))
-> ListPipelineExecutions -> f ListPipelineExecutions
listPipelineExecutions_sortOrder = (ListPipelineExecutions -> Maybe SortOrder)
-> (ListPipelineExecutions
    -> Maybe SortOrder -> ListPipelineExecutions)
-> Lens
     ListPipelineExecutions
     ListPipelineExecutions
     (Maybe SortOrder)
     (Maybe SortOrder)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPipelineExecutions' {Maybe SortOrder
sortOrder :: Maybe SortOrder
$sel:sortOrder:ListPipelineExecutions' :: ListPipelineExecutions -> Maybe SortOrder
sortOrder} -> Maybe SortOrder
sortOrder) (\s :: ListPipelineExecutions
s@ListPipelineExecutions' {} Maybe SortOrder
a -> ListPipelineExecutions
s {$sel:sortOrder:ListPipelineExecutions' :: Maybe SortOrder
sortOrder = Maybe SortOrder
a} :: ListPipelineExecutions)

-- | The maximum number of pipeline executions to return in the response.
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)

-- | A filter that returns the pipeline executions that were created before a
-- specified time.
listPipelineExecutions_createdBefore :: Lens.Lens' ListPipelineExecutions (Prelude.Maybe Prelude.UTCTime)
listPipelineExecutions_createdBefore :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ListPipelineExecutions -> f ListPipelineExecutions
listPipelineExecutions_createdBefore = (ListPipelineExecutions -> Maybe POSIX)
-> (ListPipelineExecutions
    -> Maybe POSIX -> ListPipelineExecutions)
-> Lens
     ListPipelineExecutions
     ListPipelineExecutions
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPipelineExecutions' {Maybe POSIX
createdBefore :: Maybe POSIX
$sel:createdBefore:ListPipelineExecutions' :: ListPipelineExecutions -> Maybe POSIX
createdBefore} -> Maybe POSIX
createdBefore) (\s :: ListPipelineExecutions
s@ListPipelineExecutions' {} Maybe POSIX
a -> ListPipelineExecutions
s {$sel:createdBefore:ListPipelineExecutions' :: Maybe POSIX
createdBefore = Maybe POSIX
a} :: ListPipelineExecutions) ((Maybe POSIX -> f (Maybe POSIX))
 -> ListPipelineExecutions -> f ListPipelineExecutions)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ListPipelineExecutions
-> f ListPipelineExecutions
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The field by which to sort results. The default is @CreatedTime@.
listPipelineExecutions_sortBy :: Lens.Lens' ListPipelineExecutions (Prelude.Maybe SortPipelineExecutionsBy)
listPipelineExecutions_sortBy :: (Maybe SortPipelineExecutionsBy
 -> f (Maybe SortPipelineExecutionsBy))
-> ListPipelineExecutions -> f ListPipelineExecutions
listPipelineExecutions_sortBy = (ListPipelineExecutions -> Maybe SortPipelineExecutionsBy)
-> (ListPipelineExecutions
    -> Maybe SortPipelineExecutionsBy -> ListPipelineExecutions)
-> Lens
     ListPipelineExecutions
     ListPipelineExecutions
     (Maybe SortPipelineExecutionsBy)
     (Maybe SortPipelineExecutionsBy)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPipelineExecutions' {Maybe SortPipelineExecutionsBy
sortBy :: Maybe SortPipelineExecutionsBy
$sel:sortBy:ListPipelineExecutions' :: ListPipelineExecutions -> Maybe SortPipelineExecutionsBy
sortBy} -> Maybe SortPipelineExecutionsBy
sortBy) (\s :: ListPipelineExecutions
s@ListPipelineExecutions' {} Maybe SortPipelineExecutionsBy
a -> ListPipelineExecutions
s {$sel:sortBy:ListPipelineExecutions' :: Maybe SortPipelineExecutionsBy
sortBy = Maybe SortPipelineExecutionsBy
a} :: ListPipelineExecutions)

-- | The name of the pipeline.
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
"SageMaker.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
Maybe POSIX
Maybe SortOrder
Maybe SortPipelineExecutionsBy
Text
pipelineName :: Text
sortBy :: Maybe SortPipelineExecutionsBy
createdBefore :: Maybe POSIX
maxResults :: Maybe Natural
sortOrder :: Maybe SortOrder
nextToken :: Maybe Text
createdAfter :: Maybe POSIX
$sel:pipelineName:ListPipelineExecutions' :: ListPipelineExecutions -> Text
$sel:sortBy:ListPipelineExecutions' :: ListPipelineExecutions -> Maybe SortPipelineExecutionsBy
$sel:createdBefore:ListPipelineExecutions' :: ListPipelineExecutions -> Maybe POSIX
$sel:maxResults:ListPipelineExecutions' :: ListPipelineExecutions -> Maybe Natural
$sel:sortOrder:ListPipelineExecutions' :: ListPipelineExecutions -> Maybe SortOrder
$sel:nextToken:ListPipelineExecutions' :: ListPipelineExecutions -> Maybe Text
$sel:createdAfter:ListPipelineExecutions' :: ListPipelineExecutions -> Maybe POSIX
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"CreatedAfter" Text -> POSIX -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (POSIX -> Pair) -> Maybe POSIX -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe POSIX
createdAfter,
            (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
"SortOrder" Text -> SortOrder -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (SortOrder -> Pair) -> Maybe SortOrder -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SortOrder
sortOrder,
            (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,
            (Text
"CreatedBefore" Text -> POSIX -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (POSIX -> Pair) -> Maybe POSIX -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe POSIX
createdBefore,
            (Text
"SortBy" Text -> SortPipelineExecutionsBy -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (SortPipelineExecutionsBy -> Pair)
-> Maybe SortPipelineExecutionsBy -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SortPipelineExecutionsBy
sortBy,
            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

-- | /See:/ 'newListPipelineExecutionsResponse' smart constructor.
data ListPipelineExecutionsResponse = ListPipelineExecutionsResponse'
  { -- | If the result of the previous @ListPipelineExecutions@ request was
    -- truncated, the response includes a @NextToken@. To retrieve the next set
    -- of pipeline executions, use the token in the next request.
    ListPipelineExecutionsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Contains a sorted list of pipeline execution summary objects matching
    -- the specified filters. Each run summary includes the Amazon Resource
    -- Name (ARN) of the pipeline execution, the run date, and the status. This
    -- list can be empty.
    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' - If the result of the previous @ListPipelineExecutions@ request was
-- truncated, the response includes a @NextToken@. To retrieve the next set
-- of pipeline executions, use the token in the next request.
--
-- 'pipelineExecutionSummaries', 'listPipelineExecutionsResponse_pipelineExecutionSummaries' - Contains a sorted list of pipeline execution summary objects matching
-- the specified filters. Each run summary includes the Amazon Resource
-- Name (ARN) of the pipeline execution, the run date, and the status. This
-- list can be empty.
--
-- '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_
    }

-- | If the result of the previous @ListPipelineExecutions@ request was
-- truncated, the response includes a @NextToken@. To retrieve the next set
-- of pipeline executions, use the token in the next request.
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)

-- | Contains a sorted list of pipeline execution summary objects matching
-- the specified filters. Each run summary includes the Amazon Resource
-- Name (ARN) of the pipeline execution, the run date, and the status. This
-- list can be empty.
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