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

    -- * Request Lenses
    describeAutomationExecutions_filters,
    describeAutomationExecutions_maxResults,
    describeAutomationExecutions_nextToken,

    -- * Destructuring the Response
    DescribeAutomationExecutionsResponse (..),
    newDescribeAutomationExecutionsResponse,

    -- * Response Lenses
    describeAutomationExecutionsResponse_automationExecutionMetadataList,
    describeAutomationExecutionsResponse_nextToken,
    describeAutomationExecutionsResponse_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:/ 'newDescribeAutomationExecutions' smart constructor.
data DescribeAutomationExecutions = DescribeAutomationExecutions'
  { -- | Filters used to limit the scope of executions that are requested.
    DescribeAutomationExecutions
-> Maybe (NonEmpty AutomationExecutionFilter)
filters :: Prelude.Maybe (Prelude.NonEmpty AutomationExecutionFilter),
    -- | 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.
    DescribeAutomationExecutions -> 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.)
    DescribeAutomationExecutions -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
  }
  deriving (DescribeAutomationExecutions
-> DescribeAutomationExecutions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeAutomationExecutions
-> DescribeAutomationExecutions -> Bool
$c/= :: DescribeAutomationExecutions
-> DescribeAutomationExecutions -> Bool
== :: DescribeAutomationExecutions
-> DescribeAutomationExecutions -> Bool
$c== :: DescribeAutomationExecutions
-> DescribeAutomationExecutions -> Bool
Prelude.Eq, ReadPrec [DescribeAutomationExecutions]
ReadPrec DescribeAutomationExecutions
Int -> ReadS DescribeAutomationExecutions
ReadS [DescribeAutomationExecutions]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeAutomationExecutions]
$creadListPrec :: ReadPrec [DescribeAutomationExecutions]
readPrec :: ReadPrec DescribeAutomationExecutions
$creadPrec :: ReadPrec DescribeAutomationExecutions
readList :: ReadS [DescribeAutomationExecutions]
$creadList :: ReadS [DescribeAutomationExecutions]
readsPrec :: Int -> ReadS DescribeAutomationExecutions
$creadsPrec :: Int -> ReadS DescribeAutomationExecutions
Prelude.Read, Int -> DescribeAutomationExecutions -> ShowS
[DescribeAutomationExecutions] -> ShowS
DescribeAutomationExecutions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeAutomationExecutions] -> ShowS
$cshowList :: [DescribeAutomationExecutions] -> ShowS
show :: DescribeAutomationExecutions -> String
$cshow :: DescribeAutomationExecutions -> String
showsPrec :: Int -> DescribeAutomationExecutions -> ShowS
$cshowsPrec :: Int -> DescribeAutomationExecutions -> ShowS
Prelude.Show, forall x.
Rep DescribeAutomationExecutions x -> DescribeAutomationExecutions
forall x.
DescribeAutomationExecutions -> Rep DescribeAutomationExecutions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeAutomationExecutions x -> DescribeAutomationExecutions
$cfrom :: forall x.
DescribeAutomationExecutions -> Rep DescribeAutomationExecutions x
Prelude.Generic)

-- |
-- Create a value of 'DescribeAutomationExecutions' 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', 'describeAutomationExecutions_filters' - Filters used to limit the scope of executions that are requested.
--
-- 'maxResults', 'describeAutomationExecutions_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', 'describeAutomationExecutions_nextToken' - The token for the next set of items to return. (You received this token
-- from a previous call.)
newDescribeAutomationExecutions ::
  DescribeAutomationExecutions
newDescribeAutomationExecutions :: DescribeAutomationExecutions
newDescribeAutomationExecutions =
  DescribeAutomationExecutions'
    { $sel:filters:DescribeAutomationExecutions' :: Maybe (NonEmpty AutomationExecutionFilter)
filters =
        forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:DescribeAutomationExecutions' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeAutomationExecutions' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing
    }

-- | Filters used to limit the scope of executions that are requested.
describeAutomationExecutions_filters :: Lens.Lens' DescribeAutomationExecutions (Prelude.Maybe (Prelude.NonEmpty AutomationExecutionFilter))
describeAutomationExecutions_filters :: Lens'
  DescribeAutomationExecutions
  (Maybe (NonEmpty AutomationExecutionFilter))
