{-# 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.ListProvisionedConcurrencyConfigs
-- 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 provisioned concurrency configurations for a
-- function.
--
-- This operation returns paginated results.
module Amazonka.Lambda.ListProvisionedConcurrencyConfigs
  ( -- * Creating a Request
    ListProvisionedConcurrencyConfigs (..),
    newListProvisionedConcurrencyConfigs,

    -- * Request Lenses
    listProvisionedConcurrencyConfigs_marker,
    listProvisionedConcurrencyConfigs_maxItems,
    listProvisionedConcurrencyConfigs_functionName,

    -- * Destructuring the Response
    ListProvisionedConcurrencyConfigsResponse (..),
    newListProvisionedConcurrencyConfigsResponse,

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

-- |
-- Create a value of 'ListProvisionedConcurrencyConfigs' 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', 'listProvisionedConcurrencyConfigs_marker' - Specify the pagination token that\'s returned by a previous request to
-- retrieve the next page of results.
--
-- 'maxItems', 'listProvisionedConcurrencyConfigs_maxItems' - Specify a number to limit the number of configurations returned.
--
-- 'functionName', 'listProvisionedConcurrencyConfigs_functionName' - The name of the Lambda function.
--
-- __Name formats__
--
-- -   __Function name__ - @my-function@.
--
-- -   __Function ARN__ -
--     @arn:aws:lambda:us-west-2:123456789012:function:my-function@.
--
-- -   __Partial ARN__ - @123456789012:function:my-function@.
--
-- The length constraint applies only to the full ARN. If you specify only
-- the function name, it is limited to 64 characters in length.
newListProvisionedConcurrencyConfigs ::
  -- | 'functionName'
  Prelude.Text ->
  ListProvisionedConcurrencyConfigs
newListProvisionedConcurrencyConfigs :: Text -> ListProvisionedConcurrencyConfigs
newListProvisionedConcurrencyConfigs Text
pFunctionName_ =
  ListProvisionedConcurrencyConfigs' :: Maybe Text
-> Maybe Natural -> Text -> ListProvisionedConcurrencyConfigs
ListProvisionedConcurrencyConfigs'
    { $sel:marker:ListProvisionedConcurrencyConfigs' :: Maybe Text
marker =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxItems:ListProvisionedConcurrencyConfigs' :: Maybe Natural
maxItems = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:functionName:ListProvisionedConcurrencyConfigs' :: Text
functionName = Text
pFunctionName_
    }

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

-- | Specify a number to limit the number of configurations returned.
listProvisionedConcurrencyConfigs_maxItems :: Lens.Lens' ListProvisionedConcurrencyConfigs (Prelude.Maybe Prelude.Natural)
listProvisionedConcurrencyConfigs_maxItems :: (Maybe Natural -> f (Maybe Natural))
-> ListProvisionedConcurrencyConfigs
-> f ListProvisionedConcurrencyConfigs
listProvisionedConcurrencyConfigs_maxItems = (ListProvisionedConcurrencyConfigs -> Maybe Natural)
-> (ListProvisionedConcurrencyConfigs
    -> Maybe Natural -> ListProvisionedConcurrencyConfigs)
-> Lens
     ListProvisionedConcurrencyConfigs
     ListProvisionedConcurrencyConfigs
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListProvisionedConcurrencyConfigs' {Maybe Natural
maxItems :: Maybe Natural
$sel:maxItems:ListProvisionedConcurrencyConfigs' :: ListProvisionedConcurrencyConfigs -> Maybe Natural
maxItems} -> Maybe Natural
maxItems) (\s :: ListProvisionedConcurrencyConfigs
s@ListProvisionedConcurrencyConfigs' {} Maybe Natural
a -> ListProvisionedConcurrencyConfigs
s {$sel:maxItems:ListProvisionedConcurrencyConfigs' :: Maybe Natural
maxItems = Maybe Natural
a} :: ListProvisionedConcurrencyConfigs)

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

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

instance
  Prelude.NFData
    ListProvisionedConcurrencyConfigs

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

instance
  Core.ToPath
    ListProvisionedConcurrencyConfigs
  where
  toPath :: ListProvisionedConcurrencyConfigs -> ByteString
toPath ListProvisionedConcurrencyConfigs' {Maybe Natural
Maybe Text
Text
functionName :: Text
maxItems :: Maybe Natural
marker :: Maybe Text
$sel:functionName:ListProvisionedConcurrencyConfigs' :: ListProvisionedConcurrencyConfigs -> Text
$sel:maxItems:ListProvisionedConcurrencyConfigs' :: ListProvisionedConcurrencyConfigs -> Maybe Natural
$sel:marker:ListProvisionedConcurrencyConfigs' :: ListProvisionedConcurrencyConfigs -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/2019-09-30/functions/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
functionName,
        ByteString
"/provisioned-concurrency"
      ]

instance
  Core.ToQuery
    ListProvisionedConcurrencyConfigs
  where
  toQuery :: ListProvisionedConcurrencyConfigs -> QueryString
toQuery ListProvisionedConcurrencyConfigs' {Maybe Natural
Maybe Text
Text
functionName :: Text
maxItems :: Maybe Natural
marker :: Maybe Text
$sel:functionName:ListProvisionedConcurrencyConfigs' :: ListProvisionedConcurrencyConfigs -> Text
$sel:maxItems:ListProvisionedConcurrencyConfigs' :: ListProvisionedConcurrencyConfigs -> Maybe Natural
$sel:marker:ListProvisionedConcurrencyConfigs' :: ListProvisionedConcurrencyConfigs -> 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,
        QueryString
"List=ALL"
      ]

-- | /See:/ 'newListProvisionedConcurrencyConfigsResponse' smart constructor.
data ListProvisionedConcurrencyConfigsResponse = ListProvisionedConcurrencyConfigsResponse'
  { -- | A list of provisioned concurrency configurations.
    ListProvisionedConcurrencyConfigsResponse
-> Maybe [ProvisionedConcurrencyConfigListItem]
provisionedConcurrencyConfigs :: Prelude.Maybe [ProvisionedConcurrencyConfigListItem],
    -- | The pagination token that\'s included if more results are available.
    ListProvisionedConcurrencyConfigsResponse -> Maybe Text
nextMarker :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListProvisionedConcurrencyConfigsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListProvisionedConcurrencyConfigsResponse
-> ListProvisionedConcurrencyConfigsResponse -> Bool
(ListProvisionedConcurrencyConfigsResponse
 -> ListProvisionedConcurrencyConfigsResponse -> Bool)
-> (ListProvisionedConcurrencyConfigsResponse
    -> ListProvisionedConcurrencyConfigsResponse -> Bool)
-> Eq ListProvisionedConcurrencyConfigsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListProvisionedConcurrencyConfigsResponse
-> ListProvisionedConcurrencyConfigsResponse -> Bool
$c/= :: ListProvisionedConcurrencyConfigsResponse
-> ListProvisionedConcurrencyConfigsResponse -> Bool
== :: ListProvisionedConcurrencyConfigsResponse
-> ListProvisionedConcurrencyConfigsResponse -> Bool
$c== :: ListProvisionedConcurrencyConfigsResponse
-> ListProvisionedConcurrencyConfigsResponse -> Bool
Prelude.Eq, ReadPrec [ListProvisionedConcurrencyConfigsResponse]
ReadPrec ListProvisionedConcurrencyConfigsResponse
Int -> ReadS ListProvisionedConcurrencyConfigsResponse
ReadS [ListProvisionedConcurrencyConfigsResponse]
(Int -> ReadS ListProvisionedConcurrencyConfigsResponse)
-> ReadS [ListProvisionedConcurrencyConfigsResponse]
-> ReadPrec ListProvisionedConcurrencyConfigsResponse
-> ReadPrec [ListProvisionedConcurrencyConfigsResponse]
-> Read ListProvisionedConcurrencyConfigsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListProvisionedConcurrencyConfigsResponse]
$creadListPrec :: ReadPrec [ListProvisionedConcurrencyConfigsResponse]
readPrec :: ReadPrec ListProvisionedConcurrencyConfigsResponse
$creadPrec :: ReadPrec ListProvisionedConcurrencyConfigsResponse
readList :: ReadS [ListProvisionedConcurrencyConfigsResponse]
$creadList :: ReadS [ListProvisionedConcurrencyConfigsResponse]
readsPrec :: Int -> ReadS ListProvisionedConcurrencyConfigsResponse
$creadsPrec :: Int -> ReadS ListProvisionedConcurrencyConfigsResponse
Prelude.Read, Int -> ListProvisionedConcurrencyConfigsResponse -> ShowS
[ListProvisionedConcurrencyConfigsResponse] -> ShowS
ListProvisionedConcurrencyConfigsResponse -> String
(Int -> ListProvisionedConcurrencyConfigsResponse -> ShowS)
-> (ListProvisionedConcurrencyConfigsResponse -> String)
-> ([ListProvisionedConcurrencyConfigsResponse] -> ShowS)
-> Show ListProvisionedConcurrencyConfigsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListProvisionedConcurrencyConfigsResponse] -> ShowS
$cshowList :: [ListProvisionedConcurrencyConfigsResponse] -> ShowS
show :: ListProvisionedConcurrencyConfigsResponse -> String
$cshow :: ListProvisionedConcurrencyConfigsResponse -> String
showsPrec :: Int -> ListProvisionedConcurrencyConfigsResponse -> ShowS
$cshowsPrec :: Int -> ListProvisionedConcurrencyConfigsResponse -> ShowS
Prelude.Show, (forall x.
 ListProvisionedConcurrencyConfigsResponse
 -> Rep ListProvisionedConcurrencyConfigsResponse x)
