{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- 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 qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Lambda.Types
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
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]
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
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.
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'
    { $sel:qualifier:DeleteFunctionEventInvokeConfig' :: Maybe Text
qualifier =
        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 :: Lens' DeleteFunctionEventInvokeConfig (Maybe Text)
deleteFunctionEventInvokeConfig_qualifier = 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 :: Lens' DeleteFunctionEventInvokeConfig Text
deleteFunctionEventInvokeConfig_functionName = 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 :: (Service -> Service)
-> DeleteFunctionEventInvokeConfig
-> Request DeleteFunctionEventInvokeConfig
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.delete (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DeleteFunctionEventInvokeConfig
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse DeleteFunctionEventInvokeConfig)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
      DeleteFunctionEventInvokeConfigResponse
DeleteFunctionEventInvokeConfigResponse'

instance
  Prelude.Hashable
    DeleteFunctionEventInvokeConfig
  where
  hashWithSalt :: Int -> DeleteFunctionEventInvokeConfig -> Int
hashWithSalt
    Int
_salt
    DeleteFunctionEventInvokeConfig' {Maybe Text
Text
functionName :: Text
qualifier :: Maybe Text
$sel:functionName:DeleteFunctionEventInvokeConfig' :: DeleteFunctionEventInvokeConfig -> Text
$sel:qualifier:DeleteFunctionEventInvokeConfig' :: DeleteFunctionEventInvokeConfig -> Maybe Text
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
qualifier
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
functionName

instance
  Prelude.NFData
    DeleteFunctionEventInvokeConfig
  where
  rnf :: DeleteFunctionEventInvokeConfig -> ()
rnf DeleteFunctionEventInvokeConfig' {Maybe Text
Text
functionName :: Text
qualifier :: Maybe Text
$sel:functionName:DeleteFunctionEventInvokeConfig' :: DeleteFunctionEventInvokeConfig -> Text
$sel:qualifier:DeleteFunctionEventInvokeConfig' :: DeleteFunctionEventInvokeConfig -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
qualifier
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
functionName

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

instance Data.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
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/2019-09-25/functions/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
functionName,
        ByteString
"/event-invoke-config"
      ]

instance Data.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
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"Qualifier" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
qualifier]

-- | /See:/ 'newDeleteFunctionEventInvokeConfigResponse' smart constructor.
data DeleteFunctionEventInvokeConfigResponse = DeleteFunctionEventInvokeConfigResponse'
  {
  }
  deriving (DeleteFunctionEventInvokeConfigResponse
-> DeleteFunctionEventInvokeConfigResponse -> Bool
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]
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
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.
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
  where
  rnf :: DeleteFunctionEventInvokeConfigResponse -> ()
rnf DeleteFunctionEventInvokeConfigResponse
_ = ()