{-# 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.SecurityLake.GetDatalakeExceptionsSubscription
-- 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 details of exception notifications for the account in
-- Amazon Security Lake.
module Amazonka.SecurityLake.GetDatalakeExceptionsSubscription
  ( -- * Creating a Request
    GetDatalakeExceptionsSubscription (..),
    newGetDatalakeExceptionsSubscription,

    -- * Destructuring the Response
    GetDatalakeExceptionsSubscriptionResponse (..),
    newGetDatalakeExceptionsSubscriptionResponse,

    -- * Response Lenses
    getDatalakeExceptionsSubscriptionResponse_httpStatus,
    getDatalakeExceptionsSubscriptionResponse_protocolAndNotificationEndpoint,
  )
where

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

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

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

instance
  Core.AWSRequest
    GetDatalakeExceptionsSubscription
  where
  type
    AWSResponse GetDatalakeExceptionsSubscription =
      GetDatalakeExceptionsSubscriptionResponse
  request :: (Service -> Service)
-> GetDatalakeExceptionsSubscription
-> Request GetDatalakeExceptionsSubscription
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 GetDatalakeExceptionsSubscription
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse GetDatalakeExceptionsSubscription)))
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 ->
          Int
-> ProtocolAndNotificationEndpoint
-> GetDatalakeExceptionsSubscriptionResponse
GetDatalakeExceptionsSubscriptionResponse'
            forall (f :: * -> *) a b. Functor 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))
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"protocolAndNotificationEndpoint")
      )

instance
  Prelude.Hashable
    GetDatalakeExceptionsSubscription
  where
  hashWithSalt :: Int -> GetDatalakeExceptionsSubscription -> Int
hashWithSalt Int
_salt GetDatalakeExceptionsSubscription
_ =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ()

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

instance
  Data.ToHeaders
    GetDatalakeExceptionsSubscription
  where
  toHeaders :: GetDatalakeExceptionsSubscription -> 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
    GetDatalakeExceptionsSubscription
  where
  toPath :: GetDatalakeExceptionsSubscription -> ByteString
toPath =
    forall a b. a -> b -> a
Prelude.const
      ByteString
"/v1/datalake/exceptions/subscription"

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

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

-- |
-- Create a value of 'GetDatalakeExceptionsSubscriptionResponse' 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', 'getDatalakeExceptionsSubscriptionResponse_httpStatus' - The response's http status code.
--
-- 'protocolAndNotificationEndpoint', 'getDatalakeExceptionsSubscriptionResponse_protocolAndNotificationEndpoint' - Retrieves the exception notification subscription information.
newGetDatalakeExceptionsSubscriptionResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'protocolAndNotificationEndpoint'
  ProtocolAndNotificationEndpoint ->
  GetDatalakeExceptionsSubscriptionResponse
newGetDatalakeExceptionsSubscriptionResponse :: Int
-> ProtocolAndNotificationEndpoint
-> GetDatalakeExceptionsSubscriptionResponse
newGetDatalakeExceptionsSubscriptionResponse
  Int
pHttpStatus_
  ProtocolAndNotificationEndpoint
pProtocolAndNotificationEndpoint_ =
    GetDatalakeExceptionsSubscriptionResponse'
      { $sel:httpStatus:GetDatalakeExceptionsSubscriptionResponse' :: Int
httpStatus =
          Int
pHttpStatus_,
        $sel:protocolAndNotificationEndpoint:GetDatalakeExceptionsSubscriptionResponse' :: ProtocolAndNotificationEndpoint
protocolAndNotificationEndpoint =
          ProtocolAndNotificationEndpoint
pProtocolAndNotificationEndpoint_
      }

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

-- | Retrieves the exception notification subscription information.
getDatalakeExceptionsSubscriptionResponse_protocolAndNotificationEndpoint :: Lens.Lens' GetDatalakeExceptionsSubscriptionResponse ProtocolAndNotificationEndpoint
getDatalakeExceptionsSubscriptionResponse_protocolAndNotificationEndpoint :: Lens'
  GetDatalakeExceptionsSubscriptionResponse
  ProtocolAndNotificationEndpoint
getDatalakeExceptionsSubscriptionResponse_protocolAndNotificationEndpoint = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDatalakeExceptionsSubscriptionResponse' {ProtocolAndNotificationEndpoint
protocolAndNotificationEndpoint :: ProtocolAndNotificationEndpoint
$sel:protocolAndNotificationEndpoint:GetDatalakeExceptionsSubscriptionResponse' :: GetDatalakeExceptionsSubscriptionResponse
-> ProtocolAndNotificationEndpoint
protocolAndNotificationEndpoint} -> ProtocolAndNotificationEndpoint
protocolAndNotificationEndpoint) (\s :: GetDatalakeExceptionsSubscriptionResponse
s@GetDatalakeExceptionsSubscriptionResponse' {} ProtocolAndNotificationEndpoint
a -> GetDatalakeExceptionsSubscriptionResponse
s {$sel:protocolAndNotificationEndpoint:GetDatalakeExceptionsSubscriptionResponse' :: ProtocolAndNotificationEndpoint
protocolAndNotificationEndpoint = ProtocolAndNotificationEndpoint
a} :: GetDatalakeExceptionsSubscriptionResponse)

instance
  Prelude.NFData
    GetDatalakeExceptionsSubscriptionResponse
  where
  rnf :: GetDatalakeExceptionsSubscriptionResponse -> ()
rnf GetDatalakeExceptionsSubscriptionResponse' {Int
ProtocolAndNotificationEndpoint
protocolAndNotificationEndpoint :: ProtocolAndNotificationEndpoint
httpStatus :: Int
$sel:protocolAndNotificationEndpoint:GetDatalakeExceptionsSubscriptionResponse' :: GetDatalakeExceptionsSubscriptionResponse
-> ProtocolAndNotificationEndpoint
$sel:httpStatus:GetDatalakeExceptionsSubscriptionResponse' :: GetDatalakeExceptionsSubscriptionResponse -> Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ProtocolAndNotificationEndpoint
protocolAndNotificationEndpoint