{-# 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.GetDatalakeExceptionsExpiry
-- 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 expiration period and time-to-live (TTL) for which the
-- exception message will remain. Exceptions are stored by default, for 2
-- weeks from when a record was created in Amazon Security Lake. This API
-- does not take input parameters.
module Amazonka.SecurityLake.GetDatalakeExceptionsExpiry
  ( -- * Creating a Request
    GetDatalakeExceptionsExpiry (..),
    newGetDatalakeExceptionsExpiry,

    -- * Destructuring the Response
    GetDatalakeExceptionsExpiryResponse (..),
    newGetDatalakeExceptionsExpiryResponse,

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

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

instance Core.AWSRequest GetDatalakeExceptionsExpiry where
  type
    AWSResponse GetDatalakeExceptionsExpiry =
      GetDatalakeExceptionsExpiryResponse
  request :: (Service -> Service)
-> GetDatalakeExceptionsExpiry
-> Request GetDatalakeExceptionsExpiry
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 GetDatalakeExceptionsExpiry
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetDatalakeExceptionsExpiry)))
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 -> Integer -> GetDatalakeExceptionsExpiryResponse
GetDatalakeExceptionsExpiryResponse'
            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
"exceptionMessageExpiry")
      )

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

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

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

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

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

-- |
-- Create a value of 'GetDatalakeExceptionsExpiryResponse' 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', 'getDatalakeExceptionsExpiryResponse_httpStatus' - The response's http status code.
--
-- 'exceptionMessageExpiry', 'getDatalakeExceptionsExpiryResponse_exceptionMessageExpiry' - The expiration period and time-to-live (TTL).
newGetDatalakeExceptionsExpiryResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'exceptionMessageExpiry'
  Prelude.Integer ->
  GetDatalakeExceptionsExpiryResponse
newGetDatalakeExceptionsExpiryResponse :: Int -> Integer -> GetDatalakeExceptionsExpiryResponse
newGetDatalakeExceptionsExpiryResponse
  Int
pHttpStatus_
  Integer
pExceptionMessageExpiry_ =
    GetDatalakeExceptionsExpiryResponse'
      { $sel:httpStatus:GetDatalakeExceptionsExpiryResponse' :: Int
httpStatus =
          Int
pHttpStatus_,
        $sel:exceptionMessageExpiry:GetDatalakeExceptionsExpiryResponse' :: Integer
exceptionMessageExpiry =
          Integer
pExceptionMessageExpiry_
      }

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

-- | The expiration period and time-to-live (TTL).
getDatalakeExceptionsExpiryResponse_exceptionMessageExpiry :: Lens.Lens' GetDatalakeExceptionsExpiryResponse Prelude.Integer
getDatalakeExceptionsExpiryResponse_exceptionMessageExpiry :: Lens' GetDatalakeExceptionsExpiryResponse Integer
getDatalakeExceptionsExpiryResponse_exceptionMessageExpiry = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDatalakeExceptionsExpiryResponse' {Integer
exceptionMessageExpiry :: Integer
$sel:exceptionMessageExpiry:GetDatalakeExceptionsExpiryResponse' :: GetDatalakeExceptionsExpiryResponse -> Integer
exceptionMessageExpiry} -> Integer
exceptionMessageExpiry) (\s :: GetDatalakeExceptionsExpiryResponse
s@GetDatalakeExceptionsExpiryResponse' {} Integer
a -> GetDatalakeExceptionsExpiryResponse
s {$sel:exceptionMessageExpiry:GetDatalakeExceptionsExpiryResponse' :: Integer
exceptionMessageExpiry = Integer
a} :: GetDatalakeExceptionsExpiryResponse)

instance
  Prelude.NFData
    GetDatalakeExceptionsExpiryResponse
  where
  rnf :: GetDatalakeExceptionsExpiryResponse -> ()
rnf GetDatalakeExceptionsExpiryResponse' {Int
Integer
exceptionMessageExpiry :: Integer
httpStatus :: Int
$sel:exceptionMessageExpiry:GetDatalakeExceptionsExpiryResponse' :: GetDatalakeExceptionsExpiryResponse -> Integer
$sel:httpStatus:GetDatalakeExceptionsExpiryResponse' :: GetDatalakeExceptionsExpiryResponse -> 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 Integer
exceptionMessageExpiry