{-# 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.ListPipelineExecutionSteps
-- 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 @PipeLineExecutionStep@ objects.
--
-- This operation returns paginated results.
module Amazonka.SageMaker.ListPipelineExecutionSteps
  ( -- * Creating a Request
    ListPipelineExecutionSteps (..),
    newListPipelineExecutionSteps,

    -- * Request Lenses
    listPipelineExecutionSteps_pipelineExecutionArn,
    listPipelineExecutionSteps_nextToken,
    listPipelineExecutionSteps_sortOrder,
    listPipelineExecutionSteps_maxResults,

    -- * Destructuring the Response
    ListPipelineExecutionStepsResponse (..),
    newListPipelineExecutionStepsResponse,

    -- * Response Lenses
    listPipelineExecutionStepsResponse_pipelineExecutionSteps,
    listPipelineExecutionStepsResponse_nextToken,
    listPipelineExecutionStepsResponse_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:/ 'newListPipelineExecutionSteps' smart constructor.
data ListPipelineExecutionSteps = ListPipelineExecutionSteps'
  { -- | The Amazon Resource Name (ARN) of the pipeline execution.
    ListPipelineExecutionSteps -> Maybe Text
pipelineExecutionArn :: Prelude.Maybe Prelude.Text,
    -- | If the result of the previous @ListPipelineExecutionSteps@ request was
    -- truncated, the response includes a @NextToken@. To retrieve the next set
    -- of pipeline execution steps, use the token in the next request.
    ListPipelineExecutionSteps -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The field by which to sort results. The default is @CreatedTime@.
    ListPipelineExecutionSteps -> Maybe SortOrder
sortOrder :: Prelude.Maybe SortOrder,
    -- | The maximum number of pipeline execution steps to return in the
    -- response.
    ListPipelineExecutionSteps -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListPipelineExecutionSteps -> ListPipelineExecutionSteps -> Bool
(ListPipelineExecutionSteps -> ListPipelineExecutionSteps -> Bool)
-> (ListPipelineExecutionSteps
    -> ListPipelineExecutionSteps -> Bool)
-> Eq ListPipelineExecutionSteps
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListPipelineExecutionSteps -> ListPipelineExecutionSteps -> Bool
$c/= :: ListPipelineExecutionSteps -> ListPipelineExecutionSteps -> Bool
== :: ListPipelineExecutionSteps -> ListPipelineExecutionSteps -> Bool
$c== :: ListPipelineExecutionSteps -> ListPipelineExecutionSteps -> Bool
Prelude.Eq, ReadPrec [ListPipelineExecutionSteps]
ReadPrec ListPipelineExecutionSteps
Int -> ReadS ListPipelineExecutionSteps
ReadS [ListPipelineExecutionSteps]
(Int -> ReadS ListPipelineExecutionSteps)
-> ReadS [ListPipelineExecutionSteps]
-> ReadPrec ListPipelineExecutionSteps
-> ReadPrec [ListPipelineExecutionSteps]
-> Read ListPipelineExecutionSteps
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListPipelineExecutionSteps]
$creadListPrec :: ReadPrec [ListPipelineExecutionSteps]
readPrec :: ReadPrec ListPipelineExecutionSteps
$creadPrec :: ReadPrec ListPipelineExecutionSteps
readList :: ReadS [ListPipelineExecutionSteps]
$creadList :: ReadS [ListPipelineExecutionSteps]
readsPrec :: Int -> ReadS ListPipelineExecutionSteps
$creadsPrec :: Int -> ReadS ListPipelineExecutionSteps
Prelude.Read, Int -> ListPipelineExecutionSteps -> ShowS
[ListPipelineExecutionSteps] -> ShowS
ListPipelineExecutionSteps -> String
(Int -> ListPipelineExecutionSteps -> ShowS)
-> (ListPipelineExecutionSteps -> String)
-> ([ListPipelineExecutionSteps] -> ShowS)
-> Show ListPipelineExecutionSteps
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListPipelineExecutionSteps] -> ShowS
$cshowList :: [ListPipelineExecutionSteps] -> ShowS
show :: ListPipelineExecutionSteps -> String
$cshow :: ListPipelineExecutionSteps -> String
showsPrec :: Int -> ListPipelineExecutionSteps -> ShowS
$cshowsPrec :: Int -> ListPipelineExecutionSteps -> ShowS
Prelude.Show, (forall x.
 ListPipelineExecutionSteps -> Rep ListPipelineExecutionSteps x)
-> (forall x.
    Rep ListPipelineExecutionSteps x -> ListPipelineExecutionSteps)
-> Generic ListPipelineExecutionSteps
forall x.
Rep ListPipelineExecutionSteps x -> ListPipelineExecutionSteps
forall x.
ListPipelineExecutionSteps -> Rep ListPipelineExecutionSteps x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListPipelineExecutionSteps x -> ListPipelineExecutionSteps
$cfrom :: forall x.
ListPipelineExecutionSteps -> Rep ListPipelineExecutionSteps x
Prelude.Generic)

