{-# 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.DeleteFunctionEventInvokeConfig
-- 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)
--
-- Deletes the configuration for asynchronous invocation for a function,
-- version, or alias.
--
-- To configure options for asynchronous invocation, use
-- PutFunctionEventInvokeConfig.
module Amazonka.Lambda.DeleteFunctionEventInvokeConfig
  ( -- * Creating a Request
    DeleteFunctionEventInvokeConfig (..),
    newDeleteFunctionEventInvokeConfig,

    -- * Request Lenses
    deleteFunctionEventInvokeConfig_qualifier,
    deleteFunctionEventInvokeConfig_functionName,

    -- * Destructuring the Response
    DeleteFunctionEventInvokeConfigResponse (..),
    newDeleteFunctionEventInvokeConfigResponse,
  )
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:/ 'newDeleteFunctionEventInvokeConfig' smart constructor.
data DeleteFunctionEventInvokeConfig = DeleteFunctionEventInvokeConfig'
  { -- | A version number or alias name.
    DeleteFunctionEventInvokeConfig -> Maybe Text
qualifier :: Prelude.Maybe Prelude.Text,
    -- | The name of the Lambda function, version, or alias.
    --
    -- __Name formats__
    --
    -- -   __Function name__ - @my-function@ (name-only), @my-function:v1@
    --     (with alias).
    --
    -- -   __Function ARN__ -
    --     @arn:aws:lambda:us-west-2:123456789012:function:my-function@.
    --
    -- -   __Partial ARN__ - @123456789012:function:my-function@.
    --
    -- You can append a version number or alias to any of the formats. The
    -- length constraint applies only to the full ARN. If you specify only the
    -- function name, it is limited to 64 characters in length.
    DeleteFunctionEventInvokeConfig -> Text
functionName :: Prelude.Text
  }
  deriving (DeleteFunctionEventInvokeConfig
-> DeleteFunctionEventInvokeConfig -> Bool
(DeleteFunctionEventInvokeConfig
 -> DeleteFunctionEventInvokeConfig -> Bool)
-> (DeleteFunctionEventInvokeConfig
    -> DeleteFunctionEventInvokeConfig -> Bool)
-> Eq DeleteFunctionEventInvokeConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteFunctionEventInvokeConfig
-> DeleteFunctionEventInvokeConfig -> Bool
$c/= :: DeleteFunctionEventInvokeConfig
-> DeleteFunctionEventInvokeConfig -> Bool
== :: DeleteFunctionEventInvokeConfig
-> DeleteFunctionEventInvokeConfig -> Bool
$c== :: DeleteFunctionEventInvokeConfig
-> DeleteFunctionEventInvokeConfig -> Bool
Prelude.Eq, ReadPrec [DeleteFunctionEventInvokeConfig]
ReadPrec DeleteFunctionEventInvokeConfig
Int -> ReadS DeleteFunctionEventInvokeConfig
ReadS [DeleteFunctionEventInvokeConfig]
(Int -> ReadS DeleteFunctionEventInvokeConfig)
-> ReadS [DeleteFunctionEventInvokeConfig]
-> ReadPrec DeleteFunctionEventInvokeConfig
-> ReadPrec [DeleteFunctionEventInvokeConfig]
-> Read DeleteFunctionEventInvokeConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteFunctionEventInvokeConfig]
$creadListPrec :: ReadPrec [DeleteFunctionEventInvokeConfig]
readPrec :: ReadPrec DeleteFunctionEventInvokeConfig
$creadPrec :: ReadPrec DeleteFunctionEventInvokeConfig
readList :: ReadS [DeleteFunctionEventInvokeConfig]
$creadList :: ReadS [DeleteFunctionEventInvokeConfig]
readsPrec :: Int -> ReadS DeleteFunctionEventInvokeConfig
$creadsPrec :: Int -> ReadS DeleteFunctionEventInvokeConfig
Prelude.Read, Int -> DeleteFunctionEventInvokeConfig -> ShowS
[DeleteFunctionEventInvokeConfig] -> ShowS
DeleteFunctionEventInvokeConfig -> String
(Int -> DeleteFunctionEventInvokeConfig -> ShowS)
-> (DeleteFunctionEventInvokeConfig -> String)
-> ([DeleteFunctionEventInvokeConfig] -> ShowS)
-> Show DeleteFunctionEventInvokeConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteFunctionEventInvokeConfig] -> ShowS
$cshowList :: [DeleteFunctionEventInvokeConfig] -> ShowS
show :: DeleteFunctionEventInvokeConfig -> String
$cshow :: DeleteFunctionEventInvokeConfig -> String
showsPrec :: Int -> DeleteFunctionEventInvokeConfig -> ShowS
$cshowsPrec :: Int -> DeleteFunctionEventInvokeConfig -> ShowS
Prelude.Show, (forall x.
 DeleteFunctionEventInvokeConfig
 -> Rep DeleteFunctionEventInvokeConfig x)
