{-# 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.AuditManager.DeleteAssessmentFramework
-- 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 a custom framework in Audit Manager.
module Amazonka.AuditManager.DeleteAssessmentFramework
  ( -- * Creating a Request
    DeleteAssessmentFramework (..),
    newDeleteAssessmentFramework,

    -- * Request Lenses
    deleteAssessmentFramework_frameworkId,

    -- * Destructuring the Response
    DeleteAssessmentFrameworkResponse (..),
    newDeleteAssessmentFrameworkResponse,

    -- * Response Lenses
    deleteAssessmentFrameworkResponse_httpStatus,
  )
where

import Amazonka.AuditManager.Types
import qualified Amazonka.Core as Core
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:/ 'newDeleteAssessmentFramework' smart constructor.
data DeleteAssessmentFramework = DeleteAssessmentFramework'
  { -- | The identifier for the specified framework.
    DeleteAssessmentFramework -> Text
frameworkId :: Prelude.Text
  }
  deriving (DeleteAssessmentFramework -> DeleteAssessmentFramework -> Bool
(DeleteAssessmentFramework -> DeleteAssessmentFramework -> Bool)
-> (DeleteAssessmentFramework -> DeleteAssessmentFramework -> Bool)
-> Eq DeleteAssessmentFramework
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteAssessmentFramework -> DeleteAssessmentFramework -> Bool
$c/= :: DeleteAssessmentFramework -> DeleteAssessmentFramework -> Bool
== :: DeleteAssessmentFramework -> DeleteAssessmentFramework -> Bool
$c== :: DeleteAssessmentFramework -> DeleteAssessmentFramework -> Bool
Prelude.Eq, ReadPrec [DeleteAssessmentFramework]
ReadPrec DeleteAssessmentFramework
Int -> ReadS DeleteAssessmentFramework
ReadS [DeleteAssessmentFramework]
(Int -> ReadS DeleteAssessmentFramework)
-> ReadS [DeleteAssessmentFramework]
-> ReadPrec DeleteAssessmentFramework
-> ReadPrec [DeleteAssessmentFramework]
-> Read DeleteAssessmentFramework
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteAssessmentFramework]
$creadListPrec :: ReadPrec [DeleteAssessmentFramework]
readPrec :: ReadPrec DeleteAssessmentFramework
$creadPrec :: ReadPrec DeleteAssessmentFramework
readList :: ReadS [DeleteAssessmentFramework]
$creadList :: ReadS [DeleteAssessmentFramework]
readsPrec :: Int -> ReadS DeleteAssessmentFramework
$creadsPrec :: Int -> ReadS DeleteAssessmentFramework
Prelude.Read, Int -> DeleteAssessmentFramework -> ShowS
[DeleteAssessmentFramework] -> ShowS
DeleteAssessmentFramework -> String
(Int -> DeleteAssessmentFramework -> ShowS)
-> (DeleteAssessmentFramework -> String)
-> ([DeleteAssessmentFramework] -> ShowS)
-> Show DeleteAssessmentFramework
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteAssessmentFramework] -> ShowS
$cshowList :: [DeleteAssessmentFramework] -> ShowS
show :: DeleteAssessmentFramework -> String
$cshow :: DeleteAssessmentFramework -> String
showsPrec :: Int -> DeleteAssessmentFramework -> ShowS
$cshowsPrec :: Int -> DeleteAssessmentFramework -> ShowS
Prelude.Show, (forall x.
 DeleteAssessmentFramework -> Rep DeleteAssessmentFramework x)
-> (forall x.
    Rep DeleteAssessmentFramework x -> DeleteAssessmentFramework)
-> Generic DeleteAssessmentFramework
forall x.
Rep DeleteAssessmentFramework x -> DeleteAssessmentFramework
forall x.
DeleteAssessmentFramework -> Rep DeleteAssessmentFramework x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteAssessmentFramework x -> DeleteAssessmentFramework
$cfrom :: forall x.
DeleteAssessmentFramework -> Rep DeleteAssessmentFramework x
Prelude.Generic)

-- |
-- Create a value of 'DeleteAssessmentFramework' 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:
--
-- 'frameworkId', 'deleteAssessmentFramework_frameworkId' - The identifier for the specified framework.
newDeleteAssessmentFramework ::
  -- | 'frameworkId'
  Prelude.Text ->
  DeleteAssessmentFramework
newDeleteAssessmentFramework :: Text -> DeleteAssessmentFramework
newDeleteAssessmentFramework Text
pFrameworkId_ =
  DeleteAssessmentFramework' :: Text -> DeleteAssessmentFramework
DeleteAssessmentFramework'
    { $sel:frameworkId:DeleteAssessmentFramework' :: Text
frameworkId =
        Text
pFrameworkId_
    }

-- | The identifier for the specified framework.
deleteAssessmentFramework_frameworkId :: Lens.Lens' DeleteAssessmentFramework Prelude.Text
deleteAssessmentFramework_frameworkId :: (Text -> f Text)
-> DeleteAssessmentFramework -> f DeleteAssessmentFramework
deleteAssessmentFramework_frameworkId = (DeleteAssessmentFramework -> Text)
-> (DeleteAssessmentFramework -> Text -> DeleteAssessmentFramework)
-> Lens
     DeleteAssessmentFramework DeleteAssessmentFramework Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteAssessmentFramework' {Text
frameworkId :: Text
$sel:frameworkId:DeleteAssessmentFramework' :: DeleteAssessmentFramework -> Text
frameworkId} -> Text
frameworkId) (\s :: DeleteAssessmentFramework
s@DeleteAssessmentFramework' {} Text
a -> DeleteAssessmentFramework
s {$sel:frameworkId:DeleteAssessmentFramework' :: Text
frameworkId = Text
a} :: DeleteAssessmentFramework)

instance Core.AWSRequest DeleteAssessmentFramework where
  type
    AWSResponse DeleteAssessmentFramework =
      DeleteAssessmentFrameworkResponse
  request :: DeleteAssessmentFramework -> Request DeleteAssessmentFramework
request = Service
-> DeleteAssessmentFramework -> Request DeleteAssessmentFramework
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
  response :: Logger
-> Service
-> Proxy DeleteAssessmentFramework
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteAssessmentFramework)))
response =
    (Int
 -> ResponseHeaders
 -> ()
 -> Either String (AWSResponse DeleteAssessmentFramework))
-> Logger
-> Service
-> Proxy DeleteAssessmentFramework
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteAssessmentFramework)))
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 -> DeleteAssessmentFrameworkResponse
DeleteAssessmentFrameworkResponse'
            (Int -> DeleteAssessmentFrameworkResponse)
-> Either String Int
-> Either String DeleteAssessmentFrameworkResponse
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 DeleteAssessmentFramework

instance Prelude.NFData DeleteAssessmentFramework

instance Core.ToHeaders DeleteAssessmentFramework where
  toHeaders :: DeleteAssessmentFramework -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DeleteAssessmentFramework -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToPath DeleteAssessmentFramework where
  toPath :: DeleteAssessmentFramework -> ByteString
toPath DeleteAssessmentFramework' {Text
frameworkId :: Text
$sel:frameworkId:DeleteAssessmentFramework' :: DeleteAssessmentFramework -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/assessmentFrameworks/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
frameworkId]

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

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

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

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

instance
  Prelude.NFData
    DeleteAssessmentFrameworkResponse