-- |
-- Create a value of 'ListPipelineExecutionSteps' 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:
--
-- 'pipelineExecutionArn', 'listPipelineExecutionSteps_pipelineExecutionArn' - The Amazon Resource Name (ARN) of the pipeline execution.
--
-- 'nextToken', 'listPipelineExecutionSteps_nextToken' - If the result of the previous @ListPipelineExecutionSteps@ request was
-- truncated, the response includes a @NextToken@. To retrieve the next set
-- of pipeline execution steps, use the token in the next request.
--
-- 'sortOrder', 'listPipelineExecutionSteps_sortOrder' - The field by which to sort results. The default is @CreatedTime@.
--
-- 'maxResults', 'listPipelineExecutionSteps_maxResults' - The maximum number of pipeline execution steps to return in the
-- response.
newListPipelineExecutionSteps ::
  ListPipelineExecutionSteps
newListPipelineExecutionSteps :: ListPipelineExecutionSteps
newListPipelineExecutionSteps =
  ListPipelineExecutionSteps' :: Maybe Text
-> Maybe Text
-> Maybe SortOrder
-> Maybe Natural
-> ListPipelineExecutionSteps
ListPipelineExecutionSteps'
    { $sel:pipelineExecutionArn:ListPipelineExecutionSteps' :: Maybe Text
pipelineExecutionArn =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListPipelineExecutionSteps' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:sortOrder:ListPipelineExecutionSteps' :: Maybe SortOrder
sortOrder = Maybe SortOrder
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListPipelineExecutionSteps' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Resource Name (ARN) of the pipeline execution.
listPipelineExecutionSteps_pipelineExecutionArn :: Lens.Lens' ListPipelineExecutionSteps (Prelude.Maybe Prelude.Text)
listPipelineExecutionSteps_pipelineExecutionArn :: (Maybe Text -> f (Maybe Text))
-> ListPipelineExecutionSteps -> f ListPipelineExecutionSteps
listPipelineExecutionSteps_pipelineExecutionArn = (ListPipelineExecutionSteps -> Maybe Text)
-> (ListPipelineExecutionSteps
    -> Maybe Text -> ListPipelineExecutionSteps)
-> Lens
     ListPipelineExecutionSteps
     ListPipelineExecutionSteps
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPipelineExecutionSteps' {Maybe Text
pipelineExecutionArn :: Maybe Text
$sel:pipelineExecutionArn:ListPipelineExecutionSteps' :: ListPipelineExecutionSteps -> Maybe Text
pipelineExecutionArn} -> Maybe Text
pipelineExecutionArn) (\s :: ListPipelineExecutionSteps
s@ListPipelineExecutionSteps' {} Maybe Text
a -> ListPipelineExecutionSteps
s {$sel:pipelineExecutionArn:ListPipelineExecutionSteps' :: Maybe Text
pipelineExecutionArn = Maybe Text
a} :: ListPipelineExecutionSteps)

-- | If the result of the previous @ListPipelineExecutionSteps@ request was
-- truncated, the response includes a @NextToken@. To retrieve the next set
-- of pipeline execution steps, use the token in the next request.
listPipelineExecutionSteps_nextToken :: Lens.Lens' ListPipelineExecutionSteps (Prelude.Maybe Prelude.Text)
listPipelineExecutionSteps_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListPipelineExecutionSteps -> f ListPipelineExecutionSteps
listPipelineExecutionSteps_nextToken = (ListPipelineExecutionSteps -> Maybe Text)
-> (ListPipelineExecutionSteps
    -> Maybe Text -> ListPipelineExecutionSteps)