-> (forall x.
    Rep DeleteFunctionEventInvokeConfig x
    -> DeleteFunctionEventInvokeConfig)
-> Generic DeleteFunctionEventInvokeConfig
forall x.
Rep DeleteFunctionEventInvokeConfig x
-> DeleteFunctionEventInvokeConfig
forall x.
DeleteFunctionEventInvokeConfig
-> Rep DeleteFunctionEventInvokeConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteFunctionEventInvokeConfig x
-> DeleteFunctionEventInvokeConfig
$cfrom :: forall x.
DeleteFunctionEventInvokeConfig
-> Rep DeleteFunctionEventInvokeConfig x
Prelude.Generic)

-- |
-- Create a value of 'DeleteFunctionEventInvokeConfig' 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:
--
-- 'qualifier', 'deleteFunctionEventInvokeConfig_qualifier' - A version number or alias name.
--
-- 'functionName', 'deleteFunctionEventInvokeConfig_functionName' - The name of the Lambda function, version, or alias.
--
-- __Name formats__
--
-- -   __Function name__ - @my-function@ (name-only), @my-function:v1@
--     (with alias).
--
-- -   __Function ARN__ -
--     @arn:aws:lambda:us-west-2:123456789012:function:my-function@.
--
-- -   __Partial ARN__ - @123456789012:function:my-function@.
--
-- You can append a version number or alias to any of the formats. The
-- length constraint applies only to the full ARN. If you specify only the
-- function name, it is limited to 64 characters in length.
newDeleteFunctionEventInvokeConfig ::
  -- | 'functionName'
  Prelude.Text ->
  DeleteFunctionEventInvokeConfig
newDeleteFunctionEventInvokeConfig :: Text -> DeleteFunctionEventInvokeConfig
newDeleteFunctionEventInvokeConfig Text
pFunctionName_ =
  DeleteFunctionEventInvokeConfig' :: Maybe Text -> Text -> DeleteFunctionEventInvokeConfig
DeleteFunctionEventInvokeConfig'
    { $sel:qualifier:DeleteFunctionEventInvokeConfig' :: Maybe Text
qualifier =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:functionName:DeleteFunctionEventInvokeConfig' :: Text
functionName = Text
pFunctionName_
    }

-- | A version number or alias name.
deleteFunctionEventInvokeConfig_qualifier :: Lens.Lens' DeleteFunctionEventInvokeConfig (Prelude.Maybe Prelude.Text)
deleteFunctionEventInvokeConfig_qualifier :: (Maybe Text -> f (Maybe Text))
-> DeleteFunctionEventInvokeConfig
-> f DeleteFunctionEventInvokeConfig
deleteFunctionEventInvokeConfig_qualifier = (DeleteFunctionEventInvokeConfig -> Maybe Text)
-> (DeleteFunctionEventInvokeConfig
    -> Maybe Text -> DeleteFunctionEventInvokeConfig)
