{-# 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.DeleteBucketLifecycle
(
DeleteBucketLifecycle (..),
newDeleteBucketLifecycle,
deleteBucketLifecycle_expectedBucketOwner,
deleteBucketLifecycle_bucket,
DeleteBucketLifecycleResponse (..),
newDeleteBucketLifecycleResponse,
)
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 DeleteBucketLifecycle = DeleteBucketLifecycle'
{
DeleteBucketLifecycle -> Maybe Text
expectedBucketOwner :: Prelude.Maybe Prelude.Text,
DeleteBucketLifecycle -> BucketName
bucket :: BucketName
}
deriving (DeleteBucketLifecycle -> DeleteBucketLifecycle -> Bool
(DeleteBucketLifecycle -> DeleteBucketLifecycle -> Bool)
-> (DeleteBucketLifecycle -> DeleteBucketLifecycle -> Bool)
-> Eq DeleteBucketLifecycle
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteBucketLifecycle -> DeleteBucketLifecycle -> Bool
$c/= :: DeleteBucketLifecycle -> DeleteBucketLifecycle -> Bool
== :: DeleteBucketLifecycle -> DeleteBucketLifecycle -> Bool
$c== :: DeleteBucketLifecycle -> DeleteBucketLifecycle -> Bool
Prelude.Eq, ReadPrec [DeleteBucketLifecycle]
ReadPrec DeleteBucketLifecycle
Int -> ReadS DeleteBucketLifecycle
ReadS [DeleteBucketLifecycle]
(Int -> ReadS DeleteBucketLifecycle)
-> ReadS [DeleteBucketLifecycle]
-> ReadPrec DeleteBucketLifecycle
-> ReadPrec [DeleteBucketLifecycle]
-> Read DeleteBucketLifecycle
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteBucketLifecycle]
$creadListPrec :: ReadPrec [DeleteBucketLifecycle]
readPrec :: ReadPrec DeleteBucketLifecycle
$creadPrec :: ReadPrec DeleteBucketLifecycle
readList :: ReadS [DeleteBucketLifecycle]
$creadList :: ReadS [DeleteBucketLifecycle]
readsPrec :: Int -> ReadS DeleteBucketLifecycle
$creadsPrec :: Int -> ReadS DeleteBucketLifecycle
Prelude.Read, Int -> DeleteBucketLifecycle -> ShowS
[DeleteBucketLifecycle] -> ShowS
DeleteBucketLifecycle -> String
(Int -> DeleteBucketLifecycle -> ShowS)
-> (DeleteBucketLifecycle -> String)
-> ([DeleteBucketLifecycle] -> ShowS)
-> Show DeleteBucketLifecycle
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteBucketLifecycle] -> ShowS
$cshowList :: [DeleteBucketLifecycle] -> ShowS
show :: DeleteBucketLifecycle -> String
$cshow :: DeleteBucketLifecycle -> String
showsPrec :: Int -> DeleteBucketLifecycle -> ShowS
$cshowsPrec :: Int -> DeleteBucketLifecycle -> ShowS
Prelude.Show, (forall x. DeleteBucketLifecycle -> Rep DeleteBucketLifecycle x)
-> (forall x. Rep DeleteBucketLifecycle x -> DeleteBucketLifecycle)
-> Generic DeleteBucketLifecycle
forall x. Rep DeleteBucketLifecycle x -> DeleteBucketLifecycle
forall x. DeleteBucketLifecycle -> Rep DeleteBucketLifecycle x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteBucketLifecycle x -> DeleteBucketLifecycle
$cfrom :: forall x. DeleteBucketLifecycle -> Rep DeleteBucketLifecycle x
Prelude.Generic)
newDeleteBucketLifecycle ::
BucketName ->
DeleteBucketLifecycle
newDeleteBucketLifecycle :: BucketName -> DeleteBucketLifecycle
newDeleteBucketLifecycle BucketName
pBucket_ =
DeleteBucketLifecycle' :: Maybe Text -> BucketName -> DeleteBucketLifecycle
DeleteBucketLifecycle'
{ $sel:expectedBucketOwner:DeleteBucketLifecycle' :: Maybe Text
expectedBucketOwner =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:bucket:DeleteBucketLifecycle' :: BucketName
bucket = BucketName
pBucket_
}
deleteBucketLifecycle_expectedBucketOwner :: Lens.Lens' DeleteBucketLifecycle (Prelude.Maybe Prelude.Text)
deleteBucketLifecycle_expectedBucketOwner :: (Maybe Text -> f (Maybe Text))
-> DeleteBucketLifecycle -> f DeleteBucketLifecycle
deleteBucketLifecycle_expectedBucketOwner = (DeleteBucketLifecycle -> Maybe Text)
-> (DeleteBucketLifecycle -> Maybe Text -> DeleteBucketLifecycle)
-> Lens
DeleteBucketLifecycle
DeleteBucketLifecycle
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteBucketLifecycle' {Maybe Text
expectedBucketOwner :: Maybe Text
$sel:expectedBucketOwner:DeleteBucketLifecycle' :: DeleteBucketLifecycle -> Maybe Text
expectedBucketOwner} -> Maybe Text
expectedBucketOwner) (\s :: DeleteBucketLifecycle
s@DeleteBucketLifecycle' {} Maybe Text
a -> DeleteBucketLifecycle
s {$sel:expectedBucketOwner:DeleteBucketLifecycle' :: Maybe Text
expectedBucketOwner = Maybe Text
a} :: DeleteBucketLifecycle)
deleteBucketLifecycle_bucket :: Lens.Lens' DeleteBucketLifecycle BucketName
deleteBucketLifecycle_bucket :: (BucketName -> f BucketName)
-> DeleteBucketLifecycle -> f DeleteBucketLifecycle
deleteBucketLifecycle_bucket = (DeleteBucketLifecycle -> BucketName)
-> (DeleteBucketLifecycle -> BucketName -> DeleteBucketLifecycle)
-> Lens
DeleteBucketLifecycle DeleteBucketLifecycle BucketName BucketName
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteBucketLifecycle' {BucketName
bucket :: BucketName
$sel:bucket:DeleteBucketLifecycle' :: DeleteBucketLifecycle -> BucketName
bucket} -> BucketName
bucket) (\s :: DeleteBucketLifecycle
s@DeleteBucketLifecycle' {} BucketName
a -> DeleteBucketLifecycle
s {$sel:bucket:DeleteBucketLifecycle' :: BucketName
bucket = BucketName
a} :: DeleteBucketLifecycle)
instance Core.AWSRequest DeleteBucketLifecycle where
type
AWSResponse DeleteBucketLifecycle =
DeleteBucketLifecycleResponse
request :: DeleteBucketLifecycle -> Request DeleteBucketLifecycle
request =
Request DeleteBucketLifecycle -> Request DeleteBucketLifecycle
forall a. Request a -> Request a
Request.s3vhost
(Request DeleteBucketLifecycle -> Request DeleteBucketLifecycle)
-> (DeleteBucketLifecycle -> Request DeleteBucketLifecycle)
-> DeleteBucketLifecycle
-> Request DeleteBucketLifecycle
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Service -> DeleteBucketLifecycle -> Request DeleteBucketLifecycle
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteBucketLifecycle
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteBucketLifecycle)))
response =
AWSResponse DeleteBucketLifecycle
-> Logger
-> Service
-> Proxy DeleteBucketLifecycle
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteBucketLifecycle)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse DeleteBucketLifecycle
DeleteBucketLifecycleResponse
DeleteBucketLifecycleResponse'
instance Prelude.Hashable DeleteBucketLifecycle
instance Prelude.NFData DeleteBucketLifecycle
instance Core.ToHeaders DeleteBucketLifecycle where
toHeaders :: DeleteBucketLifecycle -> [Header]
toHeaders DeleteBucketLifecycle' {Maybe Text
BucketName
bucket :: BucketName
expectedBucketOwner :: Maybe Text
$sel:bucket:DeleteBucketLifecycle' :: DeleteBucketLifecycle -> BucketName
$sel:expectedBucketOwner:DeleteBucketLifecycle' :: DeleteBucketLifecycle -> 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 DeleteBucketLifecycle where
toPath :: DeleteBucketLifecycle -> ByteString
toPath DeleteBucketLifecycle' {Maybe Text
BucketName
bucket :: BucketName
expectedBucketOwner :: Maybe Text
$sel:bucket:DeleteBucketLifecycle' :: DeleteBucketLifecycle -> BucketName
$sel:expectedBucketOwner:DeleteBucketLifecycle' :: DeleteBucketLifecycle -> 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 DeleteBucketLifecycle where
toQuery :: DeleteBucketLifecycle -> QueryString
toQuery =
QueryString -> DeleteBucketLifecycle -> QueryString
forall a b. a -> b -> a
Prelude.const ([QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat [QueryString
"lifecycle"])
data DeleteBucketLifecycleResponse = DeleteBucketLifecycleResponse'
{
}
deriving (DeleteBucketLifecycleResponse
-> DeleteBucketLifecycleResponse -> Bool
(DeleteBucketLifecycleResponse
-> DeleteBucketLifecycleResponse -> Bool)
-> (DeleteBucketLifecycleResponse
-> DeleteBucketLifecycleResponse -> Bool)
-> Eq DeleteBucketLifecycleResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteBucketLifecycleResponse
-> DeleteBucketLifecycleResponse -> Bool
$c/= :: DeleteBucketLifecycleResponse
-> DeleteBucketLifecycleResponse -> Bool
== :: DeleteBucketLifecycleResponse
-> DeleteBucketLifecycleResponse -> Bool
$c== :: DeleteBucketLifecycleResponse
-> DeleteBucketLifecycleResponse -> Bool
Prelude.Eq, ReadPrec [DeleteBucketLifecycleResponse]
ReadPrec DeleteBucketLifecycleResponse
Int -> ReadS DeleteBucketLifecycleResponse
ReadS [DeleteBucketLifecycleResponse]
(Int -> ReadS DeleteBucketLifecycleResponse)
-> ReadS [DeleteBucketLifecycleResponse]
-> ReadPrec DeleteBucketLifecycleResponse
-> ReadPrec [DeleteBucketLifecycleResponse]
-> Read DeleteBucketLifecycleResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteBucketLifecycleResponse]
$creadListPrec :: ReadPrec [DeleteBucketLifecycleResponse]
readPrec :: ReadPrec DeleteBucketLifecycleResponse
$creadPrec :: ReadPrec DeleteBucketLifecycleResponse
readList :: ReadS [DeleteBucketLifecycleResponse]
$creadList :: ReadS [DeleteBucketLifecycleResponse]
readsPrec :: Int -> ReadS DeleteBucketLifecycleResponse
$creadsPrec :: Int -> ReadS DeleteBucketLifecycleResponse
Prelude.Read, Int -> DeleteBucketLifecycleResponse -> ShowS
[DeleteBucketLifecycleResponse] -> ShowS
DeleteBucketLifecycleResponse -> String
(Int -> DeleteBucketLifecycleResponse -> ShowS)
-> (DeleteBucketLifecycleResponse -> String)
-> ([DeleteBucketLifecycleResponse] -> ShowS)
-> Show DeleteBucketLifecycleResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteBucketLifecycleResponse] -> ShowS
$cshowList :: [DeleteBucketLifecycleResponse] -> ShowS
show :: DeleteBucketLifecycleResponse -> String
$cshow :: DeleteBucketLifecycleResponse -> String
showsPrec :: Int -> DeleteBucketLifecycleResponse -> ShowS
$cshowsPrec :: Int -> DeleteBucketLifecycleResponse -> ShowS
Prelude.Show, (forall x.
DeleteBucketLifecycleResponse
-> Rep DeleteBucketLifecycleResponse x)
-> (forall x.
Rep DeleteBucketLifecycleResponse x
-> DeleteBucketLifecycleResponse)
-> Generic DeleteBucketLifecycleResponse
forall x.
Rep DeleteBucketLifecycleResponse x
-> DeleteBucketLifecycleResponse
forall x.
DeleteBucketLifecycleResponse
-> Rep DeleteBucketLifecycleResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteBucketLifecycleResponse x
-> DeleteBucketLifecycleResponse
$cfrom :: forall x.
DeleteBucketLifecycleResponse
-> Rep DeleteBucketLifecycleResponse x
Prelude.Generic)
newDeleteBucketLifecycleResponse ::
DeleteBucketLifecycleResponse
newDeleteBucketLifecycleResponse :: DeleteBucketLifecycleResponse
newDeleteBucketLifecycleResponse =
DeleteBucketLifecycleResponse
DeleteBucketLifecycleResponse'
instance Prelude.NFData DeleteBucketLifecycleResponse