{-# 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.Greengrass.ListFunctionDefinitions
-- 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)
--
-- Retrieves a list of Lambda function definitions.
--
-- This operation returns paginated results.
module Amazonka.Greengrass.ListFunctionDefinitions
  ( -- * Creating a Request
    ListFunctionDefinitions (..),
    newListFunctionDefinitions,

    -- * Request Lenses
    listFunctionDefinitions_nextToken,
    listFunctionDefinitions_maxResults,

    -- * Destructuring the Response
    ListFunctionDefinitionsResponse (..),
    newListFunctionDefinitionsResponse,

    -- * Response Lenses
    listFunctionDefinitionsResponse_nextToken,
    listFunctionDefinitionsResponse_definitions,
    listFunctionDefinitionsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.Greengrass.Types
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:/ 'newListFunctionDefinitions' smart constructor.
data ListFunctionDefinitions = ListFunctionDefinitions'
  { -- | The token for the next set of results, or \'\'null\'\' if there are no
    -- additional results.
    ListFunctionDefinitions -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results to be returned per request.
    ListFunctionDefinitions -> Maybe Text
maxResults :: Prelude.Maybe Prelude.Text
  }
  deriving (ListFunctionDefinitions -> ListFunctionDefinitions -> Bool
(ListFunctionDefinitions -> ListFunctionDefinitions -> Bool)
-> (ListFunctionDefinitions -> ListFunctionDefinitions -> Bool)
-> Eq ListFunctionDefinitions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListFunctionDefinitions -> ListFunctionDefinitions -> Bool
$c/= :: ListFunctionDefinitions -> ListFunctionDefinitions -> Bool
== :: ListFunctionDefinitions -> ListFunctionDefinitions -> Bool
$c== :: ListFunctionDefinitions -> ListFunctionDefinitions -> Bool
Prelude.Eq, ReadPrec [ListFunctionDefinitions]
ReadPrec ListFunctionDefinitions
Int -> ReadS ListFunctionDefinitions
ReadS [ListFunctionDefinitions]
(Int -> ReadS ListFunctionDefinitions)
-> ReadS [ListFunctionDefinitions]
-> ReadPrec ListFunctionDefinitions
-> ReadPrec [ListFunctionDefinitions]
-> Read ListFunctionDefinitions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListFunctionDefinitions]
$creadListPrec :: ReadPrec [ListFunctionDefinitions]
readPrec :: ReadPrec ListFunctionDefinitions
$creadPrec :: ReadPrec ListFunctionDefinitions
readList :: ReadS [ListFunctionDefinitions]
$creadList :: ReadS [ListFunctionDefinitions]
readsPrec :: Int -> ReadS ListFunctionDefinitions
$creadsPrec :: Int -> ReadS ListFunctionDefinitions
Prelude.Read, Int -> ListFunctionDefinitions -> ShowS
[ListFunctionDefinitions] -> ShowS
ListFunctionDefinitions -> String
(Int -> ListFunctionDefinitions -> ShowS)
-> (ListFunctionDefinitions -> String)
-> ([ListFunctionDefinitions] -> ShowS)
-> Show ListFunctionDefinitions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListFunctionDefinitions] -> ShowS
$cshowList :: [ListFunctionDefinitions] -> ShowS
show :: ListFunctionDefinitions -> String
$cshow :: ListFunctionDefinitions -> String
showsPrec :: Int -> ListFunctionDefinitions -> ShowS
$cshowsPrec :: Int -> ListFunctionDefinitions -> ShowS
Prelude.Show, (forall x.
 ListFunctionDefinitions -> Rep ListFunctionDefinitions x)
-> (forall x.
    Rep ListFunctionDefinitions x -> ListFunctionDefinitions)
-> Generic ListFunctionDefinitions
forall x. Rep ListFunctionDefinitions x -> ListFunctionDefinitions
forall x. ListFunctionDefinitions -> Rep ListFunctionDefinitions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListFunctionDefinitions x -> ListFunctionDefinitions
$cfrom :: forall x. ListFunctionDefinitions -> Rep ListFunctionDefinitions x
Prelude.Generic)

-- |
-- Create a value of 'ListFunctionDefinitions' 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', 'listFunctionDefinitions_nextToken' - The token for the next set of results, or \'\'null\'\' if there are no
-- additional results.
--
-- 'maxResults', 'listFunctionDefinitions_maxResults' - The maximum number of results to be returned per request.
newListFunctionDefinitions ::
  ListFunctionDefinitions