-> Lens
     DeleteFunctionEventInvokeConfig
     DeleteFunctionEventInvokeConfig
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteFunctionEventInvokeConfig' {Maybe Text
qualifier :: Maybe Text
$sel:qualifier:DeleteFunctionEventInvokeConfig' :: DeleteFunctionEventInvokeConfig -> Maybe Text
qualifier} -> Maybe Text
qualifier) (\s :: DeleteFunctionEventInvokeConfig
s@DeleteFunctionEventInvokeConfig' {} Maybe Text
a -> DeleteFunctionEventInvokeConfig
s {$sel:qualifier:DeleteFunctionEventInvokeConfig' :: Maybe Text
qualifier = Maybe Text
a} :: DeleteFunctionEventInvokeConfig)

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

instance
  Core.AWSRequest
    DeleteFunctionEventInvokeConfig
  where
  type
    AWSResponse DeleteFunctionEventInvokeConfig =
      DeleteFunctionEventInvokeConfigResponse
  request :: DeleteFunctionEventInvokeConfig
-> Request DeleteFunctionEventInvokeConfig
request = Service
-> DeleteFunctionEventInvokeConfig
-> Request DeleteFunctionEventInvokeConfig
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
  response :: Logger
-> Service
-> Proxy DeleteFunctionEventInvokeConfig
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse DeleteFunctionEventInvokeConfig)))
response =
    AWSResponse DeleteFunctionEventInvokeConfig
-> Logger
-> Service
-> Proxy DeleteFunctionEventInvokeConfig
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse DeleteFunctionEventInvokeConfig)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
      AWSResponse DeleteFunctionEventInvokeConfig
DeleteFunctionEventInvokeConfigResponse
DeleteFunctionEventInvokeConfigResponse'

instance
  Prelude.Hashable
    DeleteFunctionEventInvokeConfig

instance
  Prelude.NFData
    DeleteFunctionEventInvokeConfig

instance
  Core.ToHeaders
    DeleteFunctionEventInvokeConfig
  where
  toHeaders :: DeleteFunctionEventInvokeConfig -> [Header]
toHeaders = [Header] -> DeleteFunctionEventInvokeConfig -> [Header]
forall a b. a -> b -> a
Prelude.const [Header]
forall a. Monoid a => a
Prelude.mempty

instance Core.ToPath DeleteFunctionEventInvokeConfig where
  toPath :: DeleteFunctionEventInvokeConfig -> ByteString
toPath DeleteFunctionEventInvokeConfig' {Maybe Text
Text
functionName :: Text
qualifier :: Maybe Text
$sel:functionName:DeleteFunctionEventInvokeConfig' :: DeleteFunctionEventInvokeConfig -> Text
$sel:qualifier:DeleteFunctionEventInvokeConfig' :: DeleteFunctionEventInvokeConfig -> 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"
      ]

instance Core.ToQuery DeleteFunctionEventInvokeConfig where
  toQuery :: DeleteFunctionEventInvokeConfig -> QueryString
toQuery DeleteFunctionEventInvokeConfig' {Maybe Text
Text
functionName :: Text
qualifier :: Maybe Text
$sel:functionName:DeleteFunctionEventInvokeConfig' :: DeleteFunctionEventInvokeConfig -> Text
$sel:qualifier:DeleteFunctionEventInvokeConfig' :: DeleteFunctionEventInvokeConfig -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"Qualifier" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
qualifier]

-- | /See:/ 'newDeleteFunctionEventInvokeConfigResponse' smart constructor.
data DeleteFunctionEventInvokeConfigResponse = DeleteFunctionEventInvokeConfigResponse'
  {
  }
  deriving (DeleteFunctionEventInvokeConfigResponse
-> DeleteFunctionEventInvokeConfigResponse -> Bool
(DeleteFunctionEventInvokeConfigResponse
 -> DeleteFunctionEventInvokeConfigResponse -> Bool)
-> (DeleteFunctionEventInvokeConfigResponse
    -> DeleteFunctionEventInvokeConfigResponse -> Bool)
-> Eq DeleteFunctionEventInvokeConfigResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteFunctionEventInvokeConfigResponse
-> DeleteFunctionEventInvokeConfigResponse -> Bool
$c/= :: DeleteFunctionEventInvokeConfigResponse
-> DeleteFunctionEventInvokeConfigResponse -> Bool
== :: DeleteFunctionEventInvokeConfigResponse
-> DeleteFunctionEventInvokeConfigResponse -> Bool
$c== :: DeleteFunctionEventInvokeConfigResponse
-> DeleteFunctionEventInvokeConfigResponse -> Bool
Prelude.Eq, ReadPrec [DeleteFunctionEventInvokeConfigResponse]
ReadPrec DeleteFunctionEventInvokeConfigResponse
Int -> ReadS DeleteFunctionEventInvokeConfigResponse
ReadS [DeleteFunctionEventInvokeConfigResponse]
(Int -> ReadS DeleteFunctionEventInvokeConfigResponse)
-> ReadS [DeleteFunctionEventInvokeConfigResponse]
-> ReadPrec DeleteFunctionEventInvokeConfigResponse
-> ReadPrec [DeleteFunctionEventInvokeConfigResponse]
-> Read DeleteFunctionEventInvokeConfigResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteFunctionEventInvokeConfigResponse]
$creadListPrec :: ReadPrec [DeleteFunctionEventInvokeConfigResponse]
readPrec :: ReadPrec DeleteFunctionEventInvokeConfigResponse
$creadPrec :: ReadPrec DeleteFunctionEventInvokeConfigResponse
readList :: ReadS [DeleteFunctionEventInvokeConfigResponse]
$creadList :: ReadS [DeleteFunctionEventInvokeConfigResponse]
readsPrec :: Int -> ReadS DeleteFunctionEventInvokeConfigResponse
$creadsPrec :: Int -> ReadS DeleteFunctionEventInvokeConfigResponse
Prelude.Read, Int -> DeleteFunctionEventInvokeConfigResponse -> ShowS
[DeleteFunctionEventInvokeConfigResponse] -> ShowS
DeleteFunctionEventInvokeConfigResponse -> String
(Int -> DeleteFunctionEventInvokeConfigResponse -> ShowS)
-> (DeleteFunctionEventInvokeConfigResponse -> String)
-> ([DeleteFunctionEventInvokeConfigResponse] -> ShowS)
-> Show DeleteFunctionEventInvokeConfigResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteFunctionEventInvokeConfigResponse] -> ShowS
$cshowList :: [DeleteFunctionEventInvokeConfigResponse] -> ShowS
show :: DeleteFunctionEventInvokeConfigResponse -> String
$cshow :: DeleteFunctionEventInvokeConfigResponse -> String
showsPrec :: Int -> DeleteFunctionEventInvokeConfigResponse -> ShowS
$cshowsPrec :: Int -> DeleteFunctionEventInvokeConfigResponse -> ShowS
Prelude.Show, (forall x.
 DeleteFunctionEventInvokeConfigResponse
 -> Rep DeleteFunctionEventInvokeConfigResponse x)
-> (forall x.
    Rep DeleteFunctionEventInvokeConfigResponse x
    -> DeleteFunctionEventInvokeConfigResponse)
-> Generic DeleteFunctionEventInvokeConfigResponse
forall x.
Rep DeleteFunctionEventInvokeConfigResponse x
-> DeleteFunctionEventInvokeConfigResponse
forall x.
DeleteFunctionEventInvokeConfigResponse
-> Rep DeleteFunctionEventInvokeConfigResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteFunctionEventInvokeConfigResponse x
-> DeleteFunctionEventInvokeConfigResponse
$cfrom :: forall x.
DeleteFunctionEventInvokeConfigResponse
-> Rep DeleteFunctionEventInvokeConfigResponse x
Prelude.Generic)

-- |
-- Create a value of 'DeleteFunctionEventInvokeConfigResponse' 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.
newDeleteFunctionEventInvokeConfigResponse ::
  DeleteFunctionEventInvokeConfigResponse
newDeleteFunctionEventInvokeConfigResponse :: DeleteFunctionEventInvokeConfigResponse
newDeleteFunctionEventInvokeConfigResponse =
  DeleteFunctionEventInvokeConfigResponse
DeleteFunctionEventInvokeConfigResponse'

instance
  Prelude.NFData
    DeleteFunctionEventInvokeConfigResponse