{-# 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.Lambda.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)
--
-- Returns a list of Lambda functions, with the version-specific
-- configuration of each. Lambda returns up to 50 functions per call.
--
-- Set @FunctionVersion@ to @ALL@ to include all published versions of each
-- function in addition to the unpublished version.
--
-- The @ListFunctions@ action returns a subset of the FunctionConfiguration
-- fields. To get the additional fields (State, StateReasonCode,
-- StateReason, LastUpdateStatus, LastUpdateStatusReason,
-- LastUpdateStatusReasonCode) for a function or version, use GetFunction.
--
-- This operation returns paginated results.
module Amazonka.Lambda.ListFunctions
  ( -- * Creating a Request
    ListFunctions (..),
    newListFunctions,

    -- * Request Lenses
    listFunctions_masterRegion,
    listFunctions_marker,
    listFunctions_maxItems,
    listFunctions_functionVersion,

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

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

import qualified Amazonka.Core as Core
import Amazonka.Lambda.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:/ 'newListFunctions' smart constructor.
data ListFunctions = ListFunctions'
  { -- | For Lambda\@Edge functions, the Amazon Web Services Region of the master
    -- function. For example, @us-east-1@ filters the list of functions to only
    -- include Lambda\@Edge functions replicated from a master function in US
    -- East (N. Virginia). If specified, you must set @FunctionVersion@ to
    -- @ALL@.
    ListFunctions -> Maybe Text
masterRegion :: Prelude.Maybe Prelude.Text,
    -- | Specify the pagination token that\'s returned by a previous request to
    -- retrieve the next page of results.
    ListFunctions -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of functions to return in the response. Note that
    -- @ListFunctions@ returns a maximum of 50 items in each response, even if
    -- you set the number higher.
    ListFunctions -> Maybe Natural
maxItems :: Prelude.Maybe Prelude.Natural,
    -- | Set to @ALL@ to include entries for all published versions of each
    -- function.
    ListFunctions -> Maybe FunctionVersion
functionVersion :: Prelude.Maybe FunctionVersion
  }
  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:
--
-- 'masterRegion', 'listFunctions_masterRegion' - For Lambda\@Edge functions, the Amazon Web Services Region of the master
-- function. For example, @us-east-1@ filters the list of functions to only
-- include Lambda\@Edge functions replicated from a master function in US
-- East (N. Virginia). If specified, you must set @FunctionVersion@ to
-- @ALL@.
--
-- 'marker', 'listFunctions_marker' - Specify the pagination token that\'s returned by a previous request to
-- retrieve the next page of results.
--
-- 'maxItems', 'listFunctions_maxItems' - The maximum number of functions to return in the response. Note that
-- @ListFunctions@ returns a maximum of 50 items in each response, even if
-- you set the number higher.
--
-- 'functionVersion', 'listFunctions_functionVersion' - Set to @ALL@ to include entries for all published versions of each
-- function.
newListFunctions ::
  ListFunctions
newListFunctions :: ListFunctions
newListFunctions =
  ListFunctions' :: Maybe Text
-> Maybe Text
-> Maybe Natural
-> Maybe FunctionVersion
-> ListFunctions
ListFunctions'
    { $sel:masterRegion:ListFunctions' :: Maybe Text
masterRegion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:marker:ListFunctions' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxItems:ListFunctions' :: Maybe Natural
maxItems = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:functionVersion:ListFunctions' :: Maybe FunctionVersion
functionVersion = Maybe FunctionVersion
forall a. Maybe a
Prelude.Nothing
    }

-- | For Lambda\@Edge functions, the Amazon Web Services Region of the master
-- function. For example, @us-east-1@ filters the list of functions to only
-- include Lambda\@Edge functions replicated from a master function in US
-- East (N. Virginia). If specified, you must set @FunctionVersion@ to
-- @ALL@.
listFunctions_masterRegion :: Lens.Lens' ListFunctions (Prelude.Maybe Prelude.Text)
listFunctions_masterRegion :: (Maybe Text -> f (Maybe Text)) -> ListFunctions -> f ListFunctions
listFunctions_masterRegion = (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
masterRegion :: Maybe Text
$sel:masterRegion:ListFunctions' :: ListFunctions -> Maybe Text
masterRegion} -> Maybe Text
masterRegion) (\s :: ListFunctions
s@ListFunctions' {} Maybe Text
a -> ListFunctions
s {$sel:masterRegion:ListFunctions' :: Maybe Text
masterRegion = Maybe Text
a} :: ListFunctions)

-- | Specify the pagination token that\'s returned by a previous request to
-- retrieve the next page of results.
listFunctions_marker :: Lens.Lens' ListFunctions (Prelude.Maybe Prelude.Text)
listFunctions_marker :: (Maybe Text -> f (Maybe Text)) -> ListFunctions -> f ListFunctions
listFunctions_marker = (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
marker :: Maybe Text
$sel:marker:ListFunctions' :: ListFunctions -> Maybe Text
marker} -> Maybe Text
marker) (\s :: ListFunctions
s@ListFunctions' {} Maybe Text
a -> ListFunctions
s {$sel:marker:ListFunctions' :: Maybe Text
marker = Maybe Text
a} :: ListFunctions)

-- | The maximum number of functions to return in the response. Note that
-- @ListFunctions@ returns a maximum of 50 items in each response, even if
-- you set the number higher.
listFunctions_maxItems :: Lens.Lens' ListFunctions (Prelude.Maybe Prelude.Natural)
listFunctions_maxItems :: (Maybe Natural -> f (Maybe Natural))
-> ListFunctions -> f ListFunctions
listFunctions_maxItems = (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
maxItems :: Maybe Natural
$sel:maxItems:ListFunctions' :: ListFunctions -> Maybe Natural
maxItems} -> Maybe Natural
maxItems) (\s :: ListFunctions
s@ListFunctions' {} Maybe Natural
a -> ListFunctions
s {$sel:maxItems:ListFunctions' :: Maybe Natural
maxItems = Maybe Natural
a} :: ListFunctions)

-- | Set to @ALL@ to include entries for all published versions of each
-- function.
listFunctions_functionVersion :: Lens.Lens' ListFunctions (Prelude.Maybe FunctionVersion)
listFunctions_functionVersion :: (Maybe FunctionVersion -> f (Maybe FunctionVersion))
-> ListFunctions -> f ListFunctions
listFunctions_functionVersion = (ListFunctions -> Maybe FunctionVersion)
-> (ListFunctions -> Maybe FunctionVersion -> ListFunctions)
-> Lens
     ListFunctions
     ListFunctions
     (Maybe FunctionVersion)
     (Maybe FunctionVersion)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFunctions' {Maybe FunctionVersion
functionVersion :: Maybe FunctionVersion
$sel:functionVersion:ListFunctions' :: ListFunctions -> Maybe FunctionVersion
functionVersion} -> Maybe FunctionVersion
functionVersion) (\s :: ListFunctions
s@ListFunctions' {} Maybe FunctionVersion
a -> ListFunctions
s {$sel:functionVersion:ListFunctions' :: Maybe FunctionVersion
functionVersion = Maybe FunctionVersion
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_nextMarker
              ((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_marker
          ((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_nextMarker ((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
"NextMarker")
            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
forall a. Monoid a => a
Prelude.mempty

instance Core.ToPath ListFunctions where
  toPath :: ListFunctions -> ByteString
toPath = ByteString -> ListFunctions -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/2015-03-31/functions/"

instance Core.ToQuery ListFunctions where
  toQuery :: ListFunctions -> QueryString
toQuery ListFunctions' {Maybe Natural
Maybe Text
Maybe FunctionVersion
functionVersion :: Maybe FunctionVersion
maxItems :: Maybe Natural
marker :: Maybe Text
masterRegion :: Maybe Text
$sel:functionVersion:ListFunctions' :: ListFunctions -> Maybe FunctionVersion
$sel:maxItems:ListFunctions' :: ListFunctions -> Maybe Natural
$sel:marker:ListFunctions' :: ListFunctions -> Maybe Text
$sel:masterRegion:ListFunctions' :: ListFunctions -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"MasterRegion" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
masterRegion,
        ByteString
"Marker" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
marker,
        ByteString
"MaxItems" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxItems,
        ByteString
"FunctionVersion" ByteString -> Maybe FunctionVersion -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe FunctionVersion
functionVersion
      ]

-- | A list of Lambda functions.
--
-- /See:/ 'newListFunctionsResponse' smart constructor.
data ListFunctionsResponse = ListFunctionsResponse'
  { -- | The pagination token that\'s included if more results are available.
    ListFunctionsResponse -> Maybe Text
nextMarker :: Prelude.Maybe Prelude.Text,
    -- | A list of Lambda functions.
    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, 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:
--
-- 'nextMarker', 'listFunctionsResponse_nextMarker' - The pagination token that\'s included if more results are available.
--
-- 'functions', 'listFunctionsResponse_functions' - A list of Lambda functions.
--
-- '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:nextMarker:ListFunctionsResponse' :: Maybe Text
nextMarker =
        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_
    }

-- | The pagination token that\'s included if more results are available.
listFunctionsResponse_nextMarker :: Lens.Lens' ListFunctionsResponse (Prelude.Maybe Prelude.Text)
listFunctionsResponse_nextMarker :: (Maybe Text -> f (Maybe Text))
-> ListFunctionsResponse -> f ListFunctionsResponse
listFunctionsResponse_nextMarker = (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
nextMarker :: Maybe Text
$sel:nextMarker:ListFunctionsResponse' :: ListFunctionsResponse -> Maybe Text
nextMarker} -> Maybe Text
nextMarker) (\s :: ListFunctionsResponse
s@ListFunctionsResponse' {} Maybe Text
a -> ListFunctionsResponse
s {$sel:nextMarker:ListFunctionsResponse' :: Maybe Text
nextMarker = Maybe Text
a} :: ListFunctionsResponse)

-- | A list of Lambda functions.
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