newListFunctionDefinitions :: ListFunctionDefinitions
newListFunctionDefinitions =
  ListFunctionDefinitions' :: Maybe Text -> Maybe Text -> ListFunctionDefinitions
ListFunctionDefinitions'
    { $sel:nextToken:ListFunctionDefinitions' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListFunctionDefinitions' :: Maybe Text
maxResults = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The token for the next set of results, or \'\'null\'\' if there are no
-- additional results.
listFunctionDefinitions_nextToken :: Lens.Lens' ListFunctionDefinitions (Prelude.Maybe Prelude.Text)
listFunctionDefinitions_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListFunctionDefinitions -> f ListFunctionDefinitions
listFunctionDefinitions_nextToken = (ListFunctionDefinitions -> Maybe Text)
-> (ListFunctionDefinitions
    -> Maybe Text -> ListFunctionDefinitions)
-> Lens
     ListFunctionDefinitions
     ListFunctionDefinitions
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFunctionDefinitions' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListFunctionDefinitions' :: ListFunctionDefinitions -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListFunctionDefinitions
s@ListFunctionDefinitions' {} Maybe Text
a -> ListFunctionDefinitions
s {$sel:nextToken:ListFunctionDefinitions' :: Maybe Text
nextToken = Maybe Text
a} :: ListFunctionDefinitions)

-- | The maximum number of results to be returned per request.
listFunctionDefinitions_maxResults :: Lens.Lens' ListFunctionDefinitions (Prelude.Maybe Prelude.Text)
listFunctionDefinitions_maxResults :: (Maybe Text -> f (Maybe Text))
-> ListFunctionDefinitions -> f ListFunctionDefinitions
listFunctionDefinitions_maxResults = (ListFunctionDefinitions -> Maybe Text)
-> (ListFunctionDefinitions
    -> Maybe Text -> ListFunctionDefinitions)
-> Lens
     ListFunctionDefinitions
     ListFunctionDefinitions
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFunctionDefinitions' {Maybe Text
maxResults :: Maybe Text
$sel:maxResults:ListFunctionDefinitions' :: ListFunctionDefinitions -> Maybe Text
maxResults} -> Maybe Text
maxResults) (\s :: ListFunctionDefinitions
s@ListFunctionDefinitions' {} Maybe Text
a -> ListFunctionDefinitions
s {$sel:maxResults:ListFunctionDefinitions' :: Maybe Text
maxResults = Maybe Text
a} :: ListFunctionDefinitions)

instance Core.AWSPager ListFunctionDefinitions where
  page :: ListFunctionDefinitions
-> AWSResponse ListFunctionDefinitions
-> Maybe ListFunctionDefinitions
page ListFunctionDefinitions
rq AWSResponse ListFunctionDefinitions
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListFunctionDefinitions
ListFunctionDefinitionsResponse
rs
            ListFunctionDefinitionsResponse
-> Getting (First Text) ListFunctionDefinitionsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListFunctionDefinitionsResponse
-> Const (First Text) ListFunctionDefinitionsResponse
Lens' ListFunctionDefinitionsResponse (Maybe Text)
listFunctionDefinitionsResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListFunctionDefinitionsResponse
 -> Const (First Text) ListFunctionDefinitionsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListFunctionDefinitionsResponse 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 ListFunctionDefinitions
forall a. Maybe a
Prelude.Nothing
    | Maybe [DefinitionInformation] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListFunctionDefinitions
ListFunctionDefinitionsResponse
rs
            ListFunctionDefinitionsResponse
-> Getting
     (First [DefinitionInformation])
     ListFunctionDefinitionsResponse
     [DefinitionInformation]
-> Maybe [DefinitionInformation]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [DefinitionInformation]
 -> Const
      (First [DefinitionInformation]) (Maybe [DefinitionInformation]))
-> ListFunctionDefinitionsResponse
-> Const
     (First [DefinitionInformation]) ListFunctionDefinitionsResponse
Lens'
  ListFunctionDefinitionsResponse (Maybe [DefinitionInformation])
listFunctionDefinitionsResponse_definitions
              ((Maybe [DefinitionInformation]
  -> Const
       (First [DefinitionInformation]) (Maybe [DefinitionInformation]))
 -> ListFunctionDefinitionsResponse
 -> Const
      (First [DefinitionInformation]) ListFunctionDefinitionsResponse)
-> (([DefinitionInformation]
     -> Const (First [DefinitionInformation]) [DefinitionInformation])
    -> Maybe [DefinitionInformation]
    -> Const
         (First [DefinitionInformation]) (Maybe [DefinitionInformation]))
-> Getting
     (First [DefinitionInformation])
     ListFunctionDefinitionsResponse
     [DefinitionInformation]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([DefinitionInformation]
 -> Const (First [DefinitionInformation]) [DefinitionInformation])
-> Maybe [DefinitionInformation]
-> Const
     (First [DefinitionInformation]) (Maybe [DefinitionInformation])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListFunctionDefinitions
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListFunctionDefinitions -> Maybe ListFunctionDefinitions
forall a. a -> Maybe a
Prelude.Just (ListFunctionDefinitions -> Maybe ListFunctionDefinitions)
-> ListFunctionDefinitions -> Maybe ListFunctionDefinitions
forall a b. (a -> b) -> a -> b
Prelude.$
        ListFunctionDefinitions
rq
          ListFunctionDefinitions
-> (ListFunctionDefinitions -> ListFunctionDefinitions)
-> ListFunctionDefinitions
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListFunctionDefinitions -> Identity ListFunctionDefinitions
Lens
  ListFunctionDefinitions
  ListFunctionDefinitions
  (Maybe Text)
  (Maybe Text)
listFunctionDefinitions_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListFunctionDefinitions -> Identity ListFunctionDefinitions)
-> Maybe Text -> ListFunctionDefinitions -> ListFunctionDefinitions
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListFunctionDefinitions
ListFunctionDefinitionsResponse
rs
          ListFunctionDefinitionsResponse
-> Getting (First Text) ListFunctionDefinitionsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListFunctionDefinitionsResponse
-> Const (First Text) ListFunctionDefinitionsResponse
Lens' ListFunctionDefinitionsResponse (Maybe Text)
listFunctionDefinitionsResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListFunctionDefinitionsResponse
 -> Const (First Text) ListFunctionDefinitionsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListFunctionDefinitionsResponse 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 ListFunctionDefinitions where
  type
    AWSResponse ListFunctionDefinitions =
      ListFunctionDefinitionsResponse
  request :: ListFunctionDefinitions -> Request ListFunctionDefinitions
request = Service
-> ListFunctionDefinitions -> Request ListFunctionDefinitions
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy ListFunctionDefinitions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListFunctionDefinitions)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListFunctionDefinitions))
-> Logger
-> Service
-> Proxy ListFunctionDefinitions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListFunctionDefinitions)))
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 [DefinitionInformation]
-> Int
-> ListFunctionDefinitionsResponse
ListFunctionDefinitionsResponse'
            (Maybe Text
 -> Maybe [DefinitionInformation]
 -> Int
 -> ListFunctionDefinitionsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [DefinitionInformation]
      -> Int -> ListFunctionDefinitionsResponse)
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 [DefinitionInformation]
   -> Int -> ListFunctionDefinitionsResponse)
