{-# 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.AppSync.ListFunctions
-- 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)
--
-- List multiple functions.
--
-- This operation returns paginated results.
module Amazonka.AppSync.ListFunctions
  ( -- * Creating a Request
    ListFunctions (..),
    newListFunctions,

    -- * Request Lenses
    listFunctions_nextToken,
    listFunctions_maxResults,
    listFunctions_apiId,

    -- * Destructuring the Response
    ListFunctionsResponse (..),
    newListFunctionsResponse,

    -- * Response Lenses
    listFunctionsResponse_nextToken,
    listFunctionsResponse_functions,
    listFunctionsResponse_httpStatus,
  )
where

import Amazonka.AppSync.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:/ 'newListFunctions' smart constructor.
data ListFunctions = ListFunctions'
  { -- | An identifier that was returned from the previous call to this
    -- operation, which can be used to return the next set of items in the
    -- list.
    ListFunctions -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results you want the request to return.
    ListFunctions -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The GraphQL API ID.
    ListFunctions -> Text
apiId :: Prelude.Text
  }
  deriving (ListFunctions -> ListFunctions -> Bool
(ListFunctions -> ListFunctions -> Bool)
-> (ListFunctions -> ListFunctions -> Bool) -> Eq ListFunctions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListFunctions -> ListFunctions -> Bool
$c/= :: ListFunctions -> ListFunctions -> Bool
== :: ListFunctions -> ListFunctions -> Bool
$c== :: ListFunctions -> ListFunctions -> Bool
Prelude.Eq, ReadPrec [ListFunctions]
ReadPrec ListFunctions
Int -> ReadS ListFunctions
ReadS [ListFunctions]
(Int -> ReadS ListFunctions)
-> ReadS [ListFunctions]
-> ReadPrec ListFunctions
-> ReadPrec [ListFunctions]
-> Read ListFunctions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListFunctions]
$creadListPrec :: ReadPrec [ListFunctions]
readPrec :: ReadPrec ListFunctions
$creadPrec :: ReadPrec ListFunctions
readList :: ReadS [ListFunctions]
$creadList :: ReadS [ListFunctions]
readsPrec :: Int -> ReadS ListFunctions
$creadsPrec :: Int -> ReadS ListFunctions
Prelude.Read, Int -> ListFunctions -> ShowS
[ListFunctions] -> ShowS
ListFunctions -> String
(Int -> ListFunctions -> ShowS)
-> (ListFunctions -> String)
-> ([ListFunctions] -> ShowS)
-> Show ListFunctions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListFunctions] -> ShowS
$cshowList :: [ListFunctions] -> ShowS
show :: ListFunctions -> String
$cshow :: ListFunctions -> String
showsPrec :: Int -> ListFunctions -> ShowS
$cshowsPrec :: Int -> ListFunctions -> ShowS
Prelude.Show, (forall x. ListFunctions -> Rep ListFunctions x)
-> (forall x. Rep ListFunctions x -> ListFunctions)
-> Generic ListFunctions
forall x. Rep ListFunctions x -> ListFunctions
forall x. ListFunctions -> Rep ListFunctions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListFunctions x -> ListFunctions
$cfrom :: forall x. ListFunctions -> Rep ListFunctions x
Prelude.Generic)

-- |
-- Create a value of 'ListFunctions' 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', 'listFunctions_nextToken' - An identifier that was returned from the previous call to this
-- operation, which can be used to return the next set of items in the
-- list.
--
-- 'maxResults', 'listFunctions_maxResults' - The maximum number of results you want the request to return.
--
-- 'apiId', 'listFunctions_apiId' - The GraphQL API ID.
newListFunctions ::
  -- | 'apiId'
  Prelude.Text ->
  ListFunctions
newListFunctions :: Text -> ListFunctions
newListFunctions Text
pApiId_ =
  ListFunctions' :: Maybe Text -> Maybe Natural -> Text -> ListFunctions
ListFunctions'
    { $sel:nextToken:ListFunctions' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListFunctions' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:apiId:ListFunctions' :: Text
apiId = Text
pApiId_
    }

-- | An identifier that was returned from the previous call to this
-- operation, which can be used to return the next set of items in the
-- list.
listFunctions_nextToken :: Lens.Lens' ListFunctions (Prelude.Maybe Prelude.Text)
listFunctions_nextToken :: (Maybe Text -> f (Maybe Text)) -> ListFunctions -> f ListFunctions
listFunctions_nextToken = (ListFunctions -> Maybe Text)
-> (ListFunctions -> Maybe Text -> ListFunctions)
-> Lens ListFunctions ListFunctions (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFunctions' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListFunctions' :: ListFunctions -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListFunctions
s@ListFunctions' {} Maybe Text
a -> ListFunctions
s {$sel:nextToken:ListFunctions' :: Maybe Text
nextToken = Maybe Text
a} :: ListFunctions)

-- | The maximum number of results you want the request to return.
listFunctions_maxResults :: Lens.Lens' ListFunctions (Prelude.Maybe Prelude.Natural)
listFunctions_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListFunctions -> f ListFunctions
listFunctions_maxResults = (ListFunctions -> Maybe Natural)
-> (ListFunctions -> Maybe Natural -> ListFunctions)
-> Lens ListFunctions ListFunctions (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFunctions' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListFunctions' :: ListFunctions -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListFunctions
s@ListFunctions' {} Maybe Natural
a -> ListFunctions
s {$sel:maxResults:ListFunctions' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListFunctions)

-- | The GraphQL API ID.
listFunctions_apiId :: Lens.Lens' ListFunctions Prelude.Text
listFunctions_apiId :: (Text -> f Text) -> ListFunctions -> f ListFunctions
listFunctions_apiId = (ListFunctions -> Text)
-> (ListFunctions -> Text -> ListFunctions)
-> Lens ListFunctions ListFunctions Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFunctions' {Text
apiId :: Text
$sel:apiId:ListFunctions' :: ListFunctions -> Text
apiId} -> Text
apiId) (\s :: ListFunctions
s@ListFunctions' {} Text
a -> ListFunctions
s {$sel:apiId:ListFunctions' :: Text
apiId = Text
a} :: ListFunctions)

instance Core.AWSPager ListFunctions where
  page :: ListFunctions -> AWSResponse ListFunctions -> Maybe ListFunctions
page ListFunctions
rq AWSResponse ListFunctions
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListFunctions
ListFunctionsResponse
rs
            ListFunctionsResponse
-> Getting (First Text) ListFunctionsResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListFunctionsResponse
-> Const (First Text) ListFunctionsResponse
Lens' ListFunctionsResponse (Maybe Text)
listFunctionsResponse_nextToken ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListFunctionsResponse
 -> Const (First Text) ListFunctionsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListFunctionsResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListFunctions
forall a. Maybe a
Prelude.Nothing
    | Maybe [FunctionConfiguration] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListFunctions
ListFunctionsResponse
rs
            ListFunctionsResponse
-> Getting
     (First [FunctionConfiguration])
     ListFunctionsResponse
     [FunctionConfiguration]
-> Maybe [FunctionConfiguration]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [FunctionConfiguration]
 -> Const
      (First [FunctionConfiguration]) (Maybe [FunctionConfiguration]))
-> ListFunctionsResponse
-> Const (First [FunctionConfiguration]) ListFunctionsResponse
Lens' ListFunctionsResponse (Maybe [FunctionConfiguration])
listFunctionsResponse_functions ((Maybe [FunctionConfiguration]
  -> Const
       (First [FunctionConfiguration]) (Maybe [FunctionConfiguration]))
 -> ListFunctionsResponse
 -> Const (First [FunctionConfiguration]) ListFunctionsResponse)
-> (([FunctionConfiguration]
     -> Const (First [FunctionConfiguration]) [FunctionConfiguration])
    -> Maybe [FunctionConfiguration]
    -> Const
         (First [FunctionConfiguration]) (Maybe [FunctionConfiguration]))
-> Getting
     (First [FunctionConfiguration])
     ListFunctionsResponse
     [FunctionConfiguration]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([FunctionConfiguration]
 -> Const (First [FunctionConfiguration]) [FunctionConfiguration])
-> Maybe [FunctionConfiguration]
-> Const
     (First [FunctionConfiguration]) (Maybe [FunctionConfiguration])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListFunctions
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListFunctions -> Maybe ListFunctions
forall a. a -> Maybe a
Prelude.Just (ListFunctions -> Maybe ListFunctions)
-> ListFunctions -> Maybe ListFunctions
forall a b. (a -> b) -> a -> b
Prelude.$
        ListFunctions
rq
          ListFunctions -> (ListFunctions -> ListFunctions) -> ListFunctions
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListFunctions -> Identity ListFunctions
Lens ListFunctions ListFunctions (Maybe Text) (Maybe Text)
listFunctions_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListFunctions -> Identity ListFunctions)
-> Maybe Text -> ListFunctions -> ListFunctions
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListFunctions
ListFunctionsResponse
rs
          ListFunctionsResponse
-> Getting (First Text) ListFunctionsResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListFunctionsResponse
-> Const (First Text) ListFunctionsResponse
Lens' ListFunctionsResponse (Maybe Text)
listFunctionsResponse_nextToken ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListFunctionsResponse
 -> Const (First Text) ListFunctionsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListFunctionsResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

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

instance Prelude.NFData ListFunctions

instance Core.ToHeaders ListFunctions where
  toHeaders :: ListFunctions -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListFunctions -> 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.ToPath ListFunctions where
  toPath :: ListFunctions -> ByteString
toPath ListFunctions' {Maybe Natural
Maybe Text
Text
apiId :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:apiId:ListFunctions' :: ListFunctions -> Text
$sel:maxResults:ListFunctions' :: ListFunctions -> Maybe Natural
$sel:nextToken:ListFunctions' :: ListFunctions -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/v1/apis/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
apiId, ByteString
"/functions"]

instance Core.ToQuery ListFunctions where
  toQuery :: ListFunctions -> QueryString
toQuery ListFunctions' {Maybe Natural
Maybe Text
Text
apiId :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:apiId:ListFunctions' :: ListFunctions -> Text
$sel:maxResults:ListFunctions' :: ListFunctions -> Maybe Natural
$sel:nextToken:ListFunctions' :: ListFunctions -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"nextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"maxResults" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxResults
      ]

-- | /See:/ 'newListFunctionsResponse' smart constructor.
data ListFunctionsResponse = ListFunctionsResponse'
  { -- | An identifier that was returned from the previous call to this
    -- operation, which can be used to return the next set of items in the
    -- list.
    ListFunctionsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | A list of @Function@ objects.
    ListFunctionsResponse -> Maybe [FunctionConfiguration]
functions :: Prelude.Maybe [FunctionConfiguration],
    -- | The response's http status code.
    ListFunctionsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListFunctionsResponse -> ListFunctionsResponse -> Bool
(ListFunctionsResponse -> ListFunctionsResponse -> Bool)
-> (ListFunctionsResponse -> ListFunctionsResponse -> Bool)
-> Eq ListFunctionsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListFunctionsResponse -> ListFunctionsResponse -> Bool
$c/= :: ListFunctionsResponse -> ListFunctionsResponse -> Bool
== :: ListFunctionsResponse -> ListFunctionsResponse -> Bool
$c== :: ListFunctionsResponse -> ListFunctionsResponse -> Bool
Prelude.Eq, ReadPrec [ListFunctionsResponse]
ReadPrec ListFunctionsResponse
Int -> ReadS ListFunctionsResponse
ReadS [ListFunctionsResponse]
(Int -> ReadS ListFunctionsResponse)
-> ReadS [ListFunctionsResponse]
-> ReadPrec ListFunctionsResponse
-> ReadPrec [ListFunctionsResponse]
-> Read ListFunctionsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListFunctionsResponse]
$creadListPrec :: ReadPrec [ListFunctionsResponse]
readPrec :: ReadPrec ListFunctionsResponse
$creadPrec :: ReadPrec ListFunctionsResponse
readList :: ReadS [ListFunctionsResponse]
$creadList :: ReadS [ListFunctionsResponse]
readsPrec :: Int -> ReadS ListFunctionsResponse
$creadsPrec :: Int -> ReadS ListFunctionsResponse
Prelude.Read, Int -> ListFunctionsResponse -> ShowS
[ListFunctionsResponse] -> ShowS
ListFunctionsResponse -> String
(Int -> ListFunctionsResponse -> ShowS)
-> (ListFunctionsResponse -> String)
-> ([ListFunctionsResponse] -> ShowS)
-> Show ListFunctionsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListFunctionsResponse] -> ShowS
$cshowList :: [ListFunctionsResponse] -> ShowS
show :: ListFunctionsResponse -> String
$cshow :: ListFunctionsResponse -> String
showsPrec :: Int -> ListFunctionsResponse -> ShowS
$cshowsPrec :: Int -> ListFunctionsResponse -> ShowS
Prelude.Show, (forall x. ListFunctionsResponse -> Rep ListFunctionsResponse x)
-> (forall x. Rep ListFunctionsResponse x -> ListFunctionsResponse)
-> Generic ListFunctionsResponse
forall x. Rep ListFunctionsResponse x -> ListFunctionsResponse
forall x. ListFunctionsResponse -> Rep ListFunctionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListFunctionsResponse x -> ListFunctionsResponse
$cfrom :: forall x. ListFunctionsResponse -> Rep ListFunctionsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListFunctionsResponse' 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', 'listFunctionsResponse_nextToken' - An identifier that was returned from the previous call to this
-- operation, which can be used to return the next set of items in the
-- list.
--
-- 'functions', 'listFunctionsResponse_functions' - A list of @Function@ objects.
--
-- 'httpStatus', 'listFunctionsResponse_httpStatus' - The response's http status code.
newListFunctionsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListFunctionsResponse
newListFunctionsResponse :: Int -> ListFunctionsResponse
newListFunctionsResponse Int
pHttpStatus_ =
  ListFunctionsResponse' :: Maybe Text
-> Maybe [FunctionConfiguration] -> Int -> ListFunctionsResponse
ListFunctionsResponse'
    { $sel:nextToken:ListFunctionsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:functions:ListFunctionsResponse' :: Maybe [FunctionConfiguration]
functions = Maybe [FunctionConfiguration]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListFunctionsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | An identifier that was returned from the previous call to this
-- operation, which can be used to return the next set of items in the
-- list.
listFunctionsResponse_nextToken :: Lens.Lens' ListFunctionsResponse (Prelude.Maybe Prelude.Text)
listFunctionsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListFunctionsResponse -> f ListFunctionsResponse
listFunctionsResponse_nextToken = (ListFunctionsResponse -> Maybe Text)
-> (ListFunctionsResponse -> Maybe Text -> ListFunctionsResponse)
-> Lens' ListFunctionsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFunctionsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListFunctionsResponse' :: ListFunctionsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListFunctionsResponse
s@ListFunctionsResponse' {} Maybe Text
a -> ListFunctionsResponse
s {$sel:nextToken:ListFunctionsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListFunctionsResponse)

-- | A list of @Function@ objects.
listFunctionsResponse_functions :: Lens.Lens' ListFunctionsResponse (Prelude.Maybe [FunctionConfiguration])
listFunctionsResponse_functions :: (Maybe [FunctionConfiguration]
 -> f (Maybe [FunctionConfiguration]))
-> ListFunctionsResponse -> f ListFunctionsResponse
listFunctionsResponse_functions = (ListFunctionsResponse -> Maybe [FunctionConfiguration])
-> (ListFunctionsResponse
    -> Maybe [FunctionConfiguration] -> ListFunctionsResponse)
-> Lens' ListFunctionsResponse (Maybe [FunctionConfiguration])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFunctionsResponse' {Maybe [FunctionConfiguration]
functions :: Maybe [FunctionConfiguration]
$sel:functions:ListFunctionsResponse' :: ListFunctionsResponse -> Maybe [FunctionConfiguration]
functions} -> Maybe [FunctionConfiguration]
functions) (\s :: ListFunctionsResponse
s@ListFunctionsResponse' {} Maybe [FunctionConfiguration]
a -> ListFunctionsResponse
s {$sel:functions:ListFunctionsResponse' :: Maybe [FunctionConfiguration]
functions = Maybe [FunctionConfiguration]
a} :: ListFunctionsResponse) ((Maybe [FunctionConfiguration]
  -> f (Maybe [FunctionConfiguration]))
 -> ListFunctionsResponse -> f ListFunctionsResponse)
-> ((Maybe [FunctionConfiguration]
     -> f (Maybe [FunctionConfiguration]))
    -> Maybe [FunctionConfiguration]
    -> f (Maybe [FunctionConfiguration]))
-> (Maybe [FunctionConfiguration]
    -> f (Maybe [FunctionConfiguration]))
-> ListFunctionsResponse
-> f ListFunctionsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [FunctionConfiguration]
  [FunctionConfiguration]
  [FunctionConfiguration]
  [FunctionConfiguration]
-> Iso
     (Maybe [FunctionConfiguration])
     (Maybe [FunctionConfiguration])
     (Maybe [FunctionConfiguration])
     (Maybe [FunctionConfiguration])
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
  [FunctionConfiguration]
  [FunctionConfiguration]
  [FunctionConfiguration]
  [FunctionConfiguration]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData ListFunctionsResponse