{-# 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.ListFlowDefinitions
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Returns information about the flow definitions in your account.
--
-- This operation returns paginated results.
module Amazonka.SageMaker.ListFlowDefinitions
  ( -- * Creating a Request
    ListFlowDefinitions (..),
    newListFlowDefinitions,

    -- * Request Lenses
    listFlowDefinitions_creationTimeAfter,
    listFlowDefinitions_creationTimeBefore,
    listFlowDefinitions_maxResults,
    listFlowDefinitions_nextToken,
    listFlowDefinitions_sortOrder,

    -- * Destructuring the Response
    ListFlowDefinitionsResponse (..),
    newListFlowDefinitionsResponse,

    -- * Response Lenses
    listFlowDefinitionsResponse_nextToken,
    listFlowDefinitionsResponse_httpStatus,
    listFlowDefinitionsResponse_flowDefinitionSummaries,
  )
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.SageMaker.Types

-- | /See:/ 'newListFlowDefinitions' smart constructor.
data ListFlowDefinitions = ListFlowDefinitions'
  { -- | A filter that returns only flow definitions with a creation time greater
    -- than or equal to the specified timestamp.
    ListFlowDefinitions -> Maybe POSIX
creationTimeAfter :: Prelude.Maybe Data.POSIX,
    -- | A filter that returns only flow definitions that were created before the
    -- specified timestamp.
    ListFlowDefinitions -> Maybe POSIX
creationTimeBefore :: Prelude.Maybe Data.POSIX,
    -- | The total number of items to return. If the total number of available
    -- items is more than the value specified in @MaxResults@, then a
    -- @NextToken@ will be provided in the output that you can use to resume
    -- pagination.
    ListFlowDefinitions -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | A token to resume pagination.
    ListFlowDefinitions -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | An optional value that specifies whether you want the results sorted in
    -- @Ascending@ or @Descending@ order.
    ListFlowDefinitions -> Maybe SortOrder
sortOrder :: Prelude.Maybe SortOrder
  }
  deriving (ListFlowDefinitions -> ListFlowDefinitions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListFlowDefinitions -> ListFlowDefinitions -> Bool
$c/= :: ListFlowDefinitions -> ListFlowDefinitions -> Bool
== :: ListFlowDefinitions -> ListFlowDefinitions -> Bool
$c== :: ListFlowDefinitions -> ListFlowDefinitions -> Bool
Prelude.Eq, ReadPrec [ListFlowDefinitions]
ReadPrec ListFlowDefinitions
Int -> ReadS ListFlowDefinitions
ReadS [ListFlowDefinitions]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListFlowDefinitions]
$creadListPrec :: ReadPrec [ListFlowDefinitions]
readPrec :: ReadPrec ListFlowDefinitions
$creadPrec :: ReadPrec ListFlowDefinitions
readList :: ReadS [ListFlowDefinitions]
$creadList :: ReadS [ListFlowDefinitions]
readsPrec :: Int -> ReadS ListFlowDefinitions
$creadsPrec :: Int -> ReadS ListFlowDefinitions
Prelude.Read, Int -> ListFlowDefinitions -> ShowS
[ListFlowDefinitions] -> ShowS
ListFlowDefinitions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListFlowDefinitions] -> ShowS
$cshowList :: [ListFlowDefinitions] -> ShowS
show :: ListFlowDefinitions -> String
$cshow :: ListFlowDefinitions -> String
showsPrec :: Int -> ListFlowDefinitions -> ShowS
$cshowsPrec :: Int -> ListFlowDefinitions -> ShowS
Prelude.Show, forall x. Rep ListFlowDefinitions x -> ListFlowDefinitions
forall x. ListFlowDefinitions -> Rep ListFlowDefinitions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListFlowDefinitions x -> ListFlowDefinitions
$cfrom :: forall x. ListFlowDefinitions -> Rep ListFlowDefinitions x
Prelude.Generic)

