{-# 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.PutBucketLifecycleConfiguration
(
PutBucketLifecycleConfiguration (..),
newPutBucketLifecycleConfiguration,
putBucketLifecycleConfiguration_lifecycleConfiguration,
putBucketLifecycleConfiguration_expectedBucketOwner,
putBucketLifecycleConfiguration_bucket,
PutBucketLifecycleConfigurationResponse (..),
newPutBucketLifecycleConfigurationResponse,
)
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 PutBucketLifecycleConfiguration = PutBucketLifecycleConfiguration'
{
PutBucketLifecycleConfiguration
-> Maybe BucketLifecycleConfiguration
lifecycleConfiguration :: Prelude.Maybe BucketLifecycleConfiguration,
PutBucketLifecycleConfiguration -> Maybe Text
expectedBucketOwner :: Prelude.Maybe Prelude.Text,
PutBucketLifecycleConfiguration -> BucketName
bucket :: BucketName
}
deriving (PutBucketLifecycleConfiguration
-> PutBucketLifecycleConfiguration -> Bool
(PutBucketLifecycleConfiguration
-> PutBucketLifecycleConfiguration -> Bool)
-> (PutBucketLifecycleConfiguration
-> PutBucketLifecycleConfiguration -> Bool)
-> Eq PutBucketLifecycleConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutBucketLifecycleConfiguration
-> PutBucketLifecycleConfiguration -> Bool
$c/= :: PutBucketLifecycleConfiguration
-> PutBucketLifecycleConfiguration -> Bool
== :: PutBucketLifecycleConfiguration
-> PutBucketLifecycleConfiguration -> Bool
$c== :: PutBucketLifecycleConfiguration
-> PutBucketLifecycleConfiguration -> Bool
Prelude.Eq, ReadPrec [PutBucketLifecycleConfiguration]
ReadPrec PutBucketLifecycleConfiguration
Int -> ReadS PutBucketLifecycleConfiguration
ReadS [PutBucketLifecycleConfiguration]
(Int -> ReadS PutBucketLifecycleConfiguration)
-> ReadS [PutBucketLifecycleConfiguration]
-> ReadPrec PutBucketLifecycleConfiguration
-> ReadPrec [PutBucketLifecycleConfiguration]
-> Read PutBucketLifecycleConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutBucketLifecycleConfiguration]
$creadListPrec :: ReadPrec [PutBucketLifecycleConfiguration]
readPrec :: ReadPrec PutBucketLifecycleConfiguration
$creadPrec :: ReadPrec PutBucketLifecycleConfiguration
readList :: ReadS [PutBucketLifecycleConfiguration]
$creadList :: ReadS [PutBucketLifecycleConfiguration]
readsPrec :: Int -> ReadS PutBucketLifecycleConfiguration
$creadsPrec :: Int -> ReadS PutBucketLifecycleConfiguration
Prelude.Read, Int -> PutBucketLifecycleConfiguration -> ShowS
[PutBucketLifecycleConfiguration] -> ShowS
PutBucketLifecycleConfiguration -> String
(Int -> PutBucketLifecycleConfiguration -> ShowS)
-> (PutBucketLifecycleConfiguration -> String)
-> ([PutBucketLifecycleConfiguration] -> ShowS)
-> Show PutBucketLifecycleConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutBucketLifecycleConfiguration] -> ShowS
$cshowList :: [PutBucketLifecycleConfiguration] -> ShowS
show :: PutBucketLifecycleConfiguration -> String
$cshow :: PutBucketLifecycleConfiguration -> String
showsPrec :: Int -> PutBucketLifecycleConfiguration -> ShowS
$cshowsPrec :: Int -> PutBucketLifecycleConfiguration -> ShowS
Prelude.Show, (forall x.
PutBucketLifecycleConfiguration
-> Rep PutBucketLifecycleConfiguration x)
-> (forall x.
Rep PutBucketLifecycleConfiguration x
-> PutBucketLifecycleConfiguration)
-> Generic PutBucketLifecycleConfiguration
forall x.
Rep PutBucketLifecycleConfiguration x
-> PutBucketLifecycleConfiguration
forall x.
PutBucketLifecycleConfiguration
-> Rep PutBucketLifecycleConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutBucketLifecycleConfiguration x
-> PutBucketLifecycleConfiguration
$cfrom :: forall x.
PutBucketLifecycleConfiguration
-> Rep PutBucketLifecycleConfiguration x
Prelude.Generic)
newPutBucketLifecycleConfiguration ::
BucketName ->
PutBucketLifecycleConfiguration
newPutBucketLifecycleConfiguration :: BucketName -> PutBucketLifecycleConfiguration
newPutBucketLifecycleConfiguration BucketName
pBucket_ =
PutBucketLifecycleConfiguration' :: Maybe BucketLifecycleConfiguration
-> Maybe Text -> BucketName -> PutBucketLifecycleConfiguration
PutBucketLifecycleConfiguration'
{ $sel:lifecycleConfiguration:PutBucketLifecycleConfiguration' :: Maybe BucketLifecycleConfiguration
lifecycleConfiguration =
Maybe BucketLifecycleConfiguration
forall a. Maybe a
Prelude.Nothing,
$sel:expectedBucketOwner:PutBucketLifecycleConfiguration' :: Maybe Text
expectedBucketOwner = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:bucket:PutBucketLifecycleConfiguration' :: BucketName
bucket = BucketName
pBucket_
}
putBucketLifecycleConfiguration_lifecycleConfiguration :: Lens.Lens' PutBucketLifecycleConfiguration (Prelude.Maybe BucketLifecycleConfiguration)
putBucketLifecycleConfiguration_lifecycleConfiguration :: (Maybe BucketLifecycleConfiguration
-> f (Maybe BucketLifecycleConfiguration))
-> PutBucketLifecycleConfiguration
-> f PutBucketLifecycleConfiguration
putBucketLifecycleConfiguration_lifecycleConfiguration = (PutBucketLifecycleConfiguration
-> Maybe BucketLifecycleConfiguration)
-> (PutBucketLifecycleConfiguration
-> Maybe BucketLifecycleConfiguration
-> PutBucketLifecycleConfiguration)
-> Lens
PutBucketLifecycleConfiguration
PutBucketLifecycleConfiguration
(Maybe BucketLifecycleConfiguration)
(Maybe BucketLifecycleConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutBucketLifecycleConfiguration' {Maybe BucketLifecycleConfiguration
lifecycleConfiguration :: Maybe BucketLifecycleConfiguration
$sel:lifecycleConfiguration:PutBucketLifecycleConfiguration' :: PutBucketLifecycleConfiguration
-> Maybe BucketLifecycleConfiguration
lifecycleConfiguration} -> Maybe BucketLifecycleConfiguration
lifecycleConfiguration) (\s :: PutBucketLifecycleConfiguration
s@PutBucketLifecycleConfiguration' {} Maybe BucketLifecycleConfiguration
a -> PutBucketLifecycleConfiguration
s {$sel:lifecycleConfiguration:PutBucketLifecycleConfiguration' :: Maybe BucketLifecycleConfiguration
lifecycleConfiguration = Maybe BucketLifecycleConfiguration
a} :: PutBucketLifecycleConfiguration)
putBucketLifecycleConfiguration_expectedBucketOwner :: Lens.Lens' PutBucketLifecycleConfiguration (Prelude.Maybe Prelude.Text)
putBucketLifecycleConfiguration_expectedBucketOwner :: (Maybe Text -> f (Maybe Text))
-> PutBucketLifecycleConfiguration
-> f PutBucketLifecycleConfiguration
putBucketLifecycleConfiguration_expectedBucketOwner = (PutBucketLifecycleConfiguration -> Maybe Text)
-> (PutBucketLifecycleConfiguration
-> Maybe Text -> PutBucketLifecycleConfiguration)
-> Lens
PutBucketLifecycleConfiguration
PutBucketLifecycleConfiguration
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutBucketLifecycleConfiguration' {Maybe Text
expectedBucketOwner :: Maybe Text
$sel:expectedBucketOwner:PutBucketLifecycleConfiguration' :: PutBucketLifecycleConfiguration -> Maybe Text
expectedBucketOwner} -> Maybe Text
expectedBucketOwner) (\s :: PutBucketLifecycleConfiguration
s@PutBucketLifecycleConfiguration' {} Maybe Text
a -> PutBucketLifecycleConfiguration
s {$sel:expectedBucketOwner:PutBucketLifecycleConfiguration' :: Maybe Text
expectedBucketOwner = Maybe Text
a} :: PutBucketLifecycleConfiguration)
putBucketLifecycleConfiguration_bucket :: Lens.Lens' PutBucketLifecycleConfiguration BucketName
putBucketLifecycleConfiguration_bucket :: (BucketName -> f BucketName)
-> PutBucketLifecycleConfiguration
-> f PutBucketLifecycleConfiguration
putBucketLifecycleConfiguration_bucket = (PutBucketLifecycleConfiguration -> BucketName)
-> (PutBucketLifecycleConfiguration
-> BucketName -> PutBucketLifecycleConfiguration)
-> Lens
PutBucketLifecycleConfiguration
PutBucketLifecycleConfiguration
BucketName
BucketName
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutBucketLifecycleConfiguration' {BucketName
bucket :: BucketName
$sel:bucket:PutBucketLifecycleConfiguration' :: PutBucketLifecycleConfiguration -> BucketName
bucket} -> BucketName
bucket) (\s :: PutBucketLifecycleConfiguration
s@PutBucketLifecycleConfiguration' {} BucketName
a -> PutBucketLifecycleConfiguration
s {$sel:bucket:PutBucketLifecycleConfiguration' :: BucketName
bucket = BucketName
a} :: PutBucketLifecycleConfiguration)
instance
Core.AWSRequest
PutBucketLifecycleConfiguration
where
type
AWSResponse PutBucketLifecycleConfiguration =
PutBucketLifecycleConfigurationResponse
request :: PutBucketLifecycleConfiguration
-> Request PutBucketLifecycleConfiguration
request =
Request PutBucketLifecycleConfiguration
-> Request PutBucketLifecycleConfiguration
forall a. Request a -> Request a
Request.contentMD5Header
(Request PutBucketLifecycleConfiguration
-> Request PutBucketLifecycleConfiguration)
-> (PutBucketLifecycleConfiguration
-> Request PutBucketLifecycleConfiguration)
-> PutBucketLifecycleConfiguration
-> Request PutBucketLifecycleConfiguration
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Request PutBucketLifecycleConfiguration
-> Request PutBucketLifecycleConfiguration
forall a. Request a -> Request a
Request.s3vhost
(Request PutBucketLifecycleConfiguration
-> Request PutBucketLifecycleConfiguration)
-> (PutBucketLifecycleConfiguration
-> Request PutBucketLifecycleConfiguration)
-> PutBucketLifecycleConfiguration
-> Request PutBucketLifecycleConfiguration
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Service
-> PutBucketLifecycleConfiguration
-> Request PutBucketLifecycleConfiguration
forall a. (ToRequest a, ToElement a) => Service -> a -> Request a
Request.putXML Service
defaultService
response :: Logger
-> Service
-> Proxy PutBucketLifecycleConfiguration
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse PutBucketLifecycleConfiguration)))
response =
AWSResponse PutBucketLifecycleConfiguration
-> Logger
-> Service
-> Proxy PutBucketLifecycleConfiguration
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse PutBucketLifecycleConfiguration)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
AWSResponse PutBucketLifecycleConfiguration
PutBucketLifecycleConfigurationResponse
PutBucketLifecycleConfigurationResponse'
instance
Prelude.Hashable
PutBucketLifecycleConfiguration
instance
Prelude.NFData
PutBucketLifecycleConfiguration
instance
Core.ToElement
PutBucketLifecycleConfiguration
where
toElement :: PutBucketLifecycleConfiguration -> Element
toElement PutBucketLifecycleConfiguration' {Maybe Text
Maybe BucketLifecycleConfiguration
BucketName
bucket :: BucketName
expectedBucketOwner :: Maybe Text
lifecycleConfiguration :: Maybe BucketLifecycleConfiguration
$sel:bucket:PutBucketLifecycleConfiguration' :: PutBucketLifecycleConfiguration -> BucketName
$sel:expectedBucketOwner:PutBucketLifecycleConfiguration' :: PutBucketLifecycleConfiguration -> Maybe Text
$sel:lifecycleConfiguration:PutBucketLifecycleConfiguration' :: PutBucketLifecycleConfiguration
-> Maybe BucketLifecycleConfiguration
..} =
Name -> Maybe BucketLifecycleConfiguration -> Element
forall a. ToXML a => Name -> a -> Element
Core.mkElement
Name
"{http://s3.amazonaws.com/doc/2006-03-01/}LifecycleConfiguration"
Maybe BucketLifecycleConfiguration
lifecycleConfiguration
instance
Core.ToHeaders
PutBucketLifecycleConfiguration
where
toHeaders :: PutBucketLifecycleConfiguration -> [Header]
toHeaders PutBucketLifecycleConfiguration' {Maybe Text
Maybe BucketLifecycleConfiguration
BucketName
bucket :: BucketName
expectedBucketOwner :: Maybe Text
lifecycleConfiguration :: Maybe BucketLifecycleConfiguration
$sel:bucket:PutBucketLifecycleConfiguration' :: PutBucketLifecycleConfiguration -> BucketName
$sel:expectedBucketOwner:PutBucketLifecycleConfiguration' :: PutBucketLifecycleConfiguration -> Maybe Text
$sel:lifecycleConfiguration:PutBucketLifecycleConfiguration' :: PutBucketLifecycleConfiguration
-> Maybe BucketLifecycleConfiguration
..} =
[[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 PutBucketLifecycleConfiguration where
toPath :: PutBucketLifecycleConfiguration -> ByteString
toPath PutBucketLifecycleConfiguration' {Maybe Text
Maybe BucketLifecycleConfiguration
BucketName
bucket :: BucketName
expectedBucketOwner :: Maybe Text
lifecycleConfiguration :: Maybe BucketLifecycleConfiguration
$sel:bucket:PutBucketLifecycleConfiguration' :: PutBucketLifecycleConfiguration -> BucketName
$sel:expectedBucketOwner:PutBucketLifecycleConfiguration' :: PutBucketLifecycleConfiguration -> Maybe Text
$sel:lifecycleConfiguration:PutBucketLifecycleConfiguration' :: PutBucketLifecycleConfiguration
-> Maybe BucketLifecycleConfiguration
..} =
[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 PutBucketLifecycleConfiguration where
toQuery :: PutBucketLifecycleConfiguration -> QueryString
toQuery =
QueryString -> PutBucketLifecycleConfiguration -> QueryString
forall a b. a -> b -> a
Prelude.const ([QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat [QueryString
"lifecycle"])
data PutBucketLifecycleConfigurationResponse = PutBucketLifecycleConfigurationResponse'
{
}
deriving (PutBucketLifecycleConfigurationResponse
-> PutBucketLifecycleConfigurationResponse -> Bool
(PutBucketLifecycleConfigurationResponse
-> PutBucketLifecycleConfigurationResponse -> Bool)
-> (PutBucketLifecycleConfigurationResponse
-> PutBucketLifecycleConfigurationResponse -> Bool)
-> Eq PutBucketLifecycleConfigurationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutBucketLifecycleConfigurationResponse
-> PutBucketLifecycleConfigurationResponse -> Bool
$c/= :: PutBucketLifecycleConfigurationResponse
-> PutBucketLifecycleConfigurationResponse -> Bool
== :: PutBucketLifecycleConfigurationResponse
-> PutBucketLifecycleConfigurationResponse -> Bool
$c== :: PutBucketLifecycleConfigurationResponse
-> PutBucketLifecycleConfigurationResponse -> Bool
Prelude.Eq, ReadPrec [PutBucketLifecycleConfigurationResponse]
ReadPrec PutBucketLifecycleConfigurationResponse
Int -> ReadS PutBucketLifecycleConfigurationResponse
ReadS [PutBucketLifecycleConfigurationResponse]
(Int -> ReadS PutBucketLifecycleConfigurationResponse)
-> ReadS [PutBucketLifecycleConfigurationResponse]
-> ReadPrec PutBucketLifecycleConfigurationResponse
-> ReadPrec [PutBucketLifecycleConfigurationResponse]
-> Read PutBucketLifecycleConfigurationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutBucketLifecycleConfigurationResponse]
$creadListPrec :: ReadPrec [PutBucketLifecycleConfigurationResponse]
readPrec :: ReadPrec PutBucketLifecycleConfigurationResponse
$creadPrec :: ReadPrec PutBucketLifecycleConfigurationResponse
readList :: ReadS [PutBucketLifecycleConfigurationResponse]
$creadList :: ReadS [PutBucketLifecycleConfigurationResponse]
readsPrec :: Int -> ReadS PutBucketLifecycleConfigurationResponse
$creadsPrec :: Int -> ReadS PutBucketLifecycleConfigurationResponse
Prelude.Read, Int -> PutBucketLifecycleConfigurationResponse -> ShowS
[PutBucketLifecycleConfigurationResponse] -> ShowS
PutBucketLifecycleConfigurationResponse -> String
(Int -> PutBucketLifecycleConfigurationResponse -> ShowS)
-> (PutBucketLifecycleConfigurationResponse -> String)
-> ([PutBucketLifecycleConfigurationResponse] -> ShowS)
-> Show PutBucketLifecycleConfigurationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutBucketLifecycleConfigurationResponse] -> ShowS
$cshowList :: [PutBucketLifecycleConfigurationResponse] -> ShowS
show :: PutBucketLifecycleConfigurationResponse -> String
$cshow :: PutBucketLifecycleConfigurationResponse -> String
showsPrec :: Int -> PutBucketLifecycleConfigurationResponse -> ShowS
$cshowsPrec :: Int -> PutBucketLifecycleConfigurationResponse -> ShowS
Prelude.Show, (forall x.
PutBucketLifecycleConfigurationResponse
-> Rep PutBucketLifecycleConfigurationResponse x)
-> (forall x.
Rep PutBucketLifecycleConfigurationResponse x
-> PutBucketLifecycleConfigurationResponse)
-> Generic PutBucketLifecycleConfigurationResponse
forall x.
Rep PutBucketLifecycleConfigurationResponse x
-> PutBucketLifecycleConfigurationResponse
forall x.
PutBucketLifecycleConfigurationResponse
-> Rep PutBucketLifecycleConfigurationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutBucketLifecycleConfigurationResponse x
-> PutBucketLifecycleConfigurationResponse
$cfrom :: forall x.
PutBucketLifecycleConfigurationResponse
-> Rep PutBucketLifecycleConfigurationResponse x
Prelude.Generic)
newPutBucketLifecycleConfigurationResponse ::
PutBucketLifecycleConfigurationResponse
newPutBucketLifecycleConfigurationResponse :: PutBucketLifecycleConfigurationResponse
newPutBucketLifecycleConfigurationResponse =
PutBucketLifecycleConfigurationResponse
PutBucketLifecycleConfigurationResponse'
instance
Prelude.NFData
PutBucketLifecycleConfigurationResponse