describeAutomationExecutions_filters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAutomationExecutions' {Maybe (NonEmpty AutomationExecutionFilter)
filters :: Maybe (NonEmpty AutomationExecutionFilter)
$sel:filters:DescribeAutomationExecutions' :: DescribeAutomationExecutions
-> Maybe (NonEmpty AutomationExecutionFilter)
filters} -> Maybe (NonEmpty AutomationExecutionFilter)
filters) (\s :: DescribeAutomationExecutions
s@DescribeAutomationExecutions' {} Maybe (NonEmpty AutomationExecutionFilter)
a -> DescribeAutomationExecutions
s {$sel:filters:DescribeAutomationExecutions' :: Maybe (NonEmpty AutomationExecutionFilter)
filters = Maybe (NonEmpty AutomationExecutionFilter)
a} :: DescribeAutomationExecutions) 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.
describeAutomationExecutions_maxResults :: Lens.Lens' DescribeAutomationExecutions (Prelude.Maybe Prelude.Natural)
describeAutomationExecutions_maxResults :: Lens' DescribeAutomationExecutions (Maybe Natural)
describeAutomationExecutions_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAutomationExecutions' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:DescribeAutomationExecutions' :: DescribeAutomationExecutions -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: DescribeAutomationExecutions
s@DescribeAutomationExecutions' {} Maybe Natural
a -> DescribeAutomationExecutions
s {$sel:maxResults:DescribeAutomationExecutions' :: Maybe Natural
maxResults = Maybe Natural
a} :: DescribeAutomationExecutions)

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

instance Core.AWSPager DescribeAutomationExecutions where
  page :: DescribeAutomationExecutions
-> AWSResponse DescribeAutomationExecutions
-> Maybe DescribeAutomationExecutions
page DescribeAutomationExecutions
rq AWSResponse DescribeAutomationExecutions
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeAutomationExecutions
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeAutomationExecutionsResponse (Maybe Text)
describeAutomationExecutionsResponse_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 DescribeAutomationExecutions
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
  DescribeAutomationExecutionsResponse
  (Maybe [AutomationExecutionMetadata])
describeAutomationExecutionsResponse_automationExecutionMetadataList
            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.$ DescribeAutomationExecutions
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' DescribeAutomationExecutions (Maybe Text)
describeAutomationExecutions_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeAutomationExecutions
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeAutomationExecutionsResponse (Maybe Text)
describeAutomationExecutionsResponse_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 DescribeAutomationExecutions where
  type
    AWSResponse DescribeAutomationExecutions =
      DescribeAutomationExecutionsResponse
  request :: (Service -> Service)
-> DescribeAutomationExecutions
-> Request DescribeAutomationExecutions
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 DescribeAutomationExecutions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeAutomationExecutions)))
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 [AutomationExecutionMetadata]
-> Maybe Text -> Int -> DescribeAutomationExecutionsResponse
DescribeAutomationExecutionsResponse'
            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
"AutomationExecutionMetadataList"
                            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.<*> (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.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance
  Prelude.Hashable
    DescribeAutomationExecutions
  where
  hashWithSalt :: Int -> DescribeAutomationExecutions -> Int
hashWithSalt Int
_salt DescribeAutomationExecutions' {Maybe Natural
Maybe (NonEmpty AutomationExecutionFilter)
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe (NonEmpty AutomationExecutionFilter)
$sel:nextToken:DescribeAutomationExecutions' :: DescribeAutomationExecutions -> Maybe Text
$sel:maxResults:DescribeAutomationExecutions' :: DescribeAutomationExecutions -> Maybe Natural
$sel:filters:DescribeAutomationExecutions' :: DescribeAutomationExecutions
-> Maybe (NonEmpty AutomationExecutionFilter)
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty AutomationExecutionFilter)
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

instance Prelude.NFData DescribeAutomationExecutions where
  rnf :: DescribeAutomationExecutions -> ()
rnf DescribeAutomationExecutions' {Maybe Natural
Maybe (NonEmpty AutomationExecutionFilter)
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe (NonEmpty AutomationExecutionFilter)
$sel:nextToken:DescribeAutomationExecutions' :: DescribeAutomationExecutions -> Maybe Text
$sel:maxResults:DescribeAutomationExecutions' :: DescribeAutomationExecutions -> Maybe Natural
$sel:filters:DescribeAutomationExecutions' :: DescribeAutomationExecutions
-> Maybe (NonEmpty AutomationExecutionFilter)
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty AutomationExecutionFilter)
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

instance Data.ToHeaders DescribeAutomationExecutions where
  toHeaders :: DescribeAutomationExecutions -> 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.DescribeAutomationExecutions" ::
                          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 DescribeAutomationExecutions where
  toJSON :: DescribeAutomationExecutions -> Value
toJSON DescribeAutomationExecutions' {Maybe Natural
Maybe (NonEmpty AutomationExecutionFilter)
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe (NonEmpty AutomationExecutionFilter)
$sel:nextToken:DescribeAutomationExecutions' :: DescribeAutomationExecutions -> Maybe Text
$sel:maxResults:DescribeAutomationExecutions' :: DescribeAutomationExecutions -> Maybe Natural
$sel:filters:DescribeAutomationExecutions' :: DescribeAutomationExecutions
-> Maybe (NonEmpty AutomationExecutionFilter)
..} =
    [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 AutomationExecutionFilter)
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
          ]
      )

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

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

-- | /See:/ 'newDescribeAutomationExecutionsResponse' smart constructor.
data DescribeAutomationExecutionsResponse = DescribeAutomationExecutionsResponse'
  { -- | The list of details about each automation execution which has occurred
    -- which matches the filter specification, if any.
    DescribeAutomationExecutionsResponse
-> Maybe [AutomationExecutionMetadata]
automationExecutionMetadataList :: Prelude.Maybe [AutomationExecutionMetadata],
    -- | The token to use when requesting the next set of items. If there are no
    -- additional items to return, the string is empty.
    DescribeAutomationExecutionsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeAutomationExecutionsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeAutomationExecutionsResponse
-> DescribeAutomationExecutionsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeAutomationExecutionsResponse
-> DescribeAutomationExecutionsResponse -> Bool
$c/= :: DescribeAutomationExecutionsResponse
-> DescribeAutomationExecutionsResponse -> Bool
== :: DescribeAutomationExecutionsResponse
-> DescribeAutomationExecutionsResponse -> Bool
$c== :: DescribeAutomationExecutionsResponse
-> DescribeAutomationExecutionsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeAutomationExecutionsResponse]
ReadPrec DescribeAutomationExecutionsResponse
Int -> ReadS DescribeAutomationExecutionsResponse
ReadS [DescribeAutomationExecutionsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeAutomationExecutionsResponse]
$creadListPrec :: ReadPrec [DescribeAutomationExecutionsResponse]
readPrec :: ReadPrec DescribeAutomationExecutionsResponse
$creadPrec :: ReadPrec DescribeAutomationExecutionsResponse
readList :: ReadS [DescribeAutomationExecutionsResponse]
$creadList :: ReadS [DescribeAutomationExecutionsResponse]
readsPrec :: Int -> ReadS DescribeAutomationExecutionsResponse
$creadsPrec :: Int -> ReadS DescribeAutomationExecutionsResponse
Prelude.Read, Int -> DescribeAutomationExecutionsResponse -> ShowS
[DescribeAutomationExecutionsResponse] -> ShowS
DescribeAutomationExecutionsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeAutomationExecutionsResponse] -> ShowS
$cshowList :: [DescribeAutomationExecutionsResponse] -> ShowS
show :: DescribeAutomationExecutionsResponse -> String
$cshow :: DescribeAutomationExecutionsResponse -> String
showsPrec :: Int -> DescribeAutomationExecutionsResponse -> ShowS
$cshowsPrec :: Int -> DescribeAutomationExecutionsResponse -> ShowS
Prelude.Show, forall x.
Rep DescribeAutomationExecutionsResponse x
-> DescribeAutomationExecutionsResponse
forall x.
DescribeAutomationExecutionsResponse
-> Rep DescribeAutomationExecutionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeAutomationExecutionsResponse x
-> DescribeAutomationExecutionsResponse
$cfrom :: forall x.
DescribeAutomationExecutionsResponse
-> Rep DescribeAutomationExecutionsResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeAutomationExecutionsResponse' 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:
--
-- 'automationExecutionMetadataList', 'describeAutomationExecutionsResponse_automationExecutionMetadataList' - The list of details about each automation execution which has occurred
-- which matches the filter specification, if any.
--
-- 'nextToken', 'describeAutomationExecutionsResponse_nextToken' - The token to use when requesting the next set of items. If there are no
-- additional items to return, the string is empty.
--
-- 'httpStatus', 'describeAutomationExecutionsResponse_httpStatus' - The response's http status code.
newDescribeAutomationExecutionsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeAutomationExecutionsResponse
newDescribeAutomationExecutionsResponse :: Int -> DescribeAutomationExecutionsResponse
newDescribeAutomationExecutionsResponse Int
pHttpStatus_ =
  DescribeAutomationExecutionsResponse'
    { $sel:automationExecutionMetadataList:DescribeAutomationExecutionsResponse' :: Maybe [AutomationExecutionMetadata]
automationExecutionMetadataList =
        forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeAutomationExecutionsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeAutomationExecutionsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The list of details about each automation execution which has occurred
-- which matches the filter specification, if any.
describeAutomationExecutionsResponse_automationExecutionMetadataList :: Lens.Lens' DescribeAutomationExecutionsResponse (Prelude.Maybe [AutomationExecutionMetadata])
describeAutomationExecutionsResponse_automationExecutionMetadataList :: Lens'
  DescribeAutomationExecutionsResponse
  (Maybe [AutomationExecutionMetadata])
describeAutomationExecutionsResponse_automationExecutionMetadataList = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAutomationExecutionsResponse' {Maybe [AutomationExecutionMetadata]
automationExecutionMetadataList :: Maybe [AutomationExecutionMetadata]
$sel:automationExecutionMetadataList:DescribeAutomationExecutionsResponse' :: DescribeAutomationExecutionsResponse
-> Maybe [AutomationExecutionMetadata]
automationExecutionMetadataList} -> Maybe [AutomationExecutionMetadata]
automationExecutionMetadataList) (\s :: DescribeAutomationExecutionsResponse
s@DescribeAutomationExecutionsResponse' {} Maybe [AutomationExecutionMetadata]
a -> DescribeAutomationExecutionsResponse
s {$sel:automationExecutionMetadataList:DescribeAutomationExecutionsResponse' :: Maybe [AutomationExecutionMetadata]
automationExecutionMetadataList = Maybe [AutomationExecutionMetadata]
a} :: DescribeAutomationExecutionsResponse) 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 token to use when requesting the next set of items. If there are no
-- additional items to return, the string is empty.
describeAutomationExecutionsResponse_nextToken :: Lens.Lens' DescribeAutomationExecutionsResponse (Prelude.Maybe Prelude.Text)
describeAutomationExecutionsResponse_nextToken :: Lens' DescribeAutomationExecutionsResponse (Maybe Text)
describeAutomationExecutionsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAutomationExecutionsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeAutomationExecutionsResponse' :: DescribeAutomationExecutionsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeAutomationExecutionsResponse
s@DescribeAutomationExecutionsResponse' {} Maybe Text
a -> DescribeAutomationExecutionsResponse
s {$sel:nextToken:DescribeAutomationExecutionsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeAutomationExecutionsResponse)

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

instance
  Prelude.NFData
    DescribeAutomationExecutionsResponse
  where
  rnf :: DescribeAutomationExecutionsResponse -> ()
rnf DescribeAutomationExecutionsResponse' {Int
Maybe [AutomationExecutionMetadata]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
automationExecutionMetadataList :: Maybe [AutomationExecutionMetadata]
$sel:httpStatus:DescribeAutomationExecutionsResponse' :: DescribeAutomationExecutionsResponse -> Int
$sel:nextToken:DescribeAutomationExecutionsResponse' :: DescribeAutomationExecutionsResponse -> Maybe Text
$sel:automationExecutionMetadataList:DescribeAutomationExecutionsResponse' :: DescribeAutomationExecutionsResponse
-> Maybe [AutomationExecutionMetadata]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [AutomationExecutionMetadata]
automationExecutionMetadataList
      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 Int
httpStatus