{-# 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.S3.GetBucketNotificationConfiguration
(
GetBucketNotificationConfiguration (..),
newGetBucketNotificationConfiguration,
getBucketNotificationConfiguration_expectedBucketOwner,
getBucketNotificationConfiguration_bucket,
NotificationConfiguration (..),
newNotificationConfiguration,
notificationConfiguration_eventBridgeConfiguration,
notificationConfiguration_lambdaFunctionConfigurations,
notificationConfiguration_queueConfigurations,
notificationConfiguration_topicConfigurations,
)
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.S3.Types
data GetBucketNotificationConfiguration = GetBucketNotificationConfiguration'
{
GetBucketNotificationConfiguration -> Maybe Text
expectedBucketOwner :: Prelude.Maybe Prelude.Text,
GetBucketNotificationConfiguration -> BucketName
bucket :: BucketName
}
deriving (GetBucketNotificationConfiguration
-> GetBucketNotificationConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetBucketNotificationConfiguration
-> GetBucketNotificationConfiguration -> Bool
$c/= :: GetBucketNotificationConfiguration
-> GetBucketNotificationConfiguration -> Bool
== :: GetBucketNotificationConfiguration
-> GetBucketNotificationConfiguration -> Bool
$c== :: GetBucketNotificationConfiguration
-> GetBucketNotificationConfiguration -> Bool
Prelude.Eq, ReadPrec [GetBucketNotificationConfiguration]
ReadPrec GetBucketNotificationConfiguration
Int -> ReadS GetBucketNotificationConfiguration
ReadS [GetBucketNotificationConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetBucketNotificationConfiguration]
$creadListPrec :: ReadPrec [GetBucketNotificationConfiguration]
readPrec :: ReadPrec GetBucketNotificationConfiguration
$creadPrec :: ReadPrec GetBucketNotificationConfiguration
readList :: ReadS [GetBucketNotificationConfiguration]
$creadList :: ReadS [GetBucketNotificationConfiguration]
readsPrec :: Int -> ReadS GetBucketNotificationConfiguration
$creadsPrec :: Int -> ReadS GetBucketNotificationConfiguration
Prelude.Read, Int -> GetBucketNotificationConfiguration -> ShowS
[GetBucketNotificationConfiguration] -> ShowS
GetBucketNotificationConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetBucketNotificationConfiguration] -> ShowS
$cshowList :: [GetBucketNotificationConfiguration] -> ShowS
show :: GetBucketNotificationConfiguration -> String
$cshow :: GetBucketNotificationConfiguration -> String
showsPrec :: Int -> GetBucketNotificationConfiguration -> ShowS
$cshowsPrec :: Int -> GetBucketNotificationConfiguration -> ShowS
Prelude.Show, forall x.
Rep GetBucketNotificationConfiguration x
-> GetBucketNotificationConfiguration
forall x.
GetBucketNotificationConfiguration
-> Rep GetBucketNotificationConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetBucketNotificationConfiguration x
-> GetBucketNotificationConfiguration
$cfrom :: forall x.
GetBucketNotificationConfiguration
-> Rep GetBucketNotificationConfiguration x
Prelude.Generic)
newGetBucketNotificationConfiguration ::
BucketName ->
GetBucketNotificationConfiguration
newGetBucketNotificationConfiguration :: BucketName -> GetBucketNotificationConfiguration
newGetBucketNotificationConfiguration BucketName
pBucket_ =
GetBucketNotificationConfiguration'
{ $sel:expectedBucketOwner:GetBucketNotificationConfiguration' :: Maybe Text
expectedBucketOwner =
forall a. Maybe a
Prelude.Nothing,
$sel:bucket:GetBucketNotificationConfiguration' :: BucketName
bucket = BucketName
pBucket_
}
getBucketNotificationConfiguration_expectedBucketOwner :: Lens.Lens' GetBucketNotificationConfiguration (Prelude.Maybe Prelude.Text)
getBucketNotificationConfiguration_expectedBucketOwner :: Lens' GetBucketNotificationConfiguration (Maybe Text)
getBucketNotificationConfiguration_expectedBucketOwner = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBucketNotificationConfiguration' {Maybe Text
expectedBucketOwner :: Maybe Text
$sel:expectedBucketOwner:GetBucketNotificationConfiguration' :: GetBucketNotificationConfiguration -> Maybe Text
expectedBucketOwner} -> Maybe Text
expectedBucketOwner) (\s :: GetBucketNotificationConfiguration
s@GetBucketNotificationConfiguration' {} Maybe Text
a -> GetBucketNotificationConfiguration
s {$sel:expectedBucketOwner:GetBucketNotificationConfiguration' :: Maybe Text
expectedBucketOwner = Maybe Text
a} :: GetBucketNotificationConfiguration)
getBucketNotificationConfiguration_bucket :: Lens.Lens' GetBucketNotificationConfiguration BucketName
getBucketNotificationConfiguration_bucket :: Lens' GetBucketNotificationConfiguration BucketName
getBucketNotificationConfiguration_bucket = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBucketNotificationConfiguration' {BucketName
bucket :: BucketName
$sel:bucket:GetBucketNotificationConfiguration' :: GetBucketNotificationConfiguration -> BucketName
bucket} -> BucketName
bucket) (\s :: GetBucketNotificationConfiguration
s@GetBucketNotificationConfiguration' {} BucketName
a -> GetBucketNotificationConfiguration
s {$sel:bucket:GetBucketNotificationConfiguration' :: BucketName
bucket = BucketName
a} :: GetBucketNotificationConfiguration)
instance
Core.AWSRequest
GetBucketNotificationConfiguration
where
type
AWSResponse GetBucketNotificationConfiguration =
NotificationConfiguration
request :: (Service -> Service)
-> GetBucketNotificationConfiguration
-> Request GetBucketNotificationConfiguration
request Service -> Service
overrides =
forall a. Request a -> Request a
Request.s3vhost
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 GetBucketNotificationConfiguration
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse GetBucketNotificationConfiguration)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXML (\Int
s ResponseHeaders
h [Node]
x -> forall a. FromXML a => [Node] -> Either String a
Data.parseXML [Node]
x)
instance
Prelude.Hashable
GetBucketNotificationConfiguration
where
hashWithSalt :: Int -> GetBucketNotificationConfiguration -> Int
hashWithSalt
Int
_salt
GetBucketNotificationConfiguration' {Maybe Text
BucketName
bucket :: BucketName
expectedBucketOwner :: Maybe Text
$sel:bucket:GetBucketNotificationConfiguration' :: GetBucketNotificationConfiguration -> BucketName
$sel:expectedBucketOwner:GetBucketNotificationConfiguration' :: GetBucketNotificationConfiguration -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
expectedBucketOwner
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` BucketName
bucket
instance
Prelude.NFData
GetBucketNotificationConfiguration
where
rnf :: GetBucketNotificationConfiguration -> ()
rnf GetBucketNotificationConfiguration' {Maybe Text
BucketName
bucket :: BucketName
expectedBucketOwner :: Maybe Text
$sel:bucket:GetBucketNotificationConfiguration' :: GetBucketNotificationConfiguration -> BucketName
$sel:expectedBucketOwner:GetBucketNotificationConfiguration' :: GetBucketNotificationConfiguration -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
expectedBucketOwner
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf BucketName
bucket
instance
Data.ToHeaders
GetBucketNotificationConfiguration
where
toHeaders :: GetBucketNotificationConfiguration -> ResponseHeaders
toHeaders GetBucketNotificationConfiguration' {Maybe Text
BucketName
bucket :: BucketName
expectedBucketOwner :: Maybe Text
$sel:bucket:GetBucketNotificationConfiguration' :: GetBucketNotificationConfiguration -> BucketName
$sel:expectedBucketOwner:GetBucketNotificationConfiguration' :: GetBucketNotificationConfiguration -> Maybe Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"x-amz-expected-bucket-owner"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# Maybe Text
expectedBucketOwner
]
instance
Data.ToPath
GetBucketNotificationConfiguration
where
toPath :: GetBucketNotificationConfiguration -> ByteString
toPath GetBucketNotificationConfiguration' {Maybe Text
BucketName
bucket :: BucketName
expectedBucketOwner :: Maybe Text
$sel:bucket:GetBucketNotificationConfiguration' :: GetBucketNotificationConfiguration -> BucketName
$sel:expectedBucketOwner:GetBucketNotificationConfiguration' :: GetBucketNotificationConfiguration -> Maybe Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"/", forall a. ToByteString a => a -> ByteString
Data.toBS BucketName
bucket]
instance
Data.ToQuery
GetBucketNotificationConfiguration
where
toQuery :: GetBucketNotificationConfiguration -> QueryString
toQuery =
forall a b. a -> b -> a
Prelude.const (forall a. Monoid a => [a] -> a
Prelude.mconcat [QueryString
"notification"])