{-# 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.DeleteFunctionConcurrency
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Removes a concurrent execution limit from a function.
module Amazonka.Lambda.DeleteFunctionConcurrency
  ( -- * Creating a Request
    DeleteFunctionConcurrency (..),
    newDeleteFunctionConcurrency,

    -- * Request Lenses
    deleteFunctionConcurrency_functionName,

    -- * Destructuring the Response
    DeleteFunctionConcurrencyResponse (..),
    newDeleteFunctionConcurrencyResponse,
  )
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:/ 'newDeleteFunctionConcurrency' smart constructor.
data DeleteFunctionConcurrency = DeleteFunctionConcurrency'
  { -- | 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.
    DeleteFunctionConcurrency -> Text
functionName :: Prelude.Text
  }
  deriving (DeleteFunctionConcurrency -> DeleteFunctionConcurrency -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteFunctionConcurrency -> DeleteFunctionConcurrency -> Bool
$c/= :: DeleteFunctionConcurrency -> DeleteFunctionConcurrency -> Bool
== :: DeleteFunctionConcurrency -> DeleteFunctionConcurrency -> Bool
$c== :: DeleteFunctionConcurrency -> DeleteFunctionConcurrency -> Bool
Prelude.Eq, ReadPrec [DeleteFunctionConcurrency]
ReadPrec DeleteFunctionConcurrency
Int -> ReadS DeleteFunctionConcurrency
ReadS [DeleteFunctionConcurrency]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteFunctionConcurrency]
$creadListPrec :: ReadPrec [DeleteFunctionConcurrency]
readPrec :: ReadPrec DeleteFunctionConcurrency
$creadPrec :: ReadPrec DeleteFunctionConcurrency
readList :: ReadS [DeleteFunctionConcurrency]
$creadList :: ReadS [DeleteFunctionConcurrency]
readsPrec :: Int -> ReadS DeleteFunctionConcurrency
$creadsPrec :: Int -> ReadS DeleteFunctionConcurrency
Prelude.Read, Int -> DeleteFunctionConcurrency -> ShowS
[DeleteFunctionConcurrency] -> ShowS
DeleteFunctionConcurrency -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteFunctionConcurrency] -> ShowS
$cshowList :: [DeleteFunctionConcurrency] -> ShowS
show :: DeleteFunctionConcurrency -> String
$cshow :: DeleteFunctionConcurrency -> String
showsPrec :: Int -> DeleteFunctionConcurrency -> ShowS
$cshowsPrec :: Int -> DeleteFunctionConcurrency -> ShowS
Prelude.Show, forall x.
Rep DeleteFunctionConcurrency x -> DeleteFunctionConcurrency
forall x.
DeleteFunctionConcurrency -> Rep DeleteFunctionConcurrency x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteFunctionConcurrency x -> DeleteFunctionConcurrency
$cfrom :: forall x.
DeleteFunctionConcurrency -> Rep DeleteFunctionConcurrency x
Prelude.Generic)

-- |
-- Create a value of 'DeleteFunctionConcurrency' 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:
--
-- 'functionName', 'deleteFunctionConcurrency_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.
newDeleteFunctionConcurrency ::
  -- | 'functionName'
  Prelude.Text ->
  DeleteFunctionConcurrency
newDeleteFunctionConcurrency :: Text -> DeleteFunctionConcurrency
newDeleteFunctionConcurrency Text
pFunctionName_ =
  DeleteFunctionConcurrency'
    { $sel:functionName:DeleteFunctionConcurrency' :: Text
functionName =
        Text
pFunctionName_
    }

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

instance Core.AWSRequest DeleteFunctionConcurrency where
  type
    AWSResponse DeleteFunctionConcurrency =
      DeleteFunctionConcurrencyResponse
  request :: (Service -> Service)
-> DeleteFunctionConcurrency -> Request DeleteFunctionConcurrency
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 DeleteFunctionConcurrency
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteFunctionConcurrency)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
      DeleteFunctionConcurrencyResponse
DeleteFunctionConcurrencyResponse'

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

instance Prelude.NFData DeleteFunctionConcurrency where
  rnf :: DeleteFunctionConcurrency -> ()
rnf DeleteFunctionConcurrency' {Text
functionName :: Text
$sel:functionName:DeleteFunctionConcurrency' :: DeleteFunctionConcurrency -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
functionName

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

instance Data.ToPath DeleteFunctionConcurrency where
  toPath :: DeleteFunctionConcurrency -> ByteString
toPath DeleteFunctionConcurrency' {Text
functionName :: Text
$sel:functionName:DeleteFunctionConcurrency' :: DeleteFunctionConcurrency -> Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/2017-10-31/functions/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
functionName,
        ByteString
"/concurrency"
      ]

instance Data.ToQuery DeleteFunctionConcurrency where
  toQuery :: DeleteFunctionConcurrency -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

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

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

instance
  Prelude.NFData
    DeleteFunctionConcurrencyResponse
  where
  rnf :: DeleteFunctionConcurrencyResponse -> ()
rnf DeleteFunctionConcurrencyResponse
_ = ()