{-# 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.SSM.DescribeAutomationStepExecutions
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Information about all active and terminated step executions in an
-- Automation workflow.
--
-- This operation returns paginated results.
module Amazonka.SSM.DescribeAutomationStepExecutions
  ( -- * Creating a Request
    DescribeAutomationStepExecutions (..),
    newDescribeAutomationStepExecutions,

    -- * Request Lenses
    describeAutomationStepExecutions_filters,
    describeAutomationStepExecutions_maxResults,
    describeAutomationStepExecutions_nextToken,
    describeAutomationStepExecutions_reverseOrder,
    describeAutomationStepExecutions_automationExecutionId,

    -- * Destructuring the Response
    DescribeAutomationStepExecutionsResponse (..),
    newDescribeAutomationStepExecutionsResponse,

    -- * Response Lenses
    describeAutomationStepExecutionsResponse_nextToken,
    describeAutomationStepExecutionsResponse_stepExecutions,
    describeAutomationStepExecutionsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.SSM.Types

-- | /See:/ 'newDescribeAutomationStepExecutions' smart constructor.
data DescribeAutomationStepExecutions = DescribeAutomationStepExecutions'
  { -- | One or more filters to limit the number of step executions returned by
    -- the request.
    DescribeAutomationStepExecutions
-> Maybe (NonEmpty StepExecutionFilter)
filters :: Prelude.Maybe (Prelude.NonEmpty StepExecutionFilter),
    -- | The maximum number of items to return for this call. The call also
    -- returns a token that you can specify in a subsequent call to get the
    -- next set of results.
    DescribeAutomationStepExecutions -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The token for the next set of items to return. (You received this token
    -- from a previous call.)
    DescribeAutomationStepExecutions -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Indicates whether to list step executions in reverse order by start
    -- time. The default value is \'false\'.
    DescribeAutomationStepExecutions -> Maybe Bool
reverseOrder :: Prelude.Maybe Prelude.Bool,
    -- | The Automation execution ID for which you want step execution
    -- descriptions.
    DescribeAutomationStepExecutions -> Text
automationExecutionId :: Prelude.Text
  }
  deriving (DescribeAutomationStepExecutions
-> DescribeAutomationStepExecutions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeAutomationStepExecutions
-> DescribeAutomationStepExecutions -> Bool
$c/= :: DescribeAutomationStepExecutions
-> DescribeAutomationStepExecutions -> Bool
== :: DescribeAutomationStepExecutions
-> DescribeAutomationStepExecutions -> Bool
$c== :: DescribeAutomationStepExecutions
-> DescribeAutomationStepExecutions -> Bool
Prelude.Eq, ReadPrec [DescribeAutomationStepExecutions]
ReadPrec DescribeAutomationStepExecutions
Int -> ReadS DescribeAutomationStepExecutions
ReadS [DescribeAutomationStepExecutions]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeAutomationStepExecutions]
$creadListPrec :: ReadPrec [DescribeAutomationStepExecutions]
readPrec :: ReadPrec DescribeAutomationStepExecutions
$creadPrec :: ReadPrec DescribeAutomationStepExecutions
readList :: ReadS [DescribeAutomationStepExecutions]
$creadList :: ReadS [DescribeAutomationStepExecutions]
readsPrec :: Int -> ReadS DescribeAutomationStepExecutions
$creadsPrec :: Int -> ReadS DescribeAutomationStepExecutions
Prelude.Read, Int -> DescribeAutomationStepExecutions -> ShowS
[DescribeAutomationStepExecutions] -> ShowS
DescribeAutomationStepExecutions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeAutomationStepExecutions] -> ShowS
$cshowList :: [DescribeAutomationStepExecutions] -> ShowS
show :: DescribeAutomationStepExecutions -> String
$cshow :: DescribeAutomationStepExecutions -> String
showsPrec :: Int -> DescribeAutomationStepExecutions -> ShowS
$cshowsPrec :: Int -> DescribeAutomationStepExecutions -> ShowS
Prelude.Show, forall x.
Rep DescribeAutomationStepExecutions x
-> DescribeAutomationStepExecutions
forall x.
DescribeAutomationStepExecutions
-> Rep DescribeAutomationStepExecutions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeAutomationStepExecutions x
-> DescribeAutomationStepExecutions
$cfrom :: forall x.
DescribeAutomationStepExecutions
-> Rep DescribeAutomationStepExecutions x
Prelude.Generic)

