{-# 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.DeleteFunctionCodeSigningConfig
-- 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 the code signing configuration from the function.
module Amazonka.Lambda.DeleteFunctionCodeSigningConfig
  ( -- * Creating a Request
    DeleteFunctionCodeSigningConfig (..),
    newDeleteFunctionCodeSigningConfig,

    -- * Request Lenses
    deleteFunctionCodeSigningConfig_functionName,

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

-- |
-- Create a value of 'DeleteFunctionCodeSigningConfig' 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', 'deleteFunctionCodeSigningConfig_functionName' - The name of the Lambda function.
--
-- __Name formats__
--
-- -   __Function name__ - @MyFunction@.
--
-- -   __Function ARN__ -
--     @arn:aws:lambda:us-west-2:123456789012:function:MyFunction@.
--
-- -   __Partial ARN__ - @123456789012:function:MyFunction@.
--
-- The length constraint applies only to the full ARN. If you specify only
-- the function name, it is limited to 64 characters in length.
newDeleteFunctionCodeSigningConfig ::
  -- | 'functionName'
  Prelude.Text ->
  DeleteFunctionCodeSigningConfig
newDeleteFunctionCodeSigningConfig :: Text -> DeleteFunctionCodeSigningConfig
newDeleteFunctionCodeSigningConfig Text
pFunctionName_ =
  DeleteFunctionCodeSigningConfig'
    { $sel:functionName:DeleteFunctionCodeSigningConfig' :: Text
functionName =
        Text
pFunctionName_
    }

-- | The name of the Lambda function.
--
-- __Name formats__
--
-- -   __Function name__ - @MyFunction@.
--
-- -   __Function ARN__ -
--     @arn:aws:lambda:us-west-2:123456789012:function:MyFunction@.
--
-- -   __Partial ARN__ - @123456789012:function:MyFunction@.
--
-- The length constraint applies only to the full ARN. If you specify only
-- the function name, it is limited to 64 characters in length.
deleteFunctionCodeSigningConfig_functionName :: Lens.Lens' DeleteFunctionCodeSigningConfig Prelude.Text
deleteFunctionCodeSigningConfig_functionName :: Lens' DeleteFunctionCodeSigningConfig Text
deleteFunctionCodeSigningConfig_functionName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteFunctionCodeSigningConfig' {Text
functionName :: Text
$sel:functionName:DeleteFunctionCodeSigningConfig' :: DeleteFunctionCodeSigningConfig -> Text
functionName} -> Text
functionName) (\s :: DeleteFunctionCodeSigningConfig
s@DeleteFunctionCodeSigningConfig' {} Text
a -> DeleteFunctionCodeSigningConfig
s {$sel:functionName:DeleteFunctionCodeSigningConfig' :: Text
functionName = Text
a} :: DeleteFunctionCodeSigningConfig)

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

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

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

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

instance Data.ToPath DeleteFunctionCodeSigningConfig where
  toPath :: DeleteFunctionCodeSigningConfig -> ByteString
toPath DeleteFunctionCodeSigningConfig' {Text
functionName :: Text
$sel:functionName:DeleteFunctionCodeSigningConfig' :: DeleteFunctionCodeSigningConfig -> Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/2020-06-30/functions/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
functionName,
        ByteString
"/code-signing-config"
      ]

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

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

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

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