{-# 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.DeleteCodeSigningConfig
-- 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 code signing configuration. You can delete the code signing
-- configuration only if no function is using it.
module Amazonka.Lambda.DeleteCodeSigningConfig
  ( -- * Creating a Request
    DeleteCodeSigningConfig (..),
    newDeleteCodeSigningConfig,

    -- * Request Lenses
    deleteCodeSigningConfig_codeSigningConfigArn,

    -- * Destructuring the Response
    DeleteCodeSigningConfigResponse (..),
    newDeleteCodeSigningConfigResponse,

    -- * Response Lenses
    deleteCodeSigningConfigResponse_httpStatus,
  )
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:/ 'newDeleteCodeSigningConfig' smart constructor.
data DeleteCodeSigningConfig = DeleteCodeSigningConfig'
  { -- | The The Amazon Resource Name (ARN) of the code signing configuration.
    DeleteCodeSigningConfig -> Text
codeSigningConfigArn :: Prelude.Text
  }
  deriving (DeleteCodeSigningConfig -> DeleteCodeSigningConfig -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteCodeSigningConfig -> DeleteCodeSigningConfig -> Bool
$c/= :: DeleteCodeSigningConfig -> DeleteCodeSigningConfig -> Bool
== :: DeleteCodeSigningConfig -> DeleteCodeSigningConfig -> Bool
$c== :: DeleteCodeSigningConfig -> DeleteCodeSigningConfig -> Bool
Prelude.Eq, ReadPrec [DeleteCodeSigningConfig]
ReadPrec DeleteCodeSigningConfig
Int -> ReadS DeleteCodeSigningConfig
ReadS [DeleteCodeSigningConfig]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteCodeSigningConfig]
$creadListPrec :: ReadPrec [DeleteCodeSigningConfig]
readPrec :: ReadPrec DeleteCodeSigningConfig
$creadPrec :: ReadPrec DeleteCodeSigningConfig
readList :: ReadS [DeleteCodeSigningConfig]
$creadList :: ReadS [DeleteCodeSigningConfig]
readsPrec :: Int -> ReadS DeleteCodeSigningConfig
$creadsPrec :: Int -> ReadS DeleteCodeSigningConfig
Prelude.Read, Int -> DeleteCodeSigningConfig -> ShowS
[DeleteCodeSigningConfig] -> ShowS
DeleteCodeSigningConfig -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteCodeSigningConfig] -> ShowS
$cshowList :: [DeleteCodeSigningConfig] -> ShowS
show :: DeleteCodeSigningConfig -> String
$cshow :: DeleteCodeSigningConfig -> String
showsPrec :: Int -> DeleteCodeSigningConfig -> ShowS
$cshowsPrec :: Int -> DeleteCodeSigningConfig -> ShowS
Prelude.Show, forall x. Rep DeleteCodeSigningConfig x -> DeleteCodeSigningConfig
forall x. DeleteCodeSigningConfig -> Rep DeleteCodeSigningConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteCodeSigningConfig x -> DeleteCodeSigningConfig
$cfrom :: forall x. DeleteCodeSigningConfig -> Rep DeleteCodeSigningConfig x
Prelude.Generic)

-- |
-- Create a value of 'DeleteCodeSigningConfig' 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:
--
-- 'codeSigningConfigArn', 'deleteCodeSigningConfig_codeSigningConfigArn' - The The Amazon Resource Name (ARN) of the code signing configuration.
newDeleteCodeSigningConfig ::
  -- | 'codeSigningConfigArn'
  Prelude.Text ->
  DeleteCodeSigningConfig
newDeleteCodeSigningConfig :: Text -> DeleteCodeSigningConfig
newDeleteCodeSigningConfig Text
pCodeSigningConfigArn_ =
  DeleteCodeSigningConfig'
    { $sel:codeSigningConfigArn:DeleteCodeSigningConfig' :: Text
codeSigningConfigArn =
        Text
pCodeSigningConfigArn_
    }

-- | The The Amazon Resource Name (ARN) of the code signing configuration.
deleteCodeSigningConfig_codeSigningConfigArn :: Lens.Lens' DeleteCodeSigningConfig Prelude.Text
deleteCodeSigningConfig_codeSigningConfigArn :: Lens' DeleteCodeSigningConfig Text
deleteCodeSigningConfig_codeSigningConfigArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteCodeSigningConfig' {Text
codeSigningConfigArn :: Text
$sel:codeSigningConfigArn:DeleteCodeSigningConfig' :: DeleteCodeSigningConfig -> Text
codeSigningConfigArn} -> Text
codeSigningConfigArn) (\s :: DeleteCodeSigningConfig
s@DeleteCodeSigningConfig' {} Text
a -> DeleteCodeSigningConfig
s {$sel:codeSigningConfigArn:DeleteCodeSigningConfig' :: Text
codeSigningConfigArn = Text
a} :: DeleteCodeSigningConfig)

instance Core.AWSRequest DeleteCodeSigningConfig where
  type
    AWSResponse DeleteCodeSigningConfig =
      DeleteCodeSigningConfigResponse
  request :: (Service -> Service)
-> DeleteCodeSigningConfig -> Request DeleteCodeSigningConfig
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 DeleteCodeSigningConfig
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteCodeSigningConfig)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
      ( \Int
s ResponseHeaders
h ()
x ->
          Int -> DeleteCodeSigningConfigResponse
DeleteCodeSigningConfigResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

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

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

instance Data.ToHeaders DeleteCodeSigningConfig where
  toHeaders :: DeleteCodeSigningConfig -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

instance Data.ToPath DeleteCodeSigningConfig where
  toPath :: DeleteCodeSigningConfig -> ByteString
toPath DeleteCodeSigningConfig' {Text
codeSigningConfigArn :: Text
$sel:codeSigningConfigArn:DeleteCodeSigningConfig' :: DeleteCodeSigningConfig -> Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/2020-04-22/code-signing-configs/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
codeSigningConfigArn
      ]

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

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

-- |
-- Create a value of 'DeleteCodeSigningConfigResponse' 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:
--
-- 'httpStatus', 'deleteCodeSigningConfigResponse_httpStatus' - The response's http status code.
newDeleteCodeSigningConfigResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DeleteCodeSigningConfigResponse
newDeleteCodeSigningConfigResponse :: Int -> DeleteCodeSigningConfigResponse
newDeleteCodeSigningConfigResponse Int
pHttpStatus_ =
  DeleteCodeSigningConfigResponse'
    { $sel:httpStatus:DeleteCodeSigningConfigResponse' :: Int
httpStatus =
        Int
pHttpStatus_
    }

-- | The response's http status code.
deleteCodeSigningConfigResponse_httpStatus :: Lens.Lens' DeleteCodeSigningConfigResponse Prelude.Int
deleteCodeSigningConfigResponse_httpStatus :: Lens' DeleteCodeSigningConfigResponse Int
deleteCodeSigningConfigResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteCodeSigningConfigResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteCodeSigningConfigResponse' :: DeleteCodeSigningConfigResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteCodeSigningConfigResponse
s@DeleteCodeSigningConfigResponse' {} Int
a -> DeleteCodeSigningConfigResponse
s {$sel:httpStatus:DeleteCodeSigningConfigResponse' :: Int
httpStatus = Int
a} :: DeleteCodeSigningConfigResponse)

instance
  Prelude.NFData
    DeleteCodeSigningConfigResponse
  where
  rnf :: DeleteCodeSigningConfigResponse -> ()
rnf DeleteCodeSigningConfigResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteCodeSigningConfigResponse' :: DeleteCodeSigningConfigResponse -> Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus