{-# 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.ListVersionsByFunction
-- 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
-- <https://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html versions>,
-- with the version-specific configuration of each. Lambda returns up to 50
-- versions per call.
--
-- This operation returns paginated results.
module Amazonka.Lambda.ListVersionsByFunction
  ( -- * Creating a Request
    ListVersionsByFunction (..),
    newListVersionsByFunction,

    -- * Request Lenses
    listVersionsByFunction_marker,
    listVersionsByFunction_maxItems,
    listVersionsByFunction_functionName,

    -- * Destructuring the Response
    ListVersionsByFunctionResponse (..),
    newListVersionsByFunctionResponse,

    -- * Response Lenses
    listVersionsByFunctionResponse_versions,
    listVersionsByFunctionResponse_nextMarker,
    listVersionsByFunctionResponse_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:/ 'newListVersionsByFunction' smart constructor.
data ListVersionsByFunction = ListVersionsByFunction'
  { -- | Specify the pagination token that\'s returned by a previous request to
    -- retrieve the next page of results.
    ListVersionsByFunction -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of versions to return. Note that
    -- @ListVersionsByFunction@ returns a maximum of 50 items in each response,
    -- even if you set the number higher.
    ListVersionsByFunction -> Maybe Natural
maxItems :: Prelude.Maybe Prelude.Natural,
    -- | The name of the Lambda function.
    --
    -- __Name formats__
    --
    -- -   __Function name__ - @MyFunction@.
    --
    -- -   __Function ARN__ -
    --     @arn:aws:lambda:us-west-2:123456789012:function:MyFunction@.
    --
    -- -   __Partial ARN__ - @123456789012:function:MyFunction@.
    --
    -- The length constraint applies only to the full ARN. If you specify only
    -- the function name, it is limited to 64 characters in length.
    ListVersionsByFunction -> Text
functionName :: Prelude.Text
  }
  deriving (ListVersionsByFunction -> ListVersionsByFunction -> Bool
(ListVersionsByFunction -> ListVersionsByFunction -> Bool)
-> (ListVersionsByFunction -> ListVersionsByFunction -> Bool)
-> Eq ListVersionsByFunction
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListVersionsByFunction -> ListVersionsByFunction -> Bool
$c/= :: ListVersionsByFunction -> ListVersionsByFunction -> Bool
== :: ListVersionsByFunction -> ListVersionsByFunction -> Bool
$c== :: ListVersionsByFunction -> ListVersionsByFunction -> Bool
Prelude.Eq, ReadPrec [ListVersionsByFunction]
ReadPrec ListVersionsByFunction
Int -> ReadS ListVersionsByFunction
ReadS [ListVersionsByFunction]
(Int -> ReadS ListVersionsByFunction)
-> ReadS [ListVersionsByFunction]
-> ReadPrec ListVersionsByFunction
-> ReadPrec [ListVersionsByFunction]
-> Read ListVersionsByFunction
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListVersionsByFunction]
$creadListPrec :: ReadPrec [ListVersionsByFunction]
readPrec :: ReadPrec ListVersionsByFunction
$creadPrec :: ReadPrec ListVersionsByFunction
readList :: ReadS [ListVersionsByFunction]
$creadList :: ReadS [ListVersionsByFunction]
readsPrec :: Int -> ReadS ListVersionsByFunction
$creadsPrec :: Int -> ReadS ListVersionsByFunction
Prelude.Read, Int -> ListVersionsByFunction -> ShowS
[ListVersionsByFunction] -> ShowS
ListVersionsByFunction -> String
(Int -> ListVersionsByFunction -> ShowS)
-> (ListVersionsByFunction -> String)
-> ([ListVersionsByFunction] -> ShowS)
-> Show ListVersionsByFunction
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListVersionsByFunction] -> ShowS
$cshowList :: [ListVersionsByFunction] -> ShowS
show :: ListVersionsByFunction -> String
$cshow :: ListVersionsByFunction -> String
showsPrec :: Int -> ListVersionsByFunction -> ShowS
$cshowsPrec :: Int -> ListVersionsByFunction -> ShowS
Prelude.Show, (forall x. ListVersionsByFunction -> Rep ListVersionsByFunction x)
-> (forall x.
    Rep ListVersionsByFunction x -> ListVersionsByFunction)
-> Generic ListVersionsByFunction
forall x. Rep ListVersionsByFunction x -> ListVersionsByFunction
forall x. ListVersionsByFunction -> Rep ListVersionsByFunction x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListVersionsByFunction x -> ListVersionsByFunction
$cfrom :: forall x. ListVersionsByFunction -> Rep ListVersionsByFunction x
Prelude.Generic)

