{-# 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.PutBucketLogging
(
PutBucketLogging (..),
newPutBucketLogging,
putBucketLogging_contentMD5,
putBucketLogging_expectedBucketOwner,
putBucketLogging_bucket,
putBucketLogging_bucketLoggingStatus,
PutBucketLoggingResponse (..),
newPutBucketLoggingResponse,
)
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 PutBucketLogging = PutBucketLogging'
{
PutBucketLogging -> Maybe Text
contentMD5 :: Prelude.Maybe Prelude.Text,
PutBucketLogging -> Maybe Text
expectedBucketOwner :: Prelude.Maybe Prelude.Text,
PutBucketLogging -> BucketName
bucket :: BucketName,
PutBucketLogging -> BucketLoggingStatus
bucketLoggingStatus :: BucketLoggingStatus
}
deriving (PutBucketLogging -> PutBucketLogging -> Bool
(PutBucketLogging -> PutBucketLogging -> Bool)
-> (PutBucketLogging -> PutBucketLogging -> Bool)
-> Eq PutBucketLogging
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutBucketLogging -> PutBucketLogging -> Bool
$c/= :: PutBucketLogging -> PutBucketLogging -> Bool
== :: PutBucketLogging -> PutBucketLogging -> Bool
$c== :: PutBucketLogging -> PutBucketLogging -> Bool
Prelude.Eq, ReadPrec [PutBucketLogging]
ReadPrec PutBucketLogging
Int -> ReadS PutBucketLogging
ReadS [PutBucketLogging]
(Int -> ReadS PutBucketLogging)
-> ReadS [PutBucketLogging]
-> ReadPrec PutBucketLogging
-> ReadPrec [PutBucketLogging]
-> Read PutBucketLogging
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutBucketLogging]
$creadListPrec :: ReadPrec [PutBucketLogging]
readPrec :: ReadPrec PutBucketLogging
$creadPrec :: ReadPrec PutBucketLogging
readList :: ReadS [PutBucketLogging]
$creadList :: ReadS [PutBucketLogging]
readsPrec :: Int -> ReadS PutBucketLogging
$creadsPrec :: Int -> ReadS PutBucketLogging
Prelude.Read, Int -> PutBucketLogging -> ShowS
[PutBucketLogging] -> ShowS
PutBucketLogging -> String
(Int -> PutBucketLogging -> ShowS)
-> (PutBucketLogging -> String)
-> ([PutBucketLogging] -> ShowS)
-> Show PutBucketLogging
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutBucketLogging] -> ShowS
$cshowList :: [PutBucketLogging] -> ShowS
show :: PutBucketLogging -> String
$cshow :: PutBucketLogging -> String
showsPrec :: Int -> PutBucketLogging -> ShowS
$cshowsPrec :: Int -> PutBucketLogging -> ShowS
Prelude.Show, (forall x. PutBucketLogging -> Rep PutBucketLogging x)
-> (forall x. Rep PutBucketLogging x -> PutBucketLogging)
-> Generic PutBucketLogging
forall x. Rep PutBucketLogging x -> PutBucketLogging
forall x. PutBucketLogging -> Rep PutBucketLogging x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutBucketLogging x -> PutBucketLogging
$cfrom :: forall x. PutBucketLogging -> Rep PutBucketLogging x
Prelude.Generic)
newPutBucketLogging ::
BucketName ->
BucketLoggingStatus ->
PutBucketLogging
newPutBucketLogging :: BucketName -> BucketLoggingStatus -> PutBucketLogging
newPutBucketLogging BucketName
pBucket_ BucketLoggingStatus
pBucketLoggingStatus_ =
PutBucketLogging' :: Maybe Text
-> Maybe Text
-> BucketName
-> BucketLoggingStatus
-> PutBucketLogging
PutBucketLogging'
{ $sel:contentMD5:PutBucketLogging' :: Maybe Text
contentMD5 = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:expectedBucketOwner:PutBucketLogging' :: Maybe Text
expectedBucketOwner = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:bucket:PutBucketLogging' :: BucketName
bucket = BucketName
pBucket_,
$sel:bucketLoggingStatus:PutBucketLogging' :: BucketLoggingStatus
bucketLoggingStatus = BucketLoggingStatus
pBucketLoggingStatus_
}
putBucketLogging_contentMD5 :: Lens.Lens' PutBucketLogging (Prelude.Maybe Prelude.Text)
putBucketLogging_contentMD5 :: (Maybe Text -> f (Maybe Text))
-> PutBucketLogging -> f PutBucketLogging
putBucketLogging_contentMD5 = (PutBucketLogging -> Maybe Text)
-> (PutBucketLogging -> Maybe Text -> PutBucketLogging)
-> Lens PutBucketLogging PutBucketLogging (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutBucketLogging' {Maybe Text
contentMD5 :: Maybe Text
$sel:contentMD5:PutBucketLogging' :: PutBucketLogging -> Maybe Text
contentMD5} -> Maybe Text
contentMD5) (\s :: PutBucketLogging
s@PutBucketLogging' {} Maybe Text
a -> PutBucketLogging
s {$sel:contentMD5:PutBucketLogging' :: Maybe Text
contentMD5 = Maybe Text
a} :: PutBucketLogging)
putBucketLogging_expectedBucketOwner :: Lens.Lens' PutBucketLogging (Prelude.Maybe Prelude.Text)
putBucketLogging_expectedBucketOwner :: (Maybe Text -> f (Maybe Text))
-> PutBucketLogging -> f PutBucketLogging
putBucketLogging_expectedBucketOwner = (PutBucketLogging -> Maybe Text)
-> (PutBucketLogging -> Maybe Text -> PutBucketLogging)
-> Lens PutBucketLogging PutBucketLogging (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutBucketLogging' {Maybe Text
expectedBucketOwner :: Maybe Text
$sel:expectedBucketOwner:PutBucketLogging' :: PutBucketLogging -> Maybe Text
expectedBucketOwner} -> Maybe Text
expectedBucketOwner) (\s :: PutBucketLogging
s@PutBucketLogging' {} Maybe Text
a -> PutBucketLogging
s {$sel:expectedBucketOwner:PutBucketLogging' :: Maybe Text
expectedBucketOwner = Maybe Text
a} :: PutBucketLogging)
putBucketLogging_bucket :: Lens.Lens' PutBucketLogging BucketName
putBucketLogging_bucket :: (BucketName -> f BucketName)
-> PutBucketLogging -> f PutBucketLogging
putBucketLogging_bucket = (PutBucketLogging -> BucketName)
-> (PutBucketLogging -> BucketName -> PutBucketLogging)
-> Lens PutBucketLogging PutBucketLogging BucketName BucketName
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutBucketLogging' {BucketName
bucket :: BucketName
$sel:bucket:PutBucketLogging' :: PutBucketLogging -> BucketName
bucket} -> BucketName
bucket) (\s :: PutBucketLogging
s@PutBucketLogging' {} BucketName
a -> PutBucketLogging
s {$sel:bucket:PutBucketLogging' :: BucketName
bucket = BucketName
a} :: PutBucketLogging)
putBucketLogging_bucketLoggingStatus :: Lens.Lens' PutBucketLogging BucketLoggingStatus
putBucketLogging_bucketLoggingStatus :: (BucketLoggingStatus -> f BucketLoggingStatus)
-> PutBucketLogging -> f PutBucketLogging
putBucketLogging_bucketLoggingStatus = (PutBucketLogging -> BucketLoggingStatus)
-> (PutBucketLogging -> BucketLoggingStatus -> PutBucketLogging)
-> Lens
PutBucketLogging
PutBucketLogging
BucketLoggingStatus
BucketLoggingStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutBucketLogging' {BucketLoggingStatus
bucketLoggingStatus :: BucketLoggingStatus
$sel:bucketLoggingStatus:PutBucketLogging' :: PutBucketLogging -> BucketLoggingStatus
bucketLoggingStatus} -> BucketLoggingStatus
bucketLoggingStatus) (\s :: PutBucketLogging
s@PutBucketLogging' {} BucketLoggingStatus
a -> PutBucketLogging
s {$sel:bucketLoggingStatus:PutBucketLogging' :: BucketLoggingStatus
bucketLoggingStatus = BucketLoggingStatus
a} :: PutBucketLogging)
instance Core.AWSRequest PutBucketLogging where
type
AWSResponse PutBucketLogging =
PutBucketLoggingResponse
request :: PutBucketLogging -> Request PutBucketLogging
request =
Request PutBucketLogging -> Request PutBucketLogging
forall a. Request a -> Request a
Request.s3vhost
(Request PutBucketLogging -> Request PutBucketLogging)
-> (PutBucketLogging -> Request PutBucketLogging)
-> PutBucketLogging
-> Request PutBucketLogging
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Service -> PutBucketLogging -> Request PutBucketLogging
forall a. (ToRequest a, ToElement a) => Service -> a -> Request a
Request.putXML Service
defaultService
response :: Logger
-> Service
-> Proxy PutBucketLogging
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse PutBucketLogging)))
response =
AWSResponse PutBucketLogging
-> Logger
-> Service
-> Proxy PutBucketLogging
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse PutBucketLogging)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse PutBucketLogging
PutBucketLoggingResponse
PutBucketLoggingResponse'
instance Prelude.Hashable PutBucketLogging
instance Prelude.NFData PutBucketLogging
instance Core.ToElement PutBucketLogging where
toElement :: PutBucketLogging -> Element
toElement PutBucketLogging' {Maybe Text
BucketName
BucketLoggingStatus
bucketLoggingStatus :: BucketLoggingStatus
bucket :: BucketName
expectedBucketOwner :: Maybe Text
contentMD5 :: Maybe Text
$sel:bucketLoggingStatus:PutBucketLogging' :: PutBucketLogging -> BucketLoggingStatus
$sel:bucket:PutBucketLogging' :: PutBucketLogging -> BucketName
$sel:expectedBucketOwner:PutBucketLogging' :: PutBucketLogging -> Maybe Text
$sel:contentMD5:PutBucketLogging' :: PutBucketLogging -> Maybe Text
..} =
Name -> BucketLoggingStatus -> Element
forall a. ToXML a => Name -> a -> Element
Core.mkElement
Name
"{http://s3.amazonaws.com/doc/2006-03-01/}BucketLoggingStatus"
BucketLoggingStatus
bucketLoggingStatus
instance Core.ToHeaders PutBucketLogging where
toHeaders :: PutBucketLogging -> [Header]
toHeaders PutBucketLogging' {Maybe Text
BucketName
BucketLoggingStatus
bucketLoggingStatus :: BucketLoggingStatus
bucket :: BucketName
expectedBucketOwner :: Maybe Text
contentMD5 :: Maybe Text
$sel:bucketLoggingStatus:PutBucketLogging' :: PutBucketLogging -> BucketLoggingStatus
$sel:bucket:PutBucketLogging' :: PutBucketLogging -> BucketName
$sel:expectedBucketOwner:PutBucketLogging' :: PutBucketLogging -> Maybe Text
$sel:contentMD5:PutBucketLogging' :: PutBucketLogging -> Maybe Text
..} =
[[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-MD5" HeaderName -> Maybe Text -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# Maybe Text
contentMD5,
HeaderName
"x-amz-expected-bucket-owner"
HeaderName -> Maybe Text -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# Maybe Text
expectedBucketOwner
]
instance Core.ToPath PutBucketLogging where
toPath :: PutBucketLogging -> ByteString
toPath PutBucketLogging' {Maybe Text
BucketName
BucketLoggingStatus
bucketLoggingStatus :: BucketLoggingStatus
bucket :: BucketName
expectedBucketOwner :: Maybe Text
contentMD5 :: Maybe Text
$sel:bucketLoggingStatus:PutBucketLogging' :: PutBucketLogging -> BucketLoggingStatus
$sel:bucket:PutBucketLogging' :: PutBucketLogging -> BucketName
$sel:expectedBucketOwner:PutBucketLogging' :: PutBucketLogging -> Maybe Text
$sel:contentMD5:PutBucketLogging' :: PutBucketLogging -> 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 PutBucketLogging where
toQuery :: PutBucketLogging -> QueryString
toQuery = QueryString -> PutBucketLogging -> QueryString
forall a b. a -> b -> a
Prelude.const ([QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat [QueryString
"logging"])
data PutBucketLoggingResponse = PutBucketLoggingResponse'
{
}
deriving (PutBucketLoggingResponse -> PutBucketLoggingResponse -> Bool
(PutBucketLoggingResponse -> PutBucketLoggingResponse -> Bool)
-> (PutBucketLoggingResponse -> PutBucketLoggingResponse -> Bool)
-> Eq PutBucketLoggingResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutBucketLoggingResponse -> PutBucketLoggingResponse -> Bool
$c/= :: PutBucketLoggingResponse -> PutBucketLoggingResponse -> Bool
== :: PutBucketLoggingResponse -> PutBucketLoggingResponse -> Bool
$c== :: PutBucketLoggingResponse -> PutBucketLoggingResponse -> Bool
Prelude.Eq, ReadPrec [PutBucketLoggingResponse]
ReadPrec PutBucketLoggingResponse
Int -> ReadS PutBucketLoggingResponse
ReadS [PutBucketLoggingResponse]
(Int -> ReadS PutBucketLoggingResponse)
-> ReadS [PutBucketLoggingResponse]
-> ReadPrec PutBucketLoggingResponse
-> ReadPrec [PutBucketLoggingResponse]
-> Read PutBucketLoggingResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutBucketLoggingResponse]
$creadListPrec :: ReadPrec [PutBucketLoggingResponse]
readPrec :: ReadPrec PutBucketLoggingResponse
$creadPrec :: ReadPrec PutBucketLoggingResponse
readList :: ReadS [PutBucketLoggingResponse]
$creadList :: ReadS [PutBucketLoggingResponse]
readsPrec :: Int -> ReadS PutBucketLoggingResponse
$creadsPrec :: Int -> ReadS PutBucketLoggingResponse
Prelude.Read, Int -> PutBucketLoggingResponse -> ShowS
[PutBucketLoggingResponse] -> ShowS
PutBucketLoggingResponse -> String
(Int -> PutBucketLoggingResponse -> ShowS)
-> (PutBucketLoggingResponse -> String)
-> ([PutBucketLoggingResponse] -> ShowS)
-> Show PutBucketLoggingResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutBucketLoggingResponse] -> ShowS
$cshowList :: [PutBucketLoggingResponse] -> ShowS
show :: PutBucketLoggingResponse -> String
$cshow :: PutBucketLoggingResponse -> String
showsPrec :: Int -> PutBucketLoggingResponse -> ShowS
$cshowsPrec :: Int -> PutBucketLoggingResponse -> ShowS
Prelude.Show, (forall x.
PutBucketLoggingResponse -> Rep PutBucketLoggingResponse x)
-> (forall x.
Rep PutBucketLoggingResponse x -> PutBucketLoggingResponse)
-> Generic PutBucketLoggingResponse
forall x.
Rep PutBucketLoggingResponse x -> PutBucketLoggingResponse
forall x.
PutBucketLoggingResponse -> Rep PutBucketLoggingResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutBucketLoggingResponse x -> PutBucketLoggingResponse
$cfrom :: forall x.
PutBucketLoggingResponse -> Rep PutBucketLoggingResponse x
Prelude.Generic)
newPutBucketLoggingResponse ::
PutBucketLoggingResponse
newPutBucketLoggingResponse :: PutBucketLoggingResponse
newPutBucketLoggingResponse =
PutBucketLoggingResponse
PutBucketLoggingResponse'
instance Prelude.NFData PutBucketLoggingResponse