-- |
-- Create a value of 'DescribeAutomationStepExecutions' 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:
--
-- 'filters', 'describeAutomationStepExecutions_filters' - One or more filters to limit the number of step executions returned by
-- the request.
--
-- 'maxResults', 'describeAutomationStepExecutions_maxResults' - The maximum number of items to return for this call. The call also
-- returns a token that you can specify in a subsequent call to get the
-- next set of results.
--
-- 'nextToken', 'describeAutomationStepExecutions_nextToken' - The token for the next set of items to return. (You received this token
-- from a previous call.)
--
-- 'reverseOrder', 'describeAutomationStepExecutions_reverseOrder' - Indicates whether to list step executions in reverse order by start
-- time. The default value is \'false\'.
--
-- 'automationExecutionId', 'describeAutomationStepExecutions_automationExecutionId' - The Automation execution ID for which you want step execution
-- descriptions.
newDescribeAutomationStepExecutions ::
  -- | 'automationExecutionId'
  Prelude.Text ->
  DescribeAutomationStepExecutions
newDescribeAutomationStepExecutions :: Text -> DescribeAutomationStepExecutions
newDescribeAutomationStepExecutions
  Text
pAutomationExecutionId_ =
    DescribeAutomationStepExecutions'
      { $sel:filters:DescribeAutomationStepExecutions' :: Maybe (NonEmpty StepExecutionFilter)
filters =
          forall a. Maybe a
Prelude.Nothing,
        $sel:maxResults:DescribeAutomationStepExecutions' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
        $sel:nextToken:DescribeAutomationStepExecutions' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
        $sel:reverseOrder:DescribeAutomationStepExecutions' :: Maybe Bool
reverseOrder = forall a. Maybe a
Prelude.Nothing,
        $sel:automationExecutionId:DescribeAutomationStepExecutions' :: Text
automationExecutionId =
          Text
pAutomationExecutionId_
      }

-- | One or more filters to limit the number of step executions returned by
-- the request.
describeAutomationStepExecutions_filters :: Lens.Lens' DescribeAutomationStepExecutions (Prelude.Maybe (Prelude.NonEmpty StepExecutionFilter))
describeAutomationStepExecutions_filters :: Lens'
  DescribeAutomationStepExecutions
  (Maybe (NonEmpty StepExecutionFilter))
describeAutomationStepExecutions_filters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAutomationStepExecutions' {Maybe (NonEmpty StepExecutionFilter)
filters :: Maybe (NonEmpty StepExecutionFilter)
$sel:filters:DescribeAutomationStepExecutions' :: DescribeAutomationStepExecutions
-> Maybe (NonEmpty StepExecutionFilter)
filters} -> Maybe (NonEmpty StepExecutionFilter)
filters) (\s :: DescribeAutomationStepExecutions
s@DescribeAutomationStepExecutions' {} Maybe (NonEmpty StepExecutionFilter)
a -> DescribeAutomationStepExecutions
s {$sel:filters:DescribeAutomationStepExecutions' :: Maybe (NonEmpty StepExecutionFilter)
filters = Maybe (NonEmpty StepExecutionFilter)
a} :: DescribeAutomationStepExecutions) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The maximum number of items to return for this call. The call also
-- returns a token that you can specify in a subsequent call to get the
-- next set of results.
describeAutomationStepExecutions_maxResults :: Lens.Lens' DescribeAutomationStepExecutions (Prelude.Maybe Prelude.Natural)
describeAutomationStepExecutions_maxResults :: Lens' DescribeAutomationStepExecutions (Maybe Natural)
describeAutomationStepExecutions_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAutomationStepExecutions' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:DescribeAutomationStepExecutions' :: DescribeAutomationStepExecutions -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: DescribeAutomationStepExecutions
s@DescribeAutomationStepExecutions' {} Maybe Natural
a -> DescribeAutomationStepExecutions
s {$sel:maxResults:DescribeAutomationStepExecutions' :: Maybe Natural
maxResults = Maybe Natural
a} :: DescribeAutomationStepExecutions)

