{-# 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.ListFunctionEventInvokeConfigs
-- 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 configurations for asynchronous invocation for a
-- function.
--
-- To configure options for asynchronous invocation, use
-- PutFunctionEventInvokeConfig.
--
-- This operation returns paginated results.
module Amazonka.Lambda.ListFunctionEventInvokeConfigs
  ( -- * Creating a Request
    ListFunctionEventInvokeConfigs (..),
    newListFunctionEventInvokeConfigs,

    -- * Request Lenses
    listFunctionEventInvokeConfigs_marker,
    listFunctionEventInvokeConfigs_maxItems,
    listFunctionEventInvokeConfigs_functionName,

    -- * Destructuring the Response
    ListFunctionEventInvokeConfigsResponse (..),
    newListFunctionEventInvokeConfigsResponse,

    -- * Response Lenses
    listFunctionEventInvokeConfigsResponse_functionEventInvokeConfigs,
    listFunctionEventInvokeConfigsResponse_nextMarker,
    listFunctionEventInvokeConfigsResponse_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:/ 'newListFunctionEventInvokeConfigs' smart constructor.
data ListFunctionEventInvokeConfigs = ListFunctionEventInvokeConfigs'
  { -- | Specify the pagination token that\'s returned by a previous request to
    -- retrieve the next page of results.
    ListFunctionEventInvokeConfigs -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of configurations to return.
    ListFunctionEventInvokeConfigs -> 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.
    ListFunctionEventInvokeConfigs -> Text
functionName :: Prelude.Text
  }
  deriving (ListFunctionEventInvokeConfigs
-> ListFunctionEventInvokeConfigs -> Bool
(ListFunctionEventInvokeConfigs
 -> ListFunctionEventInvokeConfigs -> Bool)
-> (ListFunctionEventInvokeConfigs
    -> ListFunctionEventInvokeConfigs -> Bool)
-> Eq ListFunctionEventInvokeConfigs
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListFunctionEventInvokeConfigs
-> ListFunctionEventInvokeConfigs -> Bool
$c/= :: ListFunctionEventInvokeConfigs
-> ListFunctionEventInvokeConfigs -> Bool
== :: ListFunctionEventInvokeConfigs
-> ListFunctionEventInvokeConfigs -> Bool
$c== :: ListFunctionEventInvokeConfigs
-> ListFunctionEventInvokeConfigs -> Bool
Prelude.Eq, ReadPrec [ListFunctionEventInvokeConfigs]
ReadPrec ListFunctionEventInvokeConfigs
Int -> ReadS ListFunctionEventInvokeConfigs
ReadS [ListFunctionEventInvokeConfigs]
(Int -> ReadS ListFunctionEventInvokeConfigs)
-> ReadS [ListFunctionEventInvokeConfigs]
-> ReadPrec ListFunctionEventInvokeConfigs
-> ReadPrec [ListFunctionEventInvokeConfigs]
-> Read ListFunctionEventInvokeConfigs
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListFunctionEventInvokeConfigs]
$creadListPrec :: ReadPrec [ListFunctionEventInvokeConfigs]
readPrec :: ReadPrec ListFunctionEventInvokeConfigs
$creadPrec :: ReadPrec ListFunctionEventInvokeConfigs
readList :: ReadS [ListFunctionEventInvokeConfigs]
$creadList :: ReadS [ListFunctionEventInvokeConfigs]
readsPrec :: Int -> ReadS ListFunctionEventInvokeConfigs
$creadsPrec :: Int -> ReadS ListFunctionEventInvokeConfigs
Prelude.Read, Int -> ListFunctionEventInvokeConfigs -> ShowS
[ListFunctionEventInvokeConfigs] -> ShowS
ListFunctionEventInvokeConfigs -> String
(Int -> ListFunctionEventInvokeConfigs -> ShowS)
-> (ListFunctionEventInvokeConfigs -> String)
-> ([ListFunctionEventInvokeConfigs] -> ShowS)
-> Show ListFunctionEventInvokeConfigs
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListFunctionEventInvokeConfigs] -> ShowS
$cshowList :: [ListFunctionEventInvokeConfigs] -> ShowS
show :: ListFunctionEventInvokeConfigs -> String
$cshow :: ListFunctionEventInvokeConfigs -> String
showsPrec :: Int -> ListFunctionEventInvokeConfigs -> ShowS
$cshowsPrec :: Int -> ListFunctionEventInvokeConfigs -> ShowS
Prelude.Show, (forall x.
 ListFunctionEventInvokeConfigs
 -> Rep ListFunctionEventInvokeConfigs x)
-> (forall x.
    Rep ListFunctionEventInvokeConfigs x
    -> ListFunctionEventInvokeConfigs)
-> Generic ListFunctionEventInvokeConfigs
forall x.
Rep ListFunctionEventInvokeConfigs x
-> ListFunctionEventInvokeConfigs
forall x.
ListFunctionEventInvokeConfigs
-> Rep ListFunctionEventInvokeConfigs x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListFunctionEventInvokeConfigs x
-> ListFunctionEventInvokeConfigs
$cfrom :: forall x.
ListFunctionEventInvokeConfigs
-> Rep ListFunctionEventInvokeConfigs x
Prelude.Generic)

-- |
-- Create a value of 'ListFunctionEventInvokeConfigs' 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', 'listFunctionEventInvokeConfigs_marker' - Specify the pagination token that\'s returned by a previous request to
-- retrieve the next page of results.
--
-- 'maxItems', 'listFunctionEventInvokeConfigs_maxItems' - The maximum number of configurations to return.
--
-- 'functionName', 'listFunctionEventInvokeConfigs_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.
newListFunctionEventInvokeConfigs ::
  -- | 'functionName'
  Prelude.Text ->
  ListFunctionEventInvokeConfigs
newListFunctionEventInvokeConfigs :: Text -> ListFunctionEventInvokeConfigs
newListFunctionEventInvokeConfigs Text
pFunctionName_ =
  ListFunctionEventInvokeConfigs' :: Maybe Text
-> Maybe Natural -> Text -> ListFunctionEventInvokeConfigs
ListFunctionEventInvokeConfigs'
    { $sel:marker:ListFunctionEventInvokeConfigs' :: Maybe Text
marker =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxItems:ListFunctionEventInvokeConfigs' :: Maybe Natural
maxItems = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:functionName:ListFunctionEventInvokeConfigs' :: Text
functionName = Text
pFunctionName_
    }

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

-- | The maximum number of configurations to return.
listFunctionEventInvokeConfigs_maxItems :: Lens.Lens' ListFunctionEventInvokeConfigs (Prelude.Maybe Prelude.Natural)
listFunctionEventInvokeConfigs_maxItems :: (Maybe Natural -> f (Maybe Natural))
-> ListFunctionEventInvokeConfigs
-> f ListFunctionEventInvokeConfigs
listFunctionEventInvokeConfigs_maxItems = (ListFunctionEventInvokeConfigs -> Maybe Natural)
-> (ListFunctionEventInvokeConfigs
    -> Maybe Natural -> ListFunctionEventInvokeConfigs)
-> Lens
     ListFunctionEventInvokeConfigs
     ListFunctionEventInvokeConfigs
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFunctionEventInvokeConfigs' {Maybe Natural
maxItems :: Maybe Natural
$sel:maxItems:ListFunctionEventInvokeConfigs' :: ListFunctionEventInvokeConfigs -> Maybe Natural
maxItems} -> Maybe Natural
maxItems) (\s :: ListFunctionEventInvokeConfigs
s@ListFunctionEventInvokeConfigs' {} Maybe Natural
a -> ListFunctionEventInvokeConfigs
s {$sel:maxItems:ListFunctionEventInvokeConfigs' :: Maybe Natural
maxItems = Maybe Natural
a} :: ListFunctionEventInvokeConfigs)

-- | 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.
listFunctionEventInvokeConfigs_functionName :: Lens.Lens' ListFunctionEventInvokeConfigs Prelude.Text
listFunctionEventInvokeConfigs_functionName :: (Text -> f Text)
-> ListFunctionEventInvokeConfigs
-> f ListFunctionEventInvokeConfigs
listFunctionEventInvokeConfigs_functionName = (ListFunctionEventInvokeConfigs -> Text)
-> (ListFunctionEventInvokeConfigs
    -> Text -> ListFunctionEventInvokeConfigs)
-> Lens
     ListFunctionEventInvokeConfigs
     ListFunctionEventInvokeConfigs
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFunctionEventInvokeConfigs' {Text
functionName :: Text
$sel:functionName:ListFunctionEventInvokeConfigs' :: ListFunctionEventInvokeConfigs -> Text
functionName} -> Text
functionName) (\s :: ListFunctionEventInvokeConfigs
s@ListFunctionEventInvokeConfigs' {} Text
a -> ListFunctionEventInvokeConfigs
s {$sel:functionName:ListFunctionEventInvokeConfigs' :: Text
functionName = Text
a} :: ListFunctionEventInvokeConfigs)

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

instance
  Prelude.NFData
    ListFunctionEventInvokeConfigs

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

instance Core.ToPath ListFunctionEventInvokeConfigs where
  toPath :: ListFunctionEventInvokeConfigs -> ByteString
toPath ListFunctionEventInvokeConfigs' {Maybe Natural
Maybe Text
Text
functionName :: Text
maxItems :: Maybe Natural
marker :: Maybe Text
$sel:functionName:ListFunctionEventInvokeConfigs' :: ListFunctionEventInvokeConfigs -> Text
$sel:maxItems:ListFunctionEventInvokeConfigs' :: ListFunctionEventInvokeConfigs -> Maybe Natural
$sel:marker:ListFunctionEventInvokeConfigs' :: ListFunctionEventInvokeConfigs -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/2019-09-25/functions/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
functionName,
        ByteString
"/event-invoke-config/list"
      ]

instance Core.ToQuery ListFunctionEventInvokeConfigs where
  toQuery :: ListFunctionEventInvokeConfigs -> QueryString
toQuery ListFunctionEventInvokeConfigs' {Maybe Natural
Maybe Text
Text
functionName :: Text
maxItems :: Maybe Natural
marker :: Maybe Text
$sel:functionName:ListFunctionEventInvokeConfigs' :: ListFunctionEventInvokeConfigs -> Text
$sel:maxItems:ListFunctionEventInvokeConfigs' :: ListFunctionEventInvokeConfigs -> Maybe Natural
$sel:marker:ListFunctionEventInvokeConfigs' :: ListFunctionEventInvokeConfigs -> 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:/ 'newListFunctionEventInvokeConfigsResponse' smart constructor.
data ListFunctionEventInvokeConfigsResponse = ListFunctionEventInvokeConfigsResponse'
  { -- | A list of configurations.
    ListFunctionEventInvokeConfigsResponse
-> Maybe [FunctionEventInvokeConfig]
functionEventInvokeConfigs :: Prelude.Maybe [FunctionEventInvokeConfig],
    -- | The pagination token that\'s included if more results are available.
    ListFunctionEventInvokeConfigsResponse -> Maybe Text
nextMarker :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListFunctionEventInvokeConfigsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListFunctionEventInvokeConfigsResponse
-> ListFunctionEventInvokeConfigsResponse -> Bool
(ListFunctionEventInvokeConfigsResponse
 -> ListFunctionEventInvokeConfigsResponse -> Bool)
-> (ListFunctionEventInvokeConfigsResponse
    -> ListFunctionEventInvokeConfigsResponse -> Bool)
-> Eq ListFunctionEventInvokeConfigsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListFunctionEventInvokeConfigsResponse
-> ListFunctionEventInvokeConfigsResponse -> Bool
$c/= :: ListFunctionEventInvokeConfigsResponse
-> ListFunctionEventInvokeConfigsResponse -> Bool
== :: ListFunctionEventInvokeConfigsResponse
-> ListFunctionEventInvokeConfigsResponse -> Bool
$c== :: ListFunctionEventInvokeConfigsResponse
-> ListFunctionEventInvokeConfigsResponse -> Bool
Prelude.Eq, ReadPrec [ListFunctionEventInvokeConfigsResponse]
ReadPrec ListFunctionEventInvokeConfigsResponse
Int -> ReadS ListFunctionEventInvokeConfigsResponse
ReadS [ListFunctionEventInvokeConfigsResponse]
(Int -> ReadS ListFunctionEventInvokeConfigsResponse)
-> ReadS [ListFunctionEventInvokeConfigsResponse]
-> ReadPrec ListFunctionEventInvokeConfigsResponse
-> ReadPrec [ListFunctionEventInvokeConfigsResponse]
-> Read ListFunctionEventInvokeConfigsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListFunctionEventInvokeConfigsResponse]
$creadListPrec :: ReadPrec [ListFunctionEventInvokeConfigsResponse]
readPrec :: ReadPrec ListFunctionEventInvokeConfigsResponse
$creadPrec :: ReadPrec ListFunctionEventInvokeConfigsResponse
readList :: ReadS [ListFunctionEventInvokeConfigsResponse]
$creadList :: ReadS [ListFunctionEventInvokeConfigsResponse]
readsPrec :: Int -> ReadS ListFunctionEventInvokeConfigsResponse
$creadsPrec :: Int -> ReadS ListFunctionEventInvokeConfigsResponse
Prelude.Read, Int -> ListFunctionEventInvokeConfigsResponse -> ShowS
[ListFunctionEventInvokeConfigsResponse] -> ShowS
ListFunctionEventInvokeConfigsResponse -> String
(Int -> ListFunctionEventInvokeConfigsResponse -> ShowS)
-> (ListFunctionEventInvokeConfigsResponse -> String)
-> ([ListFunctionEventInvokeConfigsResponse] -> ShowS)
-> Show ListFunctionEventInvokeConfigsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListFunctionEventInvokeConfigsResponse] -> ShowS
$cshowList :: [ListFunctionEventInvokeConfigsResponse] -> ShowS
show :: ListFunctionEventInvokeConfigsResponse -> String
$cshow :: ListFunctionEventInvokeConfigsResponse -> String
showsPrec :: Int -> ListFunctionEventInvokeConfigsResponse -> ShowS
$cshowsPrec :: Int -> ListFunctionEventInvokeConfigsResponse -> ShowS
Prelude.Show, (forall x.
 ListFunctionEventInvokeConfigsResponse
 -> Rep ListFunctionEventInvokeConfigsResponse x)
-> (forall x.
    Rep ListFunctionEventInvokeConfigsResponse x
    -> ListFunctionEventInvokeConfigsResponse)
-> Generic ListFunctionEventInvokeConfigsResponse
forall x.
Rep ListFunctionEventInvokeConfigsResponse x
-> ListFunctionEventInvokeConfigsResponse
forall x.
ListFunctionEventInvokeConfigsResponse
-> Rep ListFunctionEventInvokeConfigsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListFunctionEventInvokeConfigsResponse x
-> ListFunctionEventInvokeConfigsResponse
$cfrom :: forall x.
ListFunctionEventInvokeConfigsResponse
-> Rep ListFunctionEventInvokeConfigsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListFunctionEventInvokeConfigsResponse' 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:
--
-- 'functionEventInvokeConfigs', 'listFunctionEventInvokeConfigsResponse_functionEventInvokeConfigs' - A list of configurations.
--
-- 'nextMarker', 'listFunctionEventInvokeConfigsResponse_nextMarker' - The pagination token that\'s included if more results are available.
--
-- 'httpStatus', 'listFunctionEventInvokeConfigsResponse_httpStatus' - The response's http status code.
newListFunctionEventInvokeConfigsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListFunctionEventInvokeConfigsResponse
newListFunctionEventInvokeConfigsResponse :: Int -> ListFunctionEventInvokeConfigsResponse
newListFunctionEventInvokeConfigsResponse
  Int
pHttpStatus_ =
    ListFunctionEventInvokeConfigsResponse' :: Maybe [FunctionEventInvokeConfig]
-> Maybe Text -> Int -> ListFunctionEventInvokeConfigsResponse
ListFunctionEventInvokeConfigsResponse'
      { $sel:functionEventInvokeConfigs:ListFunctionEventInvokeConfigsResponse' :: Maybe [FunctionEventInvokeConfig]
functionEventInvokeConfigs =
          Maybe [FunctionEventInvokeConfig]
forall a. Maybe a
Prelude.Nothing,
        $sel:nextMarker:ListFunctionEventInvokeConfigsResponse' :: Maybe Text
nextMarker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:ListFunctionEventInvokeConfigsResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | A list of configurations.
listFunctionEventInvokeConfigsResponse_functionEventInvokeConfigs :: Lens.Lens' ListFunctionEventInvokeConfigsResponse (Prelude.Maybe [FunctionEventInvokeConfig])
listFunctionEventInvokeConfigsResponse_functionEventInvokeConfigs :: (Maybe [FunctionEventInvokeConfig]
 -> f (Maybe [FunctionEventInvokeConfig]))
-> ListFunctionEventInvokeConfigsResponse
-> f ListFunctionEventInvokeConfigsResponse
listFunctionEventInvokeConfigsResponse_functionEventInvokeConfigs = (ListFunctionEventInvokeConfigsResponse
 -> Maybe [FunctionEventInvokeConfig])
-> (ListFunctionEventInvokeConfigsResponse
    -> Maybe [FunctionEventInvokeConfig]
    -> ListFunctionEventInvokeConfigsResponse)
-> Lens'
     ListFunctionEventInvokeConfigsResponse
     (Maybe [FunctionEventInvokeConfig])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFunctionEventInvokeConfigsResponse' {Maybe [FunctionEventInvokeConfig]
functionEventInvokeConfigs :: Maybe [FunctionEventInvokeConfig]
$sel:functionEventInvokeConfigs:ListFunctionEventInvokeConfigsResponse' :: ListFunctionEventInvokeConfigsResponse
-> Maybe [FunctionEventInvokeConfig]
functionEventInvokeConfigs} -> Maybe [FunctionEventInvokeConfig]
functionEventInvokeConfigs) (\s :: ListFunctionEventInvokeConfigsResponse
s@ListFunctionEventInvokeConfigsResponse' {} Maybe [FunctionEventInvokeConfig]
a -> ListFunctionEventInvokeConfigsResponse
s {$sel:functionEventInvokeConfigs:ListFunctionEventInvokeConfigsResponse' :: Maybe [FunctionEventInvokeConfig]
functionEventInvokeConfigs = Maybe [FunctionEventInvokeConfig]
a} :: ListFunctionEventInvokeConfigsResponse) ((Maybe [FunctionEventInvokeConfig]
  -> f (Maybe [FunctionEventInvokeConfig]))
 -> ListFunctionEventInvokeConfigsResponse
 -> f ListFunctionEventInvokeConfigsResponse)
-> ((Maybe [FunctionEventInvokeConfig]
     -> f (Maybe [FunctionEventInvokeConfig]))
    -> Maybe [FunctionEventInvokeConfig]
    -> f (Maybe [FunctionEventInvokeConfig]))
-> (Maybe [FunctionEventInvokeConfig]
    -> f (Maybe [FunctionEventInvokeConfig]))
-> ListFunctionEventInvokeConfigsResponse
-> f ListFunctionEventInvokeConfigsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [FunctionEventInvokeConfig]
  [FunctionEventInvokeConfig]
  [FunctionEventInvokeConfig]
  [FunctionEventInvokeConfig]
-> Iso
     (Maybe [FunctionEventInvokeConfig])
     (Maybe [FunctionEventInvokeConfig])
     (Maybe [FunctionEventInvokeConfig])
     (Maybe [FunctionEventInvokeConfig])
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
  [FunctionEventInvokeConfig]
  [FunctionEventInvokeConfig]
  [FunctionEventInvokeConfig]
  [FunctionEventInvokeConfig]
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.
listFunctionEventInvokeConfigsResponse_nextMarker :: Lens.Lens' ListFunctionEventInvokeConfigsResponse (Prelude.Maybe Prelude.Text)
listFunctionEventInvokeConfigsResponse_nextMarker :: (Maybe Text -> f (Maybe Text))
-> ListFunctionEventInvokeConfigsResponse
-> f ListFunctionEventInvokeConfigsResponse
listFunctionEventInvokeConfigsResponse_nextMarker = (ListFunctionEventInvokeConfigsResponse -> Maybe Text)
-> (ListFunctionEventInvokeConfigsResponse
    -> Maybe Text -> ListFunctionEventInvokeConfigsResponse)
-> Lens' ListFunctionEventInvokeConfigsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFunctionEventInvokeConfigsResponse' {Maybe Text
nextMarker :: Maybe Text
$sel:nextMarker:ListFunctionEventInvokeConfigsResponse' :: ListFunctionEventInvokeConfigsResponse -> Maybe Text
nextMarker} -> Maybe Text
nextMarker) (\s :: ListFunctionEventInvokeConfigsResponse
s@ListFunctionEventInvokeConfigsResponse' {} Maybe Text
a -> ListFunctionEventInvokeConfigsResponse
s {$sel:nextMarker:ListFunctionEventInvokeConfigsResponse' :: Maybe Text
nextMarker = Maybe Text
a} :: ListFunctionEventInvokeConfigsResponse)

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

instance
  Prelude.NFData
    ListFunctionEventInvokeConfigsResponse