-- |
-- Create a value of 'ListFlowDefinitions' 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:
--
-- 'creationTimeAfter', 'listFlowDefinitions_creationTimeAfter' - A filter that returns only flow definitions with a creation time greater
-- than or equal to the specified timestamp.
--
-- 'creationTimeBefore', 'listFlowDefinitions_creationTimeBefore' - A filter that returns only flow definitions that were created before the
-- specified timestamp.
--
-- 'maxResults', 'listFlowDefinitions_maxResults' - The total number of items to return. If the total number of available
-- items is more than the value specified in @MaxResults@, then a
-- @NextToken@ will be provided in the output that you can use to resume
-- pagination.
--
-- 'nextToken', 'listFlowDefinitions_nextToken' - A token to resume pagination.
--
-- 'sortOrder', 'listFlowDefinitions_sortOrder' - An optional value that specifies whether you want the results sorted in
-- @Ascending@ or @Descending@ order.
newListFlowDefinitions ::
  ListFlowDefinitions
newListFlowDefinitions :: ListFlowDefinitions
newListFlowDefinitions =
  ListFlowDefinitions'
    { $sel:creationTimeAfter:ListFlowDefinitions' :: Maybe POSIX
creationTimeAfter =
        forall a. Maybe a
Prelude.Nothing,
      $sel:creationTimeBefore:ListFlowDefinitions' :: Maybe POSIX
creationTimeBefore = forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListFlowDefinitions' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListFlowDefinitions' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:sortOrder:ListFlowDefinitions' :: Maybe SortOrder
sortOrder = forall a. Maybe a
Prelude.Nothing
    }

-- | A filter that returns only flow definitions with a creation time greater
-- than or equal to the specified timestamp.
listFlowDefinitions_creationTimeAfter :: Lens.Lens' ListFlowDefinitions (Prelude.Maybe Prelude.UTCTime)
listFlowDefinitions_creationTimeAfter :: Lens' ListFlowDefinitions (Maybe UTCTime)
listFlowDefinitions_creationTimeAfter = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFlowDefinitions' {Maybe POSIX
creationTimeAfter :: Maybe POSIX
$sel:creationTimeAfter:ListFlowDefinitions' :: ListFlowDefinitions -> Maybe POSIX
creationTimeAfter} -> Maybe POSIX
creationTimeAfter) (\s :: ListFlowDefinitions
s@ListFlowDefinitions' {} Maybe POSIX
a -> ListFlowDefinitions
s {$sel:creationTimeAfter:ListFlowDefinitions' :: Maybe POSIX
creationTimeAfter = Maybe POSIX
a} :: ListFlowDefinitions) 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 (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | A filter that returns only flow definitions that were created before the
-- specified timestamp.
listFlowDefinitions_creationTimeBefore :: Lens.Lens' ListFlowDefinitions (Prelude.Maybe Prelude.UTCTime)
listFlowDefinitions_creationTimeBefore :: Lens' ListFlowDefinitions (Maybe UTCTime)
listFlowDefinitions_creationTimeBefore = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFlowDefinitions' {Maybe POSIX
creationTimeBefore :: Maybe POSIX
$sel:creationTimeBefore:ListFlowDefinitions' :: ListFlowDefinitions -> Maybe POSIX
creationTimeBefore} -> Maybe POSIX
creationTimeBefore) (\s :: ListFlowDefinitions
s@ListFlowDefinitions' {} Maybe POSIX
a -> ListFlowDefinitions
s {$sel:creationTimeBefore:ListFlowDefinitions' :: Maybe POSIX
creationTimeBefore = Maybe POSIX
a} :: ListFlowDefinitions) 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 (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The total number of items to return. If the total number of available
-- items is more than the value specified in @MaxResults@, then a
-- @NextToken@ will be provided in the output that you can use to resume
-- pagination.
listFlowDefinitions_maxResults :: Lens.Lens' ListFlowDefinitions (Prelude.Maybe Prelude.Natural)
listFlowDefinitions_maxResults :: Lens' ListFlowDefinitions (Maybe Natural)
listFlowDefinitions_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFlowDefinitions' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListFlowDefinitions' :: ListFlowDefinitions -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListFlowDefinitions
s@ListFlowDefinitions' {} Maybe Natural
a -> ListFlowDefinitions
s {$sel:maxResults:ListFlowDefinitions' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListFlowDefinitions)

-- | A token to resume pagination.
listFlowDefinitions_nextToken :: Lens.Lens' ListFlowDefinitions (Prelude.Maybe Prelude.Text)
listFlowDefinitions_nextToken :: Lens' ListFlowDefinitions (Maybe Text)
listFlowDefinitions_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFlowDefinitions' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListFlowDefinitions' :: ListFlowDefinitions -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListFlowDefinitions
s@ListFlowDefinitions' {} Maybe Text
a -> ListFlowDefinitions
s {$sel:nextToken:ListFlowDefinitions' :: Maybe Text
nextToken = Maybe Text
a} :: ListFlowDefinitions)

-- | An optional value that specifies whether you want the results sorted in
-- @Ascending@ or @Descending@ order.
listFlowDefinitions_sortOrder :: Lens.Lens' ListFlowDefinitions (Prelude.Maybe SortOrder)
listFlowDefinitions_sortOrder :: Lens' ListFlowDefinitions (Maybe SortOrder)
listFlowDefinitions_sortOrder = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFlowDefinitions' {Maybe SortOrder
sortOrder :: Maybe SortOrder
$sel:sortOrder:ListFlowDefinitions' :: ListFlowDefinitions -> Maybe SortOrder
sortOrder} -> Maybe SortOrder
sortOrder) (\s :: ListFlowDefinitions
s@ListFlowDefinitions' {} Maybe SortOrder
a -> ListFlowDefinitions
s {$sel:sortOrder:ListFlowDefinitions' :: Maybe SortOrder
sortOrder = Maybe SortOrder
a} :: ListFlowDefinitions)

instance Core.AWSPager ListFlowDefinitions where
  page :: ListFlowDefinitions
-> AWSResponse ListFlowDefinitions -> Maybe ListFlowDefinitions
page ListFlowDefinitions
rq AWSResponse ListFlowDefinitions
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListFlowDefinitions
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListFlowDefinitionsResponse (Maybe Text)
listFlowDefinitionsResponse_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 ListFlowDefinitions
rs
            forall s a. s -> Getting a s a -> a
Lens.^. Lens' ListFlowDefinitionsResponse [FlowDefinitionSummary]
listFlowDefinitionsResponse_flowDefinitionSummaries
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ ListFlowDefinitions
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListFlowDefinitions (Maybe Text)
listFlowDefinitions_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListFlowDefinitions
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListFlowDefinitionsResponse (Maybe Text)
listFlowDefinitionsResponse_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 ListFlowDefinitions where
  type
    AWSResponse ListFlowDefinitions =
      ListFlowDefinitionsResponse
  request :: (Service -> Service)
-> ListFlowDefinitions -> Request ListFlowDefinitions
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 ListFlowDefinitions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListFlowDefinitions)))
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
-> Int -> [FlowDefinitionSummary] -> ListFlowDefinitionsResponse
ListFlowDefinitionsResponse'
            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.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
            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
"FlowDefinitionSummaries"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                        )
      )

instance Prelude.Hashable ListFlowDefinitions where
  hashWithSalt :: Int -> ListFlowDefinitions -> Int
hashWithSalt Int
_salt ListFlowDefinitions' {Maybe Natural
Maybe Text
Maybe POSIX
Maybe SortOrder
sortOrder :: Maybe SortOrder
nextToken :: Maybe Text
maxResults :: Maybe Natural
creationTimeBefore :: Maybe POSIX
creationTimeAfter :: Maybe POSIX
$sel:sortOrder:ListFlowDefinitions' :: ListFlowDefinitions -> Maybe SortOrder
$sel:nextToken:ListFlowDefinitions' :: ListFlowDefinitions -> Maybe Text
$sel:maxResults:ListFlowDefinitions' :: ListFlowDefinitions -> Maybe Natural
$sel:creationTimeBefore:ListFlowDefinitions' :: ListFlowDefinitions -> Maybe POSIX
$sel:creationTimeAfter:ListFlowDefinitions' :: ListFlowDefinitions -> Maybe POSIX
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
creationTimeAfter
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
creationTimeBefore
      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 SortOrder
sortOrder

instance Prelude.NFData ListFlowDefinitions where
  rnf :: ListFlowDefinitions -> ()
rnf ListFlowDefinitions' {Maybe Natural
Maybe Text
Maybe POSIX
Maybe SortOrder
sortOrder :: Maybe SortOrder
nextToken :: Maybe Text
maxResults :: Maybe Natural
creationTimeBefore :: Maybe POSIX
creationTimeAfter :: Maybe POSIX
$sel:sortOrder:ListFlowDefinitions' :: ListFlowDefinitions -> Maybe SortOrder
$sel:nextToken:ListFlowDefinitions' :: ListFlowDefinitions -> Maybe Text
$sel:maxResults:ListFlowDefinitions' :: ListFlowDefinitions -> Maybe Natural
$sel:creationTimeBefore:ListFlowDefinitions' :: ListFlowDefinitions -> Maybe POSIX
$sel:creationTimeAfter:ListFlowDefinitions' :: ListFlowDefinitions -> Maybe POSIX
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
creationTimeAfter
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
creationTimeBefore
      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 SortOrder
sortOrder

instance Data.ToHeaders ListFlowDefinitions where
  toHeaders :: ListFlowDefinitions -> 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
"SageMaker.ListFlowDefinitions" ::
                          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 ListFlowDefinitions where
  toJSON :: ListFlowDefinitions -> Value
toJSON ListFlowDefinitions' {Maybe Natural
Maybe Text
Maybe POSIX
Maybe SortOrder
sortOrder :: Maybe SortOrder
nextToken :: Maybe Text
maxResults :: Maybe Natural
creationTimeBefore :: Maybe POSIX
creationTimeAfter :: Maybe POSIX
$sel:sortOrder:ListFlowDefinitions' :: ListFlowDefinitions -> Maybe SortOrder
$sel:nextToken:ListFlowDefinitions' :: ListFlowDefinitions -> Maybe Text
$sel:maxResults:ListFlowDefinitions' :: ListFlowDefinitions -> Maybe Natural
$sel:creationTimeBefore:ListFlowDefinitions' :: ListFlowDefinitions -> Maybe POSIX
$sel:creationTimeAfter:ListFlowDefinitions' :: ListFlowDefinitions -> Maybe POSIX
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"CreationTimeAfter" 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 POSIX
creationTimeAfter,
            (Key
"CreationTimeBefore" 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 POSIX
creationTimeBefore,
            (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
"SortOrder" 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 SortOrder
sortOrder
          ]
      )

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

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

-- | /See:/ 'newListFlowDefinitionsResponse' smart constructor.
data ListFlowDefinitionsResponse = ListFlowDefinitionsResponse'
  { -- | A token to resume pagination.
    ListFlowDefinitionsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListFlowDefinitionsResponse -> Int
httpStatus :: Prelude.Int,
    -- | An array of objects describing the flow definitions.
    ListFlowDefinitionsResponse -> [FlowDefinitionSummary]
flowDefinitionSummaries :: [FlowDefinitionSummary]
  }
  deriving (ListFlowDefinitionsResponse -> ListFlowDefinitionsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListFlowDefinitionsResponse -> ListFlowDefinitionsResponse -> Bool
$c/= :: ListFlowDefinitionsResponse -> ListFlowDefinitionsResponse -> Bool
== :: ListFlowDefinitionsResponse -> ListFlowDefinitionsResponse -> Bool
$c== :: ListFlowDefinitionsResponse -> ListFlowDefinitionsResponse -> Bool
Prelude.Eq, ReadPrec [ListFlowDefinitionsResponse]
ReadPrec ListFlowDefinitionsResponse
Int -> ReadS ListFlowDefinitionsResponse
ReadS [ListFlowDefinitionsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListFlowDefinitionsResponse]
$creadListPrec :: ReadPrec [ListFlowDefinitionsResponse]
readPrec :: ReadPrec ListFlowDefinitionsResponse
$creadPrec :: ReadPrec ListFlowDefinitionsResponse
readList :: ReadS [ListFlowDefinitionsResponse]
$creadList :: ReadS [ListFlowDefinitionsResponse]
readsPrec :: Int -> ReadS ListFlowDefinitionsResponse
$creadsPrec :: Int -> ReadS ListFlowDefinitionsResponse
Prelude.Read, Int -> ListFlowDefinitionsResponse -> ShowS
[ListFlowDefinitionsResponse] -> ShowS
ListFlowDefinitionsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListFlowDefinitionsResponse] -> ShowS
$cshowList :: [ListFlowDefinitionsResponse] -> ShowS
show :: ListFlowDefinitionsResponse -> String
$cshow :: ListFlowDefinitionsResponse -> String
showsPrec :: Int -> ListFlowDefinitionsResponse -> ShowS
$cshowsPrec :: Int -> ListFlowDefinitionsResponse -> ShowS
Prelude.Show, forall x.
Rep ListFlowDefinitionsResponse x -> ListFlowDefinitionsResponse
forall x.
ListFlowDefinitionsResponse -> Rep ListFlowDefinitionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListFlowDefinitionsResponse x -> ListFlowDefinitionsResponse
$cfrom :: forall x.
ListFlowDefinitionsResponse -> Rep ListFlowDefinitionsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListFlowDefinitionsResponse' 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', 'listFlowDefinitionsResponse_nextToken' - A token to resume pagination.
--
-- 'httpStatus', 'listFlowDefinitionsResponse_httpStatus' - The response's http status code.
--
-- 'flowDefinitionSummaries', 'listFlowDefinitionsResponse_flowDefinitionSummaries' - An array of objects describing the flow definitions.
newListFlowDefinitionsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListFlowDefinitionsResponse
newListFlowDefinitionsResponse :: Int -> ListFlowDefinitionsResponse
newListFlowDefinitionsResponse Int
pHttpStatus_ =
  ListFlowDefinitionsResponse'
    { $sel:nextToken:ListFlowDefinitionsResponse' :: Maybe Text
nextToken =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListFlowDefinitionsResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:flowDefinitionSummaries:ListFlowDefinitionsResponse' :: [FlowDefinitionSummary]
flowDefinitionSummaries = forall a. Monoid a => a
Prelude.mempty
    }

-- | A token to resume pagination.
listFlowDefinitionsResponse_nextToken :: Lens.Lens' ListFlowDefinitionsResponse (Prelude.Maybe Prelude.Text)
listFlowDefinitionsResponse_nextToken :: Lens' ListFlowDefinitionsResponse (Maybe Text)
listFlowDefinitionsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFlowDefinitionsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListFlowDefinitionsResponse' :: ListFlowDefinitionsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListFlowDefinitionsResponse
s@ListFlowDefinitionsResponse' {} Maybe Text
a -> ListFlowDefinitionsResponse
s {$sel:nextToken:ListFlowDefinitionsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListFlowDefinitionsResponse)

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

-- | An array of objects describing the flow definitions.
listFlowDefinitionsResponse_flowDefinitionSummaries :: Lens.Lens' ListFlowDefinitionsResponse [FlowDefinitionSummary]
listFlowDefinitionsResponse_flowDefinitionSummaries :: Lens' ListFlowDefinitionsResponse [FlowDefinitionSummary]
listFlowDefinitionsResponse_flowDefinitionSummaries = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFlowDefinitionsResponse' {[FlowDefinitionSummary]
flowDefinitionSummaries :: [FlowDefinitionSummary]
$sel:flowDefinitionSummaries:ListFlowDefinitionsResponse' :: ListFlowDefinitionsResponse -> [FlowDefinitionSummary]
flowDefinitionSummaries} -> [FlowDefinitionSummary]
flowDefinitionSummaries) (\s :: ListFlowDefinitionsResponse
s@ListFlowDefinitionsResponse' {} [FlowDefinitionSummary]
a -> ListFlowDefinitionsResponse
s {$sel:flowDefinitionSummaries:ListFlowDefinitionsResponse' :: [FlowDefinitionSummary]
flowDefinitionSummaries = [FlowDefinitionSummary]
a} :: ListFlowDefinitionsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.NFData ListFlowDefinitionsResponse where
  rnf :: ListFlowDefinitionsResponse -> ()
rnf ListFlowDefinitionsResponse' {Int
[FlowDefinitionSummary]
Maybe Text
flowDefinitionSummaries :: [FlowDefinitionSummary]
httpStatus :: Int
nextToken :: Maybe Text
$sel:flowDefinitionSummaries:ListFlowDefinitionsResponse' :: ListFlowDefinitionsResponse -> [FlowDefinitionSummary]
$sel:httpStatus:ListFlowDefinitionsResponse' :: ListFlowDefinitionsResponse -> Int
$sel:nextToken:ListFlowDefinitionsResponse' :: ListFlowDefinitionsResponse -> 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 Int
httpStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [FlowDefinitionSummary]
flowDefinitionSummaries