-- | The token for the next set of items to return. (You received this token
-- from a previous call.)
describeAutomationStepExecutions_nextToken :: Lens.Lens' DescribeAutomationStepExecutions (Prelude.Maybe Prelude.Text)
describeAutomationStepExecutions_nextToken :: Lens' DescribeAutomationStepExecutions (Maybe Text)
describeAutomationStepExecutions_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAutomationStepExecutions' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeAutomationStepExecutions' :: DescribeAutomationStepExecutions -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeAutomationStepExecutions
s@DescribeAutomationStepExecutions' {} Maybe Text
a -> DescribeAutomationStepExecutions
s {$sel:nextToken:DescribeAutomationStepExecutions' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeAutomationStepExecutions)

-- | Indicates whether to list step executions in reverse order by start
-- time. The default value is \'false\'.
describeAutomationStepExecutions_reverseOrder :: Lens.Lens' DescribeAutomationStepExecutions (Prelude.Maybe Prelude.Bool)
describeAutomationStepExecutions_reverseOrder :: Lens' DescribeAutomationStepExecutions (Maybe Bool)
describeAutomationStepExecutions_reverseOrder = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAutomationStepExecutions' {Maybe Bool
reverseOrder :: Maybe Bool
$sel:reverseOrder:DescribeAutomationStepExecutions' :: DescribeAutomationStepExecutions -> Maybe Bool
reverseOrder} -> Maybe Bool
reverseOrder) (\s :: DescribeAutomationStepExecutions
s@DescribeAutomationStepExecutions' {} Maybe Bool
a -> DescribeAutomationStepExecutions
s {$sel:reverseOrder:DescribeAutomationStepExecutions' :: Maybe Bool
reverseOrder = Maybe Bool
a} :: DescribeAutomationStepExecutions)

-- | The Automation execution ID for which you want step execution
-- descriptions.
describeAutomationStepExecutions_automationExecutionId :: Lens.Lens' DescribeAutomationStepExecutions Prelude.Text
describeAutomationStepExecutions_automationExecutionId :: Lens' DescribeAutomationStepExecutions Text
describeAutomationStepExecutions_automationExecutionId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAutomationStepExecutions' {Text
automationExecutionId :: Text
$sel:automationExecutionId:DescribeAutomationStepExecutions' :: DescribeAutomationStepExecutions -> Text
automationExecutionId} -> Text
automationExecutionId) (\s :: DescribeAutomationStepExecutions
s@DescribeAutomationStepExecutions' {} Text
a -> DescribeAutomationStepExecutions
s {$sel:automationExecutionId:DescribeAutomationStepExecutions' :: Text
automationExecutionId = Text
a} :: DescribeAutomationStepExecutions)

instance
  Core.AWSPager
    DescribeAutomationStepExecutions
  where
  page :: DescribeAutomationStepExecutions
-> AWSResponse DescribeAutomationStepExecutions
-> Maybe DescribeAutomationStepExecutions
page DescribeAutomationStepExecutions
rq AWSResponse DescribeAutomationStepExecutions
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeAutomationStepExecutions
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeAutomationStepExecutionsResponse (Maybe Text)
describeAutomationStepExecutionsResponse_nextToken
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeAutomationStepExecutions
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
  DescribeAutomationStepExecutionsResponse (Maybe [StepExecution])
