{-# 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.AppFlow.DescribeFlowExecutionRecords
-- 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)
--
-- Fetches the execution history of the flow.
module Amazonka.AppFlow.DescribeFlowExecutionRecords
  ( -- * Creating a Request
    DescribeFlowExecutionRecords (..),
    newDescribeFlowExecutionRecords,

    -- * Request Lenses
    describeFlowExecutionRecords_nextToken,
    describeFlowExecutionRecords_maxResults,
    describeFlowExecutionRecords_flowName,

    -- * Destructuring the Response
    DescribeFlowExecutionRecordsResponse (..),
    newDescribeFlowExecutionRecordsResponse,

    -- * Response Lenses
    describeFlowExecutionRecordsResponse_flowExecutions,
    describeFlowExecutionRecordsResponse_nextToken,
    describeFlowExecutionRecordsResponse_httpStatus,
  )
where

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

-- | /See:/ 'newDescribeFlowExecutionRecords' smart constructor.
data DescribeFlowExecutionRecords = DescribeFlowExecutionRecords'
  { -- | The pagination token for the next page of data.
    DescribeFlowExecutionRecords -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Specifies the maximum number of items that should be returned in the
    -- result set. The default for @maxResults@ is 20 (for all paginated API
    -- operations).
    DescribeFlowExecutionRecords -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The specified name of the flow. Spaces are not allowed. Use underscores
    -- (_) or hyphens (-) only.
    DescribeFlowExecutionRecords -> Text
flowName :: Prelude.Text
  }
  deriving (DescribeFlowExecutionRecords
-> DescribeFlowExecutionRecords -> Bool
(DescribeFlowExecutionRecords
 -> DescribeFlowExecutionRecords -> Bool)
-> (DescribeFlowExecutionRecords
    -> DescribeFlowExecutionRecords -> Bool)
-> Eq DescribeFlowExecutionRecords
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeFlowExecutionRecords
-> DescribeFlowExecutionRecords -> Bool
$c/= :: DescribeFlowExecutionRecords
-> DescribeFlowExecutionRecords -> Bool
== :: DescribeFlowExecutionRecords
-> DescribeFlowExecutionRecords -> Bool
$c== :: DescribeFlowExecutionRecords
-> DescribeFlowExecutionRecords -> Bool
Prelude.Eq, ReadPrec [DescribeFlowExecutionRecords]
ReadPrec DescribeFlowExecutionRecords
Int -> ReadS DescribeFlowExecutionRecords
ReadS [DescribeFlowExecutionRecords]
(Int -> ReadS DescribeFlowExecutionRecords)
-> ReadS [DescribeFlowExecutionRecords]
-> ReadPrec DescribeFlowExecutionRecords
-> ReadPrec [DescribeFlowExecutionRecords]
-> Read DescribeFlowExecutionRecords
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeFlowExecutionRecords]
$creadListPrec :: ReadPrec [DescribeFlowExecutionRecords]
readPrec :: ReadPrec DescribeFlowExecutionRecords
$creadPrec :: ReadPrec DescribeFlowExecutionRecords
readList :: ReadS [DescribeFlowExecutionRecords]
$creadList :: ReadS [DescribeFlowExecutionRecords]
readsPrec :: Int -> ReadS DescribeFlowExecutionRecords
$creadsPrec :: Int -> ReadS DescribeFlowExecutionRecords
Prelude.Read, Int -> DescribeFlowExecutionRecords -> ShowS
[DescribeFlowExecutionRecords] -> ShowS
DescribeFlowExecutionRecords -> String
(Int -> DescribeFlowExecutionRecords -> ShowS)
-> (DescribeFlowExecutionRecords -> String)
-> ([DescribeFlowExecutionRecords] -> ShowS)
-> Show DescribeFlowExecutionRecords
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeFlowExecutionRecords] -> ShowS
$cshowList :: [DescribeFlowExecutionRecords] -> ShowS
show :: DescribeFlowExecutionRecords -> String
$cshow :: DescribeFlowExecutionRecords -> String
showsPrec :: Int -> DescribeFlowExecutionRecords -> ShowS
$cshowsPrec :: Int -> DescribeFlowExecutionRecords -> ShowS
Prelude.Show, (forall x.
 DescribeFlowExecutionRecords -> Rep DescribeFlowExecutionRecords x)
-> (forall x.
    Rep DescribeFlowExecutionRecords x -> DescribeFlowExecutionRecords)
-> Generic DescribeFlowExecutionRecords
forall x.
Rep DescribeFlowExecutionRecords x -> DescribeFlowExecutionRecords
forall x.
DescribeFlowExecutionRecords -> Rep DescribeFlowExecutionRecords x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeFlowExecutionRecords x -> DescribeFlowExecutionRecords
$cfrom :: forall x.
DescribeFlowExecutionRecords -> Rep DescribeFlowExecutionRecords x
Prelude.Generic)

-- |
-- Create a value of 'DescribeFlowExecutionRecords' 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', 'describeFlowExecutionRecords_nextToken' - The pagination token for the next page of data.
--
-- 'maxResults', 'describeFlowExecutionRecords_maxResults' - Specifies the maximum number of items that should be returned in the
-- result set. The default for @maxResults@ is 20 (for all paginated API
-- operations).
--
-- 'flowName', 'describeFlowExecutionRecords_flowName' - The specified name of the flow. Spaces are not allowed. Use underscores
-- (_) or hyphens (-) only.
newDescribeFlowExecutionRecords ::
  -- | 'flowName'
  Prelude.Text ->
  DescribeFlowExecutionRecords
newDescribeFlowExecutionRecords :: Text -> DescribeFlowExecutionRecords
newDescribeFlowExecutionRecords Text
pFlowName_ =
  DescribeFlowExecutionRecords' :: Maybe Text -> Maybe Natural -> Text -> DescribeFlowExecutionRecords
DescribeFlowExecutionRecords'
    { $sel:nextToken:DescribeFlowExecutionRecords' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:DescribeFlowExecutionRecords' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:flowName:DescribeFlowExecutionRecords' :: Text
flowName = Text
pFlowName_
    }

-- | The pagination token for the next page of data.
describeFlowExecutionRecords_nextToken :: Lens.Lens' DescribeFlowExecutionRecords (Prelude.Maybe Prelude.Text)
describeFlowExecutionRecords_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeFlowExecutionRecords -> f DescribeFlowExecutionRecords
describeFlowExecutionRecords_nextToken = (DescribeFlowExecutionRecords -> Maybe Text)
-> (DescribeFlowExecutionRecords
    -> Maybe Text -> DescribeFlowExecutionRecords)
-> Lens
     DescribeFlowExecutionRecords
     DescribeFlowExecutionRecords
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFlowExecutionRecords' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeFlowExecutionRecords' :: DescribeFlowExecutionRecords -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeFlowExecutionRecords
s@DescribeFlowExecutionRecords' {} Maybe Text
a -> DescribeFlowExecutionRecords
s {$sel:nextToken:DescribeFlowExecutionRecords' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeFlowExecutionRecords)

-- | Specifies the maximum number of items that should be returned in the
-- result set. The default for @maxResults@ is 20 (for all paginated API
-- operations).
describeFlowExecutionRecords_maxResults :: Lens.Lens' DescribeFlowExecutionRecords (Prelude.Maybe Prelude.Natural)
describeFlowExecutionRecords_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> DescribeFlowExecutionRecords -> f DescribeFlowExecutionRecords
describeFlowExecutionRecords_maxResults = (DescribeFlowExecutionRecords -> Maybe Natural)
-> (DescribeFlowExecutionRecords
    -> Maybe Natural -> DescribeFlowExecutionRecords)
-> Lens
     DescribeFlowExecutionRecords
     DescribeFlowExecutionRecords
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFlowExecutionRecords' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:DescribeFlowExecutionRecords' :: DescribeFlowExecutionRecords -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: DescribeFlowExecutionRecords
s@DescribeFlowExecutionRecords' {} Maybe Natural
a -> DescribeFlowExecutionRecords
s {$sel:maxResults:DescribeFlowExecutionRecords' :: Maybe Natural
maxResults = Maybe Natural
a} :: DescribeFlowExecutionRecords)

-- | The specified name of the flow. Spaces are not allowed. Use underscores
-- (_) or hyphens (-) only.
describeFlowExecutionRecords_flowName :: Lens.Lens' DescribeFlowExecutionRecords Prelude.Text
describeFlowExecutionRecords_flowName :: (Text -> f Text)
-> DescribeFlowExecutionRecords -> f DescribeFlowExecutionRecords
describeFlowExecutionRecords_flowName = (DescribeFlowExecutionRecords -> Text)
-> (DescribeFlowExecutionRecords
    -> Text -> DescribeFlowExecutionRecords)