-> Either String (Maybe [DefinitionInformation])
-> Either String (Int -> ListFunctionDefinitionsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text -> Either String (Maybe (Maybe [DefinitionInformation]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Definitions" Either String (Maybe (Maybe [DefinitionInformation]))
-> Maybe [DefinitionInformation]
-> Either String (Maybe [DefinitionInformation])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [DefinitionInformation]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Int -> ListFunctionDefinitionsResponse)
-> Either String Int
-> Either String ListFunctionDefinitionsResponse
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 ListFunctionDefinitions

instance Prelude.NFData ListFunctionDefinitions

instance Core.ToHeaders ListFunctionDefinitions where
  toHeaders :: ListFunctionDefinitions -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListFunctionDefinitions -> 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 ListFunctionDefinitions where
  toPath :: ListFunctionDefinitions -> ByteString
toPath =
    ByteString -> ListFunctionDefinitions -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/greengrass/definition/functions"

instance Core.ToQuery ListFunctionDefinitions where
  toQuery :: ListFunctionDefinitions -> QueryString
toQuery ListFunctionDefinitions' {Maybe Text
maxResults :: Maybe Text
nextToken :: Maybe Text
$sel:maxResults:ListFunctionDefinitions' :: ListFunctionDefinitions -> Maybe Text
$sel:nextToken:ListFunctionDefinitions' :: ListFunctionDefinitions -> 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 Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
maxResults
      ]

-- | /See:/ 'newListFunctionDefinitionsResponse' smart constructor.
data ListFunctionDefinitionsResponse = ListFunctionDefinitionsResponse'
  { -- | The token for the next set of results, or \'\'null\'\' if there are no
    -- additional results.
    ListFunctionDefinitionsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Information about a definition.
    ListFunctionDefinitionsResponse -> Maybe [DefinitionInformation]
definitions :: Prelude.Maybe [DefinitionInformation],
    -- | The response's http status code.
    ListFunctionDefinitionsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListFunctionDefinitionsResponse
-> ListFunctionDefinitionsResponse -> Bool
(ListFunctionDefinitionsResponse
 -> ListFunctionDefinitionsResponse -> Bool)
-> (ListFunctionDefinitionsResponse
    -> ListFunctionDefinitionsResponse -> Bool)
-> Eq ListFunctionDefinitionsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListFunctionDefinitionsResponse
-> ListFunctionDefinitionsResponse -> Bool
$c/= :: ListFunctionDefinitionsResponse
-> ListFunctionDefinitionsResponse -> Bool
== :: ListFunctionDefinitionsResponse
-> ListFunctionDefinitionsResponse -> Bool
$c== :: ListFunctionDefinitionsResponse
-> ListFunctionDefinitionsResponse -> Bool
Prelude.Eq, ReadPrec [ListFunctionDefinitionsResponse]
ReadPrec ListFunctionDefinitionsResponse
Int -> ReadS ListFunctionDefinitionsResponse
ReadS [ListFunctionDefinitionsResponse]
(Int -> ReadS ListFunctionDefinitionsResponse)
-> ReadS [ListFunctionDefinitionsResponse]
-> ReadPrec ListFunctionDefinitionsResponse
-> ReadPrec [ListFunctionDefinitionsResponse]
-> Read ListFunctionDefinitionsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListFunctionDefinitionsResponse]
$creadListPrec :: ReadPrec [ListFunctionDefinitionsResponse]
readPrec :: ReadPrec ListFunctionDefinitionsResponse
$creadPrec :: ReadPrec ListFunctionDefinitionsResponse
readList :: ReadS [ListFunctionDefinitionsResponse]
$creadList :: ReadS [ListFunctionDefinitionsResponse]
readsPrec :: Int -> ReadS ListFunctionDefinitionsResponse
$creadsPrec :: Int -> ReadS ListFunctionDefinitionsResponse
Prelude.Read, Int -> ListFunctionDefinitionsResponse -> ShowS
[ListFunctionDefinitionsResponse] -> ShowS
ListFunctionDefinitionsResponse -> String
(Int -> ListFunctionDefinitionsResponse -> ShowS)
-> (ListFunctionDefinitionsResponse -> String)
-> ([ListFunctionDefinitionsResponse] -> ShowS)
-> Show ListFunctionDefinitionsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListFunctionDefinitionsResponse] -> ShowS
$cshowList :: [ListFunctionDefinitionsResponse] -> ShowS
show :: ListFunctionDefinitionsResponse -> String
$cshow :: ListFunctionDefinitionsResponse -> String
showsPrec :: Int -> ListFunctionDefinitionsResponse -> ShowS
$cshowsPrec :: Int -> ListFunctionDefinitionsResponse -> ShowS
Prelude.Show, (forall x.
 ListFunctionDefinitionsResponse
 -> Rep ListFunctionDefinitionsResponse x)
-> (forall x.
    Rep ListFunctionDefinitionsResponse x
    -> ListFunctionDefinitionsResponse)
-> Generic ListFunctionDefinitionsResponse
forall x.
Rep ListFunctionDefinitionsResponse x
-> ListFunctionDefinitionsResponse
forall x.
ListFunctionDefinitionsResponse
-> Rep ListFunctionDefinitionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListFunctionDefinitionsResponse x
-> ListFunctionDefinitionsResponse
$cfrom :: forall x.
ListFunctionDefinitionsResponse
-> Rep ListFunctionDefinitionsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListFunctionDefinitionsResponse' 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', 'listFunctionDefinitionsResponse_nextToken' - The token for the next set of results, or \'\'null\'\' if there are no
-- additional results.
--
-- 'definitions', 'listFunctionDefinitionsResponse_definitions' - Information about a definition.
--
-- 'httpStatus', 'listFunctionDefinitionsResponse_httpStatus' - The response's http status code.
newListFunctionDefinitionsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListFunctionDefinitionsResponse
newListFunctionDefinitionsResponse :: Int -> ListFunctionDefinitionsResponse
newListFunctionDefinitionsResponse Int
pHttpStatus_ =
  ListFunctionDefinitionsResponse' :: Maybe Text
-> Maybe [DefinitionInformation]
-> Int
-> ListFunctionDefinitionsResponse
ListFunctionDefinitionsResponse'
    { $sel:nextToken:ListFunctionDefinitionsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:definitions:ListFunctionDefinitionsResponse' :: Maybe [DefinitionInformation]
definitions = Maybe [DefinitionInformation]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListFunctionDefinitionsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The token for the next set of results, or \'\'null\'\' if there are no
-- additional results.
listFunctionDefinitionsResponse_nextToken :: Lens.Lens' ListFunctionDefinitionsResponse (Prelude.Maybe Prelude.Text)
listFunctionDefinitionsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListFunctionDefinitionsResponse
-> f ListFunctionDefinitionsResponse
listFunctionDefinitionsResponse_nextToken = (ListFunctionDefinitionsResponse -> Maybe Text)
-> (ListFunctionDefinitionsResponse
    -> Maybe Text -> ListFunctionDefinitionsResponse)
-> Lens' ListFunctionDefinitionsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFunctionDefinitionsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListFunctionDefinitionsResponse' :: ListFunctionDefinitionsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListFunctionDefinitionsResponse
s@ListFunctionDefinitionsResponse' {} Maybe Text
a -> ListFunctionDefinitionsResponse
s {$sel:nextToken:ListFunctionDefinitionsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListFunctionDefinitionsResponse)

-- | Information about a definition.
listFunctionDefinitionsResponse_definitions :: Lens.Lens' ListFunctionDefinitionsResponse (Prelude.Maybe [DefinitionInformation])
listFunctionDefinitionsResponse_definitions :: (Maybe [DefinitionInformation]
 -> f (Maybe [DefinitionInformation]))
-> ListFunctionDefinitionsResponse
-> f ListFunctionDefinitionsResponse
listFunctionDefinitionsResponse_definitions = (ListFunctionDefinitionsResponse -> Maybe [DefinitionInformation])
-> (ListFunctionDefinitionsResponse
    -> Maybe [DefinitionInformation]
    -> ListFunctionDefinitionsResponse)
-> Lens'
     ListFunctionDefinitionsResponse (Maybe [DefinitionInformation])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFunctionDefinitionsResponse' {Maybe [DefinitionInformation]
definitions :: Maybe [DefinitionInformation]
$sel:definitions:ListFunctionDefinitionsResponse' :: ListFunctionDefinitionsResponse -> Maybe [DefinitionInformation]
definitions} -> Maybe [DefinitionInformation]
definitions) (\s :: ListFunctionDefinitionsResponse
s@ListFunctionDefinitionsResponse' {} Maybe [DefinitionInformation]
a -> ListFunctionDefinitionsResponse
s {$sel:definitions:ListFunctionDefinitionsResponse' :: Maybe [DefinitionInformation]
definitions = Maybe [DefinitionInformation]
a} :: ListFunctionDefinitionsResponse) ((Maybe [DefinitionInformation]
  -> f (Maybe [DefinitionInformation]))
 -> ListFunctionDefinitionsResponse
 -> f ListFunctionDefinitionsResponse)
-> ((Maybe [DefinitionInformation]
     -> f (Maybe [DefinitionInformation]))
    -> Maybe [DefinitionInformation]
    -> f (Maybe [DefinitionInformation]))
-> (Maybe [DefinitionInformation]
    -> f (Maybe [DefinitionInformation]))
-> ListFunctionDefinitionsResponse
-> f ListFunctionDefinitionsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [DefinitionInformation]
  [DefinitionInformation]
  [DefinitionInformation]
  [DefinitionInformation]
-> Iso
     (Maybe [DefinitionInformation])
     (Maybe [DefinitionInformation])
     (Maybe [DefinitionInformation])
     (Maybe [DefinitionInformation])
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
  [DefinitionInformation]
  [DefinitionInformation]
  [DefinitionInformation]
  [DefinitionInformation]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    ListFunctionDefinitionsResponse