describeAutomationStepExecutionsResponse_stepExecutions
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ DescribeAutomationStepExecutions
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' DescribeAutomationStepExecutions (Maybe Text)
describeAutomationStepExecutions_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeAutomationStepExecutions
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeAutomationStepExecutionsResponse (Maybe Text)
describeAutomationStepExecutionsResponse_nextToken
          forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance
  Core.AWSRequest
    DescribeAutomationStepExecutions
  where
  type
    AWSResponse DescribeAutomationStepExecutions =
      DescribeAutomationStepExecutionsResponse
  request :: (Service -> Service)
-> DescribeAutomationStepExecutions
-> Request DescribeAutomationStepExecutions
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DescribeAutomationStepExecutions
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse DescribeAutomationStepExecutions)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe [StepExecution]
-> Int
-> DescribeAutomationStepExecutionsResponse
DescribeAutomationStepExecutionsResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"NextToken")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"StepExecutions" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance
  Prelude.Hashable
    DescribeAutomationStepExecutions
  where
  hashWithSalt :: Int -> DescribeAutomationStepExecutions -> Int
hashWithSalt
    Int
_salt
    DescribeAutomationStepExecutions' {Maybe Bool
Maybe Natural
Maybe (NonEmpty StepExecutionFilter)
Maybe Text
Text
automationExecutionId :: Text
reverseOrder :: Maybe Bool
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe (NonEmpty StepExecutionFilter)
$sel:automationExecutionId:DescribeAutomationStepExecutions' :: DescribeAutomationStepExecutions -> Text
$sel:reverseOrder:DescribeAutomationStepExecutions' :: DescribeAutomationStepExecutions -> Maybe Bool
$sel:nextToken:DescribeAutomationStepExecutions' :: DescribeAutomationStepExecutions -> Maybe Text
$sel:maxResults:DescribeAutomationStepExecutions' :: DescribeAutomationStepExecutions -> Maybe Natural
$sel:filters:DescribeAutomationStepExecutions' :: DescribeAutomationStepExecutions
-> Maybe (NonEmpty StepExecutionFilter)
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty StepExecutionFilter)
filters
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
reverseOrder
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
automationExecutionId

instance
  Prelude.NFData
    DescribeAutomationStepExecutions
  where
  rnf :: DescribeAutomationStepExecutions -> ()
rnf DescribeAutomationStepExecutions' {Maybe Bool
Maybe Natural
Maybe (NonEmpty StepExecutionFilter)
Maybe Text
Text
automationExecutionId :: Text
reverseOrder :: Maybe Bool
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe (NonEmpty StepExecutionFilter)
$sel:automationExecutionId:DescribeAutomationStepExecutions' :: DescribeAutomationStepExecutions -> Text
$sel:reverseOrder:DescribeAutomationStepExecutions' :: DescribeAutomationStepExecutions -> Maybe Bool
$sel:nextToken:DescribeAutomationStepExecutions' :: DescribeAutomationStepExecutions -> Maybe Text
$sel:maxResults:DescribeAutomationStepExecutions' :: DescribeAutomationStepExecutions -> Maybe Natural
$sel:filters:DescribeAutomationStepExecutions' :: DescribeAutomationStepExecutions
-> Maybe (NonEmpty StepExecutionFilter)
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty StepExecutionFilter)
filters
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
reverseOrder
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
automationExecutionId

instance
  Data.ToHeaders
    DescribeAutomationStepExecutions
  where
  toHeaders :: DescribeAutomationStepExecutions -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"AmazonSSM.DescribeAutomationStepExecutions" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON DescribeAutomationStepExecutions where
  toJSON :: DescribeAutomationStepExecutions -> Value
toJSON DescribeAutomationStepExecutions' {Maybe Bool
Maybe Natural
Maybe (NonEmpty StepExecutionFilter)
Maybe Text
Text
automationExecutionId :: Text
reverseOrder :: Maybe Bool
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe (NonEmpty StepExecutionFilter)
$sel:automationExecutionId:DescribeAutomationStepExecutions' :: DescribeAutomationStepExecutions -> Text
$sel:reverseOrder:DescribeAutomationStepExecutions' :: DescribeAutomationStepExecutions -> Maybe Bool
$sel:nextToken:DescribeAutomationStepExecutions' :: DescribeAutomationStepExecutions -> Maybe Text
$sel:maxResults:DescribeAutomationStepExecutions' :: DescribeAutomationStepExecutions -> Maybe Natural
$sel:filters:DescribeAutomationStepExecutions' :: DescribeAutomationStepExecutions
-> Maybe (NonEmpty StepExecutionFilter)
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"Filters" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty StepExecutionFilter)
filters,
            (Key
"MaxResults" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
            (Key
"NextToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            (Key
"ReverseOrder" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
reverseOrder,
            forall a. a -> Maybe a
Prelude.Just
              ( Key
"AutomationExecutionId"
                  forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
automationExecutionId
              )
          ]
      )

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

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

-- | /See:/ 'newDescribeAutomationStepExecutionsResponse' smart constructor.
data DescribeAutomationStepExecutionsResponse = DescribeAutomationStepExecutionsResponse'
  { -- | The token to use when requesting the next set of items. If there are no
    -- additional items to return, the string is empty.
    DescribeAutomationStepExecutionsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | A list of details about the current state of all steps that make up an
    -- execution.
    DescribeAutomationStepExecutionsResponse -> Maybe [StepExecution]
stepExecutions :: Prelude.Maybe [StepExecution],
    -- | The response's http status code.
    DescribeAutomationStepExecutionsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeAutomationStepExecutionsResponse
-> DescribeAutomationStepExecutionsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeAutomationStepExecutionsResponse
-> DescribeAutomationStepExecutionsResponse -> Bool
$c/= :: DescribeAutomationStepExecutionsResponse
-> DescribeAutomationStepExecutionsResponse -> Bool
== :: DescribeAutomationStepExecutionsResponse
-> DescribeAutomationStepExecutionsResponse -> Bool
$c== :: DescribeAutomationStepExecutionsResponse
-> DescribeAutomationStepExecutionsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeAutomationStepExecutionsResponse]
ReadPrec DescribeAutomationStepExecutionsResponse
Int -> ReadS DescribeAutomationStepExecutionsResponse
ReadS [DescribeAutomationStepExecutionsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeAutomationStepExecutionsResponse]
$creadListPrec :: ReadPrec [DescribeAutomationStepExecutionsResponse]
readPrec :: ReadPrec DescribeAutomationStepExecutionsResponse
$creadPrec :: ReadPrec DescribeAutomationStepExecutionsResponse
readList :: ReadS [DescribeAutomationStepExecutionsResponse]
$creadList :: ReadS [DescribeAutomationStepExecutionsResponse]
readsPrec :: Int -> ReadS DescribeAutomationStepExecutionsResponse
$creadsPrec :: Int -> ReadS DescribeAutomationStepExecutionsResponse
Prelude.Read, Int -> DescribeAutomationStepExecutionsResponse -> ShowS
[DescribeAutomationStepExecutionsResponse] -> ShowS
DescribeAutomationStepExecutionsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeAutomationStepExecutionsResponse] -> ShowS
$cshowList :: [DescribeAutomationStepExecutionsResponse] -> ShowS
show :: DescribeAutomationStepExecutionsResponse -> String
$cshow :: DescribeAutomationStepExecutionsResponse -> String
showsPrec :: Int -> DescribeAutomationStepExecutionsResponse -> ShowS
$cshowsPrec :: Int -> DescribeAutomationStepExecutionsResponse -> ShowS
Prelude.Show, forall x.
Rep DescribeAutomationStepExecutionsResponse x
-> DescribeAutomationStepExecutionsResponse
forall x.
DescribeAutomationStepExecutionsResponse
-> Rep DescribeAutomationStepExecutionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeAutomationStepExecutionsResponse x
-> DescribeAutomationStepExecutionsResponse
$cfrom :: forall x.
DescribeAutomationStepExecutionsResponse
-> Rep DescribeAutomationStepExecutionsResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeAutomationStepExecutionsResponse' 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', 'describeAutomationStepExecutionsResponse_nextToken' - The token to use when requesting the next set of items. If there are no
-- additional items to return, the string is empty.
--
-- 'stepExecutions', 'describeAutomationStepExecutionsResponse_stepExecutions' - A list of details about the current state of all steps that make up an
-- execution.
--
-- 'httpStatus', 'describeAutomationStepExecutionsResponse_httpStatus' - The response's http status code.
newDescribeAutomationStepExecutionsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeAutomationStepExecutionsResponse
newDescribeAutomationStepExecutionsResponse :: Int -> DescribeAutomationStepExecutionsResponse
newDescribeAutomationStepExecutionsResponse
  Int