-> (forall x.
    Rep ListProvisionedConcurrencyConfigsResponse x
    -> ListProvisionedConcurrencyConfigsResponse)
-> Generic ListProvisionedConcurrencyConfigsResponse
forall x.
Rep ListProvisionedConcurrencyConfigsResponse x
-> ListProvisionedConcurrencyConfigsResponse
forall x.
ListProvisionedConcurrencyConfigsResponse
-> Rep ListProvisionedConcurrencyConfigsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListProvisionedConcurrencyConfigsResponse x
-> ListProvisionedConcurrencyConfigsResponse
$cfrom :: forall x.
ListProvisionedConcurrencyConfigsResponse
-> Rep ListProvisionedConcurrencyConfigsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListProvisionedConcurrencyConfigsResponse' 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:
--
-- 'provisionedConcurrencyConfigs', 'listProvisionedConcurrencyConfigsResponse_provisionedConcurrencyConfigs' - A list of provisioned concurrency configurations.
--
-- 'nextMarker', 'listProvisionedConcurrencyConfigsResponse_nextMarker' - The pagination token that\'s included if more results are available.
--
-- 'httpStatus', 'listProvisionedConcurrencyConfigsResponse_httpStatus' - The response's http status code.
newListProvisionedConcurrencyConfigsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListProvisionedConcurrencyConfigsResponse
newListProvisionedConcurrencyConfigsResponse :: Int -> ListProvisionedConcurrencyConfigsResponse
newListProvisionedConcurrencyConfigsResponse
  Int
pHttpStatus_ =
    ListProvisionedConcurrencyConfigsResponse' :: Maybe [ProvisionedConcurrencyConfigListItem]
-> Maybe Text -> Int -> ListProvisionedConcurrencyConfigsResponse
ListProvisionedConcurrencyConfigsResponse'
      { $sel:provisionedConcurrencyConfigs:ListProvisionedConcurrencyConfigsResponse' :: Maybe [ProvisionedConcurrencyConfigListItem]
provisionedConcurrencyConfigs =
          Maybe [ProvisionedConcurrencyConfigListItem]
forall a. Maybe a
Prelude.Nothing,
        $sel:nextMarker:ListProvisionedConcurrencyConfigsResponse' :: Maybe Text
nextMarker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:ListProvisionedConcurrencyConfigsResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | A list of provisioned concurrency configurations.
listProvisionedConcurrencyConfigsResponse_provisionedConcurrencyConfigs :: Lens.Lens' ListProvisionedConcurrencyConfigsResponse (Prelude.Maybe [ProvisionedConcurrencyConfigListItem])
listProvisionedConcurrencyConfigsResponse_provisionedConcurrencyConfigs :: (Maybe [ProvisionedConcurrencyConfigListItem]
 -> f (Maybe [ProvisionedConcurrencyConfigListItem]))
-> ListProvisionedConcurrencyConfigsResponse
-> f ListProvisionedConcurrencyConfigsResponse
listProvisionedConcurrencyConfigsResponse_provisionedConcurrencyConfigs = (ListProvisionedConcurrencyConfigsResponse
 -> Maybe [ProvisionedConcurrencyConfigListItem])
-> (ListProvisionedConcurrencyConfigsResponse
    -> Maybe [ProvisionedConcurrencyConfigListItem]
    -> ListProvisionedConcurrencyConfigsResponse)
-> Lens'
     ListProvisionedConcurrencyConfigsResponse
     (Maybe [ProvisionedConcurrencyConfigListItem])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListProvisionedConcurrencyConfigsResponse' {Maybe [ProvisionedConcurrencyConfigListItem]
provisionedConcurrencyConfigs :: Maybe [ProvisionedConcurrencyConfigListItem]
$sel:provisionedConcurrencyConfigs:ListProvisionedConcurrencyConfigsResponse' :: ListProvisionedConcurrencyConfigsResponse
-> Maybe [ProvisionedConcurrencyConfigListItem]
provisionedConcurrencyConfigs} -> Maybe [ProvisionedConcurrencyConfigListItem]
provisionedConcurrencyConfigs) (\s :: ListProvisionedConcurrencyConfigsResponse
s@ListProvisionedConcurrencyConfigsResponse' {} Maybe [ProvisionedConcurrencyConfigListItem]
a -> ListProvisionedConcurrencyConfigsResponse
s {$sel:provisionedConcurrencyConfigs:ListProvisionedConcurrencyConfigsResponse' :: Maybe [ProvisionedConcurrencyConfigListItem]
provisionedConcurrencyConfigs = Maybe [ProvisionedConcurrencyConfigListItem]
a} :: ListProvisionedConcurrencyConfigsResponse) ((Maybe [ProvisionedConcurrencyConfigListItem]
  -> f (Maybe [ProvisionedConcurrencyConfigListItem]))
 -> ListProvisionedConcurrencyConfigsResponse
 -> f ListProvisionedConcurrencyConfigsResponse)
-> ((Maybe [ProvisionedConcurrencyConfigListItem]
     -> f (Maybe [ProvisionedConcurrencyConfigListItem]))
    -> Maybe [ProvisionedConcurrencyConfigListItem]
    -> f (Maybe [ProvisionedConcurrencyConfigListItem]))
-> (Maybe [ProvisionedConcurrencyConfigListItem]
    -> f (Maybe [ProvisionedConcurrencyConfigListItem]))
-> ListProvisionedConcurrencyConfigsResponse
-> f ListProvisionedConcurrencyConfigsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ProvisionedConcurrencyConfigListItem]
  [ProvisionedConcurrencyConfigListItem]
  [ProvisionedConcurrencyConfigListItem]
  [ProvisionedConcurrencyConfigListItem]
-> Iso
     (Maybe [ProvisionedConcurrencyConfigListItem])
     (Maybe [ProvisionedConcurrencyConfigListItem])
     (Maybe [ProvisionedConcurrencyConfigListItem])
     (Maybe [ProvisionedConcurrencyConfigListItem])
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
  [ProvisionedConcurrencyConfigListItem]
  [ProvisionedConcurrencyConfigListItem]
  [ProvisionedConcurrencyConfigListItem]
  [ProvisionedConcurrencyConfigListItem]
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.
listProvisionedConcurrencyConfigsResponse_nextMarker :: Lens.Lens' ListProvisionedConcurrencyConfigsResponse (Prelude.Maybe Prelude.Text)
listProvisionedConcurrencyConfigsResponse_nextMarker :: (Maybe Text -> f (Maybe Text))
-> ListProvisionedConcurrencyConfigsResponse
-> f ListProvisionedConcurrencyConfigsResponse
listProvisionedConcurrencyConfigsResponse_nextMarker = (ListProvisionedConcurrencyConfigsResponse -> Maybe Text)
-> (ListProvisionedConcurrencyConfigsResponse
    -> Maybe Text -> ListProvisionedConcurrencyConfigsResponse)
-> Lens' ListProvisionedConcurrencyConfigsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListProvisionedConcurrencyConfigsResponse' {Maybe Text
nextMarker :: Maybe Text
$sel:nextMarker:ListProvisionedConcurrencyConfigsResponse' :: ListProvisionedConcurrencyConfigsResponse -> Maybe Text
nextMarker} -> Maybe Text
nextMarker) (\s :: ListProvisionedConcurrencyConfigsResponse
s@ListProvisionedConcurrencyConfigsResponse' {} Maybe Text
a -> ListProvisionedConcurrencyConfigsResponse
s {$sel:nextMarker:ListProvisionedConcurrencyConfigsResponse' :: Maybe Text
nextMarker = Maybe Text
a} :: ListProvisionedConcurrencyConfigsResponse)

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

instance
  Prelude.NFData
    ListProvisionedConcurrencyConfigsResponse