-> Lens
     DescribeFlowExecutionRecords DescribeFlowExecutionRecords Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFlowExecutionRecords' {Text
flowName :: Text
$sel:flowName:DescribeFlowExecutionRecords' :: DescribeFlowExecutionRecords -> Text
flowName} -> Text
flowName) (\s :: DescribeFlowExecutionRecords
s@DescribeFlowExecutionRecords' {} Text
a -> DescribeFlowExecutionRecords
s {$sel:flowName:DescribeFlowExecutionRecords' :: Text
flowName = Text
a} :: DescribeFlowExecutionRecords)

instance Core.AWSRequest DescribeFlowExecutionRecords where
  type
    AWSResponse DescribeFlowExecutionRecords =
      DescribeFlowExecutionRecordsResponse
  request :: DescribeFlowExecutionRecords
-> Request DescribeFlowExecutionRecords
request = Service
-> DescribeFlowExecutionRecords
-> Request DescribeFlowExecutionRecords
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeFlowExecutionRecords
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeFlowExecutionRecords)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse DescribeFlowExecutionRecords))
-> Logger
-> Service
-> Proxy DescribeFlowExecutionRecords
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeFlowExecutionRecords)))
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 [ExecutionRecord]
-> Maybe Text -> Int -> DescribeFlowExecutionRecordsResponse
DescribeFlowExecutionRecordsResponse'
            (Maybe [ExecutionRecord]
 -> Maybe Text -> Int -> DescribeFlowExecutionRecordsResponse)
-> Either String (Maybe [ExecutionRecord])
-> Either
     String (Maybe Text -> Int -> DescribeFlowExecutionRecordsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [ExecutionRecord]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"flowExecutions" Either String (Maybe (Maybe [ExecutionRecord]))
-> Maybe [ExecutionRecord]
-> Either String (Maybe [ExecutionRecord])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [ExecutionRecord]
forall a. Monoid a => a
Prelude.mempty)
            Either
  String (Maybe Text -> Int -> DescribeFlowExecutionRecordsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> DescribeFlowExecutionRecordsResponse)
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 -> DescribeFlowExecutionRecordsResponse)
-> Either String Int
-> Either String DescribeFlowExecutionRecordsResponse
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
    DescribeFlowExecutionRecords

instance Prelude.NFData DescribeFlowExecutionRecords

instance Core.ToHeaders DescribeFlowExecutionRecords where
  toHeaders :: DescribeFlowExecutionRecords -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DescribeFlowExecutionRecords -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ 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 DescribeFlowExecutionRecords where
  toJSON :: DescribeFlowExecutionRecords -> Value
toJSON DescribeFlowExecutionRecords' {Maybe Natural
Maybe Text
Text
flowName :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:flowName:DescribeFlowExecutionRecords' :: DescribeFlowExecutionRecords -> Text
$sel:maxResults:DescribeFlowExecutionRecords' :: DescribeFlowExecutionRecords -> Maybe Natural
$sel:nextToken:DescribeFlowExecutionRecords' :: DescribeFlowExecutionRecords -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"nextToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            (Text
"maxResults" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"flowName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
flowName)
          ]
      )

instance Core.ToPath DescribeFlowExecutionRecords where
  toPath :: DescribeFlowExecutionRecords -> ByteString
toPath =
    ByteString -> DescribeFlowExecutionRecords -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/describe-flow-execution-records"

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