-- |
-- Create a value of 'ListVersionsByFunction' 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:
--
-- 'marker', 'listVersionsByFunction_marker' - Specify the pagination token that\'s returned by a previous request to
-- retrieve the next page of results.
--
-- 'maxItems', 'listVersionsByFunction_maxItems' - The maximum number of versions to return. Note that
-- @ListVersionsByFunction@ returns a maximum of 50 items in each response,
-- even if you set the number higher.
--
-- 'functionName', 'listVersionsByFunction_functionName' - The name of the Lambda function.
--
-- __Name formats__
--
-- -   __Function name__ - @MyFunction@.
--
-- -   __Function ARN__ -
--     @arn:aws:lambda:us-west-2:123456789012:function:MyFunction@.
--
-- -   __Partial ARN__ - @123456789012:function:MyFunction@.
--
-- The length constraint applies only to the full ARN. If you specify only
-- the function name, it is limited to 64 characters in length.
newListVersionsByFunction ::
  -- | 'functionName'
  Prelude.Text ->
  ListVersionsByFunction
newListVersionsByFunction :: Text -> ListVersionsByFunction
newListVersionsByFunction Text
pFunctionName_ =
  ListVersionsByFunction' :: Maybe Text -> Maybe Natural -> Text -> ListVersionsByFunction
ListVersionsByFunction'
    { $sel:marker:ListVersionsByFunction' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxItems:ListVersionsByFunction' :: Maybe Natural
maxItems = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:functionName:ListVersionsByFunction' :: Text
functionName = Text
pFunctionName_
    }

-- | Specify the pagination token that\'s returned by a previous request to
-- retrieve the next page of results.
listVersionsByFunction_marker :: Lens.Lens' ListVersionsByFunction (Prelude.Maybe Prelude.Text)
listVersionsByFunction_marker :: (Maybe Text -> f (Maybe Text))
-> ListVersionsByFunction -> f ListVersionsByFunction
listVersionsByFunction_marker = (ListVersionsByFunction -> Maybe Text)
-> (ListVersionsByFunction -> Maybe Text -> ListVersionsByFunction)
-> Lens
     ListVersionsByFunction
     ListVersionsByFunction
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVersionsByFunction' {Maybe Text
marker :: Maybe Text
$sel:marker:ListVersionsByFunction' :: ListVersionsByFunction -> Maybe Text
marker} -> Maybe Text
marker) (\s :: ListVersionsByFunction
s@ListVersionsByFunction' {} Maybe Text
a -> ListVersionsByFunction
s {$sel:marker:ListVersionsByFunction' :: Maybe Text
marker = Maybe Text
a} :: ListVersionsByFunction)

-- | The maximum number of versions to return. Note that
-- @ListVersionsByFunction@ returns a maximum of 50 items in each response,
-- even if you set the number higher.
listVersionsByFunction_maxItems :: Lens.Lens' ListVersionsByFunction (Prelude.Maybe Prelude.Natural)
listVersionsByFunction_maxItems :: (Maybe Natural -> f (Maybe Natural))
-> ListVersionsByFunction -> f ListVersionsByFunction
listVersionsByFunction_maxItems = (ListVersionsByFunction -> Maybe Natural)
-> (ListVersionsByFunction
    -> Maybe Natural -> ListVersionsByFunction)
-> Lens
     ListVersionsByFunction
     ListVersionsByFunction
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVersionsByFunction' {Maybe Natural
maxItems :: Maybe Natural
$sel:maxItems:ListVersionsByFunction' :: ListVersionsByFunction -> Maybe Natural
maxItems} -> Maybe Natural
maxItems) (\s :: ListVersionsByFunction
s@ListVersionsByFunction' {} Maybe Natural
a -> ListVersionsByFunction
s {$sel:maxItems:ListVersionsByFunction' :: Maybe Natural
maxItems = Maybe Natural
a} :: ListVersionsByFunction)

-- | The name of the Lambda function.
--
-- __Name formats__
--
-- -   __Function name__ - @MyFunction@.
--
-- -   __Function ARN__ -
--     @arn:aws:lambda:us-west-2:123456789012:function:MyFunction@.
--
-- -   __Partial ARN__ - @123456789012:function:MyFunction@.
--
-- The length constraint applies only to the full ARN. If you specify only
-- the function name, it is limited to 64 characters in length.
listVersionsByFunction_functionName :: Lens.Lens' ListVersionsByFunction Prelude.Text
listVersionsByFunction_functionName :: (Text -> f Text)
-> ListVersionsByFunction -> f ListVersionsByFunction
listVersionsByFunction_functionName = (ListVersionsByFunction -> Text)
-> (ListVersionsByFunction -> Text -> ListVersionsByFunction)
-> Lens ListVersionsByFunction ListVersionsByFunction Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVersionsByFunction' {Text
functionName :: Text
$sel:functionName:ListVersionsByFunction' :: ListVersionsByFunction -> Text
functionName} -> Text
functionName) (\s :: ListVersionsByFunction
s@ListVersionsByFunction' {} Text
a -> ListVersionsByFunction
s {$sel:functionName:ListVersionsByFunction' :: Text
functionName = Text
a} :: ListVersionsByFunction)

instance Core.AWSPager ListVersionsByFunction where
  page :: ListVersionsByFunction
-> AWSResponse ListVersionsByFunction
-> Maybe ListVersionsByFunction
page ListVersionsByFunction
rq AWSResponse ListVersionsByFunction
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListVersionsByFunction
ListVersionsByFunctionResponse
rs
            ListVersionsByFunctionResponse
-> Getting (First Text) ListVersionsByFunctionResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListVersionsByFunctionResponse
-> Const (First Text) ListVersionsByFunctionResponse
Lens' ListVersionsByFunctionResponse (Maybe Text)
listVersionsByFunctionResponse_nextMarker
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListVersionsByFunctionResponse
 -> Const (First Text) ListVersionsByFunctionResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListVersionsByFunctionResponse 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 ListVersionsByFunction
forall a. Maybe a
Prelude.Nothing
    | Maybe [FunctionConfiguration] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListVersionsByFunction
ListVersionsByFunctionResponse
rs
            ListVersionsByFunctionResponse
-> Getting
     (First [FunctionConfiguration])
     ListVersionsByFunctionResponse
     [FunctionConfiguration]
-> Maybe [FunctionConfiguration]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [FunctionConfiguration]
 -> Const
      (First [FunctionConfiguration]) (Maybe [FunctionConfiguration]))
-> ListVersionsByFunctionResponse
-> Const
     (First [FunctionConfiguration]) ListVersionsByFunctionResponse
Lens'
  ListVersionsByFunctionResponse (Maybe [FunctionConfiguration])
listVersionsByFunctionResponse_versions
              ((Maybe [FunctionConfiguration]
  -> Const
       (First [FunctionConfiguration]) (Maybe [FunctionConfiguration]))
 -> ListVersionsByFunctionResponse
 -> Const
      (First [FunctionConfiguration]) ListVersionsByFunctionResponse)
-> (([FunctionConfiguration]
     -> Const (First [FunctionConfiguration]) [FunctionConfiguration])
    -> Maybe [FunctionConfiguration]
    -> Const
         (First [FunctionConfiguration]) (Maybe [FunctionConfiguration]))
-> Getting
     (First [FunctionConfiguration])
     ListVersionsByFunctionResponse
     [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 ListVersionsByFunction
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListVersionsByFunction -> Maybe ListVersionsByFunction
forall a. a -> Maybe a
Prelude.Just (ListVersionsByFunction -> Maybe ListVersionsByFunction)
-> ListVersionsByFunction -> Maybe ListVersionsByFunction
forall a b. (a -> b) -> a -> b
Prelude.$
        ListVersionsByFunction
rq
          ListVersionsByFunction
-> (ListVersionsByFunction -> ListVersionsByFunction)
-> ListVersionsByFunction
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListVersionsByFunction -> Identity ListVersionsByFunction
Lens
  ListVersionsByFunction
  ListVersionsByFunction
  (Maybe Text)
  (Maybe Text)
listVersionsByFunction_marker
          ((Maybe Text -> Identity (Maybe Text))
 -> ListVersionsByFunction -> Identity ListVersionsByFunction)
-> Maybe Text -> ListVersionsByFunction -> ListVersionsByFunction
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListVersionsByFunction
ListVersionsByFunctionResponse
rs
          ListVersionsByFunctionResponse
-> Getting (First Text) ListVersionsByFunctionResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListVersionsByFunctionResponse
-> Const (First Text) ListVersionsByFunctionResponse
Lens' ListVersionsByFunctionResponse (Maybe Text)
listVersionsByFunctionResponse_nextMarker
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListVersionsByFunctionResponse
 -> Const (First Text) ListVersionsByFunctionResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListVersionsByFunctionResponse 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 ListVersionsByFunction where
  type
    AWSResponse ListVersionsByFunction =
      ListVersionsByFunctionResponse
  request :: ListVersionsByFunction -> Request ListVersionsByFunction
request = Service -> ListVersionsByFunction -> Request ListVersionsByFunction
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy ListVersionsByFunction
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListVersionsByFunction)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListVersionsByFunction))
-> Logger
-> Service
-> Proxy ListVersionsByFunction
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListVersionsByFunction)))
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 [FunctionConfiguration]
-> Maybe Text -> Int -> ListVersionsByFunctionResponse
ListVersionsByFunctionResponse'
            (Maybe [FunctionConfiguration]
 -> Maybe Text -> Int -> ListVersionsByFunctionResponse)
-> Either String (Maybe [FunctionConfiguration])
-> Either
     String (Maybe Text -> Int -> ListVersionsByFunctionResponse)
forall (f :: * -> *) a b. Functor 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
"Versions" 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 (Maybe Text -> Int -> ListVersionsByFunctionResponse)
-> Either String (Maybe Text)
-> Either String (Int -> ListVersionsByFunctionResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"NextMarker")
            Either String (Int -> ListVersionsByFunctionResponse)
-> Either String Int
-> Either String ListVersionsByFunctionResponse
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 ListVersionsByFunction

instance Prelude.NFData ListVersionsByFunction

instance Core.ToHeaders ListVersionsByFunction where
  toHeaders :: ListVersionsByFunction -> ResponseHeaders
toHeaders = ResponseHeaders -> ListVersionsByFunction -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

instance Core.ToPath ListVersionsByFunction where
  toPath :: ListVersionsByFunction -> ByteString
toPath ListVersionsByFunction' {Maybe Natural
Maybe Text
Text
functionName :: Text
maxItems :: Maybe Natural
marker :: Maybe Text
$sel:functionName:ListVersionsByFunction' :: ListVersionsByFunction -> Text
$sel:maxItems:ListVersionsByFunction' :: ListVersionsByFunction -> Maybe Natural
$sel:marker:ListVersionsByFunction' :: ListVersionsByFunction -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/2015-03-31/functions/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
functionName,
        ByteString
"/versions"
      ]

instance Core.ToQuery ListVersionsByFunction where
  toQuery :: ListVersionsByFunction -> QueryString
toQuery ListVersionsByFunction' {Maybe Natural
Maybe Text
Text
functionName :: Text
maxItems :: Maybe Natural
marker :: Maybe Text
$sel:functionName:ListVersionsByFunction' :: ListVersionsByFunction -> Text
$sel:maxItems:ListVersionsByFunction' :: ListVersionsByFunction -> Maybe Natural
$sel:marker:ListVersionsByFunction' :: ListVersionsByFunction -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ 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
      ]

-- | /See:/ 'newListVersionsByFunctionResponse' smart constructor.
data ListVersionsByFunctionResponse = ListVersionsByFunctionResponse'
  { -- | A list of Lambda function versions.
    ListVersionsByFunctionResponse -> Maybe [FunctionConfiguration]
versions :: Prelude.Maybe [FunctionConfiguration],
    -- | The pagination token that\'s included if more results are available.
    ListVersionsByFunctionResponse -> Maybe Text
nextMarker :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListVersionsByFunctionResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListVersionsByFunctionResponse
-> ListVersionsByFunctionResponse -> Bool
(ListVersionsByFunctionResponse
 -> ListVersionsByFunctionResponse -> Bool)
-> (ListVersionsByFunctionResponse
    -> ListVersionsByFunctionResponse -> Bool)
-> Eq ListVersionsByFunctionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListVersionsByFunctionResponse
-> ListVersionsByFunctionResponse -> Bool
$c/= :: ListVersionsByFunctionResponse
-> ListVersionsByFunctionResponse -> Bool
== :: ListVersionsByFunctionResponse
-> ListVersionsByFunctionResponse -> Bool
$c== :: ListVersionsByFunctionResponse
-> ListVersionsByFunctionResponse -> Bool
Prelude.Eq, Int -> ListVersionsByFunctionResponse -> ShowS
[ListVersionsByFunctionResponse] -> ShowS
ListVersionsByFunctionResponse -> String
(Int -> ListVersionsByFunctionResponse -> ShowS)
-> (ListVersionsByFunctionResponse -> String)
-> ([ListVersionsByFunctionResponse] -> ShowS)
-> Show ListVersionsByFunctionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListVersionsByFunctionResponse] -> ShowS
$cshowList :: [ListVersionsByFunctionResponse] -> ShowS
show :: ListVersionsByFunctionResponse -> String
$cshow :: ListVersionsByFunctionResponse -> String
showsPrec :: Int -> ListVersionsByFunctionResponse -> ShowS
$cshowsPrec :: Int -> ListVersionsByFunctionResponse -> ShowS
Prelude.Show, (forall x.
 ListVersionsByFunctionResponse
 -> Rep ListVersionsByFunctionResponse x)
-> (forall x.
    Rep ListVersionsByFunctionResponse x
    -> ListVersionsByFunctionResponse)
-> Generic ListVersionsByFunctionResponse
forall x.
Rep ListVersionsByFunctionResponse x
-> ListVersionsByFunctionResponse
forall x.
ListVersionsByFunctionResponse
-> Rep ListVersionsByFunctionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListVersionsByFunctionResponse x
-> ListVersionsByFunctionResponse
$cfrom :: forall x.
ListVersionsByFunctionResponse
-> Rep ListVersionsByFunctionResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListVersionsByFunctionResponse' 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:
--
-- 'versions', 'listVersionsByFunctionResponse_versions' - A list of Lambda function versions.
--
-- 'nextMarker', 'listVersionsByFunctionResponse_nextMarker' - The pagination token that\'s included if more results are available.
--
-- 'httpStatus', 'listVersionsByFunctionResponse_httpStatus' - The response's http status code.
newListVersionsByFunctionResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListVersionsByFunctionResponse
newListVersionsByFunctionResponse :: Int -> ListVersionsByFunctionResponse
newListVersionsByFunctionResponse Int
pHttpStatus_ =
  ListVersionsByFunctionResponse' :: Maybe [FunctionConfiguration]
