{-# 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.GetRevealConfiguration
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Retrieves the status and configuration settings for retrieving
-- occurrences of sensitive data reported by findings.
module Amazonka.MacieV2.GetRevealConfiguration
  ( -- * Creating a Request
    GetRevealConfiguration (..),
    newGetRevealConfiguration,

    -- * Destructuring the Response
    GetRevealConfigurationResponse (..),
    newGetRevealConfigurationResponse,

    -- * Response Lenses
    getRevealConfigurationResponse_configuration,
    getRevealConfigurationResponse_httpStatus,
  )
where

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

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

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

instance Core.AWSRequest GetRevealConfiguration where
  type
    AWSResponse GetRevealConfiguration =
      GetRevealConfigurationResponse
  request :: (Service -> Service)
-> GetRevealConfiguration -> Request GetRevealConfiguration
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy GetRevealConfiguration
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetRevealConfiguration)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe RevealConfiguration -> Int -> GetRevealConfigurationResponse
GetRevealConfigurationResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"configuration")
            forall (f :: * -> *) a b. Applicative f => 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 GetRevealConfiguration where
  hashWithSalt :: Int -> GetRevealConfiguration -> Int
hashWithSalt Int
_salt GetRevealConfiguration
_ =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ()

instance Prelude.NFData GetRevealConfiguration where
  rnf :: GetRevealConfiguration -> ()
rnf GetRevealConfiguration
_ = ()

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

instance Data.ToPath GetRevealConfiguration where
  toPath :: GetRevealConfiguration -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/reveal-configuration"

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

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

-- |
-- Create a value of 'GetRevealConfigurationResponse' 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:
--
-- 'configuration', 'getRevealConfigurationResponse_configuration' - The current configuration settings and the status of the configuration
-- for the account.
--
-- 'httpStatus', 'getRevealConfigurationResponse_httpStatus' - The response's http status code.
newGetRevealConfigurationResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetRevealConfigurationResponse
newGetRevealConfigurationResponse :: Int -> GetRevealConfigurationResponse
newGetRevealConfigurationResponse Int
pHttpStatus_ =
  GetRevealConfigurationResponse'
    { $sel:configuration:GetRevealConfigurationResponse' :: Maybe RevealConfiguration
configuration =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetRevealConfigurationResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The current configuration settings and the status of the configuration
-- for the account.
getRevealConfigurationResponse_configuration :: Lens.Lens' GetRevealConfigurationResponse (Prelude.Maybe RevealConfiguration)
getRevealConfigurationResponse_configuration :: Lens' GetRevealConfigurationResponse (Maybe RevealConfiguration)
getRevealConfigurationResponse_configuration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRevealConfigurationResponse' {Maybe RevealConfiguration
configuration :: Maybe RevealConfiguration
$sel:configuration:GetRevealConfigurationResponse' :: GetRevealConfigurationResponse -> Maybe RevealConfiguration
configuration} -> Maybe RevealConfiguration
configuration) (\s :: GetRevealConfigurationResponse
s@GetRevealConfigurationResponse' {} Maybe RevealConfiguration
a -> GetRevealConfigurationResponse
s {$sel:configuration:GetRevealConfigurationResponse' :: Maybe RevealConfiguration
configuration = Maybe RevealConfiguration
a} :: GetRevealConfigurationResponse)

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

instance
  Prelude.NFData
    GetRevealConfigurationResponse
  where
  rnf :: GetRevealConfigurationResponse -> ()
rnf GetRevealConfigurationResponse' {Int
Maybe RevealConfiguration
httpStatus :: Int
configuration :: Maybe RevealConfiguration
$sel:httpStatus:GetRevealConfigurationResponse' :: GetRevealConfigurationResponse -> Int
$sel:configuration:GetRevealConfigurationResponse' :: GetRevealConfigurationResponse -> Maybe RevealConfiguration
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe RevealConfiguration
configuration
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus