{-# 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.PutBucketNotificationConfiguration
(
PutBucketNotificationConfiguration (..),
newPutBucketNotificationConfiguration,
putBucketNotificationConfiguration_expectedBucketOwner,
putBucketNotificationConfiguration_bucket,
putBucketNotificationConfiguration_notificationConfiguration,
PutBucketNotificationConfigurationResponse (..),
newPutBucketNotificationConfigurationResponse,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.S3.Types
data PutBucketNotificationConfiguration = PutBucketNotificationConfiguration'
{
PutBucketNotificationConfiguration -> Maybe Text
expectedBucketOwner :: Prelude.Maybe Prelude.Text,
PutBucketNotificationConfiguration -> BucketName
bucket :: BucketName,
PutBucketNotificationConfiguration -> NotificationConfiguration
notificationConfiguration :: NotificationConfiguration
}
deriving (PutBucketNotificationConfiguration
-> PutBucketNotificationConfiguration -> Bool
(PutBucketNotificationConfiguration
-> PutBucketNotificationConfiguration -> Bool)
-> (PutBucketNotificationConfiguration
-> PutBucketNotificationConfiguration -> Bool)
-> Eq PutBucketNotificationConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutBucketNotificationConfiguration
-> PutBucketNotificationConfiguration -> Bool
$c/= :: PutBucketNotificationConfiguration
-> PutBucketNotificationConfiguration -> Bool
== :: PutBucketNotificationConfiguration
-> PutBucketNotificationConfiguration -> Bool
$c== :: PutBucketNotificationConfiguration
-> PutBucketNotificationConfiguration -> Bool
Prelude.Eq, ReadPrec [PutBucketNotificationConfiguration]
ReadPrec PutBucketNotificationConfiguration
Int -> ReadS PutBucketNotificationConfiguration
ReadS [PutBucketNotificationConfiguration]
(Int -> ReadS PutBucketNotificationConfiguration)
-> ReadS [PutBucketNotificationConfiguration]
-> ReadPrec PutBucketNotificationConfiguration
-> ReadPrec [PutBucketNotificationConfiguration]
-> Read PutBucketNotificationConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutBucketNotificationConfiguration]
$creadListPrec :: ReadPrec [PutBucketNotificationConfiguration]
readPrec :: ReadPrec PutBucketNotificationConfiguration
$creadPrec :: ReadPrec PutBucketNotificationConfiguration
readList :: ReadS [PutBucketNotificationConfiguration]
$creadList :: ReadS [PutBucketNotificationConfiguration]
readsPrec :: Int -> ReadS PutBucketNotificationConfiguration
$creadsPrec :: Int -> ReadS PutBucketNotificationConfiguration
Prelude.Read, Int -> PutBucketNotificationConfiguration -> ShowS
[PutBucketNotificationConfiguration] -> ShowS
PutBucketNotificationConfiguration -> String
(Int -> PutBucketNotificationConfiguration -> ShowS)
-> (PutBucketNotificationConfiguration -> String)
-> ([PutBucketNotificationConfiguration] -> ShowS)
-> Show PutBucketNotificationConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutBucketNotificationConfiguration] -> ShowS
$cshowList :: [PutBucketNotificationConfiguration] -> ShowS
show :: PutBucketNotificationConfiguration -> String
$cshow :: PutBucketNotificationConfiguration -> String
showsPrec :: Int -> PutBucketNotificationConfiguration -> ShowS
$cshowsPrec :: Int -> PutBucketNotificationConfiguration -> ShowS
Prelude.Show, (forall x.
PutBucketNotificationConfiguration
-> Rep PutBucketNotificationConfiguration x)
-> (forall x.
Rep PutBucketNotificationConfiguration x
-> PutBucketNotificationConfiguration)
-> Generic PutBucketNotificationConfiguration
forall x.
Rep PutBucketNotificationConfiguration x
-> PutBucketNotificationConfiguration
forall x.
PutBucketNotificationConfiguration
-> Rep PutBucketNotificationConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutBucketNotificationConfiguration x
-> PutBucketNotificationConfiguration
$cfrom :: forall x.
PutBucketNotificationConfiguration
-> Rep PutBucketNotificationConfiguration x
Prelude.Generic)
newPutBucketNotificationConfiguration ::
BucketName ->
NotificationConfiguration ->
PutBucketNotificationConfiguration
newPutBucketNotificationConfiguration :: BucketName
-> NotificationConfiguration -> PutBucketNotificationConfiguration
newPutBucketNotificationConfiguration
BucketName
pBucket_
NotificationConfiguration
pNotificationConfiguration_ =
PutBucketNotificationConfiguration' :: Maybe Text
-> BucketName
-> NotificationConfiguration
-> PutBucketNotificationConfiguration
PutBucketNotificationConfiguration'
{ $sel:expectedBucketOwner:PutBucketNotificationConfiguration' :: Maybe Text
expectedBucketOwner =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:bucket:PutBucketNotificationConfiguration' :: BucketName
bucket = BucketName
pBucket_,
$sel:notificationConfiguration:PutBucketNotificationConfiguration' :: NotificationConfiguration
notificationConfiguration =
NotificationConfiguration
pNotificationConfiguration_
}
putBucketNotificationConfiguration_expectedBucketOwner :: Lens.Lens' PutBucketNotificationConfiguration (Prelude.Maybe Prelude.Text)
putBucketNotificationConfiguration_expectedBucketOwner :: (Maybe Text -> f (Maybe Text))
-> PutBucketNotificationConfiguration
-> f PutBucketNotificationConfiguration
putBucketNotificationConfiguration_expectedBucketOwner = (PutBucketNotificationConfiguration -> Maybe Text)
-> (PutBucketNotificationConfiguration
-> Maybe Text -> PutBucketNotificationConfiguration)
-> Lens
PutBucketNotificationConfiguration
PutBucketNotificationConfiguration
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutBucketNotificationConfiguration' {Maybe Text
expectedBucketOwner :: Maybe Text
$sel:expectedBucketOwner:PutBucketNotificationConfiguration' :: PutBucketNotificationConfiguration -> Maybe Text
expectedBucketOwner} -> Maybe Text
expectedBucketOwner) (\s :: PutBucketNotificationConfiguration
s@PutBucketNotificationConfiguration' {} Maybe Text
a -> PutBucketNotificationConfiguration
s {$sel:expectedBucketOwner:PutBucketNotificationConfiguration' :: Maybe Text
expectedBucketOwner = Maybe Text
a} :: PutBucketNotificationConfiguration)
putBucketNotificationConfiguration_bucket :: Lens.Lens' PutBucketNotificationConfiguration BucketName
putBucketNotificationConfiguration_bucket :: (BucketName -> f BucketName)
-> PutBucketNotificationConfiguration
-> f PutBucketNotificationConfiguration
putBucketNotificationConfiguration_bucket = (PutBucketNotificationConfiguration -> BucketName)
-> (PutBucketNotificationConfiguration
-> BucketName -> PutBucketNotificationConfiguration)
-> Lens
PutBucketNotificationConfiguration
PutBucketNotificationConfiguration
BucketName
BucketName
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutBucketNotificationConfiguration' {BucketName
bucket :: BucketName
$sel:bucket:PutBucketNotificationConfiguration' :: PutBucketNotificationConfiguration -> BucketName
bucket} -> BucketName
bucket) (\s :: PutBucketNotificationConfiguration
s@PutBucketNotificationConfiguration' {} BucketName
a -> PutBucketNotificationConfiguration
s {$sel:bucket:PutBucketNotificationConfiguration' :: BucketName
bucket = BucketName
a} :: PutBucketNotificationConfiguration)
putBucketNotificationConfiguration_notificationConfiguration :: Lens.Lens' PutBucketNotificationConfiguration NotificationConfiguration
putBucketNotificationConfiguration_notificationConfiguration :: (NotificationConfiguration -> f NotificationConfiguration)
-> PutBucketNotificationConfiguration
-> f PutBucketNotificationConfiguration
putBucketNotificationConfiguration_notificationConfiguration = (PutBucketNotificationConfiguration -> NotificationConfiguration)
-> (PutBucketNotificationConfiguration
-> NotificationConfiguration -> PutBucketNotificationConfiguration)
-> Lens
PutBucketNotificationConfiguration
PutBucketNotificationConfiguration
NotificationConfiguration
NotificationConfiguration
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutBucketNotificationConfiguration' {NotificationConfiguration
notificationConfiguration :: NotificationConfiguration
$sel:notificationConfiguration:PutBucketNotificationConfiguration' :: PutBucketNotificationConfiguration -> NotificationConfiguration
notificationConfiguration} -> NotificationConfiguration
notificationConfiguration) (\s :: PutBucketNotificationConfiguration
s@PutBucketNotificationConfiguration' {} NotificationConfiguration
a -> PutBucketNotificationConfiguration
s {$sel:notificationConfiguration:PutBucketNotificationConfiguration' :: NotificationConfiguration
notificationConfiguration = NotificationConfiguration
a} :: PutBucketNotificationConfiguration)
instance
Core.AWSRequest
PutBucketNotificationConfiguration
where
type
AWSResponse PutBucketNotificationConfiguration =
PutBucketNotificationConfigurationResponse
request :: PutBucketNotificationConfiguration
-> Request PutBucketNotificationConfiguration
request =
Request PutBucketNotificationConfiguration
-> Request PutBucketNotificationConfiguration
forall a. Request a -> Request a
Request.s3vhost
(Request PutBucketNotificationConfiguration
-> Request PutBucketNotificationConfiguration)
-> (PutBucketNotificationConfiguration
-> Request PutBucketNotificationConfiguration)
-> PutBucketNotificationConfiguration
-> Request PutBucketNotificationConfiguration
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Service
-> PutBucketNotificationConfiguration
-> Request PutBucketNotificationConfiguration
forall a. (ToRequest a, ToElement a) => Service -> a -> Request a
Request.putXML Service
defaultService
response :: Logger
-> Service
-> Proxy PutBucketNotificationConfiguration
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse PutBucketNotificationConfiguration)))
response =
AWSResponse PutBucketNotificationConfiguration
-> Logger
-> Service
-> Proxy PutBucketNotificationConfiguration
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse PutBucketNotificationConfiguration)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
AWSResponse PutBucketNotificationConfiguration
PutBucketNotificationConfigurationResponse
PutBucketNotificationConfigurationResponse'
instance
Prelude.Hashable
PutBucketNotificationConfiguration
instance
Prelude.NFData
PutBucketNotificationConfiguration
instance
Core.ToElement
PutBucketNotificationConfiguration
where
toElement :: PutBucketNotificationConfiguration -> Element
toElement PutBucketNotificationConfiguration' {Maybe Text
BucketName
NotificationConfiguration
notificationConfiguration :: NotificationConfiguration
bucket :: BucketName
expectedBucketOwner :: Maybe Text
$sel:notificationConfiguration:PutBucketNotificationConfiguration' :: PutBucketNotificationConfiguration -> NotificationConfiguration
$sel:bucket:PutBucketNotificationConfiguration' :: PutBucketNotificationConfiguration -> BucketName
$sel:expectedBucketOwner:PutBucketNotificationConfiguration' :: PutBucketNotificationConfiguration -> Maybe Text
..} =
Name -> NotificationConfiguration -> Element
forall a. ToXML a => Name -> a -> Element
Core.mkElement
Name
"{http://s3.amazonaws.com/doc/2006-03-01/}NotificationConfiguration"
NotificationConfiguration
notificationConfiguration
instance
Core.ToHeaders
PutBucketNotificationConfiguration
where
toHeaders :: PutBucketNotificationConfiguration -> [Header]
toHeaders PutBucketNotificationConfiguration' {Maybe Text
BucketName
NotificationConfiguration
notificationConfiguration :: NotificationConfiguration
bucket :: BucketName
expectedBucketOwner :: Maybe Text
$sel:notificationConfiguration:PutBucketNotificationConfiguration' :: PutBucketNotificationConfiguration -> NotificationConfiguration
$sel:bucket:PutBucketNotificationConfiguration' :: PutBucketNotificationConfiguration -> BucketName
$sel:expectedBucketOwner:PutBucketNotificationConfiguration' :: PutBucketNotificationConfiguration -> Maybe Text
..} =
[[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"x-amz-expected-bucket-owner"
HeaderName -> Maybe Text -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# Maybe Text
expectedBucketOwner
]
instance
Core.ToPath
PutBucketNotificationConfiguration
where
toPath :: PutBucketNotificationConfiguration -> ByteString
toPath PutBucketNotificationConfiguration' {Maybe Text
BucketName
NotificationConfiguration
notificationConfiguration :: NotificationConfiguration
bucket :: BucketName
expectedBucketOwner :: Maybe Text
$sel:notificationConfiguration:PutBucketNotificationConfiguration' :: PutBucketNotificationConfiguration -> NotificationConfiguration
$sel:bucket:PutBucketNotificationConfiguration' :: PutBucketNotificationConfiguration -> BucketName
$sel:expectedBucketOwner:PutBucketNotificationConfiguration' :: PutBucketNotificationConfiguration -> Maybe Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"/", BucketName -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS BucketName
bucket]
instance
Core.ToQuery
PutBucketNotificationConfiguration
where
toQuery :: PutBucketNotificationConfiguration -> QueryString
toQuery =
QueryString -> PutBucketNotificationConfiguration -> QueryString
forall a b. a -> b -> a
Prelude.const ([QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat [QueryString
"notification"])
data PutBucketNotificationConfigurationResponse = PutBucketNotificationConfigurationResponse'
{
}
deriving (PutBucketNotificationConfigurationResponse
-> PutBucketNotificationConfigurationResponse -> Bool
(PutBucketNotificationConfigurationResponse
-> PutBucketNotificationConfigurationResponse -> Bool)
-> (PutBucketNotificationConfigurationResponse
-> PutBucketNotificationConfigurationResponse -> Bool)
-> Eq PutBucketNotificationConfigurationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutBucketNotificationConfigurationResponse
-> PutBucketNotificationConfigurationResponse -> Bool
$c/= :: PutBucketNotificationConfigurationResponse
-> PutBucketNotificationConfigurationResponse -> Bool
== :: PutBucketNotificationConfigurationResponse
-> PutBucketNotificationConfigurationResponse -> Bool
$c== :: PutBucketNotificationConfigurationResponse
-> PutBucketNotificationConfigurationResponse -> Bool
Prelude.Eq, ReadPrec [PutBucketNotificationConfigurationResponse]
ReadPrec PutBucketNotificationConfigurationResponse
Int -> ReadS PutBucketNotificationConfigurationResponse
ReadS [PutBucketNotificationConfigurationResponse]
(Int -> ReadS PutBucketNotificationConfigurationResponse)
-> ReadS [PutBucketNotificationConfigurationResponse]
-> ReadPrec PutBucketNotificationConfigurationResponse
-> ReadPrec [PutBucketNotificationConfigurationResponse]
-> Read PutBucketNotificationConfigurationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutBucketNotificationConfigurationResponse]
$creadListPrec :: ReadPrec [PutBucketNotificationConfigurationResponse]
readPrec :: ReadPrec PutBucketNotificationConfigurationResponse
$creadPrec :: ReadPrec PutBucketNotificationConfigurationResponse
readList :: ReadS [PutBucketNotificationConfigurationResponse]
$creadList :: ReadS [PutBucketNotificationConfigurationResponse]
readsPrec :: Int -> ReadS PutBucketNotificationConfigurationResponse
$creadsPrec :: Int -> ReadS PutBucketNotificationConfigurationResponse
Prelude.Read, Int -> PutBucketNotificationConfigurationResponse -> ShowS
[PutBucketNotificationConfigurationResponse] -> ShowS
PutBucketNotificationConfigurationResponse -> String
(Int -> PutBucketNotificationConfigurationResponse -> ShowS)
-> (PutBucketNotificationConfigurationResponse -> String)
-> ([PutBucketNotificationConfigurationResponse] -> ShowS)
-> Show PutBucketNotificationConfigurationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutBucketNotificationConfigurationResponse] -> ShowS
$cshowList :: [PutBucketNotificationConfigurationResponse] -> ShowS
show :: PutBucketNotificationConfigurationResponse -> String
$cshow :: PutBucketNotificationConfigurationResponse -> String
showsPrec :: Int -> PutBucketNotificationConfigurationResponse -> ShowS
$cshowsPrec :: Int -> PutBucketNotificationConfigurationResponse -> ShowS
Prelude.Show, (forall x.
PutBucketNotificationConfigurationResponse
-> Rep PutBucketNotificationConfigurationResponse x)
-> (forall x.
Rep PutBucketNotificationConfigurationResponse x
-> PutBucketNotificationConfigurationResponse)
-> Generic PutBucketNotificationConfigurationResponse
forall x.
Rep PutBucketNotificationConfigurationResponse x
-> PutBucketNotificationConfigurationResponse
forall x.
PutBucketNotificationConfigurationResponse
-> Rep PutBucketNotificationConfigurationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutBucketNotificationConfigurationResponse x
-> PutBucketNotificationConfigurationResponse
$cfrom :: forall x.
PutBucketNotificationConfigurationResponse
-> Rep PutBucketNotificationConfigurationResponse x
Prelude.Generic)
newPutBucketNotificationConfigurationResponse ::
PutBucketNotificationConfigurationResponse
newPutBucketNotificationConfigurationResponse :: PutBucketNotificationConfigurationResponse
newPutBucketNotificationConfigurationResponse =
PutBucketNotificationConfigurationResponse
PutBucketNotificationConfigurationResponse'
instance
Prelude.NFData
PutBucketNotificationConfigurationResponse