-> Maybe Text -> Int -> ListVersionsByFunctionResponse
ListVersionsByFunctionResponse'
    { $sel:versions:ListVersionsByFunctionResponse' :: Maybe [FunctionConfiguration]
versions =
        Maybe [FunctionConfiguration]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextMarker:ListVersionsByFunctionResponse' :: Maybe Text
nextMarker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListVersionsByFunctionResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A list of Lambda function versions.
listVersionsByFunctionResponse_versions :: Lens.Lens' ListVersionsByFunctionResponse (Prelude.Maybe [FunctionConfiguration])
listVersionsByFunctionResponse_versions :: (Maybe [FunctionConfiguration]
 -> f (Maybe [FunctionConfiguration]))
-> ListVersionsByFunctionResponse
-> f ListVersionsByFunctionResponse
listVersionsByFunctionResponse_versions = (ListVersionsByFunctionResponse -> Maybe [FunctionConfiguration])
-> (ListVersionsByFunctionResponse
    -> Maybe [FunctionConfiguration] -> ListVersionsByFunctionResponse)
-> Lens'
     ListVersionsByFunctionResponse (Maybe [FunctionConfiguration])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVersionsByFunctionResponse' {Maybe [FunctionConfiguration]
versions :: Maybe [FunctionConfiguration]
$sel:versions:ListVersionsByFunctionResponse' :: ListVersionsByFunctionResponse -> Maybe [FunctionConfiguration]
versions} -> Maybe [FunctionConfiguration]
versions) (\s :: ListVersionsByFunctionResponse
s@ListVersionsByFunctionResponse' {} Maybe [FunctionConfiguration]
a -> ListVersionsByFunctionResponse
s {$sel:versions:ListVersionsByFunctionResponse' :: Maybe [FunctionConfiguration]
versions = Maybe [FunctionConfiguration]
a} :: ListVersionsByFunctionResponse) ((Maybe [FunctionConfiguration]
  -> f (Maybe [FunctionConfiguration]))
 -> ListVersionsByFunctionResponse
 -> f ListVersionsByFunctionResponse)
-> ((Maybe [FunctionConfiguration]
     -> f (Maybe [FunctionConfiguration]))
    -> Maybe [FunctionConfiguration]
    -> f (Maybe [FunctionConfiguration]))
-> (Maybe [FunctionConfiguration]
    -> f (Maybe [FunctionConfiguration]))
-> ListVersionsByFunctionResponse
-> f ListVersionsByFunctionResponse
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 pagination token that\'s included if more results are available.
listVersionsByFunctionResponse_nextMarker :: Lens.Lens' ListVersionsByFunctionResponse (Prelude.Maybe Prelude.Text)
listVersionsByFunctionResponse_nextMarker :: (Maybe Text -> f (Maybe Text))
-> ListVersionsByFunctionResponse
-> f ListVersionsByFunctionResponse
listVersionsByFunctionResponse_nextMarker = (ListVersionsByFunctionResponse -> Maybe Text)
-> (ListVersionsByFunctionResponse
    -> Maybe Text -> ListVersionsByFunctionResponse)
-> Lens' ListVersionsByFunctionResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVersionsByFunctionResponse' {Maybe Text
nextMarker :: Maybe Text
$sel:nextMarker:ListVersionsByFunctionResponse' :: ListVersionsByFunctionResponse -> Maybe Text
nextMarker} -> Maybe Text
nextMarker) (\s :: ListVersionsByFunctionResponse
s@ListVersionsByFunctionResponse' {} Maybe Text
a -> ListVersionsByFunctionResponse
s {$sel:nextMarker:ListVersionsByFunctionResponse' :: Maybe Text
nextMarker = Maybe Text
a} :: ListVersionsByFunctionResponse)

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

instance
  Prelude.NFData
    ListVersionsByFunctionResponse