{-# 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-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)
--
-- 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 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:/ '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
(DeleteFunctionCodeSigningConfig
 -> DeleteFunctionCodeSigningConfig -> Bool)
-> (DeleteFunctionCodeSigningConfig
    -> DeleteFunctionCodeSigningConfig -> Bool)
-> Eq DeleteFunctionCodeSigningConfig
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]
(Int -> ReadS DeleteFunctionCodeSigningConfig)
-> ReadS [DeleteFunctionCodeSigningConfig]
-> ReadPrec DeleteFunctionCodeSigningConfig
-> ReadPrec [DeleteFunctionCodeSigningConfig]
-> Read 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
(Int -> DeleteFunctionCodeSigningConfig -> ShowS)
-> (DeleteFunctionCodeSigningConfig -> String)
-> ([DeleteFunctionCodeSigningConfig] -> ShowS)
-> Show DeleteFunctionCodeSigningConfig
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.
 DeleteFunctionCodeSigningConfig
 -> Rep DeleteFunctionCodeSigningConfig x)
-> (forall x.
    Rep DeleteFunctionCodeSigningConfig x
    -> DeleteFunctionCodeSigningConfig)
-> Generic DeleteFunctionCodeSigningConfig
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' :: Text -> DeleteFunctionCodeSigningConfig
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 :: (Text -> f Text)
-> DeleteFunctionCodeSigningConfig
-> f DeleteFunctionCodeSigningConfig
deleteFunctionCodeSigningConfig_functionName = (DeleteFunctionCodeSigningConfig -> Text)
-> (DeleteFunctionCodeSigningConfig
    -> Text -> DeleteFunctionCodeSigningConfig)
-> Lens
     DeleteFunctionCodeSigningConfig
     DeleteFunctionCodeSigningConfig
     Text
     Text
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 :: DeleteFunctionCodeSigningConfig
-> Request DeleteFunctionCodeSigningConfig
request = Service
-> DeleteFunctionCodeSigningConfig
-> Request DeleteFunctionCodeSigningConfig
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
  response :: Logger
-> Service
-> Proxy DeleteFunctionCodeSigningConfig
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse DeleteFunctionCodeSigningConfig)))
response =
    AWSResponse DeleteFunctionCodeSigningConfig
-> Logger
-> Service
-> Proxy DeleteFunctionCodeSigningConfig
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse DeleteFunctionCodeSigningConfig)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
      AWSResponse DeleteFunctionCodeSigningConfig
DeleteFunctionCodeSigningConfigResponse
DeleteFunctionCodeSigningConfigResponse'

instance
  Prelude.Hashable
    DeleteFunctionCodeSigningConfig

instance
  Prelude.NFData
    DeleteFunctionCodeSigningConfig

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

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

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

-- | /See:/ 'newDeleteFunctionCodeSigningConfigResponse' smart constructor.
data DeleteFunctionCodeSigningConfigResponse = DeleteFunctionCodeSigningConfigResponse'
  {
  }
  deriving (DeleteFunctionCodeSigningConfigResponse
-> DeleteFunctionCodeSigningConfigResponse -> Bool
(DeleteFunctionCodeSigningConfigResponse
 -> DeleteFunctionCodeSigningConfigResponse -> Bool)
-> (DeleteFunctionCodeSigningConfigResponse
    -> DeleteFunctionCodeSigningConfigResponse -> Bool)
-> Eq DeleteFunctionCodeSigningConfigResponse
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]
(Int -> ReadS DeleteFunctionCodeSigningConfigResponse)
-> ReadS [DeleteFunctionCodeSigningConfigResponse]
-> ReadPrec DeleteFunctionCodeSigningConfigResponse
-> ReadPrec [DeleteFunctionCodeSigningConfigResponse]
-> Read 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
(Int -> DeleteFunctionCodeSigningConfigResponse -> ShowS)
-> (DeleteFunctionCodeSigningConfigResponse -> String)
-> ([DeleteFunctionCodeSigningConfigResponse] -> ShowS)
-> Show DeleteFunctionCodeSigningConfigResponse
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.
 DeleteFunctionCodeSigningConfigResponse
 -> Rep DeleteFunctionCodeSigningConfigResponse x)
-> (forall x.
    Rep DeleteFunctionCodeSigningConfigResponse x
    -> DeleteFunctionCodeSigningConfigResponse)
-> Generic DeleteFunctionCodeSigningConfigResponse
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