{-# 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 #-}
module Amazonka.SecurityLake.UpdateDatalakeExceptionsSubscription
(
UpdateDatalakeExceptionsSubscription (..),
newUpdateDatalakeExceptionsSubscription,
updateDatalakeExceptionsSubscription_notificationEndpoint,
updateDatalakeExceptionsSubscription_subscriptionProtocol,
UpdateDatalakeExceptionsSubscriptionResponse (..),
newUpdateDatalakeExceptionsSubscriptionResponse,
updateDatalakeExceptionsSubscriptionResponse_httpStatus,
)
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
data UpdateDatalakeExceptionsSubscription = UpdateDatalakeExceptionsSubscription'
{
UpdateDatalakeExceptionsSubscription -> Text
notificationEndpoint :: Prelude.Text,
UpdateDatalakeExceptionsSubscription -> SubscriptionProtocolType
subscriptionProtocol :: SubscriptionProtocolType
}
deriving (UpdateDatalakeExceptionsSubscription
-> UpdateDatalakeExceptionsSubscription -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateDatalakeExceptionsSubscription
-> UpdateDatalakeExceptionsSubscription -> Bool
$c/= :: UpdateDatalakeExceptionsSubscription
-> UpdateDatalakeExceptionsSubscription -> Bool
== :: UpdateDatalakeExceptionsSubscription
-> UpdateDatalakeExceptionsSubscription -> Bool
$c== :: UpdateDatalakeExceptionsSubscription
-> UpdateDatalakeExceptionsSubscription -> Bool
Prelude.Eq, ReadPrec [UpdateDatalakeExceptionsSubscription]
ReadPrec UpdateDatalakeExceptionsSubscription
Int -> ReadS UpdateDatalakeExceptionsSubscription
ReadS [UpdateDatalakeExceptionsSubscription]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateDatalakeExceptionsSubscription]
$creadListPrec :: ReadPrec [UpdateDatalakeExceptionsSubscription]
readPrec :: ReadPrec UpdateDatalakeExceptionsSubscription
$creadPrec :: ReadPrec UpdateDatalakeExceptionsSubscription
readList :: ReadS [UpdateDatalakeExceptionsSubscription]
$creadList :: ReadS [UpdateDatalakeExceptionsSubscription]
readsPrec :: Int -> ReadS UpdateDatalakeExceptionsSubscription
$creadsPrec :: Int -> ReadS UpdateDatalakeExceptionsSubscription
Prelude.Read, Int -> UpdateDatalakeExceptionsSubscription -> ShowS
[UpdateDatalakeExceptionsSubscription] -> ShowS
UpdateDatalakeExceptionsSubscription -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateDatalakeExceptionsSubscription] -> ShowS
$cshowList :: [UpdateDatalakeExceptionsSubscription] -> ShowS
show :: UpdateDatalakeExceptionsSubscription -> String
$cshow :: UpdateDatalakeExceptionsSubscription -> String
showsPrec :: Int -> UpdateDatalakeExceptionsSubscription -> ShowS
$cshowsPrec :: Int -> UpdateDatalakeExceptionsSubscription -> ShowS
Prelude.Show, forall x.
Rep UpdateDatalakeExceptionsSubscription x
-> UpdateDatalakeExceptionsSubscription
forall x.
UpdateDatalakeExceptionsSubscription
-> Rep UpdateDatalakeExceptionsSubscription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateDatalakeExceptionsSubscription x
-> UpdateDatalakeExceptionsSubscription
$cfrom :: forall x.
UpdateDatalakeExceptionsSubscription
-> Rep UpdateDatalakeExceptionsSubscription x
Prelude.Generic)
newUpdateDatalakeExceptionsSubscription ::
Prelude.Text ->
SubscriptionProtocolType ->
UpdateDatalakeExceptionsSubscription
newUpdateDatalakeExceptionsSubscription :: Text
-> SubscriptionProtocolType -> UpdateDatalakeExceptionsSubscription
newUpdateDatalakeExceptionsSubscription
Text
pNotificationEndpoint_
SubscriptionProtocolType
pSubscriptionProtocol_ =
UpdateDatalakeExceptionsSubscription'
{ $sel:notificationEndpoint:UpdateDatalakeExceptionsSubscription' :: Text
notificationEndpoint =
Text
pNotificationEndpoint_,
$sel:subscriptionProtocol:UpdateDatalakeExceptionsSubscription' :: SubscriptionProtocolType
subscriptionProtocol =
SubscriptionProtocolType
pSubscriptionProtocol_
}
updateDatalakeExceptionsSubscription_notificationEndpoint :: Lens.Lens' UpdateDatalakeExceptionsSubscription Prelude.Text
updateDatalakeExceptionsSubscription_notificationEndpoint :: Lens' UpdateDatalakeExceptionsSubscription Text
updateDatalakeExceptionsSubscription_notificationEndpoint = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDatalakeExceptionsSubscription' {Text
notificationEndpoint :: Text
$sel:notificationEndpoint:UpdateDatalakeExceptionsSubscription' :: UpdateDatalakeExceptionsSubscription -> Text
notificationEndpoint} -> Text
notificationEndpoint) (\s :: UpdateDatalakeExceptionsSubscription
s@UpdateDatalakeExceptionsSubscription' {} Text
a -> UpdateDatalakeExceptionsSubscription
s {$sel:notificationEndpoint:UpdateDatalakeExceptionsSubscription' :: Text
notificationEndpoint = Text
a} :: UpdateDatalakeExceptionsSubscription)
updateDatalakeExceptionsSubscription_subscriptionProtocol :: Lens.Lens' UpdateDatalakeExceptionsSubscription SubscriptionProtocolType
updateDatalakeExceptionsSubscription_subscriptionProtocol :: Lens' UpdateDatalakeExceptionsSubscription SubscriptionProtocolType
updateDatalakeExceptionsSubscription_subscriptionProtocol = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDatalakeExceptionsSubscription' {SubscriptionProtocolType
subscriptionProtocol :: SubscriptionProtocolType
$sel:subscriptionProtocol:UpdateDatalakeExceptionsSubscription' :: UpdateDatalakeExceptionsSubscription -> SubscriptionProtocolType
subscriptionProtocol} -> SubscriptionProtocolType
subscriptionProtocol) (\s :: UpdateDatalakeExceptionsSubscription
s@UpdateDatalakeExceptionsSubscription' {} SubscriptionProtocolType
a -> UpdateDatalakeExceptionsSubscription
s {$sel:subscriptionProtocol:UpdateDatalakeExceptionsSubscription' :: SubscriptionProtocolType
subscriptionProtocol = SubscriptionProtocolType
a} :: UpdateDatalakeExceptionsSubscription)
instance
Core.AWSRequest
UpdateDatalakeExceptionsSubscription
where
type
AWSResponse UpdateDatalakeExceptionsSubscription =
UpdateDatalakeExceptionsSubscriptionResponse
request :: (Service -> Service)
-> UpdateDatalakeExceptionsSubscription
-> Request UpdateDatalakeExceptionsSubscription
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy UpdateDatalakeExceptionsSubscription
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse
(AWSResponse UpdateDatalakeExceptionsSubscription)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> UpdateDatalakeExceptionsSubscriptionResponse
UpdateDatalakeExceptionsSubscriptionResponse'
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))
)
instance
Prelude.Hashable
UpdateDatalakeExceptionsSubscription
where
hashWithSalt :: Int -> UpdateDatalakeExceptionsSubscription -> Int
hashWithSalt
Int
_salt
UpdateDatalakeExceptionsSubscription' {Text
SubscriptionProtocolType
subscriptionProtocol :: SubscriptionProtocolType
notificationEndpoint :: Text
$sel:subscriptionProtocol:UpdateDatalakeExceptionsSubscription' :: UpdateDatalakeExceptionsSubscription -> SubscriptionProtocolType
$sel:notificationEndpoint:UpdateDatalakeExceptionsSubscription' :: UpdateDatalakeExceptionsSubscription -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
notificationEndpoint
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` SubscriptionProtocolType
subscriptionProtocol
instance
Prelude.NFData
UpdateDatalakeExceptionsSubscription
where
rnf :: UpdateDatalakeExceptionsSubscription -> ()
rnf UpdateDatalakeExceptionsSubscription' {Text
SubscriptionProtocolType
subscriptionProtocol :: SubscriptionProtocolType
notificationEndpoint :: Text
$sel:subscriptionProtocol:UpdateDatalakeExceptionsSubscription' :: UpdateDatalakeExceptionsSubscription -> SubscriptionProtocolType
$sel:notificationEndpoint:UpdateDatalakeExceptionsSubscription' :: UpdateDatalakeExceptionsSubscription -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
notificationEndpoint
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf SubscriptionProtocolType
subscriptionProtocol
instance
Data.ToHeaders
UpdateDatalakeExceptionsSubscription
where
toHeaders :: UpdateDatalakeExceptionsSubscription -> 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.ToJSON
UpdateDatalakeExceptionsSubscription
where
toJSON :: UpdateDatalakeExceptionsSubscription -> Value
toJSON UpdateDatalakeExceptionsSubscription' {Text
SubscriptionProtocolType
subscriptionProtocol :: SubscriptionProtocolType
notificationEndpoint :: Text
$sel:subscriptionProtocol:UpdateDatalakeExceptionsSubscription' :: UpdateDatalakeExceptionsSubscription -> SubscriptionProtocolType
$sel:notificationEndpoint:UpdateDatalakeExceptionsSubscription' :: UpdateDatalakeExceptionsSubscription -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just
( Key
"notificationEndpoint"
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
notificationEndpoint
),
forall a. a -> Maybe a
Prelude.Just
( Key
"subscriptionProtocol"
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= SubscriptionProtocolType
subscriptionProtocol
)
]
)
instance
Data.ToPath
UpdateDatalakeExceptionsSubscription
where
toPath :: UpdateDatalakeExceptionsSubscription -> ByteString
toPath =
forall a b. a -> b -> a
Prelude.const
ByteString
"/v1/datalake/exceptions/subscription"
instance
Data.ToQuery
UpdateDatalakeExceptionsSubscription
where
toQuery :: UpdateDatalakeExceptionsSubscription -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data UpdateDatalakeExceptionsSubscriptionResponse = UpdateDatalakeExceptionsSubscriptionResponse'
{
UpdateDatalakeExceptionsSubscriptionResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateDatalakeExceptionsSubscriptionResponse
-> UpdateDatalakeExceptionsSubscriptionResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateDatalakeExceptionsSubscriptionResponse
-> UpdateDatalakeExceptionsSubscriptionResponse -> Bool
$c/= :: UpdateDatalakeExceptionsSubscriptionResponse
-> UpdateDatalakeExceptionsSubscriptionResponse -> Bool
== :: UpdateDatalakeExceptionsSubscriptionResponse
-> UpdateDatalakeExceptionsSubscriptionResponse -> Bool
$c== :: UpdateDatalakeExceptionsSubscriptionResponse
-> UpdateDatalakeExceptionsSubscriptionResponse -> Bool
Prelude.Eq, ReadPrec [UpdateDatalakeExceptionsSubscriptionResponse]
ReadPrec UpdateDatalakeExceptionsSubscriptionResponse
Int -> ReadS UpdateDatalakeExceptionsSubscriptionResponse
ReadS [UpdateDatalakeExceptionsSubscriptionResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateDatalakeExceptionsSubscriptionResponse]
$creadListPrec :: ReadPrec [UpdateDatalakeExceptionsSubscriptionResponse]
readPrec :: ReadPrec UpdateDatalakeExceptionsSubscriptionResponse
$creadPrec :: ReadPrec UpdateDatalakeExceptionsSubscriptionResponse
readList :: ReadS [UpdateDatalakeExceptionsSubscriptionResponse]
$creadList :: ReadS [UpdateDatalakeExceptionsSubscriptionResponse]
readsPrec :: Int -> ReadS UpdateDatalakeExceptionsSubscriptionResponse
$creadsPrec :: Int -> ReadS UpdateDatalakeExceptionsSubscriptionResponse
Prelude.Read, Int -> UpdateDatalakeExceptionsSubscriptionResponse -> ShowS
[UpdateDatalakeExceptionsSubscriptionResponse] -> ShowS
UpdateDatalakeExceptionsSubscriptionResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateDatalakeExceptionsSubscriptionResponse] -> ShowS
$cshowList :: [UpdateDatalakeExceptionsSubscriptionResponse] -> ShowS
show :: UpdateDatalakeExceptionsSubscriptionResponse -> String
$cshow :: UpdateDatalakeExceptionsSubscriptionResponse -> String
showsPrec :: Int -> UpdateDatalakeExceptionsSubscriptionResponse -> ShowS
$cshowsPrec :: Int -> UpdateDatalakeExceptionsSubscriptionResponse -> ShowS
Prelude.Show, forall x.
Rep UpdateDatalakeExceptionsSubscriptionResponse x
-> UpdateDatalakeExceptionsSubscriptionResponse
forall x.
UpdateDatalakeExceptionsSubscriptionResponse
-> Rep UpdateDatalakeExceptionsSubscriptionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateDatalakeExceptionsSubscriptionResponse x
-> UpdateDatalakeExceptionsSubscriptionResponse
$cfrom :: forall x.
UpdateDatalakeExceptionsSubscriptionResponse
-> Rep UpdateDatalakeExceptionsSubscriptionResponse x
Prelude.Generic)
newUpdateDatalakeExceptionsSubscriptionResponse ::
Prelude.Int ->
UpdateDatalakeExceptionsSubscriptionResponse
newUpdateDatalakeExceptionsSubscriptionResponse :: Int -> UpdateDatalakeExceptionsSubscriptionResponse
newUpdateDatalakeExceptionsSubscriptionResponse
Int
pHttpStatus_ =
UpdateDatalakeExceptionsSubscriptionResponse'
{ $sel:httpStatus:UpdateDatalakeExceptionsSubscriptionResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
updateDatalakeExceptionsSubscriptionResponse_httpStatus :: Lens.Lens' UpdateDatalakeExceptionsSubscriptionResponse Prelude.Int
updateDatalakeExceptionsSubscriptionResponse_httpStatus :: Lens' UpdateDatalakeExceptionsSubscriptionResponse Int
updateDatalakeExceptionsSubscriptionResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDatalakeExceptionsSubscriptionResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateDatalakeExceptionsSubscriptionResponse' :: UpdateDatalakeExceptionsSubscriptionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateDatalakeExceptionsSubscriptionResponse
s@UpdateDatalakeExceptionsSubscriptionResponse' {} Int
a -> UpdateDatalakeExceptionsSubscriptionResponse
s {$sel:httpStatus:UpdateDatalakeExceptionsSubscriptionResponse' :: Int
httpStatus = Int
a} :: UpdateDatalakeExceptionsSubscriptionResponse)
instance
Prelude.NFData
UpdateDatalakeExceptionsSubscriptionResponse
where
rnf :: UpdateDatalakeExceptionsSubscriptionResponse -> ()
rnf UpdateDatalakeExceptionsSubscriptionResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateDatalakeExceptionsSubscriptionResponse' :: UpdateDatalakeExceptionsSubscriptionResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus