{-# 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.DeleteProvisionedConcurrencyConfig
-- 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 provisioned concurrency configuration for a function.
module Amazonka.Lambda.DeleteProvisionedConcurrencyConfig
  ( -- * Creating a Request
    DeleteProvisionedConcurrencyConfig (..),
    newDeleteProvisionedConcurrencyConfig,

    -- * Request Lenses
    deleteProvisionedConcurrencyConfig_functionName,
    deleteProvisionedConcurrencyConfig_qualifier,

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

-- |
-- Create a value of 'DeleteProvisionedConcurrencyConfig' 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', 'deleteProvisionedConcurrencyConfig_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.
--
-- 'qualifier', 'deleteProvisionedConcurrencyConfig_qualifier' - The version number or alias name.
newDeleteProvisionedConcurrencyConfig ::
  -- | 'functionName'
  Prelude.Text ->
  -- | 'qualifier'
  Prelude.Text ->
  DeleteProvisionedConcurrencyConfig
newDeleteProvisionedConcurrencyConfig :: Text -> Text -> DeleteProvisionedConcurrencyConfig
newDeleteProvisionedConcurrencyConfig
  Text
pFunctionName_
  Text
pQualifier_ =
    DeleteProvisionedConcurrencyConfig' :: Text -> Text -> DeleteProvisionedConcurrencyConfig
DeleteProvisionedConcurrencyConfig'
      { $sel:functionName:DeleteProvisionedConcurrencyConfig' :: Text
functionName =
          Text
pFunctionName_,
        $sel:qualifier:DeleteProvisionedConcurrencyConfig' :: Text
qualifier = Text
pQualifier_
      }

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

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

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

instance
  Prelude.Hashable
    DeleteProvisionedConcurrencyConfig

instance
  Prelude.NFData
    DeleteProvisionedConcurrencyConfig

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

instance
  Core.ToPath
    DeleteProvisionedConcurrencyConfig
  where
  toPath :: DeleteProvisionedConcurrencyConfig -> ByteString
toPath DeleteProvisionedConcurrencyConfig' {Text
qualifier :: Text
functionName :: Text
$sel:qualifier:DeleteProvisionedConcurrencyConfig' :: DeleteProvisionedConcurrencyConfig -> Text
$sel:functionName:DeleteProvisionedConcurrencyConfig' :: DeleteProvisionedConcurrencyConfig -> 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
    DeleteProvisionedConcurrencyConfig
  where
  toQuery :: DeleteProvisionedConcurrencyConfig -> QueryString
toQuery DeleteProvisionedConcurrencyConfig' {Text
qualifier :: Text
functionName :: Text
$sel:qualifier:DeleteProvisionedConcurrencyConfig' :: DeleteProvisionedConcurrencyConfig -> Text
$sel:functionName:DeleteProvisionedConcurrencyConfig' :: DeleteProvisionedConcurrencyConfig -> Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"Qualifier" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
qualifier]

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

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

instance
  Prelude.NFData
    DeleteProvisionedConcurrencyConfigResponse