pHttpStatus_ =
    DescribeAutomationStepExecutionsResponse'
      { $sel:nextToken:DescribeAutomationStepExecutionsResponse' :: Maybe Text
nextToken =
          forall a. Maybe a
Prelude.Nothing,
        $sel:stepExecutions:DescribeAutomationStepExecutionsResponse' :: Maybe [StepExecution]
stepExecutions = forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:DescribeAutomationStepExecutionsResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | The token to use when requesting the next set of items. If there are no
-- additional items to return, the string is empty.
describeAutomationStepExecutionsResponse_nextToken :: Lens.Lens' DescribeAutomationStepExecutionsResponse (Prelude.Maybe Prelude.Text)
describeAutomationStepExecutionsResponse_nextToken :: Lens' DescribeAutomationStepExecutionsResponse (Maybe Text)
describeAutomationStepExecutionsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAutomationStepExecutionsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeAutomationStepExecutionsResponse' :: DescribeAutomationStepExecutionsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeAutomationStepExecutionsResponse
s@DescribeAutomationStepExecutionsResponse' {} Maybe Text
a -> DescribeAutomationStepExecutionsResponse
s {$sel:nextToken:DescribeAutomationStepExecutionsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeAutomationStepExecutionsResponse)

-- | A list of details about the current state of all steps that make up an
-- execution.
describeAutomationStepExecutionsResponse_stepExecutions :: Lens.Lens' DescribeAutomationStepExecutionsResponse (Prelude.Maybe [StepExecution])
describeAutomationStepExecutionsResponse_stepExecutions :: Lens'
  DescribeAutomationStepExecutionsResponse (Maybe [StepExecution])
describeAutomationStepExecutionsResponse_stepExecutions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAutomationStepExecutionsResponse' {Maybe [StepExecution]
stepExecutions :: Maybe [StepExecution]
$sel:stepExecutions:DescribeAutomationStepExecutionsResponse' :: DescribeAutomationStepExecutionsResponse -> Maybe [StepExecution]
stepExecutions} -> Maybe [StepExecution]
stepExecutions) (\s :: DescribeAutomationStepExecutionsResponse
s@DescribeAutomationStepExecutionsResponse' {} Maybe [StepExecution]
a -> DescribeAutomationStepExecutionsResponse
s {$sel:stepExecutions:DescribeAutomationStepExecutionsResponse' :: Maybe [StepExecution]
stepExecutions = Maybe [StepExecution]
a} :: DescribeAutomationStepExecutionsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    DescribeAutomationStepExecutionsResponse
  where
  rnf :: DescribeAutomationStepExecutionsResponse -> ()
rnf DescribeAutomationStepExecutionsResponse' {Int
Maybe [StepExecution]
Maybe Text
httpStatus :: Int
stepExecutions :: Maybe [StepExecution]
nextToken :: Maybe Text
$sel:httpStatus:DescribeAutomationStepExecutionsResponse' :: DescribeAutomationStepExecutionsResponse -> Int
$sel:stepExecutions:DescribeAutomationStepExecutionsResponse' :: DescribeAutomationStepExecutionsResponse -> Maybe [StepExecution]
$sel:nextToken:DescribeAutomationStepExecutionsResponse' :: DescribeAutomationStepExecutionsResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [StepExecution]
stepExecutions
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus