{-# 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.GetClassificationExportConfiguration
-- 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)
--
-- Retrieves the configuration settings for storing data classification
-- results.
module Amazonka.MacieV2.GetClassificationExportConfiguration
  ( -- * Creating a Request
    GetClassificationExportConfiguration (..),
    newGetClassificationExportConfiguration,

    -- * Destructuring the Response
    GetClassificationExportConfigurationResponse (..),
    newGetClassificationExportConfigurationResponse,

    -- * Response Lenses
    getClassificationExportConfigurationResponse_configuration,
    getClassificationExportConfigurationResponse_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:/ 'newGetClassificationExportConfiguration' smart constructor.
data GetClassificationExportConfiguration = GetClassificationExportConfiguration'
  {
  }
  deriving (GetClassificationExportConfiguration
-> GetClassificationExportConfiguration -> Bool
(GetClassificationExportConfiguration
 -> GetClassificationExportConfiguration -> Bool)
-> (GetClassificationExportConfiguration
    -> GetClassificationExportConfiguration -> Bool)
-> Eq GetClassificationExportConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetClassificationExportConfiguration
-> GetClassificationExportConfiguration -> Bool
$c/= :: GetClassificationExportConfiguration
-> GetClassificationExportConfiguration -> Bool
== :: GetClassificationExportConfiguration
-> GetClassificationExportConfiguration -> Bool
$c== :: GetClassificationExportConfiguration
-> GetClassificationExportConfiguration -> Bool
Prelude.Eq, ReadPrec [GetClassificationExportConfiguration]
ReadPrec GetClassificationExportConfiguration
Int -> ReadS GetClassificationExportConfiguration
ReadS [GetClassificationExportConfiguration]
(Int -> ReadS GetClassificationExportConfiguration)
-> ReadS [GetClassificationExportConfiguration]
-> ReadPrec GetClassificationExportConfiguration
-> ReadPrec [GetClassificationExportConfiguration]
-> Read GetClassificationExportConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetClassificationExportConfiguration]
$creadListPrec :: ReadPrec [GetClassificationExportConfiguration]
readPrec :: ReadPrec GetClassificationExportConfiguration
$creadPrec :: ReadPrec GetClassificationExportConfiguration
readList :: ReadS [GetClassificationExportConfiguration]
$creadList :: ReadS [GetClassificationExportConfiguration]
readsPrec :: Int -> ReadS GetClassificationExportConfiguration
$creadsPrec :: Int -> ReadS GetClassificationExportConfiguration
Prelude.Read, Int -> GetClassificationExportConfiguration -> ShowS
[GetClassificationExportConfiguration] -> ShowS
GetClassificationExportConfiguration -> String
(Int -> GetClassificationExportConfiguration -> ShowS)
-> (GetClassificationExportConfiguration -> String)
-> ([GetClassificationExportConfiguration] -> ShowS)
-> Show GetClassificationExportConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetClassificationExportConfiguration] -> ShowS
$cshowList :: [GetClassificationExportConfiguration] -> ShowS
show :: GetClassificationExportConfiguration -> String
$cshow :: GetClassificationExportConfiguration -> String
showsPrec :: Int -> GetClassificationExportConfiguration -> ShowS
$cshowsPrec :: Int -> GetClassificationExportConfiguration -> ShowS
Prelude.Show, (forall x.
 GetClassificationExportConfiguration
 -> Rep GetClassificationExportConfiguration x)
-> (forall x.
    Rep GetClassificationExportConfiguration x
    -> GetClassificationExportConfiguration)
-> Generic GetClassificationExportConfiguration
forall x.
Rep GetClassificationExportConfiguration x
-> GetClassificationExportConfiguration
forall x.
GetClassificationExportConfiguration
-> Rep GetClassificationExportConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetClassificationExportConfiguration x
-> GetClassificationExportConfiguration
$cfrom :: forall x.
GetClassificationExportConfiguration
-> Rep GetClassificationExportConfiguration x
Prelude.Generic)

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

instance
  Core.AWSRequest
    GetClassificationExportConfiguration
  where
  type
    AWSResponse GetClassificationExportConfiguration =
      GetClassificationExportConfigurationResponse
  request :: GetClassificationExportConfiguration
-> Request GetClassificationExportConfiguration
request = Service
-> GetClassificationExportConfiguration
-> Request GetClassificationExportConfiguration
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy GetClassificationExportConfiguration
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse GetClassificationExportConfiguration)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either
      String (AWSResponse GetClassificationExportConfiguration))
-> Logger
-> Service
-> Proxy GetClassificationExportConfiguration
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse GetClassificationExportConfiguration)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe ClassificationExportConfiguration
-> Int -> GetClassificationExportConfigurationResponse
GetClassificationExportConfigurationResponse'
            (Maybe ClassificationExportConfiguration
 -> Int -> GetClassificationExportConfigurationResponse)
-> Either String (Maybe ClassificationExportConfiguration)
-> Either
     String (Int -> GetClassificationExportConfigurationResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Key -> Either String (Maybe ClassificationExportConfiguration)
forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Core..?> Key
"configuration")
              Either String (Int -> GetClassificationExportConfigurationResponse)
-> Either String Int
-> Either String GetClassificationExportConfigurationResponse
forall (f :: * -> *) a b. Applicative f => 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
    GetClassificationExportConfiguration

instance
  Prelude.NFData
    GetClassificationExportConfiguration

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

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

-- | /See:/ 'newGetClassificationExportConfigurationResponse' smart constructor.
data GetClassificationExportConfigurationResponse = GetClassificationExportConfigurationResponse'
  { -- | The location where data classification results are stored, and the
    -- encryption settings that are used when storing results in that location.
    GetClassificationExportConfigurationResponse
-> Maybe ClassificationExportConfiguration
configuration :: Prelude.Maybe ClassificationExportConfiguration,
    -- | The response's http status code.
    GetClassificationExportConfigurationResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetClassificationExportConfigurationResponse
-> GetClassificationExportConfigurationResponse -> Bool
(GetClassificationExportConfigurationResponse
 -> GetClassificationExportConfigurationResponse -> Bool)
-> (GetClassificationExportConfigurationResponse
    -> GetClassificationExportConfigurationResponse -> Bool)
-> Eq GetClassificationExportConfigurationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetClassificationExportConfigurationResponse
-> GetClassificationExportConfigurationResponse -> Bool
$c/= :: GetClassificationExportConfigurationResponse
-> GetClassificationExportConfigurationResponse -> Bool
== :: GetClassificationExportConfigurationResponse
-> GetClassificationExportConfigurationResponse -> Bool
$c== :: GetClassificationExportConfigurationResponse
-> GetClassificationExportConfigurationResponse -> Bool
Prelude.Eq, ReadPrec [GetClassificationExportConfigurationResponse]
ReadPrec GetClassificationExportConfigurationResponse
Int -> ReadS GetClassificationExportConfigurationResponse
ReadS [GetClassificationExportConfigurationResponse]
(Int -> ReadS GetClassificationExportConfigurationResponse)
-> ReadS [GetClassificationExportConfigurationResponse]
-> ReadPrec GetClassificationExportConfigurationResponse
-> ReadPrec [GetClassificationExportConfigurationResponse]
-> Read GetClassificationExportConfigurationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetClassificationExportConfigurationResponse]
$creadListPrec :: ReadPrec [GetClassificationExportConfigurationResponse]
readPrec :: ReadPrec GetClassificationExportConfigurationResponse
$creadPrec :: ReadPrec GetClassificationExportConfigurationResponse
readList :: ReadS [GetClassificationExportConfigurationResponse]
$creadList :: ReadS [GetClassificationExportConfigurationResponse]
readsPrec :: Int -> ReadS GetClassificationExportConfigurationResponse
$creadsPrec :: Int -> ReadS GetClassificationExportConfigurationResponse
Prelude.Read, Int -> GetClassificationExportConfigurationResponse -> ShowS
[GetClassificationExportConfigurationResponse] -> ShowS
GetClassificationExportConfigurationResponse -> String
(Int -> GetClassificationExportConfigurationResponse -> ShowS)
-> (GetClassificationExportConfigurationResponse -> String)
-> ([GetClassificationExportConfigurationResponse] -> ShowS)
-> Show GetClassificationExportConfigurationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetClassificationExportConfigurationResponse] -> ShowS
$cshowList :: [GetClassificationExportConfigurationResponse] -> ShowS
show :: GetClassificationExportConfigurationResponse -> String
$cshow :: GetClassificationExportConfigurationResponse -> String
showsPrec :: Int -> GetClassificationExportConfigurationResponse -> ShowS
$cshowsPrec :: Int -> GetClassificationExportConfigurationResponse -> ShowS
Prelude.Show, (forall x.
 GetClassificationExportConfigurationResponse
 -> Rep GetClassificationExportConfigurationResponse x)
-> (forall x.
    Rep GetClassificationExportConfigurationResponse x
    -> GetClassificationExportConfigurationResponse)
-> Generic GetClassificationExportConfigurationResponse
forall x.
Rep GetClassificationExportConfigurationResponse x
-> GetClassificationExportConfigurationResponse
forall x.
GetClassificationExportConfigurationResponse
-> Rep GetClassificationExportConfigurationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetClassificationExportConfigurationResponse x
-> GetClassificationExportConfigurationResponse
$cfrom :: forall x.
GetClassificationExportConfigurationResponse
-> Rep GetClassificationExportConfigurationResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetClassificationExportConfigurationResponse' 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', 'getClassificationExportConfigurationResponse_configuration' - The location where data classification results are stored, and the
-- encryption settings that are used when storing results in that location.
--
-- 'httpStatus', 'getClassificationExportConfigurationResponse_httpStatus' - The response's http status code.
newGetClassificationExportConfigurationResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetClassificationExportConfigurationResponse
newGetClassificationExportConfigurationResponse :: Int -> GetClassificationExportConfigurationResponse
newGetClassificationExportConfigurationResponse
  Int
pHttpStatus_ =
    GetClassificationExportConfigurationResponse' :: Maybe ClassificationExportConfiguration
-> Int -> GetClassificationExportConfigurationResponse
GetClassificationExportConfigurationResponse'
      { $sel:configuration:GetClassificationExportConfigurationResponse' :: Maybe ClassificationExportConfiguration
configuration =
          Maybe ClassificationExportConfiguration
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:GetClassificationExportConfigurationResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | The location where data classification results are stored, and the
-- encryption settings that are used when storing results in that location.
getClassificationExportConfigurationResponse_configuration :: Lens.Lens' GetClassificationExportConfigurationResponse (Prelude.Maybe ClassificationExportConfiguration)
getClassificationExportConfigurationResponse_configuration :: (Maybe ClassificationExportConfiguration
 -> f (Maybe ClassificationExportConfiguration))
-> GetClassificationExportConfigurationResponse
-> f GetClassificationExportConfigurationResponse
getClassificationExportConfigurationResponse_configuration = (GetClassificationExportConfigurationResponse
 -> Maybe ClassificationExportConfiguration)
-> (GetClassificationExportConfigurationResponse
    -> Maybe ClassificationExportConfiguration
    -> GetClassificationExportConfigurationResponse)
-> Lens
     GetClassificationExportConfigurationResponse
     GetClassificationExportConfigurationResponse
     (Maybe ClassificationExportConfiguration)
     (Maybe ClassificationExportConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetClassificationExportConfigurationResponse' {Maybe ClassificationExportConfiguration
configuration :: Maybe ClassificationExportConfiguration
$sel:configuration:GetClassificationExportConfigurationResponse' :: GetClassificationExportConfigurationResponse
-> Maybe ClassificationExportConfiguration
configuration} -> Maybe ClassificationExportConfiguration
configuration) (\s :: GetClassificationExportConfigurationResponse
s@GetClassificationExportConfigurationResponse' {} Maybe ClassificationExportConfiguration
a -> GetClassificationExportConfigurationResponse
s {$sel:configuration:GetClassificationExportConfigurationResponse' :: Maybe ClassificationExportConfiguration
configuration = Maybe ClassificationExportConfiguration
a} :: GetClassificationExportConfigurationResponse)

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

instance
  Prelude.NFData
    GetClassificationExportConfigurationResponse