{-# 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-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 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 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:/ '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
(DeleteCodeSigningConfig -> DeleteCodeSigningConfig -> Bool)
-> (DeleteCodeSigningConfig -> DeleteCodeSigningConfig -> Bool)
-> Eq DeleteCodeSigningConfig
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]
(Int -> ReadS DeleteCodeSigningConfig)
-> ReadS [DeleteCodeSigningConfig]
-> ReadPrec DeleteCodeSigningConfig
-> ReadPrec [DeleteCodeSigningConfig]
-> Read 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
(Int -> DeleteCodeSigningConfig -> ShowS)
-> (DeleteCodeSigningConfig -> String)
-> ([DeleteCodeSigningConfig] -> ShowS)
-> Show DeleteCodeSigningConfig
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.
 DeleteCodeSigningConfig -> Rep DeleteCodeSigningConfig x)
-> (forall x.
    Rep DeleteCodeSigningConfig x -> DeleteCodeSigningConfig)
-> Generic DeleteCodeSigningConfig
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' :: Text -> DeleteCodeSigningConfig
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 :: (Text -> f Text)
-> DeleteCodeSigningConfig -> f DeleteCodeSigningConfig
deleteCodeSigningConfig_codeSigningConfigArn = (DeleteCodeSigningConfig -> Text)
-> (DeleteCodeSigningConfig -> Text -> DeleteCodeSigningConfig)
-> Lens DeleteCodeSigningConfig DeleteCodeSigningConfig Text Text
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 :: DeleteCodeSigningConfig -> Request DeleteCodeSigningConfig
request = Service
-> DeleteCodeSigningConfig -> Request DeleteCodeSigningConfig
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
  response :: Logger
-> Service
-> Proxy DeleteCodeSigningConfig
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteCodeSigningConfig)))
response =
    (Int
 -> ResponseHeaders
 -> ()
 -> Either String (AWSResponse DeleteCodeSigningConfig))
-> Logger
-> Service
-> Proxy DeleteCodeSigningConfig
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteCodeSigningConfig)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
      ( \Int
s ResponseHeaders
h ()
x ->
          Int -> DeleteCodeSigningConfigResponse
DeleteCodeSigningConfigResponse'
            (Int -> DeleteCodeSigningConfigResponse)
-> Either String Int
-> Either String DeleteCodeSigningConfigResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable DeleteCodeSigningConfig

instance Prelude.NFData DeleteCodeSigningConfig

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

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

instance Core.ToQuery DeleteCodeSigningConfig where
  toQuery :: DeleteCodeSigningConfig -> QueryString
toQuery = QueryString -> DeleteCodeSigningConfig -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
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
(DeleteCodeSigningConfigResponse
 -> DeleteCodeSigningConfigResponse -> Bool)
-> (DeleteCodeSigningConfigResponse
    -> DeleteCodeSigningConfigResponse -> Bool)
-> Eq DeleteCodeSigningConfigResponse
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]
(Int -> ReadS DeleteCodeSigningConfigResponse)
-> ReadS [DeleteCodeSigningConfigResponse]
-> ReadPrec DeleteCodeSigningConfigResponse
-> ReadPrec [DeleteCodeSigningConfigResponse]
-> Read 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
(Int -> DeleteCodeSigningConfigResponse -> ShowS)
-> (DeleteCodeSigningConfigResponse -> String)
-> ([DeleteCodeSigningConfigResponse] -> ShowS)
-> Show DeleteCodeSigningConfigResponse
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.
 DeleteCodeSigningConfigResponse
 -> Rep DeleteCodeSigningConfigResponse x)
-> (forall x.
    Rep DeleteCodeSigningConfigResponse x
    -> DeleteCodeSigningConfigResponse)
-> Generic DeleteCodeSigningConfigResponse
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' :: Int -> DeleteCodeSigningConfigResponse
DeleteCodeSigningConfigResponse'
    { $sel:httpStatus:DeleteCodeSigningConfigResponse' :: Int
httpStatus =
        Int
pHttpStatus_
    }

-- | The response's http status code.
deleteCodeSigningConfigResponse_httpStatus :: Lens.Lens' DeleteCodeSigningConfigResponse Prelude.Int
deleteCodeSigningConfigResponse_httpStatus :: (Int -> f Int)
-> DeleteCodeSigningConfigResponse
-> f DeleteCodeSigningConfigResponse
deleteCodeSigningConfigResponse_httpStatus = (DeleteCodeSigningConfigResponse -> Int)
-> (DeleteCodeSigningConfigResponse
    -> Int -> DeleteCodeSigningConfigResponse)
-> Lens
     DeleteCodeSigningConfigResponse
     DeleteCodeSigningConfigResponse
     Int
     Int
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