-- | /See:/ 'newDescribeFlowExecutionRecordsResponse' smart constructor.
data DescribeFlowExecutionRecordsResponse = DescribeFlowExecutionRecordsResponse'
  { -- | Returns a list of all instances when this flow was run.
    DescribeFlowExecutionRecordsResponse -> Maybe [ExecutionRecord]
flowExecutions :: Prelude.Maybe [ExecutionRecord],
    -- | The pagination token for the next page of data.
    DescribeFlowExecutionRecordsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeFlowExecutionRecordsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeFlowExecutionRecordsResponse
-> DescribeFlowExecutionRecordsResponse -> Bool
(DescribeFlowExecutionRecordsResponse
 -> DescribeFlowExecutionRecordsResponse -> Bool)
-> (DescribeFlowExecutionRecordsResponse
    -> DescribeFlowExecutionRecordsResponse -> Bool)
-> Eq DescribeFlowExecutionRecordsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeFlowExecutionRecordsResponse
-> DescribeFlowExecutionRecordsResponse -> Bool
$c/= :: DescribeFlowExecutionRecordsResponse
-> DescribeFlowExecutionRecordsResponse -> Bool
== :: DescribeFlowExecutionRecordsResponse
-> DescribeFlowExecutionRecordsResponse -> Bool
$c== :: DescribeFlowExecutionRecordsResponse
-> DescribeFlowExecutionRecordsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeFlowExecutionRecordsResponse]
ReadPrec DescribeFlowExecutionRecordsResponse
Int -> ReadS DescribeFlowExecutionRecordsResponse
ReadS [DescribeFlowExecutionRecordsResponse]
(Int -> ReadS DescribeFlowExecutionRecordsResponse)
-> ReadS [DescribeFlowExecutionRecordsResponse]
-> ReadPrec DescribeFlowExecutionRecordsResponse
-> ReadPrec [DescribeFlowExecutionRecordsResponse]
-> Read DescribeFlowExecutionRecordsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeFlowExecutionRecordsResponse]
$creadListPrec :: ReadPrec [DescribeFlowExecutionRecordsResponse]
readPrec :: ReadPrec DescribeFlowExecutionRecordsResponse
$creadPrec :: ReadPrec DescribeFlowExecutionRecordsResponse
readList :: ReadS [DescribeFlowExecutionRecordsResponse]
$creadList :: ReadS [DescribeFlowExecutionRecordsResponse]
readsPrec :: Int -> ReadS DescribeFlowExecutionRecordsResponse
$creadsPrec :: Int -> ReadS DescribeFlowExecutionRecordsResponse
Prelude.Read, Int -> DescribeFlowExecutionRecordsResponse -> ShowS
[DescribeFlowExecutionRecordsResponse] -> ShowS
DescribeFlowExecutionRecordsResponse -> String
(Int -> DescribeFlowExecutionRecordsResponse -> ShowS)
-> (DescribeFlowExecutionRecordsResponse -> String)
-> ([DescribeFlowExecutionRecordsResponse] -> ShowS)
-> Show DescribeFlowExecutionRecordsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeFlowExecutionRecordsResponse] -> ShowS
$cshowList :: [DescribeFlowExecutionRecordsResponse] -> ShowS
show :: DescribeFlowExecutionRecordsResponse -> String
$cshow :: DescribeFlowExecutionRecordsResponse -> String
showsPrec :: Int -> DescribeFlowExecutionRecordsResponse -> ShowS
$cshowsPrec :: Int -> DescribeFlowExecutionRecordsResponse -> ShowS
Prelude.Show, (forall x.
 DescribeFlowExecutionRecordsResponse
 -> Rep DescribeFlowExecutionRecordsResponse x)
-> (forall x.
    Rep DescribeFlowExecutionRecordsResponse x
    -> DescribeFlowExecutionRecordsResponse)
-> Generic DescribeFlowExecutionRecordsResponse
forall x.
Rep DescribeFlowExecutionRecordsResponse x
-> DescribeFlowExecutionRecordsResponse
forall x.
DescribeFlowExecutionRecordsResponse
-> Rep DescribeFlowExecutionRecordsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeFlowExecutionRecordsResponse x
-> DescribeFlowExecutionRecordsResponse
$cfrom :: forall x.
DescribeFlowExecutionRecordsResponse
-> Rep DescribeFlowExecutionRecordsResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeFlowExecutionRecordsResponse' 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:
--
-- 'flowExecutions', 'describeFlowExecutionRecordsResponse_flowExecutions' - Returns a list of all instances when this flow was run.
--
-- 'nextToken', 'describeFlowExecutionRecordsResponse_nextToken' - The pagination token for the next page of data.
--
-- 'httpStatus', 'describeFlowExecutionRecordsResponse_httpStatus' - The response's http status code.
newDescribeFlowExecutionRecordsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeFlowExecutionRecordsResponse
newDescribeFlowExecutionRecordsResponse :: Int -> DescribeFlowExecutionRecordsResponse
newDescribeFlowExecutionRecordsResponse Int
pHttpStatus_ =
  DescribeFlowExecutionRecordsResponse' :: Maybe [ExecutionRecord]
-> Maybe Text -> Int -> DescribeFlowExecutionRecordsResponse
DescribeFlowExecutionRecordsResponse'
    { $sel:flowExecutions:DescribeFlowExecutionRecordsResponse' :: Maybe [ExecutionRecord]
flowExecutions =
        Maybe [ExecutionRecord]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeFlowExecutionRecordsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeFlowExecutionRecordsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Returns a list of all instances when this flow was run.
describeFlowExecutionRecordsResponse_flowExecutions :: Lens.Lens' DescribeFlowExecutionRecordsResponse (Prelude.Maybe [ExecutionRecord])
describeFlowExecutionRecordsResponse_flowExecutions :: (Maybe [ExecutionRecord] -> f (Maybe [ExecutionRecord]))
-> DescribeFlowExecutionRecordsResponse
-> f DescribeFlowExecutionRecordsResponse
describeFlowExecutionRecordsResponse_flowExecutions = (DescribeFlowExecutionRecordsResponse -> Maybe [ExecutionRecord])
-> (DescribeFlowExecutionRecordsResponse
    -> Maybe [ExecutionRecord] -> DescribeFlowExecutionRecordsResponse)
-> Lens
     DescribeFlowExecutionRecordsResponse
     DescribeFlowExecutionRecordsResponse
     (Maybe [ExecutionRecord])
     (Maybe [ExecutionRecord])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFlowExecutionRecordsResponse' {Maybe [ExecutionRecord]
flowExecutions :: Maybe [ExecutionRecord]
$sel:flowExecutions:DescribeFlowExecutionRecordsResponse' :: DescribeFlowExecutionRecordsResponse -> Maybe [ExecutionRecord]
flowExecutions} -> Maybe [ExecutionRecord]
flowExecutions) (\s :: DescribeFlowExecutionRecordsResponse
s@DescribeFlowExecutionRecordsResponse' {} Maybe [ExecutionRecord]
a -> DescribeFlowExecutionRecordsResponse
s {$sel:flowExecutions:DescribeFlowExecutionRecordsResponse' :: Maybe [ExecutionRecord]
flowExecutions = Maybe [ExecutionRecord]
a} :: DescribeFlowExecutionRecordsResponse) ((Maybe [ExecutionRecord] -> f (Maybe [ExecutionRecord]))
 -> DescribeFlowExecutionRecordsResponse
 -> f DescribeFlowExecutionRecordsResponse)
-> ((Maybe [ExecutionRecord] -> f (Maybe [ExecutionRecord]))
    -> Maybe [ExecutionRecord] -> f (Maybe [ExecutionRecord]))
-> (Maybe [ExecutionRecord] -> f (Maybe [ExecutionRecord]))
-> DescribeFlowExecutionRecordsResponse
-> f DescribeFlowExecutionRecordsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ExecutionRecord]
  [ExecutionRecord]
  [ExecutionRecord]
  [ExecutionRecord]
-> Iso
     (Maybe [ExecutionRecord])
     (Maybe [ExecutionRecord])
     (Maybe [ExecutionRecord])
     (Maybe [ExecutionRecord])
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
  [ExecutionRecord]
  [ExecutionRecord]
  [ExecutionRecord]
  [ExecutionRecord]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The pagination token for the next page of data.
describeFlowExecutionRecordsResponse_nextToken :: Lens.Lens' DescribeFlowExecutionRecordsResponse (Prelude.Maybe Prelude.Text)
describeFlowExecutionRecordsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeFlowExecutionRecordsResponse
-> f DescribeFlowExecutionRecordsResponse
describeFlowExecutionRecordsResponse_nextToken = (DescribeFlowExecutionRecordsResponse -> Maybe Text)
-> (DescribeFlowExecutionRecordsResponse
    -> Maybe Text -> DescribeFlowExecutionRecordsResponse)
-> Lens
     DescribeFlowExecutionRecordsResponse
     DescribeFlowExecutionRecordsResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFlowExecutionRecordsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeFlowExecutionRecordsResponse' :: DescribeFlowExecutionRecordsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeFlowExecutionRecordsResponse
s@DescribeFlowExecutionRecordsResponse' {} Maybe Text
a -> DescribeFlowExecutionRecordsResponse
s {$sel:nextToken:DescribeFlowExecutionRecordsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeFlowExecutionRecordsResponse)

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

instance
  Prelude.NFData
    DescribeFlowExecutionRecordsResponse