-> Lens
     ListPipelineExecutionSteps
     ListPipelineExecutionSteps
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPipelineExecutionSteps' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListPipelineExecutionSteps' :: ListPipelineExecutionSteps -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListPipelineExecutionSteps
s@ListPipelineExecutionSteps' {} Maybe Text
a -> ListPipelineExecutionSteps
s {$sel:nextToken:ListPipelineExecutionSteps' :: Maybe Text
nextToken = Maybe Text
a} :: ListPipelineExecutionSteps)

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

-- | The maximum number of pipeline execution steps to return in the
-- response.
listPipelineExecutionSteps_maxResults :: Lens.Lens' ListPipelineExecutionSteps (Prelude.Maybe Prelude.Natural)
listPipelineExecutionSteps_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListPipelineExecutionSteps -> f ListPipelineExecutionSteps
listPipelineExecutionSteps_maxResults = (ListPipelineExecutionSteps -> Maybe Natural)
-> (ListPipelineExecutionSteps
    -> Maybe Natural -> ListPipelineExecutionSteps)
-> Lens
     ListPipelineExecutionSteps
     ListPipelineExecutionSteps
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPipelineExecutionSteps' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListPipelineExecutionSteps' :: ListPipelineExecutionSteps -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListPipelineExecutionSteps
s@ListPipelineExecutionSteps' {} Maybe Natural
a -> ListPipelineExecutionSteps
s {$sel:maxResults:ListPipelineExecutionSteps' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListPipelineExecutionSteps)

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

instance Prelude.NFData ListPipelineExecutionSteps

instance Core.ToHeaders ListPipelineExecutionSteps where
  toHeaders :: ListPipelineExecutionSteps -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListPipelineExecutionSteps -> 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.ListPipelineExecutionSteps" ::
                          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 ListPipelineExecutionSteps where
  toJSON :: ListPipelineExecutionSteps -> Value
toJSON ListPipelineExecutionSteps' {Maybe Natural
Maybe Text
Maybe SortOrder
maxResults :: Maybe Natural
sortOrder :: Maybe SortOrder
nextToken :: Maybe Text
pipelineExecutionArn :: Maybe Text
$sel:maxResults:ListPipelineExecutionSteps' :: ListPipelineExecutionSteps -> Maybe Natural
$sel:sortOrder:ListPipelineExecutionSteps' :: ListPipelineExecutionSteps -> Maybe SortOrder
$sel:nextToken:ListPipelineExecutionSteps' :: ListPipelineExecutionSteps -> Maybe Text
$sel:pipelineExecutionArn:ListPipelineExecutionSteps' :: ListPipelineExecutionSteps -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"PipelineExecutionArn" 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
pipelineExecutionArn,
            (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
          ]
      )

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

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

-- | /See:/ 'newListPipelineExecutionStepsResponse' smart constructor.
data ListPipelineExecutionStepsResponse = ListPipelineExecutionStepsResponse'
  { -- | A list of @PipeLineExecutionStep@ objects. Each @PipeLineExecutionStep@
    -- consists of StepName, StartTime, EndTime, StepStatus, and Metadata.
    -- Metadata is an object with properties for each job that contains
    -- relevant information about the job created by the step.
    ListPipelineExecutionStepsResponse -> Maybe [PipelineExecutionStep]
pipelineExecutionSteps :: Prelude.Maybe [PipelineExecutionStep],
    -- | If the result of the previous @ListPipelineExecutionSteps@ request was
    -- truncated, the response includes a @NextToken@. To retrieve the next set
    -- of pipeline execution steps, use the token in the next request.
    ListPipelineExecutionStepsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListPipelineExecutionStepsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListPipelineExecutionStepsResponse
-> ListPipelineExecutionStepsResponse -> Bool
(ListPipelineExecutionStepsResponse
 -> ListPipelineExecutionStepsResponse -> Bool)
-> (ListPipelineExecutionStepsResponse
    -> ListPipelineExecutionStepsResponse -> Bool)
-> Eq ListPipelineExecutionStepsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListPipelineExecutionStepsResponse
-> ListPipelineExecutionStepsResponse -> Bool
$c/= :: ListPipelineExecutionStepsResponse
-> ListPipelineExecutionStepsResponse -> Bool
== :: ListPipelineExecutionStepsResponse
-> ListPipelineExecutionStepsResponse -> Bool
$c== :: ListPipelineExecutionStepsResponse
-> ListPipelineExecutionStepsResponse -> Bool
Prelude.Eq, ReadPrec [ListPipelineExecutionStepsResponse]
ReadPrec ListPipelineExecutionStepsResponse
Int -> ReadS ListPipelineExecutionStepsResponse
ReadS [ListPipelineExecutionStepsResponse]
(Int -> ReadS ListPipelineExecutionStepsResponse)
-> ReadS [ListPipelineExecutionStepsResponse]
-> ReadPrec ListPipelineExecutionStepsResponse
-> ReadPrec [ListPipelineExecutionStepsResponse]
-> Read ListPipelineExecutionStepsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListPipelineExecutionStepsResponse]
$creadListPrec :: ReadPrec [ListPipelineExecutionStepsResponse]
readPrec :: ReadPrec ListPipelineExecutionStepsResponse
$creadPrec :: ReadPrec ListPipelineExecutionStepsResponse
readList :: ReadS [ListPipelineExecutionStepsResponse]
$creadList :: ReadS [ListPipelineExecutionStepsResponse]
readsPrec :: Int -> ReadS ListPipelineExecutionStepsResponse
$creadsPrec :: Int -> ReadS ListPipelineExecutionStepsResponse
Prelude.Read, Int -> ListPipelineExecutionStepsResponse -> ShowS
[ListPipelineExecutionStepsResponse] -> ShowS
ListPipelineExecutionStepsResponse -> String
(Int -> ListPipelineExecutionStepsResponse -> ShowS)
-> (ListPipelineExecutionStepsResponse -> String)
-> ([ListPipelineExecutionStepsResponse] -> ShowS)
-> Show ListPipelineExecutionStepsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListPipelineExecutionStepsResponse] -> ShowS
$cshowList :: [ListPipelineExecutionStepsResponse] -> ShowS
show :: ListPipelineExecutionStepsResponse -> String
$cshow :: ListPipelineExecutionStepsResponse -> String
showsPrec :: Int -> ListPipelineExecutionStepsResponse -> ShowS
$cshowsPrec :: Int -> ListPipelineExecutionStepsResponse -> ShowS
Prelude.Show, (forall x.
 ListPipelineExecutionStepsResponse
 -> Rep ListPipelineExecutionStepsResponse x)
-> (forall x.
    Rep ListPipelineExecutionStepsResponse x
    -> ListPipelineExecutionStepsResponse)
-> Generic ListPipelineExecutionStepsResponse
forall x.
Rep ListPipelineExecutionStepsResponse x
-> ListPipelineExecutionStepsResponse
forall x.
ListPipelineExecutionStepsResponse
-> Rep ListPipelineExecutionStepsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListPipelineExecutionStepsResponse x
-> ListPipelineExecutionStepsResponse
$cfrom :: forall x.
ListPipelineExecutionStepsResponse
-> Rep ListPipelineExecutionStepsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListPipelineExecutionStepsResponse' 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:
--
-- 'pipelineExecutionSteps', 'listPipelineExecutionStepsResponse_pipelineExecutionSteps' - A list of @PipeLineExecutionStep@ objects. Each @PipeLineExecutionStep@
-- consists of StepName, StartTime, EndTime, StepStatus, and Metadata.
-- Metadata is an object with properties for each job that contains
-- relevant information about the job created by the step.
--
-- 'nextToken', 'listPipelineExecutionStepsResponse_nextToken' - If the result of the previous @ListPipelineExecutionSteps@ request was
-- truncated, the response includes a @NextToken@. To retrieve the next set
-- of pipeline execution steps, use the token in the next request.
--
-- 'httpStatus', 'listPipelineExecutionStepsResponse_httpStatus' - The response's http status code.
newListPipelineExecutionStepsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListPipelineExecutionStepsResponse
newListPipelineExecutionStepsResponse :: Int -> ListPipelineExecutionStepsResponse
newListPipelineExecutionStepsResponse Int
pHttpStatus_ =
  ListPipelineExecutionStepsResponse' :: Maybe [PipelineExecutionStep]
-> Maybe Text -> Int -> ListPipelineExecutionStepsResponse
ListPipelineExecutionStepsResponse'
    { $sel:pipelineExecutionSteps:ListPipelineExecutionStepsResponse' :: Maybe [PipelineExecutionStep]
pipelineExecutionSteps =
        Maybe [PipelineExecutionStep]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListPipelineExecutionStepsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListPipelineExecutionStepsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A list of @PipeLineExecutionStep@ objects. Each @PipeLineExecutionStep@
-- consists of StepName, StartTime, EndTime, StepStatus, and Metadata.
-- Metadata is an object with properties for each job that contains
-- relevant information about the job created by the step.
listPipelineExecutionStepsResponse_pipelineExecutionSteps :: Lens.Lens' ListPipelineExecutionStepsResponse (Prelude.Maybe [PipelineExecutionStep])
listPipelineExecutionStepsResponse_pipelineExecutionSteps :: (Maybe [PipelineExecutionStep]
 -> f (Maybe [PipelineExecutionStep]))
-> ListPipelineExecutionStepsResponse
-> f ListPipelineExecutionStepsResponse
listPipelineExecutionStepsResponse_pipelineExecutionSteps = (ListPipelineExecutionStepsResponse
 -> Maybe [PipelineExecutionStep])
-> (ListPipelineExecutionStepsResponse
    -> Maybe [PipelineExecutionStep]
    -> ListPipelineExecutionStepsResponse)
-> Lens'
     ListPipelineExecutionStepsResponse (Maybe [PipelineExecutionStep])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPipelineExecutionStepsResponse' {Maybe [PipelineExecutionStep]
pipelineExecutionSteps :: Maybe [PipelineExecutionStep]
$sel:pipelineExecutionSteps:ListPipelineExecutionStepsResponse' :: ListPipelineExecutionStepsResponse -> Maybe [PipelineExecutionStep]
pipelineExecutionSteps} -> Maybe [PipelineExecutionStep]
pipelineExecutionSteps) (\s :: ListPipelineExecutionStepsResponse
s@ListPipelineExecutionStepsResponse' {} Maybe [PipelineExecutionStep]
a -> ListPipelineExecutionStepsResponse
s {$sel:pipelineExecutionSteps:ListPipelineExecutionStepsResponse' :: Maybe [PipelineExecutionStep]
pipelineExecutionSteps = Maybe [PipelineExecutionStep]
a} :: ListPipelineExecutionStepsResponse) ((Maybe [PipelineExecutionStep]
  -> f (Maybe [PipelineExecutionStep]))
 -> ListPipelineExecutionStepsResponse
 -> f ListPipelineExecutionStepsResponse)
-> ((Maybe [PipelineExecutionStep]
     -> f (Maybe [PipelineExecutionStep]))
    -> Maybe [PipelineExecutionStep]
    -> f (Maybe [PipelineExecutionStep]))
-> (Maybe [PipelineExecutionStep]
    -> f (Maybe [PipelineExecutionStep]))
-> ListPipelineExecutionStepsResponse
-> f ListPipelineExecutionStepsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [PipelineExecutionStep]
  [PipelineExecutionStep]
  [PipelineExecutionStep]
  [PipelineExecutionStep]
-> Iso
     (Maybe [PipelineExecutionStep])
     (Maybe [PipelineExecutionStep])
     (Maybe [PipelineExecutionStep])
     (Maybe [PipelineExecutionStep])
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
  [PipelineExecutionStep]
  [PipelineExecutionStep]
  [PipelineExecutionStep]
  [PipelineExecutionStep]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | If the result of the previous @ListPipelineExecutionSteps@ request was
-- truncated, the response includes a @NextToken@. To retrieve the next set
-- of pipeline execution steps, use the token in the next request.
listPipelineExecutionStepsResponse_nextToken :: Lens.Lens' ListPipelineExecutionStepsResponse (Prelude.Maybe Prelude.Text)
listPipelineExecutionStepsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListPipelineExecutionStepsResponse
-> f ListPipelineExecutionStepsResponse
listPipelineExecutionStepsResponse_nextToken = (ListPipelineExecutionStepsResponse -> Maybe Text)
-> (ListPipelineExecutionStepsResponse
    -> Maybe Text -> ListPipelineExecutionStepsResponse)
-> Lens' ListPipelineExecutionStepsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPipelineExecutionStepsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListPipelineExecutionStepsResponse' :: ListPipelineExecutionStepsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListPipelineExecutionStepsResponse
s@ListPipelineExecutionStepsResponse' {} Maybe Text
a -> ListPipelineExecutionStepsResponse
s {$sel:nextToken:ListPipelineExecutionStepsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListPipelineExecutionStepsResponse)

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

instance
  Prelude.NFData
    ListPipelineExecutionStepsResponse