{-# 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.MacieV2.DisableMacie
-- 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)
--
-- Disables an Amazon Macie account and deletes Macie resources for the
-- account.
module Amazonka.MacieV2.DisableMacie
  ( -- * Creating a Request
    DisableMacie (..),
    newDisableMacie,

    -- * Destructuring the Response
    DisableMacieResponse (..),
    newDisableMacieResponse,

    -- * Response Lenses
    disableMacieResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MacieV2.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

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

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

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

instance Prelude.NFData DisableMacie

instance Core.ToHeaders DisableMacie where
  toHeaders :: DisableMacie -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DisableMacie -> 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 DisableMacie where
  toPath :: DisableMacie -> ByteString
toPath = ByteString -> DisableMacie -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/macie"

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

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

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

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

instance Prelude.NFData DisableMacieResponse